Task API
7.1 Task
7.1.1 List all async tasks in graph
Params
- status: the status of asyncTasks, one of NEW, SCHEDULING, SCHEDULED, QUEUED, RESTORING, RUNNING, SUCCESS, CANCELLING, CANCELLED, FAILED, HANGING, DELETING, case-insensitive
- ids: task ids to query, can be repeated. It can not be combined with
statusorpage, and it ignoreslimit. - limit: the max number of tasks to return, default is 100
- page: page token for pagination. When it is passed, the response carries a
pagefield with the token of the next page.
Method & Url
Response Status
Response Body
7.1.2 View the details of an async task
Params
- with_result: whether to load the result of the task, default is true
Method & Url
Response Status
Response Body
7.1.3 Delete task information of an async task,won’t delete the task itself
Params
- force: whether to delete the task even when it is still running, default is false
Method & Url
Response Status
7.1.4 Cancel an async task, the task should be able to be canceled
If you already created an async task via Gremlin API as follows:
Method & Url
cancel it in 10s. if more than 10s, the task may already be finished, then can’t be cancelled.
Response Status
Cancelling a task that is already completed or already cancelling returns 400.
Response Body
The whole task object is returned, with task_status set to cancelling or cancelled:
At this point, the number of vertices whose label is man must be less than 10.
7.2 Algorithm Job
Schedules an OLAP algorithm as an asynchronous task inside the server. The task id in the response can be followed with the Task API above.
Params
Path parameters
- graphspace: Graphspace name
- graph: Graph name
- name: Algorithm name. The registered algorithms are
count_vertex,count_edge,degree_centrality,stress_centrality,betweenness_centrality,closeness_centrality,eigenvector_centrality,triangle_count,cluster_coefficient,lpa,louvain,weak_connected_component,fusiform_similarity,rings,k_core,page_rankandsubgraph_stat. An unknown name returns404.
Method & Url
Request Body
The body is the parameter map of the algorithm, and each algorithm validates its own parameters. Pass {} to run with the defaults.
Response Status
Response Body
7.3 Computer Job
Schedules a HugeGraph-Computer job as an asynchronous task. The computer job runs outside the server, see HugeGraph-Computer.
Params
Path parameters
- graphspace: Graphspace name
- graph: Graph name
- name: Computer name. The registered computers are
page_rank,weak_connected_component,lpa,triangle_countandlouvain. An unknown name returns404.
Method & Url
Request Body
The body is the parameter map of the computer job. Pass {} to run with the defaults.