Querying Path Details
Function
This API is used to query the path details. All possible paths will be listed.
URI
- URI format
POST /ges/v1.0/{project_id}/graphs/{graph_name}/paths/action?action_id=query-detail
- Parameter description
Table 1 URI parameter description Parameter
Mandatory
Type
Description
project_id
Yes
String
Project ID, which is used for resource isolation. For details, see Obtaining a Project ID.
graph_name
Yes
String
Graph name
Request
- Request example
post http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/paths/action?action_id=query-detail { "paths":[ [ "Ray", "Lethal Weapon", "Alice" ] ], "directed":false }
SERVER_URL: Address for accessing a graph. For details about its value, see Constraints of Using Service Plane APIs.
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
paths |
Yes |
List |
Set of paths to be queried |
directed |
No |
Boolean |
Whether the querying path is directional or non-directional: true: directional false: non-directional default=false |
Response
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
errorMessage |
No |
String |
System prompt.
|
errorCode |
No |
String |
System prompt.
|
data |
No |
Json |
Query results. This parameter is left blank when the query fails. |
Parameter |
Type |
Description |
---|---|---|
outputs |
Json |
Query results containing the paths |
paths |
List |
Collection of paths that contain detailed vertex and edge information, in JSONArray format
NOTE:
In the returned paths:
|
- Response example (successful request)
Http Status Code: 200 { "data": { "outputs":{ "paths":[ [ { "id":"Ray", "label":"user", "properties":{ "Name":["Ray"], "Gender":["M"], "Age":["18-24"], "Occupation":["college/grad student"], "Zip-code":["90241"] } }, { "edges":[ { "source":"Ray", "target":"Lethal Weapon", "index":"1", "label":"rate", "properties":{ "Score":[2], "Datetime":["2000-11-22 19:16:16"] } } ] }, { "id":"Alice", "label":"user", "properties":{ "Name":["Alice"], "Gender":["F"], "Age":["25-34"], "Occupation":["academic/educator"], "Zip-code":["79928"] } } ] ] } } }
- Response example (failed request)
Http Status Code: 400 { "errorMessage":"graph [demo] is not found", "errorCode":"GES.8107" }
Return Value
- Normal
- Abnormal
Table 5 Return code for failed requests Return Value
Description
400 Bad Request
Request error.
401 Unauthorized
Authentication failed.
403 Forbidden
No operation permission.
404 Not Found
The requested resource was not found.
500 Internal Server Error
Internal service error.
503 Service Unavailable
Service unavailable.
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