Updated on 2022-10-27 GMT+08:00

Query task information

Function

This API is used to query the execution status of the current task based on the task ID returned by the SSH key pair API.

URI

GET /v3/{project_id}/tasks/{task_id}

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID.

task_id

Yes

String

Task ID.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token. The token can be obtained by calling the IAM API (value of X-Subject-Token in the response header).

Response Parameters

Status code: 200

Table 3 Response body parameters

Parameter

Type

Description

server_id

String

Tenant VM ID.

task_id

String

ID returned when a task is successfully delivered.

task_status

String

Key pair processing state. It can be:

  • READY_RESET: Preparing for resetting the key pair.

  • RUNNING_RESET: Resetting the key pair.

  • FAILED_RESET: Reset failed.

  • SUCCESS_RESET: Reset succeeded.

  • READY_REPLACE: Preparing for replacing the key pair.

  • RUNNING_REPLACE: Replacing the key pair.

  • FAILED_RESET: Replacement failed.

  • SUCCESS_RESET: Replacement succeeded.

  • READY_UNBIND: Preparing for unbinding the key pair.

  • RUNNING_UNBIND: Unbinding the key pair.

  • FAILED_UNBIND: Unbinding failed.

  • SUCCESS_UNBIND: Unbinding succeeded.

Status code: 400

Table 4 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Requests

None

Example Responses

Status code: 200

OK.

{
  "task_id" : "aee8d2fe-5484-4753-9177-5a38dc15546c",
  "task_status" : "RUNNING_RESET",
  "server_id" : "c9aa197b-a6b6-4c33-b3a6-fa0b4ec50006"
}

Status code: 400

Error occurred.

{
  "error_code" : "KPS.XXX",
  "error_msg" : "XXX"
}

Status Codes

Status Code

Description

200

OK.

400

Error occurred.

Error Codes

See Error Codes.