Skip to main content
PUT
/
v1
/
metric
/
policies
/
{policyId}
JavaScript
import Roark from '@roarkanalytics/sdk';

const client = new Roark({
  bearerToken: process.env['ROARK_API_BEARER_TOKEN'], // This is the default and can be omitted
});

const metricPolicy = await client.metricPolicy.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(metricPolicy.data);
{
  "data": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "name": "<string>",
    "type": "SYSTEM",
    "status": "ACTIVE",
    "conditions": [
      {
        "conditions": [
          {
            "conditionType": "AGENT",
            "conditionKey": "<string>",
            "conditionOperator": "EQUALS",
            "conditionValue": "<string>"
          }
        ]
      }
    ],
    "metrics": [
      {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
      }
    ],
    "createdAt": "<string>",
    "updatedAt": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

policyId
string<uuid>
required

The ID of the metric policy to update

Body

application/json

Input for updating an existing metric policy

name
string

Name of the metric policy

Minimum string length: 1
status
enum<string>

Status of the policy

Available options:
ACTIVE,
INACTIVE
conditions
object[]

Condition groups. Omit to keep existing, provide empty array to remove all conditions.

metrics
object[]

Metric definitions to collect when this policy matches

Minimum array length: 1

Response

The updated metric policy

data
object
required

A metric policy defining when metrics should be collected