Help Center/ Graph Engine Service/ API Reference/ Management Plane APIs (V2)/ Backup Management/ Obtaining a Download Link for Backup Files (2.4.3)
Updated on 2024-07-26 GMT+08:00

Obtaining a Download Link for Backup Files (2.4.3)

Function

This API is used to obtain a download link for backup files. Within the validity period of 3,600 seconds, you can directly download the backup file through the URL.

URI

GET /v2/{project_id}/graphs/{graph_id}/backup-files?backup_id={backup_id}

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID. For how to obtain the project ID, see Obtaining a Project ID.

graph_id

Yes

String

Graph ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

backup_id

Yes

String

Backup ID. For how to obtain the backup ID, see Viewing the Backup List of a Graph (1.0.0).

X-Auth-Token

Yes

String

User token

Used to obtain the permission to use APIs. For how to obtain the token, see Authentication. (The token is the value of X-Subject-Token in the response header.)

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

bucket

String

Name of the bucket where the file is

files

Array of objects

List of backup files. For details, see Table 4.

Table 4 files field data structure description

Parameter

Type

Description

name

String

File name

size

Long

File size, in KB

download_link

String

File download link

NOTE:

The way a browser opens a link depends on the type of backup file.

For instance, text files can be directly viewed in the browser, while binary files will automatically download to the local host when opened in the browser. To download all backup files, you are advised to use an HTTP library in a programming language such as Java's HttpClient or Python's Requests.

link_expired_time

String

Link expiration time, in yyyy-mm-ddThh:mm:ssZ format.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

System prompt

  • If the execution succeeds, this parameter may be left blank.
  • If the execution fails, this parameter is used to display the error code.

error_msg

String

System prompt

  • If the execution succeeds, this parameter may be left blank.
  • If the execution fails, this parameter is used to display the error message.

Example Request

Obtain the backup download link.

GET https:/Endpoint/v2/{project_id}/graphs/{graph_id}/backup-files?backup_id=22aa0177-b20b-4f3a-8556-8147d6658ed8

Example Response

Status code: 200

Example response for a successful request

{
  "bucket": "string",
  "files": [
    {
      "name": "43e4feaab48f11e89039fa163ebaa7e4br01.xxx",
      "size": 2803,
      "download_link": "https://obs.domainname.com/rdsbucket.username.1/xxxxxx",
      "link_expired_time": "2018-08-016T10:15:14+0800"
    }
  ]
}

Status code: 400

Example response for a failed request

{
  "error_code": "GES.7006",
  "error_msg": "The underlying graph engine has internal error."
}

Status Codes

Return Value

Description

400 Bad Request

Request error.

401 Unauthorized

Authorization failed.

403 Forbidden

No operation permissions.

404 Not Found

No resources found.

500 Internal Server Error

Internal server error.

503 Service Unavailable

Service unavailable.