fileshares

package
v0.20221118.1153619 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2022 License: MPL-2.0 Imports: 10 Imported by: 0

README

github.com/hashicorp/go-azure-sdk/resource-manager/storage/2022-09-01/fileshares Documentation

The fileshares SDK allows for interaction with the Azure Resource Manager Service storage (API Version 2022-09-01).

This readme covers example usages, but further information on using this SDK can be found in the project root.

Import Path

import "github.com/hashicorp/go-azure-sdk/resource-manager/storage/2022-09-01/fileshares"

Client Initialization

client := fileshares.NewFileSharesClientWithBaseURI("https://management.azure.com")
client.Client.Authorizer = authorizer

Example Usage: FileSharesClient.Create

ctx := context.TODO()
id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "shareValue")

payload := fileshares.FileShare{
	// ...
}


read, err := client.Create(ctx, id, payload, fileshares.DefaultCreateOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: FileSharesClient.Delete

ctx := context.TODO()
id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "shareValue")

read, err := client.Delete(ctx, id, fileshares.DefaultDeleteOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: FileSharesClient.Get

ctx := context.TODO()
id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "shareValue")

read, err := client.Get(ctx, id, fileshares.DefaultGetOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: FileSharesClient.Lease

ctx := context.TODO()
id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "shareValue")

payload := fileshares.LeaseShareRequest{
	// ...
}


read, err := client.Lease(ctx, id, payload, fileshares.DefaultLeaseOperationOptions())
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: FileSharesClient.List

ctx := context.TODO()
id := fileshares.NewStorageAccountID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue")

// alternatively `client.List(ctx, id, fileshares.DefaultListOperationOptions())` can be used to do batched pagination
items, err := client.ListComplete(ctx, id, fileshares.DefaultListOperationOptions())
if err != nil {
	// handle the error
}
for _, item := range items {
	// do something
}

Example Usage: FileSharesClient.Restore

ctx := context.TODO()
id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "shareValue")

payload := fileshares.DeletedShare{
	// ...
}


