compute

package
v0.0.0-...-04ad9f0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2022 License: Apache-2.0 Imports: 14 Imported by: 18

Documentation

Overview

Package compute provides access to the Google Compute API.

Index

Constants

This section is empty.

Variables

View Source
var OperationErrorCodeFormat = "Code: %s"

OperationErrorCodeFormat is the format of operation error code.

Functions

This section is empty.

Types

type Client

type Client interface {
	AttachDisk(project, zone, instance string, d *compute.AttachedDisk) error
	DetachDisk(project, zone, instance, disk string) error
	CreateDisk(project, zone string, d *compute.Disk) error
	CreateDiskAlpha(project, zone string, d *computeAlpha.Disk) error
	CreateDiskBeta(project, zone string, d *computeBeta.Disk) error
	CreateForwardingRule(project, region string, fr *compute.ForwardingRule) error
	CreateFirewallRule(project string, i *compute.Firewall) error
	CreateImage(project string, i *compute.Image) error
	CreateImageAlpha(project string, i *computeAlpha.Image) error
	CreateImageBeta(project string, i *computeBeta.Image) error
	CreateInstance(project, zone string, i *compute.Instance) error
	CreateInstanceAlpha(project, zone string, i *computeAlpha.Instance) error
	CreateInstanceBeta(project, zone string, i *computeBeta.Instance) error
	CreateNetwork(project string, n *compute.Network) error
	CreateSnapshot(project, zone, disk string, s *compute.Snapshot) error
	CreateSubnetwork(project, region string, n *compute.Subnetwork) error
	CreateTargetInstance(project, zone string, ti *compute.TargetInstance) error
	DeleteDisk(project, zone, name string) error
	DeleteForwardingRule(project, region, name string) error
	DeleteFirewallRule(project, name string) error
	DeleteImage(project, name string) error
	DeleteInstance(project, zone, name string) error
	StartInstance(project, zone, name string) error
	StopInstance(project, zone, name string) error
	DeleteNetwork(project, name string) error
	DeleteSubnetwork(project, region, name string) error
	DeleteTargetInstance(project, zone, name string) error
	DeprecateImage(project, name string, deprecationstatus *compute.DeprecationStatus) error
	DeprecateImageAlpha(project, name string, deprecationstatus *computeAlpha.DeprecationStatus) error
	GetMachineType(project, zone, machineType string) (*compute.MachineType, error)
	GetProject(project string) (*compute.Project, error)
	GetSerialPortOutput(project, zone, name string, port, start int64) (*compute.SerialPortOutput, error)
	GetZone(project, zone string) (*compute.Zone, error)
	GetInstance(project, zone, name string) (*compute.Instance, error)
	GetInstanceAlpha(project, zone, name string) (*computeAlpha.Instance, error)
	GetInstanceBeta(project, zone, name string) (*computeBeta.Instance, error)
	GetDisk(project, zone, name string) (*compute.Disk, error)
	GetDiskAlpha(project, zone, name string) (*computeAlpha.Disk, error)
	GetDiskBeta(project, zone, name string) (*computeBeta.Disk, error)
	GetForwardingRule(project, region, name string) (*compute.ForwardingRule, error)
	GetFirewallRule(project, name string) (*compute.Firewall, error)
	GetGuestAttributes(project, zone, name, queryPath, variableKey string) (*compute.GuestAttributes, error)
	GetImage(project, name string) (*compute.Image, error)
	GetImageAlpha(project, name string) (*computeAlpha.Image, error)
	GetImageBeta(project, name string) (*computeBeta.Image, error)
	GetImageFromFamily(project, family string) (*compute.Image, error)
	GetLicense(project, name string) (*compute.License, error)
	GetNetwork(project, name string) (*compute.Network, error)
	GetSubnetwork(project, region, name string) (*compute.Subnetwork, error)
	GetTargetInstance(project, zone, name string) (*compute.TargetInstance, error)
	InstanceStatus(project, zone, name string) (string, error)
	InstanceStopped(project, zone, name string) (bool, error)
	ListMachineTypes(project, zone string, opts ...ListCallOption) ([]*compute.MachineType, error)
	ListLicenses(project string, opts ...ListCallOption) ([]*compute.License, error)
	ListZones(project string, opts ...ListCallOption) ([]*compute.Zone, error)
	ListRegions(project string, opts ...ListCallOption) ([]*compute.Region, error)
	AggregatedListInstances(project string, opts ...ListCallOption) ([]*compute.Instance, error)
	ListInstances(project, zone string, opts ...ListCallOption) ([]*compute.Instance, error)
	AggregatedListDisks(project string, opts ...ListCallOption) ([]*compute.Disk, error)
	ListDisks(project, zone string, opts ...ListCallOption) ([]*compute.Disk, error)
	ListForwardingRules(project, zone string, opts ...ListCallOption) ([]*compute.ForwardingRule, error)
	ListFirewallRules(project string, opts ...ListCallOption) ([]*compute.Firewall, error)
	ListImages(project string, opts ...ListCallOption) ([]*compute.Image, error)
	ListImagesAlpha(project string, opts ...ListCallOption) ([]*computeAlpha.Image, error)
	GetSnapshot(project, name string) (*compute.Snapshot, error)
	ListSnapshots(project string, opts ...ListCallOption) ([]*compute.Snapshot, error)
	DeleteSnapshot(project, name string) error
	ListNetworks(project string, opts ...ListCallOption) ([]*compute.Network, error)
	AggregatedListSubnetworks(project string, opts ...ListCallOption) ([]*compute.Subnetwork, error)
	ListSubnetworks(project, region string, opts ...ListCallOption) ([]*compute.Subnetwork, error)
	ListTargetInstances(project, zone string, opts ...ListCallOption) ([]*compute.TargetInstance, error)
	ResizeDisk(project, zone, disk string, drr *compute.DisksResizeRequest) error
	SetInstanceMetadata(project, zone, name string, md *compute.Metadata) error
	SetCommonInstanceMetadata(project string, md *compute.Metadata) error
	SetDiskAutoDelete(project, zone, instance string, autoDelete bool, deviceName string) error
	ListMachineImages(project string, opts ...ListCallOption) ([]*compute.MachineImage, error)
	DeleteMachineImage(project, name string) error
	CreateMachineImage(project string, i *compute.MachineImage) error
	GetMachineImage(project, name string) (*compute.MachineImage, error)

	Retry(f func(opts ...googleapi.CallOption) (*compute.Operation, error), opts ...googleapi.CallOption) (op *compute.Operation, err error)
	RetryBeta(f func(opts ...googleapi.CallOption) (*computeBeta.Operation, error), opts ...googleapi.CallOption) (op *computeBeta.Operation, err error)
	BasePath() string
}

