metadata

package
v0.0.0-...-c113622 Latest Latest
Warning

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

Go to latest
Published: Jul 1, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	GetMetadata(path string) (string, error)
	GetUserData() (string, error)
	GetVendorData() (string, error)
	GetInstanceIdentityDocument() (meta Metadata, err error)
}

func NewClient

func NewClient() Client

type DefaultClient

type DefaultClient struct {
	// contains filtered or unexported fields
}

func (DefaultClient) GetInstanceIdentityDocument

func (client DefaultClient) GetInstanceIdentityDocument() (meta Metadata, err error)

func (DefaultClient) GetMetadata

func (client DefaultClient) GetMetadata(path string) (string, error)

func (DefaultClient) GetUserData

func (client DefaultClient) GetUserData() (string, error)

func (DefaultClient) GetVendorData

func (client DefaultClient) GetVendorData() (string, error)

func (DefaultClient) SendRequest

func (client DefaultClient) SendRequest(path string) (string, error)

func (*DefaultClient) SetHttpClient

func (client *DefaultClient) SetHttpClient(httpClient http.Client) error

SetHttpClient will setup a http client

type MDDisks

type MDDisks struct {
	BackupType string `json:"backup-type"`
	DiskId     string `json:"disk-id"`
	DiskType   string `json:"disk-type"`
	Drive      string `json:"drive"`
	Encrypted  bool   `json:"encrypted"`
	IsBoot     bool   `json:"is-boot"`
	Name       string `json:"name"`
	Size       int    `json:"size"`
}

type MDEthernet

type MDEthernet struct {
	Addresses   []string      `json:"addresses"`
	Gateway4    string        `json:"gateway4"`
	Match       MDMatch       `json:"match"`
	MTU         int           `json:"mtu"`
	NameServers MDNameServers `json:"nameservers"`
}

type MDIPs

type MDIPs struct {
	IPAddress string `json:"ip-address"`
	Type      string `json:"type"`
	Bandwidth int    `json:"bandwidth,omitempty"`
	IPId      string `json:"ip-id,omitempty"`
}

type MDMatch

type MDMatch struct {
	MacAddress string `json:"macaddress"`
}

type MDNameServers

type MDNameServers struct {
	Addresses []string `json:"addresses"`
}

type MDNetworkConfig

type MDNetworkConfig struct {
	Ethernets map[string]MDEthernet `json:"ethernets"`
	Version   int                   `json:"version"`
}

type MDNetworkInterfaces

type MDNetworkInterfaces struct {
	IPs      []MDIPs `json:"ips"`
	Mac      string  `json:"mac"`
	SubnetId string  `json:"subnet-id"`
	VpcId    string  `json:"vpc-id"`
}

type MDUHost

type MDUHost struct {
	CPU               int                   `json:"cpu"`
	Disks             []MDDisks             `json:"disks"`
	GPU               int                   `json:"gpu"`
	Hotplug           bool                  `json:"hotplug"`
	ImageId           string                `json:"image-id"`
	IsolationGroup    string                `json:"isolation-group"`
	MachineType       string                `json:"machine-type"`
	Memory            int                   `json:"memory"`
	Name              string                `json:"name"`
	NetCapability     string                `json:"net-capability"`
	NetworkInterfaces []MDNetworkInterfaces `json:"network-interfaces"`
	OsName            string                `json:"os-name"`
	ProjectId         string                `json:"project-id"`
	Region            string                `json:"region"`
	Remark            string                `json:"remark"`
	Tag               string                `json:"tag"`
	UHostId           string                `json:"uhost-id"`
	Zone              string                `json:"zone"`
}

type Metadata

type Metadata struct {
	AvailabilityZone string          `json:"availability-zone"`
	CloudName        string          `json:"cloud-name"`
	InstanceId       string          `json:"instance-id"`
	LocalHostname    string          `json:"local-hostname"`
	NetworkConfig    MDNetworkConfig `json:"network-config"`
	Platform         string          `json:"platform"`
	PublicSSHKeys    []string        `json:"public-ssh-keys"`
	Region           string          `json:"region"`
	UHost            MDUHost         `json:"uhost"`
}

Jump to

Keyboard shortcuts

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