imds

package
v0.0.12 Latest Latest
Warning

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

Go to latest
Published: May 30, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Copyright (c) Microsoft Corporation. Licensed under the MIT license.

Index

Constants

View Source
const (
	// ImdsInstanceAPIVersion is the imds instance api version
	ImdsInstanceAPIVersion = "2021-10-01"
	// ImdsLoadBalancerAPIVersion is the imds load balancer api version
	ImdsLoadBalancerAPIVersion = "2020-10-01"
	// ImdsServer is the imds server endpoint
	ImdsServer = "http://169.254.169.254"
	// ImdsInstanceURI is the imds instance uri
	ImdsInstanceURI = "/metadata/instance"
	// ImdsLoadBalancerURI is the imds load balancer uri
	ImdsLoadBalancerURI = "/metadata/loadbalancer"
	// ImdsUserAgent is the user agent to query Imds
	ImdsUserAgent = "golang/kube-egress-gateway"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ComputeMetadata

type ComputeMetadata struct {
	AzEnvironment     string    `json:"azEnvironment"`
	Location          string    `json:"location"`
	Name              string    `json:"name"`
	OSType            string    `json:"osType"`
	OSProfile         OSProfile `json:"osProfile"`
	ResourceGroupName string    `json:"resourceGroupName"`
	ResourceID        string    `json:"resourceId"`
	SubscriptionID    string    `json:"subscriptionId"`
	Tags              string    `json:"tags"`
	VMScaleSetName    string    `json:"vmScaleSetName"`
}

type IPAddress

type IPAddress struct {
	PrivateIP string `json:"privateIpAddress"`
	PublicIP  string `json:"publicIpAddress"`
}

type IPData

type IPData struct {
	IPAddress []IPAddress `json:"ipAddress"`
	Subnet    []Subnet    `json:"subnet"`
}

type InstanceMetadata

type InstanceMetadata struct {
	Compute *ComputeMetadata `json:"compute"`
	Network *NetworkMetadata `json:"network"`
}

func GetInstanceMetadata

func GetInstanceMetadata() (*InstanceMetadata, error)

type LBData

type LBData struct {
	PublicIPAddresses []PublicIPMetadata `json:"publicIpAddresses"`
}

type LoadBalancerMetadata

type LoadBalancerMetadata struct {
	LoadBalancer LBData `json:"loadbalancer"`
}

func GetLoadBalancerMetadata

func GetLoadBalancerMetadata() (*LoadBalancerMetadata, error)

type NetworkInterface

type NetworkInterface struct {
	IPv4       IPData `json:"ipv4"`
	MacAddress string `json:"macAddress"`
}

type NetworkMetadata

type NetworkMetadata struct {
	Interface []NetworkInterface `json:"interface"`
}

type OSProfile added in v0.0.7

type OSProfile struct {
	ComputerName string `json:"computerName"`
}

type PublicIPMetadata

type PublicIPMetadata struct {
	FrontendIPAddress string `json:"frontendIpAddress"`
	PrivateIPAddress  string `json:"privateIpAddress"`
}

type Subnet

type Subnet struct {
	Address string `json:"address"`
	Prefix  string `json:"prefix"`
}

Jump to

Keyboard shortcuts

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