Client is a client for interacting with Google Cloud Compute.

func NewClient

func NewClient(ctx context.Context, opts ...option.ClientOption) (Client, error)

NewClient creates a new Google Cloud Compute client.

type Filter

type Filter string

Filter sets the optional parameter "filter": Sets a filter {expression} for filtering listed resources. Your {expression} must be in the format: field_name comparison_string literal_string.

type ListCallOption

type ListCallOption interface {
	// contains filtered or unexported methods
}

A ListCallOption is an option for a Google Compute API *ListCall.

type OrderBy

type OrderBy string

OrderBy sets the optional parameter "orderBy": Sorts list results by a certain order. By default, results are returned in alphanumerical order based on the resource name.

type TestClient

type TestClient struct {
	AttachDiskFn                func(project, zone, instance string, d *compute.AttachedDisk) error
	DetachDiskFn                func(project, zone, instance, disk string) error
	CreateDiskFn                func(project, zone string, d *compute.Disk) error
	CreateForwardingRuleFn      func(project, region string, fr *compute.ForwardingRule) error
	CreateFirewallRuleFn        func(project string, i *compute.Firewall) error
	CreateImageFn               func(project string, i *compute.Image) error
	CreateInstanceFn            func(project, zone string, i *compute.Instance) error
	CreateNetworkFn             func(project string, n *compute.Network) error
	CreateSnapshotFn            func(project, zone, disk string, s *compute.Snapshot) error
	CreateSubnetworkFn          func(project, region string, n *compute.Subnetwork) error
	CreateTargetInstanceFn      func(project, zone string, ti *compute.TargetInstance) error
	StartInstanceFn             func(project, zone, name string) error
	StopInstanceFn              func(project, zone, name string) error
	DeleteDiskFn                func(project, zone, name string) error
	DeleteForwardingRuleFn      func(project, region, name string) error
	DeleteFirewallRuleFn        func(project, name string) error
	DeleteImageFn               func(project, name string) error
	DeleteInstanceFn            func(project, zone, name string) error
	DeleteNetworkFn             func(project, name string) error
	DeleteSubnetworkFn          func(project, region, name string) error
	DeleteTargetInstanceFn      func(project, zone, name string) error
	DeprecateImageFn            func(project, name string, deprecationstatus *compute.DeprecationStatus) error
	GetMachineTypeFn            func(project, zone, machineType string) (*compute.MachineType, error)
	ListMachineTypesFn          func(project, zone string, opts ...ListCallOption) ([]*compute.MachineType, error)
	GetProjectFn                func(project string) (*compute.Project, error)
	GetSerialPortOutputFn       func(project, zone, name string, port, start int64) (*compute.SerialPortOutput, error)
	GetGuestAttributesFn        func(project, zone, name, queryPath, variableKey string) (*compute.GuestAttributes, error)
	GetZoneFn                   func(project, zone string) (*compute.Zone, error)
	ListZonesFn                 func(project string, opts ...ListCallOption) ([]*compute.Zone, error)
	GetInstanceFn               func(project, zone, name string) (*compute.Instance, error)
	AggregatedListInstancesFn   func(project string, opts ...ListCallOption) ([]*compute.Instance, error)
	ListInstancesFn             func(project, zone string, opts ...ListCallOption) ([]*compute.Instance, error)
	ListSnapshotsFn             func(project string, opts ...ListCallOption) ([]*compute.Snapshot, error)
	GetSnapshotFn               func(project, name string) (*compute.Snapshot, error)
	DeleteSnapshotFn            func(project, name string) error
	GetDiskFn                   func(project, zone, name string) (*compute.Disk, error)
	AggregatedListDisksFn       func(project string, opts ...ListCallOption) ([]*compute.Disk, error)
	ListDisksFn                 func(project, zone string, opts ...ListCallOption) ([]*compute.Disk, error)
	GetForwardingRuleFn         func(project, region, name string) (*compute.ForwardingRule, error)
	ListForwardingRulesFn       func(project, region string, opts ...ListCallOption) ([]*compute.ForwardingRule, error)
	GetFirewallRuleFn           func(project, name string) (*compute.Firewall, error)
	ListFirewallRulesFn         func(project string, opts ...ListCallOption) ([]*compute.Firewall, error)
	GetImageFn                  func(project, name string) (*compute.Image, error)
	GetImageFromFamilyFn        func(project, family string) (*compute.Image, error)
	ListImagesFn                func(project string, opts ...ListCallOption) ([]*compute.Image, error)
	GetLicenseFn                func(project, name string) (*compute.License, error)
	ListLicensesFn              func(project string, opts ...ListCallOption) ([]*compute.License, error)
	GetNetworkFn                func(project, name string) (*compute.Network, error)
	AggregatedListSubnetworksFn func(project string, opts ...ListCallOption) ([]*compute.Subnetwork, error)
	ListNetworksFn              func(project string, opts ...ListCallOption) ([]*compute.Network, error)
	GetSubnetworkFn             func(project, region, name string) (*compute.Subnetwork, error)
	ListSubnetworksFn           func(project, region string, opts ...ListCallOption) ([]*compute.Subnetwork, error)
	GetTargetInstanceFn         func(project, zone, name string) (*compute.TargetInstance, error)
	ListTargetInstancesFn       func(project, zone string, opts ...ListCallOption) ([]*compute.TargetInstance, error)
	InstanceStatusFn            func(project, zone, name string) (string, error)
	InstanceStoppedFn           func(project, zone, name string) (bool, error)
	ResizeDiskFn                func(project, zone, disk string, drr *compute.DisksResizeRequest) error
	SetInstanceMetadataFn       func(project, zone, name string, md *compute.Metadata) error
	SetCommonInstanceMetadataFn func(project string, md *compute.Metadata) error
	ListMachineImagesFn         func(project string, opts ...ListCallOption) ([]*compute.MachineImage, error)
	DeleteMachineImageFn        func(project, name string) error
	CreateMachineImageFn        func(project string, i *compute.MachineImage) error
	GetMachineImageFn           func(project, name string) (*compute.MachineImage, error)
	RetryFn                     func(f func(opts ...googleapi.CallOption) (*compute.Operation, error), opts ...googleapi.CallOption) (op *compute.Operation, err error)

	// Alpha API calls
	CreateInstanceAlphaFn func(project, zone string, i *computeAlpha.Instance) error

	// Beta API calls
	CreateInstanceBetaFn func(project, zone string, i *computeBeta.Instance) error
	// contains filtered or unexported fields
}

