google

package
v0.0.0-...-7501429 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Copied from the official Google Cloud auto-generated client.
	ProjectRegex         = "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?))"
	ProjectRegexWildCard = "(?:(?:[-a-z0-9]{1,63}\\.)*(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?):)?(?:[0-9]{1,19}|(?:[a-z0-9](?:[-a-z0-9]{0,61}[a-z0-9])?)|-)"
	RegionRegex          = "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?"
	SubnetworkRegex      = "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?"
)

Variables

View Source
var AccessApprovalDefaultBasePath = "https://accessapproval.googleapis.com/v1/"

Generated product base paths nolint

View Source
var AccessContextManagerDefaultBasePath = "https://accesscontextmanager.googleapis.com/v1/"
View Source
var ActiveDirectoryDefaultBasePath = "https://managedidentities.googleapis.com/v1/"
View Source
var AppEngineDefaultBasePath = "https://appengine.googleapis.com/v1/"
View Source
var BigQueryDefaultBasePath = "https://bigquery.googleapis.com/bigquery/v2/"
View Source
var BigqueryDataTransferDefaultBasePath = "https://bigquerydatatransfer.googleapis.com/v1/"
View Source
var BigtableAdminCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_BIGTABLE_CUSTOM_ENDPOINT",
	}, BigtableAdminDefaultBasePath),
}
View Source
var BigtableAdminCustomEndpointEntryKey = "bigtable_custom_endpoint"
View Source
var BigtableAdminDefaultBasePath = "https://bigtableadmin.googleapis.com/v2/"
View Source
var BigtableDefaultBasePath = "https://bigtableadmin.googleapis.com/v2/"
View Source
var BinaryAuthorizationDefaultBasePath = "https://binaryauthorization.googleapis.com/v1/"
View Source
var CloudAssetDefaultBasePath = "https://cloudasset.googleapis.com/v1/"
View Source
var CloudBillingCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_CLOUD_BILLING_CUSTOM_ENDPOINT",
	}, CloudBillingDefaultBasePath),
}
View Source
var CloudBillingCustomEndpointEntryKey = "cloud_billing_custom_endpoint"
View Source
var CloudBillingDefaultBasePath = "https://cloudbilling.googleapis.com/v1/"
View Source
var CloudBuildDefaultBasePath = "https://cloudbuild.googleapis.com/v1/"
View Source
var CloudFunctionsDefaultBasePath = "https://cloudfunctions.googleapis.com/v1/"
View Source
var CloudIotDefaultBasePath = "https://cloudiot.googleapis.com/v1/"
View Source
var CloudRunDefaultBasePath = "https://{{location}}-run.googleapis.com/"
View Source
var CloudSchedulerDefaultBasePath = "https://cloudscheduler.googleapis.com/v1/"
View Source
var CloudTasksDefaultBasePath = "https://cloudtasks.googleapis.com/v2/"
View Source
var ComposerCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_COMPOSER_CUSTOM_ENDPOINT",
	}, ComposerDefaultBasePath),
}
View Source
var ComposerCustomEndpointEntryKey = "composer_custom_endpoint"
View Source
var ComposerDefaultBasePath = "https://composer.googleapis.com/v1beta1/"
View Source
var ComputeBetaCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_COMPUTE_BETA_CUSTOM_ENDPOINT",
	}, ComputeBetaDefaultBasePath),
}
View Source
var ComputeBetaCustomEndpointEntryKey = "compute_beta_custom_endpoint"
View Source
var ComputeBetaDefaultBasePath = "https://www.googleapis.com/compute/beta/"
View Source
var ComputeDefaultBasePath = "https://compute.googleapis.com/compute/v1/"
View Source
var ContainerAnalysisDefaultBasePath = "https://containeranalysis.googleapis.com/v1/"
View Source
var ContainerBetaCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_CONTAINER_BETA_CUSTOM_ENDPOINT",
	}, ContainerBetaDefaultBasePath),
}
View Source
var ContainerBetaCustomEndpointEntryKey = "container_beta_custom_endpoint"
View Source
var ContainerBetaDefaultBasePath = "https://container.googleapis.com/v1beta1/"
View Source
var ContainerCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_CONTAINER_CUSTOM_ENDPOINT",
	}, ContainerDefaultBasePath),
}
View Source
var ContainerCustomEndpointEntryKey = "container_custom_endpoint"
View Source
var ContainerDefaultBasePath = "https://container.googleapis.com/v1/"
View Source
var DNSDefaultBasePath = "https://dns.googleapis.com/dns/v1/"
View Source
var DataCatalogDefaultBasePath = "https://datacatalog.googleapis.com/v1/"
View Source
var DataLossPreventionDefaultBasePath = "https://dlp.googleapis.com/v2/"
View Source
var DataflowCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_DATAFLOW_CUSTOM_ENDPOINT",
	}, DataflowDefaultBasePath),
}
View Source
var DataflowCustomEndpointEntryKey = "dataflow_custom_endpoint"
View Source
var DataflowDefaultBasePath = "https://dataflow.googleapis.com/v1b3/"
View Source
var DataprocBetaCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_DATAPROC_BETA_CUSTOM_ENDPOINT",
	}, DataprocBetaDefaultBasePath),
}
View Source
var DataprocBetaCustomEndpointEntryKey = "dataproc_beta_custom_endpoint"
View Source
var DataprocBetaDefaultBasePath = "https://dataproc.googleapis.com/v1beta2/"
View Source
var DataprocDefaultBasePath = "https://dataproc.googleapis.com/v1/"
View Source
var DatastoreDefaultBasePath = "https://datastore.googleapis.com/v1/"
View Source
var DefaultClientScopes = []string{
	"https://www.googleapis.com/auth/compute",
	"https://www.googleapis.com/auth/cloud-platform",
	"https://www.googleapis.com/auth/cloud-identity",
	"https://www.googleapis.com/auth/ndev.clouddns.readwrite",
	"https://www.googleapis.com/auth/devstorage.full_control",
	"https://www.googleapis.com/auth/userinfo.email",
}
View Source
var DefaultRequestTimeout = 5 * time.Minute
View Source
var DeploymentManagerDefaultBasePath = "https://www.googleapis.com/deploymentmanager/v2/"
View Source
var DialogflowDefaultBasePath = "https://dialogflow.googleapis.com/v2/"
View Source
var DnsBetaCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_DNS_BETA_CUSTOM_ENDPOINT",
	}, DnsBetaDefaultBasePath),
}

