ec2metadata

package
Version: v2.5.2-0...-f3a5e34 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 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 EC2Metadata

type EC2Metadata struct {
	AvailabilityZone string `json:"availabilityZone"`
	InstanceType     string `json:"instanceType"`
	InstanceID       string `json:"instanceId"`
	ImageID          string `json:"imageId"`
	AccountID        string `json:"accountId"`
	Region           string `json:"region"`
	Architecture     string `json:"architecture"`
	// In SFX the dimension/property key is "AWSUniqueId" this struct field is
	// named AWSUniqueID to satisfy golint
	AWSUniqueID string
}

EC2Metadata contains metadata about an ec2 instance

func Get

func Get() (*EC2Metadata, error)

Get returns a map with aws metadata including the AWSUniqueID

func GetWithIdentityURL

func GetWithIdentityURL(url string) (*EC2Metadata, error)

GetWithIdentityURL returns a map with aws metadata including AWSUniqueID

func (*EC2Metadata) GetAWSUniqueID

func (e *EC2Metadata) GetAWSUniqueID() (string, error)

GetAWSUniqueID returns the AWSUniqueId from the collected EC2Metadata Please note that the dimension/property used in SFX is named "AWSUniqueId" and not AWSUniqueID. This function is named in order to satisfy golint demands

func (*EC2Metadata) ToStringMap

func (e *EC2Metadata) ToStringMap() map[string]string

ToStringMap returns the ec2 metadata as a string map

Source Files

Jump to

Keyboard shortcuts

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