TestClient is a Client with overrideable methods.

func NewTestClient

func NewTestClient(handleFunc http.HandlerFunc) (*httptest.Server, *TestClient, error)

NewTestClient returns a TestClient with a replacement http handler function. Methods on the new TestClient are overrideable as well.

func (*TestClient) AggregatedListDisks

func (c *TestClient) AggregatedListDisks(project string, opts ...ListCallOption) ([]*compute.Disk, error)

AggregatedListDisks uses the override method ListInstancesFn or the real implementation.

func (*TestClient) AggregatedListInstances

func (c *TestClient) AggregatedListInstances(project string, opts ...ListCallOption) ([]*compute.Instance, error)

AggregatedListInstances uses the override method ListInstancesFn or the real implementation.

func (*TestClient) AggregatedListSubnetworks

func (c *TestClient) AggregatedListSubnetworks(project string, opts ...ListCallOption) ([]*compute.Subnetwork, error)

AggregatedListSubnetworks uses the override method AggregatedListSubnetworksFn or the real implementation.

func (*TestClient) AttachDisk

func (c *TestClient) AttachDisk(project, zone, instance string, ad *compute.AttachedDisk) error

AttachDisk uses the override method AttachDiskFn or the real implementation.

func (*TestClient) BasePath

func (c *TestClient) BasePath() string

