gcp_interface

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GCPClienter

type GCPClienter interface {
	common_interface.Clienter

	// GCP-specific methods
	ListProjects(
		ctx context.Context,
		req *resourcemanagerpb.ListProjectsRequest,
	) ([]*resourcemanagerpb.Project, error)

	EnsureProject(
		ctx context.Context,
		organizationID string,
		projectID string,
		billingAccountID string,
	) (string, error)
	DestroyProject(ctx context.Context, projectID string) error

	ListAllAssetsInProject(
		ctx context.Context,
		projectID string,
	) ([]*assetpb.Asset, error)
	StartResourcePolling(ctx context.Context) error

	CheckAuthentication(ctx context.Context) error
	CheckPermissions(ctx context.Context) error
	EnableAPI(ctx context.Context, projectID, apiName string) error
	CreateVPCNetwork(ctx context.Context, networkName string) error
	CreateFirewallRules(ctx context.Context, networkName string) error
	CreateIP(
		ctx context.Context,
		projectID string,
		location string,
		addressName string,
	) (string, error)
	// CreateStorageBucket(ctx context.Context, bucketName string) error
	CreateVM(
		ctx context.Context,
		projectID string,
		machine models.Machiner,
	) (*computepb.Instance, error)
	// WaitForOperation(
	// 	ctx context.Context,
	// 	projectID string,
	// 	op *computepb.Operation,
	// ) error
	SetBillingAccount(
		ctx context.Context,
		projectID string,
		billingAccountID string,
	) error
	ListBillingAccounts(ctx context.Context) ([]string, error)
	CreateServiceAccount(
		ctx context.Context,
		projectID string,
	) (*iam.ServiceAccount, error)
	IsAPIEnabled(ctx context.Context, projectID, apiName string) (bool, error)
	GetVMExternalIP(
		ctx context.Context,
		vmName string,
		locationData map[string]string,
	) (string, error)
	// WaitForGlobalOperation(
	// 	ctx context.Context,
	// 	project, operation string,
	// ) error
	GetVMZone(
		ctx context.Context,
		projectID, vmName string,
	) (string, error)
	CheckFirewallRuleExists(
		ctx context.Context,
		projectID, ruleName string,
	) error
	ValidateMachineType(ctx context.Context, machineType, location string) (bool, error)
	EnsureVPCNetwork(ctx context.Context, networkName string) error
	EnsureFirewallRules(ctx context.Context, networkName string) error
	// EnsureStorageBucket(ctx context.Context, location, bucketName string) error
	ProjectExists(ctx context.Context, projectID string) (bool, error)

	GetParentString() string
	SetParentString(organizationID string)
}

Jump to

Keyboard shortcuts

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