fm

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const ErrMissingParams = "baseURI and port cannot be empty"

Variables

View Source
var (
	ErrBootStorageTags                = errors.New("mandatory field 'is_bootstorage' must be equal true in devices specification")
	ErrBootStorageConditionNotFound   = errors.New("not found condition in device spec for bootable storage")
	ErrSsdIdNotFound                  = errors.New("ssdId not found in resources")
	ErrGetMachineUUIDFromPostResponse = errors.New("error while getting machine UUID from POST response")
)

Functions

func CheckDeviceSpecJson

func CheckDeviceSpecJson(ds string) error

Types

type FabricManager

type FabricManager interface {
	IsInit() bool
	ValidateTenant(tenantId, bearerToken string) error
	PowerOn(machineUUID, tenantId, bearerToken string) error
	PowerOff(machineUUID, tenantId, bearerToken string) error
	GracefulShutdown(machineUUID, tenantId, bearerToken string) error
	ImageInstall(tenantId string, ssdId string, imageFilename, bearerToken string) error
	RemoveMachine(machineUUID, tenantId, bearerToken string) error
	CreateMachine(machineName, tenantId string, machineSpecs models.MachineSpecsArgs, bearerToken string) (string, error)
	GetMachineDetails(tenantId, machineUUID, bearerToken string) ([]models.Lanport, string, int, error)
}

FabricManager interface defines the methods for interacting with the Fabric Manager.

type FabricManagerClient

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

FabricManagerClient struct holds configuration for Fabric Manager interaction.

func NewFabricManagerClient

func NewFabricManagerClient(baseURI, endpoint, deviceSpecJsonString string) (*FabricManagerClient, error)

NewFabricManagerClient creates a new FabricManagerClient instance.

func (*FabricManagerClient) CreateMachine

func (fmc *FabricManagerClient) CreateMachine(machineName, tenantId string, machineSpecs models.MachineSpecsArgs, bearerToken string) (string, error)

CreateMachine sends a POST request to the Fabric Manager's `/machines/` endpoint to create a new machine

func (*FabricManagerClient) GetMachineDetails

func (fmc *FabricManagerClient) GetMachineDetails(tenantId, machineUUID, bearerToken string) (lanports []models.Lanport, bootSsd string, status int, _ error)

GetMachineDetails receives status on Machine from the Fabric Manager service.

func (*FabricManagerClient) GracefulShutdown added in v0.1.4

func (fmc *FabricManagerClient) GracefulShutdown(machineUUID, tenantId, bearerToken string) error

func (*FabricManagerClient) ImageInstall

func (fmc *FabricManagerClient) ImageInstall(tenantId, ssdId, imageFilename, bearerToken string) error

func (*FabricManagerClient) IsInit

func (fmc *FabricManagerClient) IsInit() bool

func (*FabricManagerClient) PowerOff

func (fmc *FabricManagerClient) PowerOff(machineUUID, tenantId, bearerToken string) error

func (*FabricManagerClient) PowerOn

func (fmc *FabricManagerClient) PowerOn(machineUUID, tenantId, bearerToken string) error

func (*FabricManagerClient) RemoveMachine

func (fmc *FabricManagerClient) RemoveMachine(machineUUID, tenantId, bearerToken string) error

func (*FabricManagerClient) ValidateTenant

func (fmc *FabricManagerClient) ValidateTenant(tenantId, bearerToken string) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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