Interface HttpClientRegistry


  • @Beta
    public interface HttpClientRegistry
    Contains a bucket of configured HttpClients for use within an extension.

    There are two categories of HttpClients, one for internal Spinnaker services, and another for extension-defined http clients.

    • Method Detail

      • get

        @Nonnull
        HttpClient get​(@Nonnull
                       java.lang.String name)
        Get an extension-defined HttpClient by name.

        The client must first be configured before it can be retrieved from the registry.

        Parameters:
        name - The name of the HttpClient
        Returns:
        The configured HttpClient
      • getInternalService

        @Nonnull
        HttpClient getInternalService​(@Nonnull
                                      java.lang.String name)
        Get an internal Spinnaker service HttpClient.
        Parameters:
        name - The name of the Spinnaker service you want to talk to
        Returns:
        The internal service client
      • configure

        void configure​(@Nonnull
                       java.lang.String name,
                       @Nonnull
                       java.lang.String baseUrl,
                       @Nonnull
                       HttpClientConfig config)
        Configure a new external HttpClient.

        An HttpClient must be configured prior to being used.

        Parameters:
        name - A unique name for the client, scoped within an extension
        baseUrl - The base URL of the HTTP client
        config - Additional configuration for the client