BasePath returns the base path for this client.

func (*TestClient) CreateDisk

func (c *TestClient) CreateDisk(project, zone string, d *compute.Disk) error

CreateDisk uses the override method CreateDiskFn or the real implementation.

func (*TestClient) CreateDiskAlpha

func (c *TestClient) CreateDiskAlpha(project, zone string, d *computeAlpha.Disk) error

CreateDiskAlpha creates a GCE persistent disk.

func (*TestClient) CreateDiskBeta

func (c *TestClient) CreateDiskBeta(project, zone string, d *computeBeta.Disk) error

CreateDiskBeta creates a GCE persistent disk.

func (*TestClient) CreateFirewallRule

func (c *TestClient) CreateFirewallRule(project string, i *compute.Firewall) error

CreateFirewallRule uses the override method CreateFirewallRuleFn or the real implementation.

func (*TestClient) CreateForwardingRule

func (c *TestClient) CreateForwardingRule(project, region string, fr *compute.ForwardingRule) error

CreateForwardingRule uses the override method CreateForwardingRuleFn or the real implementation.

func (*TestClient) CreateImage

func (c *TestClient) CreateImage(project string, i *compute.Image) error

CreateImage uses the override method CreateImageFn or the real implementation.

func (*TestClient) CreateImageAlpha