nolint

View Source
var DnsBetaCustomEndpointEntryKey = "dns_beta_custom_endpoint"

nolint

View Source
var DnsBetaDefaultBasePath = "https://www.googleapis.com/dns/v1beta2/"

nolint

View Source
var FilestoreDefaultBasePath = "https://file.googleapis.com/v1/"
View Source
var FirestoreDefaultBasePath = "https://firestore.googleapis.com/v1/"
View Source
var GameServicesDefaultBasePath = "https://gameservices.googleapis.com/v1/"
View Source
var HealthcareDefaultBasePath = "https://healthcare.googleapis.com/v1/"
View Source
var IAMCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_IAM_CUSTOM_ENDPOINT",
	}, IAMDefaultBasePath),
}
View Source
var IAMCustomEndpointEntryKey = "iam_custom_endpoint"
View Source
var IAMDefaultBasePath = "https://iam.googleapis.com/v1/"
View Source
var IamCredentialsCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_IAM_CREDENTIALS_CUSTOM_ENDPOINT",
	}, IamCredentialsDefaultBasePath),
}
View Source
var IamCredentialsCustomEndpointEntryKey = "iam_credentials_custom_endpoint"
View Source
var IamCredentialsDefaultBasePath = "https://iamcredentials.googleapis.com/v1/"
View Source
var IapDefaultBasePath = "https://iap.googleapis.com/v1/"
View Source
var IdentityPlatformDefaultBasePath = "https://identitytoolkit.googleapis.com/v2/"
View Source
var KMSDefaultBasePath = "https://cloudkms.googleapis.com/v1/"
View Source
var LoggingDefaultBasePath = "https://logging.googleapis.com/v2/"
View Source
var MLEngineDefaultBasePath = "https://ml.googleapis.com/v1/"
View Source
var MonitoringDefaultBasePath = "https://monitoring.googleapis.com/"
View Source
var NetworkManagementDefaultBasePath = "https://networkmanagement.googleapis.com/v1/"
View Source
var OSConfigDefaultBasePath = "https://osconfig.googleapis.com/v1/"
View Source
var OSLoginDefaultBasePath = "https://oslogin.googleapis.com/v1/"
View Source
var PubsubDefaultBasePath = "https://pubsub.googleapis.com/v1/"
View Source
var RedisDefaultBasePath = "https://redis.googleapis.com/v1/"
View Source
var ResourceManagerDefaultBasePath = "https://cloudresourcemanager.googleapis.com/v1/"
View Source
var ResourceManagerV2Beta1CustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_RESOURCE_MANAGER_V2BETA1_CUSTOM_ENDPOINT",
	}, ResourceManagerV2Beta1DefaultBasePath),
}
View Source
var ResourceManagerV2Beta1CustomEndpointEntryKey = "resource_manager_v2beta1_custom_endpoint"
View Source
var ResourceManagerV2Beta1DefaultBasePath = "https://cloudresourcemanager.googleapis.com/v2beta1/"
View Source
var RuntimeConfigCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_RUNTIMECONFIG_CUSTOM_ENDPOINT",
	}, RuntimeConfigDefaultBasePath),
}
View Source
var RuntimeConfigCustomEndpointEntryKey = "runtimeconfig_custom_endpoint"
View Source
var RuntimeConfigDefaultBasePath = "https://runtimeconfig.googleapis.com/v1beta1/"
View Source
var SQLDefaultBasePath = "https://sqladmin.googleapis.com/sql/v1beta4/"
View Source
var SecretManagerDefaultBasePath = "https://secretmanager.googleapis.com/v1/"

