Class ApplicationClient

java.lang.Object
com.netflix.genie.client.ApplicationClient

public class ApplicationClient extends Object
Client library for the Application Service.
Since:
3.0.0
  • Constructor Details

    • ApplicationClient

      public ApplicationClient(@NotNull @NotNull retrofit2.Retrofit retrofit)
      Constructor.
      Parameters:
      retrofit - The configured Retrofit client to a Genie server
    • ApplicationClient

      @Deprecated public ApplicationClient(@NotEmpty @NotEmpty String url, @Nullable List<okhttp3.Interceptor> interceptors, @Nullable GenieNetworkConfiguration genieNetworkConfiguration) throws GenieClientException
      Constructor.
      Parameters:
      url - The endpoint URL of the Genie API. Not null or empty
      interceptors - Any interceptors to configure the client with, can include security ones
      genieNetworkConfiguration - The network configuration parameters. Could be null
      Throws:
      GenieClientException - On error
  • Method Details

    • createApplication

      public String createApplication(Application application) throws 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.
      IOException - For Network and other IO issues
    • getApplications

      public List<Application> getApplications() throws 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.
      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
      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 returned
      sortAttribute - The entity attribute used to sort
      sortDirection - The sort direction
      pageIndex - 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

      public Application getApplication(String applicationId) throws 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.
      IOException - For Network and other IO issues
    • deleteApplication

      public void deleteApplication(String applicationId) throws 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.
      IOException - For Network and other IO issues
    • deleteAllApplications

      public void deleteAllApplications() throws IOException, GenieClientException
      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