fsas

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WAIT_FOR_STATUS_TIMEOUT               time.Duration = 30 * time.Minute
	WAIT_FOR_STATUS_INSTALL_TIMEOUT       time.Duration = 30 * time.Minute
	WAIT_FOR_STATUS_STEP                  time.Duration = 5 * time.Second
	WAIT_FOR_STATUS_STEP_FOR_INSTALLATION time.Duration = 5 * time.Second
	WAIT_FOR_STATUS_INSTALL_STEP          time.Duration = 5 * time.Second
	WAIT_FOR_STATUS_STOPPED_TIMEOUT       time.Duration = 15 * time.Second
	WAIT_FOR_STATUS_NOT_FOUND_TIMEOUT     time.Duration = 15 * time.Second
	WAIT_FOR_START_AFTER_REBOOT           time.Duration = 60 * time.Second
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CdiMachineState added in v0.1.4

type CdiMachineState int

State represents the state of the FSAS host

const (
	None                  CdiMachineState = iota
	BUILDING_BEFORE_QUEUE CdiMachineState = 10
	BUILDING              CdiMachineState = 11
	BOOTING               CdiMachineState = 12
	ACTIVE_PON            CdiMachineState = 13
	POWERING_OFF          CdiMachineState = 14
	ACTIVE_POFF           CdiMachineState = 15
	UNBUILDING            CdiMachineState = 16
	UNBUILDED             CdiMachineState = 17
	OS_INSTALLING         CdiMachineState = 18
	ERASING               CdiMachineState = 19
	ADDING_RESOURCE       CdiMachineState = 20
	DELETING_RESOURCE     CdiMachineState = 21
	UNBUILDING_WAIT       CdiMachineState = 30
	ERROR                 CdiMachineState = 90
)

func (CdiMachineState) String added in v0.1.4

func (s CdiMachineState) String() string

Given a State type, returns its string representation

type Driver

type Driver struct {
	*drivers.BaseDriver
	SSHPassword               string
	TenantUuid                string
	Username                  string
	Password                  string
	ApiUrl                    string
	NtpUrl                    string
	DnsIp                     string
	ComputeConditionsJson     string
	DevicesSpecJson           string
	NetworkBaremetalPort      int
	NetworkBaremetalUUID      string
	NetworkBaremetalDefaultGW string
	NetworkProvisionPort      int
	NetworkProvisionUUID      string
	NetworkProvisionDefaultGW string
	PrivateIPAddress          string
	OsImageName               string
	OsImageSshHostPubKey      string
	MachineUUID               string
	UserDataFile              string
	FabricManager             fm.FabricManager    `json:"-"`
	Keycloak                  keycloak.Keycloak   `json:"-"`
	SshManager                sshutils.SshManager `json:"-"`
	CfgManager                cfgutils.CfgManager `json:"-"`
}

Driver is the implementation of BaseDriver interface

func NewDriver

func NewDriver() *Driver

NewDriver creates and returns a new instance of the FSAS CDI 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 IP to use in communication

func (*Driver) GetSSHHostname

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

GetSSHHostname returns hostname 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

func (*Driver) String

func (d *Driver) String() string

func (*Driver) UnmarshalJSON

func (d *Driver) UnmarshalJSON(data []byte) error

UnmarshalJSON loads driver config from JSON. This function is used by the RPCServerDriver that wraps all drivers as a means of populating an already-initialized driver with new configuration. See `RPCServerDriver.SetConfigRaw`.

Jump to

Keyboard shortcuts

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