Documentation ¶
Index ¶
- Constants
- Variables
- func ClientWithAdditionalRetries(baseClient *http.Client, predicates ...RetryErrorPredicateFunc) *http.Client
- func CommonRefreshFunc(w Waiter) resource.StateRefreshFunc
- func ConfigureBasePaths(c *Config)
- func Convert(item, out interface{}) error
- func ConvertToMap(item interface{}) (map[string]interface{}, error)
- func GetRegionFromRegionSelfLink(selfLink string) string
- func GetResourceNameFromSelfLink(link string) string
- func NewTransportWithDefaultRetries(t http.RoundTripper) *retryTransport
- func OperationDone(w Waiter) bool
- func Provider() *schema.Provider
- func ResourceMap() map[string]*schema.Resource
- func ResourceMapWithErrors() (map[string]*schema.Resource, error)
- func TestProvider() *schema.Provider
- type BatchRequest
- type BatcherCombineFunc
- type BatcherSendFunc
- type CommonOpError
- type CommonOperation
- type CommonOperationWaiter
- func (w *CommonOperationWaiter) Error() error
- func (w *CommonOperationWaiter) IsRetryable(error) bool
- func (w *CommonOperationWaiter) OpName() string
- func (w *CommonOperationWaiter) PendingStates() []string
- func (w *CommonOperationWaiter) SetOp(op interface{}) error
- func (w *CommonOperationWaiter) State() string
- func (w *CommonOperationWaiter) TargetStates() []string
- type Config
- func (c *Config) GetCredentials(clientScopes []string) (googleoauth.Credentials, error)
- func (c *Config) LoadAndValidate(ctx context.Context) error
- func (c *Config) NewComputeBetaClient(userAgent string) *computeBeta.Service
- func (c *Config) NewComputeClient(userAgent string) *compute.Service
- func (c *Config) NewMetricsClient(userAgent string) *monitoring.MetricClient
- type GCPFailover
- type GlobalFieldValue
- type LocationType
- type MutexKV
- type OrganizationFieldValue
- type ProjectFieldValue
- type RegionalFieldValue
- type RequestBatcher
- type RetryErrorPredicateFunc
- type TerraformResourceData
- type TerraformResourceDiff
- type Waiter
- type ZonalFieldValue
Constants ¶
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 ¶
var AccessApprovalDefaultBasePath = "https://accessapproval.googleapis.com/v1/"
Generated product base paths nolint
var AccessContextManagerDefaultBasePath = "https://accesscontextmanager.googleapis.com/v1/"
var ActiveDirectoryDefaultBasePath = "https://managedidentities.googleapis.com/v1/"
var AppEngineDefaultBasePath = "https://appengine.googleapis.com/v1/"
var BigQueryDefaultBasePath = "https://bigquery.googleapis.com/bigquery/v2/"
var BigqueryDataTransferDefaultBasePath = "https://bigquerydatatransfer.googleapis.com/v1/"
var BigtableAdminCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_BIGTABLE_CUSTOM_ENDPOINT", }, BigtableAdminDefaultBasePath), }
var BigtableAdminCustomEndpointEntryKey = "bigtable_custom_endpoint"
var BigtableAdminDefaultBasePath = "https://bigtableadmin.googleapis.com/v2/"
var BigtableDefaultBasePath = "https://bigtableadmin.googleapis.com/v2/"
var BinaryAuthorizationDefaultBasePath = "https://binaryauthorization.googleapis.com/v1/"
var CloudAssetDefaultBasePath = "https://cloudasset.googleapis.com/v1/"
var CloudBillingCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_CLOUD_BILLING_CUSTOM_ENDPOINT", }, CloudBillingDefaultBasePath), }
var CloudBillingCustomEndpointEntryKey = "cloud_billing_custom_endpoint"
var CloudBillingDefaultBasePath = "https://cloudbilling.googleapis.com/v1/"
var CloudBuildDefaultBasePath = "https://cloudbuild.googleapis.com/v1/"
var CloudFunctionsDefaultBasePath = "https://cloudfunctions.googleapis.com/v1/"
var CloudIotDefaultBasePath = "https://cloudiot.googleapis.com/v1/"
var CloudRunDefaultBasePath = "https://{{location}}-run.googleapis.com/"
var CloudSchedulerDefaultBasePath = "https://cloudscheduler.googleapis.com/v1/"
var CloudTasksDefaultBasePath = "https://cloudtasks.googleapis.com/v2/"
var ComposerCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_COMPOSER_CUSTOM_ENDPOINT", }, ComposerDefaultBasePath), }
var ComposerCustomEndpointEntryKey = "composer_custom_endpoint"
var ComposerDefaultBasePath = "https://composer.googleapis.com/v1beta1/"
var ComputeBetaCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_COMPUTE_BETA_CUSTOM_ENDPOINT", }, ComputeBetaDefaultBasePath), }
var ComputeBetaCustomEndpointEntryKey = "compute_beta_custom_endpoint"
var ComputeBetaDefaultBasePath = "https://www.googleapis.com/compute/beta/"
var ComputeDefaultBasePath = "https://compute.googleapis.com/compute/v1/"
var ContainerAnalysisDefaultBasePath = "https://containeranalysis.googleapis.com/v1/"
var ContainerBetaCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_CONTAINER_BETA_CUSTOM_ENDPOINT", }, ContainerBetaDefaultBasePath), }
var ContainerBetaCustomEndpointEntryKey = "container_beta_custom_endpoint"
var ContainerBetaDefaultBasePath = "https://container.googleapis.com/v1beta1/"
var ContainerCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_CONTAINER_CUSTOM_ENDPOINT", }, ContainerDefaultBasePath), }
var ContainerCustomEndpointEntryKey = "container_custom_endpoint"
var ContainerDefaultBasePath = "https://container.googleapis.com/v1/"
var DNSDefaultBasePath = "https://dns.googleapis.com/dns/v1/"
var DataCatalogDefaultBasePath = "https://datacatalog.googleapis.com/v1/"
var DataLossPreventionDefaultBasePath = "https://dlp.googleapis.com/v2/"
var DataflowCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_DATAFLOW_CUSTOM_ENDPOINT", }, DataflowDefaultBasePath), }
var DataflowCustomEndpointEntryKey = "dataflow_custom_endpoint"
var DataflowDefaultBasePath = "https://dataflow.googleapis.com/v1b3/"
var DataprocBetaCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_DATAPROC_BETA_CUSTOM_ENDPOINT", }, DataprocBetaDefaultBasePath), }
var DataprocBetaCustomEndpointEntryKey = "dataproc_beta_custom_endpoint"
var DataprocBetaDefaultBasePath = "https://dataproc.googleapis.com/v1beta2/"
var DataprocDefaultBasePath = "https://dataproc.googleapis.com/v1/"
var DatastoreDefaultBasePath = "https://datastore.googleapis.com/v1/"
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",
}
var DefaultRequestTimeout = 5 * time.Minute
var DeploymentManagerDefaultBasePath = "https://www.googleapis.com/deploymentmanager/v2/"
var DialogflowDefaultBasePath = "https://dialogflow.googleapis.com/v2/"
var DnsBetaCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_DNS_BETA_CUSTOM_ENDPOINT", }, DnsBetaDefaultBasePath), }
nolint
var DnsBetaCustomEndpointEntryKey = "dns_beta_custom_endpoint"
nolint
var DnsBetaDefaultBasePath = "https://www.googleapis.com/dns/v1beta2/"
nolint
var FilestoreDefaultBasePath = "https://file.googleapis.com/v1/"
var FirestoreDefaultBasePath = "https://firestore.googleapis.com/v1/"
var GameServicesDefaultBasePath = "https://gameservices.googleapis.com/v1/"
var HealthcareDefaultBasePath = "https://healthcare.googleapis.com/v1/"
var IAMCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_IAM_CUSTOM_ENDPOINT", }, IAMDefaultBasePath), }
var IAMCustomEndpointEntryKey = "iam_custom_endpoint"
var IAMDefaultBasePath = "https://iam.googleapis.com/v1/"
var IamCredentialsCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_IAM_CREDENTIALS_CUSTOM_ENDPOINT", }, IamCredentialsDefaultBasePath), }
var IamCredentialsCustomEndpointEntryKey = "iam_credentials_custom_endpoint"
var IamCredentialsDefaultBasePath = "https://iamcredentials.googleapis.com/v1/"
var IapDefaultBasePath = "https://iap.googleapis.com/v1/"
var IdentityPlatformDefaultBasePath = "https://identitytoolkit.googleapis.com/v2/"
var KMSDefaultBasePath = "https://cloudkms.googleapis.com/v1/"
var LoggingDefaultBasePath = "https://logging.googleapis.com/v2/"
var MLEngineDefaultBasePath = "https://ml.googleapis.com/v1/"
var MonitoringDefaultBasePath = "https://monitoring.googleapis.com/"
var NetworkManagementDefaultBasePath = "https://networkmanagement.googleapis.com/v1/"
var OSConfigDefaultBasePath = "https://osconfig.googleapis.com/v1/"
var OSLoginDefaultBasePath = "https://oslogin.googleapis.com/v1/"
var PubsubDefaultBasePath = "https://pubsub.googleapis.com/v1/"
var RedisDefaultBasePath = "https://redis.googleapis.com/v1/"
var ResourceManagerDefaultBasePath = "https://cloudresourcemanager.googleapis.com/v1/"
var ResourceManagerV2Beta1CustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_RESOURCE_MANAGER_V2BETA1_CUSTOM_ENDPOINT", }, ResourceManagerV2Beta1DefaultBasePath), }
var ResourceManagerV2Beta1CustomEndpointEntryKey = "resource_manager_v2beta1_custom_endpoint"
var ResourceManagerV2Beta1DefaultBasePath = "https://cloudresourcemanager.googleapis.com/v2beta1/"
var RuntimeConfigCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_RUNTIMECONFIG_CUSTOM_ENDPOINT", }, RuntimeConfigDefaultBasePath), }
var RuntimeConfigCustomEndpointEntryKey = "runtimeconfig_custom_endpoint"
var RuntimeConfigDefaultBasePath = "https://runtimeconfig.googleapis.com/v1beta1/"
var SQLDefaultBasePath = "https://sqladmin.googleapis.com/sql/v1beta4/"
var SecretManagerDefaultBasePath = "https://secretmanager.googleapis.com/v1/"
nolint
var SecurityCenterDefaultBasePath = "https://securitycenter.googleapis.com/v1/"
var ServiceManagementDefaultBasePath = "https://servicemanagement.googleapis.com/v1/"
var ServiceNetworkingCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_SERVICE_NETWORKING_CUSTOM_ENDPOINT", }, ServiceNetworkingDefaultBasePath), }
var ServiceNetworkingCustomEndpointEntryKey = "service_networking_custom_endpoint"
var ServiceNetworkingDefaultBasePath = "https://servicenetworking.googleapis.com/v1/"
var ServiceUsageCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_SERVICE_USAGE_CUSTOM_ENDPOINT", }, ServiceUsageDefaultBasePath), }
var ServiceUsageCustomEndpointEntryKey = "service_usage_custom_endpoint"
var ServiceUsageDefaultBasePath = "https://serviceusage.googleapis.com/v1/"
var SourceRepoDefaultBasePath = "https://sourcerepo.googleapis.com/v1/"
var SpannerDefaultBasePath = "https://spanner.googleapis.com/v1/"
var StorageDefaultBasePath = "https://storage.googleapis.com/storage/v1/"
var StorageTransferCustomEndpointEntry = &schema.Schema{ Type: schema.TypeString, Optional: true, ValidateDiagFunc: validateCustomEndpoint(), DefaultFunc: schema.MultiEnvDefaultFunc([]string{ "GOOGLE_STORAGE_TRANSFER_CUSTOM_ENDPOINT", }, StorageTransferDefaultBasePath), }
var StorageTransferCustomEndpointEntryKey = "storage_transfer_custom_endpoint"
var StorageTransferDefaultBasePath = "https://storagetransfer.googleapis.com/v1/"
var TPUDefaultBasePath = "https://tpu.googleapis.com/v1/"
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 ¶
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 ¶
return the region a selfLink is referring to
func NewTransportWithDefaultRetries ¶
func NewTransportWithDefaultRetries(t http.RoundTripper) *retryTransport
NewTransportWithDefaultRetries constructs a default retryTransport that will retry common temporary errors nolint
func OperationDone ¶
func ResourceMap ¶
func TestProvider ¶
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 ¶
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) NewComputeBetaClient ¶
func (c *Config) NewComputeBetaClient(userAgent string) *computeBeta.Service
func (*Config) NewComputeClient ¶
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 ¶
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 (GlobalFieldValue) RelativeLink ¶
func (f GlobalFieldValue) RelativeLink() string
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.
type OrganizationFieldValue ¶
type OrganizationFieldValue struct { // nolint OrgId string Name string // contains filtered or unexported fields }
func (OrganizationFieldValue) RelativeLink ¶
func (f OrganizationFieldValue) RelativeLink() string
type ProjectFieldValue ¶
type ProjectFieldValue struct { Project string Name string // contains filtered or unexported fields }
func (ProjectFieldValue) RelativeLink ¶
func (f ProjectFieldValue) RelativeLink() string
type RegionalFieldValue ¶
type RegionalFieldValue struct { Project string Region string Name string // contains filtered or unexported fields }
func (RegionalFieldValue) RelativeLink ¶
func (f RegionalFieldValue) RelativeLink() string
type RequestBatcher ¶
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 TerraformResourceData ¶
type TerraformResourceDiff ¶
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 (ZonalFieldValue) RelativeLink ¶
func (f ZonalFieldValue) RelativeLink() string
Source Files ¶
- batcher.go
- common_operation.go
- config.go
- convert.go
- error_retry_predicates.go
- field_helpers.go
- hashcode.go
- mutexkv.go
- path_or_contents.go
- polkadot_failover.go
- provider.go
- provider_handwritten_endpoint.go
- resource.go
- retry_transport.go
- retry_utils.go
- self_link_helpers.go
- service_scope.go
- transport.go
- utils.go
- validation.go