vmclient

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2021 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Overview

Package vmclient implements the client for VirtualMachines.

Index

Constants

View Source
const (
	// APIVersion is the API version for VirtualMachine.
	APIVersion = "2020-12-01"
	// AzureStackCloudAPIVersion is the API version for Azure Stack
	AzureStackCloudAPIVersion = "2017-12-01"
	// AzureStackCloudName is the cloud name of Azure Stack
	AzureStackCloudName = "AZURESTACKCLOUD"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {

	// ARM throttling configures.
	RetryAfterReader time.Time
	RetryAfterWriter time.Time
	// contains filtered or unexported fields
}

Client implements VirtualMachine client Interface.

func New

func New(config *azclients.ClientConfig) *Client

New creates a new VirtualMachine client with ratelimiting.

func (*Client) CreateOrUpdate

func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachine, source string) *retry.Error

CreateOrUpdate creates or updates a VirtualMachine.

func (*Client) Delete

func (c *Client) Delete(ctx context.Context, resourceGroupName string, VMName string) *retry.Error

Delete deletes a VirtualMachine.

func (*Client) Get

func (c *Client) Get(ctx context.Context, resourceGroupName string, VMName string, expand compute.InstanceViewTypes) (compute.VirtualMachine, *retry.Error)

Get gets a VirtualMachine.

func (*Client) List

func (c *Client) List(ctx context.Context, resourceGroupName string) ([]compute.VirtualMachine, *retry.Error)

List gets a list of VirtualMachine in the resourceGroupName.

func (*Client) Update

func (c *Client) Update(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) *retry.Error

Update updates a VirtualMachine.

type Interface

type Interface interface {
	// Get gets a VirtualMachine.
	Get(ctx context.Context, resourceGroupName string, VMName string, expand compute.InstanceViewTypes) (compute.VirtualMachine, *retry.Error)

	// List gets a list of VirtualMachines in the resourceGroupName.
	List(ctx context.Context, resourceGroupName string) ([]compute.VirtualMachine, *retry.Error)

	// CreateOrUpdate creates or updates a VirtualMachine.
	CreateOrUpdate(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachine, source string) *retry.Error

	// Update updates a VirtualMachine.
	Update(ctx context.Context, resourceGroupName string, VMName string, parameters compute.VirtualMachineUpdate, source string) *retry.Error

	// Delete deletes a VirtualMachine.
	Delete(ctx context.Context, resourceGroupName string, VMName string) *retry.Error
}

Interface is the client interface for VirtualMachines. Don't forget to run the following command to generate the mock client: mockgen -source=$GOPATH/src/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/interface.go -package=mockvmclient Interface > $GOPATH/src/sigs.k8s.io/cloud-provider-azure/pkg/azureclients/vmclient/mockvmclient/interface.go

type VirtualMachineListResultPage

type VirtualMachineListResultPage struct {
	// contains filtered or unexported fields
}

VirtualMachineListResultPage contains a page of VirtualMachine values.

func (*VirtualMachineListResultPage) Next

func (page *VirtualMachineListResultPage) Next() error

Next advances to the next page of values. If there was an error making the request the page does not advance and the error is returned. Deprecated: Use NextWithContext() instead.

func (*VirtualMachineListResultPage) NextWithContext

func (page *VirtualMachineListResultPage) NextWithContext(ctx context.Context) (err error)

NextWithContext advances to the next page of values. If there was an error making the request the page does not advance and the error is returned.

func (VirtualMachineListResultPage) NotDone

func (page VirtualMachineListResultPage) NotDone() bool

NotDone returns true if the page enumeration should be started or is not yet complete.

func (VirtualMachineListResultPage) Response

Response returns the raw server response from the last page request.

func (VirtualMachineListResultPage) Values

Values returns the slice of values for the current page or nil if there are no values.

Directories

Path Synopsis
Package mockvmclient implements the mock client for VirtualMachines.
Package mockvmclient implements the mock client for VirtualMachines.

Jump to

Keyboard shortcuts

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