FileSharesOperations Class

FileSharesOperations async operations.

You should not instantiate this class directly. Instead, you should create a Client instance that instantiates it for you and attaches it as an attribute.

Inheritance
builtins.object
FileSharesOperations

Constructor

FileSharesOperations(client, config, serializer, deserializer)

Parameters

client
Required

Client for service requests.

config
Required

Configuration of service client.

serializer
Required

An object model serializer.

deserializer
Required

An object model deserializer.

Variables

models

Alias to model classes used in this operation group.

Methods

create

Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share.

delete

Deletes specified share under its account.

get

Gets properties of a specified share.

list

Lists all shares.

restore

Restore a file share within a valid retention days if share soft delete is enabled.

update

Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist.

create

Creates a new share under the specified account as described by request body. The share resource includes metadata and properties for that share. It does not include a list of the files contained by the share.

async create(resource_group_name: str, account_name: str, share_name: str, file_share: azure.mgmt.storage.v2020_08_01_preview.models._models_py3.FileShare, expand: Optional[str] = 'snapshots', **kwargs: Any) -> azure.mgmt.storage.v2020_08_01_preview.models._models_py3.FileShare

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
Required

The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.

share_name
str
Required

The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.

file_share
FileShare
Required

Properties of the file share to create.

expand
str
Required

Optional, used to create a snapshot. The default value is "snapshots".

cls
callable

A custom type or function that will be passed the direct response

Returns

FileShare, or the result of cls(response)

Return type

Exceptions

delete

Deletes specified share under its account.

async delete(resource_group_name: str, account_name: str, share_name: str, x_ms_snapshot: Optional[str] = None, **kwargs: Any) -> None

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
Required

The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.

share_name
str
Required

The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.

x_ms_snapshot
str
Required

Optional, used to delete a snapshot.

cls
callable

A custom type or function that will be passed the direct response

Returns

None, or the result of cls(response)

Return type

Exceptions

get

Gets properties of a specified share.

async get(resource_group_name: str, account_name: str, share_name: str, expand: Optional[str] = 'stats', x_ms_snapshot: Optional[str] = None, **kwargs: Any) -> azure.mgmt.storage.v2020_08_01_preview.models._models_py3.FileShare

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
Required

The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.

share_name
str
Required

The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.

expand
str
Required

Optional, used to expand the properties within share's properties. The default value is "stats".

x_ms_snapshot
str
Required

Optional, used to retrieve properties of a snapshot.

cls
callable

A custom type or function that will be passed the direct response

Returns

FileShare, or the result of cls(response)

Return type

Exceptions

list

Lists all shares.

list(resource_group_name: str, account_name: str, maxpagesize: Optional[str] = None, filter: Optional[str] = None, expand: Optional[Union[str, azure.mgmt.storage.v2020_08_01_preview.models._storage_management_client_enums.ListSharesExpand]] = None, **kwargs: Any) -> AsyncIterable[azure.mgmt.storage.v2020_08_01_preview.models._models_py3.FileShareItems]

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
Required

The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.

maxpagesize
str
Required

Optional. Specified maximum number of shares that can be included in the list.

filter
str
Required

Optional. When specified, only share names starting with the filter will be listed.

expand
str or ListSharesExpand
Required

Optional, used to expand the properties within share's properties.

cls
callable

A custom type or function that will be passed the direct response

Returns

An iterator like instance of either FileShareItems or the result of cls(response)

Return type

Exceptions

restore

Restore a file share within a valid retention days if share soft delete is enabled.

async restore(resource_group_name: str, account_name: str, share_name: str, deleted_share: azure.mgmt.storage.v2020_08_01_preview.models._models_py3.DeletedShare, **kwargs: Any) -> None

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
Required

The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.

share_name
str
Required

The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.

deleted_share
DeletedShare
Required
cls
callable

A custom type or function that will be passed the direct response

Returns

None, or the result of cls(response)

Return type

Exceptions

update

Updates share properties as specified in request body. Properties not mentioned in the request will not be changed. Update fails if the specified share does not already exist.

async update(resource_group_name: str, account_name: str, share_name: str, file_share: azure.mgmt.storage.v2020_08_01_preview.models._models_py3.FileShare, **kwargs: Any) -> azure.mgmt.storage.v2020_08_01_preview.models._models_py3.FileShare

Parameters

resource_group_name
str
Required

The name of the resource group within the user's subscription. The name is case insensitive.

account_name
str
Required

The name of the storage account within the specified resource group. Storage account names must be between 3 and 24 characters in length and use numbers and lower-case letters only.

share_name
str
Required

The name of the file share within the specified storage account. File share names must be between 3 and 63 characters in length and use numbers, lower-case letters and dash (-) only. Every dash (-) character must be immediately preceded and followed by a letter or number.

file_share
FileShare
Required

Properties to update for the file share.

cls
callable

A custom type or function that will be passed the direct response

Returns

FileShare, or the result of cls(response)

Return type

Exceptions

Attributes

models

models = <module 'azure.mgmt.storage.v2020_08_01_preview.models' from 'C:\\hostedtoolcache\\windows\\Python\\3.9.13\\x64\\lib\\site-packages\\azure\\mgmt\\storage\\v2020_08_01_preview\\models\\__init__.py'>