Class FlavorServiceImpl
- java.lang.Object
-
- org.openstack4j.openstack.internal.BaseOpenStackService
-
- org.openstack4j.openstack.compute.internal.BaseComputeServices
-
- org.openstack4j.openstack.compute.internal.FlavorServiceImpl
-
- All Implemented Interfaces:
FlavorService,RestService
public class FlavorServiceImpl extends BaseComputeServices implements FlavorService
Flavor service provides CRUD capabilities for Flavor(s). A flavor is an available hardware configuration/template for a server- Author:
- Jeremy Unruh, whaon
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstack4j.openstack.internal.BaseOpenStackService
BaseOpenStackService.Invocation<R>
-
-
Constructor Summary
Constructors Constructor Description FlavorServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<? extends FlavorAccess>addTenantAccess(String flavorId, String tenantId)Add access to private flavorFlavorcreate(String name, int ram, int vcpus, int disk, int ephemeral, int swap, float rxtxFactor, boolean isPublic)Creates a new FlavorFlavorcreate(Flavor flavor)Creates a new FlavorMap<String,String>createAndUpdateExtraSpecs(String flavorId, Map<String,String> spec)post a key-value map, if key exist, value will be updated, if not ,new extra spec created.ActionResponsedelete(String flavorId)Deletes a Flavor by it's identifiervoiddeleteExtraSpecs(String flavorId, String key)delete the extra spec with the key and flavorIdFlavorget(String flavorId)Get a Flavor by it's identifierStringgetSpec(String flavorId, String key)get the extra spec's value by the keyList<? extends Flavor>list()List all Flavors with detailsList<? extends Flavor>list(boolean detail)list flavors with non filtering parametersList<? extends Flavor>list(boolean detail, Map<String,String> filteringParams)list flavorsList<? extends Flavor>list(Map<String,String> filteringParams)list flavors with detailedMap<String,String>listExtraSpecs(String flavorId)list extra specsList<? extends FlavorAccess>listFlavorAccess(String flavorId)List tenants with access to private flavorList<? extends FlavorAccess>removeTenantAccess(String flavorId, String tenantId)Delete access from private flavor-
Methods inherited from class org.openstack4j.openstack.compute.internal.BaseComputeServices
invokeAction, invokeActionWithResponse
-
Methods inherited from class org.openstack4j.openstack.internal.BaseOpenStackService
delete, deleteWithResponse, get, getProvider, getServiceVersion, getWithResponse, getXOpenstackRequestId, head, patch, patchWithResponse, post, postWithResponse, put, putWithResponse, request, toList, uri
-
-
-
-
Method Detail
-
list
public List<? extends Flavor> list()
List all Flavors with details- Specified by:
listin interfaceFlavorService- Returns:
- List of Flavor
-
list
public List<? extends Flavor> list(boolean detail)
list flavors with non filtering parameters- Specified by:
listin interfaceFlavorService
-
list
public List<? extends Flavor> list(Map<String,String> filteringParams)
list flavors with detailed- Specified by:
listin interfaceFlavorService
-
list
public List<? extends Flavor> list(boolean detail, Map<String,String> filteringParams)
list flavors- Specified by:
listin interfaceFlavorService- Parameters:
detail- is detailedfilteringParams- parameters affect the response data,availbed are:sort_key,sort_dir,limit,marker,minDisk,minRam,is_public
-
get
public Flavor get(String flavorId)
Get a Flavor by it's identifier- Specified by:
getin interfaceFlavorService- Parameters:
flavorId- the flavor identifier- Returns:
- Flavor
-
delete
public ActionResponse delete(String flavorId)
Deletes a Flavor by it's identifier- Specified by:
deletein interfaceFlavorService- Parameters:
flavorId- the flavor identifier- Returns:
- the action response
-
create
public Flavor create(Flavor flavor)
Creates a new Flavor- Specified by:
createin interfaceFlavorService- Parameters:
flavor- the flavor to create- Returns:
- the created flavor
-
create
public Flavor create(String name, int ram, int vcpus, int disk, int ephemeral, int swap, float rxtxFactor, boolean isPublic)
Creates a new Flavor- Specified by:
createin interfaceFlavorService- Parameters:
name- the descriptive name of the flavorram- the Memory in MB for the flavorvcpus- the Number of VCPUs for the flavordisk- the size of the local disk in GBswap- the Swap space in MBrxtxFactor- the RX/TX factor (default is 1) [OPTIONAL]- Returns:
- the created flavor
-
listExtraSpecs
public Map<String,String> listExtraSpecs(String flavorId)
list extra specs- Specified by:
listExtraSpecsin interfaceFlavorService- Returns:
- all extra specs for this flavor
-
createAndUpdateExtraSpecs
public Map<String,String> createAndUpdateExtraSpecs(String flavorId, Map<String,String> spec)
post a key-value map, if key exist, value will be updated, if not ,new extra spec created. openstack provides one api to support both create and update extra spec- Specified by:
createAndUpdateExtraSpecsin interfaceFlavorService- Returns:
- spec
-
deleteExtraSpecs
public void deleteExtraSpecs(String flavorId, String key)
delete the extra spec with the key and flavorId- Specified by:
deleteExtraSpecsin interfaceFlavorService
-
getSpec
public String getSpec(String flavorId, String key)
get the extra spec's value by the key- Specified by:
getSpecin interfaceFlavorService- Returns:
- value
-
listFlavorAccess
public List<? extends FlavorAccess> listFlavorAccess(String flavorId)
List tenants with access to private flavor- Specified by:
listFlavorAccessin interfaceFlavorService- Returns:
- List tenants with access to private flavor
-
addTenantAccess
public List<? extends FlavorAccess> addTenantAccess(String flavorId, String tenantId)
Add access to private flavor- Specified by:
addTenantAccessin interfaceFlavorService- Returns:
- List tenants with access to private flavor
-
removeTenantAccess
public List<? extends FlavorAccess> removeTenantAccess(String flavorId, String tenantId)
Delete access from private flavor- Specified by:
removeTenantAccessin interfaceFlavorService- Returns:
- List tenants with access to private flavor
-
-