v.io: v.io/x/ref/runtime/internal/cloudvm Index | Files | Directories

package cloudvm

import "v.io/x/ref/runtime/internal/cloudvm"

Package cloudvm provides functions to test whether the current process is running on Google Compute Engine or Amazon Web Services, and to extract settings from this environment.

Package cloudvm provides functions to test whether the current process is running on Google Compute Engine or Amazon Web Services, and to extract settings from this environment.

Index

Package Files

aws.go gcp.go

Constants

const (
    // AWSAccountIDStatName is the name of a v.io/x/ref/lib/stats
    // string variable containing the account id.
    AWSAccountIDStatName = "system/aws/account-id"
    // AWSRegionStatName is the name of a v.io/x/ref/lib/stats
    // string variable containing the region.
    AWSRegionStatName = "system/aws/zone"
)
const (

    // GCPProjectIDStatName is the name of a v.io/x/ref/lib/stats
    // string variable containing the project id.
    GCPProjectIDStatName = "system/gcp/project-id"
    // GCPRegionStatName is the name of a v.io/x/ref/lib/stats
    // string variable containing the region.
    GCPRegionStatName = "system/gcp/zone"
)

func AWSPrivateAddrs Uses

func AWSPrivateAddrs(ctx context.Context, timeout time.Duration) ([]net.Addr, error)

AWSPrivateAddrs returns the current private Addrs of this AWS instance.

func AWSPublicAddrs Uses

func AWSPublicAddrs(ctx context.Context, timeout time.Duration) ([]net.Addr, error)

AWSPublicAddrs returns the current public IP of this AWS instance.

func GCPPrivateAddrs Uses

func GCPPrivateAddrs(ctx context.Context, timeout time.Duration) ([]net.Addr, error)

GCPPrivateAddrs returns the current private addresses of this GCP instance.

func GCPPublicAddrs Uses

func GCPPublicAddrs(ctx context.Context, timeout time.Duration) ([]net.Addr, error)

GCPPublicAddrs returns the current public addresses of this GCP instance.

func OnAWS Uses

func OnAWS(ctx context.Context, timeout time.Duration) bool

OnAWS returns true if this process is running on Amazon Web Services. If true, the the stats variables AWSAccountIDStatName and GCPRegionStatName are set.

func OnGCP Uses

func OnGCP(ctx context.Context, timeout time.Duration) bool

OnGCP returns true if this process is running on Google Compute Platform. If true, the the stats variables GCPProjectIDStatName and GCPRegionStatName are set.

func SetAWSMetadataHost Uses

func SetAWSMetadataHost(host string)

SetAWSMetadataHost can be used to override the default metadata host for testing purposes.

func SetGCPMetadataHost Uses

func SetGCPMetadataHost(host string)

SetGCPMetadataHost can be used to override the default metadata host for testing purposes.

Directories

PathSynopsis
cloudpaths
cloudvmtest

Package cloudvm imports 10 packages (graph) and is imported by 5 packages. Updated 2020-10-24. Refresh now. Tools for package owners.