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 Details

    • get

      @Nonnull HttpClient get(@Nonnull 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 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 String name, @Nonnull 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