fileshares

package
v0.20240123.1162016 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MPL-2.0 Imports: 13 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", "storageAccountValue", "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", "storageAccountValue", "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", "storageAccountValue", "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", "storageAccountValue", "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", "storageAccountValue")

// 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", "storageAccountValue", "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", "storageAccountValue", "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

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

func (CreateOperationOptions) ToHeaders added in v0.20231114.1115341

func (o CreateOperationOptions) ToHeaders() *client.Headers

func (CreateOperationOptions) ToOData added in v0.20231114.1115341

func (o CreateOperationOptions) ToOData() *odata.Query

func (CreateOperationOptions) ToQuery added in v0.20231114.1115341

type CreateOperationResponse

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

type DeleteOperationOptions

type DeleteOperationOptions struct {
	Include     *string
	XMsSnapshot *string
}

func DefaultDeleteOperationOptions

func DefaultDeleteOperationOptions() DeleteOperationOptions

func (DeleteOperationOptions) ToHeaders added in v0.20231114.1115341

func (o DeleteOperationOptions) ToHeaders() *client.Headers

func (DeleteOperationOptions) ToOData added in v0.20231114.1115341

func (o DeleteOperationOptions) ToOData() *odata.Query

func (DeleteOperationOptions) ToQuery added in v0.20231114.1115341

type DeleteOperationResponse

type DeleteOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

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"
)

func (*EnabledProtocols) UnmarshalJSON added in v0.20231114.1115341

func (s *EnabledProtocols) UnmarshalJSON(bytes []byte) error

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 *resourcemanager.Client
}

func NewFileSharesClientWithBaseURI

func NewFileSharesClientWithBaseURI(sdkApi sdkEnv.Api) (*FileSharesClient, error)

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 the results into a single object

func (FileSharesClient) ListCompleteMatchingPredicate

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

ListCompleteMatchingPredicate retrieves all the results and then applies 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

func (GetOperationOptions) ToHeaders added in v0.20231114.1115341

func (o GetOperationOptions) ToHeaders() *client.Headers

func (GetOperationOptions) ToOData added in v0.20231114.1115341

func (o GetOperationOptions) ToOData() *odata.Query

func (GetOperationOptions) ToQuery added in v0.20231114.1115341

func (o GetOperationOptions) ToQuery() *client.QueryParams

type GetOperationResponse

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

type LeaseDuration

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

func (*LeaseDuration) UnmarshalJSON added in v0.20231114.1115341

func (s *LeaseDuration) UnmarshalJSON(bytes []byte) error

type LeaseOperationOptions

type LeaseOperationOptions struct {
	XMsSnapshot *string
}

func DefaultLeaseOperationOptions

func DefaultLeaseOperationOptions() LeaseOperationOptions

func (LeaseOperationOptions) ToHeaders added in v0.20231114.1115341

func (o LeaseOperationOptions) ToHeaders() *client.Headers

func (LeaseOperationOptions) ToOData added in v0.20231114.1115341

func (o LeaseOperationOptions) ToOData() *odata.Query

func (LeaseOperationOptions) ToQuery added in v0.20231114.1115341

type LeaseOperationResponse

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

type LeaseShareAction

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

func (*LeaseShareAction) UnmarshalJSON added in v0.20231114.1115341

func (s *LeaseShareAction) UnmarshalJSON(bytes []byte) error

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"
)

func (*LeaseState) UnmarshalJSON added in v0.20231114.1115341

func (s *LeaseState) UnmarshalJSON(bytes []byte) error

type LeaseStatus

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

func (*LeaseStatus) UnmarshalJSON added in v0.20231114.1115341

func (s *LeaseStatus) UnmarshalJSON(bytes []byte) error

type ListCompleteResult

type ListCompleteResult struct {
	LatestHttpResponse *http.Response
	Items              []FileShareItem
}

type ListOperationOptions

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

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders added in v0.20231114.1115341

func (o ListOperationOptions) ToHeaders() *client.Headers

func (ListOperationOptions) ToOData added in v0.20231114.1115341

func (o ListOperationOptions) ToOData() *odata.Query

func (ListOperationOptions) ToQuery added in v0.20231114.1115341

type ListOperationResponse

type ListOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
	Model        *[]FileShareItem
}

type RestoreOperationResponse

type RestoreOperationResponse struct {
	HttpResponse *http.Response
	OData        *odata.OData
}

type RootSquashType

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

func (*RootSquashType) UnmarshalJSON added in v0.20231114.1115341

func (s *RootSquashType) UnmarshalJSON(bytes []byte) error

type ShareAccessTier

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

func (*ShareAccessTier) UnmarshalJSON added in v0.20231114.1115341

func (s *ShareAccessTier) UnmarshalJSON(bytes []byte) error

type ShareId

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

ShareId is a struct representing the Resource ID for a Share

func NewShareID

func NewShareID(subscriptionId string, resourceGroupName string, storageAccountName 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) FromParseResult added in v0.20231127.1171502

func (id *ShareId) FromParseResult(input resourceids.ParseResult) error

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 UpdateOperationResponse

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

Jump to

Keyboard shortcuts

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