diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py index 9e59f3c39841..5aa3be45d991 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/_data_box_edge_management_client.py @@ -24,8 +24,11 @@ from .operations import RolesOperations from .operations import SharesOperations from .operations import StorageAccountCredentialsOperations +from .operations import StorageAccountsOperations +from .operations import ContainersOperations from .operations import TriggersOperations from .operations import UsersOperations +from .operations import SkusOperations from . import models @@ -57,10 +60,16 @@ class DataBoxEdgeManagementClient(SDKClient): :vartype shares: azure.mgmt.databoxedge.operations.SharesOperations :ivar storage_account_credentials: StorageAccountCredentials operations :vartype storage_account_credentials: azure.mgmt.databoxedge.operations.StorageAccountCredentialsOperations + :ivar storage_accounts: StorageAccounts operations + :vartype storage_accounts: azure.mgmt.databoxedge.operations.StorageAccountsOperations + :ivar containers: Containers operations + :vartype containers: azure.mgmt.databoxedge.operations.ContainersOperations :ivar triggers: Triggers operations :vartype triggers: azure.mgmt.databoxedge.operations.TriggersOperations :ivar users: Users operations :vartype users: azure.mgmt.databoxedge.operations.UsersOperations + :ivar skus: Skus operations + :vartype skus: azure.mgmt.databoxedge.operations.SkusOperations :param credentials: Credentials needed for the client to connect to Azure. :type credentials: :mod:`A msrestazure Credentials @@ -77,7 +86,7 @@ def __init__( super(DataBoxEdgeManagementClient, self).__init__(self.config.credentials, self.config) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} - self.api_version = '2019-07-01' + self.api_version = '2019-08-01' self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) @@ -103,7 +112,13 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.storage_account_credentials = StorageAccountCredentialsOperations( self._client, self.config, self._serialize, self._deserialize) + self.storage_accounts = StorageAccountsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.containers = ContainersOperations( + self._client, self.config, self._serialize, self._deserialize) self.triggers = TriggersOperations( self._client, self.config, self._serialize, self._deserialize) self.users = UsersOperations( self._client, self.config, self._serialize, self._deserialize) + self.skus = SkusOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/__init__.py index 94a7dd2b2325..4ccf9e5ab542 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/__init__.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/__init__.py @@ -20,6 +20,7 @@ from ._models_py3 import BandwidthSchedule from ._models_py3 import ClientAccessRight from ._models_py3 import ContactDetails + from ._models_py3 import Container from ._models_py3 import DataBoxEdgeDevice from ._models_py3 import DataBoxEdgeDeviceExtendedInfo from ._models_py3 import DataBoxEdgeDevicePatch @@ -46,6 +47,7 @@ from ._models_py3 import PeriodicTimerEventTrigger from ._models_py3 import PeriodicTimerSourceInfo from ._models_py3 import RefreshDetails + from ._models_py3 import ResourceTypeSku from ._models_py3 import Role from ._models_py3 import RoleSinkInfo from ._models_py3 import SecuritySettings @@ -53,6 +55,11 @@ from ._models_py3 import Share from ._models_py3 import ShareAccessRight from ._models_py3 import Sku + from ._models_py3 import SkuCost + from ._models_py3 import SkuLocationInfo + from ._models_py3 import SkuRestriction + from ._models_py3 import SkuRestrictionInfo + from ._models_py3 import StorageAccount from ._models_py3 import StorageAccountCredential from ._models_py3 import SymmetricKey from ._models_py3 import TrackingInfo @@ -75,6 +82,7 @@ from ._models import BandwidthSchedule from ._models import ClientAccessRight from ._models import ContactDetails + from ._models import Container from ._models import DataBoxEdgeDevice from ._models import DataBoxEdgeDeviceExtendedInfo from ._models import DataBoxEdgeDevicePatch @@ -101,6 +109,7 @@ from ._models import PeriodicTimerEventTrigger from ._models import PeriodicTimerSourceInfo from ._models import RefreshDetails + from ._models import ResourceTypeSku from ._models import Role from ._models import RoleSinkInfo from ._models import SecuritySettings @@ -108,6 +117,11 @@ from ._models import Share from ._models import ShareAccessRight from ._models import Sku + from ._models import SkuCost + from ._models import SkuLocationInfo + from ._models import SkuRestriction + from ._models import SkuRestrictionInfo + from ._models import StorageAccount from ._models import StorageAccountCredential from ._models import SymmetricKey from ._models import TrackingInfo @@ -121,13 +135,16 @@ from ._models import UserAccessRight from ._paged_models import AlertPaged from ._paged_models import BandwidthSchedulePaged +from ._paged_models import ContainerPaged from ._paged_models import DataBoxEdgeDevicePaged from ._paged_models import NodePaged from ._paged_models import OperationPaged from ._paged_models import OrderPaged +from ._paged_models import ResourceTypeSkuPaged from ._paged_models import RolePaged from ._paged_models import SharePaged from ._paged_models import StorageAccountCredentialPaged +from ._paged_models import StorageAccountPaged from ._paged_models import TriggerPaged from ._paged_models import UserPaged from ._data_box_edge_management_client_enums import ( @@ -136,6 +153,7 @@ AzureContainerDataFormat, DayOfWeek, ClientPermissionType, + ContainerStatus, SkuName, SkuTier, DataBoxEdgeDeviceStatus, @@ -158,15 +176,18 @@ NodeStatus, OrderState, AuthenticationType, + SkuRestrictionReasonCode, ShareStatus, MonitoringStatus, ShareAccessProtocol, ShareAccessType, DataPolicy, + StorageAccountStatus, SSLStatus, AccountType, InstallRebootBehavior, UpdateOperation, + UserType, ) __all__ = [ @@ -180,6 +201,7 @@ 'BandwidthSchedule', 'ClientAccessRight', 'ContactDetails', + 'Container', 'DataBoxEdgeDevice', 'DataBoxEdgeDeviceExtendedInfo', 'DataBoxEdgeDevicePatch', @@ -206,6 +228,7 @@ 'PeriodicTimerEventTrigger', 'PeriodicTimerSourceInfo', 'RefreshDetails', + 'ResourceTypeSku', 'Role', 'RoleSinkInfo', 'SecuritySettings', @@ -213,6 +236,11 @@ 'Share', 'ShareAccessRight', 'Sku', + 'SkuCost', + 'SkuLocationInfo', + 'SkuRestriction', + 'SkuRestrictionInfo', + 'StorageAccount', 'StorageAccountCredential', 'SymmetricKey', 'TrackingInfo', @@ -233,13 +261,17 @@ 'RolePaged', 'SharePaged', 'StorageAccountCredentialPaged', + 'StorageAccountPaged', + 'ContainerPaged', 'TriggerPaged', 'UserPaged', + 'ResourceTypeSkuPaged', 'AlertSeverity', 'EncryptionAlgorithm', 'AzureContainerDataFormat', 'DayOfWeek', 'ClientPermissionType', + 'ContainerStatus', 'SkuName', 'SkuTier', 'DataBoxEdgeDeviceStatus', @@ -262,13 +294,16 @@ 'NodeStatus', 'OrderState', 'AuthenticationType', + 'SkuRestrictionReasonCode', 'ShareStatus', 'MonitoringStatus', 'ShareAccessProtocol', 'ShareAccessType', 'DataPolicy', + 'StorageAccountStatus', 'SSLStatus', 'AccountType', 'InstallRebootBehavior', 'UpdateOperation', + 'UserType', ] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_data_box_edge_management_client_enums.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_data_box_edge_management_client_enums.py index 869c4f726790..11a11deab268 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_data_box_edge_management_client_enums.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_data_box_edge_management_client_enums.py @@ -51,10 +51,26 @@ class ClientPermissionType(str, Enum): read_write = "ReadWrite" +class ContainerStatus(str, Enum): + + ok = "OK" + offline = "Offline" + unknown = "Unknown" + updating = "Updating" + needs_attention = "NeedsAttention" + + class SkuName(str, Enum): gateway = "Gateway" edge = "Edge" + tea_1_node = "TEA_1Node" + tea_1_node_ups = "TEA_1Node_UPS" + tea_1_node_heater = "TEA_1Node_Heater" + tea_1_node_ups_heater = "TEA_1Node_UPS_Heater" + tea_4_node_heater = "TEA_4Node_Heater" + tea_4_node_ups_heater = "TEA_4Node_UPS_Heater" + tma = "TMA" class SkuTier(str, Enum): @@ -116,6 +132,7 @@ class JobType(str, Enum): download_updates = "DownloadUpdates" install_updates = "InstallUpdates" refresh_share = "RefreshShare" + refresh_container = "RefreshContainer" class UpdateOperationStage(str, Enum): @@ -246,6 +263,12 @@ class AuthenticationType(str, Enum): azure_active_directory = "AzureActiveDirectory" +class SkuRestrictionReasonCode(str, Enum): + + not_available_for_subscription = "NotAvailableForSubscription" + quota_id = "QuotaId" + + class ShareStatus(str, Enum): offline = "Offline" @@ -280,6 +303,15 @@ class DataPolicy(str, Enum): local = "Local" +class StorageAccountStatus(str, Enum): + + ok = "OK" + offline = "Offline" + unknown = "Unknown" + updating = "Updating" + needs_attention = "NeedsAttention" + + class SSLStatus(str, Enum): enabled = "Enabled" @@ -305,3 +337,10 @@ class UpdateOperation(str, Enum): scan = "Scan" download = "Download" install = "Install" + + +class UserType(str, Enum): + + share = "Share" + local_management = "LocalManagement" + arm = "ARM" diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_models.py index 8ea8e31a3e63..861ed9c7ba47 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_models.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_models.py @@ -456,6 +456,62 @@ def __init__(self, **kwargs): self.email_list = kwargs.get('email_list', None) +class Container(ARMBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar container_status: Current status of the container. Possible values + include: 'OK', 'Offline', 'Unknown', 'Updating', 'NeedsAttention' + :vartype container_status: str or + ~azure.mgmt.databoxedge.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values + include: 'BlockBlob', 'PageBlob', 'AzureFile' + :type data_format: str or + ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(Container, self).__init__(**kwargs) + self.container_status = None + self.data_format = kwargs.get('data_format', None) + self.refresh_details = None + self.created_date_time = None + + class DataBoxEdgeDevice(ARMBaseModel): """The Data Box Edge/Gateway device. @@ -778,7 +834,7 @@ class IoTDeviceInfo(Model): :param io_thost_hub: Required. Host name for the IoT hub associated to the device. :type io_thost_hub: str - :param io_thost_hub_id: Id of the IoT hub associated to the device. + :param io_thost_hub_id: Id for the IoT hub associated to the device. :type io_thost_hub_id: str :param authentication: IoT device authentication info. :type authentication: ~azure.mgmt.databoxedge.models.Authentication @@ -1006,7 +1062,8 @@ class Job(Model): :ivar error: The error details. :vartype error: ~azure.mgmt.databoxedge.models.JobErrorDetails :ivar job_type: The type of the job. Possible values include: 'Invalid', - 'ScanForUpdates', 'DownloadUpdates', 'InstallUpdates', 'RefreshShare' + 'ScanForUpdates', 'DownloadUpdates', 'InstallUpdates', 'RefreshShare', + 'RefreshContainer' :vartype job_type: str or ~azure.mgmt.databoxedge.models.JobType :ivar current_stage: Current stage of the update operation. Possible values include: 'Unknown', 'Initial', 'ScanStarted', 'ScanComplete', @@ -1027,10 +1084,11 @@ class Job(Model): :ivar error_manifest_file: Local share/remote container relative path to the error manifest file of the refresh. :vartype error_manifest_file: str - :ivar share_id: ARM ID of the share that was refreshed. - :vartype share_id: str + :ivar refreshed_entity_id: ARM ID of the entity that was refreshed. + :vartype refreshed_entity_id: str :param folder: If only subfolders need to be refreshed, then the subfolder - path inside the share. (The path is empty if there are no subfolders.) + path inside the share or container. (The path is empty if there are no + subfolders.) :type folder: str """ @@ -1049,7 +1107,7 @@ class Job(Model): 'install_progress': {'readonly': True}, 'total_refresh_errors': {'readonly': True}, 'error_manifest_file': {'readonly': True}, - 'share_id': {'readonly': True}, + 'refreshed_entity_id': {'readonly': True}, } _attribute_map = { @@ -1067,7 +1125,7 @@ class Job(Model): 'install_progress': {'key': 'properties.installProgress', 'type': 'UpdateInstallProgress'}, 'total_refresh_errors': {'key': 'properties.totalRefreshErrors', 'type': 'int'}, 'error_manifest_file': {'key': 'properties.errorManifestFile', 'type': 'str'}, - 'share_id': {'key': 'properties.shareId', 'type': 'str'}, + 'refreshed_entity_id': {'key': 'properties.refreshedEntityId', 'type': 'str'}, 'folder': {'key': 'properties.folder', 'type': 'str'}, } @@ -1087,7 +1145,7 @@ def __init__(self, **kwargs): self.install_progress = None self.total_refresh_errors = None self.error_manifest_file = None - self.share_id = None + self.refreshed_entity_id = None self.folder = kwargs.get('folder', None) @@ -1667,17 +1725,23 @@ class OrderStatus(Model): :vartype update_date_time: datetime :param comments: Comments related to this status change. :type comments: str + :ivar additional_order_details: Dictionary to hold generic information + which is not stored + by the already existing properties + :vartype additional_order_details: dict[str, str] """ _validation = { 'status': {'required': True}, 'update_date_time': {'readonly': True}, + 'additional_order_details': {'readonly': True}, } _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, 'comments': {'key': 'comments', 'type': 'str'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, } def __init__(self, **kwargs): @@ -1685,6 +1749,7 @@ def __init__(self, **kwargs): self.status = kwargs.get('status', None) self.update_date_time = None self.comments = kwargs.get('comments', None) + self.additional_order_details = None class PeriodicTimerEventTrigger(Trigger): @@ -1777,22 +1842,23 @@ def __init__(self, **kwargs): class RefreshDetails(Model): - """Fields for tracking refresh job on the share. + """Fields for tracking refresh job on the share or container. - :param in_progress_refresh_job_id: If a refresh share job is currently in - progress on this share, this field indicates the ARM resource ID of that - job. The field is empty if no job is in progress. + :param in_progress_refresh_job_id: If a refresh job is currently in + progress on this share or container, this field indicates the ARM resource + ID of that job. The field is empty if no job is in progress. :type in_progress_refresh_job_id: str :param last_completed_refresh_job_time_in_utc: Indicates the completed - time for the last refresh job on this particular share, if any.This could - be a failed job or a successful job. + time for the last refresh job on this particular share or container, if + any.This could be a failed job or a successful job. :type last_completed_refresh_job_time_in_utc: datetime :param error_manifest_file: Indicates the relative path of the error xml - for the last refresh job on this particular share, if any. This could be a - failed job or a successful job. + for the last refresh job on this particular share or container, if any. + This could be a failed job or a successful job. :type error_manifest_file: str :param last_job: Indicates the id of the last refresh job on this - particular share,if any. This could be a failed job or a successful job. + particular share or container,if any. This could be a failed job or a + successful job. :type last_job: str """ @@ -1811,6 +1877,77 @@ def __init__(self, **kwargs): self.last_job = kwargs.get('last_job', None) +class ResourceTypeSku(Model): + """SkuInformation object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of the resource + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: 'Gateway', 'Edge', + 'TEA_1Node', 'TEA_1Node_UPS', 'TEA_1Node_Heater', 'TEA_1Node_UPS_Heater', + 'TEA_4Node_Heater', 'TEA_4Node_UPS_Heater', 'TMA' + :vartype name: str or ~azure.mgmt.databoxedge.models.SkuName + :ivar kind: The Sku kind + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: 'Standard' + :vartype tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :ivar family: The Sku family + :vartype family: str + :ivar locations: Availability of the SKU for the region + :vartype locations: list[str] + :ivar api_versions: The API versions in which SKU is available + :vartype api_versions: list[str] + :ivar location_info: Availability of the SKU for the location/zone + :vartype location_info: + list[~azure.mgmt.databoxedge.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] + :ivar restrictions: Restrictions of the SKU availability. + :vartype restrictions: list[~azure.mgmt.databoxedge.models.SkuRestriction] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'restrictions': {'key': 'restrictions', 'type': '[SkuRestriction]'}, + } + + def __init__(self, **kwargs): + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.restrictions = None + + class RoleSinkInfo(Model): """Compute role against which events will be raised. @@ -2012,7 +2149,9 @@ def __init__(self, **kwargs): class Sku(Model): """The SKU type. - :param name: SKU name. Possible values include: 'Gateway', 'Edge' + :param name: SKU name. Possible values include: 'Gateway', 'Edge', + 'TEA_1Node', 'TEA_1Node_UPS', 'TEA_1Node_Heater', 'TEA_1Node_UPS_Heater', + 'TEA_4Node_Heater', 'TEA_4Node_UPS_Heater', 'TMA' :type name: str or ~azure.mgmt.databoxedge.models.SkuName :param tier: The SKU tier. This is based on the SKU name. Possible values include: 'Standard' @@ -2030,6 +2169,202 @@ def __init__(self, **kwargs): self.tier = kwargs.get('tier', None) +class SkuCost(Model): + """The metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The cost quantity. + :vartype quantity: long + :ivar extended_unit: Restriction of the SKU for the location/zone + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuLocationInfo(Model): + """The location info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class SkuRestriction(Model): + """The restrictions because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the restriction. + :vartype type: str + :ivar values: The locations where sku is restricted. + :vartype values: list[str] + :ivar reason_code: The SKU restriction reason. Possible values include: + 'NotAvailableForSubscription', 'QuotaId' + :vartype reason_code: str or + ~azure.mgmt.databoxedge.models.SkuRestrictionReasonCode + :ivar restriction_info: Restriction of the SKU for the location/zone + :vartype restriction_info: + ~azure.mgmt.databoxedge.models.SkuRestrictionInfo + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'reason_code': {'readonly': True}, + 'restriction_info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'SkuRestrictionInfo'}, + } + + def __init__(self, **kwargs): + super(SkuRestriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = None + self.restriction_info = None + + +class SkuRestrictionInfo(Model): + """The restriction info with locations and zones. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar locations: The locations. + :vartype locations: list[str] + :ivar zones: The zones. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(SkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None + + +class StorageAccount(ARMBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. + Possible values include: 'OK', 'Offline', 'Unknown', 'Updating', + 'NeedsAttention' + :type storage_account_status: str or + ~azure.mgmt.databoxedge.models.StorageAccountStatus + :param data_policy: Data policy of the storage Account. Possible values + include: 'Cloud', 'Local' + :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage + Accounts with DataPolicy set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(StorageAccount, self).__init__(**kwargs) + self.description = kwargs.get('description', None) + self.storage_account_status = kwargs.get('storage_account_status', None) + self.data_policy = kwargs.get('data_policy', None) + self.storage_account_credential_id = kwargs.get('storage_account_credential_id', None) + self.blob_endpoint = None + self.container_count = None + + class StorageAccountCredential(ARMBaseModel): """The storage account credential. @@ -2390,36 +2725,40 @@ def __init__(self, **kwargs): class UploadCertificateResponse(Model): """The upload registration certificate response. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. :param auth_type: Specifies authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory' :type auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType - :param resource_id: Required. The resource ID of the Data Box Edge/Gateway - device. - :type resource_id: str - :param aad_authority: Required. Azure Active Directory tenant authority. - :type aad_authority: str - :param aad_tenant_id: Required. Azure Active Directory tenant ID. - :type aad_tenant_id: str - :param service_principal_client_id: Required. Azure Active Directory - service principal client ID. - :type service_principal_client_id: str - :param service_principal_object_id: Required. Azure Active Directory - service principal object ID. - :type service_principal_object_id: str - :param azure_management_endpoint_audience: Required. The azure management - endpoint audience. - :type azure_management_endpoint_audience: str + :ivar resource_id: The resource ID of the Data Box Edge/Gateway device. + :vartype resource_id: str + :ivar aad_authority: Azure Active Directory tenant authority. + :vartype aad_authority: str + :ivar aad_tenant_id: Azure Active Directory tenant ID. + :vartype aad_tenant_id: str + :ivar service_principal_client_id: Azure Active Directory service + principal client ID. + :vartype service_principal_client_id: str + :ivar service_principal_object_id: Azure Active Directory service + principal object ID. + :vartype service_principal_object_id: str + :ivar azure_management_endpoint_audience: The azure management endpoint + audience. + :vartype azure_management_endpoint_audience: str + :ivar aad_audience: Identifier of the target resource that is the + recipient of the requested token. + :vartype aad_audience: str """ _validation = { - 'resource_id': {'required': True}, - 'aad_authority': {'required': True}, - 'aad_tenant_id': {'required': True}, - 'service_principal_client_id': {'required': True}, - 'service_principal_object_id': {'required': True}, - 'azure_management_endpoint_audience': {'required': True}, + 'resource_id': {'readonly': True}, + 'aad_authority': {'readonly': True}, + 'aad_tenant_id': {'readonly': True}, + 'service_principal_client_id': {'readonly': True}, + 'service_principal_object_id': {'readonly': True}, + 'azure_management_endpoint_audience': {'readonly': True}, + 'aad_audience': {'readonly': True}, } _attribute_map = { @@ -2430,17 +2769,19 @@ class UploadCertificateResponse(Model): 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, 'service_principal_object_id': {'key': 'servicePrincipalObjectId', 'type': 'str'}, 'azure_management_endpoint_audience': {'key': 'azureManagementEndpointAudience', 'type': 'str'}, + 'aad_audience': {'key': 'aadAudience', 'type': 'str'}, } def __init__(self, **kwargs): super(UploadCertificateResponse, self).__init__(**kwargs) self.auth_type = kwargs.get('auth_type', None) - self.resource_id = kwargs.get('resource_id', None) - self.aad_authority = kwargs.get('aad_authority', None) - self.aad_tenant_id = kwargs.get('aad_tenant_id', None) - self.service_principal_client_id = kwargs.get('service_principal_client_id', None) - self.service_principal_object_id = kwargs.get('service_principal_object_id', None) - self.azure_management_endpoint_audience = kwargs.get('azure_management_endpoint_audience', None) + self.resource_id = None + self.aad_authority = None + self.aad_tenant_id = None + self.service_principal_client_id = None + self.service_principal_object_id = None + self.azure_management_endpoint_audience = None + self.aad_audience = None class User(ARMBaseModel): @@ -2450,6 +2791,8 @@ class User(ARMBaseModel): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The path ID that uniquely identifies the object. :vartype id: str :ivar name: The object name. @@ -2463,12 +2806,16 @@ class User(ARMBaseModel): This field should not be specified during user creation. :type share_access_rights: list[~azure.mgmt.databoxedge.models.ShareAccessRight] + :param user_type: Required. Type of the user. Possible values include: + 'Share', 'LocalManagement', 'ARM' + :type user_type: str or ~azure.mgmt.databoxedge.models.UserType """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'user_type': {'required': True}, } _attribute_map = { @@ -2477,12 +2824,14 @@ class User(ARMBaseModel): 'type': {'key': 'type', 'type': 'str'}, 'encrypted_password': {'key': 'properties.encryptedPassword', 'type': 'AsymmetricEncryptedSecret'}, 'share_access_rights': {'key': 'properties.shareAccessRights', 'type': '[ShareAccessRight]'}, + 'user_type': {'key': 'properties.userType', 'type': 'str'}, } def __init__(self, **kwargs): super(User, self).__init__(**kwargs) self.encrypted_password = kwargs.get('encrypted_password', None) self.share_access_rights = kwargs.get('share_access_rights', None) + self.user_type = kwargs.get('user_type', None) class UserAccessRight(Model): diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_models_py3.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_models_py3.py index 060560a85051..2c4aa4dca8e2 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_models_py3.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_models_py3.py @@ -456,6 +456,62 @@ def __init__(self, *, contact_person: str, company_name: str, phone: str, email_ self.email_list = email_list +class Container(ARMBaseModel): + """Represents a container on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when + sending a request. + + All required parameters must be populated in order to send to Azure. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :ivar container_status: Current status of the container. Possible values + include: 'OK', 'Offline', 'Unknown', 'Updating', 'NeedsAttention' + :vartype container_status: str or + ~azure.mgmt.databoxedge.models.ContainerStatus + :param data_format: Required. DataFormat for Container. Possible values + include: 'BlockBlob', 'PageBlob', 'AzureFile' + :type data_format: str or + ~azure.mgmt.databoxedge.models.AzureContainerDataFormat + :ivar refresh_details: Details of the refresh job on this container. + :vartype refresh_details: ~azure.mgmt.databoxedge.models.RefreshDetails + :ivar created_date_time: The UTC time when container got created. + :vartype created_date_time: datetime + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'container_status': {'readonly': True}, + 'data_format': {'required': True}, + 'refresh_details': {'readonly': True}, + 'created_date_time': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'container_status': {'key': 'properties.containerStatus', 'type': 'str'}, + 'data_format': {'key': 'properties.dataFormat', 'type': 'str'}, + 'refresh_details': {'key': 'properties.refreshDetails', 'type': 'RefreshDetails'}, + 'created_date_time': {'key': 'properties.createdDateTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, data_format, **kwargs) -> None: + super(Container, self).__init__(**kwargs) + self.container_status = None + self.data_format = data_format + self.refresh_details = None + self.created_date_time = None + + class DataBoxEdgeDevice(ARMBaseModel): """The Data Box Edge/Gateway device. @@ -778,7 +834,7 @@ class IoTDeviceInfo(Model): :param io_thost_hub: Required. Host name for the IoT hub associated to the device. :type io_thost_hub: str - :param io_thost_hub_id: Id of the IoT hub associated to the device. + :param io_thost_hub_id: Id for the IoT hub associated to the device. :type io_thost_hub_id: str :param authentication: IoT device authentication info. :type authentication: ~azure.mgmt.databoxedge.models.Authentication @@ -1006,7 +1062,8 @@ class Job(Model): :ivar error: The error details. :vartype error: ~azure.mgmt.databoxedge.models.JobErrorDetails :ivar job_type: The type of the job. Possible values include: 'Invalid', - 'ScanForUpdates', 'DownloadUpdates', 'InstallUpdates', 'RefreshShare' + 'ScanForUpdates', 'DownloadUpdates', 'InstallUpdates', 'RefreshShare', + 'RefreshContainer' :vartype job_type: str or ~azure.mgmt.databoxedge.models.JobType :ivar current_stage: Current stage of the update operation. Possible values include: 'Unknown', 'Initial', 'ScanStarted', 'ScanComplete', @@ -1027,10 +1084,11 @@ class Job(Model): :ivar error_manifest_file: Local share/remote container relative path to the error manifest file of the refresh. :vartype error_manifest_file: str - :ivar share_id: ARM ID of the share that was refreshed. - :vartype share_id: str + :ivar refreshed_entity_id: ARM ID of the entity that was refreshed. + :vartype refreshed_entity_id: str :param folder: If only subfolders need to be refreshed, then the subfolder - path inside the share. (The path is empty if there are no subfolders.) + path inside the share or container. (The path is empty if there are no + subfolders.) :type folder: str """ @@ -1049,7 +1107,7 @@ class Job(Model): 'install_progress': {'readonly': True}, 'total_refresh_errors': {'readonly': True}, 'error_manifest_file': {'readonly': True}, - 'share_id': {'readonly': True}, + 'refreshed_entity_id': {'readonly': True}, } _attribute_map = { @@ -1067,7 +1125,7 @@ class Job(Model): 'install_progress': {'key': 'properties.installProgress', 'type': 'UpdateInstallProgress'}, 'total_refresh_errors': {'key': 'properties.totalRefreshErrors', 'type': 'int'}, 'error_manifest_file': {'key': 'properties.errorManifestFile', 'type': 'str'}, - 'share_id': {'key': 'properties.shareId', 'type': 'str'}, + 'refreshed_entity_id': {'key': 'properties.refreshedEntityId', 'type': 'str'}, 'folder': {'key': 'properties.folder', 'type': 'str'}, } @@ -1087,7 +1145,7 @@ def __init__(self, *, folder: str=None, **kwargs) -> None: self.install_progress = None self.total_refresh_errors = None self.error_manifest_file = None - self.share_id = None + self.refreshed_entity_id = None self.folder = folder @@ -1667,17 +1725,23 @@ class OrderStatus(Model): :vartype update_date_time: datetime :param comments: Comments related to this status change. :type comments: str + :ivar additional_order_details: Dictionary to hold generic information + which is not stored + by the already existing properties + :vartype additional_order_details: dict[str, str] """ _validation = { 'status': {'required': True}, 'update_date_time': {'readonly': True}, + 'additional_order_details': {'readonly': True}, } _attribute_map = { 'status': {'key': 'status', 'type': 'str'}, 'update_date_time': {'key': 'updateDateTime', 'type': 'iso-8601'}, 'comments': {'key': 'comments', 'type': 'str'}, + 'additional_order_details': {'key': 'additionalOrderDetails', 'type': '{str}'}, } def __init__(self, *, status, comments: str=None, **kwargs) -> None: @@ -1685,6 +1749,7 @@ def __init__(self, *, status, comments: str=None, **kwargs) -> None: self.status = status self.update_date_time = None self.comments = comments + self.additional_order_details = None class PeriodicTimerEventTrigger(Trigger): @@ -1777,22 +1842,23 @@ def __init__(self, *, start_time, schedule: str, topic: str=None, **kwargs) -> N class RefreshDetails(Model): - """Fields for tracking refresh job on the share. + """Fields for tracking refresh job on the share or container. - :param in_progress_refresh_job_id: If a refresh share job is currently in - progress on this share, this field indicates the ARM resource ID of that - job. The field is empty if no job is in progress. + :param in_progress_refresh_job_id: If a refresh job is currently in + progress on this share or container, this field indicates the ARM resource + ID of that job. The field is empty if no job is in progress. :type in_progress_refresh_job_id: str :param last_completed_refresh_job_time_in_utc: Indicates the completed - time for the last refresh job on this particular share, if any.This could - be a failed job or a successful job. + time for the last refresh job on this particular share or container, if + any.This could be a failed job or a successful job. :type last_completed_refresh_job_time_in_utc: datetime :param error_manifest_file: Indicates the relative path of the error xml - for the last refresh job on this particular share, if any. This could be a - failed job or a successful job. + for the last refresh job on this particular share or container, if any. + This could be a failed job or a successful job. :type error_manifest_file: str :param last_job: Indicates the id of the last refresh job on this - particular share,if any. This could be a failed job or a successful job. + particular share or container,if any. This could be a failed job or a + successful job. :type last_job: str """ @@ -1811,6 +1877,77 @@ def __init__(self, *, in_progress_refresh_job_id: str=None, last_completed_refre self.last_job = last_job +class ResourceTypeSku(Model): + """SkuInformation object. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar resource_type: The type of the resource + :vartype resource_type: str + :ivar name: The Sku name. Possible values include: 'Gateway', 'Edge', + 'TEA_1Node', 'TEA_1Node_UPS', 'TEA_1Node_Heater', 'TEA_1Node_UPS_Heater', + 'TEA_4Node_Heater', 'TEA_4Node_UPS_Heater', 'TMA' + :vartype name: str or ~azure.mgmt.databoxedge.models.SkuName + :ivar kind: The Sku kind + :vartype kind: str + :ivar tier: The Sku tier. Possible values include: 'Standard' + :vartype tier: str or ~azure.mgmt.databoxedge.models.SkuTier + :ivar family: The Sku family + :vartype family: str + :ivar locations: Availability of the SKU for the region + :vartype locations: list[str] + :ivar api_versions: The API versions in which SKU is available + :vartype api_versions: list[str] + :ivar location_info: Availability of the SKU for the location/zone + :vartype location_info: + list[~azure.mgmt.databoxedge.models.SkuLocationInfo] + :ivar costs: The pricing info of the Sku. + :vartype costs: list[~azure.mgmt.databoxedge.models.SkuCost] + :ivar restrictions: Restrictions of the SKU availability. + :vartype restrictions: list[~azure.mgmt.databoxedge.models.SkuRestriction] + """ + + _validation = { + 'resource_type': {'readonly': True}, + 'name': {'readonly': True}, + 'kind': {'readonly': True}, + 'tier': {'readonly': True}, + 'family': {'readonly': True}, + 'locations': {'readonly': True}, + 'api_versions': {'readonly': True}, + 'location_info': {'readonly': True}, + 'costs': {'readonly': True}, + 'restrictions': {'readonly': True}, + } + + _attribute_map = { + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + 'family': {'key': 'family', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[str]'}, + 'api_versions': {'key': 'apiVersions', 'type': '[str]'}, + 'location_info': {'key': 'locationInfo', 'type': '[SkuLocationInfo]'}, + 'costs': {'key': 'costs', 'type': '[SkuCost]'}, + 'restrictions': {'key': 'restrictions', 'type': '[SkuRestriction]'}, + } + + def __init__(self, **kwargs) -> None: + super(ResourceTypeSku, self).__init__(**kwargs) + self.resource_type = None + self.name = None + self.kind = None + self.tier = None + self.family = None + self.locations = None + self.api_versions = None + self.location_info = None + self.costs = None + self.restrictions = None + + class RoleSinkInfo(Model): """Compute role against which events will be raised. @@ -2012,7 +2149,9 @@ def __init__(self, *, share_id: str, access_type, **kwargs) -> None: class Sku(Model): """The SKU type. - :param name: SKU name. Possible values include: 'Gateway', 'Edge' + :param name: SKU name. Possible values include: 'Gateway', 'Edge', + 'TEA_1Node', 'TEA_1Node_UPS', 'TEA_1Node_Heater', 'TEA_1Node_UPS_Heater', + 'TEA_4Node_Heater', 'TEA_4Node_UPS_Heater', 'TMA' :type name: str or ~azure.mgmt.databoxedge.models.SkuName :param tier: The SKU tier. This is based on the SKU name. Possible values include: 'Standard' @@ -2030,6 +2169,202 @@ def __init__(self, *, name=None, tier=None, **kwargs) -> None: self.tier = tier +class SkuCost(Model): + """The metadata for retrieving price info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar meter_id: Used for querying price from commerce. + :vartype meter_id: str + :ivar quantity: The cost quantity. + :vartype quantity: long + :ivar extended_unit: Restriction of the SKU for the location/zone + :vartype extended_unit: str + """ + + _validation = { + 'meter_id': {'readonly': True}, + 'quantity': {'readonly': True}, + 'extended_unit': {'readonly': True}, + } + + _attribute_map = { + 'meter_id': {'key': 'meterId', 'type': 'str'}, + 'quantity': {'key': 'quantity', 'type': 'long'}, + 'extended_unit': {'key': 'extendedUnit', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(SkuCost, self).__init__(**kwargs) + self.meter_id = None + self.quantity = None + self.extended_unit = None + + +class SkuLocationInfo(Model): + """The location info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar location: The location. + :vartype location: str + :ivar zones: The zones. + :vartype zones: list[str] + :ivar sites: The sites. + :vartype sites: list[str] + """ + + _validation = { + 'location': {'readonly': True}, + 'zones': {'readonly': True}, + 'sites': {'readonly': True}, + } + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + 'sites': {'key': 'sites', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(SkuLocationInfo, self).__init__(**kwargs) + self.location = None + self.zones = None + self.sites = None + + +class SkuRestriction(Model): + """The restrictions because of which SKU cannot be used. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The type of the restriction. + :vartype type: str + :ivar values: The locations where sku is restricted. + :vartype values: list[str] + :ivar reason_code: The SKU restriction reason. Possible values include: + 'NotAvailableForSubscription', 'QuotaId' + :vartype reason_code: str or + ~azure.mgmt.databoxedge.models.SkuRestrictionReasonCode + :ivar restriction_info: Restriction of the SKU for the location/zone + :vartype restriction_info: + ~azure.mgmt.databoxedge.models.SkuRestrictionInfo + """ + + _validation = { + 'type': {'readonly': True}, + 'values': {'readonly': True}, + 'reason_code': {'readonly': True}, + 'restriction_info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'values': {'key': 'values', 'type': '[str]'}, + 'reason_code': {'key': 'reasonCode', 'type': 'str'}, + 'restriction_info': {'key': 'restrictionInfo', 'type': 'SkuRestrictionInfo'}, + } + + def __init__(self, **kwargs) -> None: + super(SkuRestriction, self).__init__(**kwargs) + self.type = None + self.values = None + self.reason_code = None + self.restriction_info = None + + +class SkuRestrictionInfo(Model): + """The restriction info with locations and zones. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar locations: The locations. + :vartype locations: list[str] + :ivar zones: The zones. + :vartype zones: list[str] + """ + + _validation = { + 'locations': {'readonly': True}, + 'zones': {'readonly': True}, + } + + _attribute_map = { + 'locations': {'key': 'locations', 'type': '[str]'}, + 'zones': {'key': 'zones', 'type': '[str]'}, + } + + def __init__(self, **kwargs) -> None: + super(SkuRestrictionInfo, self).__init__(**kwargs) + self.locations = None + self.zones = None + + +class StorageAccount(ARMBaseModel): + """Represents a Storage Account on the Data Box Edge/Gateway device. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The path ID that uniquely identifies the object. + :vartype id: str + :ivar name: The object name. + :vartype name: str + :ivar type: The hierarchical type of the object. + :vartype type: str + :param description: Description for the storage Account. + :type description: str + :param storage_account_status: Current status of the storage account. + Possible values include: 'OK', 'Offline', 'Unknown', 'Updating', + 'NeedsAttention' + :type storage_account_status: str or + ~azure.mgmt.databoxedge.models.StorageAccountStatus + :param data_policy: Data policy of the storage Account. Possible values + include: 'Cloud', 'Local' + :type data_policy: str or ~azure.mgmt.databoxedge.models.DataPolicy + :param storage_account_credential_id: Storage Account Credential Id + :type storage_account_credential_id: str + :ivar blob_endpoint: BlobEndpoint of Storage Account + :vartype blob_endpoint: str + :ivar container_count: The Container Count. Present only for Storage + Accounts with DataPolicy set to Cloud. + :vartype container_count: int + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'blob_endpoint': {'readonly': True}, + 'container_count': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'description': {'key': 'properties.description', 'type': 'str'}, + 'storage_account_status': {'key': 'properties.storageAccountStatus', 'type': 'str'}, + 'data_policy': {'key': 'properties.dataPolicy', 'type': 'str'}, + 'storage_account_credential_id': {'key': 'properties.storageAccountCredentialId', 'type': 'str'}, + 'blob_endpoint': {'key': 'properties.blobEndpoint', 'type': 'str'}, + 'container_count': {'key': 'properties.containerCount', 'type': 'int'}, + } + + def __init__(self, *, description: str=None, storage_account_status=None, data_policy=None, storage_account_credential_id: str=None, **kwargs) -> None: + super(StorageAccount, self).__init__(**kwargs) + self.description = description + self.storage_account_status = storage_account_status + self.data_policy = data_policy + self.storage_account_credential_id = storage_account_credential_id + self.blob_endpoint = None + self.container_count = None + + class StorageAccountCredential(ARMBaseModel): """The storage account credential. @@ -2390,36 +2725,40 @@ def __init__(self, *, certificate: str, authentication_type=None, **kwargs) -> N class UploadCertificateResponse(Model): """The upload registration certificate response. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when + sending a request. :param auth_type: Specifies authentication type. Possible values include: 'Invalid', 'AzureActiveDirectory' :type auth_type: str or ~azure.mgmt.databoxedge.models.AuthenticationType - :param resource_id: Required. The resource ID of the Data Box Edge/Gateway - device. - :type resource_id: str - :param aad_authority: Required. Azure Active Directory tenant authority. - :type aad_authority: str - :param aad_tenant_id: Required. Azure Active Directory tenant ID. - :type aad_tenant_id: str - :param service_principal_client_id: Required. Azure Active Directory - service principal client ID. - :type service_principal_client_id: str - :param service_principal_object_id: Required. Azure Active Directory - service principal object ID. - :type service_principal_object_id: str - :param azure_management_endpoint_audience: Required. The azure management - endpoint audience. - :type azure_management_endpoint_audience: str + :ivar resource_id: The resource ID of the Data Box Edge/Gateway device. + :vartype resource_id: str + :ivar aad_authority: Azure Active Directory tenant authority. + :vartype aad_authority: str + :ivar aad_tenant_id: Azure Active Directory tenant ID. + :vartype aad_tenant_id: str + :ivar service_principal_client_id: Azure Active Directory service + principal client ID. + :vartype service_principal_client_id: str + :ivar service_principal_object_id: Azure Active Directory service + principal object ID. + :vartype service_principal_object_id: str + :ivar azure_management_endpoint_audience: The azure management endpoint + audience. + :vartype azure_management_endpoint_audience: str + :ivar aad_audience: Identifier of the target resource that is the + recipient of the requested token. + :vartype aad_audience: str """ _validation = { - 'resource_id': {'required': True}, - 'aad_authority': {'required': True}, - 'aad_tenant_id': {'required': True}, - 'service_principal_client_id': {'required': True}, - 'service_principal_object_id': {'required': True}, - 'azure_management_endpoint_audience': {'required': True}, + 'resource_id': {'readonly': True}, + 'aad_authority': {'readonly': True}, + 'aad_tenant_id': {'readonly': True}, + 'service_principal_client_id': {'readonly': True}, + 'service_principal_object_id': {'readonly': True}, + 'azure_management_endpoint_audience': {'readonly': True}, + 'aad_audience': {'readonly': True}, } _attribute_map = { @@ -2430,17 +2769,19 @@ class UploadCertificateResponse(Model): 'service_principal_client_id': {'key': 'servicePrincipalClientId', 'type': 'str'}, 'service_principal_object_id': {'key': 'servicePrincipalObjectId', 'type': 'str'}, 'azure_management_endpoint_audience': {'key': 'azureManagementEndpointAudience', 'type': 'str'}, + 'aad_audience': {'key': 'aadAudience', 'type': 'str'}, } - def __init__(self, *, resource_id: str, aad_authority: str, aad_tenant_id: str, service_principal_client_id: str, service_principal_object_id: str, azure_management_endpoint_audience: str, auth_type=None, **kwargs) -> None: + def __init__(self, *, auth_type=None, **kwargs) -> None: super(UploadCertificateResponse, self).__init__(**kwargs) self.auth_type = auth_type - self.resource_id = resource_id - self.aad_authority = aad_authority - self.aad_tenant_id = aad_tenant_id - self.service_principal_client_id = service_principal_client_id - self.service_principal_object_id = service_principal_object_id - self.azure_management_endpoint_audience = azure_management_endpoint_audience + self.resource_id = None + self.aad_authority = None + self.aad_tenant_id = None + self.service_principal_client_id = None + self.service_principal_object_id = None + self.azure_management_endpoint_audience = None + self.aad_audience = None class User(ARMBaseModel): @@ -2450,6 +2791,8 @@ class User(ARMBaseModel): Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to Azure. + :ivar id: The path ID that uniquely identifies the object. :vartype id: str :ivar name: The object name. @@ -2463,12 +2806,16 @@ class User(ARMBaseModel): This field should not be specified during user creation. :type share_access_rights: list[~azure.mgmt.databoxedge.models.ShareAccessRight] + :param user_type: Required. Type of the user. Possible values include: + 'Share', 'LocalManagement', 'ARM' + :type user_type: str or ~azure.mgmt.databoxedge.models.UserType """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, + 'user_type': {'required': True}, } _attribute_map = { @@ -2477,12 +2824,14 @@ class User(ARMBaseModel): 'type': {'key': 'type', 'type': 'str'}, 'encrypted_password': {'key': 'properties.encryptedPassword', 'type': 'AsymmetricEncryptedSecret'}, 'share_access_rights': {'key': 'properties.shareAccessRights', 'type': '[ShareAccessRight]'}, + 'user_type': {'key': 'properties.userType', 'type': 'str'}, } - def __init__(self, *, encrypted_password=None, share_access_rights=None, **kwargs) -> None: + def __init__(self, *, user_type, encrypted_password=None, share_access_rights=None, **kwargs) -> None: super(User, self).__init__(**kwargs) self.encrypted_password = encrypted_password self.share_access_rights = share_access_rights + self.user_type = user_type class UserAccessRight(Model): diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_paged_models.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_paged_models.py index 851cb48d83f6..8133d5aea0dc 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_paged_models.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/models/_paged_models.py @@ -129,6 +129,32 @@ class StorageAccountCredentialPaged(Paged): def __init__(self, *args, **kwargs): super(StorageAccountCredentialPaged, self).__init__(*args, **kwargs) +class StorageAccountPaged(Paged): + """ + A paging container for iterating over a list of :class:`StorageAccount ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[StorageAccount]'} + } + + def __init__(self, *args, **kwargs): + + super(StorageAccountPaged, self).__init__(*args, **kwargs) +class ContainerPaged(Paged): + """ + A paging container for iterating over a list of :class:`Container ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Container]'} + } + + def __init__(self, *args, **kwargs): + + super(ContainerPaged, self).__init__(*args, **kwargs) class TriggerPaged(Paged): """ A paging container for iterating over a list of :class:`Trigger ` object @@ -155,3 +181,16 @@ class UserPaged(Paged): def __init__(self, *args, **kwargs): super(UserPaged, self).__init__(*args, **kwargs) +class ResourceTypeSkuPaged(Paged): + """ + A paging container for iterating over a list of :class:`ResourceTypeSku ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[ResourceTypeSku]'} + } + + def __init__(self, *args, **kwargs): + + super(ResourceTypeSkuPaged, self).__init__(*args, **kwargs) diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/__init__.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/__init__.py index e8213477ee00..71cd553a0f3c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/__init__.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/__init__.py @@ -20,8 +20,11 @@ from ._roles_operations import RolesOperations from ._shares_operations import SharesOperations from ._storage_account_credentials_operations import StorageAccountCredentialsOperations +from ._storage_accounts_operations import StorageAccountsOperations +from ._containers_operations import ContainersOperations from ._triggers_operations import TriggersOperations from ._users_operations import UsersOperations +from ._skus_operations import SkusOperations __all__ = [ 'Operations', @@ -35,6 +38,9 @@ 'RolesOperations', 'SharesOperations', 'StorageAccountCredentialsOperations', + 'StorageAccountsOperations', + 'ContainersOperations', 'TriggersOperations', 'UsersOperations', + 'SkusOperations', ] diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_alerts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_alerts_operations.py index 2d16789da646..895b05571306 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_alerts_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_alerts_operations.py @@ -25,7 +25,7 @@ class AlertsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_bandwidth_schedules_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_bandwidth_schedules_operations.py index 0ad9fc1ddd69..909380539267 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_bandwidth_schedules_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_bandwidth_schedules_operations.py @@ -27,7 +27,7 @@ class BandwidthSchedulesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_containers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_containers_operations.py new file mode 100644 index 000000000000..4faa47a14cf8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_containers_operations.py @@ -0,0 +1,467 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class ContainersOperations(object): + """ContainersOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version. Constant value: "2019-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01" + + self.config = config + + def list_by_storage_account( + self, device_name, storage_account_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the containers of a storage Account in a Data Box Edge/Data + Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The storage Account name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of Container + :rtype: + ~azure.mgmt.databoxedge.models.ContainerPaged[~azure.mgmt.databoxedge.models.Container] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_storage_account.metadata['url'] + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ContainerPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_storage_account.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers'} + + def get( + self, device_name, storage_account_name, container_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a container by name. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name + :type storage_account_name: str + :param container_name: The container Name + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: Container or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.databoxedge.models.Container or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('Container', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} + + + def _create_or_update_initial( + self, device_name, storage_account_name, container_name, container, resource_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(container, 'Container') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('Container', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, device_name, storage_account_name, container_name, container, resource_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new container or updates an existing container on the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param container: The container properties. + :type container: ~azure.mgmt.databoxedge.models.Container + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns Container or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.databoxedge.models.Container] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.databoxedge.models.Container]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + container=container, + resource_group_name=resource_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('Container', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} + + + def _delete_initial( + self, device_name, storage_account_name, container_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, device_name, storage_account_name, container_name, resource_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the container on the Data Box Edge/Data Box Gateway device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}'} + + + def _refresh_initial( + self, device_name, storage_account_name, container_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.refresh.metadata['url'] + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def refresh( + self, device_name, storage_account_name, container_name, resource_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Refreshes the container metadata with the data from the cloud. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The Storage Account Name + :type storage_account_name: str + :param container_name: The container name. + :type container_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._refresh_initial( + device_name=device_name, + storage_account_name=storage_account_name, + container_name=container_name, + resource_group_name=resource_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + refresh.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}/containers/{containerName}/refresh'} diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_devices_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_devices_operations.py index 7410acec30d7..dcf4f0eabe2a 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_devices_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_devices_operations.py @@ -27,7 +27,7 @@ class DevicesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_jobs_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_jobs_operations.py index 2613f370302a..0e47882421b7 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_jobs_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_jobs_operations.py @@ -25,7 +25,7 @@ class JobsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_nodes_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_nodes_operations.py index 04af2001890d..ac63fceb9a3f 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_nodes_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_nodes_operations.py @@ -25,7 +25,7 @@ class NodesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations.py index a4fe3a2fa754..dc50c1c33d76 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations.py @@ -25,7 +25,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations_status_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations_status_operations.py index 03c37ab0e666..582be0959a12 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations_status_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_operations_status_operations.py @@ -25,7 +25,7 @@ class OperationsStatusOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_orders_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_orders_operations.py index a1f8f12c7d77..8f147f295ca8 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_orders_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_orders_operations.py @@ -27,7 +27,7 @@ class OrdersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config @@ -229,7 +229,7 @@ def create_or_update( self, device_name, order, resource_group_name, custom_headers=None, raw=False, polling=True, **operation_config): """Creates or updates an order. - :param device_name: The device name. + :param device_name: The order details of a device. :type device_name: str :param order: The order to be created or updated. :type order: ~azure.mgmt.databoxedge.models.Order diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_roles_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_roles_operations.py index c62f788788f1..9113705462fe 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_roles_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_roles_operations.py @@ -27,7 +27,7 @@ class RolesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_shares_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_shares_operations.py index dd9d3a87f180..9d1752f028da 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_shares_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_shares_operations.py @@ -27,7 +27,7 @@ class SharesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_skus_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_skus_operations.py new file mode 100644 index 000000000000..6975b43691a8 --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_skus_operations.py @@ -0,0 +1,112 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError + +from .. import models + + +class SkusOperations(object): + """SkusOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version. Constant value: "2019-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01" + + self.config = config + + def list( + self, filter=None, custom_headers=None, raw=False, **operation_config): + """List all the available Skus in the region and information related to + them. + + :param filter: Specify $filter='location eq ' to filter on + location. + :type filter: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of ResourceTypeSku + :rtype: + ~azure.mgmt.databoxedge.models.ResourceTypeSkuPaged[~azure.mgmt.databoxedge.models.ResourceTypeSku] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.ResourceTypeSkuPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DataBoxEdge/skus'} diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_account_credentials_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_account_credentials_operations.py index 6c90b55888cd..6a57ab418f4c 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_account_credentials_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_account_credentials_operations.py @@ -27,7 +27,7 @@ class StorageAccountCredentialsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_accounts_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_accounts_operations.py new file mode 100644 index 000000000000..45395d1db84d --- /dev/null +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_storage_accounts_operations.py @@ -0,0 +1,368 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class StorageAccountsOperations(object): + """StorageAccountsOperations operations. + + You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: The API version. Constant value: "2019-08-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-08-01" + + self.config = config + + def list_by_data_box_edge_device( + self, device_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the storage accounts in a Data Box Edge/Data Box Gateway + device. + + :param device_name: The device name. + :type device_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of StorageAccount + :rtype: + ~azure.mgmt.databoxedge.models.StorageAccountPaged[~azure.mgmt.databoxedge.models.StorageAccount] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_data_box_edge_device.metadata['url'] + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + return request + + def internal_paging(next_link=None): + request = prepare_request(next_link) + + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + header_dict = None + if raw: + header_dict = {} + deserialized = models.StorageAccountPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_data_box_edge_device.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts'} + + def get( + self, device_name, storage_account_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Gets a StorageAccount by name. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The storage account name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: StorageAccount or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.databoxedge.models.StorageAccount or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} + + + def _create_or_update_initial( + self, device_name, storage_account_name, storage_account, resource_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(storage_account, 'StorageAccount') + + # Construct and send request + request = self._client.put(url, query_parameters, header_parameters, body_content) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, device_name, storage_account_name, storage_account, resource_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new StorageAccount or updates an existing StorageAccount on + the device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param storage_account: The StorageAccount properties. + :type storage_account: ~azure.mgmt.databoxedge.models.StorageAccount + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns StorageAccount or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.databoxedge.models.StorageAccount] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.databoxedge.models.StorageAccount]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + device_name=device_name, + storage_account_name=storage_account_name, + storage_account=storage_account, + resource_group_name=resource_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('StorageAccount', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} + + + def _delete_initial( + self, device_name, storage_account_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'deviceName': self._serialize.url("device_name", device_name, 'str'), + 'storageAccountName': self._serialize.url("storage_account_name", storage_account_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, device_name, storage_account_name, resource_group_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the StorageAccount on the Data Box Edge/Data Box Gateway + device. + + :param device_name: The device name. + :type device_name: str + :param storage_account_name: The StorageAccount name. + :type storage_account_name: str + :param resource_group_name: The resource group name. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + device_name=device_name, + storage_account_name=storage_account_name, + resource_group_name=resource_group_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataBoxEdge/dataBoxEdgeDevices/{deviceName}/storageAccounts/{storageAccountName}'} diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_triggers_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_triggers_operations.py index 0ad316826af5..0e632d3e89ad 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_triggers_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_triggers_operations.py @@ -27,7 +27,7 @@ class TriggersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -37,21 +37,21 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config def list_by_data_box_edge_device( - self, device_name, resource_group_name, expand=None, custom_headers=None, raw=False, **operation_config): + self, device_name, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): """Lists all the triggers configured in the device. :param device_name: The device name. :type device_name: str :param resource_group_name: The resource group name. :type resource_group_name: str - :param expand: Specify $filter='CustomContextTag eq ' to filter + :param filter: Specify $filter='CustomContextTag eq ' to filter on custom context tag property - :type expand: str + :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -76,8 +76,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') - if expand is not None: - query_parameters['$expand'] = self._serialize.query("expand", expand, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') else: url = next_link diff --git a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_users_operations.py b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_users_operations.py index c694b73ddde6..b29e8057b23b 100644 --- a/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_users_operations.py +++ b/sdk/databoxedge/azure-mgmt-databoxedge/azure/mgmt/databoxedge/operations/_users_operations.py @@ -27,7 +27,7 @@ class UsersOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version. Constant value: "2019-07-01". + :ivar api_version: The API version. Constant value: "2019-08-01". """ models = models @@ -37,12 +37,12 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2019-07-01" + self.api_version = "2019-08-01" self.config = config def list_by_data_box_edge_device( - self, device_name, resource_group_name, custom_headers=None, raw=False, **operation_config): + self, device_name, resource_group_name, filter=None, custom_headers=None, raw=False, **operation_config): """Gets all the users registered on a Data Box Edge/Data Box Gateway device. @@ -50,6 +50,9 @@ def list_by_data_box_edge_device( :type device_name: str :param resource_group_name: The resource group name. :type resource_group_name: str + :param filter: Specify $filter='UserType eq ' to filter on user + type property + :type filter: str :param dict custom_headers: headers that will be added to the request :param bool raw: returns the direct response alongside the deserialized response @@ -74,6 +77,8 @@ def prepare_request(next_link=None): # Construct parameters query_parameters = {} query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + if filter is not None: + query_parameters['$filter'] = self._serialize.query("filter", filter, 'str') else: url = next_link