Updated on 2025-12-25 GMT+08:00

Listing Metadata Files (1.0.2)

Function

This API is used to list metadata files.

URI

GET /v2/{project_id}/graphs/metadatas

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Definition

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

Constraints

N/A

Range

The value can contain up to 64 characters. Only letters and digits are allowed.

Default Value

N/A

Table 2 Query parameters

Parameter

Mandatory

Type

Description

limit

No

Integer

Definition

Maximum number of resources per page.

Constraints

N/A

Range

The value can contain up to 64 characters. Only letters and digits are allowed.

Default Value

10

offset

No

Integer

Definition

Starting position of the request.

Constraints

N/A

Range

The value can contain up to 64 characters. Only letters and digits are allowed.

Default Value

0

Request Parameters

Table 3 Request header parameter

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

Definition

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

Constraints

N/A

Range

N/A

Default Value

N/A

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

schema_count

Integer

Definition

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

Range

N/A

schema_list

Array of schema_list objects

Definition

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

Range

N/A

Table 5 schema_list

Parameter

Type

Description

id

String

Definition

Metadata file ID.

Range

N/A

name

String

Definition

Metadata file name.

Range

N/A

start_time

String

Definition

Metadata file creation time.

Range

N/A

last_update_time

String

Definition

Time when a metadata file was last updated.

Range

N/A

description

String

Definition

Metadata file description.

Range

N/A

metadata_path

String

Definition

Metadata file path.

Range

N/A

status

String

Definition

Whether the metadata file is available.

Range

N/A

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Definition

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.

Range

N/A

error_msg

String

Definition

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.

Range

N/A

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",
    "name" : "schema_748e",
    "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",
    "name" : "unionsdk_schema",
    "id" : "6b74069d-3cf3-4cc0-9118-2478e23b87aa",
    "metadata_path" : "devdata/unionsdk/unionsdk_schema.xml",
    "status" : "200"
  } ]
}

Status code: 400

Example response for a failed request

{
 "error_code" : "GES.7006",
 "error_msg" : "An internal error occurs in the underlying service of the graph engine."
}

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.