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
FieldsModifier and TypeFieldDescriptionprotected Logger
protected final NovaApi
protected final RemoveFloatingIpFromNodeAndDeallocate
-
Constructor Summary
ConstructorsConstructorDescriptionNovaComputeServiceAdapter
(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
Modifier and TypeMethodDescriptioncreateNodeWithGroupEncodedIntoName
(String group, String name, Template template) Note that we do not validate extensions here, on basis thatApplyNovaTemplateOptionsCreateNodesWithGroupEncodedIntoNameThenAddToSet
has already done so.void
destroyNode
(String id) get a specific image by idHardware profiles describe available cpu, memory, and disk configurations that can be used to run a node.Images are the available configured operating systems that someone can run a node with.listNodesByIds
(Iterable<String> ids) void
rebootNode
(String id) void
resumeNode
(String id) void
suspendNode
(String id)
-
Field Details
-
logger
-
novaApi
-
regionIds
-
removeFloatingIpFromNodeAndDeallocate
-
-
Constructor Details
-
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 Details
-
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:
-
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:
-
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:
-
listNodes
- Specified by:
listNodes
in interfaceComputeServiceAdapter<ServerInRegion,
FlavorInRegion, ImageInRegion, Location>
-
listNodesByIds
- Specified by:
listNodesByIds
in interfaceComputeServiceAdapter<ServerInRegion,
FlavorInRegion, ImageInRegion, Location>
-
listLocations
- Specified by:
listLocations
in interfaceComputeServiceAdapter<ServerInRegion,
FlavorInRegion, ImageInRegion, Location>
-
getNode
- Specified by:
getNode
in interfaceComputeServiceAdapter<ServerInRegion,
FlavorInRegion, ImageInRegion, Location>
-
getImage
Description copied from interface:ComputeServiceAdapter
get a specific image by id- Specified by:
getImage
in interfaceComputeServiceAdapter<ServerInRegion,
FlavorInRegion, ImageInRegion, Location> - Parameters:
id
-invalid reference
Image#getId
invalid reference
Image#getProviderId
- Returns:
- image or null if not exists.
-
destroyNode
- Specified by:
destroyNode
in interfaceComputeServiceAdapter<ServerInRegion,
FlavorInRegion, ImageInRegion, Location>
-
rebootNode
- Specified by:
rebootNode
in interfaceComputeServiceAdapter<ServerInRegion,
FlavorInRegion, ImageInRegion, Location>
-
resumeNode
- Specified by:
resumeNode
in interfaceComputeServiceAdapter<ServerInRegion,
FlavorInRegion, ImageInRegion, Location>
-
suspendNode
- Specified by:
suspendNode
in interfaceComputeServiceAdapter<ServerInRegion,
FlavorInRegion, ImageInRegion, Location>
-