fileclient

package
v1.30.2 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Overview

Package fileclient implements the client for azure file.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client implements the azure file client interface

func (*Client) CreateFileShare

func (c *Client) CreateFileShare(ctx context.Context, resourceGroupName, accountName string, shareOptions *ShareOptions, expand string) (storage.FileShare, error)

CreateFileShare creates a file share expand - optional, used to expand the properties within share's properties. Valid values are: snapshots. Should be passed as a string with delimiter ','

func (*Client) DeleteFileShare

func (c *Client) DeleteFileShare(ctx context.Context, resourceGroupName, accountName, name, xMsSnapshot string) error

DeleteFileShare deletes a file share xMsSnapshot - optional, used to delete a snapshot. It is a DateTime value that uniquely identifies the share snapshot. e.g. "2017-05-10T17:52:33.9551861Z"

func (*Client) GetFileShare

func (c *Client) GetFileShare(ctx context.Context, resourceGroupName, accountName, name, xMsSnapshot string) (storage.FileShare, error)

GetFileShare gets a file share xMsSnapshot - optional, used to retrieve properties of a snapshot. It is a DateTime value that uniquely identifies the share snapshot. e.g. "2017-05-10T17:52:33.9551861Z"

func (*Client) GetServiceProperties added in v0.7.3

func (c *Client) GetServiceProperties(ctx context.Context, resourceGroupName, accountName string) (storage.FileServiceProperties, error)

GetServiceProperties get service properties

func (*Client) ListFileShare added in v1.26.0

func (c *Client) ListFileShare(ctx context.Context, resourceGroupName, accountName, filter, expand string) ([]storage.FileShareItem, error)

ListFileShare gets a file share list expand - optional, used to expand the properties within share's properties. Valid values are: deleted, snapshots. Should be passed as a string with delimiter ','

func (*Client) ResizeFileShare

func (c *Client) ResizeFileShare(ctx context.Context, resourceGroupName, accountName, name string, sizeGiB int) error

ResizeFileShare resizes a file share

func (*Client) SetServiceProperties added in v0.7.3

func (c *Client) SetServiceProperties(ctx context.Context, resourceGroupName, accountName string, parameters storage.FileServiceProperties) (storage.FileServiceProperties, error)

SetServiceProperties set service properties

func (*Client) WithSubscriptionID added in v1.25.0

func (c *Client) WithSubscriptionID(subscriptionID string) Interface

type Interface

type Interface interface {
	CreateFileShare(ctx context.Context, resourceGroupName, accountName string, shareOptions *ShareOptions, expand string) (storage.FileShare, error)
	DeleteFileShare(ctx context.Context, resourceGroupName, accountName, name, xMsSnapshot string) error
	ResizeFileShare(ctx context.Context, resourceGroupName, accountName, name string, sizeGiB int) error
	GetFileShare(ctx context.Context, resourceGroupName, accountName, name, xMsSnapshot string) (storage.FileShare, error)
	ListFileShare(ctx context.Context, resourceGroupName, accountName, filter, expand string) ([]storage.FileShareItem, error)
	GetServiceProperties(ctx context.Context, resourceGroupName, accountName string) (storage.FileServiceProperties, error)
	SetServiceProperties(ctx context.Context, resourceGroupName, accountName string, parameters storage.FileServiceProperties) (storage.FileServiceProperties, error)
	WithSubscriptionID(subscriptionID string) Interface
}

Interface is the client interface for creating file shares, interface for test injection. Don't forget to run "hack/update-mock-clients.sh" command to generate the mock client.

func New

func New(config *azclients.ClientConfig) Interface

New creates a azure file client

type ShareOptions

type ShareOptions struct {
	Name       string
	Protocol   storage.EnabledProtocols
	RequestGiB int
	// supported values: ""(by default), "TransactionOptimized", "Cool", "Hot", "Premium"
	AccessTier string
	// supported values: ""(by default), "AllSquash", "NoRootSquash", "RootSquash"
	RootSquash string
	// Metadata - A name-value pair to associate with the share as metadata.
	Metadata map[string]*string
}

ShareOptions contains the fields which are used to create file share.

Directories

Path Synopsis
Package mockfileclient implements the mock client for azure file.
Package mockfileclient implements the mock client for azure file.

Jump to

Keyboard shortcuts

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