I'm using this URL to get an existing Auto Scale Group that I want to clone with modifications. It seems to have all the informmation about Service Port, Policies, Resource Triggers, Watches, Actions that I need to have.
https://api.softlayer.com/rest/v3/SoftLayer_Scale_Group/1120061/getObject.json?objectMask=mask[policies[resourceUseTriggers[watches],actions],loadBalancers]
The resulting response is contained in "RESPONSE 1" below.
I then modify the response to "remove the IDs" and then modify it to use as a template to create a new Auto Scale Group and the new request JSON is shown in "REQUEST 1" below.
When I submit "REQUEST 1" to SoftLayer using a POST to
https://api.softlayer.com/rest/v3/SoftLayer_Scale_Group/createObject.json
I get the standard error - "The remote server returned an error: (500) Internal Server Error."
So what am I doing incorrectly here?
== REQUEST 1 ==
{ "parameters": [
{
"virtualGuestMemberTemplate": {
"accountId": 940999,
"domain": "partpic.com",
"hostname": "CaffeServer-test-001",
"maxMemory": 1024,
"postInstallScriptUri": "https://webdev.partpic.com/ppsvc/CaffeStartup.aspx?model=Sample.tar.gz",
"startCpus": 1,
"blockDeviceTemplateGroup": {
"globalIdentifier": "fb2fd46d-713a-4d9b-8de1-d47030adc728"
},
"datacenter": {
"name": "dal06"
},
"hourlyBillingFlag": true
},
"loadBalancers": [{
"healthCheckId": 609283,
"id": 101503,
"port": 32400,
"virtualServerId": 275643
}],
"policies": [{
"name": "ScaleDown",
"resourceUseTriggers": [{
"typeId": 3,
"watches": [{
"algorithm": "EWMA",
"metric": "host.cpu.percent",
"operator": "<",
"period": 1500,
"value": "20"
}]
}],
"actions": [{
"typeId": 1,
"amount": 80,
"scaleType": "PERCENT"
}]
},
{
"name": "ScaleUp",
"resourceUseTriggers": [{
"typeId": 3,
"watches": [{
"algorithm": "EWMA",
"metric": "host.cpu.percent",
"operator": ">",
"period": 600,
"value": "80"
}]
}],
"actions": [{
"typeId": 1,
"amount": 150,
"scaleType": "PERCENT"
}]
}],
"status": {
"id": 1,
"keyName": "ACTIVE",
"name": "Active"
},
"virtualGuestAssets": [],
"virtualGuestMembers": [],
"accountId": 940999,
"cooldown": 60,
"name": "scale_test-001",
"regionalGroupId": 22,
"terminationPolicyId": 1
}
]}
== RESPONSE 1 ==
{
"accountId": 940999,
"balancedTerminationFlag": false,
"cooldown": 60,
"createDate": "2016-08-08T13:19:51-05:00",
"desiredMemberCount": null,
"id": 1120061,
"lastActionDate": "2016-08-12T14:22:51-05:00",
"maximumMemberCount": 0,
"minimumMemberCount": 0,
"modifyDate": "2016-08-12T14:22:57-05:00",
"name": "scale_CaffeServerSample",
"regionalGroupId": 22,
"suspendedFlag": false,
"terminationPolicyId": 1,
"virtualGuestMemberTemplate": {
"accountId": 940999,
"createDate": null,
"dedicatedAccountHostOnlyFlag": null,
"domain": "partpic.com",
"hostname": "CaffeServerSample",
"id": null,
"lastPowerStateId": null,
"lastVerifiedDate": null,
"maxCpu": null,
"maxMemory": 1024,
"metricPollDate": null,
"modifyDate": null,
"postInstallScriptUri": "https:\/\/webdev.partpic.com\/ppsvc\/CaffeStartup.aspx?model=Sample.tar.gz",
"provisionDate": null,
"startCpus": 1,
"statusId": null,
"blockDeviceTemplateGroup": {
"accountId": null,
"createDate": null,
"id": null,
"parentId": null,
"publicFlag": null,
"statusId": null,
"transactionId": null,
"userRecordId": null,
"globalIdentifier": "fb2fd46d-713a-4d9b-8de1-d47030adc728"
},
"datacenter": {
"id": null,
"name": "dal06",
"statusId": null
},
"hourlyBillingFlag": true,
"localDiskFlag": false,
"privateNetworkOnlyFlag": false
},
"loadBalancers": [{
"createDate": "2016-08-12T14:06:07-05:00",
"deleteFlag": null,
"healthCheckId": 609283,
"id": 101503,
"modifyDate": "2016-08-12T14:19:33-05:00",
"port": 32400,
"scaleGroupId": 1120061,
"virtualServerId": 274353,
"scaleGroup": {
"accountId": 940999,
"balancedTerminationFlag": false,
"cooldown": 60,
"createDate": "2016-08-08T13:19:51-05:00",
"desiredMemberCount": null,
"id": 1120061,
"lastActionDate": "2016-08-12T14:22:51-05:00",
"maximumMemberCount": 0,
"minimumMemberCount": 0,
"modifyDate": "2016-08-12T14:22:57-05:00",
"name": "scale_CaffeServerSample",
"regionalGroupId": 22,
"suspendedFlag": false,
"terminationPolicyId": 1,
"virtualGuestMemberTemplate": {
"accountId": 940999,
"createDate": null,
"dedicatedAccountHostOnlyFlag": null,
"domain": "partpic.com",
"hostname": "CaffeServerSample",
"id": null,
"lastPowerStateId": null,
"lastVerifiedDate": null,
"maxCpu": null,
"maxMemory": 1024,
"metricPollDate": null,
"modifyDate": null,
"postInstallScriptUri": "https:\/\/webdev.partpic.com\/ppsvc\/CaffeStartup.aspx?model=Sample.tar.gz",
"provisionDate": null,
"startCpus": 1,
"statusId": null,
"blockDeviceTemplateGroup": {
"accountId": null,
"createDate": null,
"id": null,
"parentId": null,
"publicFlag": null,
"statusId": null,
"transactionId": null,
"userRecordId": null,
"globalIdentifier": "fb2fd46d-713a-4d9b-8de1-d47030adc728"
},
"datacenter": {
"id": null,
"name": "dal06",
"statusId": null
},
"hourlyBillingFlag": true,
"localDiskFlag": false,
"privateNetworkOnlyFlag": false
},
"loadBalancers": null,
"policies": [{
"cooldown": null,
"createDate": "2016-08-12T14:23:01-05:00",
"deleteFlag": null,
"id": 174557,
"modifyDate": null,
"name": "ScaleDown",
"scaleGroupId": 1120061,
"actions": [{
"createDate": "2016-08-12T14:23:01-05:00",
"deleteFlag": null,
"id": 166457,
"modifyDate": null,
"scalePolicyId": 174557,
"typeId": 1,
"scalePolicy": null,
"amount": 80,
"scaleType": "PERCENT"
}],
"resourceUseTriggers": [{
"createDate": "2016-08-12T14:23:01-05:00",
"deleteFlag": null,
"id": 173005,
"modifyDate": null,
"scalePolicyId": 174557,
"typeId": 3,
"scalePolicy": null,
"watches": [{
"algorithm": "EWMA",
"createDate": "2016-08-12T14:23:01-05:00",
"deleteFlag": null,
"id": 143505,
"metric": "host.cpu.percent",
"modifyDate": null,
"operator": "<",
"period": 1500,
"scalePolicyTriggerId": 173005,
"value": "20",
"scalePolicyTrigger": null
}]
}],
"scaleGroup": null
},
{
"cooldown": null,
"createDate": "2016-08-12T14:22:51-05:00",
"deleteFlag": null,
"id": 174555,
"modifyDate": null,
"name": "ScaleUp",
"scaleGroupId": 1120061,
"actions": [{
"createDate": "2016-08-12T14:23:01-05:00",
"deleteFlag": null,
"id": 166455,
"modifyDate": null,
"scalePolicyId": 174555,
"typeId": 1,
"scalePolicy": null,
"amount": 150,
"scaleType": "PERCENT"
}],
"resourceUseTriggers": [{
"createDate": "2016-08-12T14:22:51-05:00",
"deleteFlag": null,
"id": 173003,
"modifyDate": null,
"scalePolicyId": 174555,
"typeId": 3,
"scalePolicy": null,
"watches": [{
"algorithm": "EWMA",
"createDate": "2016-08-12T14:22:51-05:00",
"deleteFlag": null,
"id": 143503,
"metric": "host.cpu.percent",
"modifyDate": null,
"operator": ">",
"period": 600,
"scalePolicyTriggerId": 173003,
"value": "80",
"scalePolicyTrigger": null
}]
}],
"scaleGroup": null
}],
"status": {
"id": 1,
"keyName": "ACTIVE",
"name": "Active"
},
"virtualGuestAssets": [],
"virtualGuestMembers": []
}
}],
"policies": [{
"cooldown": null,
"createDate": "2016-08-12T14:23:01-05:00",
"deleteFlag": null,
"id": 174557,
"modifyDate": null,
"name": "ScaleDown",
"scaleGroupId": 1120061,
"actions": [{
"createDate": "2016-08-12T14:23:01-05:00",
"deleteFlag": null,
"id": 166457,
"modifyDate": null,
"scalePolicyId": 174557,
"typeId": 1,
"scalePolicy": null,
"amount": 80,
"scaleType": "PERCENT"
}],
"resourceUseTriggers": [{
"createDate": "2016-08-12T14:23:01-05:00",
"deleteFlag": null,
"id": 173005,
"modifyDate": null,
"scalePolicyId": 174557,
"typeId": 3,
"scalePolicy": null,
"watches": [{
"algorithm": "EWMA",
"createDate": "2016-08-12T14:23:01-05:00",
"deleteFlag": null,
"id": 143505,
"metric": "host.cpu.percent",
"modifyDate": null,
"operator": "<",
"period": 1500,
"scalePolicyTriggerId": 173005,
"value": "20",
"scalePolicyTrigger": null
}]
}],
"scaleGroup": {
"accountId": 940999,
"balancedTerminationFlag": false,
"cooldown": 60,
"createDate": "2016-08-08T13:19:51-05:00",
"desiredMemberCount": null,
"id": 1120061,
"lastActionDate": "2016-08-12T14:22:51-05:00",
"maximumMemberCount": 0,
"minimumMemberCount": 0,
"modifyDate": "2016-08-12T14:22:57-05:00",
"name": "scale_CaffeServerSample",
"regionalGroupId": 22,
"suspendedFlag": false,
"terminationPolicyId": 1,
"virtualGuestMemberTemplate": {
"accountId": 940999,
"createDate": null,
"dedicatedAccountHostOnlyFlag": null,
"domain": "partpic.com",
"hostname": "CaffeServerSample",
"id": null,
"lastPowerStateId": null,
"lastVerifiedDate": null,
"maxCpu": null,
"maxMemory": 1024,
"metricPollDate": null,
"modifyDate": null,
"postInstallScriptUri": "https:\/\/webdev.partpic.com\/ppsvc\/CaffeStartup.aspx?model=Sample.tar.gz",
"provisionDate": null,
"startCpus": 1,
"statusId": null,
"blockDeviceTemplateGroup": {
"accountId": null,
"createDate": null,
"id": null,
"parentId": null,
"publicFlag": null,
"statusId": null,
"transactionId": null,
"userRecordId": null,
"globalIdentifier": "fb2fd46d-713a-4d9b-8de1-d47030adc728"
},
"datacenter": {
"id": null,
"name": "dal06",
"statusId": null
},
"hourlyBillingFlag": true,
"localDiskFlag": false,
"privateNetworkOnlyFlag": false
},
"loadBalancers": [{
"createDate": "2016-08-12T14:06:07-05:00",
"deleteFlag": null,
"healthCheckId": 609283,
"id": 101503,
"modifyDate": "2016-08-12T14:19:33-05:00",
"port": 32400,
"scaleGroupId": 1120061,
"virtualServerId": 274353,
"scaleGroup": null
}],
"policies": null,
"status": {
"id": 1,
"keyName": "ACTIVE",
"name": "Active"
},
"virtualGuestAssets": [],
"virtualGuestMembers": []
}
},
{
"cooldown": null,
"createDate": "2016-08-12T14:22:51-05:00",
"deleteFlag": null,
"id": 174555,
"modifyDate": null,
"name": "ScaleUp",
"scaleGroupId": 1120061,
"actions": [{
"createDate": "2016-08-12T14:23:01-05:00",
"deleteFlag": null,
"id": 166455,
"modifyDate": null,
"scalePolicyId": 174555,
"typeId": 1,
"scalePolicy": null,
"amount": 150,
"scaleType": "PERCENT"
}],
"resourceUseTriggers": [{
"createDate": "2016-08-12T14:22:51-05:00",
"deleteFlag": null,
"id": 173003,
"modifyDate": null,
"scalePolicyId": 174555,
"typeId": 3,
"scalePolicy": null,
"watches": [{
"algorithm": "EWMA",
"createDate": "2016-08-12T14:22:51-05:00",
"deleteFlag": null,
"id": 143503,
"metric": "host.cpu.percent",
"modifyDate": null,
"operator": ">",
"period": 600,
"scalePolicyTriggerId": 173003,
"value": "80",
"scalePolicyTrigger": null
}]
}],
"scaleGroup": {
"accountId": 940999,
"balancedTerminationFlag": false,
"cooldown": 60,
"createDate": "2016-08-08T13:19:51-05:00",
"desiredMemberCount": null,
"id": 1120061,
"lastActionDate": "2016-08-12T14:22:51-05:00",
"maximumMemberCount": 0,
"minimumMemberCount": 0,
"modifyDate": "2016-08-12T14:22:57-05:00",
"name": "scale_CaffeServerSample",
"regionalGroupId": 22,
"suspendedFlag": false,
"terminationPolicyId": 1,
"virtualGuestMemberTemplate": {
"accountId": 940999,
"createDate": null,
"dedicatedAccountHostOnlyFlag": null,
"domain": "partpic.com",
"hostname": "CaffeServerSample",
"id": null,
"lastPowerStateId": null,
"lastVerifiedDate": null,
"maxCpu": null,
"maxMemory": 1024,
"metricPollDate": null,
"modifyDate": null,
"postInstallScriptUri": "https:\/\/webdev.partpic.com\/ppsvc\/CaffeStartup.aspx?model=Sample.tar.gz",
"provisionDate": null,
"startCpus": 1,
"statusId": null,
"blockDeviceTemplateGroup": {
"accountId": null,
"createDate": null,
"id": null,
"parentId": null,
"publicFlag": null,
"statusId": null,
"transactionId": null,
"userRecordId": null,
"globalIdentifier": "fb2fd46d-713a-4d9b-8de1-d47030adc728"
},
"datacenter": {
"id": null,
"name": "dal06",
"statusId": null
},
"hourlyBillingFlag": true,
"localDiskFlag": false,
"privateNetworkOnlyFlag": false
},
"loadBalancers": [{
"createDate": "2016-08-12T14:06:07-05:00",
"deleteFlag": null,
"healthCheckId": 609283,
"id": 101503,
"modifyDate": "2016-08-12T14:19:33-05:00",
"port": 32400,
"scaleGroupId": 1120061,
"virtualServerId": 274353,
"scaleGroup": null
}],
"policies": null,
"status": {
"id": 1,
"keyName": "ACTIVE",
"name": "Active"
},
"virtualGuestAssets": [],
"virtualGuestMembers": []
}
}],
"status": {
"id": 1,
"keyName": "ACTIVE",
"name": "Active"
},
"virtualGuestAssets": [],
"virtualGuestMembers": []
}
I do not think that create a new autoscale group is so easy like copy paste and delete some ids.
try this request:
{
"parameters": [
{
"balancedTerminationFlag": false,
"maximumMemberCount": 0,
"minimumMemberCount": 0,
"cooldown": 60,
"name": "scale_test-0012a",
"regionalGroupId": 22,
"suspendedFlag": false,
"terminationPolicyId": 1,
"virtualGuestMemberTemplate": {
"domain": "partpic.com",
"hostname": "CaffeServer-test-001",
"maxMemory": 1024,
"postInstallScriptUri": "https://webdev.partpic.com/ppsvc/CaffeStartup.aspx?model=Sample.tar.gz",
"startCpus": 1,
"blockDeviceTemplateGroup": {
"globalIdentifier": "fb2fd46d-713a-4d9b-8de1-d47030adc728"
},
"datacenter": {
"name": "dal06"
},
"hourlyBillingFlag": true,
"localDiskFlag": false,
"privateNetworkOnlyFlag": false
},
"loadBalancers": [{
"deleteFlag" : false,
"port": 32400,
"virtualServerId": 275643,
"healthCheck": {
"type": {
"keyname": "DEFAULT"
}
}
}],
"policies": [{
"name": "ScaleDown",
"resourceUseTriggers": [{
"watches": [{
"algorithm": "EWMA",
"metric": "host.cpu.percent",
"operator": "<",
"period": 1500,
"value": "20"
}]
}],
"scaleActions": [{
"amount": 80,
"scaleType": "PERCENT"
}]
}, {
"name": "ScaleUp",
"resourceUseTriggers": [{
"typeId": 3,
"watches": [{
"algorithm": "EWMA",
"metric": "host.cpu.percent",
"operator": ">",
"period": 600,
"value": "80"
}]
}],
"scaleActions": [{
"amount": 150,
"scaleType": "PERCENT"
}]
}]
}
]
}
Related
I'm trying to create a ConfigMap with ArgoCD.
I've created a volumes.yaml file as such
---
apiVersion: v1
kind: ConfigMap
metadata:
name: persistent-volumes-argo
labels:
grafana_dashboard: "1"
project: "foo"
data:
kubernetes.json: |
{{ .Files.Get "dashboards/persistent-volumes.json" | indent 4 }}
But ArgoCD doesn't seem to be able to read the data, the way a standard Helm deployment would.
I've tried adding the data directly into the ConfigMap as such
(Data omitted for brevity)
---
apiVersion: v1
kind: ConfigMap
metadata:
name: persistent-volumes-argo
labels:
grafana_dashboard: "1"
project: "foo"
data:
kubernetes.json: |
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"limit": 100,
"name": "Annotations & Alerts",
"showIn": 0,
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": 13646,
"graphTooltip": 0,
"iteration": 1659421503107,
"links": [],
"panels": [
{
"collapsed": false,
"datasource": null,
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 0
},
"id": 26,
"panels": [],
"title": "Alerts",
"type": "row"
},
{
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"mappings": [],
"noValue": "--",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "semi-dark-red",
"value": null
},
{
"color": "light-green",
"value": -0.0001
},
{
"color": "semi-dark-red",
"value": 0.0001
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 8,
"x": 0,
"y": 1
},
"id": 21,
"options": {
"colorMode": "background",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.3",
"targets": [
{
"expr": "count (max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"} ) and (max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"} )) / (max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_capacity_bytes{namespace=~\"${k8s_namespace}\"} )) >= (${warning_threshold} / 100)) or vector (0)",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "PVCs Above Warning Threshold",
"type": "stat"
},
{
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 0,
"mappings": [],
"noValue": "--",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "semi-dark-red",
"value": null
},
{
"color": "light-green",
"value": -0.0001
},
{
"color": "semi-dark-red",
"value": 0.0001
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 8,
"x": 8,
"y": 1
},
"id": 24,
"options": {
"colorMode": "background",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.3",
"targets": [
{
"expr": "count((kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=\"Pending\"}==1)) or vector(0)",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "PVCs in Pending State",
"transformations": [
{
"id": "organize",
"options": {}
}
],
"type": "stat"
},
{
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"decimals": 0,
"mappings": [],
"noValue": "--",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "semi-dark-red",
"value": null
},
{
"color": "light-green",
"value": -0.0001
},
{
"color": "semi-dark-red",
"value": 0.0001
}
]
},
"unit": "none"
},
"overrides": []
},
"gridPos": {
"h": 4,
"w": 8,
"x": 16,
"y": 1
},
"id": 23,
"options": {
"colorMode": "background",
"graphMode": "area",
"justifyMode": "auto",
"orientation": "auto",
"reduceOptions": {
"calcs": [
"mean"
],
"fields": "",
"values": false
},
"text": {},
"textMode": "auto"
},
"pluginVersion": "8.0.3",
"targets": [
{
"expr": "count((kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=\"Lost\"}==1)) or vector(0)",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "PVCs in Lost State",
"transformations": [
{
"id": "organize",
"options": {}
}
],
"type": "stat"
},
{
"collapsed": false,
"datasource": null,
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 5
},
"id": 17,
"panels": [],
"title": "Usage statistics",
"type": "row"
},
{
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"color": {
"mode": "thresholds"
},
"custom": {
"align": null,
"displayMode": "auto",
"filterable": false
},
"mappings": [],
"noValue": "--",
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "light-green",
"value": null
}
]
},
"unit": "none"
},
"overrides": [
{
"matcher": {
"id": "byName",
"options": "Used (%)"
},
"properties": [
{
"id": "custom.displayMode",
"value": "gradient-gauge"
},
{
"id": "thresholds",
"value": {
"mode": "absolute",
"steps": [
{
"color": "light-green",
"value": null
},
{
"color": "semi-dark-yellow",
"value": 70
},
{
"color": "dark-red",
"value": 80
}
]
}
},
{
"id": "decimals",
"value": 1
}
]
},
{
"matcher": {
"id": "byName",
"options": "Status"
},
"properties": [
{
"id": "custom.displayMode",
"value": "color-background"
},
{
"id": "mappings",
"value": [
{
"options": {
"0": {
"text": "Bound"
},
"1": {
"text": "Pending"
},
"2": {
"text": "Lost"
}
},
"type": "value"
}
]
},
{
"id": "thresholds",
"value": {
"mode": "absolute",
"steps": [
{
"color": "light-green",
"value": null
},
{
"color": "light-green",
"value": 0
},
{
"color": "semi-dark-orange",
"value": 1
},
{
"color": "semi-dark-red",
"value": 2
}
]
}
},
{
"id": "noValue",
"value": "--"
},
{
"id": "custom.align",
"value": "center"
}
]
},
{
"matcher": {
"id": "byName",
"options": "Namespace"
},
"properties": [
{
"id": "custom.width",
"value": 120
}
]
},
{
"matcher": {
"id": "byName",
"options": "Status"
},
"properties": [
{
"id": "custom.width",
"value": 80
}
]
},
{
"matcher": {
"id": "byName",
"options": "Capacity (GiB)"
},
"properties": [
{
"id": "custom.width",
"value": 120
}
]
},
{
"matcher": {
"id": "byName",
"options": "Used (GiB)"
},
"properties": [
{
"id": "custom.width",
"value": 120
}
]
},
{
"matcher": {
"id": "byName",
"options": "Available (GiB)"
},
"properties": [
{
"id": "custom.width",
"value": 120
}
]
},
{
"matcher": {
"id": "byName",
"options": "StorageClass"
},
"properties": [
{
"id": "custom.width",
"value": 150
}
]
},
{
"matcher": {
"id": "byName",
"options": "PersistentVolumeClaim"
},
"properties": [
{
"id": "custom.width",
"value": 370
}
]
}
]
},
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 6
},
"id": 29,
"interval": "",
"options": {
"frameIndex": 2,
"showHeader": true,
"sortBy": [
{
"desc": false,
"displayName": "PersistentVolumeClaim"
}
]
},
"pluginVersion": "8.0.3",
"targets": [
{
"expr": " sum by (persistentvolumeclaim,namespace,storageclass,volumename) (kube_persistentvolumeclaim_info{namespace=~\"${k8s_namespace}\"})",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "A"
},
{
"expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_capacity_bytes{namespace=~\"${k8s_namespace}\"}/1024/1024/1024)",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "B"
},
{
"expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}/1024/1024/1024)",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "C"
},
{
"expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_available_bytes{namespace=~\"${k8s_namespace}\"}/1024/1024/1024)",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "D"
},
{
"expr": "sum(kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=~\"(Pending|Lost)\"}) by (persistentvolumeclaim) + sum(kube_persistentvolumeclaim_status_phase{namespace=~\"${k8s_namespace}\",phase=~\"(Lost)\"}) by (persistentvolumeclaim)",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "E"
},
{
"expr": "sum by (persistentvolumeclaim) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}/kubelet_volume_stats_capacity_bytes{namespace=~\"${k8s_namespace}\"} * 100)",
"format": "table",
"instant": true,
"interval": "",
"legendFormat": "",
"refId": "F"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Persistent Volume Claim",
"transformations": [
{
"id": "seriesToColumns",
"options": {
"byField": "persistentvolumeclaim"
}
},
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"Time 1": true,
"Time 2": true,
"Time 3": true,
"Time 4": true,
"Time 5": true,
"Time 6": true,
"Value #A": true
},
"indexByName": {},
"renameByName": {
"Time 1": "",
"Time 2": "",
"Time 3": "",
"Time 4": "",
"Time 5": "",
"Time 6": "",
"Value #A": "",
"Value #B": "Capacity (GiB)",
"Value #C": "Used (GiB)",
"Value #D": "Available (GiB)",
"Value #E": "Status",
"Value #F": "Used (%)",
"namespace": "Namespace",
"persistentvolumeclaim": "PersistentVolumeClaim",
"storageclass": "StorageClass",
"volumename": "PhysicalVolume"
}
}
}
],
"type": "table"
},
{
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {
"align": null,
"displayMode": "auto",
"filterable": false
},
"mappings": [],
"thresholds": {
"mode": "absolute",
"steps": [
{
"color": "green",
"value": null
}
]
}
},
"overrides": []
},
"gridPos": {
"h": 5,
"w": 24,
"x": 0,
"y": 18
},
"id": 7,
"options": {
"showHeader": true,
"sortBy": [
{
"desc": true,
"displayName": "Status"
}
]
},
"pluginVersion": "8.0.3",
"targets": [
{
"expr": "kube_storageclass_info",
"format": "table",
"interval": "",
"legendFormat": "",
"refId": "A"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Storage Class",
"transformations": [
{
"id": "organize",
"options": {
"excludeByName": {
"Time": true,
"Value": true,
"__name__": true,
"app_kubernetes_io_instance": true,
"app_kubernetes_io_name": true,
"instance": true,
"job": true,
"kubernetes_namespace": true,
"kubernetes_pod_name": true,
"pod_template_hash": true
},
"indexByName": {
"Time": 1,
"Value": 13,
"__name__": 2,
"app_kubernetes_io_instance": 3,
"app_kubernetes_io_name": 4,
"instance": 5,
"job": 6,
"kubernetes_namespace": 7,
"kubernetes_pod_name": 8,
"pod_template_hash": 9,
"provisioner": 10,
"reclaimPolicy": 11,
"storageclass": 0,
"volumeBindingMode": 12
},
"renameByName": {
"provisioner": "Provisioner",
"reclaimPolicy": "ReclaimPolicy",
"storageclass": "StorageClass",
"volumeBindingMode": "VolumeBindingMode"
}
}
},
{
"id": "groupBy",
"options": {
"fields": {
"Provisioner": {
"aggregations": [],
"operation": "groupby"
},
"ReclaimPolicy": {
"aggregations": [],
"operation": "groupby"
},
"StorageClass": {
"aggregations": [],
"operation": "groupby"
},
"VolumeBindingMode": {
"aggregations": [],
"operation": "groupby"
}
}
}
}
],
"type": "table"
},
{
"collapsed": false,
"datasource": null,
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 23
},
"id": 15,
"panels": [],
"title": "Graphical usage data ",
"type": "row"
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 12,
"w": 24,
"x": 0,
"y": 24
},
"hiddenSeries": false,
"id": 9,
"legend": {
"alignAsTable": true,
"avg": true,
"current": true,
"max": true,
"min": true,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "8.0.3",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "(max by (persistentvolumeclaim,namespace) (kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}))",
"interval": "",
"legendFormat": "{{namespace}} ({{persistentvolumeclaim}})",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "All Running PVCs Used Bytes",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "Date & time",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"collapsed": true,
"datasource": null,
"fieldConfig": {
"defaults": {},
"overrides": []
},
"gridPos": {
"h": 1,
"w": 24,
"x": 0,
"y": 36
},
"id": 19,
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 41
},
"hiddenSeries": false,
"id": 11,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.2.1",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "rate(kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}[1h])",
"instant": false,
"interval": "",
"legendFormat": "{{namespace}} ({{persistentvolumeclaim}})",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Hourly Volume Usage Rate",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "binBps",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "Date & time",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 48
},
"hiddenSeries": false,
"id": 12,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
},
"percentage": false,
"pluginVersion": "7.2.1",
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "rate(kubelet_volume_stats_used_bytes{namespace=~\"${k8s_namespace}\"}[1d])",
"interval": "",
"legendFormat": "{{namespace}} ({{persistentvolumeclaim}})",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Daily Volume Usage Rate",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "binBps",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "Date & time",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "$datasource",
"fieldConfig": {
"defaults": {
"custom": {}
},
"overrides": []
},
"fill": 0,
"fillGradient": 0,
"gridPos": {
"h": 7,
"w": 24,
"x": 0,
"y": 55
},
"hiddenSeries": false,
"id": 13,
"legend": {
"alignAsTable": true,
"avg": true,
"current": false,
"max": false,
"min": false,
"rightSide": true,
"show": true,
"total": false,
"values": true
},
"lines": true,
"linewidth": 1,
"nullPointMode": "null",
"options": {
"alertThreshold": true
}
}
But this errors with rpc error: code = FailedPrecondition desc = Failed to unmarshal "volumes.yaml": <nil>
Is there a way to pass in json data when creating a ConfigMap with ArgoCD, either as a template or by dumping the data in the file?
To create configmap with argocd and helm
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "helm-chart.fullname" . }}-configmap
data:
config.json : |
{{ toJson .Values.configmap | indent 4 }}
and the value file should be like this, which is our JSON but converted to YAML
configmap:
json:
- rigid
- better for data interchange
yaml:
- slim and flexible
- better for configuration
object:
key: value
array:
- null_value:
- boolean: true
- integer: 1
- alias: &example aliases are like variables
- alias: *example
paragraph: >
Blank lines denote
paragraph breaks
content: |-
Or we
can auto
convert line breaks
to save space
alias: &foo
bar: baz
alias_reuse: *foo
json2yaml
A complete demo app can be found here
A very quick way to create app with the above configmap and demo app
argocd app create demo-app --repo https://github.com/Adiii717/argocd-demo-app.git --path helm-chart --dest-namespace default --dest-server https://kubernetes.default.svc --helm-set replicaCount=2
Make sure you also set
export ARGOCD_AUTH_TOKEN="tokeh
export ARGOCD_OPTS="--grpc-web"
export ARGOCD_SERVER="argocd.example.com"
added section for the configmap
I want to get all the files from an assignment in Moodle. Is there a way to get all the files?
When I call core_course_get_contents from my local Moodle instance as
http://localhost:8077/webservice/rest/server.php?wstoken=11e2d8b7f8e21ca1804e41e9cac5a816&wsfunction=core_course_get_contents&courseid=4&moodlewsrestformat=json
I receive the response as:
[
{
"id": 22,
"name": "General",
"visible": 1,
"summary": "",
"summaryformat": 1,
"section": 0,
"hiddenbynumsections": 0,
"uservisible": true,
"modules": []
},
{
"id": 23,
"name": "Introduction",
"visible": 1,
"summary": "",
"summaryformat": 1,
"section": 1,
"hiddenbynumsections": 0,
"uservisible": true,
"modules": [
{
"id": 44,
"url": "http://localhost:8077/mod/assign/view.php?id=44",
"name": "Assignment",
"instance": 3,
"contextid": 99,
"visible": 1,
"uservisible": true,
"visibleoncoursepage": 1,
"modicon": "http://localhost:8077/theme/image.php/boost/assign/1613571924/icon",
"modname": "assign",
"modplural": "Assignments",
"indent": 0,
"onclick": "",
"afterlink": null,
"customdata": "\"\"",
"noviewlink": false,
"completion": 1,
"completiondata": {
"state": 0,
"timecompleted": 0,
"overrideby": null,
"valueused": false
}
},
{
"id": 46,
"url": "http://localhost:8077/mod/resource/view.php?id=46",
"name": "test(.txt)",
"instance": 24,
"contextid": 102,
"visible": 1,
"uservisible": true,
"visibleoncoursepage": 1,
"modicon": "http://localhost:8077/theme/image.php/boost/core/1613571924/f/text-24",
"modname": "resource",
"modplural": "Files",
"indent": 0,
"onclick": "",
"afterlink": null,
"customdata": "\"a:1:{s:10:\\\"printintro\\\";i:1;}\"",
"noviewlink": false,
"completion": 1,
"completiondata": {
"state": 0,
"timecompleted": 0,
"overrideby": null,
"valueused": false
},
"contents": [
{
"type": "file",
"filename": "test.txt",
"filepath": "/",
"filesize": 935,
"fileurl": "http://localhost:8077/webservice/pluginfile.php/102/mod_resource/content/1/test.txt?forcedownload=1",
"timecreated": 1621949734,
"timemodified": 1621949744,
"sortorder": 1,
"mimetype": "text/plain",
"isexternalfile": false,
"userid": 2,
"author": "ABC",
"license": "unknown"
}
],
"contentsinfo": {
"filescount": 1,
"filessize": 935,
"lastmodified": 1621949744,
"mimetypes": [
"text/plain"
],
"repositorytype": ""
}
}
]
}
]
I want to get the files from the assignment. Is there a way to achieve this?
I have to list all the attachments of a discussion in a course. I don't know how to retrieve all the attachments URLs in a forum/discussion in Moodle LMS.
My code is in c# and usually, I call the Moodle REST API as http://localhost:8077/webservice/rest/server.php?wstoken=11e2d8b7f8e21ca1804e41e9cac5a812&wsfunction=core_course_get_contents&courseid=4&moodlewsrestformat=json and I can get the fileurl for the course files.
Likewise, I would like to retrieve forum/discussion files but I don't see any fileurl or something similar.
I only see the response as below:
[
{
"id": 22,
"name": "General",
"visible": 1,
"summary": "",
"summaryformat": 1,
"section": 0,
"hiddenbynumsections": 0,
"uservisible": true,
"modules": []
},
{
"id": 23,
"name": "Introduction",
"visible": 1,
"summary": "",
"summaryformat": 1,
"section": 1,
"hiddenbynumsections": 0,
"uservisible": true,
"modules": [
{
"id": 46,
"url": "http://localhost:8077/mod/resource/view.php?id=46",
"name": "Everest (.txt)",
"instance": 24,
"contextid": 102,
"visible": 1,
"uservisible": true,
"visibleoncoursepage": 1,
"modicon": "http://localhost:8077/theme/image.php/boost/core/1613571924/f/text-24",
"modname": "resource",
"modplural": "Files",
"indent": 0,
"onclick": "",
"afterlink": null,
"customdata": "\"a:1:{s:10:\\\"printintro\\\";i:1;}\"",
"noviewlink": false,
"completion": 1,
"completiondata": {
"state": 0,
"timecompleted": 0,
"overrideby": null,
"valueused": false
},
"contents": [
{
"type": "file",
"filename": "Everest.txt",
"filepath": "/",
"filesize": 935,
"fileurl": "http://localhost:8077/webservice/pluginfile.php/102/mod_resource/content/1/Everest.txt?forcedownload=1",
"timecreated": 1621949734,
"timemodified": 1621949744,
"sortorder": 1,
"mimetype": "text/plain",
"isexternalfile": false,
"userid": 2,
"author": "DP Bhatt",
"license": "unknown"
}
],
"contentsinfo": {
"filescount": 1,
"filessize": 935,
"lastmodified": 1621949744,
"mimetypes": [
"text/plain"
],
"repositorytype": ""
}
},
{
"id": 47,
"url": "http://localhost:8077/mod/forum/view.php?id=47",
"name": "Forum",
"instance": 5,
"contextid": 112,
"visible": 1,
"uservisible": true,
"visibleoncoursepage": 1,
"modicon": "http://localhost:8077/theme/image.php/boost/forum/1613571924/icon",
"modname": "forum",
"modplural": "Forums",
"indent": 0,
"onclick": "",
"afterlink": null,
"customdata": "\"\"",
"noviewlink": false,
"completion": 1,
"completiondata": {
"state": 0,
"timecompleted": 0,
"overrideby": null,
"valueused": false
}
}
]
}
]
It would be great if someone guides me on the right path. Thank you very much in advance.
I am trying to use the grafana API to post dashboards to a specific folder. Using the following command, I can see the folder ID's for all folders in my grafana:
curl -X GET http://<username>:<password>#localhost:3000/api/folders?limit=200
[{"id":9,"uid":"6m0M3AZZk","title":"Apps"},{"id":38,"uid":"jEJ5aSVZz","title":"Cluster_Health"},{"id":31,"uid":"vsmJ2dGZz","title":"CPU by App"},{"id":51,"uid":"Fx9ajQXWz","title":"Data Pipeline"},{"id":6,"uid":"dYFMMhZWz","title":"home"},{"id":19,"uid":"qDwG6yWZz","title":"Node_Health"},{"id":18,"uid":"37pWeyWZk","title":"Pending_Data"},{"id":44,"uid":"nreWbxfWz","title":"Prod"},{"id":13,"uid":"PYzEBYZWk","title":"Services"},{"id":27,"uid":"byVe4IMWk","title":"API"}]
Now, I would like to post a dashboard to my Services folder (id 13). However, when I make my request, this dashboard is always going to the General folder. I am using a python script to make my request:
def post_dashboard(filepath):
with open(filepath, "r") as fin:
data = json.loads(fin.read())
data = json.dumps(data)
response = requests.post("http://localhost:3000/api/dashboards/db", headers=headers_raw, data=data)
print(response.json())
print(response.status_code)
My JSON file looks like this:
{"dashboard": {
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
"type": "dashboard"
}
]
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"id": null,
"iteration": 1593098750052,
"links": [],
"panels": [
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus-1",
"description": "The amount of CPU taken up by redis from top command",
"fill": 0,
"gridPos": {
"h": 8,
"w": 24,
"x": 0,
"y": 0
},
"id": 10,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "app_cpu{node_type=\"process\", cluster_id=~\"$cluster\", app_name=~\".*redisserver.*\"}",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "{{ host_name }}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "CPU Used",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus-1",
"description": "The current amount of memory redis is consuming",
"fill": 0,
"gridPos": {
"h": 9,
"w": 12,
"x": 0,
"y": 8
},
"id": 2,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "redis_mem_used{cluster_id=~\"$cluster\"}",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "{{ node }}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Redis Memory Used",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "decbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus-1",
"description": "The maximum amount of memory that redis has used",
"fill": 0,
"gridPos": {
"h": 9,
"w": 12,
"x": 12,
"y": 8
},
"id": 4,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "redis_mem_peak{cluster_id=~\"$cluster\"}",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "{{ node }}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "Redis Peak Memory",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "decbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus-1",
"description": "The amount of memory used by the LUA engine inside of redis",
"fill": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 0,
"y": 17
},
"id": 6,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "redis_mem_lua{cluster_id=~\"$cluster\"}",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "{{ node }}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "LUA Mem Used",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "decbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
},
{
"aliasColors": {},
"bars": false,
"dashLength": 10,
"dashes": false,
"datasource": "Prometheus-1",
"description": "The amount of memory used as observed by top",
"fill": 0,
"gridPos": {
"h": 8,
"w": 12,
"x": 12,
"y": 17
},
"id": 8,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 1,
"links": [],
"nullPointMode": "null",
"percentage": false,
"pointradius": 2,
"points": false,
"renderer": "flot",
"seriesOverrides": [],
"spaceLength": 10,
"stack": false,
"steppedLine": false,
"targets": [
{
"expr": "redis_mem_rss{cluster_id=~\"$cluster\"}",
"format": "time_series",
"intervalFactor": 1,
"legendFormat": "{{ node }}",
"refId": "A"
}
],
"thresholds": [],
"timeFrom": null,
"timeRegions": [],
"timeShift": null,
"title": "RSS Mem Used",
"tooltip": {
"shared": true,
"sort": 2,
"value_type": "individual"
},
"type": "graph",
"xaxis": {
"buckets": null,
"mode": "time",
"name": null,
"show": true,
"values": []
},
"yaxes": [
{
"format": "decbytes",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
],
"yaxis": {
"align": false,
"alignLevel": null
}
}
],
"schemaVersion": 18,
"style": "dark",
"tags": [],
"templating": {
"list": [
{
"allValue": null,
"current": {},
"datasource": "Prometheus-1",
"definition": "label_values(redis_mem_used, cluster_id)",
"hide": 0,
"includeAll": true,
"label": null,
"multi": true,
"name": "cluster",
"options": [],
"query": "label_values(redis_mem_used, cluster_id)",
"refresh": 1,
"regex": "",
"skipUrlSync": false,
"sort": 0,
"tagValuesQuery": "",
"tags": [],
"tagsQuery": "",
"type": "query",
"useTags": false
}
]
},
"time": {
"from": "now-6h",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"timezone": "",
"title": "Redis",
"uid": "rfdsk32",
"folder": "Services",
"folderTitle": "Services",
"folderId": 13,
"overwrite": true
}
}
My grafana version is 6.2.0. I have used several references that say that folderId should be the controlling keyword for which folder a dashboard goes to.
https://grafana.com/docs/grafana/latest/http_api/dashboard/#create-update-dashboard
You have used wrong payload structure:
{
"dashboard": {
...
"folderId": 13,
"overwrite": true
}
}
Correct structure is:
{
"dashboard": {
...
},
"folderId": 13,
"overwrite": true
}
I'm working on a demo on real-time visualization and I'm trying to think out of the box. Looks like any big data real-time demo is on twitter or traffic data. Are there any other options out there that publish real-time data (for free)?
Thanks
Just some thoughts:
Environmental Datasets
As stated by the other comment, have a look to weather, forecast (or similar services).
Space data
What about data from the Universe?
Flights
Here's some real time flight tracking data: the evaluation plan is limited but free.
Social Networks
Twitter Streaming API, Facebook RealTime Updates API (in case you hyave already an app on the social Network), Foursquare
Energy production
Various energy production (real-time and quasi real-time) data.
On these ones probably you have to fiddle around the pages to track the sources of the data, sorry.
Website traffic
Google Analytics RealTime API (for your registered websites)
Money
Bitcoin transactions, Stock Market API
More?
And here and here an "not-so-updated" list of other Real-Time API services (some free, some others not).
Have you considered environmental datasets?
For one, there are near real time (say, hourly or 15m) data on streamflow and water quality. There's also a wealth of weather data served up via NOAA NCDC and APIs. How about some bouy data?
Seeing this post reminded me that there's lots of flight tracking data out there which could be fun to visualize too.
You can find real-time data sources at www.hooksdata.io. Using a query language you can specify what data you need and then add a webhook URL where you want to receive the data or just pull the data anytime.
API DOCS: https://www.hooksdata.io/docs/api/introduction/
Available data sources with examples:
RSS:
Input:
SELECT * FROM RSS('http://feeds.feedburner.com/TechCrunch/')
TwitterUserTimeline:
Input:
SELECT * FROM TwitterUserTimeline('Techstars')
Output:
{ "_entity_type": "tweet", "_id": "tweet_976733289221210112", "contributors": null, "coordinates": null, "created_at": "Thu Mar 22 08:12:17 +0000 2018", "entities": { "hashtags": [ { "indices": [ 121, 132 ], "text": "3Dprinting" } ], "symbols": [], "urls": [], "user_mentions": [ { "id": 117789943, "id_str": "117789943", "indices": [ 3, 19 ], "name": "StanleyBlack&Decker", "screen_name": "StanleyBlkDeckr" }, { "id": 14277276, "id_str": "14277276", "indices": [ 61, 71 ], "name": "techstars", "screen_name": "techstars" } ] }, "favorite_count": 0, "favorited": false, "geo": null, "id": 976733289221210112, "id_str": "976733289221210112", "in_reply_to_screen_name": null, "in_reply_to_status_id": null, "in_reply_to_status_id_str": null, "in_reply_to_user_id": null, "in_reply_to_user_id_str": null, "is_quote_status": false, "lang": "en", "metadata": { "iso_language_code": "en", "result_type": "recent" }, "place": null, "retweet_count": 7, "retweeted": false, "retweeted_status": { "contributors": null, "coordinates": null, "created_at": "Wed Mar 21 20:37:05 +0000 2018", "entities": { "hashtags": [ { "indices": [ 100, 111 ], "text": "3Dprinting" } ], "symbols": [], "urls": [ { "display_url": "twitter.com\/i\/web\/status\/9\u2026", "expanded_url": "https:\/\/twitter.com\/i\/web\/status\/976558334030442498", "indices": [ 117, 140 ], "url": "https:\/\/t.co\/6GWviWvVd1" } ], "user_mentions": [ { "id": 14277276, "id_str": "14277276", "indices": [ 40, 50 ], "name": "techstars", "screen_name": "techstars" } ] }, "favorite_count": 11, "favorited": false, "geo": null, "id": 976558334030442498, "id_str": "976558334030442498", "in_reply_to_screen_name": null, "in_reply_to_status_id": null, "in_reply_to_status_id_str": null, "in_reply_to_user_id": null, "in_reply_to_user_id_str": null, "is_quote_status": false, "lang": "en", "metadata": { "iso_language_code": "en", "result_type": "recent" }, "place": null, "possibly_sensitive": false, "retweet_count": 7, "retweeted": false, "source": "<a href=\"http:\/\/percolate.com\" rel=\"nofollow\">Percolate<\/a>", "text": "Ahead of the Stanley+Techstars program, #Techstars leaders visited us to see how we've incorporated #3Dprinting and\u2026 https:\/\/t.co\/6GWviWvVd1", "truncated": true, "user": { "contributors_enabled": false, "created_at": "Fri Feb 26 16:34:00 +0000 2010", "default_profile": false, "default_profile_image": false, "description": "Official Twitter account for Stanley Black and Decker", "entities": { "description": { "urls": [] }, "url": { "urls": [ { "display_url": "stanleyblackanddecker.com", "expanded_url": "http:\/\/stanleyblackanddecker.com", "indices": [ 0, 22 ], "url": "http:\/\/t.co\/OwfwWAucUP" } ] } }, "favourites_count": 474, "follow_request_sent": false, "followers_count": 5293, "following": false, "friends_count": 170, "geo_enabled": false, "has_extended_profile": false, "id": 117789943, "id_str": "117789943", "is_translation_enabled": false, "is_translator": false, "lang": "en", "listed_count": 136, "location": "New Britain", "name": "StanleyBlack&Decker", "notifications": false, "profile_background_color": "C0DEED", "profile_background_image_url": "http:\/\/pbs.twimg.com\/profile_background_images\/84200087\/stanley_twitter_nologos.jpg", "profile_background_image_url_https": "https:\/\/pbs.twimg.com\/profile_background_images\/84200087\/stanley_twitter_nologos.jpg", "profile_background_tile": false, "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/117789943\/1501159100", "profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/534427580120571905\/qEDM5_-D_normal.jpeg", "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/534427580120571905\/qEDM5_-D_normal.jpeg", "profile_link_color": "0084B4", "profile_sidebar_border_color": "C0DEED", "profile_sidebar_fill_color": "FFD30D", "profile_text_color": "333333", "profile_use_background_image": true, "protected": false, "screen_name": "StanleyBlkDeckr", "statuses_count": 1239, "time_zone": null, "translator_type": "none", "url": "http:\/\/t.co\/OwfwWAucUP", "utc_offset": null, "verified": false } }, "source": "<a href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\">Twitter for iPhone<\/a>", "text": "RT #StanleyBlkDeckr: Ahead of the Stanley+Techstars program, #Techstars leaders visited us to see how we've incorporated #3Dprinting and ad\u2026", "truncated": false, "user": { "contributors_enabled": false, "created_at": "Mon Jul 27 04:06:55 +0000 2015", "default_profile": true, "default_profile_image": false, "description": "Humble Star", "entities": { "description": { "urls": [] } }, "favourites_count": 51, "follow_request_sent": false, "followers_count": 26, "following": false, "friends_count": 74, "geo_enabled": false, "has_extended_profile": false, "id": 3296795162, "id_str": "3296795162", "is_translation_enabled": false, "is_translator": false, "lang": "en", "listed_count": 0, "location": "", "name": "Munkhi Tse", "notifications": false, "profile_background_color": "C0DEED", "profile_background_image_url": "http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_image_url_https": "https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_tile": false, "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/3296795162\/1520835673", "profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/973081082500235264\/46urpcv1_normal.jpg", "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/973081082500235264\/46urpcv1_normal.jpg", "profile_link_color": "1DA1F2", "profile_sidebar_border_color": "C0DEED", "profile_sidebar_fill_color": "DDEEF6", "profile_text_color": "333333", "profile_use_background_image": true, "protected": false, "screen_name": "Munkhitse", "statuses_count": 53, "time_zone": "Pacific Time (US & Canada)", "translator_type": "none", "url": null, "utc_offset": -25200, "verified": false } }
TwitterSearch:
Input:
SELECT * FROM TwitterSearch('Techstars')
Output:
{ "_entity_type": "tweet", "_id": "tweet_976733289221210112", "contributors": null, "coordinates": null, "created_at": "Thu Mar 22 08:12:17 +0000 2018", "entities": { "hashtags": [ { "indices": [ 121, 132 ], "text": "3Dprinting" } ], "symbols": [], "urls": [], "user_mentions": [ { "id": 117789943, "id_str": "117789943", "indices": [ 3, 19 ], "name": "StanleyBlack&Decker", "screen_name": "StanleyBlkDeckr" }, { "id": 14277276, "id_str": "14277276", "indices": [ 61, 71 ], "name": "techstars", "screen_name": "techstars" } ] }, "favorite_count": 0, "favorited": false, "geo": null, "id": 976733289221210112, "id_str": "976733289221210112", "in_reply_to_screen_name": null, "in_reply_to_status_id": null, "in_reply_to_status_id_str": null, "in_reply_to_user_id": null, "in_reply_to_user_id_str": null, "is_quote_status": false, "lang": "en", "metadata": { "iso_language_code": "en", "result_type": "recent" }, "place": null, "retweet_count": 7, "retweeted": false, "retweeted_status": { "contributors": null, "coordinates": null, "created_at": "Wed Mar 21 20:37:05 +0000 2018", "entities": { "hashtags": [ { "indices": [ 100, 111 ], "text": "3Dprinting" } ], "symbols": [], "urls": [ { "display_url": "twitter.com\/i\/web\/status\/9\u2026", "expanded_url": "https:\/\/twitter.com\/i\/web\/status\/976558334030442498", "indices": [ 117, 140 ], "url": "https:\/\/t.co\/6GWviWvVd1" } ], "user_mentions": [ { "id": 14277276, "id_str": "14277276", "indices": [ 40, 50 ], "name": "techstars", "screen_name": "techstars" } ] }, "favorite_count": 11, "favorited": false, "geo": null, "id": 976558334030442498, "id_str": "976558334030442498", "in_reply_to_screen_name": null, "in_reply_to_status_id": null, "in_reply_to_status_id_str": null, "in_reply_to_user_id": null, "in_reply_to_user_id_str": null, "is_quote_status": false, "lang": "en", "metadata": { "iso_language_code": "en", "result_type": "recent" }, "place": null, "possibly_sensitive": false, "retweet_count": 7, "retweeted": false, "source": "<a href=\"http:\/\/percolate.com\" rel=\"nofollow\">Percolate<\/a>", "text": "Ahead of the Stanley+Techstars program, #Techstars leaders visited us to see how we've incorporated #3Dprinting and\u2026 https:\/\/t.co\/6GWviWvVd1", "truncated": true, "user": { "contributors_enabled": false, "created_at": "Fri Feb 26 16:34:00 +0000 2010", "default_profile": false, "default_profile_image": false, "description": "Official Twitter account for Stanley Black and Decker", "entities": { "description": { "urls": [] }, "url": { "urls": [ { "display_url": "stanleyblackanddecker.com", "expanded_url": "http:\/\/stanleyblackanddecker.com", "indices": [ 0, 22 ], "url": "http:\/\/t.co\/OwfwWAucUP" } ] } }, "favourites_count": 474, "follow_request_sent": false, "followers_count": 5293, "following": false, "friends_count": 170, "geo_enabled": false, "has_extended_profile": false, "id": 117789943, "id_str": "117789943", "is_translation_enabled": false, "is_translator": false, "lang": "en", "listed_count": 136, "location": "New Britain", "name": "StanleyBlack&Decker", "notifications": false, "profile_background_color": "C0DEED", "profile_background_image_url": "http:\/\/pbs.twimg.com\/profile_background_images\/84200087\/stanley_twitter_nologos.jpg", "profile_background_image_url_https": "https:\/\/pbs.twimg.com\/profile_background_images\/84200087\/stanley_twitter_nologos.jpg", "profile_background_tile": false, "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/117789943\/1501159100", "profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/534427580120571905\/qEDM5_-D_normal.jpeg", "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/534427580120571905\/qEDM5_-D_normal.jpeg", "profile_link_color": "0084B4", "profile_sidebar_border_color": "C0DEED", "profile_sidebar_fill_color": "FFD30D", "profile_text_color": "333333", "profile_use_background_image": true, "protected": false, "screen_name": "StanleyBlkDeckr", "statuses_count": 1239, "time_zone": null, "translator_type": "none", "url": "http:\/\/t.co\/OwfwWAucUP", "utc_offset": null, "verified": false } }, "source": "<a href=\"http:\/\/twitter.com\/download\/iphone\" rel=\"nofollow\">Twitter for iPhone<\/a>", "text": "RT #StanleyBlkDeckr: Ahead of the Stanley+Techstars program, #Techstars leaders visited us to see how we've incorporated #3Dprinting and ad\u2026", "truncated": false, "user": { "contributors_enabled": false, "created_at": "Mon Jul 27 04:06:55 +0000 2015", "default_profile": true, "default_profile_image": false, "description": "Humble Star", "entities": { "description": { "urls": [] } }, "favourites_count": 51, "follow_request_sent": false, "followers_count": 26, "following": false, "friends_count": 74, "geo_enabled": false, "has_extended_profile": false, "id": 3296795162, "id_str": "3296795162", "is_translation_enabled": false, "is_translator": false, "lang": "en", "listed_count": 0, "location": "", "name": "Munkhi Tse", "notifications": false, "profile_background_color": "C0DEED", "profile_background_image_url": "http:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_image_url_https": "https:\/\/abs.twimg.com\/images\/themes\/theme1\/bg.png", "profile_background_tile": false, "profile_banner_url": "https:\/\/pbs.twimg.com\/profile_banners\/3296795162\/1520835673", "profile_image_url": "http:\/\/pbs.twimg.com\/profile_images\/973081082500235264\/46urpcv1_normal.jpg", "profile_image_url_https": "https:\/\/pbs.twimg.com\/profile_images\/973081082500235264\/46urpcv1_normal.jpg", "profile_link_color": "1DA1F2", "profile_sidebar_border_color": "C0DEED", "profile_sidebar_fill_color": "DDEEF6", "profile_text_color": "333333", "profile_use_background_image": true, "protected": false, "screen_name": "Munkhitse", "statuses_count": 53, "time_zone": "Pacific Time (US & Canada)", "translator_type": "none", "url": null, "utc_offset": -25200, "verified": false } }
NFLGames:
Input:
SELECT * FROM NFLGames
WHERE status = 'FUTURE' and
away_team.team_name = 'New England Patriots' OR
home_team.team_name = 'New England Patriots' AND
start_datetime.countdown = 3600
SoccerGames:
Input:
SELECT * FROM SoccerGames
WHERE away_team.team_name = 'Real Madrid'
OR home_team.team_name = 'Real Madrid'
AND start_datetime.countdown = 3600
Output:
{
"matches_count": 1,
"results": [
{
"_entity_type": "SoccerGame",
"_id": "SoccerGame_490555",
"away_score": null,
"away_team": {
"_entity_type": "SoccerTeam",
"_id": "SoccerTeam_86",
"espn_id": 86,
"id": "SoccerTeam_86",
"logo_url": "http://a.espncdn.com/combiner/i?img=/i/teamlogos/soccer/500/86.png&h=500",
"team_name": "Real Madrid"
},
"competition": "Spanish Primera División",
"game_id": "490555",
"home_score": null,
"home_team": {
"_entity_type": "SoccerTeam",
"_id": null,
"team_name": "Leganes"
},
"link": "http://m.espn.go.com/soccer/gamecast?gameId=490555&lang=EN&wjb=",
"start_datetime": {
"countdown": 86970,
"datetime": "2018-02-21T17:45:00+0000",
"timestamp": 1519235100
},
"status": "FUTURE",
"timestamp": 1519235100
}
]
}
EpisodesByTVShow:
Input:
SELECT * FROM
EpisodesByTVShow(name = 'Game of Thrones')
WHERE start_datetime.countdown = 3600
Output:
{
"_entity_type": "Episode",
"_id": "Episode_4961",
"image": {
"medium": "http://static.tvmaze.com/uploads/images/medium_landscape/1/2681.jpg",
"original": "http://static.tvmaze.com/uploads/images/original_untouched/1/2681.jpg"
},
"link": "http://www.tvmaze.com/episodes/4961/game-of-thrones-1x10-fire-and-blood",
"number": 10,
"runtime": 60,
"season": 1,
"start_datetime": {
"countdown": -210591933,
"datetime": "2011-06-20T01:00:00+0000",
"timestamp": 1308531600
},
"summary": "Daenerys must realize her destiny. Jaime finds himself in an unfamiliar predicament.",
"title": "Fire and Blood",
"tvmaze_episode_id": 4961,
"tvshow": {
"_entity_type": "TVShow",
"_id": "TVShow_82",
"externals": {
"imdb": "tt0944947",
"thetvdb": 121361,
"tvrage": 24493
},
"genres": [
"Drama",
"Adventure",
"Fantasy"
],
"id": "TVShow_82",
"image": {
"medium": "http://static.tvmaze.com/uploads/images/medium_portrait/143/359013.jpg",
"original": "http://static.tvmaze.com/uploads/images/original_untouched/143/359013.jpg"
},
"language": "English",
"name": "Game of Thrones",
"network": {
"country": {
"code": "US",
"name": "United States",
"timezone": "America/New_York"
},
"id": 8,
"name": "HBO"
},
"officialSite": "http://www.hbo.com/game-of-thrones",
"premiered": "2011-04-17",
"rating": {
"average": 9.3
},
"runtime": 60,
"schedule": {
"days": [
"Sunday"
],
"time": "21:00"
},
"status": "Running",
"summary": "<p>Based on the bestselling book series <i>A Song of Ice and Fire</i> by George R.R. Martin, this sprawling new HBO drama is set in a world where summers span decades and winters can last a lifetime. From the scheming south and the savage eastern lands, to the frozen north and ancient Wall that protects the realm from the mysterious darkness beyond, the powerful families of the Seven Kingdoms are locked in a battle for the Iron Throne. This is a story of duplicity and treachery, nobility and honor, conquest and triumph. In the <b>Game of Thrones</b>, you either win or you die.</p>",
"tvmaze_id": 82,
"type": "Scripted",
"updated": 1517168016,
"url": "http://www.tvmaze.com/shows/82/game-of-thrones",
"webChannel": {
"country": {
"code": "US",
"name": "United States",
"timezone": "America/New_York"
},
"id": 22,
"name": "HBO Go"
},
"weight": 99
}
}
WeatherByCity:
Input:
SELECT * FROM WeatherByCity
(name = 'San Francisco'
AND country.name = 'United States'
AND subdivision.type = 'State'
AND subdivision.name = 'California')
WHERE weather_conditions.main = 'Rain'
AND start_datetime.countdown = 86400
Output:
{
"_entity_type": "WeatherStatus",
"_id": "WeatherStatus_Geoname_5391959-1519178400",
"city": {
"_entity_type": "City",
"_id": "Geoname_5391959",
"admin1_code": "CA",
"admin2_code": "075",
"admin3_code": null,
"admin4_code": null,
"alternative_names": [
"Franciscopolis",
"Frisco",
"Gorad San-Francyska",
"Kapalakiko",
"Khiu-kim-san",
"Khiu-kîm-sân",
"Lungsod ng San Francisco",
"New Albion",
"SF",
"SFO",
"San Francisco",
"San Franciscu",
"San Francisko",
"San Fransisco",
"San Fransiskas",
"San Fransisko",
"San Frantzisko",
"San Phransisko",
"San-Francisko",
"San-Fransisko",
"Sanfrancisko",
"Sao Francisco",
"São Francisco",
"Yerba Buena",
"can pirancisko",
"jiu jin shan",
"saenpeulan",
"saenpeulansiseuko",
"saina pharansisako",
"saina phransisko",
"san f ran si s ko",
"san fan shi",
"san fransskw",
"san fransyskw",
"san fransyskۆ",
"san phransisko",
"sana phransisako ka'unti",
"sana phransisko",
"sanfuranshisuko",
"sena phransisko",
"sn prnsysqw",
"syana phransisko",
"Σαν Φρανσίσκο",
"Горад Сан-Францыска",
"Сан Франсиско",
"Сан Франциско",
"Сан-Франциско",
"Сан-Франціско",
"Սան Ֆրանցիսկո",
"סאן פראנציסקא",
"סן פרנסיסקו",
"سان فرانسسکو",
"سان فرانسيسكو",
"سان فرانسیسکو",
"سان فرانسیسکۆ",
"सॅन फ्रान्सिस्को",
"सैन फ्रांसिस्को",
"स्यान फ्रान्सिस्को",
"সান ফ্রান্সিসকো কাউন্টি",
"সান ফ্রান্সিস্কো",
"ਸੈਨ ਫਰਾਂਸਿਸਕੋ",
"சான் பிரான்சிஸ்கோ",
"శాన్ ఫ్రాన్సిస్కో",
"സാൻ ഫ്രാൻസിസ്കോ",
"සැන් ෆ්\u200dරැන්සිස්කෝ",
"ซานฟรานซิสโก",
"སན་ཧྥུ་རན་སིས་ཁོ",
"ဆန်ဖရန်စစ္စကိုမြို့",
"სან-ფრანცისკო",
"サンフランシスコ",
"三藩市",
"旧金山",
"舊金山",
"샌프란",
"샌프란시스코"
],
"ascii_name": "San Francisco",
"coordinates": "37.77493,-122.41942",
"country": {
"country_code_2": "US",
"country_code_3": "USA",
"country_numeric_code": "840",
"name": "United States",
"official_name": "United States of America"
},
"dem": "28",
"elevation": 16,
"feature_class": "P",
"feature_code": "PPLA2",
"geonameid": "5391959",
"id": "Geoname_5391959",
"modification_date": "2017-06-15",
"name": "San Francisco",
"population": 864816,
"subdivision": {
"country_code_2": "US",
"name": "California",
"subdivision_code": "US-CA",
"type": "State"
},
"timezone": "America/Los_Angeles"
},
"features": {
"clouds_percent": 44,
"humidity_percent": 83,
"pressure": {
"hPa": 1027.12,
"inHg": 30.33,
"mmHg": 770.4
},
"rain": {
"inch_hour": 0,
"mm_hour": 0
},
"snow": {
"inch_hour": 0,
"mm_hour": 0
},
"temperature": {
"celsius": 8.36,
"fahrenheit": 32
},
"wind_direction_degrees": 297.002,
"wind_speed": {
"meters_per_second": 3.42,
"miles_per_hour": 7.65
}
},
"is_current": false,
"measure_time": {
"countdown": 42931,
"datetime": "2018-02-21T03:00:00+0000",
"timestamp": 1519182000
},
"start_datetime": {
"countdown": 39331,
"datetime": "2018-02-21T02:00:00+0000",
"timestamp": 1519178400
},
"weather_conditions": [
{
"description": "scattered clouds",
"icon": "03n",
"icon_url": "http://openweathermap.org/img/w/03n",
"id": 802,
"main": "Clouds"
}
]
}
NBAGames:
Input:
SELECT * FROM NBAGames
WHERE status='FUTURE'
AND (away_team.team_name='Charlotte Hornets'
OR home_team.team_name='Charlotte Hornets')
AND start_datetime.countdown = 3600
Output:
{
"matches_count": 1,
"results": [
{
"_entity_type": "NBAGame",
"_id": "NBAGame_400975613",
"away_score": null,
"away_team": {
"_entity_type": "NBATeam",
"_id": "NBATeam_CHA",
"acronym": "CHA",
"division": "Southeast",
"id": "NBATeam_CHA",
"team_name": "Charlotte Hornets"
},
"game_id": "400975613",
"home_team": {
"_entity_type": "NBATeam",
"_id": null,
"acronym": null
},
"link": "http://espn.go.com/nba/game?gameId=400975613",
"start_datetime": {
"countdown": 137435,
"datetime": "2018-02-23T00:00:00+0000",
"timestamp": 1519344000
},
"status": "FUTURE"
}
]
}
MLBGames:
Input:
SELECT * FROM MLBGames
WHERE status = 'FUTURE'
AND (away_team.team_name = 'Toronto Blue Jays'
OR home_team.team_name = 'Toronto Blue Jays')
AND start_datetime.countdown = 3600
Output:
{
"matches_count": 1,
"results": [
{
"_entity_type": "MLBGame",
"_id": "MLBGame_400962533",
"away_score": null,
"away_team": {
"_entity_type": "MLBTeam",
"_id": "MLBTeam_TOR",
"acronym": "TOR",
"division": "AL East",
"id": "MLBTeam_TOR",
"team_name": "Toronto Blue Jays"
},
"game_id": "400962533",
"home_team": {
"_entity_type": "MLBTeam",
"_id": null,
"acronym": null
},
"link": "http://espn.go.com/nhl/gamecast?gameId=400962533",
"start_datetime": {
"countdown": 135524,
"datetime": "2018-02-23T00:00:00+0000",
"timestamp": 1519344000
},
"status": "FUTURE"
}
]
}
NHLGames:
Input:
SELECT * FROM NHLGames
WHERE status='FUTURE'
AND (away_team.team_name='New Jersey Devils'
OR home_team.team_name='New Jersey Devils')
AND start_datetime.countdown = 3600
Output:
{
"matches_count": 1,
"results": [
{
"_entity_type": "NHLGame",
"_id": "NHLGame_400962534",
"away_score": null,
"away_team": {
"_entity_type": "NHLTeam",
"_id": "NHLTeam_NJ",
"acronym": "NJ",
"division": "Metropolitan Division",
"id": "NHLTeam_NJ",
"team_name": "New Jersey Devils"
},
"game_id": "400962534",
"home_team": {
"_entity_type": "NHLTeam",
"_id": null,
"acronym": null
},
"link": "http://espn.go.com/nhl/gamecast?gameId=400962534",
"start_datetime": {
"countdown": 134517,
"datetime": "2018-02-23T00:00:00+0000",
"timestamp": 1519344000
},
"status": "FUTURE"
}
]
}
CryptoTickers:
Input:
SELECT * FROM CryptoTickers
WHERE market_cap_usd >= 18000000000
StockTickers:
SELECT * FROM StockTickers('AAPL')
WHERE close > 170
I'm been working with Ably Hub - it is a marketplace for open streaming data sources, which are either paid or free to use under different licenses.
Full disclosure: I'm a Developer Advocate for Ably but I think the resources from this marketplace might certainly help you with some cool data viz.
If you are interested in checking out an example - I built a live bitcoin price chart using one of the sources from the Ably Hub and KendoUI.