gcp

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2026 License: Apache-2.0 Imports: 34 Imported by: 13

Documentation

Overview

Package gcp allows interaction with Google Cloud Platform resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertStorageBucketExists deprecated

func AssertStorageBucketExists(t testing.TestingT, name string)

AssertStorageBucketExists checks if the given storage bucket exists and fails the test if it does not.

Deprecated: Use AssertStorageBucketExistsContext instead.

func AssertStorageBucketExistsContext added in v1.0.0

func AssertStorageBucketExistsContext(t testing.TestingT, ctx context.Context, name string)

AssertStorageBucketExistsContext checks if the given storage bucket exists and fails the test if it does not. The ctx parameter supports cancellation and timeouts.

func AssertStorageBucketExistsContextE added in v1.0.0

func AssertStorageBucketExistsContextE(t testing.TestingT, ctx context.Context, name string) error

AssertStorageBucketExistsContextE checks if the given storage bucket exists and returns an error if it does not. The ctx parameter supports cancellation and timeouts.

func AssertStorageBucketExistsE deprecated

func AssertStorageBucketExistsE(t testing.TestingT, name string) error

AssertStorageBucketExistsE checks if the given storage bucket exists and returns an error if it does not.

Deprecated: Use AssertStorageBucketExistsContextE instead.

func AssertStorageBucketExistsWithClient added in v1.0.0

func AssertStorageBucketExistsWithClient(ctx context.Context, client *storage.Client, name string) error

