Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR storage/resource-manager] [SRP] Add Support for File Service and File Shares #6735

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,32 @@ def blob_services(self):
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def file_services(self):
"""Instance depends on the API version:

* 2019-04-01: :class:`FileServicesOperations<azure.mgmt.storage.v2019_04_01.operations.FileServicesOperations>`
"""
api_version = self._get_api_version('file_services')
if api_version == '2019-04-01':
from .v2019_04_01.operations import FileServicesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def file_shares(self):
"""Instance depends on the API version:

* 2019-04-01: :class:`FileSharesOperations<azure.mgmt.storage.v2019_04_01.operations.FileSharesOperations>`
"""
api_version = self._get_api_version('file_shares')
if api_version == '2019-04-01':
from .v2019_04_01.operations import FileSharesOperations as OperationClass
else:
raise NotImplementedError("APIVersion {} is not available".format(api_version))
return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version)))

@property
def management_policies(self):
"""Instance depends on the API version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
from .operations import ManagementPoliciesOperations
from .operations import BlobServicesOperations
from .operations import BlobContainersOperations
from .operations import FileServicesOperations
from .operations import FileSharesOperations
from . import models


Expand All @@ -43,6 +45,10 @@ class StorageManagementClient(SDKClient):
:vartype blob_services: azure.mgmt.storage.v2019_04_01.operations.BlobServicesOperations
:ivar blob_containers: BlobContainers operations
:vartype blob_containers: azure.mgmt.storage.v2019_04_01.operations.BlobContainersOperations
:ivar file_services: FileServices operations
:vartype file_services: azure.mgmt.storage.v2019_04_01.operations.FileServicesOperations
:ivar file_shares: FileShares operations
:vartype file_shares: azure.mgmt.storage.v2019_04_01.operations.FileSharesOperations

:param credentials: Credentials needed for the client to connect to Azure.
:type credentials: :mod:`A msrestazure Credentials
Expand Down Expand Up @@ -77,3 +83,7 @@ def __init__(
self._client, self.config, self._serialize, self._deserialize)
self.blob_containers = BlobContainersOperations(
self._client, self.config, self._serialize, self._deserialize)
self.file_services = FileServicesOperations(
self._client, self.config, self._serialize, self._deserialize)
self.file_shares = FileSharesOperations(
self._client, self.config, self._serialize, self._deserialize)
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@
from ._models_py3 import EncryptionService
from ._models_py3 import EncryptionServices
from ._models_py3 import Endpoints
from ._models_py3 import FileServiceItems
from ._models_py3 import FileServiceProperties
from ._models_py3 import FileShare
from ._models_py3 import FileShareItem
from ._models_py3 import FileShareItems
from ._models_py3 import GeoReplicationStats
from ._models_py3 import Identity
from ._models_py3 import ImmutabilityPolicy
Expand Down Expand Up @@ -90,6 +95,11 @@
from ._models import EncryptionService
from ._models import EncryptionServices
from ._models import Endpoints
from ._models import FileServiceItems
from ._models import FileServiceProperties
from ._models import FileShare
from ._models import FileShareItem
from ._models import FileShareItems
from ._models import GeoReplicationStats
from ._models import Identity
from ._models import ImmutabilityPolicy
Expand Down Expand Up @@ -191,6 +201,11 @@
'EncryptionService',
'EncryptionServices',
'Endpoints',
'FileServiceItems',
'FileServiceProperties',
'FileShare',
'FileShareItem',
'FileShareItems',
'GeoReplicationStats',
'Identity',
'ImmutabilityPolicy',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# --------------------------------------------------------------------------

from msrest.serialization import Model
from msrest.exceptions import HttpOperationError


class AccountSasParameters(Model):
Expand Down Expand Up @@ -726,6 +727,267 @@ def __init__(self, **kwargs):
self.dfs = None


class ErrorResponse(Model):
"""An error response from the Storage service.

:param error:
:type error: ~azure.mgmt.storage.v2019_04_01.models.ErrorResponseBody
"""

_attribute_map = {
'error': {'key': 'error', 'type': 'ErrorResponseBody'},
}

def __init__(self, **kwargs):
super(ErrorResponse, self).__init__(**kwargs)
self.error = kwargs.get('error', None)


class ErrorResponseException(HttpOperationError):
"""Server responsed with exception of type: 'ErrorResponse'.

:param deserialize: A deserializer
:param response: Server response to be deserialized.
"""

def __init__(self, deserialize, response, *args):

super(ErrorResponseException, self).__init__(deserialize, response, 'ErrorResponse', *args)


class ErrorResponseBody(Model):
"""An error response from the Storage service.

