Executing the DSL Algorithm
Function
This API is used to provide flexible and controllable DSLs to help users design and run algorithms at low costs. For details about the DSL algorithm, see DSL Syntax.
After the DSL algorithm is executed, you need to use the "Dumping HyG Algorithm Results" API to dump the DSL execution results to OBS.
URI
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID, which is used for resource isolation. For details about how to obtain the value, see Obtaining a Project ID. |
graph_name |
Yes |
String |
Graph name |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
commands |
Yes |
String |
Command executed by the custom operation. For details about the syntax, see the syntax introduction. |
Response Parameters
Parameter |
Type |
Description |
---|---|---|
errorMessage |
String |
System prompt
|
errorCode |
String |
System prompt code
|
data |
Object |
Query results. This parameter is left blank when the query fails. |
Example Request
POST/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=algorithm-query { "commands":"Match<Vertex> v(['1']); v.repeat(bothV()).limit(2); return v;" }
Example Response
- Example response for a successful request
OK
{ "data":{ "vertices":[ { "id":"1", "label":"movie", "properties":{ "genres":[ "Comedy" ], "movieid":[ 1 ], "title":[ "Airplane! (1980)" ] } } ], "runtime":0.126476598 } }
- Example response for a failed request
{ "errorCode":"GES.8814", "errorMessage":"Unsupported API." }
Return Value
- Normal
- Abnormal
Table 4 Description 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.
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