tuskar/doc/source/resource-class-demo-script.rst
Jay Dobies e305f61b18 Fix tuskar docs building
Fixed a problem with the docs not even building and cleaned up the
sphinx warnings. Changed the directory structure to more closely
resemble other OpenStack projects. This doesn't address any of the
content yet, simply the structure and ability to build.

Change-Id: I2b00b12b7664d58d44994b9d0e23a55c96379c18
2014-02-18 13:50:14 -05:00

2.2 KiB

Resource Class Demo Script

Get a Resource Class

curl -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes/1

{
  "service_type": "compute",
  "racks": [],
  "id": 1,
  "links": [{
    "href": "http://0.0.0.0:8585/v1/resource_classes/1",
    "rel": "self"
   }],
   "name": "test-chassis"
}

Get the Resource Class Collection

curl -H 'Accept: application/json' http://0.0.0.0:8585/v1/resource_classes/

Create a Resource Class with a Rack

curl -iX POST -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
   {
     "service_type": "compute",
     "name": "test-chassis",
     "racks":[
       {
         "id": 1,
         "links": [
           {
              "href":"http://0.0.0.0:8585/v1/racks/1",
              "rel":"self"
           }
         ]
       }
     ]
    }
' http://0.0.0.0:8585/v1/resource_classes``

Update the Racks on a Resource Class (Remove Racks)

curl -iX PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
   {
     "service_type": "compute",
     "name": "test-chassis",
     "racks":[]
   }
' http://0.0.0.0:8585/v1/resource_classes/13``

Update the Racks on a Resource Class (Add a Rack)

curl -iX PUT -H 'Content-Type: application/json' -H 'Accept: application/json' -d '
   {
     "service_type": "compute",
     "name": "test-chassis",
     "racks":[
       {
         "id": 2,
         "links": [
           {
              "href":"http://0.0.0.0:8585/v1/racks/2",
              "rel":"self"
           }
         ]
       }
    ]
  }
' http://0.0.0.0:8585/v1/resource_classes/13``

Delete a Resource Class

curl -iX DELETE -H 'Accept: application/json'  http://0.0.0.0:8585/v1/resource_classes/13