Class CreateServerRequest
- java.lang.Object
-
- com.elastisys.scale.cloudpool.openstack.requests.AbstractOpenstackRequest<org.openstack4j.model.compute.Server>
-
- com.elastisys.scale.cloudpool.openstack.requests.CreateServerRequest
-
- All Implemented Interfaces:
java.util.concurrent.Callable<org.openstack4j.model.compute.Server>
public class CreateServerRequest extends AbstractOpenstackRequest<org.openstack4j.model.compute.Server>
An request that, when executed, creates a new server instance.
-
-
Constructor Summary
Constructors Constructor Description CreateServerRequest(com.elastisys.scale.commons.openstack.OSClientFactory clientFactory, java.lang.String serverName, java.lang.String flavorName, java.lang.String imageName, java.lang.String keyPair, java.util.List<java.lang.String> securityGroups, java.util.List<java.lang.String> networks, java.lang.String encodedUserData, java.util.Map<java.lang.String,java.lang.String> metadata)Creates a newCreateServerRequest.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.openstack4j.model.compute.ServerdoRequest(org.openstack4j.api.OSClient api)Carries out the request and returns the response.-
Methods inherited from class com.elastisys.scale.cloudpool.openstack.requests.AbstractOpenstackRequest
call, getApiAccessConfig, getClientFactory
-
-
-
-
Constructor Detail
-
CreateServerRequest
public CreateServerRequest(com.elastisys.scale.commons.openstack.OSClientFactory clientFactory, java.lang.String serverName, java.lang.String flavorName, java.lang.String imageName, java.lang.String keyPair, java.util.List<java.lang.String> securityGroups, java.util.List<java.lang.String> networks, java.lang.String encodedUserData, java.util.Map<java.lang.String,java.lang.String> metadata) throws org.openstack4j.api.exceptions.ResponseExceptionCreates a newCreateServerRequest.- Parameters:
clientFactory- OpenStack API client factory.serverName- The name to assign to the new server.flavorName- The name of the machine type (flavor) to launch.imageName- The identifier of the machine image used to boot the machine.keyPair- The name of the key pair to use for the machine instance. May benull.securityGroups- The security group(s) to use for the new machine instance. May benull.networks- The names of the networks to attach the launched server to (for example,private). Each network creates a separate network interface controller (NIC) on the created server. Typically, this option can be left out, but in rare cases, when an account has more than one network to choose from, the OpenStack API forces us to be explicit about the network(s) we want to use. If set tonullor left empty, the default behavior is to use which ever network is configured by the cloud provider for the user/project. However, if there are multiple choices, this will cause server boot requests to fail.encodedUserData- The base64-encoded user data used to contextualize the started instance. May benull.metadata- Any meta data tags to assign to the new server. May benull.- Throws:
org.openstack4j.api.exceptions.ResponseException
-
-
Method Detail
-
doRequest
public org.openstack4j.model.compute.Server doRequest(org.openstack4j.api.OSClient api) throws NotFoundException, org.openstack4j.api.exceptions.ResponseExceptionDescription copied from class:AbstractOpenstackRequestCarries out the request and returns the response.- Specified by:
doRequestin classAbstractOpenstackRequest<org.openstack4j.model.compute.Server>- Parameters:
api- An authenticated OpenStack API client that is instructed to operate against the configured region.- Returns:
- The response.
- Throws:
org.openstack4j.api.exceptions.ResponseException- if the request failed.NotFoundException
-
-