nolint

View Source
var SecurityCenterDefaultBasePath = "https://securitycenter.googleapis.com/v1/"
View Source
var ServiceManagementDefaultBasePath = "https://servicemanagement.googleapis.com/v1/"
View Source
var ServiceNetworkingCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_SERVICE_NETWORKING_CUSTOM_ENDPOINT",
	}, ServiceNetworkingDefaultBasePath),
}
View Source
var ServiceNetworkingCustomEndpointEntryKey = "service_networking_custom_endpoint"
View Source
var ServiceNetworkingDefaultBasePath = "https://servicenetworking.googleapis.com/v1/"
View Source
var ServiceUsageCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_SERVICE_USAGE_CUSTOM_ENDPOINT",
	}, ServiceUsageDefaultBasePath),
}
View Source
var ServiceUsageCustomEndpointEntryKey = "service_usage_custom_endpoint"
View Source
var ServiceUsageDefaultBasePath = "https://serviceusage.googleapis.com/v1/"
View Source
var SourceRepoDefaultBasePath = "https://sourcerepo.googleapis.com/v1/"
View Source
var SpannerDefaultBasePath = "https://spanner.googleapis.com/v1/"
View Source
var StorageDefaultBasePath = "https://storage.googleapis.com/storage/v1/"
View Source
var StorageTransferCustomEndpointEntry = &schema.Schema{
	Type:             schema.TypeString,
	Optional:         true,
	ValidateDiagFunc: validateCustomEndpoint(),
	DefaultFunc: schema.MultiEnvDefaultFunc([]string{
		"GOOGLE_STORAGE_TRANSFER_CUSTOM_ENDPOINT",
	}, StorageTransferDefaultBasePath),
}
View Source
var StorageTransferCustomEndpointEntryKey = "storage_transfer_custom_endpoint"
View Source
var StorageTransferDefaultBasePath = "https://storagetransfer.googleapis.com/v1/"
View Source
var TPUDefaultBasePath = "https://tpu.googleapis.com/v1/"
View Source
var VPCAccessDefaultBasePath = "https://vpcaccess.googleapis.com/v1/"

Functions

func ClientWithAdditionalRetries

func ClientWithAdditionalRetries(baseClient *http.Client, predicates ...RetryErrorPredicateFunc) *http.Client

Helper method to create a shallow copy of an HTTP client with a shallow-copied retryTransport s.t. the base HTTP transport is the same (i.e. client connection pools are shared, retryPredicates are different)

func CommonRefreshFunc

func CommonRefreshFunc(w Waiter) resource.StateRefreshFunc

func ConfigureBasePaths

func ConfigureBasePaths(c *Config)

For a consumer of config.go that isn't a full fledged provider and doesn't have its own endpoint mechanism such as sweepers, init {{service}}BasePath values to a default. After using this, you should call config.LoadAndValidate.

