curl --request PUT \ --url 'https://api.e2enetworks.com/myaccount/api/v1/scaler/scalegroups/update/{scaler_id}/?project_id=<PROJECT_ID>&apikey=<API_KEY>&location=<LOCATION>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "name": "web-autoscale-group", "plan_id": 1088, "is_private": false, "min_nodes": 1, "max_nodes": 5, "policy_type": "Default", "policy": [ { "type": "CHANGE", "adjust": 1, "parameter": "CPU", "operator": ">", "value": 60, "period_number": 3, "period": 10, "cooldown": 150 }, { "type": "CHANGE", "adjust": -1, "parameter": "CPU", "operator": "<", "value": 30, "period_number": 3, "period": 10, "cooldown": 150 } ], "scheduled_policy": [ { "type": "CARDINALITY", "adjust": 4, "recurrence": "0 12 * * *" }, { "type": "CARDINALITY", "adjust": 2, "recurrence": "0 2 * * *" } ]}'import requests
response = requests.put( "https://api.e2enetworks.com/myaccount/api/v1/scaler/scalegroups/update/{scaler_id}/", params={"project_id": "<PROJECT_ID>", "apikey": "<API_KEY>", "location": "<LOCATION>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "name": "web-autoscale-group", "plan_id": 1088, "is_private": False, "min_nodes": 1, "max_nodes": 5, "policy_type": "Default", "policy": [ { "type": "CHANGE", "adjust": 1, "parameter": "CPU", "operator": ">", "value": 60, "period_number": 3, "period": 10, "cooldown": 150, }, { "type": "CHANGE", "adjust": -1, "parameter": "CPU", "operator": "<", "value": 30, "period_number": 3, "period": 10, "cooldown": 150, }, ], "scheduled_policy": [ { "type": "CARDINALITY", "adjust": 4, "recurrence": "0 12 * * *", }, { "type": "CARDINALITY", "adjust": 2, "recurrence": "0 2 * * *", }, ], },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/scaler/scalegroups/update/{scaler_id}/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", apikey: "<API_KEY>", location: "<LOCATION>" });
const response = await fetch(url, { method: "PUT", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "web-autoscale-group", "plan_id": 1088, "is_private": false, "min_nodes": 1, "max_nodes": 5, "policy_type": "Default", "policy": [ { "type": "CHANGE", "adjust": 1, "parameter": "CPU", "operator": ">", "value": 60, "period_number": 3, "period": 10, "cooldown": 150 }, { "type": "CHANGE", "adjust": -1, "parameter": "CPU", "operator": "<", "value": 30, "period_number": 3, "period": 10, "cooldown": 150 } ], "scheduled_policy": [ { "type": "CARDINALITY", "adjust": 4, "recurrence": "0 12 * * *" }, { "type": "CARDINALITY", "adjust": 2, "recurrence": "0 2 * * *" } ] }),});console.log(await response.json());Updates a group’s configuration: its name, min_nodes / max_nodes, the backing plan_id, the policy_type, and the elastic (policy) and scheduled (scheduled_policy) rules. The same min/max and policy validation as Create applies (max_nodes <= 60, the scheduled-policy ordering rules, and at least one of policy / scheduled_policy). For a private cluster set is_private: true and omit plan_id.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The id of the auto scaling group, as returned by List.
Example
12345Query Parameters
Section titled “Query Parameters”Identifier of the project to scope the request to. Required integer project ID.
Example
<PROJECT_ID>API key used to authenticate the update request.
Example
<API_KEY>Region of the group being updated.
Example
<LOCATION>Request Body
Section titled “Request Body”Update payload for an auto scaling group’s configuration and scaling policies. The same min/max and policy validation as create applies.
object
Display name of the group.
Example
web-autoscale-groupID of the compute plan backing each node. Required when is_private is false.
Example
1088Whether the group runs on a private cluster.
Example
falseMinimum number of running nodes.
Example
1Maximum number of running nodes.
Example
5Whether the elastic policy uses a Default metric or a Custom parameter.
Example
DefaultElastic scaling rules (scale-up and scale-down). See Create for field detail.
object
Example
CHANGEExample
1Example
CPUExample
>Example
60Example
3Example
10Example
150Scheduled scaling rules (scale-up and scale-down). See Create for field detail.
object
Example
CARDINALITYExample
4Example
0 12 * * *Example
{ "name": "web-autoscale-group", "plan_id": 1088, "is_private": false, "min_nodes": 1, "max_nodes": 5, "policy_type": "Default", "policy": [ { "type": "CHANGE", "adjust": 1, "parameter": "CPU", "operator": ">", "value": 60, "period_number": 3, "period": 10, "cooldown": 150 }, { "type": "CHANGE", "adjust": -1, "parameter": "CPU", "operator": "<", "value": 30, "period_number": 3, "period": 10, "cooldown": 150 } ], "scheduled_policy": [ { "type": "CARDINALITY", "adjust": 4, "recurrence": "0 12 * * *" }, { "type": "CARDINALITY", "adjust": 2, "recurrence": "0 2 * * *" } ]}Responses
Section titled “Responses”Successful response
Update confirmation.
object
object
object
Example
{ "code": 200, "message": "service updated sucessfully, service_name: web-autoscale-group"}