vmssclient

package
v1.24.18 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2023 License: Apache-2.0 Imports: 14 Imported by: 2

Documentation

Overview

Package vmssclient implements the client for VMSS.

Index

Constants

View Source
const (
	// APIVersion is the API version for VMSS.
	APIVersion = "2022-03-01"
	// AzureStackCloudAPIVersion is the API version for Azure Stack
	AzureStackCloudAPIVersion = "2019-07-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 VMSS client Interface.

func New

func New(config *azclients.ClientConfig) *Client

New creates a new VMSS client with ratelimiting.

func (*Client) CreateOrUpdate

func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) *retry.Error

CreateOrUpdate creates or updates a VirtualMachineScaleSet.

func (*Client) CreateOrUpdateAsync

func (c *Client) CreateOrUpdateAsync(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) (*azure.Future, *retry.Error)

CreateOrUpdateAsync sends the request to arm client and DO NOT wait for the response

func (*Client) DeallocateInstancesAsync

func (c *Client) DeallocateInstancesAsync(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (*azure.Future, *retry.Error)

DeallocateInstancesAsync sends the deallocate request to ARM client and DOEST NOT wait on the future

func (*Client) DeleteInstances

func (c *Client) DeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) *retry.Error

DeleteInstances deletes the instances for a VirtualMachineScaleSet.

func (*Client) DeleteInstancesAsync

func (c *Client) DeleteInstancesAsync(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs, forceDelete bool) (*azure.Future, *retry.Error)

DeleteInstancesAsync sends the delete request to ARM client and DOEST NOT wait on the future

func (*Client) Get

func (c *Client) Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (compute.VirtualMachineScaleSet, *retry.Error)

Get gets a VirtualMachineScaleSet.

func (*Client) List

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

List gets a list of VirtualMachineScaleSets in the resource group.

func (*Client) StartInstancesAsync

func (c *Client) StartInstancesAsync(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (*azure.Future, *retry.Error)

StartInstancesAsync sends the start request to ARM client and DOEST NOT wait on the future

func (*Client) WaitForAsyncOperationResult

func (c *Client) WaitForAsyncOperationResult(ctx context.Context, future *azure.Future, resourceGroupName, request, asycOpName string) (*http.Response, error)

WaitForAsyncOperationResult waits for the response of the request

func (*Client) WaitForCreateOrUpdateResult

func (c *Client) WaitForCreateOrUpdateResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error)

WaitForCreateOrUpdateResult waits for the response of the create or update request

func (*Client) WaitForDeallocateInstancesResult

func (c *Client) WaitForDeallocateInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error)

WaitForDeallocateInstancesResult waits for the response of the delete instance request

func (*Client) WaitForDeleteInstancesResult

func (c *Client) WaitForDeleteInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error)

WaitForDeleteInstancesResult waits for the response of the delete instance request

func (*Client) WaitForStartInstancesResult

func (c *Client) WaitForStartInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error)

WaitForStartInstancesResult waits for the response of the delete instance request

type Interface

type Interface interface {
	// Get gets a VirtualMachineScaleSet.
	Get(ctx context.Context, resourceGroupName string, VMScaleSetName string) (result compute.VirtualMachineScaleSet, rerr *retry.Error)

	// List gets a list of VirtualMachineScaleSets in the resource group.
	List(ctx context.Context, resourceGroupName string) (result []compute.VirtualMachineScaleSet, rerr *retry.Error)

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

	// CreateOrUpdateSync sends the request to arm client and DO NOT wait for the response
	CreateOrUpdateAsync(ctx context.Context, resourceGroupName string, VMScaleSetName string, parameters compute.VirtualMachineScaleSet) (*azure.Future, *retry.Error)

	// WaitForAsyncOperationResult waits for the response of the request
	WaitForAsyncOperationResult(ctx context.Context, future *azure.Future, resourceGroupName, request, asyncOpName string) (*http.Response, error)

	// DeleteInstances deletes the instances for a VirtualMachineScaleSet.
	DeleteInstances(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) *retry.Error

	// DeleteInstancesAsync sends the delete request to the ARM client and DOEST NOT wait on the future
	DeleteInstancesAsync(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs, forceDelete bool) (*azure.Future, *retry.Error)

	// WaitForCreateOrUpdateResult waits for the response of the create or update request
	WaitForCreateOrUpdateResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error)

	// WaitForDeleteInstancesResult waits for the response of the delete instances request
	WaitForDeleteInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error)

	// DeallocateInstances sends the deallocate request to the ARM client and DOEST NOT wait on the future
	DeallocateInstancesAsync(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (*azure.Future, *retry.Error)

	// WaitForDeallocateInstancesResult waits for the response of the deallocate instances request
	WaitForDeallocateInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error)

	// StartInstancesAsync starts the instances for a VirtualMachineScaleSet.
	StartInstancesAsync(ctx context.Context, resourceGroupName string, vmScaleSetName string, vmInstanceIDs compute.VirtualMachineScaleSetVMInstanceRequiredIDs) (*azure.Future, *retry.Error)

	// WaitForStartInstancesResult waits for the response of the start instances request
	WaitForStartInstancesResult(ctx context.Context, future *azure.Future, resourceGroupName string) (*http.Response, error)
}

Interface is the client interface for VirtualMachineScaleSet. Don't forget to run "hack/update-mock-clients.sh" command to generate the mock client.

type VirtualMachineScaleSetListResultPage

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

VirtualMachineScaleSetListResultPage contains a page of VirtualMachineScaleSet values.

func (*VirtualMachineScaleSetListResultPage) Next

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 (*VirtualMachineScaleSetListResultPage) NextWithContext

func (page *VirtualMachineScaleSetListResultPage) 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 (VirtualMachineScaleSetListResultPage) NotDone

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

func (VirtualMachineScaleSetListResultPage) Response

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

func (VirtualMachineScaleSetListResultPage) Values

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

Directories

Path Synopsis
Package mockvmssclient implements the mock client for VMSS.
Package mockvmssclient implements the mock client for VMSS.

Jump to

Keyboard shortcuts

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