edit-icon download-icon

Introduction to CDN commands

Last Updated: Dec 19, 2017

The following provides instructions and examples to illustrate CDN commands.

Type one: service operation commands

OpenCdnService

Command instructions:

This command is used to activate CDN. You can perform domain name operations only after you have activated the CDN service. A single user can activate the service only once. Before activating the service, your account must have passed real-name registration.

Example:

  1. aliyuncli cdn OpenCdnService --InternetChargeType PayByTraffic

DescribeCdnService

Command instructions:

This command is used to query the CDN service status. This includes the current billing type, service activation time, the billing type that will take effect next time, and the current service status.

Example:

  1. aliyuncli cdn DescribeCdnService

ModifyCdnService

Command instructions:

This command is used to change the CDN service billing type.

Example:

  1. aliyuncli cdn ModifyCdnService --InternetChargeType PayByTraffic

Type two: domain name operation commands

DescribeUserDomains

Command instructions:

This command is used to query all domain names and statuses under a user name. Domain name statuses include running (indicating normal state of the domain name service), OK, stopped, configuring, and configuration failed.

DescribeCdnDomainDetail

Command instructions:

This command is used to obtain the basic information of the specified CDN domain configuration.

AddCdnDomain

Command instructions:

This command is used to add CDN domain names. Only one CDN domain name can be added at a time. A single user can add up to 20 domain names.

Restrictions:

Before creating a CDN domain name, you must first activate the CDN service. The CDN domain name must already have got ICP Filing number from MIIT. If the origin site content is not on the Alibaba Cloud platform, it must be reviewed. The review is completed in one business day.

StartCdnDomain

Command instructions:

This command is used to activate a deactivated CDN domain name, changing the DomainStatus to online.

Note: If your account has any outstanding payment or the domain name is invalid, you cannot call this interface to enable the CDN domain name properly.

StopCdnDomain

Command instructions:

This command is used to deactivate a CDN domain name, changing the DomainStatus to offline.

Note: After a CDN domain name is deactivated, its information is retained and the system automatically performs origin retrieval processing for requests to the CDN domain name. If, for the moment, you do not need the CDN domain name, we recommend that you use the StopCdnDomain interface to suspend it.

DeleteCdnDomain

Command instructions:

This command is used to delete the current CDN domain name. Only one CDN domain name can be submitted at a time. After DeleteCdnDomain is called successfully, all the records associated with the CDN domain name are deleted. If you only want to temporarily suspend the CDN domain name, we recommend that you use the StopCdnDomain interface.

Note: When using this command, we recommend that you restore the domain name A record at the DNS provider before deleting the domain name, to make sure the domain name can still be accessed after deletion.

Type three: refresh and push commands

RefreshObjectCaches

Command instructions:

This command is used to refresh the file content on a node. It refreshes the specified URL content to the Cache node. Only one URL can be submitted each time.

Restrictions: For a single ID, up to 2,000 URL push and refresh requests and up to 100 directory push and refresh requests can be submitted daily.

Refresh and push interfaces include the RefreshObjectCaches and PushObjectCache interfaces.

PushObjectCache

Command instructions:

This command is used to actively push content from the origin site to the L2 Cache node. Upon first access, you can directly hit cache to relieve pressure on the origin site.

Restrictions: For a single ID, up to 2,000 URL push and refresh requests can be submitted daily. You must note that no directory push request is supported currently. Refresh and push interfaces include the RefreshObjectCaches and PushObjectCache interfaces.

DescribeRefreshTasks

Command instructions:

This command is used to check whether push and refresh statuses have taken effect for the whole site.

Note: The push and refresh statuses can be queried by task ID or URL. If neither the taskid nor objectpath is specified, it queries the first page of data (20 records) in the past seven days by default. A taskid and objectpath can be specified at the same time, with a logical relationship of AND. Only the data in the past seven days can be queried.

Type four: resource monitoring commands

DescribeCdnMonitorData

Command instructions:

This command is used to obtain the domain name metric data with a minimum granularity of five minutes. This includes the request hit rate, bytes hit rate, QPS, traffic, and average response time.

Note: When StartTime and EndTime are not specified, data of the past 24 hours is read by default. You can specify a start time and an end time to query data in a specific period. Data of the latest 30 days can be obtained with one domain at most.

Type five: log obtaining command

DescribeCdnDomainLogs

Command instructions:

This command is used to obtain the address for downloading the original access log of the specified domain name.

Note: Log content is retained for two weeks at most.

Thank you! We've received your feedback.