@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public class Openstack extends Object
OSClient
.
The is to make sure the client is truly immutable and provide easy-to-mock abstraction for unittesting.
For server manipulation, this implementation provides metadata fingerprinting
to identify machines started via this plugin from given instance so it will not
manipulate servers it does not "own". In other words, pretends that there are no
other machines running in connected tenant.Modifier and Type | Class and Description |
---|---|
static class |
Openstack.ActionFailed |
static class |
Openstack.Factory |
static class |
Openstack.FactoryEP |
Constructor and Description |
---|
Openstack(org.openstack4j.api.OSClient client) |
Openstack(String endPointUrl,
String identity,
hudson.util.Secret credential,
String region) |
Modifier and Type | Method and Description |
---|---|
org.openstack4j.model.compute.Server |
_bootAndWaitActive(org.openstack4j.model.compute.builder.ServerCreateBuilder request,
int timeout) |
org.openstack4j.model.compute.FloatingIP |
assignFloatingIp(org.openstack4j.model.compute.Server server,
String poolName)
Assign floating ip address to the server.
|
org.openstack4j.model.compute.Server |
bootAndWaitActive(org.openstack4j.model.compute.builder.ServerCreateBuilder request,
int timeout)
Provision machine and wait until ready.
|
void |
destroyServer(org.openstack4j.model.compute.Server server)
Destroy the server.
|
String |
getImageIdFor(String name) |
static String |
getPublicAddress(org.openstack4j.model.compute.Server server)
Extract public address from server info.
|
List<org.openstack4j.model.compute.Server> |
getRunningNodes() |
org.openstack4j.model.compute.Server |
getServerById(String id) |
Collection<? extends org.openstack4j.model.compute.Flavor> |
getSortedFlavors() |
Collection<? extends org.openstack4j.model.image.Image> |
getSortedImages() |
List<String> |
getSortedIpPools() |
List<String> |
getSortedKeyPairNames() |
Collection<? extends org.openstack4j.model.network.Network> |
getSortedNetworks() |
Throwable |
sanityCheck()
Perform some tests before calling the connection successfully established.
|
org.openstack4j.model.compute.Server |
updateInfo(org.openstack4j.model.compute.Server server)
Fetch updated info about the server.
|
public Openstack(@Nonnull String endPointUrl, @Nonnull String identity, @Nonnull hudson.util.Secret credential, @CheckForNull String region)
public Openstack(@Nonnull org.openstack4j.api.OSClient client)
@Nonnull public Collection<? extends org.openstack4j.model.network.Network> getSortedNetworks()
@Nonnull public Collection<? extends org.openstack4j.model.image.Image> getSortedImages()
@Nonnull public Collection<? extends org.openstack4j.model.compute.Flavor> getSortedFlavors()
@CheckForNull public String getImageIdFor(String name)
@Nonnull public org.openstack4j.model.compute.Server getServerById(@Nonnull String id) throws NoSuchElementException
NoSuchElementException
@Nonnull public org.openstack4j.model.compute.Server bootAndWaitActive(@Nonnull org.openstack4j.model.compute.builder.ServerCreateBuilder request, @Nonnegative int timeout) throws Openstack.ActionFailed
Openstack.ActionFailed
- Openstack failed to provision the slave or it was in erroneous state (server will be deleted in such case).@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public org.openstack4j.model.compute.Server _bootAndWaitActive(@Nonnull org.openstack4j.model.compute.builder.ServerCreateBuilder request, @Nonnegative int timeout)
@Nonnull public org.openstack4j.model.compute.Server updateInfo(@Nonnull org.openstack4j.model.compute.Server server)
public void destroyServer(@Nonnull org.openstack4j.model.compute.Server server) throws Openstack.ActionFailed
Openstack.ActionFailed
- Openstack was not able to destroy the server.@Nonnull public org.openstack4j.model.compute.FloatingIP assignFloatingIp(@Nonnull org.openstack4j.model.compute.Server server, @CheckForNull String poolName)
server
- Server to assign FIPpoolName
- Name of the FIP pool to use. If null, openstack default pool will be used.@CheckForNull public static String getPublicAddress(@Nonnull org.openstack4j.model.compute.Server server)
@CheckForNull public Throwable sanityCheck()
Copyright © 2004-2016. All Rights Reserved.