config

package
v8.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2018 License: Apache-2.0, UPL-1.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthorizedKeys

type AuthorizedKeys struct {
	Cpi  string `json:"cpi"`
	User string `json:"user, omitempty"`
}

AuthorizedKeys is the set of public ssh-rsa keys to be installed on the default initial account provisioned on a new vm

type CPIProperties

type CPIProperties struct {
	OCI      OCIProperties
	Agent    registry.AgentOptions
	Registry registry.ClientOptions
}

CPIProperties element in Cloud.Config

type Cloud

type Cloud struct {
	Plugin     string
	Properties CPIProperties
}

Cloud element in the Config

type Config

type Config struct {
	Cloud Cloud
}

Config represents the full CPI configuration

It is passed to CPI by its invoker (BOSH cli or Director) via by the --configFile=<configfile> startup option.

func NewConfigFromPath

func NewConfigFromPath(configFile string, fs boshsys.FileSystem) (Config, error)

NewConfigFromPath unmarshals(builds) a Config from CPI configuration json persisted in a file on the file system.

func (Config) Validate

func (c Config) Validate() error

Validate performs a deep validation of a Config

type OCIProperties

type OCIProperties struct {
	// Tenancy under which the resources are provisioned
	Tenancy string `json:"tenancy"`

	// User OCID
	User string `json:"user"`

	// Compartment OCID
	CompartmentID string `json:"compartment"`

	// Region name
	Region string `json:"region"`

	// Fingerprint of the User API key
	Fingerprint string `json:"fingerprint"`

	// APIKeyFile is the path to the private API key
	APIKeyFile string `json:"apikeyfile"`

	// CPIKeyfile is the path to the private key used by the CPI
	// used for SSH connections
	CpiKeyFile string `json:"cpikeyfile"`

	// UsePublicIPForSSH controls whether to use public or private IP
	// of the target insatnce for establishing SSH connections
	UsePublicIPForSSH bool `json:"usePublicIpForSsh,omitempty"`

	// AuthorizedKeys contains the public ssh-keys to provision
	// on new vms
	AuthorizedKeys AuthorizedKeys `json:"authorized_keys"`

	// SSHTunnel is the configuration for creating a forward SSH tunnel
	SSHTunnel SSHTunnel `json:"sshTunnel,omitempty"`
}

OCIProperties contains the properties for configuring BOSH CPI for Oracle Cloud Infrastructure

func (OCIProperties) AuthorizedKeysContents

func (b OCIProperties) AuthorizedKeysContents() []string

func (OCIProperties) CpiSSHConfig

func (b OCIProperties) CpiSSHConfig() SSHConfig

CpiSSHConfig returns the CPI ssh configuration

func (OCIProperties) CpiSSHPublicKeyContent

func (b OCIProperties) CpiSSHPublicKeyContent() string

CpiSSHPublicKeyContent returns the configured cpi user's ssh-rsa public key

func (OCIProperties) TransportConfig

func (b OCIProperties) TransportConfig(host string) transport.Config

TransportConfig returns the configuration properties needed by the underlying transport layer for communicating with OCI

func (OCIProperties) UserSSHPublicKeyContent

func (b OCIProperties) UserSSHPublicKeyContent() string

UserSSHPublicKeyContent returns the configured ssh-rsa user public key

func (OCIProperties) Validate

func (b OCIProperties) Validate() error

Validate raises an error if any of the mandatory properties are missing

type SSHConfig

type SSHConfig struct {
	// contains filtered or unexported fields
}

SSHConfig contains configuration used by the CPI for establishing SSH connection for configuring new vm instances

func (SSHConfig) LocalIdentityKeyPath

func (c SSHConfig) LocalIdentityKeyPath() string

LocalIdentityKeyPath returns the path to the identity file containing the key for establishing the connection

func (SSHConfig) RemoteUser

func (c SSHConfig) RemoteUser() string

RemoteUser returns the name of the user on the target instance

func (SSHConfig) UsePublicIP

func (c SSHConfig) UsePublicIP() bool

UsePublicIP returns true if the SSH connection should be tried on the public IP of the target instance

type SSHTunnel

type SSHTunnel struct {
	LocalPort   int    `json:"localPort"`
	UsePublicIP bool   `json:"usePublicIP,omitempty"`
	User        string `json:"user"`
	Duration    string `json:"duration"`
}

SSHTunnel holds the CPI configuration for creating a forward SSH tunnel to a newly created vm

func (SSHTunnel) IsConfigured

func (c SSHTunnel) IsConfigured() bool

IsConfigured determines if an SSHTunnel has been configured or not

Jump to

Keyboard shortcuts

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