curl --request POST \
--url https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"day": {},
"logRules": {
"severities": [],
"dpxlExpression": "<string>"
},
"applicationRule": {
"name": "<string>"
},
"spanRules": {
"actionRule": {
"name": "<string>"
},
"dpxlExpression": "<string>",
"serviceRule": {
"name": "<string>"
},
"tagRules": [
{
"tagName": "tag_name",
"tagValue": "tag_value"
}
]
},
"subsystemRule": {
"name": "<string>"
},
"timeBucketMs": "3600000",
"week": {}
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage"
payload = {
"day": {},
"logRules": {
"severities": [],
"dpxlExpression": "<string>"
},
"applicationRule": { "name": "<string>" },
"spanRules": {
"actionRule": { "name": "<string>" },
"dpxlExpression": "<string>",
"serviceRule": { "name": "<string>" },
"tagRules": [
{
"tagName": "tag_name",
"tagValue": "tag_value"
}
]
},
"subsystemRule": { "name": "<string>" },
"timeBucketMs": "3600000",
"week": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
day: {},
logRules: {severities: [], dpxlExpression: '<string>'},
applicationRule: {name: '<string>'},
spanRules: {
actionRule: {name: '<string>'},
dpxlExpression: '<string>',
serviceRule: {name: '<string>'},
tagRules: [{tagName: 'tag_name', tagValue: 'tag_value'}]
},
subsystemRule: {name: '<string>'},
timeBucketMs: '3600000',
week: {}
})
};
fetch('https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'day' => [
],
'logRules' => [
'severities' => [
],
'dpxlExpression' => '<string>'
],
'applicationRule' => [
'name' => '<string>'
],
'spanRules' => [
'actionRule' => [
'name' => '<string>'
],
'dpxlExpression' => '<string>',
'serviceRule' => [
'name' => '<string>'
],
'tagRules' => [
[
'tagName' => 'tag_name',
'tagValue' => 'tag_value'
]
]
],
'subsystemRule' => [
'name' => '<string>'
],
'timeBucketMs' => '3600000',
'week' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage"
payload := strings.NewReader("{\n \"day\": {},\n \"logRules\": {\n \"severities\": [],\n \"dpxlExpression\": \"<string>\"\n },\n \"applicationRule\": {\n \"name\": \"<string>\"\n },\n \"spanRules\": {\n \"actionRule\": {\n \"name\": \"<string>\"\n },\n \"dpxlExpression\": \"<string>\",\n \"serviceRule\": {\n \"name\": \"<string>\"\n },\n \"tagRules\": [\n {\n \"tagName\": \"tag_name\",\n \"tagValue\": \"tag_value\"\n }\n ]\n },\n \"subsystemRule\": {\n \"name\": \"<string>\"\n },\n \"timeBucketMs\": \"3600000\",\n \"week\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"day\": {},\n \"logRules\": {\n \"severities\": [],\n \"dpxlExpression\": \"<string>\"\n },\n \"applicationRule\": {\n \"name\": \"<string>\"\n },\n \"spanRules\": {\n \"actionRule\": {\n \"name\": \"<string>\"\n },\n \"dpxlExpression\": \"<string>\",\n \"serviceRule\": {\n \"name\": \"<string>\"\n },\n \"tagRules\": [\n {\n \"tagName\": \"tag_name\",\n \"tagValue\": \"tag_value\"\n }\n ]\n },\n \"subsystemRule\": {\n \"name\": \"<string>\"\n },\n \"timeBucketMs\": \"3600000\",\n \"week\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"day\": {},\n \"logRules\": {\n \"severities\": [],\n \"dpxlExpression\": \"<string>\"\n },\n \"applicationRule\": {\n \"name\": \"<string>\"\n },\n \"spanRules\": {\n \"actionRule\": {\n \"name\": \"<string>\"\n },\n \"dpxlExpression\": \"<string>\",\n \"serviceRule\": {\n \"name\": \"<string>\"\n },\n \"tagRules\": [\n {\n \"tagName\": \"tag_name\",\n \"tagValue\": \"tag_value\"\n }\n ]\n },\n \"subsystemRule\": {\n \"name\": \"<string>\"\n },\n \"timeBucketMs\": \"3600000\",\n \"week\": {}\n}"
response = http.request(request)
puts response.read_body{
"estimatedBytes": "13251739648"
}{
"code": 349,
"message": "<string>"
}{
"code": 349,
"message": "<string>"
}{
"code": 349,
"message": "<string>"
}Forecast Policy Usage
Forecasts the usage in bytes that a draft TCO policy would match over the requested time window, given its application/subsystem rules and log or span filters. Use this before saving a new or modified policy to see the impact on your quota.
curl --request POST \
--url https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"day": {},
"logRules": {
"severities": [],
"dpxlExpression": "<string>"
},
"applicationRule": {
"name": "<string>"
},
"spanRules": {
"actionRule": {
"name": "<string>"
},
"dpxlExpression": "<string>",
"serviceRule": {
"name": "<string>"
},
"tagRules": [
{
"tagName": "tag_name",
"tagValue": "tag_value"
}
]
},
"subsystemRule": {
"name": "<string>"
},
"timeBucketMs": "3600000",
"week": {}
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage"
payload = {
"day": {},
"logRules": {
"severities": [],
"dpxlExpression": "<string>"
},
"applicationRule": { "name": "<string>" },
"spanRules": {
"actionRule": { "name": "<string>" },
"dpxlExpression": "<string>",
"serviceRule": { "name": "<string>" },
"tagRules": [
{
"tagName": "tag_name",
"tagValue": "tag_value"
}
]
},
"subsystemRule": { "name": "<string>" },
"timeBucketMs": "3600000",
"week": {}
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
day: {},
logRules: {severities: [], dpxlExpression: '<string>'},
applicationRule: {name: '<string>'},
spanRules: {
actionRule: {name: '<string>'},
dpxlExpression: '<string>',
serviceRule: {name: '<string>'},
tagRules: [{tagName: 'tag_name', tagValue: 'tag_value'}]
},
subsystemRule: {name: '<string>'},
timeBucketMs: '3600000',
week: {}
})
};
fetch('https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'day' => [
],
'logRules' => [
'severities' => [
],
'dpxlExpression' => '<string>'
],
'applicationRule' => [
'name' => '<string>'
],
'spanRules' => [
'actionRule' => [
'name' => '<string>'
],
'dpxlExpression' => '<string>',
'serviceRule' => [
'name' => '<string>'
],
'tagRules' => [
[
'tagName' => 'tag_name',
'tagValue' => 'tag_value'
]
]
],
'subsystemRule' => [
'name' => '<string>'
],
'timeBucketMs' => '3600000',
'week' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage"
payload := strings.NewReader("{\n \"day\": {},\n \"logRules\": {\n \"severities\": [],\n \"dpxlExpression\": \"<string>\"\n },\n \"applicationRule\": {\n \"name\": \"<string>\"\n },\n \"spanRules\": {\n \"actionRule\": {\n \"name\": \"<string>\"\n },\n \"dpxlExpression\": \"<string>\",\n \"serviceRule\": {\n \"name\": \"<string>\"\n },\n \"tagRules\": [\n {\n \"tagName\": \"tag_name\",\n \"tagValue\": \"tag_value\"\n }\n ]\n },\n \"subsystemRule\": {\n \"name\": \"<string>\"\n },\n \"timeBucketMs\": \"3600000\",\n \"week\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"day\": {},\n \"logRules\": {\n \"severities\": [],\n \"dpxlExpression\": \"<string>\"\n },\n \"applicationRule\": {\n \"name\": \"<string>\"\n },\n \"spanRules\": {\n \"actionRule\": {\n \"name\": \"<string>\"\n },\n \"dpxlExpression\": \"<string>\",\n \"serviceRule\": {\n \"name\": \"<string>\"\n },\n \"tagRules\": [\n {\n \"tagName\": \"tag_name\",\n \"tagValue\": \"tag_value\"\n }\n ]\n },\n \"subsystemRule\": {\n \"name\": \"<string>\"\n },\n \"timeBucketMs\": \"3600000\",\n \"week\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coralogix.com/mgmt/openapi/5/dataplans/policies/v1/all/forecast-usage")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"day\": {},\n \"logRules\": {\n \"severities\": [],\n \"dpxlExpression\": \"<string>\"\n },\n \"applicationRule\": {\n \"name\": \"<string>\"\n },\n \"spanRules\": {\n \"actionRule\": {\n \"name\": \"<string>\"\n },\n \"dpxlExpression\": \"<string>\",\n \"serviceRule\": {\n \"name\": \"<string>\"\n },\n \"tagRules\": [\n {\n \"tagName\": \"tag_name\",\n \"tagValue\": \"tag_value\"\n }\n ]\n },\n \"subsystemRule\": {\n \"name\": \"<string>\"\n },\n \"timeBucketMs\": \"3600000\",\n \"week\": {}\n}"
response = http.request(request)
puts response.read_body{
"estimatedBytes": "13251739648"
}{
"code": 349,
"message": "<string>"
}{
"code": 349,
"message": "<string>"
}{
"code": 349,
"message": "<string>"
}Authorizations
API key authentication
Body
- Forecast Policy Usage Request
- Forecast Policy Usage Request
- Forecast Policy Usage Request
- Forecast Policy Usage Request
- Forecast Policy Usage Request
- Forecast Policy Usage Request
- Forecast Policy Usage Request
- Forecast Policy Usage Request
- Forecast Policy Usage Request
- Forecast Policy Usage Request
- Forecast Policy Usage Request
- Forecast Policy Usage Request
Request to forecast the usage in bytes of a draft TCO policy, based on the bytes matched by its filter rules over a given time window.
Marker selecting a one-day forecast window.
Log rules for a policy.
Show child attributes
Show child attributes
Rule.
Show child attributes
Show child attributes
Log rules for a policy.
Show child attributes
Show child attributes
Span rules.
Show child attributes
Show child attributes
Rule.
Show child attributes
Show child attributes
Optional bucket size, in milliseconds, used to split the forecast into time buckets. When set, the response includes a per-bucket breakdown in usage_buckets; when omitted, only the total estimated bytes are returned.
1 - 20^-?[0-9]+$"3600000"
Marker selecting a one-week forecast window.
Response
Forecasted usage in bytes for a draft TCO policy, based on bytes matched over a given time window.
Estimated number of bytes the draft policy would match over the requested time window.
1 - 20^-?[0-9]+$"13251739648"
Per-bucket breakdown of matched bytes over the requested time window. Empty unless time_bucket_ms was set on the request.
10080Show child attributes
Show child attributes
Was this page helpful?