Interface VolumeTypeApi
@Beta
@Consumes("application/json")
@Path("/os-volume-types")
public interface VolumeTypeApi
Provides access to the OpenStack Compute (Nova) Volume Type extension API.
This extension is no longer supported in OpenStack Liberty.
You can use the Block Storage API and endpoint to list volume types,
see volume types v2.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptioncreate(String name, CreateVolumeTypeOptions... options) Creates a new volume typebooleanDeletes a volume typebooleandeleteExtraSpec(String id, String key) Deletes an existing extra specGets a volume typegetExtraSpec(String id, String key) Retrieve a single extra spec valuegetExtraSpecs(String id) Gets the extra specs for a volume typecom.google.common.collect.FluentIterable<VolumeType>list()voidupdateExtraSpec(String id, String key, String value) Creates or updates a single extra spec valuevoidupdateExtraSpecs(String id, Map<String, String> specs) Creates or updates the extra metadata for a given flavor
-
Method Details
-
list
- Returns:
- set of all volume types
-
get
Gets a volume type- Parameters:
id- the id of the volume type to retrieve- Returns:
- the requested volume type
-
create
@Named("volumeType:create") @POST @Produces("application/json") VolumeType create(String name, CreateVolumeTypeOptions... options) Creates a new volume type- Parameters:
name- the name of the new volume typeoptions- optional settings for the new volume type- Returns:
- the new volume type
-
delete
Deletes a volume type- Parameters:
id- the id of the volume type to delete
-
getExtraSpecs
@Named("volumeType:getExtraSpecs") @GET @Path("/{id}/extra_specs") Map<String,String> getExtraSpecs(@PathParam("id") String id) Gets the extra specs for a volume type- Parameters:
id- the id of the volume type- Returns:
- the set of extra metadata for the flavor
-
updateExtraSpecs
@Named("volumeType:updateExtraSpecs") @POST @Path("/{id}/extra_specs") @Produces("application/json") void updateExtraSpecs(@PathParam("id") String id, Map<String, String> specs) Creates or updates the extra metadata for a given flavor -
getExtraSpec
@Named("volumeType:getExtraSpec") @GET @Path("/{id}/extra_specs/{key}") @Nullable String getExtraSpec(@PathParam("id") String id, @PathParam("key") String key) Retrieve a single extra spec value- Parameters:
id- the id of the volume typekey- the key of the extra spec item to retrieve
-
updateExtraSpec
@Named("volumeType:updateExtraSpec") @PUT @Path("/{id}/extra_specs/{key}") @Produces("application/json") void updateExtraSpec(@PathParam("id") String id, @PathParam("key") String key, String value) Creates or updates a single extra spec value- Parameters:
id- the id of the volume typekey- the extra spec key (when creating ensure this does not include whitespace or other difficult characters)value- the new value to store associate with the key
-
deleteExtraSpec
@Named("volumeType:deleteExtraSpec") @DELETE @Path("/{id}/extra_specs/{key}") boolean deleteExtraSpec(@PathParam("id") String id, @PathParam("key") String key) Deletes an existing extra spec- Parameters:
id- the id of the volume typekey- the key of the extra spec to delete
-