Documentation ¶
Index ¶
- Variables
- func GetClusterName() (string, error)
- func GetHostAlias() (string, error)
- func GetHostname() (string, error)
- func GetNTPHosts() []string
- func GetNetworkID() (string, error)
- func GetPublicIPv4() (string, error)
- func GetTags() ([]string, error)
- func HostnameProvider() (string, error)
- func IsRunningOn() bool
Constants ¶
This section is empty.
Variables ¶
var (
// CloudProviderName contains the inventory name of for EC2
CloudProviderName = "GCP"
)
declare these as vars not const to ease testing
Functions ¶
func GetClusterName ¶
GetClusterName returns the name of the cluster containing the current GCE instance
func GetHostAlias ¶
GetHostAlias returns the host alias from GCE
func GetHostname ¶
GetHostname returns the hostname querying GCE Metadata api
func GetNTPHosts ¶
func GetNTPHosts() []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 ¶
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 ¶
GetPublicIPv4 returns the public IPv4 address of the current GCE instance
func HostnameProvider ¶
HostnameProvider GCE implementation of the HostnameProvider
Types ¶
This section is empty.