func Convert

func Convert(item, out interface{}) error

Convert between two types by converting to/from JSON. Intended to switch between multiple API versions, as they are strict supersets of one another. item and out are pointers to structs

func ConvertToMap

func ConvertToMap(item interface{}) (map[string]interface{}, error)

When converting to a map, we can't use setOmittedFields because FieldByName fails. Luckily, we don't use the omitted fields anymore with generated resources, and this function is used to bridge from handwritten -> generated. Since this is a known type, we can create it inline instead of needing to pass an object in.

func GetRegionFromRegionSelfLink(selfLink string) string

return the region a selfLink is referring to

func GetResourceNameFromSelfLink(link string) string

func NewTransportWithDefaultRetries

func NewTransportWithDefaultRetries(t http.RoundTripper) *retryTransport

NewTransportWithDefaultRetries constructs a default retryTransport that will retry common temporary errors nolint

func OperationDone

func OperationDone(w Waiter) bool

func Provider

func Provider() *schema.Provider

Provider returns a *schema.Provider.

func ResourceMap

func ResourceMap() map[string]*schema.Resource

func ResourceMapWithErrors

func ResourceMapWithErrors() (map[string]*schema.Resource, error)

func TestProvider

func TestProvider() *schema.Provider

Types

type BatchRequest

type BatchRequest struct {
	// ResourceName represents the underlying resource for which
	// a request is made. Its format is determined by what SendF expects, but
	// typically should be the name of the parent GCP resource being changed.
	ResourceName string

	// Body is this request's data to be passed to SendF, and may be combined
	// with other bodies using CombineF.
	Body interface{}

	// CombineF function determines how to combine bodies from two batches.
	CombineF BatcherCombineFunc

	// SendF function determines how to actually send a batched request to a
	// third party service. The arguments given to this function are
	// (ResourceName, Body) where Body may have been combined with other request
	// Bodies.
	SendF BatcherSendFunc

	// ID for debugging request. This should be specific to a single request
	// (i.e. per Terraform resource)
	DebugID string
}

BatchRequest represents a single request to a global batcher.

type BatcherCombineFunc

type BatcherCombineFunc func(body interface{}, toAdd interface{}) (interface{}, error)

BatcherCombineFunc is a function type for combine existing batches and additional batch data

type BatcherSendFunc

type BatcherSendFunc func(resourceName string, body interface{}) (interface{}, error)

BatcherSendFunc is a function type for sending a batch request

type CommonOpError

type CommonOpError struct {
	*cloudresourcemanager.Status
}

Wraps Op.Error in an implementation of built-in Error

func (*CommonOpError) Error

func (e *CommonOpError) Error() string

type CommonOperation

type CommonOperation cloudresourcemanager.Operation

The cloud resource manager API operation is an example of one of many interchangeable API operations. Choose it somewhat arbitrarily to represent the "common" operation.

type CommonOperationWaiter

type CommonOperationWaiter struct {
	Op CommonOperation
}

func (*CommonOperationWaiter) Error

func (w *CommonOperationWaiter) Error() error

func (*CommonOperationWaiter) IsRetryable

func (w *CommonOperationWaiter) IsRetryable(error) bool

func (*CommonOperationWaiter) OpName

func (w *CommonOperationWaiter) OpName() string

func (*CommonOperationWaiter) PendingStates

func (w *CommonOperationWaiter) PendingStates() []string

func (*CommonOperationWaiter) SetOp

func (w *CommonOperationWaiter) SetOp(op interface{}) error

func (*CommonOperationWaiter) State

func (w *CommonOperationWaiter) State() string

func (*CommonOperationWaiter) TargetStates

func (w *CommonOperationWaiter) TargetStates() []string

type Config

