Interface HttpClientRegistry
-
@Beta public interface HttpClientRegistryContains a bucket of configuredHttpClients for use within an extension.There are two categories of HttpClients, one for internal Spinnaker services, and another for extension-defined http clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidconfigure(java.lang.String name, java.lang.String baseUrl, HttpClientConfig config)Configure a new externalHttpClient.HttpClientget(java.lang.String name)Get an extension-definedHttpClientby name.HttpClientgetInternalService(java.lang.String name)Get an internal Spinnaker serviceHttpClient.
-
-
-
Method Detail
-
get
@Nonnull HttpClient get(@Nonnull java.lang.String name)
Get an extension-definedHttpClientby 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 serviceHttpClient.- 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 externalHttpClient.An HttpClient must be configured prior to being used.
- Parameters:
name- A unique name for the client, scoped within an extensionbaseUrl- The base URL of the HTTP clientconfig- Additional configuration for the client
-
-