Updated on 2024-09-11 GMT+08:00

Obtaining Instant Tasks

Function

This API is used to obtain the instant tasks. Before calling this API:

URI

GET /v3/{project_id}/immediate-jobs

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

Table 2 Query parameters

Parameter

Mandatory

Type

Description

status

No

String

Task execution status. Values:

  • Running: The task is being executed.
  • Completed: The task is successfully executed.
  • Failed: The task failed to be executed.
  • Pending: The task is not executed.

job_name

No

String

Task name.

  • CreateGaussDBforMySQLInstance: Creating a DB instance
  • RestoreGaussDBforMySQLNewInstance: Restoring data to a new DB instance
  • AddGaussDBforMySQLNodes: Adding a node
  • DeleteGaussDBforMySQLNode: Deleting a node
  • RebootGaussDBforMySQLInstance: Rebooting a DB instance
  • ModifyGaussDBforMySQLPort: Changing a database port
  • ModifyGaussDBforMySQLSecurityGroup: Changing a security group
  • ResizeGaussDBforMySQLFlavor: Changing instance specifications
  • SwitchoverGaussDBforMySQLMasterNode: Promoting a read replica to the primary node
  • GaussDBforMySQLBindEIP: Binding an EIP
  • GaussDBforMySQLUnbindEIP: Unbinding an EIP
  • RenameGaussDBforMySQLInstance: Changing a DB instance name
  • DeleteGaussDBforMySQLInstance: Deleting a DB instance
  • UpgradeGaussDBforMySQLDatabaseVersion: Upgrading version
  • EnlargeGaussDBforMySQLProxy: Adding nodes for a proxy instance
  • OpenGaussDBforMySQLProxy: Creating a proxy instance
  • CloseGaussDBforMySQLProxy: Deleting a proxy instance
  • GaussdbforMySQLModifyProxyIp: Changing the IP address of a proxy instance
  • ScaleGaussDBforMySQLProxy: Changing the node specifications of a proxy instance
  • GaussDBforMySQLModifyInstanceMetricExtend: Enabling or disabling Monitoring by Seconds
  • GaussDBforMySQLModifyInstanceDataVip: Changing the private IP address
  • GaussDBforMySQLSwitchSSL: Enabling or disabling SSL
  • GaussDBforMySQLModifyProxyConsist: Changing the proxy consistency
  • GaussDBforMySQLModifyProxyWeight: Changing the read weights of nodes

job_id

No

String

Task ID.

offset

No

String

Index offset. The query starts from the first piece of data. The default value is 1. The value must be a number and cannot be a negative number.

limit

No

String

Number of records to be queried. Value: 10 (default value), 20, or 50.

start_time

No

String

Start time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.

end_time

No

String

End time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.

Request Parameters

Table 3 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

It can be obtained by calling the IAM API used to obtain a user token.

The value of X-Subject-Token in the response header is the token value.

X-Language

No

String

Request language type. The default value is en-us.

Values:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 4 Response body parameters

Parameter

Type

Description

jobs

Array of TaskDetailInfo objects

Task details.

total_count

Integer

Total number of tasks.

Table 5 TaskDetailInfo

Parameter

Type

Description

instance_id

String

Instance ID, which is compliant with the UUID format.

instance_name

String

Instance name.

instance_status

String

Instance status.

Values:

  • createfail: The DB instance failed to be created.
  • creating: The DB instance is being created.
  • normal: The DB instance is normal.
  • abnormal: The DB instance is abnormal.
  • deleted: The DB instance has been deleted.

job_id

String

Task ID.

order_id

String

Order ID.

job_name

String

Task name.

Values:

  • CreateGaussDBforMySQLInstance: Creating a DB instance
  • RestoreGaussDBforMySQLNewInstance: Restoring data to a new DB instance
  • AddGaussDBforMySQLNodes: Adding a node
  • DeleteGaussDBforMySQLNode: Deleting a node
  • RebootGaussDBforMySQLInstance: Rebooting a DB instance
  • ModifyGaussDBforMySQLPort: Changing a database port
  • ModifyGaussDBforMySQLSecurityGroup: Changing a security group
  • ResizeGaussDBforMySQLFlavor: Changing instance specifications
  • SwitchoverGaussDBforMySQLMasterNode: Promoting a read replica to the primary node
  • GaussDBforMySQLBindEIP: Binding an EIP
  • GaussDBforMySQLUnbindEIP: Unbinding an EIP
  • RenameGaussDBforMySQLInstance: Changing a DB instance name
  • DeleteGaussDBforMySQLInstance: Deleting a DB instance
  • UpgradeGaussDBforMySQLDatabaseVersion: Upgrading version
  • EnlargeGaussDBforMySQLProxy: Adding nodes for a proxy instance
  • OpenGaussDBforMySQLProxy: Creating a proxy instance
  • CloseGaussDBforMySQLProxy: Deleting a proxy instance
  • GaussdbforMySQLModifyProxyIp: Changing the IP address of a proxy instance
  • ScaleGaussDBforMySQLProxy: Changing the node specifications of a proxy instance
  • GaussDBforMySQLModifyInstanceMetricExtend: Enabling or disabling Monitoring by Seconds
  • GaussDBforMySQLModifyInstanceDataVip: Changing the private IP address
  • GaussDBforMySQLSwitchSSL: Enabling or disabling SSL
  • GaussDBforMySQLModifyProxyConsist: Changing the proxy consistency
  • GaussDBforMySQLModifyProxyWeight: Changing the read weights of nodes

status

String

Task execution status.

Values:

  • Running: The task is being executed.
  • Completed: The task is successfully executed.
  • Failed: The task failed to be executed.
  • Pending: The task is delayed and is not executed.

process

String

Task progress.

created_time

String

Task creation time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.

ended_time

String

Task end time in the "yyyy-mm-ddThh:mm:ssZ" format. T is the separator between the calendar and the hourly notation of time. Z indicates the time zone offset. For example, if the time zone offset is one hour, the value of Z is +0100.

fail_reason

String

Task failure cause.

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Obtaining the instant tasks

GET https://{endpoint}/v3/619d3e78f61b4be68bc5aa0b59edcf7b/immediate-jobs

Example Response

Status code: 200

Success.

{
  "jobs" : [ {
    "instance_id" : "ede953923f06448d9be8686ef0c1378ein07",
    "instance_name" : "gauss-1234",
    "instance_status" : "deleted",
    "job_id" : "7155730b-a60b-4dc0-9f89-3f55897f29d6",
    "order_id" : "",
    "job_name" : "CloseGaussDBforMySQLProxy",
    "status" : "Completed",
    "process" : "",
    "created_time" : "2018-08-06T10:41:14+0000",
    "ended_time" : "2018-08-06T12:41:14+0000",
    "fail_reason" : "Single task exception."
  } ],
  "total_count" : 1
}

Status Code

For details, see Status Codes.

Error Code

For details, see Error Codes.