Associates a domain name with a version.

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 AttachDomainNameToVersion

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

VersionId String Yes testID

The ID of the version with which you want to associate the domain name.

DomainId String No testID

The ID of the resource with which you want to associate the domain name.

DomainNames String No example.com

The name of the resource with which you want to associate the domain name. Separate resource names with commas (,).

Response parameters

Parameter Type Example Description
RequestId String 65C66B7B-671A-8297-9187-2R5477247B76

The ID of the request.

Examples

Sample requests

http://cdn.aliyuncs.com/?Action=AttachDomainNameToVersion
&VersionId=testID
&DomainId=testID
&DomainNames=example.com
&<Common request parameters>

Sample success responses

XML format

<AttachDomainNameToVersionResponse>
  <RequestId>65C66B7B-671A-8297-9187-2R5477247B76</RequestId>
</AttachDomainNameToVersionResponse>

JSON format

{
   "RequestId": "65C66B7B-671A-8297-9187-2R5477247B76"
 }

Error codes

HttpCode Error code Error message Description
400 InvalidFunction.Malformed The configuration of the %s function of %s already exists. Only when it is consistent with the current configuration group can you attach it. The error message returned because the %s feature of %s already exists. You can include it in the settings only if it matches the configuration group.

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