diskclient

package
v0.0.0-...-d88c8b5 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package diskclient implements the client for Disks.

Index

Constants

View Source
const (
	// APIVersion is the API version for compute.
	APIVersion = "2019-07-01"
)

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 Disk client Interface.

func New

func New(config *azclients.ClientConfig) *Client

New creates a new Disk client with ratelimiting.

func (*Client) CreateOrUpdate

func (c *Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, diskParameter compute.Disk) *retry.Error

CreateOrUpdate creates or updates a Disk.

func (*Client) Delete

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

Delete deletes a Disk by name.

func (*Client) Get

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

Get gets a Disk.

func (*Client) ListByResourceGroup

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

ListByResourceGroup lists all the disks under a resource group.

func (*Client) Update

func (c *Client) Update(ctx context.Context, resourceGroupName string, diskName string, diskParameter compute.DiskUpdate) *retry.Error

Update creates or updates a Disk.

type DiskListPage

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

DiskListPage contains a page of Disk values.

func (*DiskListPage) Next

func (page *DiskListPage) 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 (*DiskListPage) NextWithContext

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

func (page DiskListPage) NotDone() bool

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

func (DiskListPage) Response

func (page DiskListPage) Response() compute.DiskList

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

func (DiskListPage) Values

func (page DiskListPage) Values() []compute.Disk

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

type Interface

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

	// CreateOrUpdate creates or updates a Disk.
	CreateOrUpdate(ctx context.Context, resourceGroupName string, diskName string, diskParameter compute.Disk) *retry.Error

	// Update updates a Disk.
	Update(ctx context.Context, resourceGroupName string, diskName string, diskParameter compute.DiskUpdate) *retry.Error

	// Delete deletes a Disk by name.
	Delete(ctx context.Context, resourceGroupName string, diskName string) *retry.Error

	// ListByResourceGroup lists all the disks under a resource group.
	ListByResourceGroup(ctx context.Context, resourceGroupName string) ([]compute.Disk, *retry.Error)
}

Interface is the client interface for Disks. Don't forget to run the following command to generate the mock client: mockgen -source=$GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/diskclient/interface.go -package=mockdiskclient Interface > $GOPATH/src/k8s.io/kubernetes/staging/src/k8s.io/legacy-cloud-providers/azure/clients/diskclient/mockdiskclient/interface.go

Jump to

Keyboard shortcuts

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