type Config struct {
	AccessToken                        string
	Credentials                        string
	ImpersonateServiceAccount          string
	ImpersonateServiceAccountDelegates []string
	Project                            string
	Region                             string
	BillingProject                     string
	Zone                               string
	Scopes                             []string
	BatchingConfig                     *batchingConfig
	UserProjectOverride                bool
	RequestTimeout                     time.Duration
	// PollInterval is passed to resource.StateChangeConf in common_operation.go
	// It controls the interval at which we poll for successful operations
	PollInterval time.Duration

	AccessApprovalBasePath       string
	AccessContextManagerBasePath string
	ActiveDirectoryBasePath      string
	AppEngineBasePath            string
	BigQueryBasePath             string
	BigqueryDataTransferBasePath string
	BigtableBasePath             string
	BinaryAuthorizationBasePath  string
	CloudAssetBasePath           string
	CloudBuildBasePath           string
	CloudFunctionsBasePath       string
	CloudIotBasePath             string
	CloudRunBasePath             string
	CloudSchedulerBasePath       string
	CloudTasksBasePath           string
	ComputeBasePath              string
	ContainerAnalysisBasePath    string
	DataCatalogBasePath          string
	DataLossPreventionBasePath   string
	DataprocBasePath             string
	DatastoreBasePath            string
	DeploymentManagerBasePath    string
	DialogflowBasePath           string
	DNSBasePath                  string
	FilestoreBasePath            string
	FirestoreBasePath            string
	GameServicesBasePath         string
	HealthcareBasePath           string
	IapBasePath                  string
	IdentityPlatformBasePath     string
	KMSBasePath                  string
	LoggingBasePath              string
	MLEngineBasePath             string
	MonitoringBasePath           string
	NetworkManagementBasePath    string
	OSConfigBasePath             string
	OSLoginBasePath              string
	PubsubBasePath               string
	RedisBasePath                string
	ResourceManagerBasePath      string
	RuntimeConfigBasePath        string
	SecretManagerBasePath        string
	SecurityCenterBasePath       string
	ServiceManagementBasePath    string
	ServiceUsageBasePath         string
	SourceRepoBasePath           string
	SpannerBasePath              string
	SQLBasePath                  string
	StorageBasePath              string
	TPUBasePath                  string
	VPCAccessBasePath            string

	CloudBillingBasePath  string
	ComposerBasePath      string
	ComputeBetaBasePath   string
	ContainerBasePath     string
	ContainerBetaBasePath string
	DataprocBetaBasePath  string
	DataflowBasePath      string
	// nolint
	DnsBetaBasePath                string
	IamCredentialsBasePath         string
	ResourceManagerV2Beta1BasePath string
	IAMBasePath                    string
	CloudIoTBasePath               string
	ServiceNetworkingBasePath      string
	StorageTransferBasePath        string
	BigtableAdminBasePath          string

	DeleteVmsWithAPIInSingleMode bool
	// contains filtered or unexported fields
}

Config is the configuration structure used to instantiate the Google provider.

func (*Config) GetCredentials

func (c *Config) GetCredentials(clientScopes []string) (googleoauth.Credentials, error)

func (*Config) LoadAndValidate

func (c *Config) LoadAndValidate(ctx context.Context) error

func (*Config) NewComputeBetaClient

func (c *Config) NewComputeBetaClient(userAgent string) *computeBeta.Service

func (*Config) NewComputeClient

func (c *Config) NewComputeClient(userAgent string) *compute.Service

Methods to create new services from config Some base paths below need the version and possibly more of the path set on them. The client libraries are inconsistent about which values they need; while most only want the host URL, some older ones also want the version and some of those "projects" as well. You can find out if this is required by looking at the basePath value in the client library file.

func (*Config) NewMetricsClient

func (c *Config) NewMetricsClient(userAgent string) *monitoring.MetricClient

type GCPFailover

type GCPFailover struct {
	resource.Failover
	Project string
}

func (*GCPFailover) FromID

func (f *GCPFailover) FromID(id string) error

func (*GCPFailover) FromIDOrSchema

func (f *GCPFailover) FromIDOrSchema(d *schema.ResourceData) error

func (*GCPFailover) ID

func (f *GCPFailover) ID() (string, error)

type GlobalFieldValue

type GlobalFieldValue struct {
	Project string
	Name    string
	// contains filtered or unexported fields
}

func ParseNetworkFieldValue

func ParseNetworkFieldValue(network string, d TerraformResourceData, config *Config) (*GlobalFieldValue, error)
func (f GlobalFieldValue) RelativeLink() string

type LocationType

type LocationType int
const (
	Zonal LocationType = iota
	Regional
	Global
)

type MutexKV

type MutexKV struct {
	// contains filtered or unexported fields
}

MutexKV is a simple key/value store for arbitrary mutexes. It can be used to serialize changes across arbitrary collaborators that share knowledge of the keys they must serialize on.

