Skip to content

Modify Single Measurement Storage Policy



POST /api/v1/metrics_rp/modify

Overview

Body Parameters

Parameter Type Required Description
name string Y Measurement name
Example: cpu
duration string Y Standard storage duration, formatted as a day-level string <positive integer>d, e.g., 7d, 30d. For SaaS paid plans, the current selectable values for rp are 3d, 7d, 14d, 30d, 60d, 90d, 180d, 360d. For enterprise deployments, validation is based on the configured range. The actual selectable values depend on the current workspace plan configuration.
Example: 7d
storagePolicy json Long-term storage policy, optional. If not provided, the existing long-term storage policy for this measurement is retained. If no custom policy exists, it falls back to using the workspace's default rp long-term storage policy. Contains longStorageEnabled and longStorageDuration: longStorageEnabled indicates whether long-term storage is enabled, default is false. longStorageDuration indicates the total long-term storage duration, formatted as a day-level string <positive integer>d. This is required only when long-term storage is enabled, and must be greater than duration. Default selectable values are 90d, 120d, 180d, 360d. For enterprise deployment measurement rp, the current default range is 1d to 3600d.
Example: {'longStorageEnabled': False}

Parameter Details

Modify the data storage policy for a single measurement.

Parameter details: - duration indicates the standard storage duration, formatted as a day-level string: <positive integer>d, e.g., 7d, 30d. For SaaS paid plans, the current selectable values for rp are 3d, 7d, 14d, 30d, 60d, 90d, 180d, 360d. For enterprise deployments, validation is based on the configured range. The actual selectable values depend on the current workspace plan configuration. - storagePolicy indicates the long-term storage policy, optional. If not provided, the existing long-term storage policy for this measurement is retained. If the measurement has no custom policy, it falls back to using the workspace's default rp long-term storage policy. - storagePolicy.longStorageEnabled indicates whether long-term storage is enabled, default is false. When false is passed or the field is omitted, the backend treats it as long-term storage not enabled and normalizes longStorageDuration to an empty string. - storagePolicy.longStorageDuration indicates the total long-term storage duration, also formatted as <positive integer>d, e.g., 90d, 180d, 360d. This is required only when longStorageEnabled=true. In this case, the value must be greater than duration. - Default selectable values for long-term storage are 90d, 120d, 180d, 360d. For enterprise deployment measurement rp, validation supports the configured range, with the current default range being 1d to 3600d. The unlimited plan does not support enabling long-term storage.

Request Example

curl 'https://openapi.guance.com/api/v1/metrics_rp/modify' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Content-Type: application/json;charset=UTF-8' \
-H 'DF-API-KEY: <DF-API-KEY>' \
--data-raw $'{"name":"cpu","duration":"30d","storagePolicy":{"longStorageEnabled":false}}' \
--compressed

Response

{
    "code": 200,
    "content": {},
    "errorCode": "",
    "message": "",
    "success": true,
    "traceId": "TRACE-6FABDEAB-3FCE-4C12-B18C-9784636367B2"
}

Feedback

Is this page helpful? ×