Get Storage Policy

Get the detailed information of the specified storage policy with the storage policy ID, including the storage policy name, stored data type, storage time, and models and measurement points (with data compression configuration) that are configured with the storage policy.

Request Format

GET https://{apigw-address}/tsdb-policy/v2.1/policies/{policyId}

Request Parameters (URI)

Name

Location (Path/Query)

Mandatory/Optional

Data Type

Description

policyId

Path

Mandatory

String

The storage policy ID, which can be retrieved through the EnOS Management Console > Time Series Data Management > Storage Policy page.

orgId

Query

Mandatory

String

The organization ID which the asset belongs to. How to get organization ID>>

Response Parameters

Name

Data Type

Description

data

List<JSONObject>

The detailed information of the storage policy. See Storage Policy Struct

Storage Policy Struct

Name

Data Type

Description

policyId

String

The storage policy ID.

policyName

String

The storage policy name.

policyType

String

The storage type.

retention

String

The data storage time.

models

List<JSONObject>

The list of models and measurement points. See Model and Point Struct

Model and Point Struct

Point Compression Configuration

Name

Data Type

Description

pointId

String

Measurement point ID.

sdt

JSONObject

Swinging Door Trending Compression parameters, including the configuration of compdev, compmax, and compmin parameters.

db

JSONObject

Dead Band Compression parameters, including the configuration of excdev, excmax, and excmin parameters.

Sample

{
   "policyId": "yourPolicyId",
   "policyName": "yourPolicyName",
   "policyType": "yourPolicyType",
   "retention": "6M",
   "models": [
      {
         "modelId": "yourModelId1",
         "points": [
            {
               "pointId": "yourPointId1",
               "sdt": {
                  "compdev": 0.22,
                  "compmax": 2200,
                  "compmin": 22
               },
               "db": {
                  "excdev": 0.11,
                  "excmax": 100,
                  "excmin": 11
               }
            },
            {
               "pointId": "yourPointId2",
               "sdt": null,
               "db": null
            },
            {
               "pointId": "yourPointId3",
               "sdt": {
                  "compdev": 0.22,
                  "compmax": 2200,
                  "compmin": 22
               },
               "db": null
            }
         ]
      },
      {
         "modelId": "yourModelId2",
         "points": [
            {
               "pointId": "yourPointId4",
               "sdt": {
                  "compdev": 0.22,
                  "compmax": 2200,
                  "compmin": 22
               },
               "db": {
                  "excdev": 0.11,
                  "excmax": 1100,
                  "excmin": 11
               }
            }
         ]
      }
   ]
}

Error Code

For the description of error codes, see Common Error Codes.

Samples

Request Sample

url: https://{apigw-address}/tsdb-policy/v2.1/policies/yourPolicyId?orgId=yourOrgId

method: GET

Return Sample

{
   "code": 0,
   "msg": "OK",
   "submsg": null,
   "data": {
      "policyId": "yourPolicyId",
      "policyName": "yourPolicyName",
      "policyType": "yourPolicyType",
      "retention": "6M",
      "models": [
         {
            "modelId": "yourModelId1",
            "points": [
               {
                  "pointId": "yourPointId1",
                  "sdt": {
                     "compdev": 0.22,
                     "compmax": 2200,
                     "compmin": 22
                  },
                  "db": {
                     "excdev": 0.11,
                     "excmax": 100,
                     "excmin": 11
                  }
               },
               {
                  "pointId": "yourPointId2",
                  "sdt": null,
                  "db": null
               },
               {
                  "pointId": "yourPointId3",
                  "sdt": {
                     "compdev": 0.22,
                     "compmax": 2200,
                     "compmin": 22
                  },
                  "db": null
               }
            ]
         },
         {
            "modelId": "yourModelId2",
            "points": [
               {
                  "pointId": "yourPointId4",
                  "sdt": {
                     "compdev": 0.22,
                     "compmax": 2200,
                     "compmin": 22
                  },
                  "db": {
                     "excdev": 0.11,
                     "excmax": 1100,
                     "excmin": 11
                  }
               }
            ]
         }
      ]
   }
}

SDK Samples


You can access the Java SDK samples for TSDB policy service on GitHub.