public class CommandClient extends BaseGenieClient
Constructor and Description |
---|
CommandClient(java.lang.String url,
java.util.List<okhttp3.Interceptor> interceptors,
GenieNetworkConfiguration genieNetworkConfiguration)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addApplicationsToCommand(java.lang.String commandId,
java.util.List<java.lang.String> applicationIds)
Method to add applications to a command.
|
void |
addConfigsToCommand(java.lang.String commandId,
java.util.Set<java.lang.String> configs)
Method to add configs to a command.
|
void |
addTagsToCommand(java.lang.String commandId,
java.util.Set<java.lang.String> tags)
Method to add tags to a command.
|
java.lang.String |
createCommand(Command command)
Create a command ing genie.
|
void |
deleteAllCommands()
Method to delete all commands from Genie.
|
void |
deleteCommand(java.lang.String commandId)
Method to delete a command from Genie.
|
java.util.List<Application> |
getApplicationsForCommand(java.lang.String commandId)
Method to get all the applications for a command.
|
java.util.List<Cluster> |
getClustersForCommand(java.lang.String commandId)
Method to get all the clusters for a command.
|
Command |
getCommand(java.lang.String commandId)
Method to get a Command from Genie.
|
java.util.List<Command> |
getCommands()
Method to get a list of all the commands.
|
java.util.List<Command> |
getCommands(java.lang.String name,
java.lang.String user,
java.util.List<java.lang.String> statusList,
java.util.List<java.lang.String> tagList)
Method to get a list of all the commands from Genie for the query parameters specified.
|
java.util.Set<java.lang.String> |
getConfigsForCommand(java.lang.String commandId)
Method to get all the configs for a command.
|
java.util.Set<java.lang.String> |
getTagsForCommand(java.lang.String commandId)
Method to get all the tags for a command.
|
void |
patchCommand(java.lang.String commandId,
com.github.fge.jsonpatch.JsonPatch patch)
Method to patch a command using json patch instructions.
|
void |
removeAllApplicationsForCommand(java.lang.String commandId)
Remove all applications for this command.
|
void |
removeAllConfigsForCommand(java.lang.String commandId)
Remove all configs for this command.
|
void |
removeAllTagsForCommand(java.lang.String commandId)
Remove all tags for this command.
|
void |
removeApplicationFromCommand(java.lang.String commandId,
java.lang.String applicationId)
Remove an application from a command.
|
void |
removeTagFromCommand(java.lang.String commandId,
java.lang.String tag)
Remove a tag from a command.
|
void |
updateApplicationsForCommand(java.lang.String commandId,
java.util.List<java.lang.String> applicationIds)
Method to update applications for a command.
|
void |
updateCommand(java.lang.String commandId,
Command command)
Method to updated a command.
|
void |
updateConfigsForCommand(java.lang.String commandId,
java.util.Set<java.lang.String> configs)
Method to update configs for a command.
|
void |
updateTagsForCommand(java.lang.String commandId,
java.util.Set<java.lang.String> tags)
Method to update tags for a command.
|
getIdFromLocation, getService, treeToValue
public CommandClient(@NotEmpty java.lang.String url, @Nullable java.util.List<okhttp3.Interceptor> interceptors, @Nullable GenieNetworkConfiguration genieNetworkConfiguration) throws GenieClientException
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 nullGenieClientException
- On errorpublic java.lang.String createCommand(Command command) throws java.io.IOException, GenieClientException
command
- A command object.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public java.util.List<Command> getCommands() throws java.io.IOException, GenieClientException
GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public java.util.List<Command> getCommands(java.lang.String name, java.lang.String user, java.util.List<java.lang.String> statusList, java.util.List<java.lang.String> tagList) throws java.io.IOException, GenieClientException
name
- The name of the commands.user
- The user who created the command.statusList
- The list of Command statuses.tagList
- The list of tags.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public Command getCommand(java.lang.String commandId) throws java.io.IOException, GenieClientException
commandId
- The id of the command to get.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void deleteCommand(java.lang.String commandId) throws java.io.IOException, GenieClientException
commandId
- The id of the command.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void deleteAllCommands() throws java.io.IOException, GenieClientException
GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void patchCommand(java.lang.String commandId, com.github.fge.jsonpatch.JsonPatch patch) throws java.io.IOException, GenieClientException
commandId
- The id of the command.patch
- The patch object specifying all the instructions.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void updateCommand(java.lang.String commandId, Command command) throws java.io.IOException, GenieClientException
commandId
- The id of the command.command
- The updated command object to use.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public java.util.Set<java.lang.String> getConfigsForCommand(java.lang.String commandId) throws java.io.IOException, GenieClientException
commandId
- The id of the command.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void addConfigsToCommand(java.lang.String commandId, java.util.Set<java.lang.String> configs) throws java.io.IOException, GenieClientException
commandId
- The id of the command.configs
- The set of configs to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void updateConfigsForCommand(java.lang.String commandId, java.util.Set<java.lang.String> configs) throws java.io.IOException, GenieClientException
commandId
- The id of the command.configs
- The set of configs to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void removeAllConfigsForCommand(java.lang.String commandId) throws java.io.IOException, GenieClientException
commandId
- The id of the command.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public java.util.List<Application> getApplicationsForCommand(java.lang.String commandId) throws java.io.IOException, GenieClientException
commandId
- The id of the command.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public java.util.List<Cluster> getClustersForCommand(java.lang.String commandId) throws java.io.IOException, GenieClientException
commandId
- The id of the command.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void addApplicationsToCommand(java.lang.String commandId, java.util.List<java.lang.String> applicationIds) throws java.io.IOException, GenieClientException
commandId
- The id of the command.applicationIds
- The set of applications ids to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void updateApplicationsForCommand(java.lang.String commandId, java.util.List<java.lang.String> applicationIds) throws java.io.IOException, GenieClientException
commandId
- The id of the command.applicationIds
- The set of application ids to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void removeApplicationFromCommand(java.lang.String commandId, java.lang.String applicationId) throws java.io.IOException, GenieClientException
commandId
- The id of the command.applicationId
- The id of the application to remove.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void removeAllApplicationsForCommand(java.lang.String commandId) throws java.io.IOException, GenieClientException
commandId
- The id of the command.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public java.util.Set<java.lang.String> getTagsForCommand(java.lang.String commandId) throws java.io.IOException, GenieClientException
commandId
- The id of the command.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void addTagsToCommand(java.lang.String commandId, java.util.Set<java.lang.String> tags) throws java.io.IOException, GenieClientException
commandId
- The id of the command.tags
- The set of tags to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void updateTagsForCommand(java.lang.String commandId, java.util.Set<java.lang.String> tags) throws java.io.IOException, GenieClientException
commandId
- The id of the command.tags
- The set of tags to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void removeTagFromCommand(java.lang.String commandId, java.lang.String tag) throws java.io.IOException, GenieClientException
commandId
- The id of the command.tag
- The tag to remove.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.public void removeAllTagsForCommand(java.lang.String commandId) throws java.io.IOException, GenieClientException
commandId
- The id of the command.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues.