Creates a tracking task that generates operations reports. The tracking task sends operations reports to a specified email address based on a specified schedule.

Note You can call this operation up to three times per second per account.

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 CreateCdnDeliverTask

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

Name String Yes Domain name report

The name of the tracking task.

Reports String Yes [{\"reportId\":1,\"conditions\":[{\"field\":\"prov\",\"op\":\"in\",\"value\":[\"Heilongjiang\",\"Beijing\"]}]}]

The operations reports that are tracked by the task. The data must be escaped in JSON.

DomainName String No www.example1.com,www.example2.com

The domain names to be tracked. Separate multiple domain names with commas (,). You can specify up to 500 domain names. If you want to specify more than 500 domain names, submit a ticket.

Note If you do not specify a domain name, the custom operations reports are created for all domain names that belong to your Alibaba Cloud account.
Deliver String Yes {"email":{"subject":"The email subject","to":["username@example.com","username@example.org"]}}

The method that is used to send operations reports. Operations reports are sent to you only by email. The settings must be escaped in JSON.

Schedule String Yes {"schedName":"The name of the tracking task","description":"The description","crontab":"000**?","frequency":"d","status":"enable","effectiveFrom":"2020-09-17T00:00:00Z","effectiveEnd":"2020-11-17T00:00:00Z"}

The parameters that specify the time interval at which the tracking task sends operations reports. The settings must be escaped in JSON.

Fields of the ReDatas parameter

Field

Type

Required

Description

reportId

String

Yes

The ID of the operations report.

conditions

ConDatas[]

No

The filter conditions for the report.

Fields of the ConDatas parameter

Field

Type

Required

Description

field

String

No

The filter field.

op

String

No

The filter operation.

value

String[]

No

The array of field values.

Fields of the email parameter

Field

Type

Required

Description

subject

String

Yes

The email subject.

to

String[]

Yes

The email addresses to which operations reports are sent.

Fields of the Schedule parameter

Field

Type

Required

Description

schedName

String

Yes

The name of the tracking task.

description

String

Yes

The description of the tracking task.

crontab

String

Yes

The period during which the operations reports are tracked.

frequency

String

Yes

The interval at which the reports are sent. Valid values:

h: every hour

d: every day

w: every week

status

String

Yes

The status of the tracking task. Valid values:

enable: enabled

disable: disabled

effectiveFrom

String

Yes

The start time of the tracking task.

effectiveEnd

String

Yes

The end time of the tracking task.

Response parameters

Parameter Type Example Description
RequestId String 04F0F334-1335-436C-A1D7-6C044FE73368

The ID of the request.

Examples

Sample requests

http://cdn.aliyuncs.com?Action=CreateCdnDeliverTask
&Name=Domain name report
&Reports="[{\"reportId\":1,\"conditions\":[{\"field\":\"prov\",\"op\":\"in\",\"value\":[\"Heilongjiang\",\"Beijing\"]}]}]"
&DomainName=www.example1.com,www.example2.com
&Deliver="{\"email\":{\"subject\":\"The email subject\",\"to\":[\"example@alibaba-inc.com\",\"example@alibaba-inc.com\"]}}"
&Schedule={"schedName":"The name of the tracking task","description":"The description","crontab":"000**?","frequency":"d","status":"enable","effectiveFrom":"2020-09-17T00:00:00Z","effectiveEnd":"2020-11-17T00:00:00Z"}
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateCdnDeliverTaskResponse>
    <RequestId>04F0F334-1335-436C-A1D7-6C044FE73368</RequestId>
    <DeliverId>3368</DeliverId>
</CreateCdnDeliverTaskResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "RequestId" : "04F0F334-1335-436C-A1D7-6C044FE73368",
  "DeliverId" : "3368"
}

Error codes

HttpCode Error code Error message Description
400 InvalidParameter The specified parameter is invalid. The error message returned because the specified parameter is invalid.
400 TimeParseFailed Failed to parse the time parameter. The error message returned because the time parameter failed to be parsed.
400 SubscriptionAlreadyExists The subscription already exists. The error message returned because the tracking task already exists.
400 SubscriptionNotFound The subscription is not found. The error message returned because the tracking task does not exist.
400 NameAlreadyExists The name already exists. The error message returned because the name of the tracking task already exists.
400 DeliverExceedLimit The maximum number of subscribed tasks is exceeded. The error message returned because the maximum number of tracking tasks has been reached.

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