func (c *TestClient) CreateImageAlpha(project string, i *computeAlpha.Image) error

CreateImageAlpha creates a GCE image using Alpha API. Only one of sourceDisk or sourceFile must be specified, sourceDisk is the url (full or partial) to the source disk, sourceFile is the full Google Cloud Storage URL where the disk image is stored.

func (*TestClient) CreateImageBeta

func (c *TestClient) CreateImageBeta(project string, i *computeBeta.Image) error

CreateImageBeta creates a GCE image using Beta API. Only one of sourceDisk or sourceFile must be specified, sourceDisk is the url (full or partial) to the source disk, sourceFile is the full Google Cloud Storage URL where the disk image is stored.

func (*TestClient) CreateInstance

func (c *TestClient) CreateInstance(project, zone string, i *compute.Instance) error

CreateInstance uses the override method CreateInstanceFn or the real implementation.

func (*TestClient) CreateInstanceAlpha

func (c *TestClient) CreateInstanceAlpha(project, zone string, i *computeAlpha.Instance) error

CreateInstanceAlpha uses the override method CreateInstanceAlphaFn or the real implementation.

func (*TestClient) CreateInstanceBeta

func (c *TestClient) CreateInstanceBeta(project, zone string, i *computeBeta.Instance) error

CreateInstanceBeta uses the override method CreateInstanceBetaFn or the real implementation.

func (*TestClient) CreateMachineImage

func (c *TestClient) CreateMachineImage(project string, mi *compute.MachineImage) error

CreateMachineImage uses the override method CreateMachineImageFn or the real implementation.

func (*TestClient) CreateNetwork

func (c *TestClient) CreateNetwork(project string, n *compute.Network) error

CreateNetwork uses the override method CreateNetworkFn or the real implementation.

func (*TestClient) CreateSnapshot

func (c *TestClient) CreateSnapshot(project, zone, disk string, s *compute.Snapshot) error

CreateSnapshot uses the override method CreateSnapshotFn or the real implementation.

func (*TestClient) CreateSubnetwork

func (c *TestClient) CreateSubnetwork(project, region string, n *compute.Subnetwork) error

CreateSubnetwork uses the override method CreateSubnetworkFn or the real implementation.

func (*TestClient) CreateTargetInstance

func (c *TestClient) CreateTargetInstance(project, zone string, ti *compute.TargetInstance) error

CreateTargetInstance uses the override method CreateTargetInstanceFn or the real implementation.

func (*TestClient) DeleteDisk

func (c *TestClient) DeleteDisk(project, zone, name string) error

DeleteDisk uses the override method DeleteDiskFn or the real implementation.

func (*TestClient) DeleteFirewallRule

func (c *TestClient) DeleteFirewallRule(project, name string) error

DeleteFirewallRule uses the override method DeleteFirewallRuleFn or the real implementation.

func (*TestClient) DeleteForwardingRule

func (c *TestClient) DeleteForwardingRule(project, region, name string) error

DeleteForwardingRule uses the override method DeleteForwardingRuleFn or the real implementation.

func (*TestClient) DeleteImage

func (c *TestClient) DeleteImage(project, name string) error

DeleteImage uses the override method DeleteImageFn or the real implementation.

func (*TestClient) DeleteInstance

func (c *TestClient) DeleteInstance(project, zone, name string) error

DeleteInstance uses the override method DeleteInstanceFn or the real implementation.

func (*TestClient) DeleteMachineImage

func (c *TestClient) DeleteMachineImage(project, name string) error

DeleteMachineImage uses the override method DeleteMachineImageFn or the real implementation.

func (*TestClient) DeleteNetwork

func (c *TestClient) DeleteNetwork(project, name string) error

DeleteNetwork uses the override method DeleteNetworkFn or the real implementation.

func (*TestClient) DeleteSnapshot

func (c *TestClient) DeleteSnapshot(project, name string) error

DeleteSnapshot uses the override method DeleteSnapshotFn or the real implementation.

