gcp

package
v0.0.0-...-7501429 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2020 License: Apache-2.0 Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AlertPolicyClean

func AlertPolicyClean(project, prefix string, dryRun bool) error

AlertPolicyClean cleans test notification alerts

func AlertsPoliciesCheck

func AlertsPoliciesCheck(prefix, project string) error

AlertsPoliciesCheck checks created alert policies

func CleanResources

func CleanResources(project, prefix string, dryRun bool) error

CleanResources cleans gcp resources

func ClearTFBucket

func ClearTFBucket(project, name string) error

ClearTFBucket deletes all objects from bucket

func DeleteManagementInstances

func DeleteManagementInstances(ctx context.Context, client *compute.Service, project string, groups InstanceGroupManagerList) error

func DeleteTFBucket

func DeleteTFBucket(project, name string) error

DeleteTFBucket deletes a bucket

func EnsureTFBucket

func EnsureTFBucket(project, name string) (bool, error)

EnsureTFBucket ensure TF bucket exists

func FirewallCheck

func FirewallCheck(prefix, project string, exposePrometheus, exposeSSH bool) error

FirewallCheck checks created firewalls

func HealthCheckClean

func HealthCheckClean(project, prefix string, dryRun bool) error

HealthCheckClean cleans all SM keys with prefix

func HealthStatusCheck

func HealthStatusCheck(prefix, project string) error

HealthStatusCheck checks instances health status

func InstanceGroupsClean

func InstanceGroupsClean(project, prefix string, dryRun bool) error

InstanceGroupsClean cleans instance groups

func InstanceTemplatesClean

func InstanceTemplatesClean(project, prefix string, dryRun bool) error

InstanceTemplatesClean cleans instance templates

func NetworkClean

func NetworkClean(project, prefix string, dryRun bool) error

NetworkClean cleans all compute networks with prefix

func NotificationChannelsClean

func NotificationChannelsClean(project, prefix string, dryRun bool) error

NotificationChannelsClean cleans test notification channels

func SAClean

func SAClean(project, prefix string, dryRun bool) error

SAClean cleans service accounts

func SMCheck

func SMCheck(t *testing.T, prefix, project string) bool

SMCheck checks sm parameters

func SMClean

func SMClean(project, prefix string, dryRun bool) error

SMClean cleans all SM keys with prefix

func VolumesCheck

func VolumesCheck(prefix, project string) error

VolumesCheck checl that we do not have unattached volumes

func WaitForInstancesCount

func WaitForInstancesCount(
	ctx context.Context,
	client *compute.Service,
	project, prefix string,
	expectedNumber int,
	regions ...string,
) error

Types

type InstanceGroupManager

type InstanceGroupManager struct {
	Name      string
	Region    string
	Instances []*compute.ManagedInstance
}

func (InstanceGroupManager) InstanceNames

func (g InstanceGroupManager) InstanceNames() []string

func (*InstanceGroupManager) SearchAndRemoveInstanceByName

func (g *InstanceGroupManager) SearchAndRemoveInstanceByName(name string) *compute.ManagedInstance

type InstanceGroupManagerList

type InstanceGroupManagerList []InstanceGroupManager

func GetInstanceGroupManagers

func GetInstanceGroupManagers(ctx context.Context, client *compute.Service, project, prefix string) (InstanceGroupManagerList, error)

GetManagementInstances ...

func GetInstanceGroupManagersForRegions

func GetInstanceGroupManagersForRegions(ctx context.Context, client *compute.Service, project, prefix string, regions ...string) (InstanceGroupManagerList, error)

GetInstanceGroupManagersForRegions ...

func GetInstanceGroupManagersForRegionsInnerClient

func GetInstanceGroupManagersForRegionsInnerClient(project, prefix string, regions ...string) (InstanceGroupManagerList, error)

func (InstanceGroupManagerList) InstanceNames

func (l InstanceGroupManagerList) InstanceNames() []string

func (InstanceGroupManagerList) InstancesCount

func (l InstanceGroupManagerList) InstancesCount() int

type InstanceMetricPoints

type InstanceMetricPoints map[instance][]*monitoringpb.Point

func GetValidatorMetrics

func GetValidatorMetrics(
	ctx context.Context,
	client *monitoring.MetricClient,
	project,
	prefix,
	metricNamespace,
	metricName string,
	instanceNames ...string,
) (InstanceMetricPoints, error)

type Validator

type Validator struct {
	GroupName    string
	InstanceName string
	Metric       int
}

func GetValidatorWithClient

func GetValidatorWithClient(
	ctx context.Context,
	client *monitoring.MetricClient,
	project,
	prefix,
	metricNamespace,
	metricName string,
	checkValue int,
	instanceNames ...string,
) (Validator, error)

func WaitForValidator

func WaitForValidator(
	project,
	prefix string,
	checkValue int,
	timeout int,
	instanceNames ...string,
) (Validator, error)

WaitForValidator waits while validator metrics is being appeared

func WaitForValidatorWithClient

func WaitForValidatorWithClient(
	ctx context.Context,
	client *monitoring.MetricClient,
	project,
	prefix string,
	checkValue int,
	timeout int,
	instanceNames ...string,
) (Validator, error)

WaitForValidatorWithClient waits while validator metrics is being appeared

Jump to

Keyboard shortcuts

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