 da1148a7a7
			
		
	
	da1148a7a7
	
	
	
		
			
			In the current api-ref, we have illustrated about how to add extra specs for flavors, but it was very simple and we have a large number of built-in extra specs that can be used to archive different purpose listed here: http://docs.openstack.org/admin-guide/compute-flavors.html The reader will still be confused about how to correctly use extra specs only read the api-ref. We could first simply add the above link to the flavor extra spec section in api-ref to let readers know where to find information and come up with better solution later. Change-Id: Ie720973783f153d3954be9f4bd97e7f9bf788c6b Closes-bug: #1640654
		
			
				
	
	
		
			191 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			ReStructuredText
		
	
	
	
	
	
			
		
		
	
	
			191 lines
		
	
	
		
			4.3 KiB
		
	
	
	
		
			ReStructuredText
		
	
	
	
	
	
| .. -*- rst -*-
 | |
| 
 | |
| ======================================================
 | |
|  Flavors extra-specs (flavors, os-flavor-extra-specs)
 | |
| ======================================================
 | |
| 
 | |
| Lists, creates, deletes, and updates the extra-specs or keys for a
 | |
| flavor.
 | |
| 
 | |
| List Extra Specs For A Flavor
 | |
| =============================
 | |
| 
 | |
| .. rest_method:: GET /flavors/{flavor_id}/os-extra_specs
 | |
| 
 | |
| Lists all extra specs for a flavor, by ID.
 | |
| 
 | |
| Normal response codes: 200
 | |
| 
 | |
| Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
 | |
| 
 | |
| Request
 | |
| -------
 | |
| 
 | |
| .. rest_parameters:: parameters.yaml
 | |
| 
 | |
| 
 | |
|   - flavor_id: flavor_id
 | |
| 
 | |
| Response
 | |
| --------
 | |
| 
 | |
| 
 | |
| .. rest_parameters:: parameters.yaml
 | |
| 
 | |
|   - extra_specs: extra_specs
 | |
|   - key: flavor_extra_spec_key2
 | |
|   - value: flavor_extra_spec_value
 | |
| 
 | |
| **Example List Extra Specs For A Flavor: JSON response**
 | |
| 
 | |
| .. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-list-resp.json
 | |
|    :language: javascript
 | |
| 
 | |
| Create Extra Specs For A Flavor
 | |
| ===============================
 | |
| 
 | |
| .. rest_method:: POST /flavors/{flavor_id}/os-extra_specs
 | |
| 
 | |
| Creates extra specs for a flavor, by ID.
 | |
| 
 | |
| .. note:: Please reference:
 | |
|   `Compute Flavors
 | |
|   <http://docs.openstack.org/admin-guide/compute-flavors.html#extra-specs>`__
 | |
|   for available built-in extra specs under ``Extra Specs`` section.
 | |
| 
 | |
| Normal response codes: 200
 | |
| 
 | |
| Error response codes: unauthorized(401), forbidden(403), itemNotFound(404),
 | |
| conflict(409)
 | |
| 
 | |
| Request
 | |
| -------
 | |
| 
 | |
| .. rest_parameters:: parameters.yaml
 | |
| 
 | |
| 
 | |
|   - flavor_id: flavor_id
 | |
|   - extra_specs: extra_specs
 | |
|   - key: flavor_extra_spec_key2
 | |
|   - value: flavor_extra_spec_value
 | |
| 
 | |
| **Example Create Extra Specs For A Flavor: JSON request**
 | |
| 
 | |
| .. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-create-req.json
 | |
|    :language: javascript
 | |
| 
 | |
| Response
 | |
| --------
 | |
| 
 | |
| .. rest_parameters:: parameters.yaml
 | |
| 
 | |
|   - extra_specs: extra_specs
 | |
|   - key: flavor_extra_spec_key2
 | |
|   - value: flavor_extra_spec_value
 | |
| 
 | |