func (*TestClient) DeleteSubnetwork

func (c *TestClient) DeleteSubnetwork(project, region, name string) error

DeleteSubnetwork uses the override method DeleteSubnetworkFn or the real implementation.

func (*TestClient) DeleteTargetInstance

func (c *TestClient) DeleteTargetInstance(project, zone, name string) error

DeleteTargetInstance uses the override method DeleteTargetInstanceFn or the real implementation.

func (*TestClient) DeprecateImage

func (c *TestClient) DeprecateImage(project, name string, deprecationstatus *compute.DeprecationStatus) error

DeprecateImage uses the override method DeprecateImageFn or the real implementation.

func (*TestClient) DeprecateImageAlpha

func (c *TestClient) DeprecateImageAlpha(project, name string, deprecationstatus *computeAlpha.DeprecationStatus) error

DeprecateImageAlpha sets deprecation status on a GCE image using the Alpha API.

func (*TestClient) DetachDisk

func (c *TestClient) DetachDisk(project, zone, instance, disk string) error

DetachDisk uses the override method DetachDiskFn or the real implementation.

func (*TestClient) GetDisk

func (c *TestClient) GetDisk(project, zone, name string) (*compute.Disk, error)

GetDisk uses the override method GetZoneFn or the real implementation.

func (*TestClient) GetDiskAlpha

func (c *TestClient) GetDiskAlpha(project, zone, name string) (*computeAlpha.Disk, error)

GetDiskAlpha gets a GCE Disk.

func (*TestClient) GetDiskBeta

func (c *TestClient) GetDiskBeta(project, zone, name string) (*computeBeta.Disk, error)

GetDiskBeta gets a GCE Disk.

func (*TestClient) GetFirewallRule

func (c *TestClient) GetFirewallRule(project, name string) (*compute.Firewall, error)

GetFirewallRule uses the override method GetFirewallRuleFn or the real implementation.

func (*TestClient) GetForwardingRule

func (c *TestClient) GetForwardingRule(project, region, name string) (*compute.ForwardingRule, error)

GetForwardingRule uses the override method GetForwardingRuleFn or the real implementation.

func (*TestClient) GetGuestAttributes

func (c *TestClient) GetGuestAttributes(project, zone, name, queryPath, variableKey string) (*compute.GuestAttributes, error)

GetGuestAttributes uses the override method GetGuestAttributesFn or the real implementation.

func (*TestClient) GetImage

func (c *TestClient) GetImage(project, name string) (*compute.Image, error)

GetImage uses the override method GetImageFn or the real implementation.

func (*TestClient) GetImageAlpha

func (c *TestClient) GetImageAlpha(project, name string) (*computeAlpha.Image, error)

GetImageAlpha gets a GCE Image using Alpha API

func (*TestClient) GetImageBeta

func (c *TestClient) GetImageBeta(project, name string) (*computeBeta.Image, error)

GetImageBeta gets a GCE Image using Beta API

func (*TestClient) GetImageFromFamily

func (c *TestClient) GetImageFromFamily(project, family string) (*compute.Image, error)

GetImageFromFamily uses the override method GetImageFromFamilyFn or the real implementation.

func (*TestClient) GetInstance

func (c *TestClient) GetInstance(project, zone, name string) (*compute.Instance, error)

GetInstance uses the override method GetZoneFn or the real implementation.

func (*TestClient) GetInstanceAlpha

func (c *TestClient) GetInstanceAlpha(project, zone, name string) (*computeAlpha.Instance, error)

GetInstanceAlpha gets a GCE Instance using Alpha API.

func (*TestClient) GetInstanceBeta

func (c *TestClient) GetInstanceBeta(project, zone, name string) (*computeBeta.Instance, error)

GetInstanceBeta gets a GCE Instance using Beta API.

func (*TestClient) GetLicense

func (c *TestClient) GetLicense(project, name string) (*compute.License, error)

GetLicense uses the override method GetLicenseFn or the real implementation.

