google

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2017 License: MPL-2.0 Imports: 56 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])?))"
	RegionRegex     = "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?"
	SubnetworkRegex = "[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?"

	SubnetworkLinkRegex = "projects/(" + ProjectRegex + ")/regions/(" + RegionRegex + ")/subnetworks/(" + SubnetworkRegex + ")$"
)
View Source
const FINGERPRINT_RETRIES = 10

Variables

View Source
var FINGERPRINT_FAIL_ERRORS = []string{"Invalid fingerprint.", "Supplied fingerprint does not match current metadata fingerprint."}
View Source
var FirewallBaseApiVersion = v1
View Source
var FirewallVersionedFeatures = []Feature{
	Feature{Version: v0beta, Item: "deny"},
	Feature{Version: v0beta, Item: "direction"},
	Feature{Version: v0beta, Item: "destination_ranges"},
}
View Source
var GlobalAddressBaseApiVersion = v1
View Source
var GlobalAddressVersionedFeatures = []Feature{Feature{Version: v0beta, Item: "ip_version"}}
View Source
var GlobalForwardingRuleBaseApiVersion = v1
View Source
var GlobalForwardingRuleVersionedFeatures = []Feature{Feature{Version: v0beta, Item: "ip_version"}}
View Source
var InstanceGroupManagerBaseApiVersion = v1
View Source
var InstanceGroupManagerVersionedFeatures = []Feature{Feature{Version: v0beta, Item: "auto_healing_policies"}}
View Source
var OrderedComputeApiVersions = []ComputeApiVersion{
	v0beta,
	v1,
}
View Source
var SubnetworkBaseApiVersion = v1
View Source
var SubnetworkVersionedFeatures = []Feature{
	{
		Version: v0beta,
		Item:    "secondary_ip_range",
	},
}

Functions

func Convert added in v0.1.3

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. Convert loses information about ForceSendFields and NullFields.

func ConvertSelfLinkToV1 added in v0.1.3

func ConvertSelfLinkToV1(link string) string

func MetadataRetryWrapper

func MetadataRetryWrapper(update func() error) error

Since the google compute API uses optimistic locking, there is a chance we need to resubmit our updated metadata. To do this, you need to provide an update function that attempts to submit your metadata

func MetadataUpdate

func MetadataUpdate(oldMDMap map[string]interface{}, newMDMap map[string]interface{}, serverMD *compute.Metadata)

Update the metadata (serverMD) according to the provided diff (oldMDMap v newMDMap).

func Provider

func Provider() terraform.ResourceProvider

Provider returns a terraform.ResourceProvider.

func SignString

func SignString(toSign []byte, cfg *jwt.Config) ([]byte, error)

SignString calculates the SHA256 signature of the input string

Types

type BigtableClientFactory added in v0.1.2

type BigtableClientFactory struct {
	UserAgent   string
	TokenSource oauth2.TokenSource
}

func (BigtableClientFactory) NewAdminClient added in v0.1.2

func (s BigtableClientFactory) NewAdminClient(project, instance string) (*bigtable.AdminClient, error)

func (BigtableClientFactory) NewInstanceAdminClient added in v0.1.2

func (s BigtableClientFactory) NewInstanceAdminClient(project string) (*bigtable.InstanceAdminClient, error)

type ComputeApiVersion added in v0.1.3

type ComputeApiVersion uint8

type ComputeOperationError

type ComputeOperationError compute.OperationError

ComputeOperationError wraps compute.OperationError and implements the error interface so it can be returned.

func (ComputeOperationError) Error

func (e ComputeOperationError) Error() string

type ComputeOperationWaiter

type ComputeOperationWaiter struct {
	Service *compute.Service
	Op      *compute.Operation
	Project string
}

func (*ComputeOperationWaiter) Conf

func (*ComputeOperationWaiter) RefreshFunc

type Config

type Config struct {
	Credentials string
	Project     string
	Region      string
	// contains filtered or unexported fields
}

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

type ContainerOperationWaiter

type ContainerOperationWaiter struct {
	Service *container.Service
	Op      *container.Operation
	Project string
	Zone    string
}

func (*ContainerOperationWaiter) Conf

