Skip to content

Instantly share code, notes, and snippets.

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/1c420b448c7db7ecd63e to your computer and use it in GitHub Desktop.
Save pavolloffay/1c420b448c7db7ecd63e to your computer and use it in GitHub Desktop.
Inventory Resource configuration + validation
ResourceType
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes/fooType/data?dataType=configurationSchema'
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes/fooType/data?dataType=connectionConfigurationSchema'
curl -ivX POST -H 'Content-Type:application/json' -d '{"id": "fooType" }' http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes
curl -ivX POST -H "Content-Type:application/json" -d '{"role": "configurationSchema", "value": {"title": "Foo resource configuration schema", "type": "object"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes/fooType/data'
curl -ivX PUT -H "Content-Type:application/json" -d '{"value": {"title": "Foo resource configuration schema", "type": "object", "required": ["man"],"properties": {"man": {"type": "integer"}}}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes/fooType/data?dataType=configurationSchema'
curl -ivX PUT -H "Content-Type:application/json" -d '{"value": {"title": "Foo resource configuration schema", "type": "object", "properties": {"man": {"type": "integer"}}}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes/fooType/data?dataType=configurationSchema'
curl -ivX PUT -H "Content-Type:application/json" -d '{"value": {"title": "Foo resource configuration schema", "type": "object", "properties": {"man":{"type": "object"}}}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/resourceTypes/fooType/data?dataType=configurationSchema'
Resource
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/resources/foo/data?dataType=configuration'
curl -ivX GET 'http://jdoe:password@localhost:8080/hawkular/inventory/test/resources/foo/data?dataType=connectionConfiguration'
curl -ivX POST -H 'Content-Type:application/json' -d '{"id":"foo", "resourceTypePath": "/rt;fooType"}' http://jdoe:password@localhost:8080/hawkular/inventory/test/resources
curl -ivX POST -H "Content-Type:application/json" -d '{"role": "configuration", "value": {"any" : "2"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/test/resources/foo/data'
curl -ivX PUT -H "Content-Type:application/json" -d '{"value": {"other" : "str"}}' 'http://jdoe:password@localhost:8080/hawkular/inventory/test/resources/foo/data?dataType=configuration'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment