Package com.netflix.genie.client
Class ApplicationClient
- java.lang.Object
-
- com.netflix.genie.client.ApplicationClient
-
public class ApplicationClient extends java.lang.Object
Client library for the Application Service.- Since:
- 3.0.0
-
-
Constructor Summary
Constructors Constructor Description ApplicationClient(@NotEmpty java.lang.String url, java.util.List<okhttp3.Interceptor> interceptors, GenieNetworkConfiguration genieNetworkConfiguration)
Deprecated.ApplicationClient(@NotNull retrofit2.Retrofit retrofit)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method 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 an application in 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)
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, @Min(1L) java.lang.Integer pageSize, SortAttribute sortAttribute, SortDirection sortDirection, @Min(0L) java.lang.Integer pageIndex)
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.
-
-
-
Constructor Detail
-
ApplicationClient
public ApplicationClient(@NotNull @NotNull retrofit2.Retrofit retrofit)
Constructor.- Parameters:
retrofit
- The configuredRetrofit
client to a Genie server
-
ApplicationClient
@Deprecated public ApplicationClient(@NotEmpty @NotEmpty java.lang.String url, @Nullable java.util.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 Detail
-
createApplication
public java.lang.String createApplication(Application application) throws java.io.IOException, GenieClientException
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.java.io.IOException
- For Network and other IO issues
-
getApplications
public java.util.List<Application> getApplications() throws java.io.IOException, GenieClientException
Method to get a list of all the applications.- Returns:
- A list of applications.
- Throws:
GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues
-
getApplications
public 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
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.java.io.IOException
- For Network and other IO issues
-
getApplications
public java.util.List<Application> getApplications(@Nullable java.lang.String name, @Nullable java.lang.String user, @Nullable java.util.List<java.lang.String> statusList, @Nullable java.util.List<java.lang.String> tagList, @Nullable java.lang.String type, @Nullable @Min(1L) @Min(1L) java.lang.Integer pageSize, @Nullable SortAttribute sortAttribute, @Nullable SortDirection sortDirection, @Nullable @Min(0L) @Min(0L) java.lang.Integer pageIndex) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
getApplication
public Application getApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
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.java.io.IOException
- For Network and other IO issues
-
deleteApplication
public void deleteApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
Method to delete a application from Genie.- Parameters:
applicationId
- The id of the application.- Throws:
GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues
-
deleteAllApplications
public void deleteAllApplications() throws java.io.IOException, GenieClientException
Method to delete all applications from Genie.- Throws:
GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues
-
patchApplication
public void patchApplication(java.lang.String applicationId, com.github.fge.jsonpatch.JsonPatch patch) throws java.io.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.java.io.IOException
- If the response received is not 2xx.
-
updateApplication
public void updateApplication(java.lang.String applicationId, Application application) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
getCommandsForApplication
public java.util.List<Command> getCommandsForApplication(java.lang.String applicationId) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
getConfigsForApplication
public java.util.Set<java.lang.String> getConfigsForApplication(java.lang.String applicationId) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
addConfigsToApplication
public void addConfigsToApplication(java.lang.String applicationId, java.util.Set<java.lang.String> configs) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
updateConfigsForApplication
public void updateConfigsForApplication(java.lang.String applicationId, java.util.Set<java.lang.String> configs) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
removeAllConfigsForApplication
public void removeAllConfigsForApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
Remove all configs for this application.- Parameters:
applicationId
- The id of the application.- Throws:
GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues
-
getDependenciesForApplication
public java.util.Set<java.lang.String> getDependenciesForApplication(java.lang.String applicationId) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
addDependenciesToApplication
public void addDependenciesToApplication(java.lang.String applicationId, java.util.Set<java.lang.String> dependencies) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
updateDependenciesForApplication
public void updateDependenciesForApplication(java.lang.String applicationId, java.util.Set<java.lang.String> dependencies) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
removeAllDependenciesForApplication
public void removeAllDependenciesForApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
Remove all dependencies for this application.- Parameters:
applicationId
- The id of the application.- Throws:
GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues
-
getTagsForApplication
public java.util.Set<java.lang.String> getTagsForApplication(java.lang.String applicationId) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
addTagsToApplication
public void addTagsToApplication(java.lang.String applicationId, java.util.Set<java.lang.String> tags) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
updateTagsForApplication
public void updateTagsForApplication(java.lang.String applicationId, java.util.Set<java.lang.String> tags) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
removeTagFromApplication
public void removeTagFromApplication(java.lang.String applicationId, java.lang.String tag) throws java.io.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.java.io.IOException
- For Network and other IO issues
-
removeAllTagsForApplication
public void removeAllTagsForApplication(java.lang.String applicationId) throws java.io.IOException, GenieClientException
Remove all tags for this application.- Parameters:
applicationId
- The id of the application.- Throws:
GenieClientException
- If the response received is not 2xx.java.io.IOException
- For Network and other IO issues
-
-