Package com.netflix.genie.client
Class CommandClient
java.lang.Object
com.netflix.genie.client.CommandClient
Client library for the Command Service.
- Since:
- 3.0.0
-
Constructor Summary
ConstructorDescriptionCommandClient
(@NotEmpty String url, List<okhttp3.Interceptor> interceptors, GenieNetworkConfiguration genieNetworkConfiguration) Deprecated.CommandClient
(@NotNull retrofit2.Retrofit retrofit) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addApplicationsToCommand
(String commandId, List<String> applicationIds) Method to add applications to a command.void
addConfigsToCommand
(String commandId, Set<String> configs) Method to add configs to a command.void
addDependenciesToCommand
(String commandId, Set<String> dependencies) Method to add dependencies to a command.void
addTagsToCommand
(String commandId, Set<String> tags) Method to add tags to a command.createCommand
(Command command) Create a command ing genie.void
Method to delete all commands from Genie.void
deleteCommand
(String commandId) Method to delete a command from Genie.getApplicationsForCommand
(String commandId) Method to get all the applications for a command.getClustersForCommand
(String commandId) Method to get all the clusters for a command.getCommand
(String commandId) Method to get a Command from Genie.Method to get a list of all the commands.getCommands
(String name, String user, List<String> statusList, List<String> tagList, @Min(1L) Integer pageSize, SortAttribute sortAttribute, SortDirection sortDirection, @Min(0L) Integer pageIndex) Method to get a list of all the commands from Genie for the query parameters specified.getConfigsForCommand
(String commandId) Method to get all the configs for a command.getDependenciesForCommand
(String commandId) Method to get all the dependency files for an command.getTagsForCommand
(String commandId) Method to get all the tags for a command.void
patchCommand
(String commandId, com.github.fge.jsonpatch.JsonPatch patch) Method to patch a command using json patch instructions.void
removeAllApplicationsForCommand
(String commandId) Remove all applications for this command.void
removeAllConfigsForCommand
(String commandId) Remove all configs for this command.void
removeAllDependenciesForCommand
(String commandId) Remove all dependencies for this command.void
removeAllTagsForCommand
(String commandId) Remove all tags for this command.void
removeApplicationFromCommand
(String commandId, String applicationId) Remove an application from a command.void
removeTagFromCommand
(String commandId, String tag) Remove a tag from a command.void
updateApplicationsForCommand
(String commandId, List<String> applicationIds) Method to update applications for a command.void
updateCommand
(String commandId, Command command) Method to updated a command.void
updateConfigsForCommand
(String commandId, Set<String> configs) Method to update configs for a command.void
updateDependenciesForCommand
(String commandId, Set<String> dependencies) Method to update dependencies for a command.void
updateTagsForCommand
(String commandId, Set<String> tags) Method to update tags for a command.
-
Constructor Details
-
CommandClient
public CommandClient(@NotNull @NotNull retrofit2.Retrofit retrofit) Constructor.- Parameters:
retrofit
- The configuredRetrofit
client to a Genie server
-
CommandClient
@Deprecated public CommandClient(@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
-
createCommand
Create a command ing genie.- Parameters:
command
- A command object.- Returns:
- id Id of the command created.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
getCommands
Method to get a list of all the commands.- Returns:
- A list of commands.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
getCommands
@Deprecated public List<Command> getCommands(String name, String user, List<String> statusList, List<String> tagList) throws IOException, GenieClientException Deprecated.Method to get a list of all the commands from Genie for the query parameters specified.- Parameters:
name
- The name of the commands.user
- The user who created the command.statusList
- The list of Command statuses.tagList
- The list of tags.- Returns:
- A list of commands.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
getCommands
public List<Command> getCommands(@Nullable String name, @Nullable String user, @Nullable List<String> statusList, @Nullable List<String> tagList, @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 commands from Genie for the query parameters specified.- Parameters:
name
- The name of the commands.user
- The user who created the command.statusList
- The list of Command statuses.tagList
- The list of tags.pageSize
- The maximum number of results returnedsortAttribute
- The entity attribute used to sortsortDirection
- The sort directionpageIndex
- The page index- Returns:
- A list of commands.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
getCommand
Method to get a Command from Genie.- Parameters:
commandId
- The id of the command to get.- Returns:
- The command details.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
deleteCommand
Method to delete a command from Genie.- Parameters:
commandId
- The id of the command.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
deleteAllCommands
Method to delete all commands from Genie.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
patchCommand
public void patchCommand(String commandId, com.github.fge.jsonpatch.JsonPatch patch) throws IOException, GenieClientException Method to patch a command using json patch instructions.- Parameters:
commandId
- The id of the command.patch
- The patch object specifying all the instructions.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
updateCommand
public void updateCommand(String commandId, Command command) throws IOException, GenieClientException Method to updated a command.- Parameters:
commandId
- The id of the command.command
- The updated command object to use.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
getConfigsForCommand
Method to get all the configs for a command.- Parameters:
commandId
- The id of the command.- Returns:
- The set of configs for the command.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
addConfigsToCommand
public void addConfigsToCommand(String commandId, Set<String> configs) throws IOException, GenieClientException Method to add configs to a command.- Parameters:
commandId
- The id of the command.configs
- The set of configs to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
updateConfigsForCommand
public void updateConfigsForCommand(String commandId, Set<String> configs) throws IOException, GenieClientException Method to update configs for a command.- Parameters:
commandId
- The id of the command.configs
- The set of configs to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
removeAllConfigsForCommand
Remove all configs for this command.- Parameters:
commandId
- The id of the command.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
getDependenciesForCommand
public Set<String> getDependenciesForCommand(String commandId) throws IOException, GenieClientException Method to get all the dependency files for an command.- Parameters:
commandId
- The id of the command.- Returns:
- The set of dependencies for the command.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
addDependenciesToCommand
public void addDependenciesToCommand(String commandId, Set<String> dependencies) throws IOException, GenieClientException Method to add dependencies to a command.- Parameters:
commandId
- The id of the command.dependencies
- The set of dependencies to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
updateDependenciesForCommand
public void updateDependenciesForCommand(String commandId, Set<String> dependencies) throws IOException, GenieClientException Method to update dependencies for a command.- Parameters:
commandId
- The id of the command.dependencies
- The set of dependencies to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
removeAllDependenciesForCommand
public void removeAllDependenciesForCommand(String commandId) throws IOException, GenieClientException Remove all dependencies for this command.- Parameters:
commandId
- The id of the command.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
getApplicationsForCommand
public List<Application> getApplicationsForCommand(String commandId) throws IOException, GenieClientException Method to get all the applications for a command.- Parameters:
commandId
- The id of the command.- Returns:
- The set of applications for the command.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
getClustersForCommand
public List<Cluster> getClustersForCommand(String commandId) throws IOException, GenieClientException Method to get all the clusters for a command.- Parameters:
commandId
- The id of the command.- Returns:
- The set of clusters for the command.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
addApplicationsToCommand
public void addApplicationsToCommand(String commandId, List<String> applicationIds) throws IOException, GenieClientException Method to add applications to a command.- Parameters:
commandId
- The id of the command.applicationIds
- The set of applications ids to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
updateApplicationsForCommand
public void updateApplicationsForCommand(String commandId, List<String> applicationIds) throws IOException, GenieClientException Method to update applications for a command.- Parameters:
commandId
- The id of the command.applicationIds
- The set of application ids to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
removeApplicationFromCommand
public void removeApplicationFromCommand(String commandId, String applicationId) throws IOException, GenieClientException Remove an application from a command.- Parameters:
commandId
- The id of the command.applicationId
- The id of the application to remove.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
removeAllApplicationsForCommand
public void removeAllApplicationsForCommand(String commandId) throws IOException, GenieClientException Remove all applications for this command.- Parameters:
commandId
- The id of the command.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
getTagsForCommand
Method to get all the tags for a command.- Parameters:
commandId
- The id of the command.- Returns:
- The set of configs for the command.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
addTagsToCommand
public void addTagsToCommand(String commandId, Set<String> tags) throws IOException, GenieClientException Method to add tags to a command.- Parameters:
commandId
- The id of the command.tags
- The set of tags to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
updateTagsForCommand
public void updateTagsForCommand(String commandId, Set<String> tags) throws IOException, GenieClientException Method to update tags for a command.- Parameters:
commandId
- The id of the command.tags
- The set of tags to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
removeTagFromCommand
public void removeTagFromCommand(String commandId, String tag) throws IOException, GenieClientException Remove a tag from a command.- Parameters:
commandId
- The id of the command.tag
- The tag to remove.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
removeAllTagsForCommand
Remove all tags for this command.- Parameters:
commandId
- The id of the command.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues.
-
CommandClient(Retrofit)