Interface RdTool


  • public interface RdTool
    Interface to the RD tool
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      <T> T apiCall​(java.util.function.Function<org.rundeck.client.api.RundeckApi,​retrofit2.Call<T>> func)
      Perform a downgradable API call
      <T> T apiCallDowngradable​(java.util.function.Function<org.rundeck.client.api.RundeckApi,​retrofit2.Call<T>> func)
      Perform a downgradable api call
      static void apiVersionCheck​(java.lang.String description, int min, int currentVersion)
      Require the client to have minimum API version
      <T> org.rundeck.client.util.ServiceClient.WithErrorResponse<T> apiWithErrorResponse​(java.util.function.Function<org.rundeck.client.api.RundeckApi,​retrofit2.Call<T>> func)
      Perform a downgradable API call without handling errors in response
      <T> org.rundeck.client.util.ServiceClient.WithErrorResponse<T> apiWithErrorResponseDowngradable​(java.util.function.Function<org.rundeck.client.api.RundeckApi,​retrofit2.Call<T>> func)
      Perform a downgradable api call, without handling errors
      org.rundeck.client.util.RdClientConfig getAppConfig()  
      org.rundeck.client.util.ServiceClient<org.rundeck.client.api.RundeckApi> getClient()  
      RdApp getRdApp()  
      <T extends RdCommandExtension>
      T
      initExtension​(T extension)  
      java.lang.String projectOrEnv​(ProjectInput options)  
      void requireApiVersion​(java.lang.String description, int min)
      Require the client to have minimum API version
    • Method Detail

      • getClient

        org.rundeck.client.util.ServiceClient<org.rundeck.client.api.RundeckApi> getClient()
                                                                                    throws InputError
        Throws:
        InputError
      • getAppConfig

        org.rundeck.client.util.RdClientConfig getAppConfig()
      • apiCall

        <T> T apiCall​(java.util.function.Function<org.rundeck.client.api.RundeckApi,​retrofit2.Call<T>> func)
               throws InputError,
                      java.io.IOException
        Perform a downgradable API call
        Type Parameters:
        T - result type
        Parameters:
        func - function
        Returns:
        result
        Throws:
        InputError - on error
        java.io.IOException - on error
      • apiWithErrorResponse

        <T> org.rundeck.client.util.ServiceClient.WithErrorResponse<T> apiWithErrorResponse​(java.util.function.Function<org.rundeck.client.api.RundeckApi,​retrofit2.Call<T>> func)
                                                                                     throws InputError,
                                                                                            java.io.IOException
        Perform a downgradable API call without handling errors in response
        Type Parameters:
        T - result type
        Parameters:
        func - function
        Returns:
        response
        Throws:
        InputError - on error
        java.io.IOException - on error
      • apiCallDowngradable

        <T> T apiCallDowngradable​(java.util.function.Function<org.rundeck.client.api.RundeckApi,​retrofit2.Call<T>> func)
                           throws InputError,
                                  java.io.IOException
        Perform a downgradable api call
        Type Parameters:
        T - result type
        Parameters:
        func - function
        Returns:
        result
        Throws:
        InputError - on error
        java.io.IOException - on error
      • apiWithErrorResponseDowngradable

        <T> org.rundeck.client.util.ServiceClient.WithErrorResponse<T> apiWithErrorResponseDowngradable​(java.util.function.Function<org.rundeck.client.api.RundeckApi,​retrofit2.Call<T>> func)
                                                                                                 throws InputError,
                                                                                                        java.io.IOException
        Perform a downgradable api call, without handling errors
        Type Parameters:
        T - result type
        Parameters:
        func - function
        Returns:
        response
        Throws:
        InputError - on error
        java.io.IOException - on error
      • projectOrEnv

        java.lang.String projectOrEnv​(ProjectInput options)
                               throws InputError
        Parameters:
        options - project options
        Returns:
        project name from options or ENV
        Throws:
        InputError - if project is not set via options or ENV
      • getRdApp

        RdApp getRdApp()
      • requireApiVersion

        void requireApiVersion​(java.lang.String description,
                               int min)
                        throws InputError
        Require the client to have minimum API version
        Parameters:
        description - reason for the requirement
        min - required minimum version
        Throws:
        InputError - if version is not met
      • apiVersionCheck

        static void apiVersionCheck​(java.lang.String description,
                                    int min,
                                    int currentVersion)
                             throws InputError
        Require the client to have minimum API version
        Parameters:
        description - reason for the requirement
        min - required minimum version
        currentVersion - current version
        Throws:
        InputError - if version is not met