gcp_interface

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 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)
	ListAddresses(
		ctx context.Context,
		projectID string,
		region string,
	) ([]*computepb.Address, error)
	StartResourcePolling(ctx context.Context) error

	CheckAuthentication(ctx context.Context, projectID string) error
	CheckPermissions(ctx context.Context, projectID string) error
	EnableAPI(ctx context.Context, projectID, apiName string) error
	CreateVPCNetwork(ctx context.Context, projectID string, networkName string) error
	CreateFirewallRules(
		ctx context.Context,
		projectID string,
		networkName string,
	) error
	CreateIP(
		ctx context.Context,
		projectID string,
		location string,
		address *computepb.Address,
	) (*computepb.Address, error)
	DeleteIP(
		ctx context.Context,
		projectID string,
		location string,
		addressName string,
	) error
	// CreateStorageBucket(ctx context.Context, bucketName string) error
	CreateVM(
		ctx context.Context,
		projectID string,
		machine models.Machiner,
		ip *computepb.Address,
		networkName string,
	) (*computepb.Instance, 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,
		projectID string,
		machineType, location string,
	) (bool, error)
	EnsureVPCNetwork(ctx context.Context, projectID, networkName string) error
	EnsureFirewallRules(
		ctx context.Context,
		projectID string,
		networkName string,
		allowedPorts []int,
	) 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