Replace a dashboard
curl --request PUT \
--url https://api.coralogix.com/mgmt/openapi/4/dashboards/dashboards/v1 \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"dashboard": {
"layout": {
"sections": [
{
"id": {
"value": "<string>"
},
"options": {
"internal": {}
},
"rows": [
{
"appearance": {
"height": 123
},
"id": {
"value": "<string>"
},
"widgets": [
{
"appearance": {
"width": 123
},
"createdAt": "2023-11-07T05:31:56Z",
"definition": {
"hexagon": {
"customUnit": "<string>",
"decimal": 2,
"decimalPrecision": false,
"legend": {
"columns": [
1,
2,
6
],
"groupByQuery": true,
"isVisible": true
},
"max": 150000,
"min": 0,
"query": {
"spans": {
"filters": [
{
"field": {
"processTagField": "<string>"
},
"observationField": {
"keypath": [
"<string>"
]
},
"operator": {
"equals": {
"selection": {
"all": {}
}
}
}
}
],
"groupBy": [
{
"processTagField": "<string>"
}
],
"groupBys": [
{
"keypath": [
"<string>"
]
}
],
"luceneQuery": {
"value": "<string>"
},
"spansAggregation": {
"metricAggregation": {}
},
"timeFrame": {
"absoluteTimeFrame": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
}
}
}
},
"thresholds": [
{
"color": "<string>",
"from": 123,
"label": "<string>"
}
]
}
},
"description": "<string>",
"id": {
"value": "<string>"
},
"title": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
]
}
]
},
"name": "Example Name",
"absoluteTimeFrame": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"actions": [
{
"definition": {
"customAction": {
"url": "<string>"
}
},
"id": "<string>",
"name": "<string>",
"shouldOpenInNewWindow": true,
"widgetId": "<string>"
}
],
"annotations": [
{
"description": "<string>",
"enabled": true,
"id": "<string>",
"name": "<string>",
"scope": {
"allWidgets": {}
},
"source": {
"spans": {
"labelFields": [
{
"keypath": [
"<string>"
]
}
],
"luceneQuery": {
"value": "<string>"
},
"messageTemplate": "<string>",
"strategy": {
"instant": {
"timestampField": {
"keypath": [
"<string>"
]
}
}
}
}
}
}
],
"description": "Sample description",
"filters": [
{
"collapsed": true,
"displayName": "<string>",
"enabled": true,
"id": {
"value": "<string>"
},
"source": {
"logs": {
"field": "<string>",
"observationField": {
"keypath": [
"<string>"
]
},
"operator": {
"equals": {
"selection": {
"all": {}
}
}
}
}
}
}
],
"folderId": {
"value": "<string>"
},
"folderPath": {
"segments": [
"<string>"
]
},
"id": "GZLHSeqelCbD3I7HbIDtL",
"off": {},
"slugName": "system-health-monitoring",
"variables": [
{
"definition": {
"constant": {
"value": "<string>"
}
},
"description": "<string>",
"displayName": "<string>",
"name": "<string>"
}
],
"variablesV2": [
{
"description": "<string>",
"displayFullRow": true,
"displayName": "<string>",
"id": {
"value": "<string>"
},
"name": "<string>",
"source": {
"static": {
"allOption": {
"includeAll": true,
"label": "<string>"
},
"values": [
{
"isDefault": true,
"label": "<string>",
"value": "<string>"
}
]
}
},
"value": {
"multiString": {
"all": {}
}
}
}
]
},
"requestId": "<string>",
"isLocked": true
}
'import requests
url = "https://api.coralogix.com/mgmt/openapi/4/dashboards/dashboards/v1"
payload = {
"dashboard": {
"layout": { "sections": [
{
"id": { "value": "<string>" },
"options": { "internal": {} },
"rows": [
{
"appearance": { "height": 123 },
"id": { "value": "<string>" },
"widgets": [
{
"appearance": { "width": 123 },
"createdAt": "2023-11-07T05:31:56Z",
"definition": { "hexagon": {
"customUnit": "<string>",
"decimal": 2,
"decimalPrecision": False,
"legend": {
"columns": [1, 2, 6],
"groupByQuery": True,
"isVisible": True
},
"max": 150000,
"min": 0,
"query": { "spans": {
"filters": [
{
"field": { "processTagField": "<string>" },
"observationField": { "keypath": ["<string>"] },
"operator": { "equals": { "selection": { "all": {} } } }
}
],
"groupBy": [{ "processTagField": "<string>" }],
"groupBys": [{ "keypath": ["<string>"] }],
"luceneQuery": { "value": "<string>" },
"spansAggregation": { "metricAggregation": {} },
"timeFrame": { "absoluteTimeFrame": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
} }
} },
"thresholds": [
{
"color": "<string>",
"from": 123,
"label": "<string>"
}
]
} },
"description": "<string>",
"id": { "value": "<string>" },
"title": "<string>",
"updatedAt": "2023-11-07T05:31:56Z"
}
]
}
]
}
] },
"name": "Example Name",
"absoluteTimeFrame": {
"from": "2023-11-07T05:31:56Z",
"to": "2023-11-07T05:31:56Z"
},
"actions": [
{
"definition": { "customAction": { "url": "<string>" } },
"id": "<string>",
"name": "<string>",
"shouldOpenInNewWindow": True,
"widgetId": "<string>"
}
],
"annotations": [
{
"description": "<string>",
"enabled": True,
"id": "<string>",
"name": "<string>",
"scope": { "allWidgets": {} },
"source": { "spans": {
"labelFields": [{ "keypath": ["<string>"] }],
"luceneQuery": { "value": "<string>" },
"messageTemplate": "<string>",
"strategy": { "instant": { "timestampField": { "keypath": ["<string>"] } } }
} }
}
],
"description": "Sample description",
"filters": [
{
"collapsed": True,
"displayName": "<string>",
"enabled": True,
"id": { "value": "<string>" },
"source": { "logs": {
"field": "<string>",
"observationField": { "keypath": ["<string>"] },
"operator": { "equals": { "selection": { "all": {} } } }
} }
}
],
"folderId": { "value": "<string>" },
"folderPath": { "segments": ["<string>"] },
"id": "GZLHSeqelCbD3I7HbIDtL",
"off": {},
"slugName": "system-health-monitoring",
"variables": [
{
"definition": { "constant": { "value": "<string>" } },
"description": "<string>",
"displayName": "<string>",
"name": "<string>"
}
],
"variablesV2": [
{
"description": "<string>",
"displayFullRow": True,
"displayName": "<string>",
"id": { "value": "<string>" },
"name": "<string>",
"source": { "static": {
"allOption": {
"includeAll": True,
"label": "<string>"
},
"values": [
{
"isDefault": True,
"label": "<string>",
"value": "<string>"
}
]
} },
"value": { "multiString": { "all": {} } }
}
]
},
"requestId": "<string>",
"isLocked": True
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
dashboard: {
layout: {
sections: [
{
id: {value: '<string>'},
options: {internal: {}},
rows: [
{
appearance: {height: 123},
id: {value: '<string>'},
widgets: [
{
appearance: {width: 123},
createdAt: '2023-11-07T05:31:56Z',
definition: {
hexagon: {
customUnit: '<string>',
decimal: 2,
decimalPrecision: false,
legend: {columns: [1, 2, 6], groupByQuery: true, isVisible: true},
max: 150000,
min: 0,
query: {
spans: {
filters: [
{
field: {processTagField: '<string>'},
observationField: {keypath: ['<string>']},
operator: {equals: {selection: {all: {}}}}
}
],
groupBy: [{processTagField: '<string>'}],
groupBys: [{keypath: ['<string>']}],
luceneQuery: {value: '<string>'},
spansAggregation: {metricAggregation: {}},
timeFrame: {absoluteTimeFrame: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'}}
}
},
thresholds: [{color: '<string>', from: 123, label: '<string>'}]
}
},
description: '<string>',
id: {value: '<string>'},
title: '<string>',
updatedAt: '2023-11-07T05:31:56Z'
}
]
}
]
}
]
},
name: 'Example Name',
absoluteTimeFrame: {from: '2023-11-07T05:31:56Z', to: '2023-11-07T05:31:56Z'},
actions: [
{
definition: {customAction: {url: '<string>'}},
id: '<string>',
name: '<string>',
shouldOpenInNewWindow: true,
widgetId: '<string>'
}
],
annotations: [
{
description: '<string>',
enabled: true,
id: '<string>',
name: '<string>',
scope: {allWidgets: {}},
source: {
spans: {
labelFields: [{keypath: ['<string>']}],
luceneQuery: {value: '<string>'},
messageTemplate: '<string>',
strategy: {instant: {timestampField: {keypath: ['<string>']}}}
}
}
}
],
description: 'Sample description',
filters: [
{
collapsed: true,
displayName: '<string>',
enabled: true,
id: {value: '<string>'},
source: {
logs: {
field: '<string>',
observationField: {keypath: ['<string>']},
operator: {equals: {selection: {all: {}}}}
}
}
}
],
folderId: {value: '<string>'},
folderPath: {segments: ['<string>']},
id: 'GZLHSeqelCbD3I7HbIDtL',
off: {},
slugName: 'system-health-monitoring',
variables: [
{
definition: {constant: {value: '<string>'}},
description: '<string>',
displayName: '<string>',
name: '<string>'
}
],
variablesV2: [
{
description: '<string>',
displayFullRow: true,
displayName: '<string>',
id: {value: '<string>'},
name: '<string>',
source: {
static: {
allOption: {includeAll: true, label: '<string>'},
values: [{isDefault: true, label: '<string>', value: '<string>'}]
}
},
value: {multiString: {all: {}}}
}
]
},
requestId: '<string>',
isLocked: true
})
};
fetch('https://api.coralogix.com/mgmt/openapi/4/dashboards/dashboards/v1', 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/4/dashboards/dashboards/v1",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'dashboard' => [
'layout' => [
'sections' => [
[
'id' => [
'value' => '<string>'
],
'options' => [
'internal' => [
]
],
'rows' => [
[
'appearance' => [
'height' => 123
],
'id' => [
'value' => '<string>'
],
'widgets' => [
[
'appearance' => [
'width' => 123
],
'createdAt' => '2023-11-07T05:31:56Z',
'definition' => [
'hexagon' => [
'customUnit' => '<string>',
'decimal' => 2,
'decimalPrecision' => false,
'legend' => [
'columns' => [
1,
2,
6
],
'groupByQuery' => true,
'isVisible' => true
],
'max' => 150000,
'min' => 0,
'query' => [
'spans' => [
'filters' => [
[
'field' => [
'processTagField' => '<string>'
],
'observationField' => [
'keypath' => [
'<string>'
]
],
'operator' => [
'equals' => [
'selection' => [
'all' => [
]
]
]
]
]
],
'groupBy' => [
[
'processTagField' => '<string>'
]
],
'groupBys' => [
[
'keypath' => [
'<string>'
]
]
],
'luceneQuery' => [
'value' => '<string>'
],
'spansAggregation' => [
'metricAggregation' => [