Skip to content

Instantly share code, notes, and snippets.

@jkremser
Last active August 29, 2015 14:21
Show Gist options
  • Select an option

  • Save jkremser/8db9087086541358f227 to your computer and use it in GitHub Desktop.

Select an option

Save jkremser/8db9087086541358f227 to your computer and use it in GitHub Desktop.
#what is my tenant
curl -ivX GET -H "Content-Type: application/json" 'http://jdoe:password@localhost:8080/hawkular/inventory/tenant' | less
#create resource
curl -ivX POST -H "Content-Type: application/json" -d '{"id": "foobar", "resourceTypeId": "URL", "properties": {"url": "http://hawkular.org"}}' 'http://jdoe:[email protected]:8080/hawkular/inventory/test/resources' | less
#create metric type
curl -ivX POST -H "Content-Type: application/json" -d '{"id":"MetricType", "unit":"BYTE"}' 'http://jdoe:password/127.0.0.1:8080/hawkular/inventory/metricTypes' | less
#create metric
curl -ivX POST -H "Accept: application/json" -H "Content-Type: application/json" -d '{"id": "fooMetric", "metricTypeId": "MetricType"}' 'http://jdoe:[email protected]:8080/hawkular/inventory/test/metrics'
#associate metric with resource
curl -ivX POST -H "Content-Type: application/json" -d '["fooMetric"]' 'http://jdoe:[email protected]:8080/hawkular/inventory/test/resources/foobar/metrics' | less
#what are the metric types of URL resource type?
curl -ivX GET 'http://jdoe:[email protected]:8080/hawkular/inventory/resourceTypes/URL/metricTypes' | less
#what are the metrics of a given resource?
curl -ivX GET -H "Content-Type: application/json" 'http://jdoe:[email protected]:8080/hawkular/inventory/test/resources/foobar/metrics' | less
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment