Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrVMUniqueIDNotFound = errors.New("vm unique ID not found") ErrUnexpectedStatusCode = errors.New("imds returned an unexpected status code") )
Functions ¶
This section is empty.
Types ¶
type APIVersionsResponse ¶ added in v1.7.3
type APIVersionsResponse struct {
APIVersions []string `json:"apiVersions"`
}
APIVersionsResponse represents versions form IMDS
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client returns metadata about the VM by querying IMDS
func (*Client) GetIMDSVersions ¶ added in v1.7.3
func (c *Client) GetIMDSVersions(ctx context.Context) (*APIVersionsResponse, error)
func (*Client) GetNetworkInterfaces ¶ added in v1.7.3
func (c *Client) GetNetworkInterfaces(ctx context.Context) ([]NetworkInterface, error)
type ClientOption ¶
type ClientOption func(*clientConfig)
func Endpoint ¶
func Endpoint(endpoint string) ClientOption
Endpoint overrides the default endpoint for a Client
func RetryAttempts ¶
func RetryAttempts(attempts uint) ClientOption
RetryAttempts overrides the default retry attempts for the client
type HardwareAddr ¶ added in v1.7.3
type HardwareAddr net.HardwareAddr
Required for marshaling/unmarshaling of mac address
func (*HardwareAddr) MarshalJSON ¶ added in v1.7.3
func (h *HardwareAddr) MarshalJSON() ([]byte, error)
func (*HardwareAddr) String ¶ added in v1.7.3
func (h *HardwareAddr) String() string
func (*HardwareAddr) UnmarshalJSON ¶ added in v1.7.3
func (h *HardwareAddr) UnmarshalJSON(data []byte) error
type NetworkInterface ¶ added in v1.7.3
type NetworkInterface struct {
// IMDS returns compartment fields - these are mapped to NC ID and NC version
MacAddress HardwareAddr `json:"macAddress"`
InterfaceCompartmentID string `json:"interfaceCompartmentID,omitempty"`
}
NetworkInterface represents a network interface from IMDS
type NetworkInterfaces ¶ added in v1.7.3
type NetworkInterfaces struct {
Interface []NetworkInterface `json:"interface"`
}
NetworkInterfaces represents the network interfaces from IMDS
Click to show internal directories.
Click to hide internal directories.