Package com.netflix.genie.client
Class ClusterClient
java.lang.Object
com.netflix.genie.client.ClusterClient
Client library for the Cluster Service.
- Since:
- 3.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionClusterClient
(@NotEmpty String url, List<okhttp3.Interceptor> interceptors, GenieNetworkConfiguration genieNetworkConfiguration) Deprecated.ClusterClient
(@NotNull retrofit2.Retrofit retrofit) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addCommandsToCluster
(String clusterId, List<String> commandIds) Method to add commands to a cluster.void
addConfigsToCluster
(String clusterId, Set<String> configs) Method to add configs to a cluster.void
addDependenciesToCluster
(String clusterId, Set<String> dependencies) Method to add dependencies to a cluster.void
addTagsToCluster
(String clusterId, Set<String> tags) Method to add tags to a cluster.createCluster
(Cluster cluster) Create a cluster ing genie.void
Method to delete all clusters from Genie.void
deleteCluster
(String clusterId) Method to delete a cluster from Genie.getCluster
(String clusterId) Method to get a Cluster from Genie.Method to get a list of all the clusters.getClusters
(String name, List<String> statusList, List<String> tagList, Long minUpdateTime, Long maxUpdateTime) getClusters
(String name, List<String> statusList, List<String> tagList, Long minUpdateTime, Long maxUpdateTime, @Min(1L) Integer pageSize, SortAttribute sortAttribute, SortDirection sortDirection, @Min(0L) Integer pageIndex) Method to get a list of all the clusters from Genie for the query parameters specified.getCommandsForCluster
(String clusterId) Method to get all the commands for a cluster.getConfigsForCluster
(String clusterId) Method to get all the configs for a cluster.getDependenciesForCluster
(String clusterId) Method to get all the dependency files for an cluster.getTagsForCluster
(String clusterId) Method to get all the tags for a cluster.void
patchCluster
(String clusterId, com.github.fge.jsonpatch.JsonPatch patch) Method to patch a cluster using json patch instructions.void
removeAllCommandsForCluster
(String clusterId) Remove all commands for this cluster.void
removeAllConfigsForCluster
(String clusterId) Remove all configs for this cluster.void
removeAllDependenciesForCluster
(String clusterId) Remove all dependencies for this cluster.void
removeAllTagsForCluster
(String clusterId) Remove all tags for this cluster.void
removeCommandFromCluster
(String clusterId, String commandId) Remove a command from a cluster.void
removeTagFromCluster
(String clusterId, String tag) Remove a tag from a cluster.void
updateCluster
(String clusterId, Cluster cluster) Method to updated a cluster.void
updateCommandsForCluster
(String clusterId, List<String> commandIds) Method to update commands for a cluster.void
updateConfigsForCluster
(String clusterId, Set<String> configs) Method to update configs for a cluster.void
updateDependenciesForCluster
(String clusterId, Set<String> dependencies) Method to update dependencies for a cluster.void
updateTagsForCluster
(String clusterId, Set<String> tags) Method to update tags for a cluster.
-
Constructor Details
-
ClusterClient
public ClusterClient(@NotNull @NotNull retrofit2.Retrofit retrofit) Constructor.- Parameters:
retrofit
- The configuredRetrofit
client to a Genie server
-
ClusterClient
@Deprecated public ClusterClient(@NotEmpty @NotEmpty String url, @Nullable List<okhttp3.Interceptor> interceptors, @Nullable GenieNetworkConfiguration genieNetworkConfiguration) throws GenieClientException Deprecated.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 Details
-
createCluster
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.IOException
- For Network and other IO issues.
-
getClusters
Method to get a list of all the clusters.- Returns:
- A list of clusters.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
getClusters
public List<Cluster> getClusters(String name, List<String> statusList, List<String> tagList, Long minUpdateTime, Long maxUpdateTime) throws 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.IOException
- For Network and other IO issues.
-
getClusters
public List<Cluster> getClusters(@Nullable String name, @Nullable List<String> statusList, @Nullable List<String> tagList, @Nullable Long minUpdateTime, @Nullable Long maxUpdateTime, @Nullable @Min(1L) @Min(1L) Integer pageSize, @Nullable SortAttribute sortAttribute, @Nullable SortDirection sortDirection, @Nullable @Min(0L) @Min(0L) Integer pageIndex) throws 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.IOException
- For Network and other IO issues.
-
getCluster
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.IOException
- For Network and other IO issues.
-
deleteCluster
Method to delete a cluster from Genie.- Parameters:
clusterId
- The id of the cluster.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
deleteAllClusters
Method to delete all clusters from Genie.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
patchCluster
public void patchCluster(String clusterId, com.github.fge.jsonpatch.JsonPatch patch) throws 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.IOException
- For Network and other IO issues.
-
updateCluster
public void updateCluster(String clusterId, Cluster cluster) throws 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.IOException
- For Network and other IO issues.
-
getConfigsForCluster
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.IOException
- For Network and other IO issues.
-
addConfigsToCluster
public void addConfigsToCluster(String clusterId, Set<String> configs) throws 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.IOException
- For Network and other IO issues.
-
updateConfigsForCluster
public void updateConfigsForCluster(String clusterId, Set<String> configs) throws 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.IOException
- For Network and other IO issues.
-
removeAllConfigsForCluster
Remove all configs for this cluster.- Parameters:
clusterId
- The id of the cluster.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
getDependenciesForCluster
public Set<String> getDependenciesForCluster(String clusterId) throws 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.IOException
- For Network and other IO issues
-
addDependenciesToCluster
public void addDependenciesToCluster(String clusterId, Set<String> dependencies) throws 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.IOException
- For Network and other IO issues
-
updateDependenciesForCluster
public void updateDependenciesForCluster(String clusterId, Set<String> dependencies) throws 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.IOException
- For Network and other IO issues
-
removeAllDependenciesForCluster
public void removeAllDependenciesForCluster(String clusterId) throws IOException, GenieClientException Remove all dependencies for this cluster.- Parameters:
clusterId
- The id of the cluster.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
getCommandsForCluster
public List<Command> getCommandsForCluster(String clusterId) throws 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.IOException
- For Network and other IO issues.
-
addCommandsToCluster
public void addCommandsToCluster(String clusterId, List<String> commandIds) throws 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.IOException
- For Network and other IO issues.
-
updateCommandsForCluster
public void updateCommandsForCluster(String clusterId, List<String> commandIds) throws 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.IOException
- For Network and other IO issues.
-
removeCommandFromCluster
public void removeCommandFromCluster(String clusterId, String commandId) throws 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.IOException
- For Network and other IO issues.
-
removeAllCommandsForCluster
Remove all commands for this cluster.- Parameters:
clusterId
- The id of the cluster.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
getTagsForCluster
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.IOException
- For Network and other IO issues.
-
addTagsToCluster
public void addTagsToCluster(String clusterId, Set<String> tags) throws 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.IOException
- For Network and other IO issues.
-
updateTagsForCluster
public void updateTagsForCluster(String clusterId, Set<String> tags) throws 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.IOException
- For Network and other IO issues.
-
removeTagFromCluster
public void removeTagFromCluster(String clusterId, String tag) throws 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.IOException
- For Network and other IO issues.
-
removeAllTagsForCluster
Remove all tags for this cluster.- Parameters:
clusterId
- The id of the cluster.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
ClusterClient(Retrofit)