oci

package
v0.0.0-...-df15804 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client defines / contains the OCI/Identity clients and operations.

func (*Client) CreateInstance

func (c *Client) CreateInstance(isRover bool, displayName, availabilityDomain, compartmentID, nodeShape, nodeImageName, nodeSubnetID, sshUser, authorizedKeys string, nodeOCPUs, nodeMemoryInGBs int) (string, error)

CreateInstance creates a new compute instance.

func (*Client) GetIPAddress

func (c *Client) GetIPAddress(id, compartmentID string) (string, error)

GetIPAddress returns the public IP of the compute instance, or private IP if there is no public address.

func (*Client) GetInstance

func (c *Client) GetInstance(id string) (core.Instance, error)

GetInstance gets a compute instance by id.

func (*Client) GetPrivateIP

func (c *Client) GetPrivateIP(id, compartmentID string) (string, error)

GetPrivateIP returns the private IP.

func (*Client) RestartInstance

func (c *Client) RestartInstance(id string) error

RestartInstance stops and starts a compute instance by id and waits for it to be running again

func (*Client) StartInstance

func (c *Client) StartInstance(id string) error

StartInstance starts a compute instance by id and waits for it to reach the Running state.

func (*Client) StopInstance

func (c *Client) StopInstance(id string) error

StopInstance stops a compute instance by id and waits for it to reach the Stopped state.

func (*Client) TerminateInstance

func (c *Client) TerminateInstance(id string) error

TerminateInstance terminates a compute instance by id (does not wait).

type Driver

type Driver struct {
	*drivers.BaseDriver
	AvailabilityDomain   string
	DockerPort           int
	Fingerprint          string
	Image                string
	NodeCompartmentID    string
	OCPUs                int
	MemoryInGBs          int
	PrivateIPAddress     string
	PrivateKeyContents   string
	PrivateKeyPassphrase string
	PrivateKeyPath       string
	Region               string
	Shape                string
	SubnetID             string
	TenancyID            string
	UserID               string
	UsePrivateIP         bool
	VCNCompartmentID     string
	VCNID                string
	IsRover              bool
	RoverComputeEndpoint string
	RoverNetworkEndpoint string
	//	RoverCertPath        string
	//	RoverCertContent     string
	// Runtime values
	InstanceID string
}

Driver is the implementation of BaseDriver interface

func NewDriver

func NewDriver(hostName, storePath string) *Driver

NewDriver creates a new driver

func (*Driver) Create

func (d *Driver) Create() error

Create a host using the driver's config

func (*Driver) DriverName

func (d *Driver) DriverName() string

DriverName returns the name of the driver

func (*Driver) GetCreateFlags

func (d *Driver) GetCreateFlags() []mcnflag.Flag

GetCreateFlags returns the mcnflag.Flag slice representing the flags that can be set, their descriptions and defaults.

func (*Driver) GetIP

func (d *Driver) GetIP() (string, error)

GetIP returns an IP or hostname that this host is available at e.g. 1.2.3.4 or docker-host-d60b70a14d3a.cloudapp.net

func (*Driver) GetMachineName

func (d *Driver) GetMachineName() string

GetMachineName returns the name of the machine

func (*Driver) GetSSHHostname

func (d *Driver) GetSSHHostname() (string, error)

GetSSHHostname returns hostname for use with ssh

func (*Driver) GetSSHPort

func (d *Driver) GetSSHPort() (int, error)

GetSSHPort returns port for use with ssh

func (*Driver) GetSSHUsername

func (d *Driver) GetSSHUsername() string

GetSSHUsername returns username for use with ssh

func (*Driver) GetState

func (d *Driver) GetState() (state.State, error)

GetState returns the state that the host is in (running, stopped, etc)

func (*Driver) GetURL

func (d *Driver) GetURL() (string, error)

GetURL returns a Docker compatible host URL for connecting to this host e.g. tcp://1.2.3.4:2376

func (*Driver) Kill

func (d *Driver) Kill() error

Kill stops a host forcefully

func (*Driver) PreCreateCheck

func (d *Driver) PreCreateCheck() error

PreCreateCheck allows for pre-create operations to make sure a driver is ready for creation

func (*Driver) Remove

func (d *Driver) Remove() error

Remove a host

func (*Driver) Restart

func (d *Driver) Restart() error

Restart a host. This may just call Stop(); Start() if the provider does not have any special restart behaviour.

func (*Driver) SetConfigFromFlags

func (d *Driver) SetConfigFromFlags(flags drivers.DriverOptions) error

SetConfigFromFlags configures the driver with the object that was returned by RegisterCreateFlags

func (*Driver) Start

func (d *Driver) Start() error

Start a host

func (*Driver) Stop

func (d *Driver) Stop() error

Stop a host gracefully

Jump to

Keyboard shortcuts

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