read, err := client.Restore(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Example Usage: FileSharesClient.Update

ctx := context.TODO()
id := fileshares.NewShareID("12345678-1234-9876-4563-123456789012", "example-resource-group", "accountValue", "shareValue")

payload := fileshares.FileShare{
	// ...
}


read, err := client.Update(ctx, id, payload)
if err != nil {
	// handle the error
}
if model := read.Model; model != nil {
	// do something with the model/response object
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PossibleValuesForEnabledProtocols

func PossibleValuesForEnabledProtocols() []string

func PossibleValuesForLeaseDuration

func PossibleValuesForLeaseDuration() []string

func PossibleValuesForLeaseShareAction

func PossibleValuesForLeaseShareAction() []string

func PossibleValuesForLeaseState

func PossibleValuesForLeaseState() []string

func PossibleValuesForLeaseStatus

func PossibleValuesForLeaseStatus() []string

func PossibleValuesForRootSquashType

func PossibleValuesForRootSquashType() []string

func PossibleValuesForShareAccessTier

func PossibleValuesForShareAccessTier() []string

func ValidateShareID

func ValidateShareID(input interface{}, key string) (warnings []string, errors []error)

ValidateShareID checks that 'input' can be parsed as a Share ID

func ValidateStorageAccountID

func ValidateStorageAccountID(input interface{}, key string) (warnings []string, errors []error)

ValidateStorageAccountID checks that 'input' can be parsed as a Storage Account ID

Types

type AccessPolicy

type AccessPolicy struct {
	ExpiryTime *string `json:"expiryTime,omitempty"`
	Permission *string `json:"permission,omitempty"`
	StartTime  *string `json:"startTime,omitempty"`
}

func (*AccessPolicy) GetExpiryTimeAsTime

func (o *AccessPolicy) GetExpiryTimeAsTime() (*time.Time, error)

func (*AccessPolicy) GetStartTimeAsTime

func (o *AccessPolicy) GetStartTimeAsTime() (*time.Time, error)

func (*AccessPolicy) SetExpiryTimeAsTime

func (o *AccessPolicy) SetExpiryTimeAsTime(input time.Time)

func (*AccessPolicy) SetStartTimeAsTime

func (o *AccessPolicy) SetStartTimeAsTime(input time.Time)

type CreateOperationOptions

type CreateOperationOptions struct {
	Expand *string
}

func DefaultCreateOperationOptions

func DefaultCreateOperationOptions() CreateOperationOptions

type CreateOperationResponse

type CreateOperationResponse struct {
	HttpResponse *http.Response
	Model        *FileShare
}

type DeleteOperationOptions

type DeleteOperationOptions struct {
	Include     *string
	XMsSnapshot *string
}

func DefaultDeleteOperationOptions

func DefaultDeleteOperationOptions() DeleteOperationOptions

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
}

type DeletedShare

type DeletedShare struct {
	DeletedShareName    string `json:"deletedShareName"`
	DeletedShareVersion string `json:"deletedShareVersion"`
}

type EnabledProtocols

type EnabledProtocols string
const (
	EnabledProtocolsNFS EnabledProtocols = "NFS"
	EnabledProtocolsSMB EnabledProtocols = "SMB"
)

type FileShare

type FileShare struct {
	Etag       *string              `json:"etag,omitempty"`
	Id         *string              `json:"id,omitempty"`
	Name       *string              `json:"name,omitempty"`
	Properties *FileShareProperties `json:"properties,omitempty"`
	Type       *string              `json:"type,omitempty"`
}

type FileShareItem

type FileShareItem struct {
	Etag       *string              `json:"etag,omitempty"`
	Id         *string              `json:"id,omitempty"`
	Name       *string              `json:"name,omitempty"`
	Properties *FileShareProperties `json:"properties,omitempty"`
	Type       *string              `json:"type,omitempty"`
}

type FileShareItemOperationPredicate

type FileShareItemOperationPredicate struct {
	Etag *string
	Id   *string
	Name *string
	Type *string
}

func (FileShareItemOperationPredicate) Matches

type FileShareProperties

type FileShareProperties struct {
	AccessTier             *ShareAccessTier    `json:"accessTier,omitempty"`
	AccessTierChangeTime   *string             `json:"accessTierChangeTime,omitempty"`
	AccessTierStatus       *string             `json:"accessTierStatus,omitempty"`
	Deleted                *bool               `json:"deleted,omitempty"`
	DeletedTime            *string             `json:"deletedTime,omitempty"`
	EnabledProtocols       *EnabledProtocols   `json:"enabledProtocols,omitempty"`
	LastModifiedTime       *string             `json:"lastModifiedTime,omitempty"`
	LeaseDuration          *LeaseDuration      `json:"leaseDuration,omitempty"`
	LeaseState             *LeaseState         `json:"leaseState,omitempty"`
	LeaseStatus            *LeaseStatus        `json:"leaseStatus,omitempty"`
	Metadata               *map[string]string  `json:"metadata,omitempty"`
	RemainingRetentionDays *int64              `json:"remainingRetentionDays,omitempty"`
	RootSquash             *RootSquashType     `json:"rootSquash,omitempty"`
	ShareQuota             *int64              `json:"shareQuota,omitempty"`
	ShareUsageBytes        *int64              `json:"shareUsageBytes,omitempty"`
	SignedIdentifiers      *[]SignedIdentifier `json:"signedIdentifiers,omitempty"`
	SnapshotTime           *string             `json:"snapshotTime,omitempty"`
	Version                *string             `json:"version,omitempty"`
}

func (*FileShareProperties) GetAccessTierChangeTimeAsTime

func (o *FileShareProperties) GetAccessTierChangeTimeAsTime() (*time.Time, error)

func (*FileShareProperties) GetDeletedTimeAsTime

func (o *FileShareProperties) GetDeletedTimeAsTime() (*time.Time, error)

func (*FileShareProperties) GetLastModifiedTimeAsTime

func (o *FileShareProperties) GetLastModifiedTimeAsTime() (*time.Time, error)

func (*FileShareProperties) GetSnapshotTimeAsTime

func (o *FileShareProperties) GetSnapshotTimeAsTime() (*time.Time, error)

func (*FileShareProperties) SetAccessTierChangeTimeAsTime

func (o *FileShareProperties) SetAccessTierChangeTimeAsTime(input time.Time)

func (*FileShareProperties) SetDeletedTimeAsTime

func (o *FileShareProperties) SetDeletedTimeAsTime(input time.Time)

func (*FileShareProperties) SetLastModifiedTimeAsTime

func (o *FileShareProperties) SetLastModifiedTimeAsTime(input time.Time)

func (*FileShareProperties) SetSnapshotTimeAsTime

func (o *FileShareProperties) SetSnapshotTimeAsTime(input time.Time)

type FileSharesClient

type FileSharesClient struct {
	Client autorest.Client
	// contains filtered or unexported fields
}

func NewFileSharesClientWithBaseURI

func NewFileSharesClientWithBaseURI(endpoint string) FileSharesClient

func (FileSharesClient) Create

func (c FileSharesClient) Create(ctx context.Context, id ShareId, input FileShare, options CreateOperationOptions) (result CreateOperationResponse, err error)

Create ...

func (FileSharesClient) Delete

Delete ...

func (FileSharesClient) Get

Get ...

func (FileSharesClient) Lease

Lease ...

func (FileSharesClient) List

List ...

func (FileSharesClient) ListComplete

ListComplete retrieves all of the results into a single object

func (FileSharesClient) ListCompleteMatchingPredicate

func (c FileSharesClient) ListCompleteMatchingPredicate(ctx context.Context, id StorageAccountId, options ListOperationOptions, predicate FileShareItemOperationPredicate) (resp ListCompleteResult, err error)

ListCompleteMatchingPredicate retrieves all of the results and then applied the predicate

func (FileSharesClient) Restore

func (c FileSharesClient) Restore(ctx context.Context, id ShareId, input DeletedShare) (result RestoreOperationResponse, err error)

Restore ...

func (FileSharesClient) Update

func (c FileSharesClient) Update(ctx context.Context, id ShareId, input FileShare) (result UpdateOperationResponse, err error)

Update ...

type GetOperationOptions

type GetOperationOptions struct {
	Expand      *string
	XMsSnapshot *string
}

func DefaultGetOperationOptions

func DefaultGetOperationOptions() GetOperationOptions

type GetOperationResponse

type GetOperationResponse struct {
	HttpResponse *http.Response
	Model        *FileShare
}

type LeaseDuration

type LeaseDuration string
const (
	LeaseDurationFixed    LeaseDuration = "Fixed"
	LeaseDurationInfinite LeaseDuration = "Infinite"
)

type LeaseOperationOptions

type LeaseOperationOptions struct {
	XMsSnapshot *string
}

func DefaultLeaseOperationOptions

func DefaultLeaseOperationOptions() LeaseOperationOptions

type LeaseOperationResponse

type LeaseOperationResponse struct {
	HttpResponse *http.Response
	Model        *LeaseShareResponse
}

type LeaseShareAction

type LeaseShareAction string
const (
	LeaseShareActionAcquire LeaseShareAction = "Acquire"
	LeaseShareActionBreak   LeaseShareAction = "Break"
	LeaseShareActionChange  LeaseShareAction = "Change"
	LeaseShareActionRelease LeaseShareAction = "Release"
	LeaseShareActionRenew   LeaseShareAction = "Renew"
)

type LeaseShareRequest

type LeaseShareRequest struct {
	Action          LeaseShareAction `json:"action"`
	BreakPeriod     *int64           `json:"breakPeriod,omitempty"`
	LeaseDuration   *int64           `json:"leaseDuration,omitempty"`
	LeaseId         *string          `json:"leaseId,omitempty"`
	ProposedLeaseId *string          `json:"proposedLeaseId,omitempty"`
}

type LeaseShareResponse

type LeaseShareResponse struct {
	LeaseId          *string `json:"leaseId,omitempty"`
	LeaseTimeSeconds *string `json:"leaseTimeSeconds,omitempty"`
}

type LeaseState

type LeaseState string
const (
	LeaseStateAvailable LeaseState = "Available"
	LeaseStateBreaking  LeaseState = "Breaking"
	LeaseStateBroken    LeaseState = "Broken"
	LeaseStateExpired   LeaseState = "Expired"
	LeaseStateLeased    LeaseState = "Leased"
)

type LeaseStatus

type LeaseStatus string
const (
	LeaseStatusLocked   LeaseStatus = "Locked"
	LeaseStatusUnlocked LeaseStatus = "Unlocked"
)

type ListCompleteResult

type ListCompleteResult struct {
	Items []FileShareItem
}

type ListOperationOptions

type ListOperationOptions struct {
	Expand      *string
	Filter      *string
	Maxpagesize *string
}

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	Model        *[]FileShareItem
	// contains filtered or unexported fields
}

