CreateDeliveryTask
Creates a data delivery node that delivers metric data from a specified data source to a destination storage or MSMQ. Supports three delivery types: Prometheus Remote Write, Kafka, and MaxCompute. You can filter metrics by labels to specify the delivery scope and attach custom labels to the delivered metrics.
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
cms:CreateDeliveryTask |
create |
*DeliveryTask
|
None | None |
Request syntax
POST /delivery-tasks HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| body |
object |
No |
The request body. |
|
| dataSourceId |
string |
Yes |
The ID of the data source, which is the ID of the Prometheus instance. |
rw-xxxxxx |
| externalLabels |
object |
No |
The additional labels attached to all delivered metrics. The key is the label name and the value is the label value. |
|
|
string |
No |
The mapping between the external label key and the external label value, such as region → cn-hangzhou. |
region: cn-hangzhou |
|
| labelFilters |
object |
No |
The metric filtering conditions used in conjunction with labelFiltersType. The key is the metric label name and the value is the match value. |
|
|
string |
No |
The mapping between the filter key and the filter value, such as name → up or job → my_job. |
__name__: up |
|
| labelFiltersType |
string |
No |
The metric filtering mode. Valid values:
|
Allow |
| resourceGroupId |
string |
No |
The ID of the resource group. |
rg-ae******ey |
| sinkList |
array<object> |
Yes |
The list of delivery destinations. |
|
|
array<object> |
Yes |
The configuration of the delivery destination. |
||
| sinkConfigs |
object |
No |
The detailed configuration of the delivery destination. The meanings of the key and value vary based on the sinkType. For more information, see the following descriptions. |
|
|
string |
No |
The configuration items supported by each sinkType. For more information, see the following descriptions. |
Url: http://xxxx/api/v1/write |
|
| sinkType |
string |
Yes |
The type of the delivery destination. Valid values:
|
Prometheus |
| tags |
array<object> |
No |
The resource tags. |
|
|
object |
No |
The resource tags. |
||
| key |
string |
No |
The key of the resource tag. |
_cms_workspace |
| value |
string |
No |
The value of the resource tag. |
test |
| taskDescription |
string |
No |
The description of the task. |
my delivery task |
| taskName |
string |
Yes |
The name of the task. The name can contain Chinese characters, English letters, underscores (_), and hyphens (-). |
my-task |
sinkConfigs configuration items
sinkType = Prometheus
| Key | Required | Description | Example | Valid values |
| Url | Yes | The Remote Write endpoint. | http://xxxx/api/v1/write | |
| Network | No | The network type. | PublicNetwork | - PublicNetwork: public network - PrivateNetwork: private network or VPC |
| VpcId | No | The ID of the VPC. Required when Network is set to PrivateNetwork. | vpc-xxxxxx | |
| VSwtichId | No | The ID of the vSwitch. | vsw-xxxxxx | |
| SecurityGroupId | No | The ID of the security group. | sg-xxxxxx | |
| Header | No | The custom HTTP header. The value must be a map string in JSON format. | {"aaa":"bbb","ccc":"ddd"} | |
| AuthType | No | The authentication type. | BasicAuth | - BasicAuth - None |
| Username | No | The username for Basic Auth. Required when AuthType is set to BasicAuth. | admin | |
| Password | No | The password for Basic Auth. Required when AuthType is set to BasicAuth. | xxxxxx |
sinkType = AcsKafka
| Key | Required | Description | Example |
| InstanceId | Yes | The ID of the Kafka instance. | alikafka_xxxxx |
| Topic | Yes | The name of the Kafka topic. | my-topic |
sinkType = AcsMaxCompute
| Key | Required | Description | Example |
| ServiceName | Yes | The name of the MaxCompute service. | my-mc-service |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
Schema of Response |
||
| requestId |
string |
Id of the request |
4CB23A2E-B426-5D4B-9AA2-6C7A508D954B |
| taskId |
string |
The ID of the delivery task. |
98e367d8fb8cc83b |
Examples
Success response
JSON format
{
"requestId": "4CB23A2E-B426-5D4B-9AA2-6C7A508D954B",
"taskId": "98e367d8fb8cc83b"
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.