POST zstack/v1/autoscaling/groups
Authorization: OAuth the-session-uuid
{
"params": {
"name": "test-group",
"description": "just for test",
"scalingResourceType": "VmInstance",
"minResourceSize": 2.0,
"maxResourceSize": 10.0,
"defaultCooldown": 60.0,
"removalPolicy": "OldestInstance",
"defaultEnable": false
},
"systemTags": [],
"userTags": []
}
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"test-group","description":"just for test","scalingResourceType":"VmInstance","minResourceSize":2.0,"maxResourceSize":10.0,"defaultCooldown":60.0,"removalPolicy":"OldestInstance","defaultEnable":false}}' http://localhost:8080/zstack/v1/autoscaling/groups
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
name | String | body (contained in the params structure) | The resource name. | 3.1.0 | |
description | String | body (contained in the params structure) | Optional. The detailed description of the resource. | 3.1.0 | |
scalingResourceType | String | body (contained in the params structure) | The resource type of the auto scaling group. Current type: VM instance. |
| 3.1.0 |
minResourceSize | Integer | body (contained in the params structure) | The minimum number of VM instances in the auto scaling group. | 3.1.0 | |
maxResourceSize | Integer | body (contained in the params structure) | The maximum number of VM instances in the auto scaling group. | 3.1.0 | |
defaultCooldown | Long | body (contained in the params structure) | The default cooldown time of the auto scaling rule. | 3.1.0 | |
removalPolicy | String | body (contained in the params structure) | The policy for removing a VM instance. |
| 3.1.0 |
defaultEnable | boolean | body (contained in the params structure) | Optional. Whether to enable the auto scaling group after creation. | 3.1.0 | |
resourceUuid | String | body (contained in the params structure) | Optional. The resource UUID. | 3.1.0 | |
tagUuids | List | body (contained in the params structure) | Optional. The tag UUID list. | 3.1.0 | |
systemTags | List | body | Optional. The system tags. | 3.1.0 | |
userTags | List | body | Optional. The user tags. | 3.1.0 |
{
"inventory": {
"name": "test-group",
"uuid": "ff296e09f82e3a84af082257ff63d162",
"description": "just for test",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.1.0 |
inventory | AutoScalingGroupInventory | See inventory. | 3.1.0 |
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.1.0 |
description | String | The brief description of the error. | 3.1.0 |
details | String | The details about the error. | 3.1.0 |
elaboration | String | The reserved field. Default value: null. | 3.1.0 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 3.1.0 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.1.0 |
Name | Type | Description | Starting Version |
---|---|---|---|
name | String | The resource name. | 3.1.0 |
uuid | String | The resource UUID. | 3.1.0 |
scalingResourceType | String | The resource type of the auto scaling group. Current type: VM instance. | 3.1.0 |
state | String | The state of the auto scaling group. | 3.1.0 |
defaultCooldown | Long | The default cooldown time of the auto scaling rule. | 3.1.0 |
description | String | The detailed description of the resource. | 3.1.0 |
minResourceSize | Integer | The minimum number of VM instances in the auto scaling group. | 3.1.0 |
maxResourceSize | Integer | The maximum number of VM instances in the auto scaling group. | 3.1.0 |
removalPolicy | String | The default policy for removing a VM instance. | 3.1.0 |
createDate | Timestamp | The creation date. | 3.1.0 |
lastOpDate | Timestamp | The last operation date. | 3.1.0 |
attachedTemplates | List | The templates of VM instances attached to the auto scaling group. | 3.1.0 |
systemTags | List | 3.1.0 |
CreateAutoScalingGroupAction action = new CreateAutoScalingGroupAction();
action.name = "test-group";
action.description = "just for test";
action.scalingResourceType = "VmInstance";
action.minResourceSize = 2.0;
action.maxResourceSize = 10.0;
action.defaultCooldown = 60.0;
action.removalPolicy = "OldestInstance";
action.defaultEnable = false;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateAutoScalingGroupAction.Result res = action.call();
CreateAutoScalingGroupAction action = CreateAutoScalingGroupAction()
action.name = "test-group"
action.description = "just for test"
action.scalingResourceType = "VmInstance"
action.minResourceSize = 2.0
action.maxResourceSize = 10.0
action.defaultCooldown = 60.0
action.removalPolicy = "OldestInstance"
action.defaultEnable = false
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateAutoScalingGroupAction.Result res = action.call()
DELETE zstack/v1/autoscaling/groups/{uuid}
Authorization: OAuth the-session-uuid
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/autoscaling/groups/09121b25fdf330538288d1ac81025563
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The resource UUID. | 3.1.0 | |
systemTags | List | body | Optional. The system tags. | 3.1.0 | |
userTags | List | body | Optional. The user tags. | 3.1.0 |
{}
is returned. When the API failed, the returned JSON structure includes an error field. For example,{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
}
}
DeleteAutoScalingGroupAction action = new DeleteAutoScalingGroupAction();
action.uuid = "09121b25fdf330538288d1ac81025563";
action.deleteMode = "Permissive";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DeleteAutoScalingGroupAction.Result res = action.call();
DeleteAutoScalingGroupAction action = DeleteAutoScalingGroupAction()
action.uuid = "09121b25fdf330538288d1ac81025563"
action.deleteMode = "Permissive"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
DeleteAutoScalingGroupAction.Result res = action.call()
PUT zstack/v1/autoscaling/groups/{uuid}/actions
Authorization: OAuth the-session-uuid
{
"updateAutoScalingGroup": {
"name": "test-group2"
},
"systemTags": [],
"userTags": []
}
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"updateAutoScalingGroup":{"name":"test-group2"}}' http://localhost:8080/zstack/v1/autoscaling/groups/17a8d07735b631a688d6f95f3323fe91/actions
Name | Type | Location | Description | Optional Value | Starting Version |
---|---|---|---|---|---|
uuid | String | url | The resource UUID. | 3.1.0 | |
name | String | body (contained in the updateAutoScalingGroup structure) | Optional. The resource name. | 3.1.0 | |
description | String | body (contained in the updateAutoScalingGroup structure) | Optional. The detailed description of the resource. | 3.1.0 | |
minResourceSize | Integer | body (contained in the updateAutoScalingGroup structure) | Optional. The minimum number of VM instances in the auto scaling group. | 3.1.0 | |
maxResourceSize | Integer | body (contained in the updateAutoScalingGroup structure) | Optional. The maximum number of VM instances in the auto scaling group. | 3.1.0 | |
removalPolicy | String | body (contained in the updateAutoScalingGroup structure) | Optional. The policy for removing a VM instance. The oldest and newest VM instances take precedence. |
| 3.1.0 |
systemTags | List | body | Optional. The system tags. | 3.1.0 | |
userTags | List | body | Optional. The user tags. | 3.1.0 |
{
"inventory": {
"name": "test-load-balance-profile",
"uuid": "95f4b920e6b63e318940a44c0f47788e",
"description": "just for test",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 3.1.0 |
inventory | AutoScalingGroupInventory | See inventory. | 3.1.0 |
Name | Type | Description | Starting Version |
---|---|---|---|
code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 3.1.0 |
description | String | The brief description of the error. | 3.1.0 |
details | String | The details about the error. | 3.1.0 |
elaboration | String | The reserved field. Default value: null. | 3.1.0 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 3.1.0 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 3.1.0 |
Name | Type | Description | Starting Version |
---|---|---|---|
name | String | The resource name. | 3.1.0 |
uuid | String | The resource UUID. | 3.1.0 |
scalingResourceType | String | The resource type of the auto scaling group. Current type: VM instance. | 3.1.0 |
state | String | The state of the auto scaling group. | 3.1.0 |
defaultCooldown | Long | The default cooldown time of the auto scaling rule. | 3.1.0 |
description | String | The detailed description of the resource. | 3.1.0 |
minResourceSize | Integer | The minimum number of VM instances in the auto scaling group. | 3.1.0 |
maxResourceSize | Integer | The maximum number of VM instances in the auto scaling group. | 3.1.0 |
removalPolicy | String | The default policy for removing a VM instance. | 3.1.0 |
createDate | Timestamp | The creation date. | 3.1.0 |
lastOpDate | Timestamp | The last operation date. | 3.1.0 |
attachedTemplates | List | The templates of VM instances attached to the auto scaling group. | 3.1.0 |
systemTags | List | 3.1.0 |
UpdateAutoScalingGroupAction action = new UpdateAutoScalingGroupAction();
action.uuid = "17a8d07735b631a688d6f95f3323fe91";
action.name = "test-group2";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
UpdateAutoScalingGroupAction.Result res = action.call();
UpdateAutoScalingGroupAction action = UpdateAutoScalingGroupAction()
action.uuid = "17a8d07735b631a688d6f95f3323fe91"
action.name = "test-group2"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
UpdateAutoScalingGroupAction.Result res = action.call()
Email Us
contact@zstack.ioEmail Us
contact@zstack.ioThe download link is sent to your email address.
If you don't see it, check your spam folder, subscription folder, or AD folder. After receiving the email, click the URL to download the documentation.Thank you for using ZStack products and services.
Submit successfully.
We'll connect soon.Thank you for choosing ZStack products and services.