gce

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// CloudProviderName contains the inventory name of the cloud
	CloudProviderName = "GCP"
)

declare these as vars not const to ease testing

Functions

func GetClusterName

func GetClusterName(ctx context.Context) (string, error)

GetClusterName returns the name of the cluster containing the current GCE instance

func GetHostAliases added in v0.9.0

func GetHostAliases(ctx context.Context) ([]string, error)

GetHostAliases returns the host aliases from GCE

func GetHostname

func GetHostname(ctx context.Context) (string, error)

GetHostname returns the hostname querying GCE Metadata api

func GetNTPHosts added in v0.9.0

func GetNTPHosts(ctx context.Context) []string

GetNTPHosts returns the NTP hosts for GCE if it is detected as the cloud provider, otherwise an empty array. Docs: https://cloud.google.com/compute/docs/instances/managing-instances

func GetNetworkID

func GetNetworkID(ctx context.Context) (string, error)

GetNetworkID retrieves the network ID using the metadata endpoint. For GCE instances, the the network ID is the VPC ID, if the instance is found to be a part of exactly one VPC.

func GetPublicIPv4 added in v0.9.0

func GetPublicIPv4(ctx context.Context) (string, error)

GetPublicIPv4 returns the public IPv4 address of the current GCE instance

func GetTags

func GetTags(ctx context.Context) ([]string, error)

GetTags gets the tags from the GCE api

func HostnameProvider

func HostnameProvider(ctx context.Context, options map[string]interface{}) (string, error)

HostnameProvider GCE implementation of the HostnameProvider

func IsRunningOn

func IsRunningOn(ctx context.Context) bool

IsRunningOn returns true if the agent is running on GCE

Types

This section is empty.

Jump to

Keyboard shortcuts

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