gcpclient

package
v0.0.0-...-e9c822e Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	// IAM
	GetServiceAccount(accountName string) (*iam.ServiceAccount, error)
	CreateServiceAccount(name, displayName string) (*iam.ServiceAccount, error)
	DeleteServiceAccount(accountEmail string) error
	CreateServiceAccountKey(serviceAccountEmail string) (*iam.ServiceAccountKey, error)
	DeleteServiceAccountKeys(serviceAccountEmail string) error
	// Cloudresourcemanager
	GetIamPolicy(projectName string) (*cloudresourcemanager.Policy, error)
	SetIamPolicy(setIamPolicyRequest *cloudresourcemanager.SetIamPolicyRequest) (*cloudresourcemanager.Policy, error)
	ListProjects() ([]*cloudresourcemanager.Project, error)
	CreateProject(parentFolder string, claimName string) (*cloudresourcemanager.Operation, error)
	CreateProjectLabels(project *cloudresourcemanager.Project, labels map[string]string) error
	DeleteProject(parentFolder string) (*cloudresourcemanager.Empty, error)
	GetProject(projectID string) (*cloudresourcemanager.Project, error)
	// ServiceManagement
	EnableAPI(projectID, api string) error
	ListAPIs(projectID string) ([]string, error)
	// CloudBilling
	CreateCloudBillingAccount(projectID, billingAccount string) error
	//Compute
	ListAvailabilityZones(projectID, region string) ([]string, error)
}

Client is a wrapper object for actual GCP libraries to allow for easier mocking/testing.

func NewClient

func NewClient(projectName string, authJSON []byte) (Client, error)

NewClient creates our client wrapper object for interacting with GCP.

Jump to

Keyboard shortcuts

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