Obtaining the Automatic Batching Result
Function
This API is used to obtain the batching result based on the batching policy. Only automatic batching is supported.
Constraints
Constraints:
-
All instances in a batch must belong to the same region.
-
All instances in a batch must be in the same AZ.
-
All instances in a batch must belong to the same application.
-
A maximum of 50/ %instances in a batch can belong to the same group (except that there is only one instance in a group).
-
The number of nodes in each of the first three batches cannot exceed 10.
-
The number of instances in each batch cannot exceed 10.
-
The total number of hosts is 200.
URI
POST /v1/instances/batches
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition: Tenant token. Constraints: Tenant token obtained from IAM. Value range: N/A. Default value: N/A. |
|
X-Language |
No |
String |
Definition: Internationalization tag. zh-cn indicates Chinese, and en-us or no value indicates English. Constraints: zh-cn indicates Chinese, and en-us or no value indicates English. Value range: zh-cn and en-us Default value: N/A. |
|
x-project-id |
No |
String |
Definition: The project ID. Constraints: Project ID corresponding to the region. Value range: N/A. Default value: N/A. |
|
x-user-profile |
No |
String |
Definition: IAM 5.0 user information. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
batch_strategy |
Yes |
String |
Definition: Batching policy: Only automatic batching is supported. Constraints: AUTO_BATCH: automatic batching Value range: AUTO_BATCH: automatic batching Default value: N/A |
|
target_instances |
Yes |
Array of ResourceInstance objects |
Definition: Target host instance. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
resource_id |
Yes |
String |
Definition: Unique ID of an instance. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
provider |
Yes |
String |
Definition: Resource provider: ECS. For a single script ticket, the provider of each instance is the same. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
region_id |
Yes |
String |
Definition: ID of the region to which the host belongs. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
type |
Yes |
String |
Definition: Resource type of the resource provider. If this parameter is not specified, CLOUDSERVER is used by default. CLOUDSERVER: Cloud server type. Constraints: N/A Value range:
Default value: N/A |
|
custom_attributes |
No |
Array of Customttribute objects |
Definition: Custom attributes in the key_value format. A maximum of five attributes can be customized. Constraints: The length of the key is 10. The length of the value is 20. The maximum length of the map is 5. Value range: N/A. Default value: N/A. |
|
agent_sn |
No |
String |
Definition: Agent management ID. This parameter will be discarded. Do not use it. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
agent_status |
No |
String |
Definition: Agent management status. This parameter will be discarded. Do not use it. Constraints: N/A Value range:
Default value: N/A |
|
properties |
No |
ResourceInstanceProp object |
Definition: Additional attributes of a host. This parameter will be discarded. Do not use it. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
key |
Yes |
String |
Definition: Key of a custom attribute. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
value |
Yes |
String |
Definition: Value of a custom attribute. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
host_name |
Yes |
String |
Definition: The host name. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
fixed_ip |
Yes |
String |
Definition: Private IP address. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
floating_ip |
No |
String |
Definition: Elastic IP address. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
region_id |
Yes |
String |
Definition: Region. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
zone_id |
Yes |
String |
Definition: AZ. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
application |
No |
String |
Definition: CloudCMDB application. This parameter has a value only in the CloudCMDB application view, which is similar to the cloud services on the management plane. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
group |
No |
String |
Definition: CloudCMDB group. This parameter has a value only in the CloudCMDB application view, which is similar to the schema of the management plane. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
project_id |
No |
String |
Definition: Project ID of the instance. Constraints: N/A. Value range: N/A. Default value: N/A. |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
data |
Array of InstancesBatchResultMode objects |
Definition: Batch result. Value range: N/A. |
|
Parameter |
Type |
Description |
|---|---|---|
|
batch_index |
Integer |
Definition: Batch ID. Value range: N/A. |
|
target_instances |
Array of ResourceInstance objects |
Definition: Hosts in the current batch. Value range: N/A. |
|
Parameter |
Type |
Description |
|---|---|---|
|
resource_id |
String |
Definition: Unique ID of an instance. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
provider |
String |
Definition: Resource provider: ECS. For a single script ticket, the provider of each instance is the same. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
region_id |
String |
Definition: ID of the region to which the host belongs. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
type |
String |
Definition: Resource type of the resource provider. If this parameter is not specified, CLOUDSERVER is used by default. CLOUDSERVER: Cloud server type. Constraints: N/A Value range:
Default value: N/A |
|
custom_attributes |
Array of Customttribute objects |
Definition: Custom attributes in the key_value format. A maximum of five attributes can be customized. Constraints: The length of the key is 10. The length of the value is 20. The maximum length of the map is 5. Value range: N/A. Default value: N/A. |
|
agent_sn |
String |
Definition: Agent management ID. This parameter will be discarded. Do not use it. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
agent_status |
String |
Definition: Agent management status. This parameter will be discarded. Do not use it. Constraints: N/A Value range:
Default value: N/A |
|
properties |
ResourceInstanceProp object |
Definition: Additional attributes of a host. This parameter will be discarded. Do not use it. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
Parameter |
Type |
Description |
|---|---|---|
|
key |
String |
Definition: Key of a custom attribute. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
value |
String |
Definition: Value of a custom attribute. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
Parameter |
Type |
Description |
|---|---|---|
|
host_name |
String |
Definition: The host name. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
fixed_ip |
String |
Definition: Private IP address. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
floating_ip |
String |
Definition: Elastic IP address. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
region_id |
String |
Definition: Region. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
zone_id |
String |
Definition: AZ. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
application |
String |
Definition: CloudCMDB application. This parameter has a value only in the CloudCMDB application view, which is similar to the cloud services on the management plane. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
group |
String |
Definition: CloudCMDB group. This parameter has a value only in the CloudCMDB application view, which is similar to the schema of the management plane. Constraints: N/A. Value range: N/A. Default value: N/A. |
|
project_id |
String |
Definition: Project ID of the instance. Constraints: N/A. Value range: N/A. Default value: N/A. |
Example Requests
Obtain the automatic batching results.
POST https://{Endpoint}/v1/instances/batches
{
"batch_strategy" : "AUTO_BATCH",
"target_instances" : [ {
"resource_id" : "7c118539-15ab-41d3-9xxxxxxxxx",
"region_id" : "cn-north-x",
"provider" : "ECS",
"type" : "CLOUDSERVERS",
"agent_sn" : "705c526eb7774c51b321xxxxxxxxx",
"agent_status" : "ONLINE",
"properties" : {
"host_name" : "ecs-0001",
"fixed_ip" : "192.168.xx.xx",
"region_id" : "cn-north-x",
"zone_id" : "cn-north-xx",
"project_id" : "10a6c23c2a1xxxxxxxxxxxxx"
}
} ]
}
Example Responses
Status code: 200
Request result is returned.
For more status codes, see Status Codes.
{
"data" : [ {
"batch_index" : 1,
"target_instances" : [ {
"resource_id" : "7c118539-15ab-41d3xxxxxxxxxxx",
"agent_sn" : "705c526eb7774c51b32xxxxxxxxxxx",
"agent_status" : "ONLINE",
"provider" : "ECS",
"type" : "CLOUDSERVERS",
"properties" : {
"host_name" : "ecs-0001",
"fixed_ip" : "192.168.xx.xx",
"floating_ip" : null,
"region_id" : "cn-north-x",
"zone_id" : "cn-north-xx",
"application" : null,
"group" : null,
"project_id" : "10a6c23c2a10xxxxxxxxxxx"
}
} ]
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
Request result is returned. For more status codes, see Status Codes. |
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.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot