Updated on 2024-01-04 GMT+08:00

Querying the Metadata List

Function

Query the metadata list.

URI

GET /v2/{project_id}/graphs/metadatas

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

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

Table 2 Query parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Maximum number of resources displayed on a single page. The default value is 10.

offset

No

Integer

Start position of the request. The default value is 0.

Request Parameters

Table 3 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It is used to obtain the permission to call APIs. For details about how to obtain the token, see Authentication. The value of X-Subject-Token in the response header is the token.

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

schema_count

Integer

Number of returned metadata files. This parameter is left blank when the request fails.

schema_list

Array of schema_list objects

List of all metadata files under the current project ID. This parameter is left blank when the request fails.

Table 5 schema_list

Parameter

Type

Description

id

String

Metadata ID

name

String

Metadata name

start_time

String

Metadata creation time

last_update_time

String

Last update time of the metadata

encrypted

Boolean

Whether metadata is encrypted

description

String

Metadata description

metadata_path

String

Metadata path

status

String

Whether the metadata is available

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

System prompt code.

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

error_msg

String

System prompt code.

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

Example Request

Query the metadata list.

GET https://Endpoint/v2/{project_id}/graphs/metadatas?offset=0&limit=2

Example Response

Status code: 200

Example response for a successful request

{
  "schema_count" : 2,
  "schema_list" : [ {
    "start_time" : "2022-01-21T10:13:31",
    "last_update_time" : "2022-01-21T10:13:31",
    "encrypted" : true,
    "name" : "schema_748e",
    "master_key_id" : "106be30a-733d-45d0-84f3-1c5439381313",
    "description" : "xxxxx",
    "id" : "6634c50e-13aa-4395-8088-6b327f7da694",
    "metadata_path" : "devdata/schema_748e.xml",
    "status" : "200"
  }, {
    "start_time" : "2022-04-12T03:15:17",
    "last_update_time" : "2022-11-16T08:18:32",
    "encrypted" : false,
    "name" : "unionsdk_schema",
    "id" : "6b74069d-3cf3-4cc0-9118-2478e23b87aa",
    "metadata_path" : "devdata/unionsdk/unionsdk_schema.xml",
    "status" : "200"
  } ]
}

Status code: 500

Example response for a failed request

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

Status Code

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

Error Code

See Error Code.