Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions plugins/SplunkCloudStatus/v1/configValidation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"steps": [
{
"displayName": "Read the Splunk Cloud status page",
"dataStream": {
"name": "statusValidation"
},
"required": true,
"error": "Could not read the Splunk Cloud status page. Check status.splunkcloud.com is reachable from the SquaredUp agent or cloud.",
"success": "Status page read successfully."
}
]
}
66 changes: 66 additions & 0 deletions plugins/SplunkCloudStatus/v1/dataStreams/componentStatus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "componentStatus",
"displayName": "Component Status",
"description": "Current status of each Splunk Cloud Platform component, one row per component",
"tags": ["Status"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "components.json",
"paging": {
"mode": "none"
},
"postRequestScript": "componentStatus.js"
},
"matches": "none",
"metadata": [
{
"name": "id",
"displayName": "ID",
"shape": "string",
"role": "id",
"visible": false
},
{
"name": "name",
"displayName": "Component",
"shape": "string",
"role": "label"
},
{
"name": "group",
"displayName": "Group",
"shape": "string"
},
{
"name": "status",
"displayName": "Status",
"shape": "string"
},
{
"name": "state",
"displayName": "State",
"shape": "state"
},
{
"name": "severity",
"displayName": "Severity",
"shape": "number",
"visible": false
},
{
"name": "updatedAt",
"displayName": "Status changed",
"shape": "date"
}
],
"defaultShaping": {
"sort": {
"by": [
["severity", "desc"],
["name", "asc"]
]
}
},
"timeframes": false
}
115 changes: 115 additions & 0 deletions plugins/SplunkCloudStatus/v1/dataStreams/incidents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"name": "incidents",
"displayName": "Incidents",
"description": "Splunk Cloud Platform incidents, one row per incident (or per affected component), with impact, timing and the latest update",
"tags": ["Status", "Incidents"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "incidents.json",
"paging": {
"mode": "none"
},
"postRequestScript": "incidents.js"
},
"matches": "none",
"ui": [
{
"type": "toggle",
"name": "oneRowPerComponent",
"label": "One row per affected component",
"defaultValue": false,
"help": "Splits an incident that affects several components into one row per component, so tiles can group by component. When off, each incident is one row."
}
],
"metadata": [
{
"name": "id",
"displayName": "ID",
"shape": "string",
"role": "id",
"visible": false
},
{
"name": "name",
"displayName": "Incident",
"shape": "string",
"role": "label"
},
{
"name": "impact",
"displayName": "Impact",
"shape": "string"
},
{
"name": "worstComponentStatus",
"displayName": "Worst component status",
"shape": "string"
},
{
"name": "status",
"displayName": "Status",
"shape": "string"
},
{
"name": "phase",
"displayName": "Phase",
"shape": "string"
},
{
"name": "state",
"displayName": "State",
"shape": "state"
},
{
"name": "components",
"displayName": "Components",
"shape": ["array", { "itemShape": "string" }]
},
{
"name": "startedAt",
"displayName": "Started",
"shape": "date",
"role": "timestamp"
},
{
"name": "resolvedAt",
"displayName": "Resolved",
"shape": "date"
},
{
"name": "updatedAt",
"displayName": "Last updated",
"shape": "date"
},
{
"name": "timeToResolveMinutes",
"displayName": "Time to resolve",
"shape": "minutes"
},
{
"name": "updateCount",
"displayName": "Updates",
"shape": ["number", { "decimalPlaces": 0 }]
},
{
"name": "latestUpdate",
"displayName": "Latest update",
"shape": "string"
},
{
"name": "link",
"displayName": "Link",
"shape": ["url", { "label": "View incident" }],
"role": "link"
}
],
"defaultShaping": {
"sort": {
"by": [["startedAt", "desc"]]
}
},
"timeframes": true,
"supportsNoneTimeframe": true,
"defaultTimeframe": "none"
}
86 changes: 86 additions & 0 deletions plugins/SplunkCloudStatus/v1/dataStreams/maintenance.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
{
"name": "maintenance",
"displayName": "Scheduled Maintenance",
"description": "Splunk Cloud Platform maintenance windows, upcoming, in progress and completed",
"tags": ["Status", "Maintenance"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "scheduled-maintenances.json",
"paging": {
"mode": "none"
},
"postRequestScript": "maintenance.js"
},
"matches": "none",
"metadata": [
{
"name": "id",
"displayName": "ID",
"shape": "string",
"role": "id",
"visible": false
},
{
"name": "name",
"displayName": "Maintenance",
"shape": "string",
"role": "label"
},
{
"name": "status",
"displayName": "Status",
"shape": "string"
},
{
"name": "phase",
"displayName": "Phase",
"shape": "string"
},
{
"name": "state",
"displayName": "State",
"shape": "state"
},
{
"name": "components",
"displayName": "Components",
"shape": ["array", { "itemShape": "string" }]
},
{
"name": "scheduledFor",
"displayName": "Scheduled start",
"shape": "date",
"role": "timestamp"
},
{
"name": "scheduledUntil",
"displayName": "Scheduled end",
"shape": "date"
},
{
"name": "durationMinutes",
"displayName": "Planned duration",
"shape": "minutes"
},
{
"name": "description",
"displayName": "Description",
"shape": "string"
},
{
"name": "link",
"displayName": "Link",
"shape": ["url", { "label": "View maintenance" }],
"role": "link"
}
],
"defaultShaping": {
"sort": {
"by": [["scheduledFor", "desc"]]
}
},
"timeframes": true,
"supportsNoneTimeframe": true,
"defaultTimeframe": "none"
}
66 changes: 66 additions & 0 deletions plugins/SplunkCloudStatus/v1/dataStreams/overallStatus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "overallStatus",
"displayName": "Overall Status",
"description": "Current overall status of Splunk Cloud Platform with counts of affected components, active incidents and maintenance",
"tags": ["Status", "Incidents"],
"baseDataSourceName": "httpRequestUnscoped",
"config": {
"httpMethod": "get",
"endpointPath": "summary.json",
"paging": {
"mode": "none"
},
"postRequestScript": "overallStatus.js"
},
"matches": "none",
"metadata": [
{
"name": "status",
"displayName": "Status",
"shape": "string",
"role": "label"
},
{
"name": "state",
"displayName": "State",
"shape": "state"
},
{
"name": "indicator",
"displayName": "Indicator",
"shape": "string"
},
{
"name": "componentsAffected",
"displayName": "Components affected",
"shape": ["number", { "decimalPlaces": 0 }]
},
{
"name": "activeIncidents",
"displayName": "Active incidents",
"shape": ["number", { "decimalPlaces": 0 }]
},
{
"name": "activeMaintenance",
"displayName": "Active maintenance",
"shape": ["number", { "decimalPlaces": 0 }]
},
{
"name": "upcomingMaintenance",
"displayName": "Upcoming maintenance",
"shape": ["number", { "decimalPlaces": 0 }]
},
{
"name": "updatedAt",
"displayName": "Updated",
"shape": "date"
},
{
"name": "link",
"displayName": "Status page",
"shape": ["url", { "label": "Open status page" }],
"role": "link"
}
],
"timeframes": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
if (!data || !Array.isArray(data.components)) {
api.report.error('The Splunk Cloud status page did not return a component list.');
}

const LEVELS = {
operational: { label: 'Operational', state: 'success', severity: 0 },
under_maintenance: { label: 'Under maintenance', state: 'warning', severity: 1 },
degraded_performance: { label: 'Degraded performance', state: 'warning', severity: 2 },
partial_outage: { label: 'Partial outage', state: 'error', severity: 3 },
major_outage: { label: 'Major outage', state: 'error', severity: 4 }
};

// Groups are containers that only roll up their children; the children carry a group_id.
const groups = new Map(data.components.filter((c) => c.group).map((c) => [c.id, c.name]));

result = data.components
.filter((c) => !c.group)
.map((c) => {
const level = LEVELS[c.status] || { label: c.status, state: 'unknown', severity: 0 };
return {
id: c.id,
name: c.name,
group: (c.group_id && groups.get(c.group_id)) || 'Ungrouped',
status: level.label,
state: level.state,
severity: level.severity,
updatedAt: c.updated_at
};
});
Loading
Loading