The initial use case is to let aws_security_group_rule resources serialize their access to individual security groups based on SG ID.

func NewMutexKV

func NewMutexKV() *MutexKV

Returns a properly initialized MutexKV

func (*MutexKV) Lock

func (m *MutexKV) Lock(key string)

Locks the mutex for the given key. Caller is responsible for calling Unlock for the same key

func (*MutexKV) Unlock

func (m *MutexKV) Unlock(key string)

Unlock the mutex for the given key. Caller must have called Lock for the same key first

type OrganizationFieldValue

type OrganizationFieldValue struct {
	// nolint
	OrgId string
	Name  string
	// contains filtered or unexported fields
}
func (f OrganizationFieldValue) RelativeLink() string

type ProjectFieldValue

type ProjectFieldValue struct {
	Project string
	Name    string
	// contains filtered or unexported fields
}
func (f ProjectFieldValue) RelativeLink() string

type RegionalFieldValue

type RegionalFieldValue struct {
	Project string
	Region  string
	Name    string
	// contains filtered or unexported fields
}
func (f RegionalFieldValue) RelativeLink() string

type RequestBatcher

type RequestBatcher struct {
	sync.Mutex
	// contains filtered or unexported fields
}

RequestBatcher keeps track of batched requests globally. It should be created at a provider level. In general, one should be created per service that requires batching to:

  • prevent blocking batching for one service due to another,
  • minimize the possibility of overlap in batchKey formats (see SendRequestWithTimeout)

func NewRequestBatcher

func NewRequestBatcher(debugId string, ctx context.Context, config *batchingConfig) *RequestBatcher

Initializes a new batcher. nolint

func (*RequestBatcher) SendRequestWithTimeout

func (b *RequestBatcher) SendRequestWithTimeout(batchKey string, request *BatchRequest, timeout time.Duration) (interface{}, error)

SendRequestWithTimeout is a blocking call for making a single request, run alone or as part of a batch. It manages registering the single request with the batcher and waiting on the result.

Params: batchKey: A string to group batchable requests. It should be unique to the API request being sent, similar to the HTTP request URL with GCP resource ID included in the URL (the caller may choose to use a key with method if needed to diff GET/read and POST/create)

As an example, for google_project_service, the batcher is called to batch services.batchEnable() calls for a project $PROJECT. The calling code uses the template "serviceusage:projects/$PROJECT/services:batchEnable", which mirrors the HTTP request: POST https://serviceusage.googleapis.com/v1/projects/$PROJECT/services:batchEnable

type RetryErrorPredicateFunc

type RetryErrorPredicateFunc func(error) (bool, string)

type TerraformResourceData

type TerraformResourceData interface {
	HasChange(string) bool
	GetOkExists(string) (interface{}, bool)
	GetOk(string) (interface{}, bool)
	Get(string) interface{}
	Set(string, interface{}) error
	SetId(string)
	Id() string
}

type TerraformResourceDiff

type TerraformResourceDiff interface {
	HasChange(string) bool
	GetChange(string) (interface{}, interface{})
	Get(string) interface{}
	Clear(string) error
	ForceNew(string) error
}

type Waiter

type Waiter interface {
	// State returns the current status of the operation.
	State() string

	// Error returns an error embedded in the operation we're waiting on, or nil
	// if the operation has no current error.
	Error() error

	// IsRetryable returns whether a given error should be retried.
	IsRetryable(error) bool

	// SetOp sets the operation we're waiting on in a Waiter struct so that it
	// can be used in other methods.
	SetOp(interface{}) error

	// QueryOp sends a request to the server to get the current status of the
	// operation. It's expected that QueryOp will return exactly one of an
	// operation or an error as non-nil, and that requests will be retried by
	// specific implementations of the method.
	QueryOp() (interface{}, error)

	// OpName is the name of the operation and is used to log its status.
	OpName() string

	// PendingStates contains the values of State() that cause us to continue
	// refreshing the operation.
	PendingStates() []string

	// TargetStates contain the values of State() that cause us to finish
	// refreshing the operation.
	TargetStates() []string
}

type ZonalFieldValue

type ZonalFieldValue struct {
	Project string
	Zone    string
	Name    string
	// contains filtered or unexported fields
}
func (f ZonalFieldValue) RelativeLink() string

Jump to

Keyboard shortcuts

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