func (*TestClient) GetMachineImage

func (c *TestClient) GetMachineImage(project, name string) (*compute.MachineImage, error)

GetMachineImage uses the override method GetMachineImageFn or the real implementation.

func (*TestClient) GetMachineType

func (c *TestClient) GetMachineType(project, zone, machineType string) (*compute.MachineType, error)

GetMachineType uses the override method GetMachineTypeFn or the real implementation.

func (*TestClient) GetNetwork

func (c *TestClient) GetNetwork(project, name string) (*compute.Network, error)

GetNetwork uses the override method GetNetworkFn or the real implementation.

func (*TestClient) GetProject

func (c *TestClient) GetProject(project string) (*compute.Project, error)

GetProject uses the override method GetProjectFn or the real implementation.

func (*TestClient) GetSerialPortOutput

func (c *TestClient) GetSerialPortOutput(project, zone, name string, port, start int64) (*compute.SerialPortOutput, error)

GetSerialPortOutput uses the override method GetSerialPortOutputFn or the real implementation.

func (*TestClient) GetSnapshot

func (c *TestClient) GetSnapshot(project, name string) (*compute.Snapshot, error)

GetSnapshot uses the override method GetSnapshotFn or the real implementation.

func (*TestClient) GetSubnetwork

func (c *TestClient) GetSubnetwork(project, region, name string) (*compute.Subnetwork, error)

GetSubnetwork uses the override method GetSubnetworkFn or the real implementation.

func (*TestClient) GetTargetInstance

func (c *TestClient) GetTargetInstance(project, zone, name string) (*compute.TargetInstance, error)

GetTargetInstance uses the override method GetTargetInstanceFn or the real implementation.

func (*TestClient) GetZone

func (c *TestClient) GetZone(project, zone string) (*compute.Zone, error)

GetZone uses the override method GetZoneFn or the real implementation.

func (*TestClient) InstanceStatus

func (c *TestClient) InstanceStatus(project, zone, name string) (string, error)

InstanceStatus uses the override method InstanceStatusFn or the real implementation.

func (*TestClient) InstanceStopped

func (c *TestClient) InstanceStopped(project, zone, name string) (bool, error)

InstanceStopped uses the override method InstanceStoppedFn or the real implementation.

func (*TestClient) ListDisks

func (c *TestClient) ListDisks(project, zone string, opts ...ListCallOption) ([]*compute.Disk, error)

ListDisks uses the override method ListDisksFn or the real implementation.

func (*TestClient) ListFirewallRules

func (c *TestClient) ListFirewallRules(project string, opts ...ListCallOption) ([]*compute.Firewall, error)

ListFirewallRules uses the override method ListFirewallRulesFn or the real implementation.

func (*TestClient) ListForwardingRules

func (c *TestClient) ListForwardingRules(project, region string, opts ...ListCallOption) ([]*compute.ForwardingRule, error)

ListForwardingRules uses the override method ListForwardingRulesFn or the real implementation.

func (*TestClient) ListImages

func (c *TestClient) ListImages(project string, opts ...ListCallOption) ([]*compute.Image, error)

ListImages uses the override method ListImagesFn or the real implementation.

func (*TestClient) ListImagesAlpha

func (c *TestClient) ListImagesAlpha(project string, opts ...ListCallOption) ([]*computeAlpha.Image, error)

ListImagesAlpha gets a list of GCE Images using Alpha API.

func (*TestClient) ListInstances

func (c *TestClient) ListInstances(project, zone string, opts ...ListCallOption) ([]*compute.Instance, error)

ListInstances uses the override method ListInstancesFn or the real implementation.

func (*TestClient) ListLicenses

func (c *TestClient) ListLicenses(project string, opts ...ListCallOption) ([]*compute.License, error)

ListLicenses uses the override method ListLicensesFn or the real implementation.

func (*TestClient) ListMachineImages

func (c *TestClient) ListMachineImages(project string, opts ...ListCallOption) ([]*compute.MachineImage, error)

