This API is used to restart, scale out, and scale in queues.
Only SQL queues in the Available status can be restarted. (The queue status is Available only after the SQL job is successfully executed.)
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID, which is used for resource isolation. For details about how to obtain its value, see Obtaining a Project ID. |
queue_name |
Yes |
String |
Name of a queue. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
action |
Yes |
String |
Operations to be performed:
NOTE:
Currently, only restart, scale_out, and scale_in operations are supported. |
force |
No |
Boolean |
Specifies whether to forcibly restart the queue. This parameter is optional when action is set to restart. The default value is false. |
cu_count |
No |
Integer |
Number of CUs to be scaled in or out. This parameter is optional when action is set to scale_out or scale_in. The value of cu_count must be a multiple of 16. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
is_success |
No |
Boolean |
Indicates whether the request is successfully executed. Value true indicates that the request is successfully executed. |
message |
No |
String |
System prompt. If execution succeeds, the parameter setting may be left blank. |
job_id |
No |
String |
Specifies the job ID returned when force is set to true. |
queue_name |
No |
String |
Name of the queue to be scaled in or out. |
result |
No |
Boolean |
Indicates the scaling result. |
{ "action": "restart", "force": "false" }
{ "action": "scale_out", "cu_count": 16 }
{ "is_success": true, "message": "Restart success" }
{ "is_success": true, "message": "Submit restart job success, it need some time to cancel jobs, please wait for a while and check job status", "job_id": "d90396c7-3a25-4944-ad1e-99c764d902e7" }
{ "queue_name": "myQueue", "result": true }
Table 4 describes the status code.
If an error occurs when this API is invoked, the system does not return the result similar to the preceding example, but returns the error code and error information. For details, see Error Codes.
Error Code |
Error Message |
---|---|
DLI.0015 |
Token info for token is null, return. |
DLI.0013 |
X-Auth-Token is not defined in request. It is mandatory. Please define and send the request. |