Obtaining Commands from SMS
Function
This API is called by the migration Agent on source servers to obtain commands from the SMS server.
Calling Method
For details, see Calling APIs.
URI
GET /v3/sources/{server_id}/command
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
server_id |
Yes |
String |
The ID of the source server that the command is sent to. Minimum: 1 Maximum: 36 |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
User token. The token can be obtained by calling the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the user token. Minimum: 1 Maximum: 16384 |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
command_name |
String |
The command name. The value can be START, STOP, SKIP, PREMIGRATE, TASK_NOT_STARTED, TASK_HAS_STOPPED, or TASK_HAS_FINISHED. Minimum: 0 Maximum: 255 |
|
command_param |
CommandParam object |
Command response parameters. |
|
Parameter |
Type |
Description |
|---|---|---|
|
task_id |
String |
The task ID. Minimum: 0 Maximum: 255 |
|
bucket |
String |
The bucket name. Minimum: 0 Maximum: 255 |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
The error code. Minimum: 0 Maximum: 255 |
|
error_msg |
String |
The error message. Minimum: 0 Maximum: 1024 |
Status code: 401
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
The error code. Minimum: 0 Maximum: 255 |
|
error_msg |
String |
The error message. Minimum: 0 Maximum: 1024 |
Status code: 403
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
The error code. Minimum: 0 Maximum: 255 |
|
error_msg |
String |
The error message. Minimum: 0 Maximum: 255 |
|
encoded_authorization_message |
String |
The encrypted authorization information. Minimum: 0 Maximum: 65535 |
|
error_param |
Array of strings |
Error parameters. Minimum: 0 Maximum: 65535 Array Length: 1 - 20 |
|
details |
Array of details objects |
The error details. Array Length: 1 - 20 |
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
The SMS error code. Minimum: 0 Maximum: 65535 |
|
error_msg |
String |
The SMS error message. Minimum: 0 Maximum: 65535 |
Status code: 404
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
The error code. Minimum: 0 Maximum: 255 |
|
error_msg |
String |
The error message. Minimum: 0 Maximum: 1024 |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
The error code. Minimum: 0 Maximum: 255 |
|
error_msg |
String |
The error message. Minimum: 0 Maximum: 1024 |
Example Requests
This example obtains the command sent to the Agent installed on the source server whose ID is f32ab4d6-d150-4fb3-aa55-edbb5cf9947f.
GET https://{endpoint}/v3/sources/f32ab4d6-d150-4fb3-aa55-edbb5cf9947f/command
Example Responses
Status code: 200
Obtaining commands from SMS succeeded.
{
"command_name" : "START",
"command_param" : {
"task_id" : "xxxxxxxxxxxxxxxxxxxxxxxx00000001"
}
}
Status code: 403
Authentication failed.
{
"error_code" : "SMS.9004",
"error_msg" : "The current account does not have the permission to execute policy. You do not have permission to perform action XXX on resource XXX.",
"encoded_authorization_message" : "XXXXXX",
"error_param" : [ "You do not have permission to perform action XXX on resource XXX." ],
"details" : [ {
"error_code" : "SMS.9004",
"error_msg" : "You do not have permission to perform action XXX on resource XXX."
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Obtaining commands from SMS succeeded. |
|
400 |
Bad Request |
|
401 |
Unauthorized |
|
403 |
Authentication failed. |
|
404 |
Not Found |
|
500 |
Internal Server Error |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.