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>
,Supplier<OciRestApi>
- Enclosing class:
- OciRestApi
public static class OciRestApi.Builder extends RestApi.Builder<OciRestApi.Builder,OciRestApi>
Fluent API builder forOciRestApi
.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
:vaults
region
:eu-frankfurt-1
domain
: "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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OciRestApi.Builder
config(Config config)
Update builder from configuration.OciRestApi.Builder
configProvider(OciConfigProvider ociConfigProvider)
Cloud connectivity configuration to use.OciRestApi.Builder
configType(OciRestApi.ConfigType configType)
How to obtain data to configure connectivity to OCI.protected OciRestApi
doBuild()
Build an instance ofRestApi
implementation.OciRestApi.Builder
domain(String domain)
Domain to use when constructing endpoint address.protected void
preBuild()
Pre build method.OciRestApi.Builder
scheme(String scheme)
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 Detail
-
config
public OciRestApi.Builder config(Config config)
Update builder from configuration.- Overrides:
config
in classRestApi.Builder<OciRestApi.Builder,OciRestApi>
- Parameters:
config
- config located on the node of OCI configuration- Returns:
- updated builder
-
configType
public OciRestApi.Builder configType(OciRestApi.ConfigType 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
public OciRestApi.Builder scheme(String scheme)
Scheme to use when constructing endpoint address. Defaults to "https".- Parameters:
scheme
- scheme to use (most likely eitherhttp
orhttps
- Returns:
- updated builder
-
domain
public OciRestApi.Builder domain(String domain)
Domain to use when constructing endpoint address. Defaults to "oraclecloud.com".- Parameters:
domain
- domain to use- Returns:
- updated builder
-
configProvider
public OciRestApi.Builder configProvider(OciConfigProvider ociConfigProvider)
Cloud connectivity configuration to use.- Parameters:
ociConfigProvider
- profile config, such asOciConfigProfile
- Returns:
- updated builder
-
preBuild
protected void preBuild()
Description copied from class:RestApi.Builder
Pre build method. This implementation builds the web client and sets up JSON factories.- Overrides:
preBuild
in classRestApi.Builder<OciRestApi.Builder,OciRestApi>
-
doBuild
protected OciRestApi doBuild()
Description copied from class:RestApi.Builder
Build an instance ofRestApi
implementation.- Specified by:
doBuild
in classRestApi.Builder<OciRestApi.Builder,OciRestApi>
- Returns:
- a new instance
-
-