func (ListOperationResponse) HasMore

func (r ListOperationResponse) HasMore() bool

func (ListOperationResponse) LoadMore

func (r ListOperationResponse) LoadMore(ctx context.Context) (resp ListOperationResponse, err error)

type RestoreOperationResponse

type RestoreOperationResponse struct {
	HttpResponse *http.Response
}

type RootSquashType

type RootSquashType string
const (
	RootSquashTypeAllSquash    RootSquashType = "AllSquash"
	RootSquashTypeNoRootSquash RootSquashType = "NoRootSquash"
	RootSquashTypeRootSquash   RootSquashType = "RootSquash"
)

type ShareAccessTier

type ShareAccessTier string
const (
	ShareAccessTierCool                 ShareAccessTier = "Cool"
	ShareAccessTierHot                  ShareAccessTier = "Hot"
	ShareAccessTierPremium              ShareAccessTier = "Premium"
	ShareAccessTierTransactionOptimized ShareAccessTier = "TransactionOptimized"
)

type ShareId

type ShareId struct {
	SubscriptionId    string
	ResourceGroupName string
	AccountName       string
	ShareName         string
}

ShareId is a struct representing the Resource ID for a Share

func NewShareID

func NewShareID(subscriptionId string, resourceGroupName string, accountName string, shareName string) ShareId

