Package com.netflix.genie.client
Class ClusterClient
- java.lang.Object
-
- com.netflix.genie.client.ClusterClient
-
public class ClusterClient extends java.lang.ObjectClient library for the Cluster Service.- Since:
- 3.0.0
-
-
Constructor Summary
Constructors Constructor Description ClusterClient(@NotEmpty java.lang.String url, java.util.List<okhttp3.Interceptor> interceptors, GenieNetworkConfiguration genieNetworkConfiguration)Deprecated.ClusterClient(@NotNull retrofit2.Retrofit retrofit)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCommandsToCluster(java.lang.String clusterId, java.util.List<java.lang.String> commandIds)Method to add commands to a cluster.voidaddConfigsToCluster(java.lang.String clusterId, java.util.Set<java.lang.String> configs)Method to add configs to a cluster.voidaddDependenciesToCluster(java.lang.String clusterId, java.util.Set<java.lang.String> dependencies)Method to add dependencies to a cluster.voidaddTagsToCluster(java.lang.String clusterId, java.util.Set<java.lang.String> tags)Method to add tags to a cluster.java.lang.StringcreateCluster(Cluster cluster)Create a cluster ing genie.voiddeleteAllClusters()Method to delete all clusters from Genie.voiddeleteCluster(java.lang.String clusterId)Method to delete a cluster from Genie.ClustergetCluster(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.voidpatchCluster(java.lang.String clusterId, com.github.fge.jsonpatch.JsonPatch patch)Method to patch a cluster using json patch instructions.voidremoveAllCommandsForCluster(java.lang.String clusterId)Remove all commands for this cluster.voidremoveAllConfigsForCluster(java.lang.String clusterId)Remove all configs for this cluster.voidremoveAllDependenciesForCluster(java.lang.String clusterId)Remove all dependencies for this cluster.voidremoveAllTagsForCluster(java.lang.String clusterId)Remove all tags for this cluster.voidremoveCommandFromCluster(java.lang.String clusterId, java.lang.String commandId)Remove a command from a cluster.voidremoveTagFromCluster(java.lang.String clusterId, java.lang.String tag)Remove a tag from a cluster.voidupdateCluster(java.lang.String clusterId, Cluster cluster)Method to updated a cluster.voidupdateCommandsForCluster(java.lang.String clusterId, java.util.List<java.lang.String> commandIds)Method to update commands for a cluster.voidupdateConfigsForCluster(java.lang.String clusterId, java.util.Set<java.lang.String> configs)Method to update configs for a cluster.voidupdateDependenciesForCluster(java.lang.String clusterId, java.util.Set<java.lang.String> dependencies)Method to update dependencies for a cluster.voidupdateTagsForCluster(java.lang.String clusterId, java.util.Set<java.lang.String> tags)Method to update tags for a cluster.
-
-
-
Constructor Detail
-
ClusterClient
public ClusterClient(@NotNull @NotNull retrofit2.Retrofit retrofit)Constructor.- Parameters:
retrofit- The configuredRetrofitclient 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 GenieClientExceptionDeprecated.Constructor.- Parameters:
url- The endpoint URL of the Genie API. Not null or emptyinterceptors- Any interceptors to configure the client with, can include security onesgenieNetworkConfiguration- 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
Deprecated.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 returnedsortAttribute- The entity attribute used to sortsortDirection- The sort directionpageIndex- 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, GenieClientExceptionMethod 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, GenieClientExceptionMethod 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, GenieClientExceptionMethod 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, GenieClientExceptionMethod 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, GenieClientExceptionMethod 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, GenieClientExceptionMethod 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, GenieClientExceptionMethod 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, GenieClientExceptionRemove 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, GenieClientExceptionMethod 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, GenieClientExceptionMethod 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, GenieClientExceptionMethod 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, GenieClientExceptionRemove 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, GenieClientExceptionMethod 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, GenieClientExceptionMethod 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, GenieClientExceptionRemove 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, GenieClientExceptionRemove 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, GenieClientExceptionMethod 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, GenieClientExceptionMethod 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, GenieClientExceptionMethod 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, GenieClientExceptionRemove 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, GenieClientExceptionRemove 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.
-
-