Agrega un nombre de dominio acelerado mediante la llamada a `AddCdnDomain`.
Descripción de la operación
-
Antes de agregar un nombre de dominio acelerado, active el servicio CDN. Para obtener más información, consulte Activar el servicio CDN.
-
Si la región de aceleración está configurada solo para China continental o global, el nombre de dominio acelerado debe contar con un registro ICP válido.
-
Solo puede agregar un nombre de dominio acelerado a la vez. De forma predeterminada, cada usuario puede agregar hasta 50 nombres de dominio acelerados. Para agregar más, envíe una solicitud en Quota Center.
-
Cada usuario puede llamar a esta API hasta 100 veces por hora.
Notas
Después de agregar un nombre de dominio mediante la API, espere de 3 a 5 minutos para que surta efecto. Espere hasta que el estado del dominio sea
onlineantes de aplicar cualquier configuración adicional.
Pruébelo ahora
Test
Autorización de RAM
|
Action |
Nivel de acceso |
Tipo de recurso |
Clave de condición |
Acción dependiente |
|
cdn:AddCdnDomain |
create |
*Domain
|
Ninguna | Ninguna |
Parámetros de la solicitud
|
Parámetro |
Tipo |
Obligatorio |
Descripción |
Ejemplo |
| CdnType |
string |
Sí |
El tipo de negocio del nombre de dominio. Valores válidos:
Valores válidos:
|
web |
| DomainName |
string |
Sí |
El nombre de dominio que desea agregar a CDN. Se admite el uso de nombres de dominio comodín. Un nombre de dominio comodín debe comenzar con un punto (.), por ejemplo, .example.com. |
.example.com |
| ResourceGroupId |
string |
No |
El ID del grupo de recursos. Si no especifica este parámetro, el sistema utiliza automáticamente el ID del grupo de recursos predeterminado. |
rg-acfmyuji4b6r4** |
| Sources |
string |
Sí |
Las direcciones de los servidores de origen. |
[ { "content": "192.0.2.0", "type": "ipaddr", "priority": "20", "port": 80, "weight": "15" } ] |
| CheckUrl |
string |
No |
La URL de verificación de estado. |
www.example.com/test.html |
| Scope |
string |
No |
La región de aceleración. Valores válidos:
|
domestic |
| TopLevelDomain |
string |
No |
El dominio de nivel superior. |
example.com |
| Tag |
array<object> |
No |
Las etiquetas. Puede especificar un máximo de 20 etiquetas. |
|
|
object |
No |
|||
| Key |
string |
No |
La clave de la etiqueta. |
env |
| Value |
string |
No |
El valor de la etiqueta. |
value |
La siguiente tabla describe los campos del parámetro Sources.
| Parámetro | Tipo | Obligatorio | Descripción |
| type | String | Sí | El tipo de origen. Valores válidos:ipaddr: Una dirección IP.domain: Un nombre de dominio.oss: Un bucket de OSS.fc_domain: Un servicio de Function Compute. |
| content | String | Sí | La dirección de origen. Puede ser una dirección IP o un nombre de dominio. |
| port | Integer | No | El puerto del servidor de origen. Puede especificar el puerto 80, un puerto personalizado o el puerto 443 para back-to-origin HTTPS. El valor predeterminado es 80. |
| priority | String | No | La prioridad del origen. Los valores válidos son 20 (origen principal) y 30 (origen secundario). El valor predeterminado es 20. |
| weight | String | No | El peso de back-to-origin. El valor debe ser un número entero del 1 al 100. El valor predeterminado es 10. |
Elementos de la respuesta
|
Elemento |
Tipo |
Descripción |
Ejemplo |
|
object |
|||
| RequestId |
string |
El ID de la solicitud. |
15C66C7B-671A-4297-9187-2C4477247A74 |
Ejemplos
Respuesta exitosa
JSON Formato
{
"RequestId": "15C66C7B-671A-4297-9187-2C4477247A74"
}
Códigos de error
|
Código de estado HTTP |
Código de error |
Mensaje de error |
Descripción |
|---|---|---|---|
| 400 | InvalidDomainName.Malformed | Specified DomainName is malformed. | The specified DomainName parameter is invalid or wildcard domain names cannot be batch added. |
| 400 | MissingParameter | The input parameter cdnType that is mandatory for processing this request is not supplied. | You must specify the cdnType parameter. |
| 400 | InvalidCdnType.Malformed | Specified CdnType is malformed. | The CdnType parameter is set to an invalid value. Valid values: web: distributes images and small files. download: accelerates large file downloads. video: accelerates distribution of on-demand audio and video content. |
| 400 | InvalidSources.Malformed | Specified Sources is malformed. | The specified origin address is invalid. |
| 400 | InvalidSourceType.Malformed | Specified CdnType is malformed. | The specified CdnType parameter is invalid. |
| 400 | InvalidSource.Priority.Malformed | The specified Source Priority is invalid. | |
| 400 | InvalidTypeAndContent.MissMatch | The specified source type does not match the specified source content. | |
| 400 | InvalidScope.Malformed | Specified Scope is malformed. | The specified Scope parameter is invalid. |
| 400 | SourceIp.Exceed | The Certificate you provided is malformed | The specified certificate format is invalid. |
| 400 | InvalidCertificate | The Certificate you provided is malformed | The specified certificate format is invalid. |
| 400 | InvalidCertificate.TooLong | The Certificate you provided is over the max length | Certificate and private key length exceeds the limit |
| 400 | InnerAddDomainDenied | Your account has not bind aoneId, can not add domain. | Your account is not bound to aoneId and cannot add a domain name. |
| 400 | CheckSourceHealthFailed | sources ip or source domain check health failed,please input right source. | The origin IP address or domain name is invalid. Specify a valid value and try again. |
| 400 | ExtensiveAndAllBothExist | Extensive domain and the domain begins with all. can not exist at the same time. | Wildcard domain names and domain names that start with "all." cannot both exist. |
| 400 | CdnTypeNotSupportExtensiveDomain | Extensive domain not supported for this cdn type. | The specified CdnType parameter is not supported for wildcard domain names. Valid values: web: distributes images and small files. download: accelerates large file downloads. video: accelerates distribution of on-demand audio and video content. |
| 400 | ExtensiveAndSpecificDomainConflict | The number of wildcard domain names exceeds the limit. | |
| 400 | InvalidResourceGroupId.Malformed | Specified ResourceGroupId is malformed. | Format of parameter ResourceGroupId is incorrect. |
| 400 | DomainReserved | The root domain of your domain is reserved by another account. Submit a ticket to contact customer support. | |
| 400 | InvalidDomainNameLevel | Domain name suffixed with alicdn.com only support third level. | alicdn.com supports up to three domain levels for wildcard domain names. |
| 400 | InvalidTopLevelDomain.Malformed | Specified TopLevelDomain is malformed. | The specified TopLevelDomain parameter is invalid. |
| 400 | TopLevelDomain.NotFound | TopLevelDomain is not exist. | The specified TopLevelDomain parameter does not exist. |
| 400 | EntityNotExists.ResourceGroup | The resource group does not exist. | The specified ResourceGroup parameter does not exist. |
| 400 | EntityNotExist.ResourceGroup | The resource group does not exist. | The specified resource group does not exist. |
| 400 | InvalidStatus.ResourceGroup | It is not allowed to do this operation because of the current status of resource-group. | This operation is not supported while the resource group is in the current state. |
| 400 | NotInternationRealIdentity | You need to do real name authentication when you use Chinese mainland resources. | You have not passed real-name verification. According to the regulations issued by MIIT, you must pass real-name verification if you want to purchase IT services in the Chinese mainland. |
| 400 | Abs.CheckUrl.Malformed | The CheckUrl you provided is malformed. | |
| 400 | RecordCheckNotAvailable | The ICP filing interface is unavailable. Please try again later. | |
| 400 | IcpBlack | The domain is on the ICP blacklist. | |
| 400 | IspBlack | The domain is on the ISP blacklist. | |
| 400 | DomainOwnerVerifyFail | Owner verification of the root domain failed. | The first time a domain name is added to Alibaba Cloud CDN, you must prove the ownership of the domain name. You must add a DNS record or a verification file for the domain name before it can be added to Alibaba Cloud CDN. |
| 400 | TopLevelDomain.Mismatch | The specified TopLevelDomain does not match webSiteType. | The top-level domain name does not match the domain name type. |
| 400 | DomainInBlacklist | The domain is in the blacklist. | The domain name is in the blacklist. |
| 400 | InvalidTagKey | The specified TagKey is invalid. | The parameter TagKey is invalid. |
| 400 | InvalidTagValue | The specified TagValue is invalid. | |
| 400 | InvalidTagKey.Repeated | The specified TagKey is duplicated. | |
| 400 | InvalidTag | The specified Tag is Invalid. | |
| 400 | InvalidTagKey.OverLimit | The number of Tag can not over limit 20. | |
| 400 | SourceInBlacklist | Source is in the blacklist. | The origin server is in the blacklist. |
| 400 | ReservedTagKey | The tag key is used internally as a reserved field and is not allowed to be used. | The tag key is used as an internal reserved field and is not allowed. |
| 400 | DomainOverLimit | The maximum number of domains is exceeded. | The number of domain names exceeds the limit. |
| 400 | DomainInRiskList | The domain you added may be at risk. If you have any questions, please submit a ticket. | The domain name you added may be at risk. If you have any questions, please submit a work order. |
| 400 | RegionNoResource | Resource allocation failed. Please submit a work order to contact customer service. | Resource allocation failed. Please submit a work order to contact customer service. |
| 403 | AccountException | Account exception. Please open ticket to make an appeal. |
Consulte Códigos de error para ver la lista completa.
Notas de la versión
Consulte Notas de la versión para ver la lista completa.