Documentation ¶
Index ¶
- type Attributes
- type Client
- func (c *Client) Get(ctx context.Context) (*Descriptor, error)
- func (c *Client) GetKey(ctx context.Context, key string, headers map[string]string) (string, error)
- func (c *Client) GetKeyRecursive(ctx context.Context, key string) (string, error)
- func (c *Client) Watch(ctx context.Context) (*Descriptor, error)
- func (c *Client) WriteGuestAttributes(ctx context.Context, key, value string) error
- type Descriptor
- type Instance
- type MDSClientInterface
- type MDSReqError
- type NetworkInterfaces
- type Project
- type VlanInterface
- type WindowsKey
- type WindowsKeys
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attributes ¶
type Attributes struct { BlockProjectKeys bool HTTPSMDSEnableNativeStore *bool DisableHTTPSMdsSetup *bool EnableOSLogin *bool EnableWindowsSSH *bool TwoFactor *bool SecurityKey *bool RequireCerts *bool SSHKeys []string WindowsKeys WindowsKeys Diagnostics string DisableAddressManager *bool DisableAccountManager *bool EnableDiagnostics *bool EnableWSFC *bool WSFCAddresses string WSFCAgentPort string DisableTelemetry bool }
Attributes describes the project's attributes keys.
func (*Attributes) UnmarshalJSON ¶
func (a *Attributes) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals b into Attribute.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client defines the public interface between the core guest agent and the metadata layer.
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context) (*Descriptor, error)
Get does a metadata call, if hang is set to true then it will do a longpoll.
func (*Client) GetKeyRecursive ¶
GetKeyRecursive gets a specific metadata key recursively and returns JSON output.
type Descriptor ¶
Descriptor wraps/holds all the metadata keys, the structure reflects the json descriptor returned with metadata call with alt=jason.
func (*Descriptor) UnmarshalJSON ¶
func (m *Descriptor) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals b into Descritor.
type Instance ¶
type Instance struct { // ID is the instance ID. ID json.Number // MachineType represents the instance's machine type. MachineType string // Attributes are the instance's attributes. Attributes Attributes // NetworkInterfaces contains all configured regular network interfaces (primary and secondary). NetworkInterfaces []NetworkInterfaces // VlanNetworkInterfaces contains all the vLAN network interfaces. VlanNetworkInterfaces map[int]map[int]VlanInterface // VirtualClock contains the drift-token attribute. VirtualClock virtualClock }
Instance describes the metadata's instance attributes/keys.
type MDSClientInterface ¶
type MDSClientInterface interface { Get(context.Context) (*Descriptor, error) GetKey(context.Context, string, map[string]string) (string, error) GetKeyRecursive(context.Context, string) (string, error) Watch(context.Context) (*Descriptor, error) WriteGuestAttributes(context.Context, string, string) error }
MDSClientInterface is the minimum required Metadata Server interface for Guest Agent.
type MDSReqError ¶
type MDSReqError struct {
// contains filtered or unexported fields
}
MDSReqError represents custom error produced by HTTP requests made on MDS. It captures error and HTTP response for inspecting status code.
func (*MDSReqError) Error ¶
func (m *MDSReqError) Error() string
Error implements method defined on error interface to transform custom type into error.
type NetworkInterfaces ¶
type NetworkInterfaces struct { ForwardedIps []string ForwardedIpv6s []string TargetInstanceIps []string IPAliases []string Mac string DHCPv6Refresh string MTU int }
NetworkInterfaces describes the instances network interfaces configurations.
type Project ¶
type Project struct { Attributes Attributes ProjectID string NumericProjectID json.Number }
Project describes the projects instance's attributes.
type VlanInterface ¶
type VlanInterface struct { // Mac is the vLAN interface's mac address. Mac string // ParentInterface is the mds reference of the parent/physical interface i.e.: // /computeMetadata/v1/instance/network-interfaces/0/ ParentInterface string // Vlan is the vlan id. Vlan int // MTU is the vlan's MTU value. MTU int // IP is the vlan's ip address. IP string // IPv6 is the vlan's ipv6 address. IPv6 []string // Gateway is the vlan's gateway address. Gateway string // GatewayIPv6 is the vlan's IPv6 gateway address. GatewayIPv6 string // DHCPv6Refresh determine if VLAN NIC supports IPV6. DHCPv6Refresh string }
VlanInterface describes the instances vlan network interfaces configurations.
type WindowsKey ¶
type WindowsKey struct { Email string ExpireOn string Exponent string Modulus string UserName string HashFunction string AddToAdministrators *bool PasswordLength int }
WindowsKey describes the WindowsKey metadata keys.
type WindowsKeys ¶
type WindowsKeys []WindowsKey
WindowsKeys is a slice of WindowKey.
func (*WindowsKeys) UnmarshalJSON ¶
func (k *WindowsKeys) UnmarshalJSON(b []byte) error
UnmarshalJSON unmarshals b into WindowsKeys.