Creates a real-time log delivery task.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- For mandatory resource types, indicate with a prefix of * .
- If the permissions cannot be granted at the resource level,
All Resourcesis used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
| Operation | Access level | Resource type | Condition key | Associated operation |
|---|---|---|---|---|
| esa:CreateSiteDeliveryTask | none | *Site acs:esa:{#regionId}:{#accountId}:site/{#SiteId} |
| none |
Request parameters
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| BusinessType | string | Yes | The log category. Valid values:
| dcdn_log_access_l1 |
| SiteId | long | Yes | The website ID, which can be obtained by calling the ListSites operation. | 12312312112*** |
| DataCenter | string | Yes | The data center. Valid values:
| cn |
| TaskName | string | Yes | The name of the delivery task. | dcdn-test-task |
| FieldName | string | Yes | The log fields, which are separated by commas (,). | user_agent,ip_adress,ip_port |
| DeliveryType | string | Yes | The destination of the delivery. Valid values:
| sls |
| DiscardRate | float | No | The discard rate. Default value: 0. | 0.0 |
| S3Delivery | object | No | The configurations for delivery to Amazon S3 or an S3-compatible service. | |
| Region | string | No | The region ID of the service. | cn-beijing |
| BucketPath | string | No | The directory in the bucket. | logriver-test/log |
| AccessKey | string | No | The access key ID of your Amazon S3 account. | yourAccessKeyID |
| SecretKey | string | No | The secret access key of your Amazon S3 account. | LDSIKh*** |
| Endpoint | string | No | The endpoint. This parameter is required when the S3Cmpt parameter is set to true. | https://s3.oss-cn-hangzhou.aliyuncs.com |
| PrefixPath | string | No | The prefix of the path in which you want to store logs. | logriver-test/log |
| S3Cmpt | boolean | No | Specifies whether the service is compatible with Amazon S3. | true |
| OssDelivery | object | No | The configurations for delivery to OSS. | |
| Region | string | No | The region in which the bucket is located. | cn-beijing |
| Aliuid | string | No | The ID of your Alibaba Cloud account. | 1234*** |
| BucketName | string | No | The name of the OSS bucket. | test_rlog |
| PrefixPath | string | No | The prefix of the path in which you want to store logs. | logriver-test/log |
| HttpDelivery | object | No | The configurations for delivery to an HTTP server. | |
| DestUrl | string | No | The address of the HTTP server. | http://xxx.aliyun.com/v1/log/upload |
| StandardAuthOn | boolean | No | Specifies whether to use server authentication. | true |
| StandardAuthParam | object | No | The authentication configurations. | |
| PrivateKey | string | No | The private key. | *** |
| ExpiredTime | integer | No | The validity period of the signature. Note
The value must be greater than 0. We recommend that you specify a value that is greater than 300.
| 300 |
| UrlPath | string | No | The URI path for server authentication. | v1/log/upload |
| MaxBatchSize | long | No | The maximum number of entries for each delivery. | 1000 |
| MaxBatchMB | long | No | The maximum size of data for each delivery. Unit: MB. | 5 |
| MaxRetry | long | No | The maximum number of retries. | 3 |
| TransformTimeout | long | No | The timeout period. Unit: seconds. | 10 |
| LogBodyPrefix | string | No | The prefix of the log delivery package. | cdnVersion:1.0 |
| LogBodySuffix | string | No | The suffix of the log delivery package. | cdnVersion:1.0 |
| Compress | string | No | The compression method. By default, data is not compressed. | gzip |
| HeaderParam | object | No | The custom headers. | |
| object | No | The header field. | ||
| StaticValue | string | No | The static variable. | alicdn |
| QueryParam | object | No | The custom query parameters. | |
| object | No | The name of the custom request parameter. | ||
| StaticValue | string | No | The static variable. | alicdn |
| KafkaDelivery | object | No | The configurations for delivery to Kafka. | |
| Topic | string | No | The topic. | dqc_test2 |
| UserAuth | boolean | No | Specifies whether to enable authentication. | true |
| MachanismType | string | No | The encryption method. | plain |
| UserName | string | No | The username. | xxx |
| Password | string | No | The password. | *** |
| Brokers | array | No | The brokers. | |
| string | No | The Kafka brokers. | 192.168.xxx.xxx:9902 | |
| Compress | string | No | The compression method. | gzip |
| Balancer | string | No | The load balancing method. | kafka.LeastBytes |
| SlsDelivery | object | No | The configurations for delivery to SLS. | |
| SLSRegion | string | No | The region in which the SLS project resides. | cn-hangzhou |
| SLSProject | string | No | The name of the SLS project. | dcdn-test20240417 |
| SLSLogStore | string | No | The name of the Logstore. | accesslog-test |
Response parameters
Examples
Sample success responses
JSONformat
{
"RequestId": "9358E852-992D-5BC7-8BD7-975CA02773A8",
"TaskName": "er-oss",
"SiteId": "123456****",
"DataCenter": "cn"
}Error codes
| HTTP status code | Error code | Error message | Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is invalid. | The specified parameter is invalid. |
| 400 | RealTimeLog.ProjectExistError | The real-time log delivery task name already exists. Check the task name and try again. | The real-time log delivery task name already exists. Check the task name and try again. |
| 400 | InternalError | An internal exception occurred, please try again later. | An inner exception was triggered. Please try again later. |
| 403 | RealTimeLog.KafkaBrokersExceedError | The number of Kafka Broker addresses for real-time log delivery has reached the upper limit (50). | The number of Kafka Broker addresses for real-time log delivery has reached the upper limit (50). |
| 403 | RealTimeLog.S3EndpointInvalidError | Invalid S3 information for the delivery task. Check your configurations and try again. | Invalid S3 information for the delivery task. Check your configurations and try again. |
| 403 | RealTimeLog.StatusQuotaError | The maximum number of real-time log delivery tasks has been reached. Check your plan quota and upgrade the plan to request a quota increase. | The maximum number of real-time log delivery tasks has been reached. Check your plan quota and upgrade the plan to request a quota increase. |
| 403 | EsaService.NotOpen | ESA service has not opend. | Edge Security Accelerator (ESA) is not turned on |
For a list of error codes, visit the Service error codes.
Change history
| Change time | Summary of changes | Operation |
|---|---|---|
| 2025-02-28 | The Error code has changed. The response structure of the API has changed | View Change Details |
| 2024-10-18 | The Error code has changed | View Change Details |
| 2024-09-27 | The Error code has changed | View Change Details |
| 2024-09-24 | The Error code has changed | View Change Details |
