Adds POST /api/resource_classes/flavors and PUT /api/resource_classes/fl...

...avors/1

on request from UI (@jprovazn) and tuskar_client (@jistr)

Given a resource_class with ID 1, you can create a new flavor for it with:

POST /api/resource_classes/1/flavors

{ "name" : "medium",                                                      
                  "capacities" : [                                         
                     {   "name": "cpu",                                    
                         "value" : "2",                                    
                          "unit" : "count" },                              
                     {   "name": "memory",                                 
                         "value" : "4096",                                 
                         "unit" : "MiB" },                                 
                     {   "name": "storage",                                
                         "value" : "1024",                                 
                         "unit" : "GiB" }                                  
                  ]                                                        
} 


and you'll get the new Flavor in the response body.

Assuming you have a ResourceClass with ID 1 and it has a Flavor with ID 2, you can update a particular aspect of that Flavor with:


PUT /api/resource_classes/1/flavors/2

 {    "name" : "x-large",                                                  
                  "capacities" : [                                         
                     {   "name": "memory",                                 
                         "value" : "1111",                                 
                         "unit" : "MiB" }                                  
                  ]                                                        
}

to change the memory capacity to 1111 for example. You will ge tthe updated Flavor in the response.

I'll update cURL commands once this is pushed