Class ClusterClient


  • public class ClusterClient
    extends java.lang.Object
    Client library for the Cluster Service.
    Since:
    3.0.0
    • Method Summary

      All Methods Instance Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      void addCommandsToCluster​(java.lang.String clusterId, java.util.List<java.lang.String> commandIds)
      Method to add commands to a cluster.
      void addConfigsToCluster​(java.lang.String clusterId, java.util.Set<java.lang.String> configs)
      Method to add configs to a cluster.
      void addDependenciesToCluster​(java.lang.String clusterId, java.util.Set<java.lang.String> dependencies)
      Method to add dependencies to a cluster.
      void addTagsToCluster​(java.lang.String clusterId, java.util.Set<java.lang.String> tags)
      Method to add tags to a cluster.
      java.lang.String createCluster​(Cluster cluster)
      Create a cluster ing genie.
      void deleteAllClusters()
      Method to delete all clusters from Genie.
      void deleteCluster​(java.lang.String clusterId)
      Method to delete a cluster from Genie.
      Cluster getCluster​(java.lang.String clusterId)
      Method to get a Cluster from Genie.
      java.util.List<Cluster> getClusters()
      Method to get a list of all the clusters.
      java.util.List<Cluster> getClusters​(java.lang.String name, java.util.List<java.lang.String> statusList, java.util.List<java.lang.String> tagList, java.lang.Long minUpdateTime, java.lang.Long maxUpdateTime)
      java.util.List<Cluster> getClusters​(java.lang.String name, java.util.List<java.lang.String> statusList, java.util.List<java.lang.String> tagList, java.lang.Long minUpdateTime, java.lang.Long maxUpdateTime, @Min(1L) java.lang.Integer pageSize, SortAttribute sortAttribute, SortDirection sortDirection, @Min(0L) java.lang.Integer pageIndex)
      Method to get a list of all the clusters from Genie for the query parameters specified.
      java.util.List<Command> getCommandsForCluster​(java.lang.String clusterId)
      Method to get all the commands for a cluster.
      java.util.Set<java.lang.String> getConfigsForCluster​(java.lang.String clusterId)
      Method to get all the configs for a cluster.
      java.util.Set<java.lang.String> getDependenciesForCluster​(java.lang.String clusterId)
      Method to get all the dependency files for an cluster.
      java.util.Set<java.lang.String> getTagsForCluster​(java.lang.String clusterId)
      Method to get all the tags for a cluster.
      void patchCluster​(java.lang.String clusterId, com.github.fge.jsonpatch.JsonPatch patch)
      Method to patch a cluster using json patch instructions.
      void removeAllCommandsForCluster​(java.lang.String clusterId)
      Remove all commands for this cluster.
      void removeAllConfigsForCluster​(java.lang.String clusterId)
      Remove all configs for this cluster.
      void removeAllDependenciesForCluster​(java.lang.String clusterId)
      Remove all dependencies for this cluster.
      void removeAllTagsForCluster​(java.lang.String clusterId)
      Remove all tags for this cluster.
      void removeCommandFromCluster​(java.lang.String clusterId, java.lang.String commandId)
      Remove a command from a cluster.
      void removeTagFromCluster​(java.lang.String clusterId, java.lang.String tag)
      Remove a tag from a cluster.
      void updateCluster​(java.lang.String clusterId, Cluster cluster)
      Method to updated a cluster.
      void updateCommandsForCluster​(java.lang.String clusterId, java.util.List<java.lang.String> commandIds)
      Method to update commands for a cluster.
      void updateConfigsForCluster​(java.lang.String clusterId, java.util.Set<java.lang.String> configs)
      Method to update configs for a cluster.
      void updateDependenciesForCluster​(java.lang.String clusterId, java.util.Set<java.lang.String> dependencies)
      Method to update dependencies for a cluster.
      void updateTagsForCluster​(java.lang.String clusterId, java.util.Set<java.lang.String> tags)
      Method to update tags for a cluster.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClusterClient

        public ClusterClient​(@NotNull
                             @NotNull retrofit2.Retrofit retrofit)
        Constructor.
        Parameters:
        retrofit - The configured Retrofit client to a Genie server
      • ClusterClient

        @Deprecated
        public ClusterClient​(@NotEmpty
                             @NotEmpty java.lang.String url,
                             @Nullable
                             java.util.List<okhttp3.Interceptor> interceptors,
                             @Nullable
                             GenieNetworkConfiguration genieNetworkConfiguration)
                      throws GenieClientException
        Deprecated.
        Constructor.
        Parameters:
        url - The endpoint URL of the Genie API. Not null or empty
        interceptors - Any interceptors to configure the client with, can include security ones
        genieNetworkConfiguration - The network configuration parameters. Could be null
        Throws:
        GenieClientException - On error
    • Method Detail

      • createCluster

        public java.lang.String createCluster​(Cluster cluster)
                                       throws java.io.IOException,
                                              GenieClientException
        Create a cluster ing genie.
        Parameters:
        cluster - A cluster object.
        Returns:
        The id of the cluster created.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • getClusters

        public java.util.List<Cluster> getClusters()
                                            throws java.io.IOException,
                                                   GenieClientException
        Method to get a list of all the clusters.
        Returns:
        A list of clusters.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • getClusters

        public java.util.List<Cluster> getClusters​(java.lang.String name,
                                                   java.util.List<java.lang.String> statusList,
                                                   java.util.List<java.lang.String> tagList,
                                                   java.lang.Long minUpdateTime,
                                                   java.lang.Long maxUpdateTime)
                                            throws java.io.IOException,
                                                   GenieClientException
        Method to get a list of all the clusters from Genie for the query parameters specified.
        Parameters:
        name - The name of the cluster.
        statusList - The list of statuses.
        tagList - The list of tags.
        minUpdateTime - Minimum Time after which cluster was updated.
        maxUpdateTime - Maximum Time before which cluster was updated.
        Returns:
        A list of clusters.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • getClusters

        public java.util.List<Cluster> getClusters​(@Nullable
                                                   java.lang.String name,
                                                   @Nullable
                                                   java.util.List<java.lang.String> statusList,
                                                   @Nullable
                                                   java.util.List<java.lang.String> tagList,
                                                   @Nullable
                                                   java.lang.Long minUpdateTime,
                                                   @Nullable
                                                   java.lang.Long maxUpdateTime,
                                                   @Nullable @Min(1L)
                                                   @Min(1L) java.lang.Integer pageSize,
                                                   @Nullable
                                                   SortAttribute sortAttribute,
                                                   @Nullable
                                                   SortDirection sortDirection,
                                                   @Nullable @Min(0L)
                                                   @Min(0L) java.lang.Integer pageIndex)
                                            throws java.io.IOException,
                                                   GenieClientException
        Method to get a list of all the clusters from Genie for the query parameters specified.
        Parameters:
        name - The name of the cluster.
        statusList - The list of statuses.
        tagList - The list of tags.
        minUpdateTime - Minimum Time after which cluster was updated.
        maxUpdateTime - Maximum Time before which cluster was updated.
        pageSize - The maximum number of results returned
        sortAttribute - The entity attribute used to sort
        sortDirection - The sort direction
        pageIndex - The page index
        Returns:
        A list of clusters.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • getCluster

        public Cluster getCluster​(java.lang.String clusterId)
                           throws java.io.IOException,
                                  GenieClientException
        Method to get a Cluster from Genie.
        Parameters:
        clusterId - The id of the cluster to get.
        Returns:
        The cluster details.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • deleteCluster

        public void deleteCluster​(java.lang.String clusterId)
                           throws java.io.IOException,
                                  GenieClientException
        Method to delete a cluster from Genie.
        Parameters:
        clusterId - The id of the cluster.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • deleteAllClusters

        public void deleteAllClusters()
                               throws java.io.IOException,
                                      GenieClientException
        Method to delete all clusters from Genie.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • patchCluster

        public void patchCluster​(java.lang.String clusterId,
                                 com.github.fge.jsonpatch.JsonPatch patch)
                          throws java.io.IOException,
                                 GenieClientException
        Method to patch a cluster using json patch instructions.
        Parameters:
        clusterId - The id of the cluster.
        patch - The patch object specifying all the instructions.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • updateCluster

        public void updateCluster​(java.lang.String clusterId,
                                  Cluster cluster)
                           throws java.io.IOException,
                                  GenieClientException
        Method to updated a cluster.
        Parameters:
        clusterId - The id of the cluster.
        cluster - The updated cluster object to use.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • getConfigsForCluster

        public java.util.Set<java.lang.String> getConfigsForCluster​(java.lang.String clusterId)
                                                             throws java.io.IOException,
                                                                    GenieClientException
        Method to get all the configs for a cluster.
        Parameters:
        clusterId - The id of the cluster.
        Returns:
        The set of configs for the cluster.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • addConfigsToCluster

        public void addConfigsToCluster​(java.lang.String clusterId,
                                        java.util.Set<java.lang.String> configs)
                                 throws java.io.IOException,
                                        GenieClientException
        Method to add configs to a cluster.
        Parameters:
        clusterId - The id of the cluster.
        configs - The set of configs to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • updateConfigsForCluster

        public void updateConfigsForCluster​(java.lang.String clusterId,
                                            java.util.Set<java.lang.String> configs)
                                     throws java.io.IOException,
                                            GenieClientException
        Method to update configs for a cluster.
        Parameters:
        clusterId - The id of the cluster.
        configs - The set of configs to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • removeAllConfigsForCluster

        public void removeAllConfigsForCluster​(java.lang.String clusterId)
                                        throws java.io.IOException,
                                               GenieClientException
        Remove all configs for this cluster.
        Parameters:
        clusterId - The id of the cluster.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • getDependenciesForCluster

        public java.util.Set<java.lang.String> getDependenciesForCluster​(java.lang.String clusterId)
                                                                  throws java.io.IOException,
                                                                         GenieClientException
        Method to get all the dependency files for an cluster.
        Parameters:
        clusterId - The id of the cluster.
        Returns:
        The set of dependencies for the cluster.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • addDependenciesToCluster

        public void addDependenciesToCluster​(java.lang.String clusterId,
                                             java.util.Set<java.lang.String> dependencies)
                                      throws java.io.IOException,
                                             GenieClientException
        Method to add dependencies to a cluster.
        Parameters:
        clusterId - The id of the cluster.
        dependencies - The set of dependencies to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • updateDependenciesForCluster

        public void updateDependenciesForCluster​(java.lang.String clusterId,
                                                 java.util.Set<java.lang.String> dependencies)
                                          throws java.io.IOException,
                                                 GenieClientException
        Method to update dependencies for a cluster.
        Parameters:
        clusterId - The id of the cluster.
        dependencies - The set of dependencies to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • removeAllDependenciesForCluster

        public void removeAllDependenciesForCluster​(java.lang.String clusterId)
                                             throws java.io.IOException,
                                                    GenieClientException
        Remove all dependencies for this cluster.
        Parameters:
        clusterId - The id of the cluster.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues
      • getCommandsForCluster

        public java.util.List<Command> getCommandsForCluster​(java.lang.String clusterId)
                                                      throws java.io.IOException,
                                                             GenieClientException
        Method to get all the commands for a cluster.
        Parameters:
        clusterId - The id of the cluster.
        Returns:
        The set of commands for the cluster.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • addCommandsToCluster

        public void addCommandsToCluster​(java.lang.String clusterId,
                                         java.util.List<java.lang.String> commandIds)
                                  throws java.io.IOException,
                                         GenieClientException
        Method to add commands to a cluster.
        Parameters:
        clusterId - The id of the cluster.
        commandIds - The list of commands to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • updateCommandsForCluster

        public void updateCommandsForCluster​(java.lang.String clusterId,
                                             java.util.List<java.lang.String> commandIds)
                                      throws java.io.IOException,
                                             GenieClientException
        Method to update commands for a cluster.
        Parameters:
        clusterId - The id of the cluster.
        commandIds - The set of commands to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • removeCommandFromCluster

        public void removeCommandFromCluster​(java.lang.String clusterId,
                                             java.lang.String commandId)
                                      throws java.io.IOException,
                                             GenieClientException
        Remove a command from a cluster.
        Parameters:
        clusterId - The id of the cluster.
        commandId - The id of the command to remove.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • removeAllCommandsForCluster

        public void removeAllCommandsForCluster​(java.lang.String clusterId)
                                         throws java.io.IOException,
                                                GenieClientException
        Remove all commands for this cluster.
        Parameters:
        clusterId - The id of the cluster.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • getTagsForCluster

        public java.util.Set<java.lang.String> getTagsForCluster​(java.lang.String clusterId)
                                                          throws java.io.IOException,
                                                                 GenieClientException
        Method to get all the tags for a cluster.
        Parameters:
        clusterId - The id of the cluster.
        Returns:
        The set of tags for the cluster.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • addTagsToCluster

        public void addTagsToCluster​(java.lang.String clusterId,
                                     java.util.Set<java.lang.String> tags)
                              throws java.io.IOException,
                                     GenieClientException
        Method to add tags to a cluster.
        Parameters:
        clusterId - The id of the cluster.
        tags - The set of tags to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • updateTagsForCluster

        public void updateTagsForCluster​(java.lang.String clusterId,
                                         java.util.Set<java.lang.String> tags)
                                  throws java.io.IOException,
                                         GenieClientException
        Method to update tags for a cluster.
        Parameters:
        clusterId - The id of the cluster.
        tags - The set of tags to add.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • removeTagFromCluster

        public void removeTagFromCluster​(java.lang.String clusterId,
                                         java.lang.String tag)
                                  throws java.io.IOException,
                                         GenieClientException
        Remove a tag from a cluster.
        Parameters:
        clusterId - The id of the cluster.
        tag - The tag to remove.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.
      • removeAllTagsForCluster

        public void removeAllTagsForCluster​(java.lang.String clusterId)
                                     throws java.io.IOException,
                                            GenieClientException
        Remove all tags for this cluster.
        Parameters:
        clusterId - The id of the cluster.
        Throws:
        GenieClientException - If the response received is not 2xx.
        java.io.IOException - For Network and other IO issues.