执行算法
功能介绍
根据输入参数,执行指定算法。
URI
|
参数 |
是否必选 |
类型 |
说明 |
|---|---|---|---|
|
project_id |
是 |
String |
项目ID。获取方法请参见获取项目ID。 |
|
graph_name |
是 |
String |
图名称。 |
请求参数
Body参数说明详见算法公共参数表。
响应参数
|
参数 |
类型 |
说明 |
|---|---|---|
|
errorMessage |
String |
系统提示信息。
|
|
errorCode |
String |
系统提示信息。
|
|
jobId |
String |
执行算法任务ID。请求失败时,该字段为空。
说明:
可以查询jobId查看任务执行状态、获取返回结果,详情参考Job管理API。 |
请求示例
执行指定算法,算法名字为shortest_path,路径的起点ID为145,路径的终点ID为10,考虑边的方向。
POST http://{SERVER_URL}/ges/v1.0/{project_id}/graphs/{graph_name}/action?action_id=execute-algorithm
{
"algorithmName": "shortest_path",
"parameters": {
"source": "145",
"target": "10",
"directed":true
},
"executionMode": "sync"
}
响应示例
状态码: 200
成功响应示例
Http Status Code: 200
{
"jobId": "4448c9fb-0b16-4a78-8d89-2a137c53454a001679122",
"jobType": 1
}
状态码:400
失败响应示例
Http Status Code: 400
{
"errorMessage": "Graph [854d9316e71d4dc599c5f27ea323d445-ges_fdb1234] does not exist, please check projectId and graphName.",
"errorCode": "GES.8000",
"result": "failed"
}
状态码
|
返回值 |
说明 |
|---|---|
|
400 Bad Request |
请求错误。 |
|
401 Unauthorized |
鉴权失败。 |
|
403 Forbidden |
没有操作权限。 |
|
404 Not Found |
找不到资源。 |
|
500 Internal Server Error |
服务内部错误。 |
|
503 Service Unavailable |
服务不可用。 |
错误码
请参见错误码。
