gcp

package
v0.0.0-...-66d0101 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2024 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DiskVolumeAttach

func DiskVolumeAttach(computeService *compute.Service, 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(computeService *compute.Service, instanceName string, gcpProjectID string, zone string, deviceName string) error

DiskVolumeDetach will detach a disk volume from a VM instance

func DiskVolumeStateCheck

func DiskVolumeStateCheck(computeService *compute.Service, experimentsDetails *experimentTypes.ExperimentDetails) error

DiskVolumeStateCheck will check the attachment state of the given volume

func GetDiskDeviceNameForVM

func GetDiskDeviceNameForVM(computeService *compute.Service, targetDiskName, gcpProjectID, zone, instanceName string) (string, error)

GetDiskDeviceNameForVM returns the device name for the target disk for a given VM

func GetDiskVolumeState

func GetDiskVolumeState(computeService *compute.Service, diskName, gcpProjectID, instanceName, zone string) (string, error)

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

func GetGCPComputeService

func GetGCPComputeService() (*compute.Service, error)

GetGCPComputeService returns a new compute service created using the GCP Service Account credentials

func GetVMInstanceStatus

func GetVMInstanceStatus(computeService *compute.Service, instanceName string, gcpProjectID string, instanceZone string) (string, error)

GetVMInstanceStatus returns the status of a VM instance

func GetVolumeAttachmentDetails

func GetVolumeAttachmentDetails(computeService *compute.Service, gcpProjectID string, zone string, diskName string) (string, error)

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

func InstanceStatusCheck

func InstanceStatusCheck(computeService *compute.Service, instanceNamesList []string, gcpProjectId string, instanceZonesList []string) error

InstanceStatusCheck is used to check whether all VM instances under chaos are running or not

func InstanceStatusCheckByName

func InstanceStatusCheckByName(computeService *compute.Service, managedInstanceGroup 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 SetTargetDiskInstanceNames

func SetTargetDiskInstanceNames(computeService *compute.Service, experimentsDetails *experimentTypes.ExperimentDetails) error

SetTargetDiskInstanceNames fetches the vm instances to which the disks are attached

func SetTargetDiskVolumes

func SetTargetDiskVolumes(computeService *compute.Service, experimentsDetails *experimentTypes.ExperimentDetails) error

SetTargetDiskVolumes will select the target disk volumes which are attached to some VM instance and filtered from the given label

func SetTargetInstance

func SetTargetInstance(computeService *compute.Service, experimentsDetails *experimentTypes.ExperimentDetails) error

SetTargetInstance will select the target vm instances which are in RUNNING state and filtered from the given label

func VMInstanceStart

func VMInstanceStart(computeService *compute.Service, instanceName string, gcpProjectID string, instanceZone string) error

VMInstanceStart starts a VM instance

func VMInstanceStop

func VMInstanceStop(computeService *compute.Service, instanceName string, gcpProjectID string, instanceZone string) error

VMInstanceStop stops a VM Instance

func WaitForVMInstanceDown

func WaitForVMInstanceDown(computeService *compute.Service, 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(computeService *compute.Service, 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(computeService *compute.Service, 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(computeService *compute.Service, 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