Skip to content

Instantly share code, notes, and snippets.

@pavolloffay
Last active November 19, 2015 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pavolloffay/fa5b3c6232656caa04f1 to your computer and use it in GitHub Desktop.
Save pavolloffay/fa5b3c6232656caa04f1 to your computer and use it in GitHub Desktop.
Root
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/'
Tenant
curl -ivX GET -H "Content-Type: application/json" 'http://jdoe:password@localhost:8080/hawkular/inventory/tenant'
curl -ivX DELETE -H "Content-Type: application/json" 'http://jdoe:password@localhost:8080/hawkular/inventory/tenant'
Metric types
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/metricTypes?feedless=false'
curl -ivX POST -H "Content-Type: application/json" -d '{"id": "test", "type":"COUNTER", "properties": {"p1": "a"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/metricTypes'
curl -ivX PUT -H "Content-Type: application/json" -d '{"properties" : {"p1":"aaa"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/metricTypes/test'
curl -ivX PUT -H "Content-Type: application/json" -d '{"unit":"BYTE"}' 'http://jdoe:password@localhost:8080/hawkular/inventory/metricTypes/test'
<environment>/<feed>/MetricTypes
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/metricTypes'
curl -ivX POST -H "Content-Type: application/json" -d '{"id": "testAAA", "type":"COUNTER", "properties": {"p1": "a"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/metricTypes'
curl -ivX PUT -H "Content-Type: application/json" -d '{"unit":"BYTE", "properties": {"p1": "a"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/metricTypes/testAAA'
Metric /<environment>/metrics
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/metrics'
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/feeds/dhcp130-144/metrics'
curl -ivX POST -H "Content-Type: application/json" -d '{"id": "fooMetric", "metricTypePath": "/mt;status.code.type"}' 'http://jdoe:password@127.0.0.1:8080/hawkular/inventory/test/metrics'
Metric /<environment>/<feed>/metrics
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/metrics'
curl -ivX POST -H "Content-Type: application/json" -d '{"id": "fooMetric", "metricTypePath": "/mt;status.code.type"}' 'http://jdoe:password@127.0.0.1:8080/hawkular/inventory/feeds/dhcp130-144/metrics'
curl -ivX POST -H "Content-Type: application/json" -d '{"id": "fooMetric", "metricTypePath": "/mt;status.code.type"}' 'http://jdoe:password@127.0.0.1:8080/hawkular/inventory/test/metrics'
ResourceTypes
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes?feedless=false'
curl -ivX POST -H "Content-Type: application/json" -d '{"id": "test", "properties": {"p1": "a"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes'
<environment>/<feed>/resourceTypes
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/resourceTypes'
curl -ivX POST -H "Content-Type: application/json" -d '{"id": "test", "properties": {"p1": "a"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/resourceTypes'
curl -ivx PUT -H "Content-Type: application/json" -d '{"properties": {"p1": "CHANGED"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/resourceTypes/test'
curl -ivX DELETE 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/resourceTypes/test'
Environment
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/environments'
curl -ivX POST -H "Content-Type: application/json" -d '{"id": "test2", "properties": {"p1": "a"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/environments'
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/environments/test2'
Feed /<environment>/feeds
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/feeds'
curl -ivX POST -H "Content-Type: application/json" -d '{"id": "test2", "properties": {"p1": "a"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/test/feeds'
Relationships
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/environments/test/relationships'
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/metricTypes/test/relationships'
curl -ivX POST -H "Content-Type: application/json" -d '{"target": "28026b36-8fe4-4332-84c8-524e173a68bf/metricTypes/test", "source": "tenants/28026b36-8fe4-4332-84c8-524e173a68bf", "name": "testRelation"}' 'http://jdoe:password@localhost:8080/hawkular/inventory/metricTypes/test/relationships'
Resources
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/resources'
curl -ivX POST -H "Content-Type: application/json" -d '{"id": "randomId", "properties": {"p1": "a"}, "resourceTypePath": "/rt;URL" },' 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/resources'
curl -ivX PUT -H "Content-Type: application/json" -d '{"properties": {"p2": "b"} },' 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/resources/randomId'
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/resources/randomId'
GET | GET | GET
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/tenant'
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/environments'
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/feeds'
ResourceTypes & MetricTypes
Tenant or Environment->Feed
curl -X GET 'http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes?feedless=false'
curl -X GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/resourceTypes'
curl -X GET 'http://jdoe:password@localhost:8080/hawkular/inventory/metricTypes?feedless=false'
curl -X GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/metricTypes'
Resource
Environment or Environment->Feed
curl -X GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/resources?feedless=true'
curl -X GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/resources'
resources of resourceTypes
curl -X GET 'http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes/URL/resources'
Metrics
curl -X GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/metrics?feedless=true'
curl -X GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/dhcp130-144/metrics'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment