Class HetznerCloudAPI

java.lang.Object
me.tomsdevsn.hetznercloud.HetznerCloudAPI

public class HetznerCloudAPI extends Object
  • Constructor Details

    • HetznerCloudAPI

      public HetznerCloudAPI(String hcloudToken)
      Initial method to use the API
      Parameters:
      hcloudToken - API-Token for Hetzner Cloud API
      See Also:
    • HetznerCloudAPI

      public HetznerCloudAPI(String hcloudToken, okhttp3.OkHttpClient client)
      Initial method to use the API
      Parameters:
      hcloudToken - API-Token for Hetzner Cloud API The API token can be created within the Hetzner Cloud Console
      client - OkHttpClient instance to be used
  • Method Details

    • getActions

      @Deprecated public ActionsResponse getActions()
      Deprecated.
      This function has been deprecated by Hetzner
      Get all actions in a project.
      Returns:
      All Actions without pagination
    • getActions

      @Deprecated public ActionsResponse getActions(ActionStatus actionStatus)
      Deprecated.
      This function has been deprecated by Hetzner
      Get all action in a project filtered by its status.
      Parameters:
      actionStatus - Action status type
      Returns:
      ActionsResponse containing all actions without pagination filtered by its status
    • getActions

      @Deprecated public ActionsResponse getActions(ActionStatus actionStatus, PaginationParameters paginationParameters)
      Deprecated.
      This function has been deprecated by Hetzner
      Get all actions in a project.
      Parameters:
      actionStatus - Query only actions with the specified status
      paginationParameters - Pagination parameters
      Returns:
      ActionsResponse
    • getAction

      public ActionResponse getAction(long id)
      Get an action by id.
      Parameters:
      id - ID of the action
      Returns:
      ActionResponse
    • getServers

      public ServersResponse getServers()
      Get all servers in a project.
      Returns:
      All servers as Servers object without pagination
    • getServers

      public ServersResponse getServers(String labelSelector)
      Get all servers in a project filtered by a label selector
      Parameters:
      labelSelector - Label selector
      Returns:
      ServersResponse containing all servers which match the label selector
    • getServers

      public ServersResponse getServers(String labelSelector, PaginationParameters paginationParameters)
      Get all servers in a project.
      Parameters:
      labelSelector - Label selector filter
      paginationParameters - Pagination parameters
      Returns:
      All servers as Servers object
    • getServer

      public ServersResponse getServer(String name)
      Get servers by name.
      Parameters:
      name - Name of the server
      Returns:
      Matching servers as Servers object
    • getServer

      public ServerResponse getServer(long id)
      Get a server by id
      Parameters:
      id - id of the server
      Returns:
      GetServerResponse
    • createServer

      public CreateServerResponse createServer(CreateServerRequest createServerRequest)
      Create a server.
      Parameters:
      createServerRequest - Parameters for server creation.
      Returns:
      ServerResponse including Action status, Server object and (if no ssh key defined) root password.
    • deleteServer

      public ActionResponse deleteServer(long id)
      Delete a server
      Parameters:
      id - id of the server.
      Returns:
      ActionResponse object
    • updateServer

      public ServerResponse updateServer(long id, UpdateServerRequest updateServerRequest)
      Update a server's name and its labels.
      Parameters:
      id - id of the server.
      updateServerRequest - request
      Returns:
      ServerResponse object
    • requestConsole

      public ConsoleResponse requestConsole(long id)
      Request a WebSocket URL for a server.
      Parameters:
      id - id of the server
      Returns:
      ConsoleResponse object
    • changeServerProtection

      public ActionResponse changeServerProtection(long id, ChangeProtectionRequest changeProtection)
      Change the protection configuration of a server.
      Parameters:
      id - id of the server
      changeProtection - Request Object (both optional)
      Returns:
      ActionResponse object
    • addServerToPlacementGroup

      public ActionResponse addServerToPlacementGroup(long serverId, long placementGroupId)
      Add a server to a placement group. Server has to be stopped.
      Parameters:
      serverId - server id
      placementGroupId - placement group id
      Returns:
      ActionResponse
    • removeServerFromPlacementGroup

      public ActionResponse removeServerFromPlacementGroup(long serverId)
      Remove a server from a placement group.
      Parameters:
      serverId - server id
      Returns:
      ActionResponse
    • getServerActions

      public ActionsResponse getServerActions(long id)
      Get all performed Actions of a server.
      Parameters:
      id - id of the server
      Returns:
      ActionsResponse object
    • getFloatingIPActions

      public ActionsResponse getFloatingIPActions(long id)
      Get all performed Actions of a Floating IP
      Parameters:
      id - ID of the FloatingIP
      Returns:
      ActionsResponse object
    • powerOnServer

      public ActionResponse powerOnServer(long id)
      Power on a specific server with the id
      Parameters:
      id - of the server
      Returns:
      respond
    • powerOffServer

      public ActionResponse powerOffServer(long id)
      Force power off a specific server with the id
      Parameters:
      id - of the server
      Returns:
      respond
    • rebootServer

      public ActionResponse rebootServer(long id)
      Reboot a specific server with the id
      Parameters:
      id - of the server
      Returns:
      respond
    • resetServer

      public ActionResponse resetServer(long id)
      Reset a specific server with the id
      Parameters:
      id - of the server
      Returns:
      respond
    • shutdownServer

      public ActionResponse shutdownServer(long id)
      Shutdown a specific server via ACPI with the id
      Parameters:
      id - ID of the server
      Returns:
      respond
    • resetRootPassword

      public ResetRootPasswordResponse resetRootPassword(long id)
      Resets the root password from a specific server with the id
      Parameters:
      id - ID of the server
      Returns:
      respond
    • enableRescue

      public EnableRescueResponse enableRescue(long id)
      Enables the rescue mode from the server
      Parameters:
      id - ID of the server
      Returns:
      respond
    • enableRescue

      public EnableRescueResponse enableRescue(long id, EnableRescueRequest enableRescueRequest)
      Enables the rescue mode from the server
      Parameters:
      id - ID of the server
      enableRescueRequest - Request object
      Returns:
      respond
    • disableRescue

      public ActionResponse disableRescue(long id)
      Disables the rescue mode from the server.

      Only needed, if the server doesn't booted into the rescue mode.

      Parameters:
      id - ID of the server
      Returns:
      respond
    • rebuildServer

      public RebuildServerResponse rebuildServer(long id, RebuildServerRequest rebuildServerRequest)
      Rebuild a server, with the specific image.

      example: ubuntu-16.04

      Parameters:
      id - ID of the server
      rebuildServerRequest - Request object
      Returns:
      respond
    • changeServerType

      public ActionResponse changeServerType(long id, ChangeTypeRequest changeTypeRequest)
      Change the type from the server

      example: from cx11 to cpx21

      Parameters:
      id - ID of the server
      changeTypeRequest - Request object
      Returns:
      respond
    • getServerMetrics

      public MetricsResponse getServerMetrics(long id, String metricType, String start, String end)
      Get the metrics from a server
      Parameters:
      id - ID of the server
      metricType - like cpu, disk or network (but also cpu,disk possible)
      start - of the metric
      end - of the metric
      Returns:
      respond
    • createImage

      public CreateImageResponse createImage(long id, CreateImageRequest createImageRequest)
      Create an image from a server
      Parameters:
      id - ID of the server
      createImageRequest - Request object
      Returns:
      respond
    • changeImageProtection

      public ActionResponse changeImageProtection(long id, ChangeProtectionRequest protectionRequest)
      Enable or disable the Protection of an Image
      Parameters:
      id - ID of the image
      protectionRequest - Only the delete parameter!
      Returns:
      ActionResponse object
    • enableBackup

      public ActionResponse enableBackup(long id)
      Enable the backups from a server Please note that this action will increase the price of the server by 20%
      Parameters:
      id - ID of the server
      Returns:
      response
    • getISOS

      public ISOSResponse getISOS()
      Get all available ISO's.
      Returns:
      ISOSResponse
    • getISOS

      public ISOSResponse getISOS(Architecture architecture)
      Get all available ISO's by architecture.
      Parameters:
      architecture - Architecture
      Returns:
      ISOSResponse
    • getISOS

      public ISOSResponse getISOS(PaginationParameters paginationParameters)
      Get all available ISO's with pagination.
      Parameters:
      paginationParameters - Pagination
      Returns:
      ISOSResponse
    • getISOS

      public ISOSResponse getISOS(Architecture architecture, PaginationParameters paginationParameters)
      Get all available ISO's.
      Parameters:
      architecture - Architecture
      paginationParameters - Pagination parametres
      Returns:
      ISOSResponse
    • getISO

      public ISOResponse getISO(long id)
      Get an ISO by ID
      Parameters:
      id - ID of the ISO
      Returns:
      ISOResponse Object
    • attachISO

      public ActionResponse attachISO(long id, AttachISORequest attachISORequest)
      Attach an ISO to a server.

      To get all ISO's getISOS()

      Parameters:
      id - of the server
      attachISORequest - Request object
      Returns:
      ActionResponse object
    • detachISO

      public ActionResponse detachISO(long id)
      Detach an ISO from a server.
      Parameters:
      id - of the server
      Returns:
      respond
    • changeDNSPTR

      public ActionResponse changeDNSPTR(long id, ChangeReverseDNSRequest changeReverseDNSRequest)
      Changes the reverse DNS entry from a server.

      Floating IPs assigned to the server are not affected!

      Parameters:
      id - ID of the server
      changeReverseDNSRequest - Request object
      Returns:
      respond
    • getDatacenter

      public DatacenterResponse getDatacenter(long id)
      Get a Datacenter by ID
      Parameters:
      id - of the Datacenter
      Returns:
      respond
    • getDatacenters

      public DatacentersResponse getDatacenters()
      Get all available datacenters and the recommendation
      Returns:
      respond
    • getDatacenter

      public DatacentersResponse getDatacenter(String name)
      Get a datacenter by name
      Parameters:
      name - of the datacenter
      Returns:
      DatacentersResponse
    • getFirewalls

      public FirewallsResponse getFirewalls()
      Returns 25 Firewall objects.
      Returns:
      a FirewallsResponse containing all Firewalls of the requested page and paging metadata
      See Also:
    • getFirewalls

      public FirewallsResponse getFirewalls(String labelSelector)
      Get all Firewalls in a project by label selector.
      Parameters:
      labelSelector - Label Selector
      Returns:
      FirewallsResponse
      See Also:
    • getFirewalls

      public FirewallsResponse getFirewalls(PaginationParameters paginationParameters)
      Get all Firewalls in a project.
      Parameters:
      paginationParameters - Pagination parametres
      Returns:
      FirewallsResponse
      See Also:
    • getFirewalls

      public FirewallsResponse getFirewalls(String labelSelector, PaginationParameters paginationParameters)
      Returns all Firewall objects.
      Parameters:
      paginationParameters -
      Returns:
      a FirewallsResponse containing all Firewalls of the requested page and paging metadata
    • createFirewall

      public CreateFirewallResponse createFirewall(CreateFirewallRequest createFirewallRequest)
      Creates a new Firewall.
      Parameters:
      createFirewallRequest - the config of the Firewall you want to create
      Returns:
      a FirewallResponse containing the created Firewall and taken Actions
    • deleteFirewall

      public void deleteFirewall(long id)
      Deletes a Firewall.
      Parameters:
      id -
    • getFirewall

      public CreateFirewallResponse getFirewall(long id)
      Gets a specific Firewall.
      Parameters:
      id -
      Returns:
      the FirewallResponse containing the searched Firewall
    • updateFirewall

      public CreateFirewallResponse updateFirewall(long id, UpdateFirewallRequest updateFirewallRequest)
      Updates the Firewall. This replaces the current labels with the given
      Parameters:
      id -
      updateFirewallRequest - the changes you want to perform
      Returns:
      the FirewallResponse of the request, containing the new Firewall and Metadata
    • getFirewallActions

      public ActionsResponse getFirewallActions(long id)
      Returns all Action objects for a Firewall.
      Parameters:
      id -
      Returns:
      an ActionsResponse with the executed actions
    • applyFirewallToResources

      public ActionsResponse applyFirewallToResources(long id, List<FWApplicationTarget> applicationTargets)
      Applies one Firewall to multiple resources.
      Parameters:
      id - of the firewall you want to add to resources
      applicationTargets - you want to add
      Returns:
      an ActionsResponse with the executed actions
    • removeFirewallFromResources

      public ActionsResponse removeFirewallFromResources(long id, List<FWApplicationTarget> removalTargets)
      Removes one Firewall from multiple resources.
      Parameters:
      id - of the firewall you want to remove resources from
      removalTargets - you want to remove
      Returns:
      an ActionsResponse with the executed actions
    • removeAllRulesFromFirewall

      public ActionsResponse removeAllRulesFromFirewall(long id)
      Removes all rules of a Firewall.
      Parameters:
      id - the firewall you want to remove the rules from
      Returns:
      an ActionsResponse with the executed actions
      See Also:
    • setFirewallRules

      public ActionsResponse setFirewallRules(long id, List<FirewallRule> firewallRules)
      Sets the rules of a Firewall. All existing rules will be overwritten. If the firewallRules are empty, all rules are deleted.
      Parameters:
      id - of the Firewall you want to set the Rules on.
      firewallRules - you want to set.
      Returns:
      an ActionsResponse with the executed actions
    • getPricing

      public PricingResponse getPricing()
      Get all prices from the products
      Returns:
      PricingResponse
    • getPrimaryIPs

      public PrimaryIPsResponse getPrimaryIPs()
      Get all Primary IPs in a project
      Returns:
      PrimaryIPsResponse
    • getPrimaryIPs

      public PrimaryIPsResponse getPrimaryIPs(String labelSelector)
      Get all Primary IPs in a project by label selector
      Parameters:
      labelSelector - Label selector
      Returns:
      PrimaryIPsResponse
    • getPrimaryIPs

      public PrimaryIPsResponse getPrimaryIPs(String labelSelector, PaginationParameters paginationParameters)
      Get all Primary IPs in a project
      Parameters:
      labelSelector - Label selector
      paginationParameters - Pagination parametres
      Returns:
      PrimaryIPsResponse
    • getPrimaryIPByName

      public PrimaryIPsResponse getPrimaryIPByName(String name)
      Get a Primary IP by its name in a project
      Parameters:
      name - Name of the Primary IP
      Returns:
      PrimaryIPsResponse
    • getPrimaryIP

      public PrimaryIPsResponse getPrimaryIP(String ip)
      Get a Primary IP by the IP address itself
      Parameters:
      ip - IP address
      Returns:
      PrimaryIPsResponse
    • getPrimaryIP

      public PrimaryIPResponse getPrimaryIP(long id)
      Get a Primary IP by its id
      Parameters:
      id - id of the Primary IP
      Returns:
      PrimaryIPResponse
    • createPrimaryIP

      public CreatePrimaryIPResponse createPrimaryIP(CreatePrimaryIPRequest createPrimaryIPRequest)
      Create a Primary IP
      Parameters:
      createPrimaryIPRequest - Primary IP request
      Returns:
      CreatePrimaryIPResponse
    • updatePrimaryIP

      public PrimaryIPResponse updatePrimaryIP(long id, UpdatePrimaryIPRequest updatePrimaryIPRequest)
      Update a Primary IP
      Parameters:
      updatePrimaryIPRequest - Primary IP Update request
      Returns:
      PrimaryIPResponse
    • assignPrimaryIP

      public ActionResponse assignPrimaryIP(long id, AssignPrimaryIPRequest assignPrimaryIPRequest)
      Assign a Primary IP to a resource.
      Parameters:
      id - id of the Primary IP
      assignPrimaryIPRequest - Primary IP Resource Assignment request
      Returns:
      ActionResponse
    • unassignPrimaryIP

      public ActionResponse unassignPrimaryIP(long id)
      Unassign a Primary IP from a resource.
      Parameters:
      id - id of the Primary IP
      Returns:
      ActionResponse
    • changePrimaryIPReverseDNS

      public ActionResponse changePrimaryIPReverseDNS(long id, ChangeReverseDNSRequest changeReverseDNSRequest)
      Update a reverse DNS entry for a Primary IP
      Parameters:
      id - id of the Primary IP
      changeReverseDNSRequest - Reverse DNS update change
      Returns:
      ActionResponse
    • changePrimaryIPProtection

      public ActionResponse changePrimaryIPProtection(long id, ChangeProtectionRequest changeProtectionRequest)
    • deletePrimaryIP

      public String deletePrimaryIP(Long id)
      Delete a Primary IP
      Parameters:
      id - id of the Primary IP
      Returns:
      nothing
    • getFloatingIPs

      public FloatingIPsResponse getFloatingIPs()
      Get all Floating IPs in a project.
      Returns:
      FloatingIPsResponse
    • getFloatingIPs

      public FloatingIPsResponse getFloatingIPs(PaginationParameters paginationParameters)
      Get all Floating IPs in a project.
      Parameters:
      paginationParameters - Pagination parametres
      Returns:
      FloatingIPsResponse
    • getFloatingIPs

      public FloatingIPsResponse getFloatingIPs(String labelSelector)
      Get all Floating IPs in a project by label selector. A label selector can be e.g. env=prod
      Parameters:
      labelSelector - Label selector
      Returns:
      FloatingIPsResponse
    • getFloatingIPs

      public FloatingIPsResponse getFloatingIPs(String labelSelector, PaginationParameters paginationParameters)
      Get all Floating IPs in a project. A label selector can be e.g. env=prod
      Parameters:
      labelSelector - Label selector
      paginationParameters - Pagination parametres
      Returns:
      FloatingIPsResponse
    • getFloatingIP

      public FloatingIPResponse getFloatingIP(long id)
      Get a specific Floating IP.
      Parameters:
      id - ID of the Floating IP
      Returns:
      GetFloatingIPResponse
    • createFloatingIP

      public CreateFloatingIPResponse createFloatingIP(CreateFloatingIPRequest createFloatingIPRequest)
      Create a Floating IP for the project or for a Server.
      Parameters:
      createFloatingIPRequest - Request object
      Returns:
      FloatingIPResponse object
    • changeFloatingIPProtection

      public ActionResponse changeFloatingIPProtection(long id, ChangeProtectionRequest protectionRequest)
      Enable or disable the Protection of a Floating IP
      Parameters:
      id - ID of the Floating IP
      protectionRequest - Only the delete parameter!
      Returns:
      ActionResponse object
    • assignFloatingIP

      public ActionResponse assignFloatingIP(long id, AssignFloatingIPRequest assignFloatingIPRequest)
      Assign a Floating IP to a server
      Parameters:
      id - ID of the Floating IP
      assignFloatingIPRequest - Request object
      Returns:
      ActionResponse object
    • unassignFloatingIP

      public ActionResponse unassignFloatingIP(long id)
      Unassign a Floating IP from a server
      Parameters:
      id - ID of the Floating IP
      Returns:
      ActionResponse object
    • changeFloatingReverseDNS

      public ActionResponse changeFloatingReverseDNS(long id, ChangeReverseDNSRequest changeReverseDNSRequest)
      Change the reverse DNS entry for a Floating IP
      Parameters:
      id - ID of the Floating IP
      changeReverseDNSRequest - Request object
      Returns:
      ActionResponse object
    • deleteFloatingIP

      public String deleteFloatingIP(long id)
      Delete a Floating IP.

      This object does not have a respond!

      Parameters:
      id - ID of the Floating ID
      Returns:
      String
    • updateFloatingIP

      public CreateFloatingIPResponse updateFloatingIP(long id, UpdateFloatingIPRequest updateFloatingIPRequest)
      Update the description or labels of a Floating IP.
      Parameters:
      id - ID of the Floating IP
      updateFloatingIPRequest - Request Object
      Returns:
      Response from API (Action will be null)
    • getSSHKeys

      public SSHKeysResponse getSSHKeys()
      Get all SSH keys.
      Returns:
      SSHKeysResponse
    • getSSHKeys

      public SSHKeysResponse getSSHKeys(PaginationParameters paginationParameters)
      Get all SSH keys.
      Parameters:
      paginationParameters - Pagination parameters
      Returns:
      SSHKeysResponse
    • getSSHKeys

      public SSHKeysResponse getSSHKeys(String labelSelector)
      Get all SSH keys by label.
      Parameters:
      labelSelector - Label selector
      Returns:
      SSHKeysResponse
    • getSSHKeys

      public SSHKeysResponse getSSHKeys(String labelSelector, PaginationParameters paginationParameters)
      Get all SSH keys by label.
      Parameters:
      labelSelector - Label selector
      paginationParameters - Pagination parameters
      Returns:
      SSHKeysResponse
    • getSSHKey

      public SSHKeyResponse getSSHKey(long id)
      Get an SSH key by ID.
      Parameters:
      id - ID of the SSH key
      Returns:
      SSHKeyResponse
    • getSSHKey

      public SSHKeysResponse getSSHKey(String name)
      Get an SSH key by name.
      Parameters:
      name - name of the SSH key
      Returns:
      SSHKeysResponse object
    • getSSHKeyByFingerprint

      public SSHKeysResponse getSSHKeyByFingerprint(String fingerprint)
      Get a SSH key by the fingerprint.
      Parameters:
      fingerprint - Fingerprint of the SSH key
      Returns:
      SSHKeysResponse object
    • createSSHKey

      public SSHKeyResponse createSSHKey(CreateSSHKeyRequest createSshKeyRequest)
      Create an SSH key.
      Parameters:
      createSshKeyRequest - Request object
      Returns:
      SSHKeyResponse object
    • updateSSHKey

      public SSHKeyResponse updateSSHKey(long id, UpdateSSHKeyRequest updateSSHKeyRequest)
      Update parameters of an SSH key
      Parameters:
      id - ID of the SSH key
      updateSSHKeyRequest - Request Object
      Returns:
      SSHKeyResponse object
    • deleteSSHKey

      public String deleteSSHKey(long id)
      Delete an SSH key.

      This object does not have a response!

      Parameters:
      id - ID of the SSH key
      Returns:
      String
    • getServerTypes

      public ServerTypesResponse getServerTypes()
      Get all Server types.
      Returns:
      ServerTypesResponse object
    • getServerTypes

      public ServerTypesResponse getServerTypes(PaginationParameters paginationParameters)
      Get Server types Paginated.
      Returns:
      ServerTypesResponse object
    • getLoadBalancerTypes

      public LoadBalancerTypesResponse getLoadBalancerTypes()
      Get all Load Balancer types.
      Returns:
      LoadBalancerTypesResponse object
    • getLoadBalancerTypeByName

      public LoadBalancerTypesResponse getLoadBalancerTypeByName(String name)
      Get Load Balancer type by name.
      Parameters:
      name - Name of the Load Balancer type
      Returns:
      LoadBalancerTypesResponse object
    • getLoadBalancerType

      public LoadBalancerTypeResponse getLoadBalancerType(long id)
      Get a Load Balancer type by id.
      Parameters:
      id - ID of the load balancer type
      Returns:
      LoadBalancerTypeResponse
    • getServerTypeByName

      public ServerTypesResponse getServerTypeByName(String name)
      Get a Server type by name.
      Parameters:
      name - name of the Server type
      Returns:
      ServerTypesResponse object
    • getServerType

      public ServerTypeResponse getServerType(long id)
      Get a Server type by id.
      Parameters:
      id - id of the Server type
      Returns:
      ServerTypeResponse object
    • getLocations

      public LocationsResponse getLocations()
      Get all available Locations.
      Returns:
      LocationsResponse object
    • getLocationByName

      public LocationsResponse getLocationByName(String name)
      Get a Location by name.
      Parameters:
      name - Name of the location
      Returns:
      LocationsResponse object
    • getLocation

      public LocationResponse getLocation(long id)
      Get a location by id.
      Parameters:
      id - id of the location
      Returns:
      LocationResponse object
    • getImages

      public ImagesResponse getImages()
      Get all available images.
      Returns:
      ImagesResponse object
    • getImages

      public ImagesResponse getImages(String labelSelector)
      Get all images by label selector.
      Parameters:
      labelSelector - Label Selector
      Returns:
      ImagesResponse
    • getImages

      public ImagesResponse getImages(Architecture architecture)
      Get all images by architecture.
      Parameters:
      architecture - Architecture of the Image
      Returns:
      ImagesResponse
    • getImages

      public ImagesResponse getImages(String labelSelector, Architecture architecture)
      Get all images by label selector and architecture.
      Parameters:
      labelSelector - Label Selector
      architecture - Architecture of the Image
      Returns:
      ImagesResponse
    • getImages

      public ImagesResponse getImages(String labelSelector, PaginationParameters paginationParameters)
      Get all images by label selector with pagination.
      Parameters:
      labelSelector - Label Selector
      paginationParameters - Pagination parametres
      Returns:
      ImagesResponse
    • getImages

      public ImagesResponse getImages(Architecture architecture, PaginationParameters paginationParameters)
      Get all images by architecture with pagination.
      Parameters:
      architecture - Architecture
      paginationParameters - Pagination parametres
      Returns:
      ImagesResponse
    • getImages

      public ImagesResponse getImages(String labelSelector, Architecture architecture, PaginationParameters paginationParameters)
      Get all available images.
      Parameters:
      labelSelector - Label selector
      architecture - Architecture of the image
      paginationParameters - Pagination parametres
      Returns:
      ImagesResponse
    • getImagesByType

      public ImagesResponse getImagesByType(ImageType type)
      Get all images by type.
      Parameters:
      type - Type of image
      Returns:
      ImagesResponse object
    • getImagesByType

      public ImagesResponse getImagesByType(ImageType type, PaginationParameters paginationParameters)
      Get all images by type.
      Parameters:
      type - Type of image
      paginationParameters - Pagination parametres
      Returns:
      ImagesResponse object
    • getImageByName

      public ImagesResponse getImageByName(String name)
      Get an image by name.
      Parameters:
      name - Name of the image
      Returns:
      ImagesResponse object
    • getImage

      public ImageResponse getImage(long id)
      Get image by ID.
      Parameters:
      id - ID of the image
      Returns:
      ImageResponse object
    • updateImage

      public ImageResponse updateImage(long id, UpdateImageRequest updateImageRequest)
      Update the description or the type of a image.
      Parameters:
      id - ID of the image
      updateImageRequest - Request object
      Returns:
      ImageResponse object
    • deleteImage

      public String deleteImage(long id)
      Delete an image,

      This object does not have a respond!

      Parameters:
      id - ID of the image
      Returns:
      String
    • getVolumes

      public VolumesResponse getVolumes()
      Get all volumes in a project.
      Returns:
      VolumesResponse
    • getVolumes

      public VolumesResponse getVolumes(PaginationParameters paginationParameters)
      Get all volumes in a project.
      Parameters:
      paginationParameters - Pagination parametres
      Returns:
      VolumesResponse
    • getVolumes

      public VolumesResponse getVolumes(String labelSelector)
      Get all volumes in a project filtered by volumes
      Parameters:
      labelSelector - Label selector
      Returns:
      VolumesResponse
    • getVolumes

      public VolumesResponse getVolumes(String labelSelector, PaginationParameters paginationParameters)
      Get all volumes in a project.
      Parameters:
      labelSelector - Filter response by label selector
      paginationParameters - Pagination parametres
      Returns:
      VolumesResponse
    • getVolume

      public VolumeResponse getVolume(long id)
      Get a specific volume by id.
      Parameters:
      id - ID of the volume
      Returns:
      Volume object
    • createVolume

      public CreateVolumeResponse createVolume(CreateVolumeRequest createVolumeRequest)
      Create a new volume.
      Parameters:
      createVolumeRequest - Volume request object
      Returns:
      Volume object with action
    • updateVolume

      public VolumeResponse updateVolume(long id, UpdateVolumeRequest updateVolumeRequest)
      Update some specific options of a volume.
      Parameters:
      id - ID of the volume
      updateVolumeRequest - Update volume request object
      Returns:
      GetVolume object
    • deleteVolume

      public String deleteVolume(long id)
      Delete a volume
      Parameters:
      id - ID of the volume
      Returns:
      no return object
    • getVolumeActions

      public ActionsResponse getVolumeActions(long id)
      Get all actions of a volume.
      Parameters:
      id - ID of the volume
      Returns:
      Action array
    • attachVolumeToServer

      public ActionResponse attachVolumeToServer(long id, AttachVolumeRequest attachVolumeRequest)
      Attach a volume to a server.
      Parameters:
      id - ID of the volume
      attachVolumeRequest - Request object
      Returns:
      Action object
    • detachVolume

      public ActionResponse detachVolume(long id)
      Detach a volume from a server.
      Parameters:
      id - ID of the volume
      Returns:
      Action object
    • resizeVolume

      public ActionResponse resizeVolume(long id, ResizeVolumeRequest resizeVolumeRequest)
      Resize a volume. Downsizing not possible!
      Parameters:
      id - ID of the volume
      resizeVolumeRequest - Request object
      Returns:
      Action object
    • changeVolumeProtection

      public ActionResponse changeVolumeProtection(long id, ChangeProtectionRequest changeProtectionRequest)
      Change the protection mode of the volume. Only deletion protection is available!
      Parameters:
      id - ID of the volume
      changeProtectionRequest - Request object
      Returns:
      Action object
    • getNetworks

      public NetworksResponse getNetworks()
      Get all Private networks in a project.
      Returns:
      NetworksResponse
    • getNetworks

      public NetworksResponse getNetworks(PaginationParameters paginationParameters)
      Get all Private networks in a project.
      Parameters:
      paginationParameters - Pagination parametres
      Returns:
      NetworksResponse
    • getNetworks

      public NetworksResponse getNetworks(String labelSelector)
      Get all Private Networks in a project with a label selector.
      Parameters:
      labelSelector - Label Selector
      Returns:
      NetworksResponse
    • getNetworks

      public NetworksResponse getNetworks(String labelSelector, PaginationParameters paginationParameters)
      Get all Private networks in a project.
      Parameters:
      labelSelector - Label selector
      paginationParameters - Pagination parametres
      Returns:
      NetworksResponse
    • getNetworksByName

      public NetworksResponse getNetworksByName(String name)
      Get all networks with specific name.
      Parameters:
      name - Name of the network
      Returns:
      Response from API
    • getNetwork

      public NetworkResponse getNetwork(long id)
      Get a network with it's specific ID.
      Parameters:
      id - ID of the network
      Returns:
      Response from API
    • updateNetwork

      public NetworkResponse updateNetwork(long id, UpdateNetworkRequest updateNetworkRequest)
      Update the labels or the name of a network.
      Parameters:
      id - ID of the network
      updateNetworkRequest - Request object
      Returns:
      Response from API
    • createNetwork

      public NetworkResponse createNetwork(CreateNetworkRequest createNetworkRequest)
      Create a new private network.
      Parameters:
      createNetworkRequest - Request object
      Returns:
      Response from API
    • deleteNetwork

      public String deleteNetwork(long id)
      Delete a network.
      Parameters:
      id - ID of the network
      Returns:
      There is no response.
    • attachServerToNetwork

      public ActionResponse attachServerToNetwork(long id, AttachServerToNetworkRequest attachServerToNetworkRequest)
      Attaches a server to a private network.
      Parameters:
      id - ID of the server
      attachServerToNetworkRequest - Request object
      Returns:
      Response from API
    • detachServerFromNetwork

      public ActionResponse detachServerFromNetwork(long id, DetachServerFromNetworkRequest detachServerFromNetworkRequest)
      Detaches a server from a private network.
      Parameters:
      id - ID of the server
      detachServerFromNetworkRequest - Request object
      Returns:
      Response from API
    • changeAliasIPsOfNetwork

      public ActionResponse changeAliasIPsOfNetwork(long id, ChangeAliasIPsofNetworkRequest changeAliasIPsofNetworkRequest)
      Change alias IPs of a network.
      Parameters:
      id - ID of the server
      changeAliasIPsofNetworkRequest - Request object
      Returns:
      Response from API
    • changeNetworkProtection

      public ActionResponse changeNetworkProtection(long id, ChangeProtectionRequest changeProtection)
      Change the protection configuration for a network
      Parameters:
      id - ID of the network
      changeProtection - Request Object
      Returns:
      Response from API
    • getNetworkActions

      public ActionsResponse getNetworkActions(long id)
      Get all performed Actions for a network
      Parameters:
      id - ID of the network
      Returns:
      Response from API
    • addSubnetToNetwork

      public ActionResponse addSubnetToNetwork(long id, AddSubnetToNetworkRequest addSubnetToNetworkRequest)
      Add a new subnet to a network.
      Parameters:
      id - ID of the network
      addSubnetToNetworkRequest - Request object
      Returns:
      Response from API
    • deleteSubnetFromNetwork

      public ActionResponse deleteSubnetFromNetwork(long id, DeleteSubnetFromNetwork deleteSubnetFromNetwork)
      Delete a subnet from a network.
      Parameters:
      id - ID of the network
      deleteSubnetFromNetwork - Request object
      Returns:
      Response from API
    • addRouteToNetwork

      public ActionResponse addRouteToNetwork(long id, NetworkRouteRequest networkRouteRequest)
      Add a route to a network.
      Parameters:
      id - ID of the network
      networkRouteRequest - Request object
      Returns:
      Response from API
    • deleteRouteFromNetwork

      public ActionResponse deleteRouteFromNetwork(long id, NetworkRouteRequest networkRouteRequest)
      Delete a route from a network.
      Parameters:
      id - ID of the network
      networkRouteRequest - Request object
      Returns:
      Response from API
    • changeIPRangeOfNetwork

      public ActionResponse changeIPRangeOfNetwork(long id, ChangeIPRangeOfNetwork changeIPRangeOfNetwork)
      Change the IP range of a network. Shrinking not possible!
      Parameters:
      id - ID of the network
      changeIPRangeOfNetwork - Request object
      Returns:
      Response from API
    • getCertificates

      public CertificatesResponse getCertificates()
      Get all certificates from the project.
      Returns:
      CertificatesResponse
    • getCertificates

      public CertificatesResponse getCertificates(PaginationParameters paginationParameters)
      Get all certificates from the project.
      Parameters:
      paginationParameters - Pagination parametres
      Returns:
      CertificatesResponse
    • getCertificates

      public CertificatesResponse getCertificates(String labelSelector)
      Get all certificates by label selector. A label selector can be e.g. env=prod
      Parameters:
      labelSelector - Label selector used for filtering
      Returns:
      CertificatesResponse
    • getCertificates

      public CertificatesResponse getCertificates(String labelSelector, PaginationParameters paginationParameters)
      Get all certificates by label selector. A label selector can be e.g. env=prod
      Parameters:
      labelSelector - Label selector used for filtering
      paginationParameters - Pagination parametres
      Returns:
      CertificatesResponse
    • getCertificate

      public CertificatesResponse getCertificate(String name)
      Get a specific certificate by its name.
      Parameters:
      name - Name of the certificate
      Returns:
      CertificatesResponse
    • getCertificate

      public CertificateResponse getCertificate(long id)
      Get a specific certificate by id.
      Parameters:
      id - ID of the certificate
      Returns:
      CertificateResponse
    • createCertificate

      public CertificateResponse createCertificate(CreateCertificateRequest createCertificateRequest)
      Create a new certificate.
      Parameters:
      createCertificateRequest - CertificateRequest object with name, public- and private-key
      Returns:
      CertificateResponse
    • updateCertificate

      public CertificateResponse updateCertificate(long id, UpdateCertificateRequest updateCertificateRequest)
      Update a certificate.

      Available options to update: - Name - Labels

      Parameters:
      id - ID of the certificate
      updateCertificateRequest - Certificate Update object
      Returns:
      CertificateResponse
    • retryCertificate

      public ActionResponse retryCertificate(long id)
      Retry an issuance or renewal for a managed certificate.

      This method is only applicable to managed certificate where either the issuance or renewal status is failed.

      Parameters:
      id - ID of the certificate
      Returns:
      ActionResponse
    • deleteCertificate

      public String deleteCertificate(long id)
      Delete a certificate.
      Parameters:
      id - ID of the certificate
      Returns:
      nothing...
    • getLoadBalancers

      public LoadBalancersResponse getLoadBalancers()
      Get all Load Balancers.
      Returns:
      LoadBalancersResponse
    • getLoadBalancerByName

      public LoadBalancersResponse getLoadBalancerByName(String name)
      Get Load Balancer by name.
      Returns:
      LoadBalancersResponse
    • getLoadBalancers

      public LoadBalancersResponse getLoadBalancers(String labelSelector)
      Get all Load Balancers by label selector.
      Parameters:
      labelSelector - Label Selector
      Returns:
      LoadBalancersResponse
    • getLoadBalancers

      public LoadBalancersResponse getLoadBalancers(String labelSelector, PaginationParameters paginationParameters)
      Get all Load Balancers.
      Parameters:
      labelSelector - Label Selector
      paginationParameters - Pagination parametres
      Returns:
      LoadBalancersResponse
    • getLoadBalancer

      public LoadBalancerResponse getLoadBalancer(long id)
      Get a specific Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      Returns:
      LoadBalancerResponse
    • createLoadBalancer

      public LoadBalancerResponse createLoadBalancer(CreateLoadBalancerRequest createLoadBalancerRequest)
      Create a new Load Balancer.
      Parameters:
      createLoadBalancerRequest - Load Balancer Request object
      Returns:
      LoadBalancerResponse
    • updateLoadBalancer

      public LoadBalancerResponse updateLoadBalancer(long id, UpdateLoadBalancerRequest updateLoadBalancerRequest)
      Update an existing Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      updateLoadBalancerRequest - Load Balancer Update Request Object
      Returns:
      LoadBalancerResponse
    • deleteLoadBalancer

      public String deleteLoadBalancer(long id)
      Delete a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      Returns:
      nothing
    • getLoadBalancerActions

      public ActionsResponse getLoadBalancerActions(long id)
      Get all actions of a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      Returns:
      ActionsResponse
    • addServiceToLoadBalancer

      public LoadBalancerResponse addServiceToLoadBalancer(long id, LBServiceRequest lbServiceRequest)
      Add a service to a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      lbServiceRequest - Load Balancer Service Request
      Returns:
      LoadBalancerResponse
    • updateServiceOfLoadBalancer

      public LoadBalancerResponse updateServiceOfLoadBalancer(long id, LBServiceRequest lbServiceRequest)
      Update a service of a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      lbServiceRequest - Load Balancer Service Request
      Returns:
      LoadBalancerResponse
    • deleteServiceOfLoadBalancer

      public ActionResponse deleteServiceOfLoadBalancer(long id, long listenPort)
      Delete a service of a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      listenPort - The desired "listen port" of the service
      Returns:
      ActionResponse
    • addTargetToLoadBalancer

      public ActionResponse addTargetToLoadBalancer(long id, LBTargetRequest lbTargetRequest)
      Add a target to a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      lbTargetRequest - Load Balancer Target Request
      Returns:
      ActionResponse
    • removeTargetFromLoadBalancer

      public ActionResponse removeTargetFromLoadBalancer(long id, LBTargetRequest lbTargetRequest)
      Removes a target from a load balancer.
      Parameters:
      id - ID of the Load Balancer
      lbTargetRequest - Load Balancer Target Request
      Returns:
      ActionResponse
    • changeAlgorithmOfLoadBalancer

      public ActionResponse changeAlgorithmOfLoadBalancer(long id, String algorithmType)
      Changes the algorithm that determines to which target new requests are sent.
      Parameters:
      id - ID of the Load Balancer
      algorithmType - Algorithm Type
      Returns:
      ActionResponse
    • changeTypeOfLoadBalancer

      public ActionResponse changeTypeOfLoadBalancer(long id, String loadBalancerType)
      Changes the type of a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      loadBalancerType - New type of the Load Balancer
      Returns:
      ActionResponse
    • attachNetworkToLoadBalancer

      public ActionResponse attachNetworkToLoadBalancer(long id, long networkId, String ip)
      Attach a network to a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      networkId - ID of the Network
      ip - IP for the Load Balancer in this private network
      Returns:
      ActionResponse
    • attachNetworkToLoadBalancer

      public ActionResponse attachNetworkToLoadBalancer(long id, long networkId)
      Attach a network to a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      networkId - ID of the Network
      Returns:
      ActionResponse
    • detachNetworkFromLoadBalancer

      public ActionResponse detachNetworkFromLoadBalancer(long id, long networkId)
      Detach a network from a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      networkId - ID of the Network
      Returns:
      ActionResponse
    • enablePublicInterfaceOfLoadBalancer

      public ActionResponse enablePublicInterfaceOfLoadBalancer(long id)
      Enable the public interface of a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      Returns:
      ActionResponse
    • disablePublicInterfaceOfLoadBalancer

      public ActionResponse disablePublicInterfaceOfLoadBalancer(long id)
      Disable the public interface of a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      Returns:
      ActionResponse
    • changeProtectionOfLoadBalancer

      public ActionResponse changeProtectionOfLoadBalancer(long id, boolean delete)
      Change the protection configuration of a Load Balancer.
      Parameters:
      id - ID of the Load Balancer
      delete - Delete protection
      Returns:
      ActionResponse
    • getPlacementGroup

      public PlacementGroupResponse getPlacementGroup(long id)
      Get a specific placement group.
      Parameters:
      id - placement group ID
      Returns:
      PlacementGroupResponse
    • getPlacementGroups

      public PlacementGroupsResponse getPlacementGroups()
      Get all placement groups.
      Returns:
      PlacementGroupsResponse
    • getPlacementGroups

      public PlacementGroupsResponse getPlacementGroups(PaginationParameters paginationParameters)
      Get all placement groups.
      Parameters:
      paginationParameters - Pagination parametres
      Returns:
      PlacementGroupsResponse
    • getPlacementGroup

      public PlacementGroupsResponse getPlacementGroup(String name)
      Get placement group by name.
      Parameters:
      name - name of the placement grouo
      Returns:
      PlacementGroupsResponse
    • getPlacementGroups

      public PlacementGroupsResponse getPlacementGroups(String labelSelector)
      Get placement groups by label selector.
      Parameters:
      labelSelector - label selector used by resource
      Returns:
      PlacementGroupsResponse
    • getPlacementGroup

      public PlacementGroupsResponse getPlacementGroup(PlacementGroupType type)
      Get placement groups by type
      Parameters:
      type - Type of the placement group
      Returns:
      PlacementGroupsResponse
    • createPlacementGroup

      public PlacementGroupResponse createPlacementGroup(CreatePlacementGroupRequest placementGroupRequest)
      Create a placement group.
      Parameters:
      placementGroupRequest - PlacementGroupRequest object
      Returns:
      PlacementGroupResponse
    • deletePlacementGroup

      public String deletePlacementGroup(long id)
      Delete a placement group.
      Parameters:
      id - placement group ID
      Returns:
      ActionResponse
    • convertToISO8601

      public String convertToISO8601(Date date)
      Converts a Date to the ISO-8601 format
      Parameters:
      date - Date to be converted
      Returns:
      Date in ISO-8601 format