Class NovaComputeServiceAdapter
- java.lang.Object
-
- org.jclouds.openstack.nova.v2_0.compute.NovaComputeServiceAdapter
-
- All Implemented Interfaces:
ComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
public class NovaComputeServiceAdapter extends Object implements ComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
The adapter used by the NovaComputeServiceContextModule to interface the nova-specific domain model to the computeService generic domain model.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.jclouds.compute.ComputeServiceAdapter
ComputeServiceAdapter.NodeAndInitialCredentials<N>
-
-
Field Summary
Fields Modifier and Type Field Description protected Logger
logger
protected NovaApi
novaApi
protected com.google.common.base.Supplier<Set<String>>
regionIds
protected RemoveFloatingIpFromNodeAndDeallocate
removeFloatingIpFromNodeAndDeallocate
-
Constructor Summary
Constructors Constructor Description NovaComputeServiceAdapter(NovaApi novaApi, com.google.common.base.Supplier<Set<String>> regionIds, RemoveFloatingIpFromNodeAndDeallocate removeFloatingIpFromNodeAndDeallocate, com.google.common.base.Predicate<RegionAndId> serverRunningPredicate, com.google.common.base.Predicate<RegionAndId> serverTerminatedPredicate, CleanupResources cleanupResources)
-
Method Summary
-
-
-
Field Detail
-
logger
@Named("jclouds.compute") protected Logger logger
-
novaApi
protected final NovaApi novaApi
-
removeFloatingIpFromNodeAndDeallocate
protected final RemoveFloatingIpFromNodeAndDeallocate removeFloatingIpFromNodeAndDeallocate
-
-
Constructor Detail
-
NovaComputeServiceAdapter
@Inject public NovaComputeServiceAdapter(NovaApi novaApi, com.google.common.base.Supplier<Set<String>> regionIds, RemoveFloatingIpFromNodeAndDeallocate removeFloatingIpFromNodeAndDeallocate, @Named("jclouds.compute.timeout.node-running") com.google.common.base.Predicate<RegionAndId> serverRunningPredicate, @Named("jclouds.compute.timeout.node-terminated") com.google.common.base.Predicate<RegionAndId> serverTerminatedPredicate, CleanupResources cleanupResources)
-
-
Method Detail
-
createNodeWithGroupEncodedIntoName
public ComputeServiceAdapter.NodeAndInitialCredentials<ServerInRegion> createNodeWithGroupEncodedIntoName(String group, String name, Template template)
Note that we do not validate extensions here, on basis thatApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet
has already done so.- Specified by:
createNodeWithGroupEncodedIntoName
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
- Parameters:
group
- used to aggregate nodes with identical configurationname
- unique supplied name for the node, which has the group encoded into it.template
- includesimageId
,locationId
, andhardwareId
used to resume the instance.- Returns:
- library-native representation of a node. TODO: return typed exception on createNodeFailure
- See Also:
ComputeService.createNodesInGroup(String, int, Template)
-
listHardwareProfiles
public Iterable<FlavorInRegion> listHardwareProfiles()
Description copied from interface:ComputeServiceAdapter
Hardware profiles describe available cpu, memory, and disk configurations that can be used to run a node. To implement this method, return the library native hardware profiles available to the user. These will be used to launch nodes as a part of the template.- Specified by:
listHardwareProfiles
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
- Returns:
- a non-null iterable of available hardware profiles.
- See Also:
ComputeService.listHardwareProfiles()
-
listImages
public Iterable<ImageInRegion> listImages()
Description copied from interface:ComputeServiceAdapter
Images are the available configured operating systems that someone can run a node with. To implement this method, return the library native images available to the user. These will be used to launch nodes as a part of the template.- Specified by:
listImages
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
- Returns:
- a non-null iterable of available images.
- See Also:
ComputeService.listImages()
-
listNodes
public Iterable<ServerInRegion> listNodes()
- Specified by:
listNodes
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
-
listNodesByIds
public Iterable<ServerInRegion> listNodesByIds(Iterable<String> ids)
- Specified by:
listNodesByIds
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
-
listLocations
public Iterable<Location> listLocations()
- Specified by:
listLocations
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
-
getNode
public ServerInRegion getNode(String id)
- Specified by:
getNode
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
-
getImage
public ImageInRegion getImage(String id)
Description copied from interface:ComputeServiceAdapter
get a specific image by id- Specified by:
getImage
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
- Parameters:
id
-Image#getId
, which is not necessarilyImage#getProviderId
- Returns:
- image or null if not exists.
-
destroyNode
public void destroyNode(String id)
- Specified by:
destroyNode
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
-
rebootNode
public void rebootNode(String id)
- Specified by:
rebootNode
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
-
resumeNode
public void resumeNode(String id)
- Specified by:
resumeNode
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
-
suspendNode
public void suspendNode(String id)
- Specified by:
suspendNode
in interfaceComputeServiceAdapter<ServerInRegion,FlavorInRegion,ImageInRegion,Location>
-
-