| **Example Create Extra Specs For A Flavor: JSON response**
 | |
| 
 | |
| .. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-create-resp.json
 | |
|    :language: javascript
 | |
| 
 | |
| Show An Extra Spec For A Flavor
 | |
| ===============================
 | |
| 
 | |
| .. rest_method:: GET /flavors/{flavor_id}/os-extra_specs/{flavor_extra_spec_key}
 | |
| 
 | |
| Shows an extra spec, by key, for a flavor, by ID.
 | |
| 
 | |
| Normal response codes: 200
 | |
| 
 | |
| Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
 | |
| 
 | |
| Request
 | |
| -------
 | |
| 
 | |
| .. rest_parameters:: parameters.yaml
 | |
| 
 | |
|   - flavor_id: flavor_id
 | |
|   - flavor_extra_spec_key: flavor_extra_spec_key
 | |
| 
 | |
| 
 | |
| Response
 | |
| --------
 | |
| 
 | |
| .. rest_parameters:: parameters.yaml
 | |
| 
 | |
|   - key: flavor_extra_spec_key2
 | |
|   - value: flavor_extra_spec_value
 | |
| 
 | |
| **Example Show An Extra Spec For A Flavor: JSON response**
 | |
| 
 | |
| .. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-get-resp.json
 | |
|    :language: javascript
 | |
| 
 | |
| Update An Extra Spec For A Flavor
 | |
| =================================
 | |
| 
 | |
| .. rest_method:: PUT /flavors/{flavor_id}/os-extra_specs/{flavor_extra_spec_key}
 | |
| 
 | |
| Updates an extra spec, by key, for a flavor, by ID.
 | |
| 
 | |
| Normal response codes: 200
 | |
| 
 | |
| Error response codes: badRequest(400), unauthorized(401), forbidden(403)
 | |
| itemNotFound(404), conflict(409)
 | |
| 
 | |
| Request
 | |
| -------
 | |
| 
 | |
| .. rest_parameters:: parameters.yaml
 | |
| 
 | |
| 
 | |
|   - flavor_id: flavor_id
 | |
|   - flavor_extra_spec_key: flavor_extra_spec_key
 | |
|   - key: flavor_extra_spec_key2
 | |
|   - value: flavor_extra_spec_value
 | |
| 
 | |
| 
 | |
| **Example Update An Extra Spec For A Flavor: JSON request**
 | |
| 
 | |
| .. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-update-req.json
 | |
|    :language: javascript
 | |
| 
 | |
| Response
 | |
| --------
 | |
| 
 | |
| .. rest_parameters:: parameters.yaml
 | |
| 
 | |
| 
 | |
|   - key: flavor_extra_spec_key2
 | |
|   - value: flavor_extra_spec_value
 | |
| 
 | |
| **Example Update An Extra Spec For A Flavor: JSON response**
 | |
| 
 | |
| .. literalinclude:: ../../doc/api_samples/flavor-extra-specs/flavor-extra-specs-update-resp.json
 | |
|    :language: javascript
 | |
| 
 | |
| Delete An Extra Spec For A Flavor
 | |
| =================================
 | |
| 
 | |
| .. rest_method:: DELETE /flavors/{flavor_id}/os-extra_specs/{flavor_extra_spec_key}
 | |
| 
 | |
| Deletes an extra spec, by key, for a flavor, by ID.
 | |
| 
 | |
| Normal response codes: 200
 | |
| 
 | |
| Error response codes: unauthorized(401), forbidden(403), itemNotFound(404)
 | |
| 
 | |
| Request
 | |
| -------
 | |
| 
 | |
| .. rest_parameters:: parameters.yaml
 | |
| 
 | |
| 
 | |
|   - flavor_id: flavor_id
 | |
|   - flavor_extra_spec_key: flavor_extra_spec_key
 | |
| 
 | |
| Response
 | |
| --------
 | |
| 
 | |
| There is no body content for the response of a successful DELETE action.
 |