Documentation ¶
Index ¶
- Constants
- Variables
- func FormatBigtableClusterName(projectID, instanceName, clusterName string) string
- func FormatBigtableInstanceName(projectID string, name string) string
- func FormatComputeNetworkName(projectID, name string) string
- func FormatComputeRouterName(projectID, region, name string) string
- func FormatComputeSubNetworkName(projectID, region, name string) string
- func FormatFullProjectID(projectID string) string
- func FormatGlobalComputeSslCertificateName(projectID, name string) string
- func FormatInstanceLocationName(projectID, name string) string
- func FormatPubSubTopicName(projectID, name string) string
- func FormatSQLOperationErrorMessages(opErrs []*sqladmin.OperationError) string
- func FullResourceNameToShortName(fullName string) string
- func GetDefaultProjectID() (string, error)
- func IsLocationRegional(location string) bool
- func IsLocationZonal(location string) bool
- func IsNotAuthorizedError(err error) bool
- func IsNotFoundError(err error) bool
- func LocationToRegion(location string) (string, error)
- func NewCloudResourceManagerClient(ctx context.Context) (*cloudresourcemanager.Service, error)
- func NewIAMClient(ctx context.Context) (*iam.Service, error)
- func NewStorageClient(ctx context.Context) (*storage.Service, error)
- func WaitForAssetInventoryOperation(assetClient *cloudasset.Service, operation *cloudasset.Operation, ...) (*cloudasset.Operation, error)
- func WaitForAssetInventoryOperationDefaultTimeout(assetClient *cloudasset.Service, operation *cloudasset.Operation, ...) (*cloudasset.Operation, error)
- func WaitForComputeOperation(computeClient *compute.Service, operation *compute.Operation, projectID string, ...) (*compute.Operation, error)
- func WaitForComputeOperationDefaultTimeout(computeClient *compute.Service, operation *compute.Operation, projectID string, ...) (*compute.Operation, error)
- func WaitForResourceManagerOperation(rmClient *resourcemanager.Service, operation *resourcemanager.Operation, ...) (*resourcemanager.Operation, error)
- func WaitForResourceManagerOperationDefaultTimeout(rmClient *resourcemanager.Service, operation *resourcemanager.Operation, ...) (*resourcemanager.Operation, error)
- type AssetInventoryWaitCallback
- type BigtableWaitCallback
- type ComputeWaitCallback
- type ContainerWaitCallback
- type RedisWaitCallback
- type ResourceManagerCallback
- type SQLWaitCallback
- type ServiceNetworkingWaitCallback
- type SpannerWaitCallback
Constants ¶
View Source
const ( Global = "global" Regional = "regional" Zonal = "zonal" )
View Source
const KCCUserAgent = "kcc/controller-manager"
The user agent to track KCC's attribution to GCP usages
Variables ¶
View Source
var ClientScopes = []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",
"https://www.googleapis.com/auth/drive.readonly",
}
ClientScopes is the list of OAuth2 scopes to be used to create an httpClient. TODO(kcc-eng): configure terraform provider to use this list as the single source of truth
Functions ¶
func FormatComputeRouterName ¶
func FormatFullProjectID ¶
func FormatPubSubTopicName ¶
func FormatSQLOperationErrorMessages ¶
func FormatSQLOperationErrorMessages(opErrs []*sqladmin.OperationError) string
func GetDefaultProjectID ¶
GetDefaultProjectID tries to retrieve the default project id through the following:
- Grabbing the project id specified in the application-default GCP credentials on the host machine. This often returns an error, for example when the application-default credentials are expired. Also, the default credentials often do not have the project id set (it's set when the credentials are for a service account).
- If, in step 1 above, there is an error or the project id field is blank, then silently ignore the failure, and fall back to shelling out to gcloud to get the default project id from the local gcloud config.
func IsLocationRegional ¶
func IsLocationZonal ¶
func IsNotAuthorizedError ¶
func IsNotFoundError ¶
func LocationToRegion ¶
func NewCloudResourceManagerClient ¶
NewCloudResourceManagerClient returns a GCP Cloud Resource Manager service.
func NewIAMClient ¶
func NewStorageClient ¶
func WaitForAssetInventoryOperation ¶
func WaitForAssetInventoryOperation(assetClient *cloudasset.Service, operation *cloudasset.Operation, projectNum string, interval, timeout time.Duration, callback AssetInventoryWaitCallback) (*cloudasset.Operation, error)
The project number should be the project number for the credentials which are making this request
func WaitForAssetInventoryOperationDefaultTimeout ¶
func WaitForAssetInventoryOperationDefaultTimeout(assetClient *cloudasset.Service, operation *cloudasset.Operation, projectNum string, callback AssetInventoryWaitCallback) (*cloudasset.Operation, error)
func WaitForComputeOperation ¶
func WaitForComputeOperation(computeClient *compute.Service, operation *compute.Operation, projectID string, interval, timeout time.Duration, callback ComputeWaitCallback) (*compute.Operation, error)
func WaitForComputeOperationDefaultTimeout ¶
func WaitForComputeOperationDefaultTimeout(computeClient *compute.Service, operation *compute.Operation, projectID string, callback ComputeWaitCallback) (*compute.Operation, error)
func WaitForResourceManagerOperation ¶
func WaitForResourceManagerOperation(rmClient *resourcemanager.Service, operation *resourcemanager.Operation, interval, timeout time.Duration, callback ResourceManagerCallback) (*resourcemanager.Operation, error)
func WaitForResourceManagerOperationDefaultTimeout ¶
func WaitForResourceManagerOperationDefaultTimeout(rmClient *resourcemanager.Service, operation *resourcemanager.Operation, callback ResourceManagerCallback) (*resourcemanager.Operation, error)
Types ¶
type AssetInventoryWaitCallback ¶
type AssetInventoryWaitCallback func(operation *cloudasset.Operation) error
type BigtableWaitCallback ¶
type BigtableWaitCallback func(operation *bigtableadmin.Operation) error
type ComputeWaitCallback ¶
type ComputeWaitCallback func(operation *compute.Operation) error
type ContainerWaitCallback ¶
type RedisWaitCallback ¶
type RedisWaitCallback func(operation *redis.Operation) error
type ResourceManagerCallback ¶
type ResourceManagerCallback func(operation *resourcemanager.Operation) error
type SQLWaitCallback ¶ added in v1.114.0
type ServiceNetworkingWaitCallback ¶
type ServiceNetworkingWaitCallback func(operation *servicenetworking.Operation) error
type SpannerWaitCallback ¶
type SpannerWaitCallback func(operation *spanner.Operation) error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.