Class OciConfigProfile.Builder
- java.lang.Object
-
- io.helidon.integrations.oci.connect.OciConfigProfile.Builder
-
- All Implemented Interfaces:
Builder<OciConfigProfile>
,Supplier<OciConfigProfile>
- Enclosing class:
- OciConfigProfile
public static class OciConfigProfile.Builder extends Object implements Builder<OciConfigProfile>
Fluent API builder forOciConfigProfile
.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description OciConfigProfile
build()
Build the instance from this builder.OciConfigProfile.Builder
config(Config config)
Update this builder from configuration.boolean
configured()
Whether this builder has the required configuration.OciConfigProfile.Builder
fromOciConfig()
Update this builder from OCI configuration on default path with default profile.OciConfigProfile.Builder
fromOciConfig(String profile)
Update this builder from OCI configuration on default path with custom profile.OciConfigProfile.Builder
fromOciConfig(Path path)
Update this builder from OCI configuration on custom path with default profile.OciConfigProfile.Builder
fromOciConfig(Path path, String profile)
Attempts to read the profile from the OCI config file.OciConfigProfile.Builder
keyFingerprint(String keyFingerprint)
Key fingerprint.OciConfigProfile.Builder
privateKey(String privateKey)
PEM encoded private key.OciConfigProfile.Builder
privateKey(RSAPrivateKey privateKey)
Configure an explicit RSA private key.void
property(String key, String value)
Add property as defined in OCI config file.OciConfigProfile.Builder
region(String region)
OCI region.OciConfigProfile.Builder
tenancyOcid(String tenancyOcid)
Tenancy OCID.OciConfigProfile.Builder
userOcid(String userOcid)
User OCID.
-
-
-
Method Detail
-
build
public OciConfigProfile build()
Description copied from interface:Builder
Build the instance from this builder.- Specified by:
build
in interfaceBuilder<OciConfigProfile>
- Returns:
- instance of the built type
-
config
public OciConfigProfile.Builder config(Config config)
Update this builder from configuration.- Parameters:
config
- config located on the node of OCI configuration- Returns:
- updated builder
-
userOcid
public OciConfigProfile.Builder userOcid(String userOcid)
User OCID.- Parameters:
userOcid
- OCID of the user- Returns:
- updated builder
-
tenancyOcid
public OciConfigProfile.Builder tenancyOcid(String tenancyOcid)
Tenancy OCID.- Parameters:
tenancyOcid
- OCID of the tenancy- Returns:
- updated builder
-
keyFingerprint
public OciConfigProfile.Builder keyFingerprint(String keyFingerprint)
Key fingerprint.- Parameters:
keyFingerprint
- key fingerprint- Returns:
- updated builder
-
region
public OciConfigProfile.Builder region(String region)
OCI region.- Parameters:
region
- region- Returns:
- updated builder
-
privateKey
public OciConfigProfile.Builder privateKey(String privateKey)
PEM encoded private key.- Parameters:
privateKey
- private key- Returns:
- updated builder
-
privateKey
public OciConfigProfile.Builder privateKey(RSAPrivateKey privateKey)
Configure an explicit RSA private key.- Parameters:
privateKey
- private key to use- Returns:
- updated builder
-
property
public void property(String key, String value)
Add property as defined in OCI config file.- Parameters:
key
- keyvalue
- value
-
fromOciConfig
public OciConfigProfile.Builder fromOciConfig()
Update this builder from OCI configuration on default path with default profile.- Returns:
- updated builder
-
fromOciConfig
public OciConfigProfile.Builder fromOciConfig(String profile)
Update this builder from OCI configuration on default path with custom profile.- Parameters:
profile
- name of the profile- Returns:
- updated builder
-
fromOciConfig
public OciConfigProfile.Builder fromOciConfig(Path path)
Update this builder from OCI configuration on custom path with default profile.- Parameters:
path
- path to the profile- Returns:
- updated builder
-
fromOciConfig
public OciConfigProfile.Builder fromOciConfig(Path path, String profile)
Attempts to read the profile from the OCI config file. This method does not fail in case the path is invalid.- Parameters:
path
- path of the OCI config (may not exist)profile
- profile to read- Returns:
- updated builder instance
- Throws:
OciRestException
- in case the file exists, but the profile name is not valid
-
configured
public boolean configured()
Whether this builder has the required configuration.- Returns:
true
if this builder is valid
-
-