fileshares

package
v0.20240710.1075622 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2024 License: MPL-2.0 Imports: 14 Imported by: 1

README

github.com/hashicorp/go-azure-sdk/resource-manager/storage/2023-05-01/fileshares Documentation

The fileshares SDK allows for interaction with the Azure Resource Manager Service storage (API Version 2023-05-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-helpers/resourcemanager/commonids"
import "github.com/hashicorp/go-azure-sdk/resource-manager/storage/2023-05-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 := commonids.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

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

func (CreateOperationOptions) ToOData

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

func (CreateOperationOptions) ToQuery

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

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

func (DeleteOperationOptions) ToOData

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

func (DeleteOperationOptions) ToQuery

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

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

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

func (GetOperationOptions) ToOData

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

func (GetOperationOptions) ToQuery

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

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

type LeaseOperationOptions

type LeaseOperationOptions struct {
	XMsSnapshot *string
}

func DefaultLeaseOperationOptions

func DefaultLeaseOperationOptions() LeaseOperationOptions

func (LeaseOperationOptions) ToHeaders

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

func (LeaseOperationOptions) ToOData

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

func (LeaseOperationOptions) ToQuery

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

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

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

type LeaseStatus

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

func (*LeaseStatus) UnmarshalJSON

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

type ListCompleteResult

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

type ListCustomPager added in v0.20240628.1153531

type ListCustomPager struct {
	NextLink *odata.Link `json:"nextLink"`
}
func (p *ListCustomPager) NextPageLink() *odata.Link

type ListOperationOptions

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

func DefaultListOperationOptions

func DefaultListOperationOptions() ListOperationOptions

func (ListOperationOptions) ToHeaders

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

func (ListOperationOptions) ToOData

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

func (ListOperationOptions) ToQuery

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

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

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

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