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.
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" )
AWSPrivateAddrs returns the current private Addrs of this AWS instance. Must be called after OnAWS.
AWSPublicAddrs returns the current public IP of this AWS instance. Must be called after OnAWS.
GCPPrivateAddrs returns the current private addresses of this GCP instance.
GCPPublicAddrs returns the current public addresses of this GCP instance.
OnAWS returns true if this process is running on Amazon Web Services. If true, the the stats variables AWSAccountIDStatName and GCPRegionStatName are set.
OnGCP returns true if this process is running on Google Compute Platform. If true, the the stats variables GCPProjectIDStatName and GCPRegionStatName are set.
SetAWSMetadataHost can be used to override the default metadata host for testing purposes.
SetGCPMetadataHost can be used to override the default metadata host for testing purposes.
Path | Synopsis |
---|---|
cloudpaths | |
cloudvmtest |
Package cloudvm imports 11 packages (graph) and is imported by 5 packages. Updated 2021-01-19. Refresh now. Tools for package owners.