func (*ContainerOperationWaiter) RefreshFunc

type DnsChangeWaiter

type DnsChangeWaiter struct {
	Service     *dns.Service
	Change      *dns.Change
	Project     string
	ManagedZone string
}

func (*DnsChangeWaiter) Conf

func (*DnsChangeWaiter) RefreshFunc

func (w *DnsChangeWaiter) RefreshFunc() resource.StateRefreshFunc

type Feature added in v0.1.3

type Feature struct {
	Version ComputeApiVersion
	Item    string
}

A field of a resource and the version of the Compute API required to use it.

func (Feature) HasChangeBy added in v0.1.3

func (s Feature) HasChangeBy(d TerraformResourceData) bool

Returns true when a feature has been modified. This is most important when updating a resource to remove versioned feature usage; if the resource is reverting to its base version, it needs to perform a final update at the higher version in order to remove high version features.

func (Feature) InUseBy added in v0.1.3

func (s Feature) InUseBy(d TerraformResourceData) bool

Return true when a feature appears in schema or has been modified.

type ResourceManagerOperationWaiter

type ResourceManagerOperationWaiter struct {
	Service *cloudresourcemanager.Service
	Op      *cloudresourcemanager.Operation
}

func (*ResourceManagerOperationWaiter) Conf

func (*ResourceManagerOperationWaiter) RefreshFunc

type RoleEntity

type RoleEntity struct {
	Role   string
	Entity string
}

type ServiceManagementOperationWaiter

type ServiceManagementOperationWaiter struct {
	Service *servicemanagement.APIService
	Op      *servicemanagement.Operation
}

func (*ServiceManagementOperationWaiter) Conf

func (*ServiceManagementOperationWaiter) RefreshFunc

type SpannerDatabaseOperationWaiter added in v0.1.3

type SpannerDatabaseOperationWaiter struct {
	Service *spanner.Service
	Op      *spanner.Operation
}

func (*SpannerDatabaseOperationWaiter) Conf added in v0.1.3

func (*SpannerDatabaseOperationWaiter) RefreshFunc added in v0.1.3

type SpannerInstanceOperationWaiter added in v0.1.3

type SpannerInstanceOperationWaiter struct {
	Service *spanner.Service
	Op      *spanner.Operation
}

func (*SpannerInstanceOperationWaiter) Conf added in v0.1.3

func (*SpannerInstanceOperationWaiter) RefreshFunc added in v0.1.3

type SqlAdminOperationError

type SqlAdminOperationError sqladmin.OperationErrors

SqlAdminOperationError wraps sqladmin.OperationError and implements the error interface so it can be returned.

func (SqlAdminOperationError) Error

func (e SqlAdminOperationError) Error() string

type SqlAdminOperationWaiter

type SqlAdminOperationWaiter struct {
	Service *sqladmin.Service
	Op      *sqladmin.Operation
	Project string
}

func (*SqlAdminOperationWaiter) Conf

func (*SqlAdminOperationWaiter) RefreshFunc

type TerraformResourceData added in v0.1.3

type TerraformResourceData interface {
	HasChange(string) bool
	GetOk(string) (interface{}, bool)
}

type UrlData

type UrlData struct {
	JwtConfig   *jwt.Config
	ContentMd5  string
	ContentType string
	HttpMethod  string
	Expires     int
	HttpHeaders map[string]string
	Path        string
}

UrlData stores the values required to create a Signed Url

func (*UrlData) EncodedSignature

func (u *UrlData) EncodedSignature() (string, error)

EncodedSignature returns the Signature() after base64 encoding and url escaping

func (*UrlData) Signature

func (u *UrlData) Signature() ([]byte, error)

func (*UrlData) SignedUrl

func (u *UrlData) SignedUrl() (string, error)

SignedUrl constructs the final signed URL a client can use to retrieve storage object

func (*UrlData) SigningString

func (u *UrlData) SigningString() []byte

SigningString creates a string representation of the UrlData in a form ready for signing: see https://cloud.google.com/storage/docs/access-control/create-signed-urls-program Example output: ------------------- GET

1388534400 bucket/objectname -------------------

Source Files

Jump to

Keyboard shortcuts

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