Interface OpenstackClient

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      java.lang.String assignFloatingIp​(java.lang.String serverId)
      Allocate a floating IP address and associate it with a given server.
      void configure​(CloudApiSettings config)
      Configures this OpenstackClient with cloud API access credentials and settings.
      org.openstack4j.model.compute.Server getServer​(java.lang.String serverId)
      Return meta data about a particular Server instance.
      java.util.List<org.openstack4j.model.compute.Server> getServers​(java.lang.String tag, java.lang.String tagValue)
      Retrieves all servers that match a given tag.
      org.openstack4j.model.compute.Server launchServer​(java.lang.String name, ProvisioningTemplate provisioningDetails, java.util.Map<java.lang.String,​java.lang.String> tags)
      Launch a new server.
      void tagServer​(java.lang.String serverId, java.util.Map<java.lang.String,​java.lang.String> tags)
      Adds meta data tags to a given server.
      void terminateServer​(java.lang.String serverId)
      Terminates a particular server.
      void untagServer​(java.lang.String serverId, java.util.List<java.lang.String> tagKeys)
      Removes a collection of meta data tags from a given server.
    • Method Detail

      • configure

        void configure​(CloudApiSettings config)
        Configures this OpenstackClient with cloud API access credentials and settings.
        Parameters:
        config - API access credentials and settings.
      • getServers

        java.util.List<org.openstack4j.model.compute.Server> getServers​(java.lang.String tag,
                                                                        java.lang.String tagValue)
                                                                 throws org.openstack4j.api.exceptions.ResponseException
        Retrieves all servers that match a given tag.
        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 Servers matching the filters.
        Throws:
        org.openstack4j.api.exceptions.ResponseException - On communication errors.
      • getServer

        org.openstack4j.model.compute.Server getServer​(java.lang.String serverId)
                                                throws NotFoundException,
                                                       org.openstack4j.api.exceptions.ResponseException
        Return meta data about a particular Server instance.
        Parameters:
        serverId - The identifier of the requested server.
        Returns:
        Server meta data.
        Throws:
        NotFoundException - if the server doesn't exist.
        org.openstack4j.api.exceptions.ResponseException - On communication errors.
      • launchServer

        org.openstack4j.model.compute.Server launchServer​(java.lang.String name,
                                                          ProvisioningTemplate provisioningDetails,
                                                          java.util.Map<java.lang.String,​java.lang.String> tags)
                                                   throws org.openstack4j.api.exceptions.ResponseException
        Launch a new server.
        Parameters:
        name - 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.
        Throws:
        org.openstack4j.api.exceptions.ResponseException - On communication errors.
      • assignFloatingIp

        java.lang.String assignFloatingIp​(java.lang.String serverId)
                                   throws org.openstack4j.api.exceptions.ResponseException
        Allocate a floating IP address and associate it with a given server.
        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:
        org.openstack4j.api.exceptions.ResponseException - On communication errors.
      • terminateServer

        void terminateServer​(java.lang.String serverId)
                      throws NotFoundException,
                             org.openstack4j.api.exceptions.ResponseException
        Terminates a particular server.
        Parameters:
        serverId - Identifier of the server to be terminated.
        Throws:
        NotFoundException - if the server doesn't exist.
        org.openstack4j.api.exceptions.ResponseException - On communication errors.
      • tagServer

        void tagServer​(java.lang.String serverId,
                       java.util.Map<java.lang.String,​java.lang.String> tags)
                throws NotFoundException,
                       org.openstack4j.api.exceptions.ResponseException
        Adds meta data tags to a given server.
        Parameters:
        serverId - Identifier of the server to be tagged.
        tags - Meta data tags to set on the server.
        Throws:
        NotFoundException - if the server doesn't exist.
        org.openstack4j.api.exceptions.ResponseException - On communication errors.
      • untagServer

        void untagServer​(java.lang.String serverId,
                         java.util.List<java.lang.String> tagKeys)
                  throws NotFoundException,
                         org.openstack4j.api.exceptions.ResponseException
        Removes a collection of meta data tags from a given server.
        Parameters:
        serverId - Identifier of the server to be untagged.
        tags - The meta data tag keys to remove from the server.
        Throws:
        NotFoundException - if the server doesn't exist.
        org.openstack4j.api.exceptions.ResponseException - On communication errors.