gcp

package
v0.0.0-...-3568c51 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiskVolumeAttach

func DiskVolumeAttach(instanceName string, gcpProjectID string, zone string, deviceName string, diskName string) error

DiskVolumeAttach will attach a disk volume to a VM instance

func DiskVolumeDetach

func DiskVolumeDetach(instanceName string, gcpProjectID string, zone string, deviceName string) error

DiskVolumeDetach will detach a disk volume from a VM instance

func DiskVolumeStateCheck

func DiskVolumeStateCheck(gcpProjectID, zones, diskNames, deviceNames string) error

DiskVolumeStateCheck will check the attachment state of the given volume

func GetDiskVolumeState

func GetDiskVolumeState(diskName, gcpProjectID, instanceName, zone string) (string, error)

GetDiskVolumeState will verify and give the VM instance details along with the disk volume details

func GetServiceAccountJSONFromSecret

func GetServiceAccountJSONFromSecret() ([]byte, error)

GetServiceAccountJSONFromSecret fetches the secrets mounted as volume and returns the json credentials byte slice

func GetVMInstanceStatus

func GetVMInstanceStatus(instanceName string, gcpProjectID string, instanceZone string) (string, error)

GetVMInstanceStatus returns the status of a VM instance

func GetVolumeAttachmentDetails

func GetVolumeAttachmentDetails(gcpProjectID string, zone string, diskName string) (string, error)

GetVolumeAttachmentDetails returns the name of the VM instance attached to a disk volume

func InstanceStatusCheckByName

func InstanceStatusCheckByName(autoScalingGroup string, delay, timeout int, check string, instanceNames string, gcpProjectId string, instanceZones string) error

InstanceStatusCheckByName is used to check the status of all the VM instances under chaos

func InstanceStatusCheckPostChaos

func InstanceStatusCheckPostChaos(timeout, delay int, instanceNamesList []string, gcpProjectId string, instanceZonesList []string) error

InstanceStatusCheckPostChaos is used to check whether all VM instances under chaos are running or not with re-check

func InstanceStatusCheckPreChaos

func InstanceStatusCheckPreChaos(instanceNamesList []string, gcpProjectId string, instanceZonesList []string) error

InstanceStatusCheckPreChaos is used to check whether all VM instances under chaos are running or not without any re-check

func VMInstanceStart

func VMInstanceStart(instanceName string, gcpProjectID string, instanceZone string) error

VMInstanceStart starts a VM instance

func VMInstanceStop

func VMInstanceStop(instanceName string, gcpProjectID string, instanceZone string) error

VMInstanceStop stops a VM Instance

func WaitForVMInstanceDown

func WaitForVMInstanceDown(timeout int, delay int, instanceName string, gcpProjectID string, instanceZone string) error

WaitForVMInstanceDown will wait for the VM instance to attain the TERMINATED status

func WaitForVMInstanceUp

func WaitForVMInstanceUp(timeout int, delay int, instanceName string, gcpProjectID string, instanceZone string) error

WaitForVMInstanceUp will wait for the VM instance to attain the RUNNING status

func WaitForVolumeAttachment

func WaitForVolumeAttachment(diskName, gcpProjectID, instanceName, zone string, delay, timeout int) error

WaitForVolumeAttachment will wait for the disk volume to get attached to a VM instance

func WaitForVolumeDetachment

func WaitForVolumeDetachment(diskName, gcpProjectID, instanceName, zone string, delay, timeout int) error

WaitForVolumeDetachment will wait for the disk volume to completely detach from a VM instance

Types

type GCPServiceAccountCredentials

type GCPServiceAccountCredentials struct {
	GCPType          string `json:"type"`
	GCPProjectID     string `json:"project_id"`
	GCPPrivateKeyID  string `json:"private_key_id"`
	GCPPrivateKey    string `json:"private_key"`
	GCPClientEmail   string `json:"client_email"`
	GCPClientID      string `json:"client_id"`
	GCPAuthURI       string `json:"auth_uri"`
	GCPTokenURI      string `json:"token_uri"`
	GCPAuthCertURL   string `json:"auth_provider_x509_cert_url"`
	GCPClientCertURL string `json:"client_x509_cert_url"`
}

GCPServiceAccountCredentials stores the service account credentials

Jump to

Keyboard shortcuts

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