All Products
Search
Document Center

Cloud Monitor:CreateDeliveryTask

Last Updated:Mar 27, 2026

Create a data delivery task to deliver metric data from a data source to a storage destination or message queue. This task supports three delivery types: Prometheus Remote Write, Kafka, and MaxCompute. You can also use tags to filter which metrics are delivered and attach custom tags to them.

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

No authorization for this operation. If you encounter issues with this operation, contact technical support.

Request syntax

POST /delivery-tasks HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request body.

taskName

string

Yes

The name of the task. The name can contain Chinese characters, English letters, underscores (_), and hyphens (-).

my-task

dataSourceId

string

Yes

The ID of the Prometheus instance that serves as the data source.

rw-xxxxxx

taskDescription

string

No

The task description.

my delivery task

labelFiltersType

string

No

The mode for applying the label filters.

Allow

labelFilters

object

No

The label conditions for filtering metrics. The key is the label name and the value is the value to match. The filtering behavior is controlled by labelFiltersType.

string

No

A key-value pair that specifies a filter condition. For example, __name__: up or job: my_job.

__name__: up

externalLabels

object

No

A map of key-value pairs to attach as additional labels to all delivered metrics.

string

No

A key-value pair for an external label. For example, region: cn-hangzhou.

region: cn-hangzhou

sinkList

array<object>

Yes

An array of delivery destination objects.

array<object>

Yes

An object that contains the configuration for a delivery destination.

sinkType

string

Yes

The type of the delivery destination (sink).

Prometheus

sinkConfigs

object

No

The configuration for the sink, specified as key-value pairs. The valid keys and values depend on the value of sinkType.

string

No

A configuration setting for the sink. The available settings depend on the sinkType.

Url: http://xxxx/api/v1/write

resourceGroupId

string

No

The ID of the resource group.

rg-ae******ey

tags

array<object>

No

An array of resource tags.

object

No

A resource tag, specified as a key-value pair.

key

string

No

The key of the resource tag.

_cms_workspace

value

string

No

The value of the resource tag.

test

SinkConfigs parameters

sinkType = Prometheus

KeyRequiredDescriptionExample valueEnumerated values
UrlYesRemote Write endpoint.http://xxxx/api/v1/write
NetworkNoNetwork type.PublicNetwork- PublicNetwork (public network)
- PrivateNetwork (private network/VPC)

VpcIdNoVPC ID. Required if Network is PrivateNetwork.vpc-xxxxxx
VSwitchIdNoVSwitch ID.vsw-xxxxxx
SecurityGroupIdNoSecurity group ID.sg-xxxxxx
HeaderNoCustom HTTP headers, specified as a JSON-formatted map string.{"aaa":"bbb","ccc":"ddd"}
AuthTypeNoAuthentication type.BasicAuth- BasicAuth
- None

UsernameNoUsername for basic authentication. Required if AuthType is BasicAuth.admin
PasswordNoPassword for basic authentication. Required if AuthType is BasicAuth.xxxxxx

sinkType = AcsKafka

KeyRequiredDescriptionExample value
InstanceIdYesKafka instance ID.alikafka_xxxxx
TopicYesKafka topic name.my-topic

sinkType = AcsMaxCompute

KeyRequiredDescriptionExample value
ServiceNameYesMaxCompute service name.my-mc-service

Response elements

Element

Type

Description

Example

object

The data returned in the response.

requestId

string

The unique ID for 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.