All Products
Search
Document Center

Auto Scaling:DetachAlbServerGroups

最終更新日:Aug 07, 2024

Detaches server groups of Application Load Balancer (ALB) instances from scaling groups. When you call the DetachAlbServerGroups operation, you can specify information such as the scaling group ID, ALB server group ID, and port used by Elastic Compute Service (ECS) instances in the desired ALB server group to detach one or more 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 region ID of the scaling group. 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 token, but you must make sure that the token is unique among different requests.

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

ForceDetach

Boolean

No

false

Specifies whether to remove the existing ECS instances from the ALB server group.

  • true: removes the existing ECS instances from the ALB server group and returns the ScalingActivityId value. You can check whether the ECS instances are removed from the scaling group based on the value of ScalingActivityId.

  • false: does not remove the existing ECS instances from the ALB server group.

Default value: false.

AlbServerGroup.N.AlbServerGroupId

String

Yes

sgp-ddwb0y0g6y9bjm****

The ID of ALB server group N. N specifies 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 specifies the serial number of the ALB server group.

Response parameters

Parameter

Type

Example

Description

ScalingActivityId

String

asa-2ze6wxj8vsohn6j9****

The ID of the scaling activity during which the ALB server group is removed from the scaling group and the existing ECS instances are removed from the ALB server group. This parameter has a return value only if you set ForceDetach to true.

RequestId

String

473469C7-AA6F-4DC5-B3DB-A3DC0DE3C83E

The request ID.

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, see Service error codes.

HTTP status code

Error code

Error message

Description

400

AlbServerGroup.NotAttached

The ALB server groups are not attached to specific ScalingGroup.

The ALB server group is not attached to the scaling group.