SetLiveDomainCertificate

Updated at:

Configures whether to enable the certificate feature for a domain name and updates the certificate information.

Operation description

Obtain the live domain name first, and then call this operation to configure whether the certificate is enabled for the domain name and update the certificate information.

QPS limits

The QPS limit for a single user is 30 calls per second. If the limit is exceeded, API calls are throttled, which may affect your services. Make API calls at a reasonable rate.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

live:SetLiveDomainCertificate

update

*Domain

acs:cdn:*:{#accountId}:domain/{#DomainName}

None None

Request parameters

Parameter

Type

Required

Description

Example

DomainName

string

Yes

The accelerated domain name to which the certificate belongs. The domain name must use the https acceleration type.

developer.aliyundoc.com

CertName

string

No

The name of the certificate.

Cert-****

CertType

string

No

The type of the certificate. Valid values:

  • upload: uploaded certificate.

  • cas: certificate from Certificate Manager.

  • free: free certificate for testing.

Valid values:

  • cas :

    Certificate from Certificate Manager.

  • upload :

    Uploaded certificate.

  • free :

    Free certificate for testing.

free

SSLProtocol

string

Yes

Specifies whether to enable the HTTPS certificate. Valid values:

  • on: enables the HTTPS certificate. If this parameter is set to on, you must also set the SSLPub and SSLPri request parameters.

  • off: disables the HTTPS certificate. This is the default value.

off

SSLPub

string

No

The content of the public key.

Note

This parameter is required only when SSLProtocol is set to on.

-----BEGIN CERTIFICATE----- MIIC**** -----END CERTIFICATE-----

SSLPri

string

No

The content of the private key.

Note

This parameter is required only when SSLProtocol is set to on.

-----BEGIN PRIVATE KEY----- MIIE**** -----END PRIVATE KEY-----

ForceSet

string

No

Specifies whether to ignore the check for duplicate certificate names and overwrite the existing certificate with the same name. Set the value to 1.

1

DryRun

boolean

No

Specifies whether to perform a dry run without performing the actual operation. Valid values:

  • true: performs a dry run. If the check passes, the actual operation is not performed.

  • false: performs a normal request. If the check passes, the actual operation is performed. This is the default value.

A dry run checks the validity of parameters, RAM permissions, and resource status. If the dry run fails, the corresponding error code is returned. If the dry run succeeds, the actual operation is not performed.

Response elements

Element

Type

Description

Example

object

RequestId

string

The request ID.

16A96B9A-F203-4EC5-8E43-CB92E68F4CD8

Examples

Success response

JSON format

{
  "RequestId": "16A96B9A-F203-4EC5-8E43-CB92E68F4CD8"
}

Error codes

HTTP status code

Error code

Error message

Description

400 InvalidSSLProtocol.ValueNotSupported The specified value of parameter SSLProtocol is not supported.
400 SSLPub.MissingParameter An input parameter "SSLPub" that is mandatory for processing the request is not supplied.
400 SSLPri.MissingParameter An input parameter "SSLPri" that is mandatory for processing the request is not supplied.
400 InvalidSSLPub The SSLPub you provided is malformed!
400 InvalidSSLPri The SSLPri you provided is malformed!
400 Certificate.MissMatch The SSLPri does not math the specified Certificate!
400 InvalidCertificate.TooLong The Certificate you provided is over the max length!
400 InvalidCertName.TooLong The Certificate name you provided is over the max length 128!
400 IllegalOperationDomain You are not authorized to operate the domain.
400 Certificate.NotPermittedOff Turn off certificate will change domain scheduling, please contact customer service
400 Certificate.SettedNotEffect Certificate was successfully setted but does't take effect for protecting current service, please contact customer service
400 Certificate.NotFind Not find the certificate info.
400 AuthenticationFailed Authentication failed.
400 SetDomainCertificate.ParameterError Parameters have error.
400 InvalidSSLPubOrInvalidSSLPri The SSLPri or SSLPub you provided is malformed!
400 Certificate.StatusError Certificate is not exist or its status is error.
400 DeleteFailed Delete certificate is failed.
400 Certificate.Duplicated The certificate name is duplicated.
400 Certificate.FormatError The certificate format is error.
400 Certificate.KeyNull The private key is not null.
400 Key.Malformed The private key format is error.
400 CertStorage.failed The certificate storage failed.
400 CertificateContent.Duplicated The certificate is already uploaded, please don't upload again.
400 Certificate.Expired The certificate is expired.
400 InvalidDomain.notOnline The domain is not online, please check the domain status and try again later.
400 Decode.Error The certificate sslpub or sslpri decode error.
400 sslPub.Error The SSLPub encoded failed.
400 sslPri.Error The SSLPri encoded failed.
400 DomainInSafeMode This domain is in the safe mode. if you want to do this operation, please contact us!
400 DomainInProtectedMode This domain is in the protected mode. if you want to do this operation, please contact us!
400 FunctionMutex Function is mutex with other function.
400 DomainOffline The domain is not online, please check the domain status and try again later. The domain is not online, please check the domain status and try again later.
403 IllegalOperation Illegal domain operate is not permitted.
404 CertName.MissingParameter The CertName parameter is required.

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.