metadata

package
v0.0.0-...-20b7744 Latest Latest
Warning

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

Go to latest
Published: May 4, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// MetadataID is used as an identifier on the metadata search order configuration.
	MetadataID = "metadataService"

	// configDriveID is used as an identifier on the metadata search order configuration.
	ConfigDriveID = "configDrive"
)

Variables

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

ErrBadMetadata is used to indicate a problem parsing data from metadata server

Functions

func Clear

func Clear()

func GetDevicePath

func GetDevicePath(volumeID string) string

func Set

func Set(value *Metadata)

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"`
}

DeviceMetadata is a single/simplified data structure for all kinds of device metadata types.

type Metadata

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

Metadata has the information fetched from OpenStack metadata service or config drives. Assumes the "2012-08-10" meta_data.json format. See http://docs.openstack.org/user-guide/cli_config_drive.html

func Get

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

func GetFromConfigDrive

func GetFromConfigDrive(metadataVersion string) (*Metadata, error)

func GetFromMetadataService

func GetFromMetadataService(metadataVersion string) (*Metadata, error)

Jump to

Keyboard shortcuts

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