AssertStorageBucketExistsWithClient checks if the given storage bucket exists and returns an error if it does not, using the supplied *storage.Client. Prefer this variant in unit tests where the client is backed by an httptest fake server (see storage_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func AssertSubscriptionExists deprecated added in v1.0.0

func AssertSubscriptionExists(t testing.TestingT, projectID string, subscriptionName string)

AssertSubscriptionExists checks if the given Pub/Sub subscription exists and fails the test if it does not.

Deprecated: Use AssertSubscriptionExistsContext instead.

func AssertSubscriptionExistsContext added in v1.0.0

func AssertSubscriptionExistsContext(t testing.TestingT, ctx context.Context, projectID string, subscriptionName string)

AssertSubscriptionExistsContext checks if the given Pub/Sub subscription exists and fails the test if it does not. The ctx parameter supports cancellation and timeouts.

func AssertSubscriptionExistsContextE added in v1.0.0

func AssertSubscriptionExistsContextE(t testing.TestingT, ctx context.Context, projectID string, subscriptionName string) error

AssertSubscriptionExistsContextE checks if the given Pub/Sub subscription exists and returns an error if it does not. The ctx parameter supports cancellation and timeouts.

func AssertSubscriptionExistsE deprecated added in v1.0.0

func AssertSubscriptionExistsE(t testing.TestingT, projectID string, subscriptionName string) error

AssertSubscriptionExistsE checks if the given Pub/Sub subscription exists and returns an error if it does not.

Deprecated: Use AssertSubscriptionExistsContextE instead.

func AssertSubscriptionExistsWithClient added in v1.0.0

func AssertSubscriptionExistsWithClient(ctx context.Context, client *pubsub.Client, subscriptionName string) error

AssertSubscriptionExistsWithClient checks if the given Pub/Sub subscription exists using the supplied *pubsub.Client. Prefer this variant in unit tests where the client is backed by a pstest in-memory fake server (see pubsub_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func AssertTopicExists deprecated added in v1.0.0

func AssertTopicExists(t testing.TestingT, projectID string, topicName string)

AssertTopicExists checks if the given Pub/Sub topic exists and fails the test if it does not.

Deprecated: Use AssertTopicExistsContext instead.

func AssertTopicExistsContext added in v1.0.0

func AssertTopicExistsContext(t testing.TestingT, ctx context.Context, projectID string, topicName string)

AssertTopicExistsContext checks if the given Pub/Sub topic exists and fails the test if it does not. The ctx parameter supports cancellation and timeouts.

func AssertTopicExistsContextE added in v1.0.0

func AssertTopicExistsContextE(t testing.TestingT, ctx context.Context, projectID string, topicName string) error

AssertTopicExistsContextE checks if the given Pub/Sub topic exists and returns an error if it does not. The ctx parameter supports cancellation and timeouts.

func AssertTopicExistsE deprecated added in v1.0.0

func AssertTopicExistsE(t testing.TestingT, projectID string, topicName string) error

AssertTopicExistsE checks if the given Pub/Sub topic exists and returns an error if it does not.

Deprecated: Use AssertTopicExistsContextE instead.

func AssertTopicExistsWithClient added in v1.0.0

func AssertTopicExistsWithClient(ctx context.Context, client *pubsub.Client, topicName string) error

AssertTopicExistsWithClient checks if the given Pub/Sub topic exists using the supplied *pubsub.Client. Prefer this variant in unit tests where the client is backed by a pstest in-memory fake server (see pubsub_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func CreateBuild deprecated added in v0.23.4

func CreateBuild(t testing.TestingT, projectID string, build *cloudbuildpb.Build) *cloudbuildpb.Build

CreateBuild creates a new build blocking until the operation is complete. This will fail the test if there is an error.

Deprecated: Use CreateBuildContext instead.

func CreateBuildContext added in v1.0.0

func CreateBuildContext(t testing.TestingT, ctx context.Context, projectID string, build *cloudbuildpb.Build) *cloudbuildpb.Build

CreateBuildContext creates a new build blocking until the operation is complete. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func CreateBuildContextE added in v1.0.0

func CreateBuildContextE(t testing.TestingT, ctx context.Context, projectID string, build *cloudbuildpb.Build) (*cloudbuildpb.Build, error)

CreateBuildContextE creates a new build blocking until the operation is complete. The ctx parameter supports cancellation and timeouts.

func CreateBuildE deprecated added in v0.23.4

func CreateBuildE(t testing.TestingT, projectID string, build *cloudbuildpb.Build) (*cloudbuildpb.Build, error)

CreateBuildE creates a new build blocking until the operation is complete.

Deprecated: Use CreateBuildContextE instead.

func CreateBuildWithClient added in v1.0.0

func CreateBuildWithClient(ctx context.Context, service *cloudbuild.Client, projectID string, build *cloudbuildpb.Build) (*cloudbuildpb.Build, error)

CreateBuildWithClient creates a new build blocking until the operation is complete using the supplied *cloudbuild.Client. Prefer this variant in unit tests where the client is backed by a mock gRPC server. The ctx parameter supports cancellation and timeouts.

func CreateStorageBucket deprecated

func CreateStorageBucket(t testing.TestingT, projectID string, name string, attr *storage.BucketAttrs)

CreateStorageBucket creates a Google Cloud bucket with the given BucketAttrs. Note that Google Storage bucket names must be globally unique. This will fail the test if there is an error.

Deprecated: Use CreateStorageBucketContext instead.

func CreateStorageBucketContext added in v1.0.0

func CreateStorageBucketContext(t testing.TestingT, ctx context.Context, projectID string, name string, attr *storage.BucketAttrs)

CreateStorageBucketContext creates a Google Cloud bucket with the given BucketAttrs. Note that Google Storage bucket names must be globally unique. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func CreateStorageBucketContextE added in v1.0.0

func CreateStorageBucketContextE(t testing.TestingT, ctx context.Context, projectID string, name string, attr *storage.BucketAttrs) error

CreateStorageBucketContextE creates a Google Cloud bucket with the given BucketAttrs. Note that Google Storage bucket names must be globally unique. The ctx parameter supports cancellation and timeouts.

func CreateStorageBucketE deprecated

func CreateStorageBucketE(t testing.TestingT, projectID string, name string, attr *storage.BucketAttrs) error

CreateStorageBucketE creates a Google Cloud bucket with the given BucketAttrs. Note that Google Storage bucket names must be globally unique.

Deprecated: Use CreateStorageBucketContextE instead.

func CreateStorageBucketWithClient added in v1.0.0

func CreateStorageBucketWithClient(ctx context.Context, client *storage.Client, projectID string, name string, attr *storage.BucketAttrs) error

CreateStorageBucketWithClient creates a Google Cloud bucket with the given BucketAttrs using the supplied *storage.Client. Prefer this variant in unit tests where the client is backed by an httptest fake server (see storage_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func CreateSubscription deprecated added in v1.0.0

func CreateSubscription(t testing.TestingT, projectID string, subscriptionName string, topicName string)

CreateSubscription creates a new Pub/Sub subscription on the given topic and fails the test if it cannot.

Deprecated: Use CreateSubscriptionContext instead.

func CreateSubscriptionContext added in v1.0.0

func CreateSubscriptionContext(t testing.TestingT, ctx context.Context, projectID string, subscriptionName string, topicName string)

CreateSubscriptionContext creates a new Pub/Sub subscription on the given topic and fails the test if it cannot. The ctx parameter supports cancellation and timeouts.

func CreateSubscriptionContextE added in v1.0.0

func CreateSubscriptionContextE(t testing.TestingT, ctx context.Context, projectID string, subscriptionName string, topicName string) error

CreateSubscriptionContextE creates a new Pub/Sub subscription on the given topic and returns an error if it fails. The ctx parameter supports cancellation and timeouts.

func CreateSubscriptionE deprecated added in v1.0.0

func CreateSubscriptionE(t testing.TestingT, projectID string, subscriptionName string, topicName string) error

CreateSubscriptionE creates a new Pub/Sub subscription on the given topic and returns an error if it fails.

Deprecated: Use CreateSubscriptionContextE instead.

func CreateSubscriptionWithClient added in v1.0.0

func CreateSubscriptionWithClient(ctx context.Context, client *pubsub.Client, subscriptionName string, topicName string) error

CreateSubscriptionWithClient creates a new Pub/Sub subscription on the given topic using the supplied *pubsub.Client. Prefer this variant in unit tests where the client is backed by a pstest in-memory fake server (see pubsub_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func CreateTopic deprecated added in v1.0.0

func CreateTopic(t testing.TestingT, projectID string, topicName string)

CreateTopic creates a new Pub/Sub topic and fails the test if it cannot.

Deprecated: Use CreateTopicContext instead.

func CreateTopicContext added in v1.0.0

func CreateTopicContext(t testing.TestingT, ctx context.Context, projectID string, topicName string)

CreateTopicContext creates a new Pub/Sub topic and fails the test if it cannot. The ctx parameter supports cancellation and timeouts.

func CreateTopicContextE added in v1.0.0

func CreateTopicContextE(t testing.TestingT, ctx context.Context, projectID string, topicName string) error

CreateTopicContextE creates a new Pub/Sub topic and returns an error if it fails. The ctx parameter supports cancellation and timeouts.

func CreateTopicE deprecated added in v1.0.0

func CreateTopicE(t testing.TestingT, projectID string, topicName string) error

CreateTopicE creates a new Pub/Sub topic and returns an error if it fails.

Deprecated: Use CreateTopicContextE instead.

func CreateTopicWithClient added in v1.0.0

func CreateTopicWithClient(ctx context.Context, client *pubsub.Client, topicName string) error

CreateTopicWithClient creates a new Pub/Sub topic using the supplied *pubsub.Client. Prefer this variant in unit tests where the client is backed by a pstest in-memory fake server (see pubsub_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func DeleteGCRImageRef deprecated added in v0.23.4

func DeleteGCRImageRef(t testing.TestingT, ref string)

DeleteGCRImageRef deletes a single repo image ref/digest. This will fail the test if there is an error.

Deprecated: Use DeleteGCRImageRefContext instead.

func DeleteGCRImageRefContext added in v1.0.0

func DeleteGCRImageRefContext(t testing.TestingT, ctx context.Context, ref string)

DeleteGCRImageRefContext deletes a single repo image ref/digest. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func DeleteGCRImageRefContextE added in v1.0.0

func DeleteGCRImageRefContextE(t testing.TestingT, ctx context.Context, ref string) error

DeleteGCRImageRefContextE deletes a single repo image ref/digest. The ctx parameter supports cancellation and timeouts.

func DeleteGCRImageRefE deprecated added in v0.23.4

func DeleteGCRImageRefE(t testing.TestingT, ref string) error

DeleteGCRImageRefE deletes a single repo image ref/digest.

Deprecated: Use DeleteGCRImageRefContextE instead.

func DeleteGCRImageRefWithClient added in v1.0.0

func DeleteGCRImageRefWithClient(ctx context.Context, client *GCRClient, ref string) error

DeleteGCRImageRefWithClient deletes a single repo image ref/digest using the supplied client. Prefer this variant in unit tests where the client's Transport points at an httptest fake server (see gcr_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func DeleteGCRRepo deprecated added in v0.23.4

func DeleteGCRRepo(t testing.TestingT, repo string)

DeleteGCRRepo deletes a GCR repository including all tagged images. This will fail the test if there is an error.

Deprecated: Use DeleteGCRRepoContext instead.

func DeleteGCRRepoContext added in v1.0.0

func DeleteGCRRepoContext(t testing.TestingT, ctx context.Context, repo string)

DeleteGCRRepoContext deletes a GCR repository including all tagged images. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func DeleteGCRRepoContextE added in v1.0.0

func DeleteGCRRepoContextE(t testing.TestingT, ctx context.Context, repo string) error

DeleteGCRRepoContextE deletes a GCR repository including all tagged images. The ctx parameter supports cancellation and timeouts.

func DeleteGCRRepoE deprecated added in v0.23.4

func DeleteGCRRepoE(t testing.TestingT, repo string) error

DeleteGCRRepoE deletes a GCR repository including all tagged images.

Deprecated: Use DeleteGCRRepoContextE instead.

func DeleteGCRRepoWithClient added in v1.0.0

func DeleteGCRRepoWithClient(ctx context.Context, client *GCRClient, repo string) error

DeleteGCRRepoWithClient deletes a GCR repository including all tagged images using the supplied client. Prefer this variant in unit tests where the client's Transport points at an httptest fake server (see gcr_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func DeleteSSHKey deprecated added in v0.15.7

func DeleteSSHKey(t testing.TestingT, user, key string)

DeleteSSHKey will delete an SSH key attached to the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key that was uploaded. This will fail the test if there is an error.

Deprecated: Use DeleteSSHKeyContext instead.

func DeleteSSHKeyContext added in v1.0.0

func DeleteSSHKeyContext(t testing.TestingT, ctx context.Context, user, key string)

DeleteSSHKeyContext will delete an SSH key attached to the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key that was uploaded. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func DeleteSSHKeyContextE added in v1.0.0

func DeleteSSHKeyContextE(t testing.TestingT, ctx context.Context, user, key string) error

DeleteSSHKeyContextE will delete an SSH key attached to the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key that was uploaded. The ctx parameter supports cancellation and timeouts.

func DeleteSSHKeyE deprecated added in v0.15.7

func DeleteSSHKeyE(t testing.TestingT, user, key string) error

DeleteSSHKeyE will delete an SSH key attached to the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key that was uploaded.

Deprecated: Use DeleteSSHKeyContextE instead.

func DeleteSSHKeyWithClient added in v1.0.0

func DeleteSSHKeyWithClient(ctx context.Context, service *oslogin.Service, user, key string) error

DeleteSSHKeyWithClient deletes an SSH key attached to the provided user identity using the supplied *oslogin.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see oslogin_unit_test.go for the pattern). The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key that was uploaded. The ctx parameter supports cancellation and timeouts.

func DeleteStorageBucket deprecated

func DeleteStorageBucket(t testing.TestingT, name string)

DeleteStorageBucket destroys the Google Storage bucket. This will fail the test if there is an error.

Deprecated: Use DeleteStorageBucketContext instead.

func DeleteStorageBucketContext added in v1.0.0

func DeleteStorageBucketContext(t testing.TestingT, ctx context.Context, name string)

DeleteStorageBucketContext destroys the Google Storage bucket. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func DeleteStorageBucketContextE added in v1.0.0

func DeleteStorageBucketContextE(t testing.TestingT, ctx context.Context, name string) error

DeleteStorageBucketContextE destroys the Google Cloud Storage bucket with the given name. The ctx parameter supports cancellation and timeouts.

func DeleteStorageBucketE deprecated

func DeleteStorageBucketE(t testing.TestingT, name string) error

DeleteStorageBucketE destroys the Google Cloud Storage bucket with the given name.

Deprecated: Use DeleteStorageBucketContextE instead.

func DeleteStorageBucketWithClient added in v1.0.0

func DeleteStorageBucketWithClient(ctx context.Context, client *storage.Client, name string) error

DeleteStorageBucketWithClient destroys the Google Cloud Storage bucket with the given name using the supplied *storage.Client. Prefer this variant in unit tests where the client is backed by an httptest fake server (see storage_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func DeleteSubscription deprecated added in v1.0.0

func DeleteSubscription(t testing.TestingT, projectID string, subscriptionName string)

DeleteSubscription deletes the given Pub/Sub subscription and fails the test if it cannot.

Deprecated: Use DeleteSubscriptionContext instead.

func DeleteSubscriptionContext added in v1.0.0

func DeleteSubscriptionContext(t testing.TestingT, ctx context.Context, projectID string, subscriptionName string)

DeleteSubscriptionContext deletes the given Pub/Sub subscription and fails the test if it cannot. The ctx parameter supports cancellation and timeouts.

func DeleteSubscriptionContextE added in v1.0.0

func DeleteSubscriptionContextE(t testing.TestingT, ctx context.Context, projectID string, subscriptionName string) error

DeleteSubscriptionContextE deletes the given Pub/Sub subscription and returns an error if it fails. The ctx parameter supports cancellation and timeouts.

func DeleteSubscriptionE deprecated added in v1.0.0

func DeleteSubscriptionE(t testing.TestingT, projectID string, subscriptionName string) error

DeleteSubscriptionE deletes the given Pub/Sub subscription and returns an error if it fails.

Deprecated: Use DeleteSubscriptionContextE instead.

func DeleteSubscriptionWithClient added in v1.0.0

func DeleteSubscriptionWithClient(ctx context.Context, client *pubsub.Client, subscriptionName string) error

DeleteSubscriptionWithClient deletes the given Pub/Sub subscription using the supplied *pubsub.Client. Prefer this variant in unit tests where the client is backed by a pstest in-memory fake server (see pubsub_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func DeleteTopic deprecated added in v1.0.0

func DeleteTopic(t testing.TestingT, projectID string, topicName string)

DeleteTopic deletes the given Pub/Sub topic and fails the test if it cannot.

Deprecated: Use DeleteTopicContext instead.

func DeleteTopicContext added in v1.0.0

func DeleteTopicContext(t testing.TestingT, ctx context.Context, projectID string, topicName string)

DeleteTopicContext deletes the given Pub/Sub topic and fails the test if it cannot. The ctx parameter supports cancellation and timeouts.

func DeleteTopicContextE added in v1.0.0

func DeleteTopicContextE(t testing.TestingT, ctx context.Context, projectID string, topicName string) error

DeleteTopicContextE deletes the given Pub/Sub topic and returns an error if it fails. The ctx parameter supports cancellation and timeouts.

func DeleteTopicE deprecated added in v1.0.0

func DeleteTopicE(t testing.TestingT, projectID string, topicName string) error

DeleteTopicE deletes the given Pub/Sub topic and returns an error if it fails.

Deprecated: Use DeleteTopicContextE instead.

func DeleteTopicWithClient added in v1.0.0

func DeleteTopicWithClient(ctx context.Context, client *pubsub.Client, topicName string) error

DeleteTopicWithClient deletes the given Pub/Sub topic using the supplied *pubsub.Client. Prefer this variant in unit tests where the client is backed by a pstest in-memory fake server (see pubsub_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func EmptyStorageBucket deprecated

func EmptyStorageBucket(t testing.TestingT, name string)

EmptyStorageBucket removes the contents of a storage bucket with the given name. This will fail the test if there is an error.

Deprecated: Use EmptyStorageBucketContext instead.

func EmptyStorageBucketContext added in v1.0.0

func EmptyStorageBucketContext(t testing.TestingT, ctx context.Context, name string)

EmptyStorageBucketContext removes the contents of a storage bucket with the given name. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func EmptyStorageBucketContextE added in v1.0.0

func EmptyStorageBucketContextE(t testing.TestingT, ctx context.Context, name string) error

EmptyStorageBucketContextE removes the contents of a storage bucket with the given name. The ctx parameter supports cancellation and timeouts.

func EmptyStorageBucketE deprecated

func EmptyStorageBucketE(t testing.TestingT, name string) error

EmptyStorageBucketE removes the contents of a storage bucket with the given name.

Deprecated: Use EmptyStorageBucketContextE instead.

func EmptyStorageBucketWithClient added in v1.0.0

func EmptyStorageBucketWithClient(ctx context.Context, client *storage.Client, name string) error

EmptyStorageBucketWithClient removes the contents of a storage bucket with the given name using the supplied *storage.Client. Prefer this variant in unit tests where the client is backed by an httptest fake server (see storage_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func GetAllGCPRegions deprecated added in v1.0.0

func GetAllGCPRegions(t testing.TestingT, projectID string) []string

GetAllGCPRegions gets the list of GCP regions available in this account. This will fail the test if there is an error.

Deprecated: Use GetAllGCPRegionsContext instead.

func GetAllGCPRegionsContext added in v1.0.0

func GetAllGCPRegionsContext(t testing.TestingT, ctx context.Context, projectID string) []string

GetAllGCPRegionsContext gets the list of GCP regions available in this account. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetAllGCPRegionsContextE added in v1.0.0

func GetAllGCPRegionsContextE(t testing.TestingT, ctx context.Context, projectID string) ([]string, error)

GetAllGCPRegionsContextE gets the list of GCP regions available in this account. The ctx parameter supports cancellation and timeouts.

func GetAllGCPRegionsE deprecated added in v1.0.0

func GetAllGCPRegionsE(t testing.TestingT, projectID string) ([]string, error)

GetAllGCPRegionsE gets the list of GCP regions available in this account.

Deprecated: Use GetAllGCPRegionsContextE instead.

func GetAllGCPRegionsWithClient added in v1.0.0

func GetAllGCPRegionsWithClient(ctx context.Context, service *compute.Service, projectID string) ([]string, error)

GetAllGCPRegionsWithClient gets the list of GCP regions available in this account using the supplied *compute.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see region_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func GetAllGCPZones deprecated added in v1.0.0

func GetAllGCPZones(t testing.TestingT, projectID string) []string

GetAllGCPZones gets the list of GCP Zones available in this account. This will fail the test if there is an error.

Deprecated: Use GetAllGCPZonesContext instead.

func GetAllGCPZonesContext added in v1.0.0

func GetAllGCPZonesContext(t testing.TestingT, ctx context.Context, projectID string) []string

GetAllGCPZonesContext gets the list of GCP Zones available in this account. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetAllGCPZonesContextE added in v1.0.0

func GetAllGCPZonesContextE(t testing.TestingT, ctx context.Context, projectID string) ([]string, error)

GetAllGCPZonesContextE gets the list of GCP Zones available in this account. The ctx parameter supports cancellation and timeouts.

func GetAllGCPZonesE deprecated added in v1.0.0

func GetAllGCPZonesE(t testing.TestingT, projectID string) ([]string, error)

GetAllGCPZonesE gets the list of GCP Zones available in this account.

Deprecated: Use GetAllGCPZonesContextE instead.

func GetAllGCPZonesWithClient added in v1.0.0

func GetAllGCPZonesWithClient(ctx context.Context, service *compute.Service, projectID string) ([]string, error)

GetAllGCPZonesWithClient gets the list of GCP Zones available in this account using the supplied *compute.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see region_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func GetAllGcpRegions deprecated

func GetAllGcpRegions(t testing.TestingT, projectID string) []string

GetAllGcpRegions gets the list of GCP regions available in this account. This will fail the test if there is an error.

Deprecated: Use GetAllGCPRegionsContext instead.

func GetAllGcpRegionsContext deprecated added in v1.0.0

func GetAllGcpRegionsContext(t testing.TestingT, ctx context.Context, projectID string) []string

GetAllGcpRegionsContext gets the list of GCP regions available in this account. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

Deprecated: Use GetAllGCPRegionsContext instead.

func GetAllGcpRegionsContextE deprecated added in v1.0.0

func GetAllGcpRegionsContextE(t testing.TestingT, ctx context.Context, projectID string) ([]string, error)

GetAllGcpRegionsContextE gets the list of GCP regions available in this account. The ctx parameter supports cancellation and timeouts.

Deprecated: Use GetAllGCPRegionsContextE instead.

func GetAllGcpRegionsE deprecated

func GetAllGcpRegionsE(t testing.TestingT, projectID string) ([]string, error)

GetAllGcpRegionsE gets the list of GCP regions available in this account.

Deprecated: Use GetAllGCPRegionsContextE instead.

func GetAllGcpZones deprecated

func GetAllGcpZones(t testing.TestingT, projectID string) []string

GetAllGcpZones gets the list of GCP Zones available in this account. This will fail the test if there is an error.

Deprecated: Use GetAllGCPZonesContext instead.

func GetAllGcpZonesContext deprecated added in v1.0.0

func GetAllGcpZonesContext(t testing.TestingT, ctx context.Context, projectID string) []string

GetAllGcpZonesContext gets the list of GCP Zones available in this account. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

Deprecated: Use GetAllGCPZonesContext instead.

func GetAllGcpZonesContextE deprecated added in v1.0.0

func GetAllGcpZonesContextE(t testing.TestingT, ctx context.Context, projectID string) ([]string, error)

GetAllGcpZonesContextE gets the list of GCP Zones available in this account. The ctx parameter supports cancellation and timeouts.

Deprecated: Use GetAllGCPZonesContextE instead.

func GetAllGcpZonesE deprecated

func GetAllGcpZonesE(t testing.TestingT, projectID string) ([]string, error)

GetAllGcpZonesE gets the list of GCP Zones available in this account.

Deprecated: Use GetAllGCPZonesContextE instead.

func GetBuild deprecated added in v0.23.4

func GetBuild(t testing.TestingT, projectID string, buildID string) *cloudbuildpb.Build

GetBuild gets the given build. This will fail the test if there is an error.

Deprecated: Use GetBuildContext instead.

func GetBuildContext added in v1.0.0

func GetBuildContext(t testing.TestingT, ctx context.Context, projectID string, buildID string) *cloudbuildpb.Build

GetBuildContext gets the given build. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetBuildContextE added in v1.0.0

func GetBuildContextE(t testing.TestingT, ctx context.Context, projectID string, buildID string) (*cloudbuildpb.Build, error)

GetBuildContextE gets the given build. The ctx parameter supports cancellation and timeouts.

func GetBuildE deprecated added in v0.23.4

func GetBuildE(t testing.TestingT, projectID string, buildID string) (*cloudbuildpb.Build, error)

GetBuildE gets the given build.

Deprecated: Use GetBuildContextE instead.

func GetBuildWithClient added in v1.0.0

func GetBuildWithClient(ctx context.Context, service *cloudbuild.Client, projectID string, buildID string) (*cloudbuildpb.Build, error)

GetBuildWithClient gets the given build using the supplied *cloudbuild.Client. Prefer this variant in unit tests where the client is backed by a mock gRPC server. The ctx parameter supports cancellation and timeouts.

func GetBuilds deprecated added in v0.23.4

func GetBuilds(t testing.TestingT, projectID string) []*cloudbuildpb.Build

GetBuilds gets the list of builds for a given project. This will fail the test if there is an error.

Deprecated: Use GetBuildsContext instead.

func GetBuildsContext added in v1.0.0

func GetBuildsContext(t testing.TestingT, ctx context.Context, projectID string) []*cloudbuildpb.Build

GetBuildsContext gets the list of builds for a given project. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetBuildsContextE added in v1.0.0

func GetBuildsContextE(t testing.TestingT, ctx context.Context, projectID string) ([]*cloudbuildpb.Build, error)

GetBuildsContextE gets the list of builds for a given project. The ctx parameter supports cancellation and timeouts.

func GetBuildsE deprecated added in v0.23.4

func GetBuildsE(t testing.TestingT, projectID string) ([]*cloudbuildpb.Build, error)

GetBuildsE gets the list of builds for a given project.

Deprecated: Use GetBuildsContextE instead.

func GetBuildsForTrigger deprecated added in v0.23.4

func GetBuildsForTrigger(t testing.TestingT, projectID string, triggerID string) []*cloudbuildpb.Build

GetBuildsForTrigger gets a list of builds for a specific cloud build trigger. This will fail the test if there is an error.

Deprecated: Use GetBuildsForTriggerContext instead.

func GetBuildsForTriggerContext added in v1.0.0

func GetBuildsForTriggerContext(t testing.TestingT, ctx context.Context, projectID string, triggerID string) []*cloudbuildpb.Build

GetBuildsForTriggerContext gets a list of builds for a specific cloud build trigger. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetBuildsForTriggerContextE added in v1.0.0

func GetBuildsForTriggerContextE(t testing.TestingT, ctx context.Context, projectID string, triggerID string) ([]*cloudbuildpb.Build, error)

GetBuildsForTriggerContextE gets a list of builds for a specific cloud build trigger. The ctx parameter supports cancellation and timeouts.

func GetBuildsForTriggerE deprecated added in v0.23.4

func GetBuildsForTriggerE(t testing.TestingT, projectID string, triggerID string) ([]*cloudbuildpb.Build, error)

GetBuildsForTriggerE gets a list of builds for a specific cloud build trigger.

Deprecated: Use GetBuildsForTriggerContextE instead.

func GetBuildsForTriggerWithClient added in v1.0.0

func GetBuildsForTriggerWithClient(ctx context.Context, service *cloudbuild.Client, projectID string, triggerID string) ([]*cloudbuildpb.Build, error)

GetBuildsForTriggerWithClient gets a list of builds for a specific cloud build trigger using the supplied *cloudbuild.Client. Prefer this variant in unit tests where the client is backed by a mock gRPC server. The ctx parameter supports cancellation and timeouts.

func GetBuildsWithClient added in v1.0.0

func GetBuildsWithClient(ctx context.Context, service *cloudbuild.Client, projectID string) ([]*cloudbuildpb.Build, error)

GetBuildsWithClient gets the list of builds for a given project using the supplied *cloudbuild.Client. Prefer this variant in unit tests where the client is backed by a mock gRPC server. The ctx parameter supports cancellation and timeouts.

func GetGoogleCredentialsFromEnvVar

func GetGoogleCredentialsFromEnvVar(t testing.TestingT) string

GetGoogleCredentialsFromEnvVar returns the Credentials for use with testing.

func GetGoogleIdentityEmailEnvVar added in v0.14.4

func GetGoogleIdentityEmailEnvVar(t testing.TestingT) string

GetGoogleIdentityEmailEnvVar returns a Google identity (user) for use with testing.

func GetGoogleProjectIDFromEnvVar

func GetGoogleProjectIDFromEnvVar(t testing.TestingT) string

GetGoogleProjectIDFromEnvVar returns the Project Id for use with testing.

func GetGoogleRegionFromEnvVar

func GetGoogleRegionFromEnvVar(t testing.TestingT) string

GetGoogleRegionFromEnvVar returns the Region for use with testing.

func GetLoginProfile deprecated added in v0.14.4

func GetLoginProfile(t testing.TestingT, user string) *oslogin.LoginProfile

GetLoginProfile will retrieve the login profile for a user's Google identity. The login profile is a combination of OS Login + gcloud SSH keys and POSIX accounts the user will appear as. Generally, this will only be the OS Login key + account, but gcloud compute ssh could create temporary keys and profiles. The user parameter should be the email address of the user. This will fail the test if there is an error.

Deprecated: Use GetLoginProfileContext instead.

func GetLoginProfileContext added in v1.0.0

func GetLoginProfileContext(t testing.TestingT, ctx context.Context, user string) *oslogin.LoginProfile

GetLoginProfileContext will retrieve the login profile for a user's Google identity. The login profile is a combination of OS Login + gcloud SSH keys and POSIX accounts the user will appear as. Generally, this will only be the OS Login key + account, but gcloud compute ssh could create temporary keys and profiles. The user parameter should be the email address of the user. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetLoginProfileContextE added in v1.0.0

func GetLoginProfileContextE(t testing.TestingT, ctx context.Context, user string) (*oslogin.LoginProfile, error)

GetLoginProfileContextE will retrieve the login profile for a user's Google identity. The login profile is a combination of OS Login + gcloud SSH keys and POSIX accounts the user will appear as. Generally, this will only be the OS Login key + account, but gcloud compute ssh could create temporary keys and profiles. The user parameter should be the email address of the user. The ctx parameter supports cancellation and timeouts.

func GetLoginProfileE deprecated added in v0.14.4

func GetLoginProfileE(t testing.TestingT, user string) (*oslogin.LoginProfile, error)

GetLoginProfileE will retrieve the login profile for a user's Google identity. The login profile is a combination of OS Login + gcloud SSH keys and POSIX accounts the user will appear as. Generally, this will only be the OS Login key + account, but gcloud compute ssh could create temporary keys and profiles. The user parameter should be the email address of the user.

Deprecated: Use GetLoginProfileContextE instead.

func GetLoginProfileWithClient added in v1.0.0

func GetLoginProfileWithClient(ctx context.Context, service *oslogin.Service, user string) (*oslogin.LoginProfile, error)

GetLoginProfileWithClient retrieves the login profile for a user's Google identity using the supplied *oslogin.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see oslogin_unit_test.go for the pattern). The user parameter should be the email address of the user. The ctx parameter supports cancellation and timeouts.

func GetRandomRegion deprecated

func GetRandomRegion(t testing.TestingT, projectID string, approvedRegions []string, forbiddenRegions []string) string

GetRandomRegion gets a randomly chosen GCP Region. If approvedRegions is not empty, this will be a Region from the approvedRegions list; otherwise, this method will fetch the latest list of regions from the GCP APIs and pick one of those. If forbiddenRegions is not empty, this method will make sure the returned Region is not in the forbiddenRegions list. This will fail the test if there is an error.

Deprecated: Use GetRandomRegionContext instead.

func GetRandomRegionContext added in v1.0.0

func GetRandomRegionContext(t testing.TestingT, ctx context.Context, projectID string, approvedRegions []string, forbiddenRegions []string) string

GetRandomRegionContext gets a randomly chosen GCP Region. If approvedRegions is not empty, this will be a Region from the approvedRegions list; otherwise, this method will fetch the latest list of regions from the GCP APIs and pick one of those. If forbiddenRegions is not empty, this method will make sure the returned Region is not in the forbiddenRegions list. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetRandomRegionContextE added in v1.0.0

func GetRandomRegionContextE(t testing.TestingT, ctx context.Context, projectID string, approvedRegions []string, forbiddenRegions []string) (string, error)

GetRandomRegionContextE gets a randomly chosen GCP Region. If approvedRegions is not empty, this will be a Region from the approvedRegions list; otherwise, this method will fetch the latest list of regions from the GCP APIs and pick one of those. If forbiddenRegions is not empty, this method will make sure the returned Region is not in the forbiddenRegions list. The ctx parameter supports cancellation and timeouts.

func GetRandomRegionE deprecated

func GetRandomRegionE(t testing.TestingT, projectID string, approvedRegions []string, forbiddenRegions []string) (string, error)

GetRandomRegionE gets a randomly chosen GCP Region. If approvedRegions is not empty, this will be a Region from the approvedRegions list; otherwise, this method will fetch the latest list of regions from the GCP APIs and pick one of those. If forbiddenRegions is not empty, this method will make sure the returned Region is not in the forbiddenRegions list.

Deprecated: Use GetRandomRegionContextE instead.

func GetRandomZone deprecated

func GetRandomZone(t testing.TestingT, projectID string, approvedZones []string, forbiddenZones []string, forbiddenRegions []string) string

GetRandomZone gets a randomly chosen GCP Zone. If approvedZones is not empty, this will be a Zone from the approvedZones list; otherwise, this method will fetch the latest list of Zones from the GCP APIs and pick one of those. If forbiddenZones is not empty, this method will make sure the returned Zone is not in the forbiddenZones list. This will fail the test if there is an error.

Deprecated: Use GetRandomZoneContext instead.

func GetRandomZoneContext added in v1.0.0

func GetRandomZoneContext(t testing.TestingT, ctx context.Context, projectID string, approvedZones []string, forbiddenZones []string, forbiddenRegions []string) string

GetRandomZoneContext gets a randomly chosen GCP Zone. If approvedZones is not empty, this will be a Zone from the approvedZones list; otherwise, this method will fetch the latest list of Zones from the GCP APIs and pick one of those. If forbiddenZones is not empty, this method will make sure the returned Zone is not in the forbiddenZones list. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetRandomZoneContextE added in v1.0.0

func GetRandomZoneContextE(t testing.TestingT, ctx context.Context, projectID string, approvedZones []string, forbiddenZones []string, forbiddenRegions []string) (string, error)

GetRandomZoneContextE gets a randomly chosen GCP Zone. If approvedZones is not empty, this will be a Zone from the approvedZones list; otherwise, this method will fetch the latest list of Zones from the GCP APIs and pick one of those. If forbiddenZones is not empty, this method will make sure the returned Zone is not in the forbiddenZones list. The ctx parameter supports cancellation and timeouts.

func GetRandomZoneE deprecated

func GetRandomZoneE(t testing.TestingT, projectID string, approvedZones []string, forbiddenZones []string, forbiddenRegions []string) (string, error)

GetRandomZoneE gets a randomly chosen GCP Zone. If approvedZones is not empty, this will be a Zone from the approvedZones list; otherwise, this method will fetch the latest list of Zones from the GCP APIs and pick one of those. If forbiddenZones is not empty, this method will make sure the returned Zone is not in the forbiddenZones list.

Deprecated: Use GetRandomZoneContextE instead.

func GetRandomZoneForRegion deprecated added in v0.11.0

func GetRandomZoneForRegion(t testing.TestingT, projectID string, region string) string

GetRandomZoneForRegion gets a randomly chosen GCP Zone in the given Region. This will fail the test if there is an error.

Deprecated: Use GetRandomZoneForRegionContext instead.

func GetRandomZoneForRegionContext added in v1.0.0

func GetRandomZoneForRegionContext(t testing.TestingT, ctx context.Context, projectID string, region string) string

GetRandomZoneForRegionContext gets a randomly chosen GCP Zone in the given Region. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func GetRandomZoneForRegionContextE added in v1.0.0

func GetRandomZoneForRegionContextE(t testing.TestingT, ctx context.Context, projectID string, region string) (string, error)

GetRandomZoneForRegionContextE gets a randomly chosen GCP Zone in the given Region. The ctx parameter supports cancellation and timeouts.

func GetRandomZoneForRegionE deprecated added in v0.11.0

func GetRandomZoneForRegionE(t testing.TestingT, projectID string, region string) (string, error)

GetRandomZoneForRegionE gets a randomly chosen GCP Zone in the given Region.

Deprecated: Use GetRandomZoneForRegionContextE instead.

func ImportProjectSSHKey deprecated added in v0.48.2

func ImportProjectSSHKey(t testing.TestingT, user, key, projectID string)

ImportProjectSSHKey will import an SSH key to GCP under the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key being uploaded. The projectID parameter should be the chosen project ID. This will fail the test if there is an error.

Deprecated: Use ImportProjectSSHKeyContext instead.

func ImportProjectSSHKeyContext added in v1.0.0

func ImportProjectSSHKeyContext(t testing.TestingT, ctx context.Context, user, key, projectID string)

ImportProjectSSHKeyContext will import an SSH key to GCP under the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key being uploaded. The projectID parameter should be the chosen project ID. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func ImportProjectSSHKeyContextE added in v1.0.0

func ImportProjectSSHKeyContextE(t testing.TestingT, ctx context.Context, user, key, projectID string) error

ImportProjectSSHKeyContextE will import an SSH key to GCP under the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key being uploaded. The projectID parameter should be the chosen project ID. The ctx parameter supports cancellation and timeouts.

func ImportProjectSSHKeyE deprecated added in v0.48.2

func ImportProjectSSHKeyE(t testing.TestingT, user, key, projectID string) error

ImportProjectSSHKeyE will import an SSH key to GCP under the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key being uploaded. The projectID parameter should be the chosen project ID.

Deprecated: Use ImportProjectSSHKeyContextE instead.

func ImportProjectSSHKeyWithClient added in v1.0.0

func ImportProjectSSHKeyWithClient(ctx context.Context, service *oslogin.Service, user, key, projectID string) error

ImportProjectSSHKeyWithClient imports an SSH key to GCP under the provided user identity, scoped to projectID, using the supplied *oslogin.Service. The ctx parameter supports cancellation and timeouts.

func ImportSSHKey deprecated added in v0.14.4

func ImportSSHKey(t testing.TestingT, user, key string)

ImportSSHKey will import an SSH key to GCP under the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key being uploaded. This will fail the test if there is an error.

Deprecated: Use ImportSSHKeyContext instead.

func ImportSSHKeyContext added in v1.0.0

func ImportSSHKeyContext(t testing.TestingT, ctx context.Context, user, key string)

ImportSSHKeyContext will import an SSH key to GCP under the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key being uploaded. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func ImportSSHKeyContextE added in v1.0.0

func ImportSSHKeyContextE(t testing.TestingT, ctx context.Context, user, key string) error

ImportSSHKeyContextE will import an SSH key to GCP under the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key being uploaded. The ctx parameter supports cancellation and timeouts.

func ImportSSHKeyE deprecated added in v0.14.4

func ImportSSHKeyE(t testing.TestingT, user, key string) error

ImportSSHKeyE will import an SSH key to GCP under the provided user identity. The user parameter should be the email address of the user. The key parameter should be the public key of the SSH key being uploaded.

Deprecated: Use ImportSSHKeyContextE instead.

func ImportSSHKeyWithClient added in v1.0.0

func ImportSSHKeyWithClient(ctx context.Context, service *oslogin.Service, user, key string) error

ImportSSHKeyWithClient imports an SSH key to GCP under the provided user identity using the supplied *oslogin.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see oslogin_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func NewCloudBuildService deprecated added in v0.23.4

func NewCloudBuildService(t testing.TestingT) *cloudbuild.Client

NewCloudBuildService creates a new Cloud Build service, which is used to make Cloud Build API calls. This will fail the test if there is an error.

Deprecated: Use NewCloudBuildServiceContext instead.

func NewCloudBuildServiceContext added in v1.0.0

func NewCloudBuildServiceContext(t testing.TestingT, ctx context.Context) *cloudbuild.Client

NewCloudBuildServiceContext creates a new Cloud Build service, which is used to make Cloud Build API calls. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func NewCloudBuildServiceContextE added in v1.0.0

func NewCloudBuildServiceContextE(t testing.TestingT, ctx context.Context) (*cloudbuild.Client, error)

NewCloudBuildServiceContextE creates a new Cloud Build service, which is used to make Cloud Build API calls. The ctx parameter supports cancellation and timeouts.

func NewCloudBuildServiceE deprecated added in v0.23.4

func NewCloudBuildServiceE(t testing.TestingT) (*cloudbuild.Client, error)

NewCloudBuildServiceE creates a new Cloud Build service, which is used to make Cloud Build API calls.

Deprecated: Use NewCloudBuildServiceContextE instead.

func NewComputeService deprecated

func NewComputeService(t testing.TestingT) *compute.Service

NewComputeService creates a new Compute service, which is used to make GCE API calls. This will fail the test if there is an error.

Deprecated: Use NewComputeServiceContext instead.

func NewComputeServiceContext added in v1.0.0

func NewComputeServiceContext(t testing.TestingT, ctx context.Context) *compute.Service

NewComputeServiceContext creates a new Compute service, which is used to make GCE API calls. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func NewComputeServiceContextE added in v1.0.0

func NewComputeServiceContextE(t testing.TestingT, ctx context.Context) (*compute.Service, error)

NewComputeServiceContextE creates a new Compute service, which is used to make GCE API calls. The ctx parameter supports cancellation and timeouts.

func NewComputeServiceE deprecated

func NewComputeServiceE(t testing.TestingT) (*compute.Service, error)

NewComputeServiceE creates a new Compute service, which is used to make GCE API calls.

Deprecated: Use NewComputeServiceContextE instead.

func NewInstancesService deprecated added in v0.13.3

func NewInstancesService(t testing.TestingT) *compute.InstancesService

NewInstancesService creates a new InstancesService, which is used to make a subset of GCE API calls. This will fail the test if there is an error.

Deprecated: Use NewInstancesServiceContext instead.

func NewInstancesServiceContext added in v1.0.0

func NewInstancesServiceContext(t testing.TestingT, ctx context.Context) *compute.InstancesService

NewInstancesServiceContext creates a new InstancesService, which is used to make a subset of GCE API calls. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func NewInstancesServiceContextE added in v1.0.0

func NewInstancesServiceContextE(t testing.TestingT, ctx context.Context) (*compute.InstancesService, error)

NewInstancesServiceContextE creates a new InstancesService, which is used to make a subset of GCE API calls. The ctx parameter supports cancellation and timeouts.

func NewInstancesServiceE deprecated added in v0.13.3

func NewInstancesServiceE(t testing.TestingT) (*compute.InstancesService, error)

NewInstancesServiceE creates a new InstancesService, which is used to make a subset of GCE API calls.

Deprecated: Use NewInstancesServiceContextE instead.

func NewMetadata added in v1.0.0

func NewMetadata(oldMetadata *compute.Metadata, kvs map[string]string) *compute.Metadata

NewMetadata merges new key-value pairs into existing metadata, preserving unmodified items.

func NewOSLoginServiceContextE added in v1.0.0

func NewOSLoginServiceContextE(t testing.TestingT, ctx context.Context) (*oslogin.Service, error)

NewOSLoginServiceContextE creates a new OS Login service, which is used to make OS Login API calls. The ctx parameter supports cancellation and timeouts.

func NewOSLoginServiceE deprecated added in v0.14.4

func NewOSLoginServiceE(t testing.TestingT) (*oslogin.Service, error)

NewOSLoginServiceE creates a new OS Login service, which is used to make OS Login API calls.

Deprecated: Use NewOSLoginServiceContextE instead.

func RandomValidGCPName added in v1.0.0

func RandomValidGCPName() string

RandomValidGCPName returns a random, valid name for GCP resources. Many resources in GCP require lowercase letters only.

func RandomValidGcpName deprecated added in v0.13.3

func RandomValidGcpName() string

RandomValidGcpName returns a random, valid name for GCP resources. Many resources in GCP require lowercase letters only.

Deprecated: Use RandomValidGCPName instead.

func ReadBucketObject deprecated

func ReadBucketObject(t testing.TestingT, bucketName string, filePath string) io.Reader

ReadBucketObject reads an object from the given Storage Bucket and returns its contents. This will fail the test if there is an error.

Deprecated: Use ReadBucketObjectContext instead.

func ReadBucketObjectContext added in v1.0.0

func ReadBucketObjectContext(t testing.TestingT, ctx context.Context, bucketName string, filePath string) io.Reader

ReadBucketObjectContext reads an object from the given Storage Bucket and returns its contents. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func ReadBucketObjectContextE added in v1.0.0

func ReadBucketObjectContextE(t testing.TestingT, ctx context.Context, bucketName string, filePath string) (io.Reader, error)

ReadBucketObjectContextE reads an object from the given Storage Bucket and returns its contents. The ctx parameter supports cancellation and timeouts.

func ReadBucketObjectE deprecated

func ReadBucketObjectE(t testing.TestingT, bucketName string, filePath string) (io.Reader, error)

ReadBucketObjectE reads an object from the given Storage Bucket and returns its contents.

Deprecated: Use ReadBucketObjectContextE instead.

func ReadBucketObjectWithClient added in v1.0.0

func ReadBucketObjectWithClient(ctx context.Context, client *storage.Client, bucketName string, filePath string) (io.Reader, error)

ReadBucketObjectWithClient reads an object from the given Storage Bucket and returns its contents using the supplied *storage.Client. Prefer this variant in unit tests where the client is backed by an httptest fake server (see storage_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func RegionURLToRegion added in v1.0.0

func RegionURLToRegion(regionURL string) string

RegionURLToRegion extracts the region name from a GCP Region URL formatted like https://www.googleapis.com/compute/v1/projects/project-123456/regions/southamerica-east1 and returns "southamerica-east1".

func RegionUrlToRegion deprecated added in v0.11.0

func RegionUrlToRegion(regionURL string) string

RegionUrlToRegion extracts the region name from a GCP Region URL.

Deprecated: Use RegionURLToRegion instead.

func WriteBucketObject deprecated

func WriteBucketObject(t testing.TestingT, bucketName string, filePath string, body io.Reader, contentType string) string

WriteBucketObject writes an object to the given Storage Bucket and returns its URL. This will fail the test if there is an error.

Deprecated: Use WriteBucketObjectContext instead.

func WriteBucketObjectContext added in v1.0.0

func WriteBucketObjectContext(t testing.TestingT, ctx context.Context, bucketName string, filePath string, body io.Reader, contentType string) string

WriteBucketObjectContext writes an object to the given Storage Bucket and returns its URL. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func WriteBucketObjectContextE added in v1.0.0

func WriteBucketObjectContextE(t testing.TestingT, ctx context.Context, bucketName string, filePath string, body io.Reader, contentType string) (string, error)

WriteBucketObjectContextE writes an object to the given Storage Bucket and returns its URL. The ctx parameter supports cancellation and timeouts.

func WriteBucketObjectE deprecated

func WriteBucketObjectE(t testing.TestingT, bucketName string, filePath string, body io.Reader, contentType string) (string, error)

WriteBucketObjectE writes an object to the given Storage Bucket and returns its URL.

Deprecated: Use WriteBucketObjectContextE instead.

func WriteBucketObjectWithClient added in v1.0.0

func WriteBucketObjectWithClient(ctx context.Context, client *storage.Client, bucketName string, filePath string, body io.Reader, contentType string) (string, error)

WriteBucketObjectWithClient writes an object to the given Storage Bucket and returns its URL using the supplied *storage.Client. Prefer this variant in unit tests where the client is backed by an httptest fake server (see storage_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func ZoneURLToZone added in v1.0.0

func ZoneURLToZone(zoneURL string) string

ZoneURLToZone extracts the zone name from a GCP Zone URL formatted like https://www.googleapis.com/compute/v1/projects/project-123456/zones/asia-east1-b and returns "asia-east1-b".

func ZoneUrlToZone deprecated added in v0.11.0

func ZoneUrlToZone(zoneURL string) string

ZoneUrlToZone extracts the zone name from a GCP Zone URL.

Deprecated: Use ZoneURLToZone instead.

Types

type GCRClient added in v1.0.0

type GCRClient struct {
	Authenticator authn.Authenticator
	Transport     http.RoundTripper
}

GCRClient bundles the credentials and transport the go-containerregistry library needs. It exists so that GCR helpers can follow terratest's (ctx, client, ...args) WithClient convention instead of exposing the two pieces separately. Transport is optional — nil uses the library default.

type Image added in v0.11.0

type Image struct {
	*compute.Image
	// contains filtered or unexported fields
}

Image represents a GCP Image (https://cloud.google.com/compute/docs/images).

func FetchImage deprecated added in v0.11.0

func FetchImage(t testing.TestingT, projectID string, name string) *Image

FetchImage queries GCP to return a new instance of the Compute Image type. This will fail the test if there is an error.

Deprecated: Use FetchImageContext instead.

func FetchImageContext added in v1.0.0

func FetchImageContext(t testing.TestingT, ctx context.Context, projectID string, name string) *Image

FetchImageContext queries GCP to return a new instance of the Compute Image type. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func FetchImageContextE added in v1.0.0

func FetchImageContextE(t testing.TestingT, ctx context.Context, projectID string, name string) (*Image, error)

FetchImageContextE queries GCP to return a new instance of the Compute Image type. The ctx parameter supports cancellation and timeouts.

func FetchImageE deprecated added in v0.11.0

func FetchImageE(t testing.TestingT, projectID string, name string) (*Image, error)

FetchImageE queries GCP to return a new instance of the Compute Image type.

Deprecated: Use FetchImageContextE instead.

func FetchImageWithClient added in v1.0.0

func FetchImageWithClient(ctx context.Context, service *compute.Service, projectID string, name string) (*Image, error)

FetchImageWithClient queries GCP to return a new instance of the Compute Image type using the supplied *compute.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see compute_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func (*Image) DeleteImage deprecated added in v0.11.0

func (i *Image) DeleteImage(t testing.TestingT)

DeleteImage deletes the given Compute Image. This will fail the test if there is an error.

Deprecated: Use Image.DeleteImageContext instead.

func (*Image) DeleteImageContext added in v1.0.0

func (i *Image) DeleteImageContext(t testing.TestingT, ctx context.Context)

DeleteImageContext deletes the given Compute Image. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*Image) DeleteImageContextE added in v1.0.0

func (i *Image) DeleteImageContextE(t testing.TestingT, ctx context.Context) error

DeleteImageContextE deletes the given Compute Image. The ctx parameter supports cancellation and timeouts.

func (*Image) DeleteImageE deprecated added in v0.11.0

func (i *Image) DeleteImageE(t testing.TestingT) error

DeleteImageE deletes the given Compute Image.

Deprecated: Use Image.DeleteImageContextE instead.

func (*Image) DeleteImageWithClient added in v1.0.0

func (i *Image) DeleteImageWithClient(ctx context.Context, service *compute.Service) error

DeleteImageWithClient deletes the given Compute Image using the supplied *compute.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see compute_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

type Instance added in v0.11.0

type Instance struct {
	*compute.Instance
	// contains filtered or unexported fields
}

Instance represents a GCP Compute Instance (https://cloud.google.com/compute/docs/instances/).

func FetchInstance deprecated added in v0.11.0

func FetchInstance(t testing.TestingT, projectID string, name string) *Instance

FetchInstance queries GCP to return an instance of the Compute Instance type. This will fail the test if there is an error.

Deprecated: Use FetchInstanceContext instead.

func FetchInstanceContext added in v1.0.0

func FetchInstanceContext(t testing.TestingT, ctx context.Context, projectID string, name string) *Instance

FetchInstanceContext queries GCP to return an instance of the Compute Instance type. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func FetchInstanceContextE added in v1.0.0

func FetchInstanceContextE(t testing.TestingT, ctx context.Context, projectID string, name string) (*Instance, error)

FetchInstanceContextE queries GCP to return an instance of the Compute Instance type. The ctx parameter supports cancellation and timeouts.

func FetchInstanceE deprecated added in v0.11.0

func FetchInstanceE(t testing.TestingT, projectID string, name string) (*Instance, error)

FetchInstanceE queries GCP to return an instance of the Compute Instance type.

Deprecated: Use FetchInstanceContextE instead.

func FetchInstanceWithClient added in v1.0.0

func FetchInstanceWithClient(ctx context.Context, service *compute.Service, projectID string, name string) (*Instance, error)

FetchInstanceWithClient queries GCP to return an instance of the Compute Instance type using the supplied *compute.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see compute_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func (*Instance) AddSSHKey deprecated added in v1.0.0

func (i *Instance) AddSSHKey(t testing.TestingT, username string, publicKey string)

AddSSHKey adds the given public SSH key to the Compute Instance. Users can SSH in with the given username. This will fail the test if there is an error.

Deprecated: Use Instance.AddSSHKeyContext instead.

func (*Instance) AddSSHKeyContext added in v1.0.0

func (i *Instance) AddSSHKeyContext(t testing.TestingT, ctx context.Context, username string, publicKey string)

AddSSHKeyContext adds the given public SSH key to the Compute Instance. Users can SSH in with the given username. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*Instance) AddSSHKeyContextE added in v1.0.0

func (i *Instance) AddSSHKeyContextE(t testing.TestingT, ctx context.Context, username string, publicKey string) error

AddSSHKeyContextE adds the given public SSH key to the Compute Instance. Users can SSH in with the given username. The ctx parameter supports cancellation and timeouts.

func (*Instance) AddSSHKeyE deprecated added in v1.0.0

func (i *Instance) AddSSHKeyE(t testing.TestingT, username string, publicKey string) error

AddSSHKeyE adds the given public SSH key to the Compute Instance. Users can SSH in with the given username.

Deprecated: Use Instance.AddSSHKeyContextE instead.

func (*Instance) AddSSHKeyWithClient added in v1.0.0

func (i *Instance) AddSSHKeyWithClient(ctx context.Context, service *compute.Service, username string, publicKey string) error

AddSSHKeyWithClient adds the given public SSH key to the Compute Instance using the supplied *compute.Service. Users can SSH in with the given username. Prefer this variant in unit tests where the service is backed by an httptest fake server (see compute_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func (*Instance) AddSshKey deprecated added in v0.13.3

func (i *Instance) AddSshKey(t testing.TestingT, username string, publicKey string)

AddSshKey adds the given public SSH key to the Compute Instance. Users can SSH in with the given username. This will fail the test if there is an error.

Deprecated: Use Instance.AddSSHKey instead.

func (*Instance) AddSshKeyE deprecated added in v0.13.3

func (i *Instance) AddSshKeyE(t testing.TestingT, username string, publicKey string) error

AddSshKeyE adds the given public SSH key to the Compute Instance. Users can SSH in with the given username.

Deprecated: Use Instance.AddSSHKeyE instead.

func (*Instance) GetLabels deprecated added in v0.11.0

func (i *Instance) GetLabels(t testing.TestingT) map[string]string

GetLabels returns all the tags for the given Compute Instance.

Deprecated: Use Instance.GetLabelsContext instead.

func (*Instance) GetLabelsContext added in v1.0.0

func (i *Instance) GetLabelsContext(t testing.TestingT, ctx context.Context) map[string]string

GetLabelsContext returns all the tags for the given Compute Instance. The ctx parameter supports cancellation and timeouts.

func (*Instance) GetLabelsContextE added in v1.0.0

func (i *Instance) GetLabelsContextE(t testing.TestingT, ctx context.Context) (map[string]string, error)

GetLabelsContextE returns all the tags for the given Compute Instance. The ctx parameter supports cancellation and timeouts.

func (*Instance) GetLabelsE deprecated added in v1.0.0

func (i *Instance) GetLabelsE(t testing.TestingT) (map[string]string, error)

GetLabelsE returns all the tags for the given Compute Instance.

Deprecated: Use Instance.GetLabelsContextE instead.

func (*Instance) GetMetadata deprecated added in v0.13.3

func (i *Instance) GetMetadata(t testing.TestingT) []*compute.MetadataItems

GetMetadata gets the given Compute Instance's metadata.

Deprecated: Use Instance.GetMetadataContext instead.

func (*Instance) GetMetadataContext added in v1.0.0

func (i *Instance) GetMetadataContext(t testing.TestingT, ctx context.Context) []*compute.MetadataItems

GetMetadataContext gets the given Compute Instance's metadata. The ctx parameter supports cancellation and timeouts.

func (*Instance) GetMetadataContextE added in v1.0.0

func (i *Instance) GetMetadataContextE(t testing.TestingT, ctx context.Context) ([]*compute.MetadataItems, error)

GetMetadataContextE gets the given Compute Instance's metadata. The ctx parameter supports cancellation and timeouts.

func (*Instance) GetMetadataE deprecated added in v1.0.0

func (i *Instance) GetMetadataE(t testing.TestingT) ([]*compute.MetadataItems, error)

GetMetadataE gets the given Compute Instance's metadata.

Deprecated: Use Instance.GetMetadataContextE instead.

func (*Instance) GetPublicIP deprecated added in v1.0.0

func (i *Instance) GetPublicIP(t testing.TestingT) string

GetPublicIP gets the public IP address of the given Compute Instance. This will fail the test if there is an error.

Deprecated: Use Instance.GetPublicIPContext instead.

func (*Instance) GetPublicIPContext added in v1.0.0

func (i *Instance) GetPublicIPContext(t testing.TestingT, ctx context.Context) string

GetPublicIPContext gets the public IP address of the given Compute Instance. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*Instance) GetPublicIPContextE added in v1.0.0

func (i *Instance) GetPublicIPContextE(t testing.TestingT, ctx context.Context) (string, error)

GetPublicIPContextE gets the public IP address of the given Compute Instance. The ctx parameter supports cancellation and timeouts. Returns an error (rather than panicking) when the instance has no network interfaces or the first interface has no accessConfigs — both indicate the instance has no external internet access (https://cloud.google.com/compute/docs/reference/rest/v1/instances).

func (*Instance) GetPublicIPE deprecated added in v1.0.0

func (i *Instance) GetPublicIPE(t testing.TestingT) (string, error)

GetPublicIPE gets the public IP address of the given Compute Instance.

Deprecated: Use Instance.GetPublicIPContextE instead.

func (*Instance) GetPublicIp deprecated added in v0.11.0

func (i *Instance) GetPublicIp(t testing.TestingT) string

GetPublicIp gets the public IP address of the given Compute Instance. This will fail the test if there is an error.

Deprecated: Use Instance.GetPublicIP instead.

func (*Instance) GetPublicIpE deprecated added in v0.11.0

func (i *Instance) GetPublicIpE(t testing.TestingT) (string, error)

GetPublicIpE gets the public IP address of the given Compute Instance.

Deprecated: Use Instance.GetPublicIPE instead.

func (*Instance) GetZone deprecated added in v0.11.0

func (i *Instance) GetZone(t testing.TestingT) string

GetZone returns the Zone in which the Compute Instance is located.

Deprecated: Use Instance.GetZoneContext instead.

func (*Instance) GetZoneContext added in v1.0.0

func (i *Instance) GetZoneContext(t testing.TestingT, ctx context.Context) string

GetZoneContext returns the Zone in which the Compute Instance is located. The ctx parameter supports cancellation and timeouts.

func (*Instance) GetZoneContextE added in v1.0.0

func (i *Instance) GetZoneContextE(t testing.TestingT, ctx context.Context) (string, error)

GetZoneContextE returns the Zone in which the Compute Instance is located. The ctx parameter supports cancellation and timeouts.

func (*Instance) GetZoneE deprecated added in v1.0.0

func (i *Instance) GetZoneE(t testing.TestingT) (string, error)

GetZoneE returns the Zone in which the Compute Instance is located.

Deprecated: Use Instance.GetZoneContextE instead.

func (*Instance) SetLabels deprecated added in v0.11.0

func (i *Instance) SetLabels(t testing.TestingT, labels map[string]string)

SetLabels adds the tags to the given Compute Instance. This will fail the test if there is an error.

Deprecated: Use Instance.SetLabelsContext instead.

func (*Instance) SetLabelsContext added in v1.0.0

func (i *Instance) SetLabelsContext(t testing.TestingT, ctx context.Context, labels map[string]string)

SetLabelsContext adds the tags to the given Compute Instance. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*Instance) SetLabelsContextE added in v1.0.0

func (i *Instance) SetLabelsContextE(t testing.TestingT, ctx context.Context, labels map[string]string) error

SetLabelsContextE adds the tags to the given Compute Instance. The ctx parameter supports cancellation and timeouts.

func (*Instance) SetLabelsE deprecated added in v0.11.0

func (i *Instance) SetLabelsE(t testing.TestingT, labels map[string]string) error

SetLabelsE adds the tags to the given Compute Instance.

Deprecated: Use Instance.SetLabelsContextE instead.

func (*Instance) SetLabelsWithClient added in v1.0.0

func (i *Instance) SetLabelsWithClient(ctx context.Context, service *compute.Service, labels map[string]string) error

SetLabelsWithClient merges the given labels into the instance's existing labels using the supplied *compute.Service. Keys present in labels overwrite existing values; other labels are preserved. Prefer this variant in unit tests where the service is backed by an httptest fake server (see compute_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func (*Instance) SetMetadata deprecated added in v0.13.3

func (i *Instance) SetMetadata(t testing.TestingT, metadata map[string]string)

SetMetadata sets the given Compute Instance's metadata. This will fail the test if there is an error.

Deprecated: Use Instance.SetMetadataContext instead.

func (*Instance) SetMetadataContext added in v1.0.0

func (i *Instance) SetMetadataContext(t testing.TestingT, ctx context.Context, metadata map[string]string)

SetMetadataContext sets the given Compute Instance's metadata. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*Instance) SetMetadataContextE added in v1.0.0

func (i *Instance) SetMetadataContextE(t testing.TestingT, ctx context.Context, metadata map[string]string) error

SetMetadataContextE adds the given metadata map to the existing metadata of the given Compute Instance. The ctx parameter supports cancellation and timeouts.

func (*Instance) SetMetadataE deprecated added in v0.13.3

func (i *Instance) SetMetadataE(t testing.TestingT, metadata map[string]string) error

SetMetadataE adds the given metadata map to the existing metadata of the given Compute Instance.

Deprecated: Use Instance.SetMetadataContextE instead.

func (*Instance) SetMetadataWithClient added in v1.0.0

func (i *Instance) SetMetadataWithClient(ctx context.Context, service *compute.Service, metadata map[string]string) error

SetMetadataWithClient adds the given metadata map to the existing metadata of the given Compute Instance using the supplied *compute.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see compute_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

type InstanceGroup added in v0.11.0

type InstanceGroup interface {
	// GetInstanceIDs gets the IDs of Instances in the given Instance Group.
	// This will fail the test if there is an error.
	GetInstanceIDs(t testing.TestingT) []string

	// GetInstanceIDsE gets the IDs of Instances in the given Instance Group.
	GetInstanceIDsE(t testing.TestingT) ([]string, error)

	// GetInstanceIDsContextE gets the IDs of Instances in the given Instance Group.
	// The ctx parameter supports cancellation and timeouts.
	GetInstanceIDsContextE(t testing.TestingT, ctx context.Context) ([]string, error)

	// Deprecated: Use [InstanceGroup.GetInstanceIDs] instead.
	GetInstanceIds(t testing.TestingT) []string //nolint:staticcheck,revive // preserving deprecated method name

	// Deprecated: Use [InstanceGroup.GetInstanceIDsE] instead.
	GetInstanceIdsE(t testing.TestingT) ([]string, error) //nolint:staticcheck,revive // preserving deprecated method name
}

InstanceGroup is an interface for instance groups that can return their instance IDs.

type RegionalInstanceGroup added in v0.11.0

type RegionalInstanceGroup struct {
	*compute.InstanceGroup
	// contains filtered or unexported fields
}

RegionalInstanceGroup represents a GCP Regional Instance Group (https://cloud.google.com/compute/docs/instance-groups/).

func FetchRegionalInstanceGroup deprecated added in v0.11.0

func FetchRegionalInstanceGroup(t testing.TestingT, projectID string, region string, name string) *RegionalInstanceGroup

FetchRegionalInstanceGroup queries GCP to return a new instance of the Regional Instance Group type. This will fail the test if there is an error.

Deprecated: Use FetchRegionalInstanceGroupContext instead.

func FetchRegionalInstanceGroupContext added in v1.0.0

func FetchRegionalInstanceGroupContext(t testing.TestingT, ctx context.Context, projectID string, region string, name string) *RegionalInstanceGroup

FetchRegionalInstanceGroupContext queries GCP to return a new instance of the Regional Instance Group type. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func FetchRegionalInstanceGroupContextE added in v1.0.0

func FetchRegionalInstanceGroupContextE(t testing.TestingT, ctx context.Context, projectID string, region string, name string) (*RegionalInstanceGroup, error)

FetchRegionalInstanceGroupContextE queries GCP to return a new instance of the Regional Instance Group type. The ctx parameter supports cancellation and timeouts.

func FetchRegionalInstanceGroupE deprecated added in v0.11.0

func FetchRegionalInstanceGroupE(t testing.TestingT, projectID string, region string, name string) (*RegionalInstanceGroup, error)

FetchRegionalInstanceGroupE queries GCP to return a new instance of the Regional Instance Group type.

Deprecated: Use FetchRegionalInstanceGroupContextE instead.

func FetchRegionalInstanceGroupWithClient added in v1.0.0

func FetchRegionalInstanceGroupWithClient(ctx context.Context, service *compute.Service, projectID string, region string, name string) (*RegionalInstanceGroup, error)

FetchRegionalInstanceGroupWithClient queries GCP to return a new instance of the Regional Instance Group type using the supplied *compute.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see compute_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func (*RegionalInstanceGroup) GetInstanceIDs deprecated added in v1.0.0

func (ig *RegionalInstanceGroup) GetInstanceIDs(t testing.TestingT) []string

GetInstanceIDs gets the IDs of Instances in the given Regional Instance Group. This will fail the test if there is an error.

Deprecated: Use RegionalInstanceGroup.GetInstanceIDsContext instead.

func (*RegionalInstanceGroup) GetInstanceIDsContext added in v1.0.0

func (ig *RegionalInstanceGroup) GetInstanceIDsContext(t testing.TestingT, ctx context.Context) []string

GetInstanceIDsContext gets the IDs of Instances in the given Regional Instance Group. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*RegionalInstanceGroup) GetInstanceIDsContextE added in v1.0.0

func (ig *RegionalInstanceGroup) GetInstanceIDsContextE(t testing.TestingT, ctx context.Context) ([]string, error)

GetInstanceIDsContextE gets the IDs of Instances in the given Regional Instance Group. The ctx parameter supports cancellation and timeouts.

func (*RegionalInstanceGroup) GetInstanceIDsE deprecated added in v1.0.0

func (ig *RegionalInstanceGroup) GetInstanceIDsE(t testing.TestingT) ([]string, error)

GetInstanceIDsE gets the IDs of Instances in the given Regional Instance Group.

Deprecated: Use RegionalInstanceGroup.GetInstanceIDsContextE instead.

func (*RegionalInstanceGroup) GetInstanceIDsWithClient added in v1.0.0

func (ig *RegionalInstanceGroup) GetInstanceIDsWithClient(ctx context.Context, service *compute.Service) ([]string, error)

GetInstanceIDsWithClient gets the IDs of Instances in the given Regional Instance Group using the supplied *compute.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see compute_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func (*RegionalInstanceGroup) GetInstanceIds deprecated added in v0.11.0

func (ig *RegionalInstanceGroup) GetInstanceIds(t testing.TestingT) []string

GetInstanceIds gets the IDs of Instances in the given Regional Instance Group. This will fail the test if there is an error.

Deprecated: Use RegionalInstanceGroup.GetInstanceIDs instead.

func (*RegionalInstanceGroup) GetInstanceIdsE deprecated added in v0.11.0

func (ig *RegionalInstanceGroup) GetInstanceIdsE(t testing.TestingT) ([]string, error)

GetInstanceIdsE gets the IDs of Instances in the given Regional Instance Group.

Deprecated: Use RegionalInstanceGroup.GetInstanceIDsE instead.

func (*RegionalInstanceGroup) GetInstances deprecated added in v0.13.4

func (ig *RegionalInstanceGroup) GetInstances(t testing.TestingT, projectID string) []*Instance

GetInstances returns a collection of Instance structs from the given Regional Instance Group. This will fail the test if there is an error.

Deprecated: Use RegionalInstanceGroup.GetInstancesContext instead.

func (*RegionalInstanceGroup) GetInstancesContext added in v1.0.0

func (ig *RegionalInstanceGroup) GetInstancesContext(t testing.TestingT, ctx context.Context, projectID string) []*Instance

GetInstancesContext returns a collection of Instance structs from the given Regional Instance Group. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*RegionalInstanceGroup) GetInstancesContextE added in v1.0.0

func (ig *RegionalInstanceGroup) GetInstancesContextE(t testing.TestingT, ctx context.Context, projectID string) ([]*Instance, error)

GetInstancesContextE returns a collection of Instance structs from the given Regional Instance Group. The ctx parameter supports cancellation and timeouts.

func (*RegionalInstanceGroup) GetInstancesE deprecated added in v0.13.4

func (ig *RegionalInstanceGroup) GetInstancesE(t testing.TestingT, projectID string) ([]*Instance, error)

GetInstancesE returns a collection of Instance structs from the given Regional Instance Group.

Deprecated: Use RegionalInstanceGroup.GetInstancesContextE instead.

func (*RegionalInstanceGroup) GetPublicIPs deprecated added in v1.0.0

func (ig *RegionalInstanceGroup) GetPublicIPs(t testing.TestingT, projectID string) []string

GetPublicIPs returns a slice of the public IPs from the given Regional Instance Group. This will fail the test if there is an error.

Deprecated: Use RegionalInstanceGroup.GetPublicIPsContext instead.

func (*RegionalInstanceGroup) GetPublicIPsContext added in v1.0.0

func (ig *RegionalInstanceGroup) GetPublicIPsContext(t testing.TestingT, ctx context.Context, projectID string) []string

GetPublicIPsContext returns a slice of the public IPs from the given Regional Instance Group. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*RegionalInstanceGroup) GetPublicIPsContextE added in v1.0.0

func (ig *RegionalInstanceGroup) GetPublicIPsContextE(t testing.TestingT, ctx context.Context, projectID string) ([]string, error)

GetPublicIPsContextE returns a slice of the public IPs from the given Regional Instance Group. The ctx parameter supports cancellation and timeouts.

func (*RegionalInstanceGroup) GetPublicIPsE deprecated added in v1.0.0

func (ig *RegionalInstanceGroup) GetPublicIPsE(t testing.TestingT, projectID string) ([]string, error)

GetPublicIPsE returns a slice of the public IPs from the given Regional Instance Group.

Deprecated: Use RegionalInstanceGroup.GetPublicIPsContextE instead.

func (*RegionalInstanceGroup) GetPublicIps deprecated added in v0.13.4

func (ig *RegionalInstanceGroup) GetPublicIps(t testing.TestingT, projectID string) []string

GetPublicIps returns a slice of the public IPs from the given Regional Instance Group. This will fail the test if there is an error.

Deprecated: Use RegionalInstanceGroup.GetPublicIPs instead.

func (*RegionalInstanceGroup) GetPublicIpsE deprecated added in v0.13.4

func (ig *RegionalInstanceGroup) GetPublicIpsE(t testing.TestingT, projectID string) ([]string, error)

GetPublicIpsE returns a slice of the public IPs from the given Regional Instance Group.

Deprecated: Use RegionalInstanceGroup.GetPublicIPsE instead.

func (*RegionalInstanceGroup) GetRandomInstance deprecated added in v0.11.0

func (ig *RegionalInstanceGroup) GetRandomInstance(t testing.TestingT) *Instance

GetRandomInstance returns a randomly selected Instance from the Regional Instance Group. This will fail the test if there is an error.

Deprecated: Use RegionalInstanceGroup.GetRandomInstanceContext instead.

func (*RegionalInstanceGroup) GetRandomInstanceContext added in v1.0.0

func (ig *RegionalInstanceGroup) GetRandomInstanceContext(t testing.TestingT, ctx context.Context) *Instance

GetRandomInstanceContext returns a randomly selected Instance from the Regional Instance Group. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*RegionalInstanceGroup) GetRandomInstanceContextE added in v1.0.0

func (ig *RegionalInstanceGroup) GetRandomInstanceContextE(t testing.TestingT, ctx context.Context) (*Instance, error)

GetRandomInstanceContextE returns a randomly selected Instance from the Regional Instance Group. The ctx parameter supports cancellation and timeouts.

func (*RegionalInstanceGroup) GetRandomInstanceE deprecated added in v0.11.0

func (ig *RegionalInstanceGroup) GetRandomInstanceE(t testing.TestingT) (*Instance, error)

GetRandomInstanceE returns a randomly selected Instance from the Regional Instance Group.

Deprecated: Use RegionalInstanceGroup.GetRandomInstanceContextE instead.

type ZonalInstanceGroup added in v0.11.0

type ZonalInstanceGroup struct {
	*compute.InstanceGroup
	// contains filtered or unexported fields
}

ZonalInstanceGroup represents a GCP Zonal Instance Group (https://cloud.google.com/compute/docs/instance-groups/).

func FetchZonalInstanceGroup deprecated added in v0.11.0

func FetchZonalInstanceGroup(t testing.TestingT, projectID string, zone string, name string) *ZonalInstanceGroup

FetchZonalInstanceGroup queries GCP to return a new instance of the Zonal Instance Group type. This will fail the test if there is an error.

Deprecated: Use FetchZonalInstanceGroupContext instead.

func FetchZonalInstanceGroupContext added in v1.0.0

func FetchZonalInstanceGroupContext(t testing.TestingT, ctx context.Context, projectID string, zone string, name string) *ZonalInstanceGroup

FetchZonalInstanceGroupContext queries GCP to return a new instance of the Zonal Instance Group type. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func FetchZonalInstanceGroupContextE added in v1.0.0

func FetchZonalInstanceGroupContextE(t testing.TestingT, ctx context.Context, projectID string, zone string, name string) (*ZonalInstanceGroup, error)

FetchZonalInstanceGroupContextE queries GCP to return a new instance of the Zonal Instance Group type. The ctx parameter supports cancellation and timeouts.

func FetchZonalInstanceGroupE deprecated added in v0.11.0

func FetchZonalInstanceGroupE(t testing.TestingT, projectID string, zone string, name string) (*ZonalInstanceGroup, error)

FetchZonalInstanceGroupE queries GCP to return a new instance of the Zonal Instance Group type.

Deprecated: Use FetchZonalInstanceGroupContextE instead.

func FetchZonalInstanceGroupWithClient added in v1.0.0

func FetchZonalInstanceGroupWithClient(ctx context.Context, service *compute.Service, projectID string, zone string, name string) (*ZonalInstanceGroup, error)

FetchZonalInstanceGroupWithClient queries GCP to return a new instance of the Zonal Instance Group type using the supplied *compute.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see compute_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func (*ZonalInstanceGroup) GetInstanceIDs deprecated added in v1.0.0

func (ig *ZonalInstanceGroup) GetInstanceIDs(t testing.TestingT) []string

GetInstanceIDs gets the IDs of Instances in the given Zonal Instance Group. This will fail the test if there is an error.

Deprecated: Use ZonalInstanceGroup.GetInstanceIDsContext instead.

func (*ZonalInstanceGroup) GetInstanceIDsContext added in v1.0.0

func (ig *ZonalInstanceGroup) GetInstanceIDsContext(t testing.TestingT, ctx context.Context) []string

GetInstanceIDsContext gets the IDs of Instances in the given Zonal Instance Group. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*ZonalInstanceGroup) GetInstanceIDsContextE added in v1.0.0

func (ig *ZonalInstanceGroup) GetInstanceIDsContextE(t testing.TestingT, ctx context.Context) ([]string, error)

GetInstanceIDsContextE gets the IDs of Instances in the given Zonal Instance Group. The ctx parameter supports cancellation and timeouts.

func (*ZonalInstanceGroup) GetInstanceIDsE deprecated added in v1.0.0

func (ig *ZonalInstanceGroup) GetInstanceIDsE(t testing.TestingT) ([]string, error)

GetInstanceIDsE gets the IDs of Instances in the given Zonal Instance Group.

Deprecated: Use ZonalInstanceGroup.GetInstanceIDsContextE instead.

func (*ZonalInstanceGroup) GetInstanceIDsWithClient added in v1.0.0

func (ig *ZonalInstanceGroup) GetInstanceIDsWithClient(ctx context.Context, service *compute.Service) ([]string, error)

GetInstanceIDsWithClient gets the IDs of Instances in the given Zonal Instance Group using the supplied *compute.Service. Prefer this variant in unit tests where the service is backed by an httptest fake server (see compute_unit_test.go for the pattern). The ctx parameter supports cancellation and timeouts.

func (*ZonalInstanceGroup) GetInstanceIds deprecated added in v0.11.0

func (ig *ZonalInstanceGroup) GetInstanceIds(t testing.TestingT) []string

GetInstanceIds gets the IDs of Instances in the given Zonal Instance Group. This will fail the test if there is an error.

Deprecated: Use ZonalInstanceGroup.GetInstanceIDs instead.

func (*ZonalInstanceGroup) GetInstanceIdsE deprecated added in v0.11.0

func (ig *ZonalInstanceGroup) GetInstanceIdsE(t testing.TestingT) ([]string, error)

GetInstanceIdsE gets the IDs of Instances in the given Zonal Instance Group.

Deprecated: Use ZonalInstanceGroup.GetInstanceIDsE instead.

func (*ZonalInstanceGroup) GetInstances deprecated added in v0.13.4

func (ig *ZonalInstanceGroup) GetInstances(t testing.TestingT, projectID string) []*Instance

GetInstances returns a collection of Instance structs from the given Zonal Instance Group. This will fail the test if there is an error.

Deprecated: Use ZonalInstanceGroup.GetInstancesContext instead.

func (*ZonalInstanceGroup) GetInstancesContext added in v1.0.0

func (ig *ZonalInstanceGroup) GetInstancesContext(t testing.TestingT, ctx context.Context, projectID string) []*Instance

GetInstancesContext returns a collection of Instance structs from the given Zonal Instance Group. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*ZonalInstanceGroup) GetInstancesContextE added in v1.0.0

func (ig *ZonalInstanceGroup) GetInstancesContextE(t testing.TestingT, ctx context.Context, projectID string) ([]*Instance, error)

GetInstancesContextE returns a collection of Instance structs from the given Zonal Instance Group. The ctx parameter supports cancellation and timeouts.

func (*ZonalInstanceGroup) GetInstancesE deprecated added in v0.13.4

func (ig *ZonalInstanceGroup) GetInstancesE(t testing.TestingT, projectID string) ([]*Instance, error)

GetInstancesE returns a collection of Instance structs from the given Zonal Instance Group.

Deprecated: Use ZonalInstanceGroup.GetInstancesContextE instead.

func (*ZonalInstanceGroup) GetPublicIPs deprecated added in v1.0.0

func (ig *ZonalInstanceGroup) GetPublicIPs(t testing.TestingT, projectID string) []string

GetPublicIPs returns a slice of the public IPs from the given Zonal Instance Group. This will fail the test if there is an error.

Deprecated: Use ZonalInstanceGroup.GetPublicIPsContext instead.

func (*ZonalInstanceGroup) GetPublicIPsContext added in v1.0.0

func (ig *ZonalInstanceGroup) GetPublicIPsContext(t testing.TestingT, ctx context.Context, projectID string) []string

GetPublicIPsContext returns a slice of the public IPs from the given Zonal Instance Group. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*ZonalInstanceGroup) GetPublicIPsContextE added in v1.0.0

func (ig *ZonalInstanceGroup) GetPublicIPsContextE(t testing.TestingT, ctx context.Context, projectID string) ([]string, error)

GetPublicIPsContextE returns a slice of the public IPs from the given Zonal Instance Group. The ctx parameter supports cancellation and timeouts.

func (*ZonalInstanceGroup) GetPublicIPsE deprecated added in v1.0.0

func (ig *ZonalInstanceGroup) GetPublicIPsE(t testing.TestingT, projectID string) ([]string, error)

GetPublicIPsE returns a slice of the public IPs from the given Zonal Instance Group.

Deprecated: Use ZonalInstanceGroup.GetPublicIPsContextE instead.

func (*ZonalInstanceGroup) GetPublicIps deprecated added in v0.13.4

func (ig *ZonalInstanceGroup) GetPublicIps(t testing.TestingT, projectID string) []string

GetPublicIps returns a slice of the public IPs from the given Zonal Instance Group. This will fail the test if there is an error.

Deprecated: Use ZonalInstanceGroup.GetPublicIPs instead.

func (*ZonalInstanceGroup) GetPublicIpsE deprecated added in v0.13.4

func (ig *ZonalInstanceGroup) GetPublicIpsE(t testing.TestingT, projectID string) ([]string, error)

GetPublicIpsE returns a slice of the public IPs from the given Zonal Instance Group.

Deprecated: Use ZonalInstanceGroup.GetPublicIPsE instead.

func (*ZonalInstanceGroup) GetRandomInstance deprecated added in v0.11.0

func (ig *ZonalInstanceGroup) GetRandomInstance(t testing.TestingT) *Instance

GetRandomInstance returns a randomly selected Instance from the Zonal Instance Group. This will fail the test if there is an error.

Deprecated: Use ZonalInstanceGroup.GetRandomInstanceContext instead.

func (*ZonalInstanceGroup) GetRandomInstanceContext added in v1.0.0

func (ig *ZonalInstanceGroup) GetRandomInstanceContext(t testing.TestingT, ctx context.Context) *Instance

GetRandomInstanceContext returns a randomly selected Instance from the Zonal Instance Group. This will fail the test if there is an error. The ctx parameter supports cancellation and timeouts.

func (*ZonalInstanceGroup) GetRandomInstanceContextE added in v1.0.0

func (ig *ZonalInstanceGroup) GetRandomInstanceContextE(t testing.TestingT, ctx context.Context) (*Instance, error)

GetRandomInstanceContextE returns a randomly selected Instance from the Zonal Instance Group. The ctx parameter supports cancellation and timeouts.

func (*ZonalInstanceGroup) GetRandomInstanceE deprecated added in v0.11.0

func (ig *ZonalInstanceGroup) GetRandomInstanceE(t testing.TestingT) (*Instance, error)

GetRandomInstanceE returns a randomly selected Instance from the Zonal Instance Group.

Deprecated: Use ZonalInstanceGroup.GetRandomInstanceContextE instead.

Jump to

Keyboard shortcuts

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