Querying a Metadata File (1.0.2)
Function
This API is used to query a metadata file.
URI
GET /v2/{project_id}/graphs/metadatas/{metadata_id}
|
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 |
|
metadata_id |
Yes |
String |
Definition Metadata file ID. Constraints N/A Range N/A Default Value N/A |
Request Parameters
|
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
|
Parameter |
Type |
Description |
|---|---|---|
|
master_key_name |
String |
Definition Key name. Range N/A |
|
master_key_id |
String |
Definition Key ID. Range N/A |
|
ges_metadata |
ges_metadata object |
Definition Object that stores message information for metadata. Range N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
labels |
Array of labels objects |
Definition A collection of the Label data structure. Range N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
name |
String |
Definition Label name. Range N/A |
|
properties |
Array of Map<String,String> objects |
Definition Property map. Range N/A |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition System prompt.
Range N/A |
|
error_msg |
String |
Definition System prompt.
Range N/A |
Example Request
Query metadata of a graph.
GET https://{Endpoint}/v2/{project_id}/graphs/metadatas/{metadata_id}
Example Response
Status code: 200
Example response for a successful request
{
"ges_metadata" : {
"labels" : [ {
"name" : "friends"
}, {
"name" : "movie",
"properties" : [ {
"data_type" : "string",
"name" : "ChineseTitle",
"cardinality" : "single"
}, {
"data_type" : "int",
"name" : "Year",
"cardinality" : "single"
}, {
"data_type" : "string",
"name" : "Genres",
"cardinality" : "set"
} ]
}, {
"name" : "user",
"properties" : [ {
"data_type" : "string",
"name" : "ChineseName",
"cardinality" : "single"
}, {
"type_name1" : "F",
"type_name2" : "M",
"data_type" : "enum",
"name" : "Gender",
"type_name_count" : "2",
"cardinality" : "single"
}, {
"type_name1" : "Under 18",
"type_name2" : "18-24",
"type_name3" : "25-34",
"type_name4" : "35-44",
"type_name5" : "45-49",
"type_name6" : "50-55",
"type_name7" : "56+",
"data_type" : "enum",
"name" : "Age",
"type_name_count" : "7",
"cardinality" : "single"
}, {
"data_type" : "string",
"name" : "Occupation",
"cardinality" : "single"
}, {
"data_type" : "char array",
"name" : "Zip-code",
"max_data_size" : "12",
"cardinality" : "single"
} ]
}, {
"name" : "rate",
"properties" : [ {
"data_type" : "int",
"name" : "Score",
"cardinality" : "single"
}, {
"data_type" : "date",
"name" : "Datetime",
"cardinality" : "single"
} ]
} ]
}
}
Status code: 400
Example response for a failed request
{
"error_msg" : "6b74069d-3cf3-4cc0-9118-2478e23b87a does not exist.",
"error_code" : "GES.2067"
}
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. |
Error Codes
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot