Disassociates one or more Application Load Balancer (ALB) server groups from a scaling group.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes DetachAlbServerGroups

The operation that you want to perform. Set the value to DetachAlbServerGroups.

RegionId String Yes cn-hangzhou

The ID of the region where the scaling group resides. Examples: cn-hangzhou and cn-shanghai. For more information, see Regions and zones.

ScalingGroupId String Yes asg-bp18p2yfxow2dloq****

The ID of the scaling group.

ClientToken String No 123e4567-e89b-12d3-a456-42665544****

The client token that is used to ensure the idempotence of the request. You can use the client to generate the value, but you must ensure that it is unique among different requests.

The token can only contain ASCII characters and cannot exceed 64 characters in length. For more information, see How to ensure idempotence.

ForceDetach Boolean No false

Specifies whether to remove existing Elastic Compute Service (ECS) instances from the ALB server group that you want to disassociate from the scaling group.

  • true: removes existing ECS instances and returns the ScalingActivityId value. You can view the ID of the scaling activity to determine whether the instances are removed.
  • false: does not remove existing ECS instances.

Default value: false.

AlbServerGroup.N.AlbServerGroupId String Yes sgp-ddwb0y0g6y9bjm****

The ID of ALB server group N. N indicates the serial number of the ALB server group.

AlbServerGroup.N.Port Integer Yes 22

The port number used by the ECS instances in ALB server group N. N indicates the serial number of the ALB server group.

Response parameters

Parameter Type Example Description
ScalingActivityId String asa-2ze6wxj8vsohn6j9****

The ID of the scaling activity in which the ALB server group is disassociated from the scaling group and the ECS instances in the ALB server group are removed from the ALB server group. This parameter is valid only when you set ForceDetach to true.

RequestId String 473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The ID of the request.

Examples

Sample requests

http(s)://ess.aliyuncs.com/?Action=DetachAlbServerGroups
&RegionId=cn-hangzhou
&ScalingGroupId=asg-bp18p2yfxow2dloq****
&ClientToken=123e4567-e89b-12d3-a456-42665544****
&ForceDetach=false
&AlbServerGroup=[{"AlbServerGroupId":"sgp-ddwb0y0g6y9bjm****","Port":22}]
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DetachAlbServerGroupsResponse>
    <ScalingActivityId>asa-2ze6wxj8vsohn6j9****</ScalingActivityId>
    <RequestId>473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E</RequestId>
</DetachAlbServerGroupsResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "ScalingActivityId" : "asa-2ze6wxj8vsohn6j9****",
  "RequestId" : "473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E"
}

Error codes

For a list of error codes, visit the API Error Center.

HTTP status code

Error code

Error message

Description

400

AlbServerGroup.NotAttached

The ALB server groups are not attached to specific ScalingGroup.

The error message returned because the ALB server group is not associated with the scaling group.