Executing DSL Algorithms
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 the syntax introduction in DSL Syntax.
URI
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID, which is used for resource isolation. For how to obtain a project ID, 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.
|
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
{ "data":{ "vertices":[ { "id":"1", "label":"movie", "properties":{ "genres":[ "Comedy" ], "movieid":[ 1 ], "title":[ "Airplane! (1980)" ] } } ], "runtime":0.126476598 } }
Status code: 400
{ "errorCode":"GES.8814", "errorMessage":"Unsupported API." }
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. |
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