Skip to content

Publish Resources

1. API Description

Use this API to publish the draft version of a specified metric or dimension.

2. API URL

POST http://{anymetrics_host:anymetrics_port}/anymetrics/api/v1/resourceVersion/publish

To obtain anymetrics_host:anymetrics_port, see Calling APIs.

3. Request Parameters

3.1 Common Request Headers

Parameter Type Required Description
tenant-id String Yes Tenant ID that identifies the tenant to which the resource belongs.
auth-type String Yes Authentication type. Supported values: UID, TOKEN, ACCOUNT, APIKEY.
auth-value String Yes Authentication value corresponding to auth-type.

3.1.1 How to Obtain Common Parameters

In Aloudata CAN, select the metric application from the top navigation bar, then choose API Integration from the left navigation menu. You can obtain tenant-id on the API Integration page. Set auth-value to the authentication value required by the selected auth-type.

3.2 Request Body

Parameter Type Required Description
resourceType String Yes Resource type:
METRIC: metric
DIMENSION: dimension
resourceId String Yes Unique resource ID (UUID).
version String Yes Version to publish, such as V1 or V2.

5. Request Example

curl --location 'http://localhost:8083/anymetrics/api/v1/resourceVersion/publish' \
--header 'tenant-id: tn_xxx' \
--header 'auth-value: 492376865890107392' \
--header 'auth-type: UID' \
--header 'Content-Type: application/json' \
--data '[
  {
    "resourceType": "METRIC",
    "resourceId": "mc2db8445b3a7148b7bc6ba8b853aa44",
    "version": "V2"
  }
]'