Restarting, Scaling Out, and Scaling In Queues
Function
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.)
URI
- URI format
- Parameter description
Table 1 URI parameters 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.
Request
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. |
Response
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. |
Example Request
- Restarting the queue:
{ "action": "restart", "force": "false" }
- Scaling out the queue:
{ "action": "scale_out", "cu_count": 16 }
Example Response
- Set force to false.
{ "is_success": true, "message": "Restart success" }
- Set force to true.
{ "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" }
- Scaling
{ "queue_name": "myQueue", "result": true }
Status Codes
Table 4 describes the status code.
Error Codes
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 Code.
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. |
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot