metadata

package
v0.26.9 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2024 License: Apache-2.0 Imports: 11 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 HuaweiCloud metadata, got empty uuid")

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

Functions

This section is empty.

Types

type IMetadata

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

IMetadata implements GetInstanceID & GetAvailabilityZone

type Metadata

type Metadata struct {
	UUID             string `json:"uuid"`
	Name             string `json:"name"`
	AvailabilityZone string `json:"availability_zone"`
	RegionID         string `json:"region_id"`
}

Metadata has the information fetched from HuaweiCloud metadata service or config drives. Assumes the "latest" meta_data.json format.

func Get

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

Get retrieves metadata from either config drive or metadata service. Search order depends on the order set in config file.

Jump to

Keyboard shortcuts

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