Class OciConfigProfile.Builder

    • Method Detail

      • 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
      • 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 - key
        value - 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