NewShareID returns a new ShareId struct

func ParseShareID

func ParseShareID(input string) (*ShareId, error)

ParseShareID parses 'input' into a ShareId

func ParseShareIDInsensitively

func ParseShareIDInsensitively(input string) (*ShareId, error)

ParseShareIDInsensitively parses 'input' case-insensitively into a ShareId note: this method should only be used for API response data and not user input

func (ShareId) ID

func (id ShareId) ID() string

ID returns the formatted Share ID

func (ShareId) Segments

func (id ShareId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Share ID

func (ShareId) String

func (id ShareId) String() string

String returns a human-readable description of this Share ID

type SignedIdentifier

type SignedIdentifier struct {
	AccessPolicy *AccessPolicy `json:"accessPolicy,omitempty"`
	Id           *string       `json:"id,omitempty"`
}

type StorageAccountId

type StorageAccountId struct {
	SubscriptionId    string
	ResourceGroupName string
	AccountName       string
}

StorageAccountId is a struct representing the Resource ID for a Storage Account

func NewStorageAccountID

func NewStorageAccountID(subscriptionId string, resourceGroupName string, accountName string) StorageAccountId

NewStorageAccountID returns a new StorageAccountId struct

func ParseStorageAccountID

func ParseStorageAccountID(input string) (*StorageAccountId, error)

ParseStorageAccountID parses 'input' into a StorageAccountId

func ParseStorageAccountIDInsensitively

func ParseStorageAccountIDInsensitively(input string) (*StorageAccountId, error)

ParseStorageAccountIDInsensitively parses 'input' case-insensitively into a StorageAccountId note: this method should only be used for API response data and not user input

func (StorageAccountId) ID

func (id StorageAccountId) ID() string

ID returns the formatted Storage Account ID

func (StorageAccountId) Segments

func (id StorageAccountId) Segments() []resourceids.Segment

Segments returns a slice of Resource ID Segments which comprise this Storage Account ID

func (StorageAccountId) String

func (id StorageAccountId) String() string

String returns a human-readable description of this Storage Account ID

type UpdateOperationResponse

type UpdateOperationResponse struct {
	HttpResponse *http.Response
	Model        *FileShare
}

Jump to

Keyboard shortcuts

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