public class ApplicationClient extends BaseGenieClient
Constructor and Description |
---|
ApplicationClient(java.lang.String url,
java.util.List<okhttp3.Interceptor> interceptors,
GenieNetworkConfiguration genieNetworkConfiguration)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addConfigsToApplication(java.lang.String applicationId,
java.util.Set<java.lang.String> configs)
Method to add configs to a application.
|
void |
addDependenciesToApplication(java.lang.String applicationId,
java.util.Set<java.lang.String> dependencies)
Method to add dependencies to a application.
|
void |
addTagsToApplication(java.lang.String applicationId,
java.util.Set<java.lang.String> tags)
Method to add tags to a application.
|
java.lang.String |
createApplication(Application application)
Create a application ing genie.
|
void |
deleteAllApplications()
Method to delete all applications from Genie.
|
void |
deleteApplication(java.lang.String applicationId)
Method to delete a application from Genie.
|
Application |
getApplication(java.lang.String applicationId)
Method to get a Application from Genie.
|
java.util.List<Application> |
getApplications()
Method to get a list of all the applications.
|
java.util.List<Application> |
getApplications(java.lang.String name,
java.lang.String user,
java.util.List<java.lang.String> statusList,
java.util.List<java.lang.String> tagList,
java.lang.String type)
Method to get a list of all the applications from Genie for the query parameters specified.
|
java.util.List<Command> |
getCommandsForApplication(java.lang.String applicationId)
Method to get all the commands for an application.
|
java.util.Set<java.lang.String> |
getConfigsForApplication(java.lang.String applicationId)
Method to get all the configs for a application.
|
java.util.Set<java.lang.String> |
getDependenciesForApplication(java.lang.String applicationId)
Method to get all the dependency files for an application.
|
java.util.Set<java.lang.String> |
getTagsForApplication(java.lang.String applicationId)
Method to get all the tags for a application.
|
void |
patchApplication(java.lang.String applicationId,
com.github.fge.jsonpatch.JsonPatch patch)
Method to patch a application using json patch instructions.
|
void |
removeAllConfigsForApplication(java.lang.String applicationId)
Remove all configs for this application.
|
void |
removeAllDependenciesForApplication(java.lang.String applicationId)
Remove all dependencies for this application.
|
void |
removeAllTagsForApplication(java.lang.String applicationId)
Remove all tags for this application.
|
void |
removeTagFromApplication(java.lang.String applicationId,
java.lang.String tag)
Remove a tag from a application.
|
void |
updateApplication(java.lang.String applicationId,
Application application)
Method to updated a application.
|
void |
updateConfigsForApplication(java.lang.String applicationId,
java.util.Set<java.lang.String> configs)
Method to update configs for a application.
|
void |
updateDependenciesForApplication(java.lang.String applicationId,
java.util.Set<java.lang.String> dependencies)
Method to update dependencies for a application.
|
void |
updateTagsForApplication(java.lang.String applicationId,
java.util.Set<java.lang.String> tags)
Method to update tags for a application.
|
getIdFromLocation, getService, treeToValue
public ApplicationClient(@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 createApplication(Application application) throws java.io.IOException, GenieClientException
application
- A application object.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic java.util.List<Application> getApplications() throws java.io.IOException, GenieClientException
GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic java.util.List<Application> getApplications(java.lang.String name, java.lang.String user, java.util.List<java.lang.String> statusList, java.util.List<java.lang.String> tagList, java.lang.String type) throws java.io.IOException
name
- The name of the commands.user
- The user who created the command.statusList
- The list of Command statuses.tagList
- The list of tags.type
- The type of the application.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic Application getApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
applicationId
- The id of the application to get.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void deleteApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void deleteAllApplications() throws java.io.IOException, GenieClientException
GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void patchApplication(java.lang.String applicationId, com.github.fge.jsonpatch.JsonPatch patch) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.patch
- The patch object specifying all the instructions.GenieClientException
- For any other error.java.io.IOException
- If the response received is not 2xx.public void updateApplication(java.lang.String applicationId, Application application) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.application
- The updated application object to use.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic java.util.List<Command> getCommandsForApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic java.util.Set<java.lang.String> getConfigsForApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void addConfigsToApplication(java.lang.String applicationId, java.util.Set<java.lang.String> configs) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.configs
- The set of configs to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void updateConfigsForApplication(java.lang.String applicationId, java.util.Set<java.lang.String> configs) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.configs
- The set of configs to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void removeAllConfigsForApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic java.util.Set<java.lang.String> getDependenciesForApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void addDependenciesToApplication(java.lang.String applicationId, java.util.Set<java.lang.String> dependencies) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.dependencies
- The set of dependencies to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void updateDependenciesForApplication(java.lang.String applicationId, java.util.Set<java.lang.String> dependencies) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.dependencies
- The set of dependencies to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void removeAllDependenciesForApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic java.util.Set<java.lang.String> getTagsForApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void addTagsToApplication(java.lang.String applicationId, java.util.Set<java.lang.String> tags) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.tags
- The set of tags to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void updateTagsForApplication(java.lang.String applicationId, java.util.Set<java.lang.String> tags) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.tags
- The set of tags to add.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void removeTagFromApplication(java.lang.String applicationId, java.lang.String tag) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.tag
- The tag to remove.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issuespublic void removeAllTagsForApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
applicationId
- The id of the application.GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues