com.elastisys.scale.cloudpool.openstack.driver.client

## Class StandardOpenstackClient

- java.lang.Object
- - com.elastisys.scale.cloudpool.openstack.driver.client.StandardOpenstackClient

All Implemented Interfaces:
  OpenstackClient

    public class StandardOpenstackClient
    extends Object
    implements OpenstackClient

Standard implementation of the `OpenstackClient` interface.

### Constructor Summary

Constructors
Constructor and Description
`StandardOpenstackClient()`

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `assignFloatingIp(String serverId)` Allocate a floating IP address and associate it with a given server.
`com.elastisys.scale.commons.openstack.OSClientFactory` `clientFactory()`
`void` `configure(CloudApiSettings configuration)` Configures this `OpenstackClient` with cloud API access credentials and settings.
`org.openstack4j.model.compute.Server` `getServer(String serverId)` Return meta data about a particular `Server` instance.
`List<org.openstack4j.model.compute.Server>` `getServers(String tag, String tagValue)` Retrieves all servers that match a given tag.
`org.openstack4j.model.compute.Server` `launchServer(String serverName, ProvisioningTemplate provisioningDetails, Map<String,String> tags)` Launch a new server.
`void` `tagServer(String serverId, Map<String,String> tags)` Adds meta data tags to a given server.
`void` `terminateServer(String serverId)` Terminates a particular server.
`void` `untagServer(String serverId, List<String> tagKeys)` Removes a collection of meta data tags from a given server.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### StandardOpenstackClient

    public StandardOpenstackClient()

### Method Detail

#### configure

    public void configure(CloudApiSettings configuration)

Description copied from interface: `OpenstackClient`
Configures this `OpenstackClient` with cloud API access credentials and settings.

Specified by:
  `configure` in interface `OpenstackClient`
Parameters:
  `configuration` - API access credentials and settings.

#### getServers

    public List<org.openstack4j.model.compute.Server> getServers(String tag,
                                                                 String tagValue)

Description copied from interface: `OpenstackClient`
Retrieves all servers that match a given tag.

Specified by:
  `getServers` in interface `OpenstackClient`
Parameters:
  `tag` - A meta data tag that must be present on returned servers.
  `tagValue` - The value for the meta data tag that must be present on returned servers.
Returns:
  All `Server`s matching the filters.

#### getServer

    public org.openstack4j.model.compute.Server getServer(String serverId)
                                                   throws NotFoundException

Description copied from interface: `OpenstackClient`
Return meta data about a particular `Server` instance.

Specified by:
  `getServer` in interface `OpenstackClient`
Parameters:
  `serverId` - The identifier of the requested server.
Returns:
  `Server` meta data.
Throws:
  `NotFoundException` - if the server doesn't exist.

#### launchServer

    public org.openstack4j.model.compute.Server launchServer(String serverName,
                                                             ProvisioningTemplate provisioningDetails,
                                                             Map<String,String> tags)

Description copied from interface: `OpenstackClient`
Launch a new server.

Specified by:
  `launchServer` in interface `OpenstackClient`
Parameters:
  `serverName` - The name to assign to the created server.
  `provisioningDetails` - The provisioning details on how to launch the new server.
  `tags` - Meta data tags to set on the launched server.
Returns:
  The launched `Server`.

#### assignFloatingIp

    public String assignFloatingIp(String serverId)
                            throws NotFoundException

Description copied from interface: `OpenstackClient`
Allocate a floating IP address and associate it with a given server.

Specified by:
  `assignFloatingIp` in interface `OpenstackClient`
Parameters:
  `serverId` - The identifier of the server that will be assigned a floating IP address.
Returns:
  The IP address that was assigned to the server.
Throws:
  `NotFoundException`

#### terminateServer

    public void terminateServer(String serverId)
                         throws NotFoundException

Description copied from interface: `OpenstackClient`
Terminates a particular server.

Specified by:
  `terminateServer` in interface `OpenstackClient`
Parameters:
  `serverId` - Identifier of the server to be terminated.
Throws:
  `NotFoundException` - if the server doesn't exist.

#### tagServer

    public void tagServer(String serverId,
                          Map<String,String> tags)

Description copied from interface: `OpenstackClient`
Adds meta data tags to a given server.

Specified by:
  `tagServer` in interface `OpenstackClient`
Parameters:
  `serverId` - Identifier of the server to be tagged.
  `tags` - Meta data tags to set on the server.

#### untagServer

    public void untagServer(String serverId,
                            List<String> tagKeys)

Description copied from interface: `OpenstackClient`
Removes a collection of meta data tags from a given server.

Specified by:
  `untagServer` in interface `OpenstackClient`
Parameters:
  `serverId` - Identifier of the server to be untagged.

#### clientFactory

    public com.elastisys.scale.commons.openstack.OSClientFactory clientFactory()