Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- GET /
- Access: application/occi-collection+json
- Content-Type: application/occi-collection+json
- {
- "compute": ["http://myservice.tld/compute"],
- "storage": ["http://myservice.tld/storage"],
- "network": ["http://myservice.tld/network"]
- }
- GET /compute/
- Access: application/occi-collection+json
- Content-Type: application/occi-collection+json
- {
- "compute": ["http://myservice.tld/compute/123",
- "http://myservice.tld/compute/345"]
- }
- GET /compute/
- Access: application/occi-entities+json
- Content-Type: application/occi-entities+json
- [
- {
- "core": {
- "id": 123,
- "summary": "This is a summary"
- },
- "kind": "http://schemas.ogf.org/occi/infrastructure#compute",
- "mixins": [
- "http://schemas.opennebula.org/occi/infrastructure#my_mixin",
- "http://schemas.other.org/occi#my_mixin"
- ],
- "links": [
- "http://myservice.tld/storage/123"
- ],
- "compute": {
- "speed": 2,
- "memory": 4,
- "cores": 2
- },
- "my_mixin": {
- "my_attribute": "my_value"
- }
- },
- {
- "core": {
- "id": 456,
- "summary": "This is a summary"
- },
- "kind": "http://schemas.ogf.org/occi/infrastructure#compute",
- "mixins": [
- "http://schemas.opennebula.org/occi/infrastructure#my_mixin",
- "http://schemas.other.org/occi#my_mixin"
- ],
- "links": [
- "http://myservice.tld/storage/456"
- ],
- "compute": {
- "speed": 2,
- "memory": 4,
- "cores": 2
- },
- "my_mixin": {
- "my_attribute": "my_value"
- }
- }
- ]
- var entities = GET /compute/
- for each occi in entities
- occi.compute.id
- end
- GET /compute/123/
- Content-Type: application/occi-entity+json
- {
- "core": {
- "id": 123,
- "summary": "This is a summary"
- },
- "kind": "http://schemas.ogf.org/occi/infrastructure#compute",
- "mixins": [
- "http://schemas.opennebula.org/occi/infrastructure#my_mixin",
- "http://schemas.other.org/occi#my_mixin"
- ],
- "links": [
- "http://myservice.tld/storage/123"
- ],
- "compute": {
- "speed": 2,
- "memory": 4,
- "cores": 2
- },
- "my_mixin": {
- "my_attribute": "my_value",
- "other_attribute": "other_value"
- }
- }
- var occi = GET /compute/123
- occi.compute.cores
- occi.mixins[0]
- occi.links[0]
- occi.kind
- occi.my_mixin.my_attribute
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement