const fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/v1/policies:atomicOverwriteLogPolicies';
let options = {
method: 'POST',
headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
body: '{"policies":[{"policy":{"name":"My Policy","description":"My Policy Description","priority":"PRIORITY_TYPE_UNSPECIFIED","applicationRule":{"ruleTypeId":"RULE_TYPE_ID_UNSPECIFIED","name":"string"},"subsystemRule":{"ruleTypeId":"RULE_TYPE_ID_UNSPECIFIED","name":"string"},"archiveRetention":{"id":"string"}},"logRules":{"severities":["SEVERITY_UNSPECIFIED"]}}]}'
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));{
"createResponses": [
{
"policy": {
"id": "policy_id",
"companyId": 1234,
"name": "My Policy",
"priority": "PRIORITY_TYPE_UNSPECIFIED",
"deleted": false,
"enabled": true,
"order": 1,
"description": "My Policy Description",
"applicationRule": {
"ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED",
"name": "<string>"
},
"subsystemRule": {
"ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED",
"name": "<string>"
},
"logRules": {
"severities": [
"SEVERITY_UNSPECIFIED"
]
},
"spanRules": {
"serviceRule": {
"ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED",
"name": "<string>"
},
"actionRule": {
"ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED",
"name": "<string>"
},
"tagRules": [
{
"ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED",
"tagName": "tag_name",
"tagValue": "tag_value"
}
]
},
"createdAt": "2021-01-01T00:00:00.000Z",
"updatedAt": "2021-01-01T00:00:00.000Z",
"archiveRetention": {
"id": "<string>"
}
}
}
]
}No description available
const fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/v1/policies:atomicOverwriteLogPolicies';
let options = {
method: 'POST',
headers: {Authorization: 'Bearer <API_KEY>', 'content-type': 'application/json'},
body: '{"policies":[{"policy":{"name":"My Policy","description":"My Policy Description","priority":"PRIORITY_TYPE_UNSPECIFIED","applicationRule":{"ruleTypeId":"RULE_TYPE_ID_UNSPECIFIED","name":"string"},"subsystemRule":{"ruleTypeId":"RULE_TYPE_ID_UNSPECIFIED","name":"string"},"archiveRetention":{"id":"string"}},"logRules":{"severities":["SEVERITY_UNSPECIFIED"]}}]}'
};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));{
"createResponses": [
{
"policy": {
"id": "policy_id",
"companyId": 1234,
"name": "My Policy",
"priority": "PRIORITY_TYPE_UNSPECIFIED",
"deleted": false,
"enabled": true,
"order": 1,
"description": "My Policy Description",
"applicationRule": {
"ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED",
"name": "<string>"
},
"subsystemRule": {
"ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED",
"name": "<string>"
},
"logRules": {
"severities": [
"SEVERITY_UNSPECIFIED"
]
},
"spanRules": {
"serviceRule": {
"ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED",
"name": "<string>"
},
"actionRule": {
"ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED",
"name": "<string>"
},
"tagRules": [
{
"ruleTypeId": "RULE_TYPE_ID_UNSPECIFIED",
"tagName": "tag_name",
"tagValue": "tag_value"
}
]
},
"createdAt": "2021-01-01T00:00:00.000Z",
"updatedAt": "2021-01-01T00:00:00.000Z",
"archiveRetention": {
"id": "<string>"
}
}
}
]
}API key authentication
In an atomic operation delete all existing log policies and create the provided list by order.
In an atomic operation delete all existing log policies and create the provided list by order.
Show child attributes
This data structue is used to create a new policy.
Show child attributes
"My Policy"
"My Policy Description"
PRIORITY_TYPE_UNSPECIFIED, PRIORITY_TYPE_BLOCK, PRIORITY_TYPE_LOW, PRIORITY_TYPE_MEDIUM, PRIORITY_TYPE_HIGH A successful response.
This data structue is obtained when overwriting log policies atomically.
Show child attributes
A policy is a set of rules that define the behavior of the Coralogix system for a specific company.
Show child attributes
"policy_id"
1234
"My Policy"
PRIORITY_TYPE_UNSPECIFIED, PRIORITY_TYPE_BLOCK, PRIORITY_TYPE_LOW, PRIORITY_TYPE_MEDIUM, PRIORITY_TYPE_HIGH false
true
1
"My Policy Description"
Log rules for a policy.
Show child attributes
SEVERITY_UNSPECIFIED, SEVERITY_DEBUG, SEVERITY_VERBOSE, SEVERITY_INFO, SEVERITY_WARNING, SEVERITY_ERROR, SEVERITY_CRITICAL Show child attributes
Show child attributes
Show child attributes
Show child attributes
RULE_TYPE_ID_UNSPECIFIED, RULE_TYPE_ID_IS, RULE_TYPE_ID_IS_NOT, RULE_TYPE_ID_START_WITH, RULE_TYPE_ID_INCLUDES "tag_name"
"tag_value"
"2021-01-01T00:00:00.000Z"
"2021-01-01T00:00:00.000Z"
Was this page helpful?