All Products
Search
Document Center

Global Accelerator:AttachDdosToAccelerator

Last Updated:Jul 31, 2024

Associates an Anti-DDoS Pro or Anti-DDoS Premium instance with a Global Accelerator (GA) instance.

Operation description

When you call this operation, take note of the following items:

  • AttachDdosToAccelerator is an asynchronous operation. After you send a request, the system returns a request ID and runs the task in the background. You can call the DescribeAccelerator or ListAccelerators operation to query the status of the GA instance.

    • If the GA instance is in the configuring state, the Anti-DDoS Pro or Anti-DDoS Premium instance is being associated with the GA instance. In this case, you can perform only query operations.
    • If the GA instance is in the active state, the Anti-DDoS Pro or Anti-DDoS Premium instance is associated with the GA instance.
  • You cannot repeatedly call the AttachDdosToAccelerator operation for the same GA instance within a specific period of time.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ga:AttachDdosToAcceleratorupdate
  • Accelerator
    acs:ga:{#regionId}:{#accountId}:ga/{#acceleratorId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
AcceleratorIdstringYes

The ID of the GA instance with which the Anti-DDoS Pro/Premium instance is associated.

ga-bp1odcab8tmno0hdq****
DdosIdstringYes

The ID of the Anti-DDoS Pro/Premium instance to be associated with the GA instance.

ddoscoo-cn-zz11vq7j****
DdosRegionIdstringYes

The region where the Anti-DDoS Pro/Premium instance is deployed. Valid values:

  • cn-hangzhou: regions in the Chinese mainland
  • ap-southeast-1: regions outside the Chinese mainland
cn-hangzhou
RegionIdstringNo

The ID of the region where the GA instance is deployed. Set the value to cn-hangzhou.

cn-hangzhou

Response parameters

ParameterTypeDescriptionExample
object

The returned data.

DdosIdstring

The ID of the Anti-DDoS Pro/Premium instance that is associated with the GA instance.

ddoscoo-cn-zz11vq7j****
RequestIdstring

The ID of the request.

DE77A7F3-3B74-41C0-A5BC-CAFD188C28B6
GaIdstring

The ID of the GA instance that is associated with the Anti-DDoS Pro/Premium instance.

ga-bp1odcab8tmno0hdq****

Examples

Sample success responses

JSONformat

{
  "DdosId": "ddoscoo-cn-zz11vq7j****",
  "RequestId": "DE77A7F3-3B74-41C0-A5BC-CAFD188C28B6",
  "GaId": "ga-bp1odcab8tmno0hdq****"
}

Error codes

HTTP status codeError codeError messageDescription
400DdosId.ErrorFailed to find the DDoS instance based on the DDoS ID.Failed to find the DDoS instance based on the DDoS ID.
400NoPermission.GaDdosRoleSessionYou are not authorized to perform the operation.The user does not have permissions to create service linked roles. Contact the Alibaba Cloud account owner or the permission administrator to grant the current user AliyunGlobalAccelerationFullAccess or create custom permission policies for service linked role. The following content describes the detailed information about custom permission policies: ServiceName: ddos.ga.aliyuncs.com. Service linked role name: AliyunServiceRoleForGaAntiDDos. Permission: ram:CreateServiceLinkedRole.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
No change history