• Auto Scaling

as
  1. Help Center
  2. Auto Scaling
  3. API Reference
  4. API
  5. AS Groups
  6. Modifying an AS Group

Modifying an AS Group

Function

This interface is used to modify information about a specified AS group.

The ECSs created based on the original AS configuration will not be affected after the AS configuration of an AS group is modified.

URI

PUT /autoscaling-api/v1/{project_id}/scaling_group/{scaling_group_id}
Table 1 Parameter description

Parameter

Mandatory

Type

Description

project_id

Yes

String

Specifies the project ID.

scaling_group_id

Yes

String

Specifies the AS group ID.

Request Message

  • Request parameters
    Table 2 Request parameters

    Parameter

    Mandatory

    Type

    Description

    scaling_group_name

    No

    String

    Specifies the AS group name. The name can contain letters, digits, underscores (_), and hyphens (-), and cannot exceed 64 characters.

    desire_instance_number

    No

    Integer

    Specifies the expected number of instances.

    The value ranges from the minimum number of instances to the maximum number of instances.

    min_instance_number

    No

    Integer

    Specifies the minimum number of instances.

    max_instance_number

    No

    Integer

    Specifies the maximum number of instances, which is greater than or equal to the minimum number of instances.

    cool_down_time

    No

    Integer

    Specifies the cooldown period (in seconds). The value ranges from 0 to 86400.

    available_zones

    No

    List<String>

    Specifies the AZ information. The ECS associated with the scaling action will be created in the specified AZ. If you do not specify an AZ, the system automatically specifies one.

    For details, see section AZ.

    The value of this parameter can be changed only when all the following conditions are met:

    • No scaling actions are triggered in the AS group.
    • The number of instances in the AS group is 0.
    • The AS group is not in service.

    networks

    No

    List data structure

    Specifies network information. The system supports up to five subnets. The first subnet transferred serves as the primary NIC of the ECS by default. You can use vpc_id to obtain the parameter value from the API used to query VPC subnets. For details, see section Subnet > Querying Subnets in the Virtual Private Cloud API Reference. The value of this parameter can be changed only when all the following conditions are met:

    • No scaling actions are triggered in the AS group.
    • The number of instances in the AS group is 0.
    • The AS group is not in service.

    security_groups

    No

    List data structure

    Specifies the security group information. You can use vpc_id to obtain the parameter value from the API used to query VPC security groups. For details, see section "Querying Security Groups" in the Virtual Private Cloud API Reference.

    If the security group is specified both in the AS configuration and AS group, the security group specified in the AS configuration prevails. If the security group is not specified in either of them, the default security group is used. For your convenience, you are advised to specify the security group in the AS configuration. The value of this parameter can be changed only when all the following conditions are met:

    • No scaling actions are triggered in the AS group.
    • The number of instances in the AS group is 0.
    • The AS group is not in service.

    lb_listener_id

    No

    String

    Specifies the ID of a typical ELB listener. The system supports the binding of up to three ELB listeners, the IDs of which are separated using a comma (,). You can use vpc_id to obtain a load balancer ID from the API used to query an ELB list. For details, see section "Querying Load Balancers" in Elastic Load Balancing API Reference. Then, use the load balancer ID to query the ELB listener list to obtain the ELB listener ID. For details, see section "Querying Listeners" in Elastic Load Balancing API Reference.

    The value of this parameter can be changed only when all the following conditions are met:

    • No scaling actions are triggered in the AS group.
    • The number of instances in the AS group is 0.
    • The AS group is not in service.

    lbaas_listeners

    No

    List data structure

    Specifies information about an enhanced load balancer. The system supports the binding of up to three load balancers.

    This field is alternative to lb_listener_id.

    health_periodic_audit_method

    No

    String

    Specifies the health check method for instances in the AS group. The health check methods include ELB_AUDIT and NOVA_AUDIT.

    • ELB_AUDIT refers to the ELB health check, which takes effect in an AS group that has a listener.
    • NOVA_AUDIT refers to the health check delivered with AS.

    health_periodic_audit_time

    No

    Integer

    Specifies the health check period for the instances in the AS group. The value can be 1, 5, 15, 60, or 180 min.

    If the value is set to 0, health check is performed every 10 seconds.

    instance_terminate_policy

    No

    String

    Specifies the instance removal policy.

    • (Default) OLD_CONFIG_OLD_INSTANCE: The earlier-created instances that were selected from the instances created based on earlier-created configurations are removed first.
    • OLD_CONFIG_NEW_INSTANCE: The later-created instances that were selected from the instances created based on earlier-created configurations are removed first.
    • OLD_INSTANCE: The earlier-created instances are removed first.
    • NEW_INSTANCE: The later-created instances are removed first.

    health_periodic_audit_grace_period

    No

    Integer

    Specifies the grace period for instance health check. The unit is second and value range is 0-86400.

    The health check grace period starts after an instance is added to an AS group and is enabled. The AS group will start checking status of the instance only after the grace period ends.

    This parameter is valid when the health check method is ELB_AUDIT. If this parameter is not specified, the default grace period is 10 minutes.

    scaling_configuration_id

    No

    String

    Specifies the AS configuration ID. You can obtain its value from the API used to query AS configurations. For details, see Querying AS Configurations.

    notifications

    No

    List<String>

    Specifies the notification mode.

    EMAIL refers to notification by email.

    delete_publicip

    No

    Boolean

    Specifies whether to delete the EIP bound to the ECS when deleting the ECS. If you do not want to delete the EIP, set this parameter to false. Then, the system only unbinds the EIP from the ECS and reserves the EIP.

    • true: deletes the EIP bound to the ECS when deleting the ECS.
    • false: only unbinds the EIP bound to the ECS when deleting the ECS.
    Table 3 lbaas_listeners field data structure description

    Parameter

    Mandatory

    Type

    Description

    pool_id

    Yes

    String

    Specifies the backend ECS group ID.

    The value of this parameter can be changed only when all the following conditions are met:

    • No scaling actions are triggered in the AS group.
    • The number of instances in the AS group is 0.
    • The AS group is not in service.

    protocol_port

    Yes

    Integer

    Specifies the backend protocol, which is the port on which a backend ECS listens for traffic. The number of the port ranges from 1 to 65535.

    weight

    Yes

    Integer

    Specifies the weight, which determines the portion of requests a backend ECS processes compared to other backend ECSs added to the same listener. The value of this parameter ranges from 0 to 100.

    Table 4 networks field data structure description

    Parameter

    Mandatory

    Type

    Description

    id

    Yes

    String

    Specifies the network ID.

    Table 5 security_groups field data structure description

    Parameter

    Mandatory

    Type

    Description

    id

    Yes

    String

    Specifies the ID of the security group.

  • Example request
    {
        "scaling_group_name": "group_1",
        "scaling_configuration_id": "f8327883-6a07-4497-9a61-68c03e8e72a2",
        "desire_instance_number": 1,
        "min_instance_number": 1,
        "max_instance_number": 3,
        "cool_down_time": 200
    }

Response Message

  • Response parameters
    Table 6 Response parameters

    Parameter

    Type

    Description

    scaling_group_id

    String

    Specifies the AS group ID.

  • Example response
    {
        "scaling_group_id": "a8327883-6b07-4497-9c61-68d03ee193a1"
    }

Returned Value

  • Normal

    200

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    The server failed to process the request.

    401 Unauthorized

    You must enter the username and password to access the requested page.

    403 Forbidden

    You are forbidden to access the requested page.

    404 Not Found

    The server could not find the requested page.

    405 Method Not Allowed

    You are not allowed to use the method specified in the request.

    406 Not Acceptable

    The response generated by the server could not be accepted by the client.

    407 Proxy Authentication Required

    You must use the proxy server for authentication so that the request can be processed.

    408 Request Timeout

    The request timed out.

    409 Conflict

    The request could not be processed due to a conflict.

    500 Internal Server Error

    Failed to complete the request because of an internal service error.

    501 Not Implemented

    Failed to complete the request because the server does not support the requested function.

    502 Bad Gateway

    Failed to complete the request because the request is invalid.

    503 Service Unavailable

    Failed to complete the request because the system is unavailable.

    504 Gateway Timeout

    A gateway timeout error occurred.

Error Codes

See section Error Codes.