Class OciRestApi.Builder
java.lang.Object
io.helidon.integrations.common.rest.RestApi.Builder<OciRestApi.Builder,OciRestApi>
io.helidon.integrations.oci.connect.OciRestApi.Builder
- All Implemented Interfaces:
Builder<OciRestApi.Builder,,OciRestApi> Supplier<OciRestApi>
- Enclosing class:
- OciRestApi
Fluent API builder for
OciRestApi.
The final host of each endpoint is computed based on a format provided by each request (usually the same format for a certain area, such as Vault, ObjectStorage etc.), and a prefix also received with each request.
The template %s://%s.%s.%s would resolve into
${scheme}://${hostPrefix}.${region}.oci.${domain}.
Let's consider the following configuration:
scheme: "oraclecloud.com"hostPrefix:vaultsregion:eu-frankfurt-1domain: "oraclecloud.com"
https://vaults.eu-frankfurt-1.oraclecloud.com as the endpoint.
In case we need to connect to a local docker image, or a testing environment, an explicit
address can be configured for each domain specific API, or parts of the template can be modified
if the final address matches the expected structure.-
Method Summary
Modifier and TypeMethodDescriptionUpdate builder from configuration.configProvider(OciConfigProvider ociConfigProvider) Cloud connectivity configuration to use.configType(OciRestApi.ConfigType configType) How to obtain data to configure connectivity to OCI.protected OciRestApidoBuild()Build an instance ofRestApiimplementation.Domain to use when constructing endpoint address.protected voidpreBuild()Pre build method.Scheme to use when constructing endpoint address.Methods inherited from class io.helidon.integrations.common.rest.RestApi.Builder
build, faultTolerance, ftHandler, get, jsonBuilderFactory, jsonReaderFactory, jsonWriterFactory, me, postBuild, webClient, webClientBuilder
-
Method Details
-
config
Update builder from configuration.- Overrides:
configin classRestApi.Builder<OciRestApi.Builder,OciRestApi> - Parameters:
config- config located on the node of OCI configuration- Returns:
- updated builder
-
configType
How to obtain data to configure connectivity to OCI. By default, an attempt is made to discover whether to use instance principal or resource principal. Falls back toOciRestApi.ConfigType.OCI_PROFILE.- Parameters:
configType- type of config to use- Returns:
- updated builder
-
scheme
Scheme to use when constructing endpoint address. Defaults to "https".- Parameters:
scheme- scheme to use (most likely eitherhttporhttps- Returns:
- updated builder
-
domain
Domain to use when constructing endpoint address. Defaults to "oraclecloud.com".- Parameters:
domain- domain to use- Returns:
- updated builder
-
configProvider
Cloud connectivity configuration to use.- Parameters:
ociConfigProvider- profile config, such asOciConfigProfile- Returns:
- updated builder
-
preBuild
protected void preBuild()Description copied from class:RestApi.BuilderPre build method. This implementation builds the web client and sets up JSON factories.- Overrides:
preBuildin classRestApi.Builder<OciRestApi.Builder,OciRestApi>
-
doBuild
Description copied from class:RestApi.BuilderBuild an instance ofRestApiimplementation.- Specified by:
doBuildin classRestApi.Builder<OciRestApi.Builder,OciRestApi> - Returns:
- a new instance
-