ListMachineImages uses the override method ListMachineImagesFn or the real implementation.

func (*TestClient) ListMachineTypes

func (c *TestClient) ListMachineTypes(project, zone string, opts ...ListCallOption) ([]*compute.MachineType, error)

ListMachineTypes uses the override method ListMachineTypesFn or the real implementation.

func (*TestClient) ListNetworks

func (c *TestClient) ListNetworks(project string, opts ...ListCallOption) ([]*compute.Network, error)

ListNetworks uses the override method ListNetworksFn or the real implementation.

func (*TestClient) ListRegions

func (c *TestClient) ListRegions(project string, opts ...ListCallOption) ([]*compute.Region, error)

ListRegions gets a list GCE Regions.

func (*TestClient) ListSnapshots

func (c *TestClient) ListSnapshots(project string, opts ...ListCallOption) ([]*compute.Snapshot, error)

ListSnapshots uses the override method ListSnapshotsFn or the real implementation.

func (*TestClient) ListSubnetworks

func (c *TestClient) ListSubnetworks(project, region string, opts ...ListCallOption) ([]*compute.Subnetwork, error)

ListSubnetworks uses the override method ListSubnetworksFn or the real implementation.

func (*TestClient) ListTargetInstances

func (c *TestClient) ListTargetInstances(project, zone string, opts ...ListCallOption) ([]*compute.TargetInstance, error)

ListTargetInstances uses the override method ListTargetInstancesFn or the real implementation.

func (*TestClient) ListZones

func (c *TestClient) ListZones(project string, opts ...ListCallOption) ([]*compute.Zone, error)

ListZones uses the override method ListZonesFn or the real implementation.

func (*TestClient) ResizeDisk

func (c *TestClient) ResizeDisk(project, zone, disk string, drr *compute.DisksResizeRequest) error

ResizeDisk uses the override method ResizeDiskFn or the real implementation.

func (*TestClient) Retry

func (c *TestClient) Retry(f func(opts ...googleapi.CallOption) (*compute.Operation, error), opts ...googleapi.CallOption) (op *compute.Operation, err error)

Retry uses the override method RetryFn or the real implementation.

func (*TestClient) RetryAlpha

func (c *TestClient) RetryAlpha(f func(opts ...googleapi.CallOption) (*computeAlpha.Operation, error), opts ...googleapi.CallOption) (op *computeAlpha.Operation, err error)

RetryAlpha invokes the given function, retrying it multiple times if the HTTP status response indicates the request should be attempted again or the oauth Token is no longer valid.

func (*TestClient) RetryBeta

func (c *TestClient) RetryBeta(f func(opts ...googleapi.CallOption) (*computeBeta.Operation, error), opts ...googleapi.CallOption) (op *computeBeta.Operation, err error)

RetryBeta invokes the given function, retrying it multiple times if the HTTP status response indicates the request should be attempted again or the oauth Token is no longer valid.

func (*TestClient) SetCommonInstanceMetadata

func (c *TestClient) SetCommonInstanceMetadata(project string, md *compute.Metadata) error

SetCommonInstanceMetadata uses the override method SetCommonInstanceMetadataFn or the real implementation.

func (*TestClient) SetDiskAutoDelete

func (c *TestClient) SetDiskAutoDelete(project, zone, instance string, autoDelete bool, deviceName string) error

SetDiskAutoDelete set auto-delete of an attached disk

func (*TestClient) SetInstanceMetadata

func (c *TestClient) SetInstanceMetadata(project, zone, name string, md *compute.Metadata) error

SetInstanceMetadata uses the override method SetInstancemetadataFn or the real implementation.

func (*TestClient) StartInstance

func (c *TestClient) StartInstance(project, zone, name string) error

StartInstance uses the override method StartInstanceFn or the real implementation.

func (*TestClient) StopInstance

func (c *TestClient) StopInstance(project, zone, name string) error

StopInstance uses the override method StopInstanceFn or the real implementation.

Jump to

Keyboard shortcuts

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