Documentation ¶
Index ¶
Constants ¶
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 ¶
var ErrBadMetadata = errors.New("invalid OpenStack metadata, got empty uuid")
ErrBadMetadata is used to indicate a problem parsing data from metadata server
Functions ¶
func GetDevicePath ¶ added in v1.15.0
GetDevicePath retrieves device path from metadata service
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 IMetadata ¶ added in v1.19.0
IMetadata implements GetInstanceID & GetAvailabilityZone
var MetadataService IMetadata
MetadataService instance of IMetadata
func GetMetadataProvider ¶ added in v1.19.0
GetMetadataProvider retrieves instance of IMetadata
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 "latest" meta_data.json format.
type MetadataMock ¶ added in v1.19.0
MetadataMock is an autogenerated mock type for the IMetadata type
func (*MetadataMock) GetAvailabilityZone ¶ added in v1.19.0
func (_m *MetadataMock) GetAvailabilityZone() (string, error)
GetAvailabilityZone provides a mock function with given fields:
func (*MetadataMock) GetInstanceID ¶ added in v1.19.0
func (_m *MetadataMock) GetInstanceID() (string, error)
GetInstanceID provides a mock function with given fields: