Documentation
¶
Overview ¶
Package cloudproviders provides utilities to detect the cloud provider.
Index ¶
- Variables
- func DetectCloudProvider(ctx context.Context, collectAccountID bool) (string, string)
- func GetCloudProviderNTPHosts(ctx context.Context) []string
- func GetHostAliases(ctx context.Context) ([]string, string)
- func GetHostCCRID(ctx context.Context, detectedCloud string) string
- func GetHostID(ctx context.Context, cloudProviderName string) string
- func GetInstanceType(ctx context.Context, detectedCloud string) string
- func GetPreemptionTerminationTime(ctx context.Context, cloudProviderName string) (time.Time, error)
- func GetPublicIPv4(ctx context.Context) (string, error)
- func GetSource(cloudProviderName string) string
Constants ¶
This section is empty.
Variables ¶
var ErrNotPreemptible = errors.New("instance is not preemptible")
ErrNotPreemptible is returned when the instance is not a preemptible instance (e.g., not an AWS Spot instance, not a GCE Preemptible instance). When this error is returned, callers should stop polling for preemption events.
var ErrPreemptionUnsupported = errors.New("preemption detection not supported for this cloud provider")
ErrPreemptionUnsupported is returned when preemption detection is not supported for the given cloud provider.
Functions ¶
func DetectCloudProvider ¶
DetectCloudProvider detects the cloud provider where the agent is running in order:
func GetCloudProviderNTPHosts ¶
GetCloudProviderNTPHosts detects the cloud provider where the agent is running in order and returns its NTP host name.
func GetHostAliases ¶
GetHostAliases returns the hostname aliases and the name of the possible cloud providers
func GetHostCCRID ¶
GetHostCCRID returns the host CCRID from the first provider that works
func GetHostID ¶
GetHostID returns the ID for a cloud provider for the current host. The host ID is unique to the cloud provider and is different from the hostname. For now only EC2 is supported.
func GetInstanceType ¶
GetInstanceType returns the instance type from the first cloud provider that works.
func GetPreemptionTerminationTime ¶
GetPreemptionTerminationTime returns the scheduled termination time for a preemptible instance (e.g., AWS Spot, GCE Preemptible, Azure Spot). Returns ErrNotPreemptible if the instance is not preemptible. Returns ErrPreemptionUnsupported if the cloud provider doesn't support preemption detection. For now only EC2 is supported.
func GetPublicIPv4 ¶
GetPublicIPv4 returns the public IPv4 from different providers
Types ¶
This section is empty.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package alibaba provides utilities to detect the Alibaba cloud provider.
|
Package alibaba provides utilities to detect the Alibaba cloud provider. |
|
Package azure provides utilities to detect Azure cloud provider.
|
Package azure provides utilities to detect Azure cloud provider. |
|
Package gce provides utilities to detect gce cloud provider.
|
Package gce provides utilities to detect gce cloud provider. |
|
Package ibm provides utilities to detect ibm cloud provider.
|
Package ibm provides utilities to detect ibm cloud provider. |
|
Package kubernetes provides utilities to detect cloud provider from kubernetes.
|
Package kubernetes provides utilities to detect cloud provider from kubernetes. |
|
Package network provides utilities around cloud provider networking.
|
Package network provides utilities around cloud provider networking. |
|
Package oracle provides utilities to detect oracle cloud provider.
|
Package oracle provides utilities to detect oracle cloud provider. |
|
Package tencent provides utilities to detect tencent cloud provider.
|
Package tencent provides utilities to detect tencent cloud provider. |