metadata

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2024 License: MPL-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigDriveID = "configDrive"
	MetadataID    = "metadataService"
)

Variables

View Source
var (
	ErrBadMetadata = errors.New("invalid OpenStack metadata, got empty uuid")
)

Functions

This section is empty.

Types

type DeviceMetadata

type DeviceMetadata struct {
	Type    string `json:"type"`
	Bus     string `json:"bus,omitempty"`
	Serial  string `json:"serial,omitempty"`
	Address string `json:"address,omitempty"`
}

type IMetadata

type IMetadata interface {
	GetInstanceID() (string, error)
	GetAvailabilityZone() (string, error)
	GetProjectID() (string, error)
}

func GetMetadataProvider

func GetMetadataProvider(order string) IMetadata

type Metadata

type Metadata struct {
	UUID             string           `json:"uuid"`
	Name             string           `json:"name"`
	AvailabilityZone string           `json:"availability_zone"`
	ProjectID        string           `json:"project_id"`
	Devices          []DeviceMetadata `json:"devices,omitempty"`
}

func Get

func Get(order string) (*Metadata, error)

type Opts

type Opts struct {
	SearchOrder    string           `gcfg:"search-order"`    // will be configDriver
	RequestTimeout utils.MyDuration `gcfg:"request-timeout"` // will be 0
}

Jump to

Keyboard shortcuts

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