You can call the ModifyCdnDomain operation to modify a CDN domain.

Debugging

Alibaba Cloud provides OpenAPI Explorer to simplify API usage. You can use OpenAPI Explorer to search for APIs, call APIs, and dynamically generate SDK example code.

Request parameters

Parameter Type Required Description
Action String Yes The operation that you want to perform. Set this parameter to ModifyCdnDomain.
DomainName String Yes The name of the CDN domain to be modified.
Sources Json No The list of origin addresses.
ResourceGroupId String No The ID of the resource group.
TopLevelDomain String No The primary domain.

Sources syntax

[{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80,"weight":"15"}]

Parameters in Sources

Parameter Type Required Description
type String Yes The address type of the origin. Valid values:
  • ipaddr: IP address.
  • domain: domain name.
  • oss: URL of an Alibaba Cloud OSS bucket.
content String Yes The address of the origin. You can specify an IP address or a domain name.
port Integer No The port number. You can specify port 443 or 80. You can also customize the port number. Default value: 80. If you specify port 443, CDN communicates with the origin by using HTTPS.
priority String No The priority of the origin if multiple origins are specified. Default value: 20.
weight String No The weight of the origin if multiple origins are specified. Default value: 10.

Response parameters

Parameter Type Description
RequestID String The ID of the request.

Examples

Sample request

http://cdn.aliyuncs.com?Action=ModifyCdnDomain&SourceType=domain&DomainName=example.com&Sources=[{"content":"1.1.1.1","type":"ipaddr","priority":"20","port":80}]&<Common request parameter>

Sample success response

JSON format

{
  "RequestId": "15C66C7B-671A-4297-9187-2C4477247A74"
}

Error codes

Error code Error message HTTP status code Description
InvalidDomainName.Malformed Specified DomainName is malformed. 400 The error message returned because the specified DomainName parameter is invalid.
InvalidSource.Content.Malformed Specified source content is malformed. 400 The error message returned because the specified origin address is invalid.
InvalidSource.Type.Malformed Specified source type is malformed. 400 The error message returned because the specified origin type is invalid.
InvalidTypeContent.Mismatch Specified source type does not math the specified source content. 400 The error message returned because the specified origin address does not match the specified origin type.
InvalidSource.Priority.Malformed Specified source priority is malformed. 400 The error message returned because the specified priority is invalid.
InvalidScope.Malformed Specified Scope is malformed. 400 The error message returned because the specified Scope parameter is invalid.
IllegalOperation Illegal domain operate is not permitted. 403 The error message returned because you are not authorized to perform this operation.
InvalidDomain.NotFound The domain provided does not belong to you. 404 The error message returned because the specified domain does not exist or does not belong to you.
Abs.resourceGroupId.Malformed Specified ResourceGroupId is malformed. 400 The error message returned because the specified resource group ID is invalid.
EntityNotExists.ResourceGroup The resource group does not exist. 400 The error message returned because the specified resource group does not exist.
InvalidStatus.ResourceGroup It's now allowed to do this operation because of the current status of resource-group. 400 The error message returned because the specified resource group is in an invalid state.