const fetch = require('node-fetch');
let url = 'https://api.coralogix.com/mgmt/openapi/v1/policies?enabledOnly=SOME_BOOLEAN_VALUE&sourceType=SOME_STRING_VALUE';
let options = {method: 'GET', headers: {Authorization: 'Bearer <API_KEY>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"policies": [
{
"id": "policy_id",
"companyId": 1234,
"name": "My Policy",
"description": "My Policy Description",
"priority": "PRIORITY_TYPE_UNSPECIFIED",
"deleted": false,
"enabled": true,
"order": 1,
"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?enabledOnly=SOME_BOOLEAN_VALUE&sourceType=SOME_STRING_VALUE';
let options = {method: 'GET', headers: {Authorization: 'Bearer <API_KEY>'}};
fetch(url, options)
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('error:' + err));
{
"policies": [
{
"id": "policy_id",
"companyId": 1234,
"name": "My Policy",
"description": "My Policy Description",
"priority": "PRIORITY_TYPE_UNSPECIFIED",
"deleted": false,
"enabled": true,
"order": 1,
"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
SOURCE_TYPE_UNSPECIFIED
, SOURCE_TYPE_LOGS
, SOURCE_TYPE_SPANS
A successful response.
This data structue is obtained when retrieving all policies of a company.
Was this page helpful?