Package com.netflix.genie.client
Class ApplicationClient
java.lang.Object
com.netflix.genie.client.ApplicationClient
Client library for the Application Service.
- Since:
- 3.0.0
-
Constructor Summary
ConstructorDescriptionApplicationClient
(@NotEmpty String url, List<okhttp3.Interceptor> interceptors, GenieNetworkConfiguration genieNetworkConfiguration) Deprecated.ApplicationClient
(@NotNull retrofit2.Retrofit retrofit) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addConfigsToApplication
(String applicationId, Set<String> configs) Method to add configs to a application.void
addDependenciesToApplication
(String applicationId, Set<String> dependencies) Method to add dependencies to a application.void
addTagsToApplication
(String applicationId, Set<String> tags) Method to add tags to a application.createApplication
(Application application) Create an application in genie.void
Method to delete all applications from Genie.void
deleteApplication
(String applicationId) Method to delete a application from Genie.getApplication
(String applicationId) Method to get a Application from Genie.Method to get a list of all the applications.getApplications
(String name, String user, List<String> statusList, List<String> tagList, String type) getApplications
(String name, String user, List<String> statusList, List<String> tagList, String type, @Min(1L) Integer pageSize, SortAttribute sortAttribute, SortDirection sortDirection, @Min(0L) Integer pageIndex) Method to get a list of all the applications from Genie for the query parameters specified.getCommandsForApplication
(String applicationId) Method to get all the commands for an application.getConfigsForApplication
(String applicationId) Method to get all the configs for a application.getDependenciesForApplication
(String applicationId) Method to get all the dependency files for an application.getTagsForApplication
(String applicationId) Method to get all the tags for a application.void
patchApplication
(String applicationId, com.github.fge.jsonpatch.JsonPatch patch) Method to patch a application using json patch instructions.void
removeAllConfigsForApplication
(String applicationId) Remove all configs for this application.void
removeAllDependenciesForApplication
(String applicationId) Remove all dependencies for this application.void
removeAllTagsForApplication
(String applicationId) Remove all tags for this application.void
removeTagFromApplication
(String applicationId, String tag) Remove a tag from a application.void
updateApplication
(String applicationId, Application application) Method to updated a application.void
updateConfigsForApplication
(String applicationId, Set<String> configs) Method to update configs for a application.void
updateDependenciesForApplication
(String applicationId, Set<String> dependencies) Method to update dependencies for a application.void
updateTagsForApplication
(String applicationId, Set<String> tags) Method to update tags for a application.
-
Constructor Details
-
ApplicationClient
public ApplicationClient(@NotNull @NotNull retrofit2.Retrofit retrofit) Constructor.- Parameters:
retrofit
- The configuredRetrofit
client to a Genie server
-
ApplicationClient
@Deprecated public ApplicationClient(@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
-
createApplication
Create an application in genie.- Parameters:
application
- A application object.- Returns:
- The id of the application created.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
getApplications
Method to get a list of all the applications.- Returns:
- A list of applications.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
getApplications
public List<Application> getApplications(String name, String user, List<String> statusList, List<String> tagList, String type) throws IOException Deprecated.Method to get a list of all the applications 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.type
- The type of the application.- Returns:
- A list of applications.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
getApplications
public List<Application> getApplications(@Nullable String name, @Nullable String user, @Nullable List<String> statusList, @Nullable List<String> tagList, @Nullable String type, @Nullable @Min(1L) @Min(1L) Integer pageSize, @Nullable SortAttribute sortAttribute, @Nullable SortDirection sortDirection, @Nullable @Min(0L) @Min(0L) Integer pageIndex) throws IOException Method to get a list of all the applications 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.type
- The type of the application.pageSize
- The maximum number of results returnedsortAttribute
- The entity attribute used to sortsortDirection
- The sort directionpageIndex
- The page index- Returns:
- A list of applications.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
getApplication
Method to get a Application from Genie.- Parameters:
applicationId
- The id of the application to get.- Returns:
- The application details.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
deleteApplication
Method to delete a application from Genie.- Parameters:
applicationId
- The id of the application.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
deleteAllApplications
Method to delete all applications from Genie.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
patchApplication
public void patchApplication(String applicationId, com.github.fge.jsonpatch.JsonPatch patch) throws IOException, GenieClientException Method to patch a application using json patch instructions.- Parameters:
applicationId
- The id of the application.patch
- The patch object specifying all the instructions.- Throws:
GenieClientException
- For any other error.IOException
- If the response received is not 2xx.
-
updateApplication
public void updateApplication(String applicationId, Application application) throws IOException, GenieClientException Method to updated a application.- Parameters:
applicationId
- The id of the application.application
- The updated application object to use.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
getCommandsForApplication
public List<Command> getCommandsForApplication(String applicationId) throws IOException, GenieClientException Method to get all the commands for an application.- Parameters:
applicationId
- The id of the application.- Returns:
- The set of commands for the applications.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
getConfigsForApplication
public Set<String> getConfigsForApplication(String applicationId) throws IOException, GenieClientException Method to get all the configs for a application.- Parameters:
applicationId
- The id of the application.- Returns:
- The set of configs for the application.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
addConfigsToApplication
public void addConfigsToApplication(String applicationId, Set<String> configs) throws IOException, GenieClientException Method to add configs to a application.- Parameters:
applicationId
- The id of the application.configs
- The set of configs to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
updateConfigsForApplication
public void updateConfigsForApplication(String applicationId, Set<String> configs) throws IOException, GenieClientException Method to update configs for a application.- Parameters:
applicationId
- The id of the application.configs
- The set of configs to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
removeAllConfigsForApplication
public void removeAllConfigsForApplication(String applicationId) throws IOException, GenieClientException Remove all configs for this application.- Parameters:
applicationId
- The id of the application.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
getDependenciesForApplication
public Set<String> getDependenciesForApplication(String applicationId) throws IOException, GenieClientException Method to get all the dependency files for an application.- Parameters:
applicationId
- The id of the application.- Returns:
- The set of dependencies for the application.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
addDependenciesToApplication
public void addDependenciesToApplication(String applicationId, Set<String> dependencies) throws IOException, GenieClientException Method to add dependencies to a application.- Parameters:
applicationId
- The id of the application.dependencies
- The set of dependencies to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
updateDependenciesForApplication
public void updateDependenciesForApplication(String applicationId, Set<String> dependencies) throws IOException, GenieClientException Method to update dependencies for a application.- Parameters:
applicationId
- The id of the application.dependencies
- The set of dependencies to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
removeAllDependenciesForApplication
public void removeAllDependenciesForApplication(String applicationId) throws IOException, GenieClientException Remove all dependencies for this application.- Parameters:
applicationId
- The id of the application.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
getTagsForApplication
public Set<String> getTagsForApplication(String applicationId) throws IOException, GenieClientException Method to get all the tags for a application.- Parameters:
applicationId
- The id of the application.- Returns:
- The set of configs for the application.
- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
addTagsToApplication
public void addTagsToApplication(String applicationId, Set<String> tags) throws IOException, GenieClientException Method to add tags to a application.- Parameters:
applicationId
- The id of the application.tags
- The set of tags to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
updateTagsForApplication
public void updateTagsForApplication(String applicationId, Set<String> tags) throws IOException, GenieClientException Method to update tags for a application.- Parameters:
applicationId
- The id of the application.tags
- The set of tags to add.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
removeTagFromApplication
public void removeTagFromApplication(String applicationId, String tag) throws IOException, GenieClientException Remove a tag from a application.- Parameters:
applicationId
- The id of the application.tag
- The tag to remove.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
removeAllTagsForApplication
public void removeAllTagsForApplication(String applicationId) throws IOException, GenieClientException Remove all tags for this application.- Parameters:
applicationId
- The id of the application.- Throws:
GenieClientException
- If the response received is not 2xx.IOException
- For Network and other IO issues
-
ApplicationClient(Retrofit)