:param code: An identifier for the error. Codes are invariant and are
intended to be consumed programmatically.
:type code: str
:param message: A message describing the error, intended to be suitable
for display in a user interface.
:type message: str
:param target: The target of the particular error. For example, the name
of the property in error.
:type target: str
:param details: A list of additional details about the error.
:type details:
list[~azure.mgmt.storage.v2019_04_01.models.ErrorResponseBody]
"""

_attribute_map = {
'code': {'key': 'code', 'type': 'str'},
'message': {'key': 'message', 'type': 'str'},
'target': {'key': 'target', 'type': 'str'},
'details': {'key': 'details', 'type': '[ErrorResponseBody]'},
}

def __init__(self, **kwargs):
super(ErrorResponseBody, self).__init__(**kwargs)
self.code = kwargs.get('code', None)
self.message = kwargs.get('message', None)
self.target = kwargs.get('target', None)
self.details = kwargs.get('details', None)


class FileServiceItems(Model):
"""FileServiceItems.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar value: List of file services returned.
:vartype value:
list[~azure.mgmt.storage.v2019_04_01.models.FileServiceProperties]
"""

_validation = {
'value': {'readonly': True},
}

_attribute_map = {
'value': {'key': 'value', 'type': '[FileServiceProperties]'},
}

def __init__(self, **kwargs):
super(FileServiceItems, self).__init__(**kwargs)
self.value = None


class FileServiceProperties(Resource):
"""The properties of File services in storage account.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: Fully qualified resource Id for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:vartype type: str
:param cors: Specifies CORS rules for the File service. You can include up
to five CorsRule elements in the request. If no CorsRule elements are
included in the request body, all CORS rules will be deleted, and CORS
will be disabled for the File service.
:type cors: ~azure.mgmt.storage.v2019_04_01.models.CorsRules
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'cors': {'key': 'properties.cors', 'type': 'CorsRules'},
}

def __init__(self, **kwargs):
super(FileServiceProperties, self).__init__(**kwargs)
self.cors = kwargs.get('cors', None)


class FileShare(AzureEntityResource):
"""Properties of the file share, including Id, resource name, resource type,
Etag.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: Fully qualified resource Id for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:vartype type: str
:ivar etag: Resource Etag.
:vartype etag: str
:ivar last_modified_time: Returns the date and time the share was last
modified.
:vartype last_modified_time: datetime
:param metadata: A name-value pair to associate with the share as
metadata.
:type metadata: dict[str, str]
:param share_quota: The maximum size of the share, in gigabytes. Must be
greater than 0, and less than or equal to 5TB (5120).
:type share_quota: int
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'etag': {'readonly': True},
'last_modified_time': {'readonly': True},
'share_quota': {'maximum': 5120, 'minimum': 1},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'etag': {'key': 'etag', 'type': 'str'},
'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'},
'metadata': {'key': 'properties.metadata', 'type': '{str}'},
'share_quota': {'key': 'properties.shareQuota', 'type': 'int'},
}

def __init__(self, **kwargs):
super(FileShare, self).__init__(**kwargs)
self.last_modified_time = None
self.metadata = kwargs.get('metadata', None)
self.share_quota = kwargs.get('share_quota', None)


class FileShareItem(AzureEntityResource):
"""The file share properties be listed out.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar id: Fully qualified resource Id for the resource. Ex -
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}
:vartype id: str
:ivar name: The name of the resource
:vartype name: str
:ivar type: The type of the resource. Ex-
Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts.
:vartype type: str
:ivar etag: Resource Etag.
:vartype etag: str
:ivar last_modified_time: Returns the date and time the share was last
modified.
:vartype last_modified_time: datetime
:param metadata: A name-value pair to associate with the share as
metadata.
:type metadata: dict[str, str]
:param share_quota: The maximum size of the share, in gigabytes. Must be
greater than 0, and less than or equal to 5TB (5120).
:type share_quota: int
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
'etag': {'readonly': True},
'last_modified_time': {'readonly': True},
'share_quota': {'maximum': 5120, 'minimum': 1},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'etag': {'key': 'etag', 'type': 'str'},
'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'},
'metadata': {'key': 'properties.metadata', 'type': '{str}'},
'share_quota': {'key': 'properties.shareQuota', 'type': 'int'},
}

def __init__(self, **kwargs):
super(FileShareItem, self).__init__(**kwargs)
self.last_modified_time = None
self.metadata = kwargs.get('metadata', None)
self.share_quota = kwargs.get('share_quota', None)


class FileShareItems(Model):
"""Response schema. Contains list of shares returned, and if paging is
requested or required, a URL to next page of shares.

Variables are only populated by the server, and will be ignored when
sending a request.

:ivar value: List of file shares returned.
:vartype value: list[~azure.mgmt.storage.v2019_04_01.models.FileShareItem]
:ivar next_link: Request URL that can be used to query next page of
shares. Returned when total number of requested shares exceed maximum page
size.
:vartype next_link: str
"""

_validation = {
'value': {'readonly': True},
'next_link': {'readonly': True},
}

_attribute_map = {
'value': {'key': 'value', 'type': '[FileShareItem]'},
'next_link': {'key': 'nextLink', 'type': 'str'},
}

def __init__(self, **kwargs):
super(FileShareItems, self).__init__(**kwargs)
self.value = None
self.next_link = None


class GeoReplicationStats(Model):
"""Statistics related to replication for storage account's Blob, Table, Queue
and File services. It is only available when geo-redundant replication is
Expand Down
Loading