client

package
v0.0.0-...-f37bb2f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2020 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateConfig

func ValidateConfig(c *Config) field.ErrorList

ValidateConfig validates the OCI Flexible Volume Provisioner config file.

Types

type AuthConfig

type AuthConfig struct {
	Region               string `yaml:"region"`
	RegionKey            string `yaml:"regionKey"`
	TenancyOCID          string `yaml:"tenancy"`
	CompartmentOCID      string `yaml:"compartment"` // DEPRECATED (we no longer directly use this)
	UserOCID             string `yaml:"user"`
	PrivateKey           string `yaml:"key"`
	Passphrase           string `yaml:"passphrase"`
	PrivateKeyPassphrase string `yaml:"key_passphase"` // DEPRECATED
	Fingerprint          string `yaml:"fingerprint"`
	VcnOCID              string `yaml:"vcn"`
}

AuthConfig holds the configuration required for communicating with the OCI API.

type Config

type Config struct {
	Auth AuthConfig `yaml:"auth"`

	UseInstancePrincipals bool `yaml:"useInstancePrincipals"`
	// contains filtered or unexported fields
}

Config holds the configuration for the OCI flexvolume driver.

func ConfigFromFile

func ConfigFromFile(path string) (*Config, error)

ConfigFromFile reads the file at the given path and marshals it into a Config object.

func NewConfig

func NewConfig(r io.Reader) (*Config, error)

NewConfig creates a new Config based on the contents of the given io.Reader.

type Interface

type Interface interface {
	// FindVolumeAttachment searches for a volume attachment in either the state
	// ATTACHING or ATTACHED and returns the first volume attachment found.
	FindVolumeAttachment(volumeID string) (core.VolumeAttachment, error)

	// WaitForVolumeAttached polls waiting for a OCI block volume to be in the
	// ATTACHED state.
	WaitForVolumeAttached(volumeAttachmentID string) (core.VolumeAttachment, error)

	// GetInstance retrieves the oci.Instance for a given OCID.
	GetInstance(id string) (*core.Instance, error)

	// AttachVolume attaches a block storage volume to the specified instance.
	// See https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/VolumeAttachment/AttachVolume
	AttachVolume(instanceID, volumeID string) (core.VolumeAttachment, int, error)

	// DetachVolume detaches a storage volume from the specified instance.
	// See: https://docs.us-phoenix-1.oraclecloud.com/api/#/en/iaas/20160918/Volume/DetachVolume
	DetachVolume(volumeAttachmentID string) error

	// WaitForVolumeDetached polls waiting for a OCI block volume to be in the
	// DETACHED state.
	WaitForVolumeDetached(volumeAttachmentID string) error

	// GetConfig returns the Config associated with the OCI API client.
	GetConfig() *Config
}

Interface abstracts the OCI SDK and application specific convenience methods for interacting with the OCI API.

func New

func New(configPath string) (Interface, error)

New initialises a OCI API client from a config file.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL