public class CreateServerRequest extends AbstractOpenstackRequest<org.openstack4j.model.compute.Server>
| Constructor and Description |
|---|
CreateServerRequest(com.elastisys.scale.commons.openstack.OSClientFactory clientFactory,
String serverName,
String flavorName,
String imageName,
String keyPair,
List<String> securityGroups,
List<String> networks,
String encodedUserData,
Map<String,String> metadata)
Creates a new
CreateServerRequest. |
| Modifier and Type | Method and Description |
|---|---|
org.openstack4j.model.compute.Server |
doRequest(org.openstack4j.api.OSClient api)
Carries out the request and returns the response.
|
call, getApiAccessConfig, getClientFactorypublic CreateServerRequest(com.elastisys.scale.commons.openstack.OSClientFactory clientFactory,
String serverName,
String flavorName,
String imageName,
String keyPair,
List<String> securityGroups,
List<String> networks,
String encodedUserData,
Map<String,String> metadata)
throws org.openstack4j.api.exceptions.ResponseException
CreateServerRequest.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
be null.securityGroups - The security group(s) to use for the new machine instance. May
be null.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 to null or 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 be null.metadata - Any meta data tags to assign to the new server. May be
null.org.openstack4j.api.exceptions.ResponseExceptionpublic org.openstack4j.model.compute.Server doRequest(org.openstack4j.api.OSClient api)
throws NotFoundException,
org.openstack4j.api.exceptions.ResponseException
AbstractOpenstackRequestdoRequest in class AbstractOpenstackRequest<org.openstack4j.model.compute.Server>api - An authenticated OpenStack API client that is instructed to
operate against the configured region.org.openstack4j.api.exceptions.ResponseException - if the request failed.NotFoundExceptionCopyright © 2011–2017 Elastisys. All rights reserved.