From 4f9894a385040981e9b4d2dd7952545f5b7e9633 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 1 Dec 2021 06:21:26 +0000 Subject: [PATCH] CodeGen from PR 16925 in Azure/azure-rest-api-specs Merge 4bb254a7d0ddee5d896a9140848ad788500a9777 into 4235ccfdd01fc722e9144b82024a3255fde0cc77 --- .../azure/mgmt/hybriddatamanager/__init__.py | 19 + .../mgmt/hybriddatamanager/_configuration.py | 48 + .../_hybrid_data_management_client.py | 84 ++ .../mgmt/hybriddatamanager/models/__init__.py | 118 ++ .../_hybrid_data_management_client_enums.py | 82 ++ .../mgmt/hybriddatamanager/models/_models.py | 1003 +++++++++++++++++ .../hybriddatamanager/models/_models_py3.py | 1003 +++++++++++++++++ .../hybriddatamanager/models/_paged_models.py | 118 ++ .../hybriddatamanager/operations/__init__.py | 30 + .../operations/_data_managers_operations.py | 543 +++++++++ .../operations/_data_services_operations.py | 181 +++ .../_data_store_types_operations.py | 181 +++ .../operations/_data_stores_operations.py | 379 +++++++ .../operations/_job_definitions_operations.py | 571 ++++++++++ .../operations/_jobs_operations.py | 554 +++++++++ .../operations/_operations.py | 102 ++ .../operations/_public_keys_operations.py | 181 +++ .../azure/mgmt/hybriddatamanager/version.py | 13 + 18 files changed, 5210 insertions(+) create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/__init__.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/_configuration.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/_hybrid_data_management_client.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/__init__.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_hybrid_data_management_client_enums.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_models.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_models_py3.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_paged_models.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/__init__.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_managers_operations.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_services_operations.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_store_types_operations.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_stores_operations.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_job_definitions_operations.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_jobs_operations.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_operations.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_public_keys_operations.py create mode 100644 sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/version.py diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/__init__.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/__init__.py new file mode 100644 index 000000000000..15e1e5a1bc26 --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/__init__.py @@ -0,0 +1,19 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._configuration import HybridDataManagementClientConfiguration +from ._hybrid_data_management_client import HybridDataManagementClient +__all__ = ['HybridDataManagementClient', 'HybridDataManagementClientConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/_configuration.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/_configuration.py new file mode 100644 index 000000000000..909c4a863a64 --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/_configuration.py @@ -0,0 +1,48 @@ +# 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. +# -------------------------------------------------------------------------- +from msrestazure import AzureConfiguration + +from .version import VERSION + + +class HybridDataManagementClientConfiguration(AzureConfiguration): + """Configuration for HybridDataManagementClient + Note that all parameters used to create this instance are saved as instance + attributes. + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Subscription Id + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + if credentials is None: + raise ValueError("Parameter 'credentials' must not be None.") + if subscription_id is None: + raise ValueError("Parameter 'subscription_id' must not be None.") + if not base_url: + base_url = 'https://management.azure.com' + + super(HybridDataManagementClientConfiguration, self).__init__(base_url) + + # Starting Autorest.Python 4.0.64, make connection pool activated by default + self.keep_alive = True + + self.add_user_agent('azure-mgmt-hybriddatamanager/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/_hybrid_data_management_client.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/_hybrid_data_management_client.py new file mode 100644 index 000000000000..d7f36bed44be --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/_hybrid_data_management_client.py @@ -0,0 +1,84 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.service_client import SDKClient +from msrest import Serializer, Deserializer + +from ._configuration import HybridDataManagementClientConfiguration +from .operations import Operations +from .operations import DataManagersOperations +from .operations import DataServicesOperations +from .operations import JobDefinitionsOperations +from .operations import JobsOperations +from .operations import DataStoresOperations +from .operations import DataStoreTypesOperations +from .operations import PublicKeysOperations +from . import models + + +class HybridDataManagementClient(SDKClient): + """HybridDataManagementClient + + :ivar config: Configuration for client. + :vartype config: HybridDataManagementClientConfiguration + + :ivar operations: Operations operations + :vartype operations: azure.mgmt.hybriddatamanager.operations.Operations + :ivar data_managers: DataManagers operations + :vartype data_managers: azure.mgmt.hybriddatamanager.operations.DataManagersOperations + :ivar data_services: DataServices operations + :vartype data_services: azure.mgmt.hybriddatamanager.operations.DataServicesOperations + :ivar job_definitions: JobDefinitions operations + :vartype job_definitions: azure.mgmt.hybriddatamanager.operations.JobDefinitionsOperations + :ivar jobs: Jobs operations + :vartype jobs: azure.mgmt.hybriddatamanager.operations.JobsOperations + :ivar data_stores: DataStores operations + :vartype data_stores: azure.mgmt.hybriddatamanager.operations.DataStoresOperations + :ivar data_store_types: DataStoreTypes operations + :vartype data_store_types: azure.mgmt.hybriddatamanager.operations.DataStoreTypesOperations + :ivar public_keys: PublicKeys operations + :vartype public_keys: azure.mgmt.hybriddatamanager.operations.PublicKeysOperations + + :param credentials: Credentials needed for the client to connect to Azure. + :type credentials: :mod:`A msrestazure Credentials + object` + :param subscription_id: The Subscription Id + :type subscription_id: str + :param str base_url: Service URL + """ + + def __init__( + self, credentials, subscription_id, base_url=None): + + self.config = HybridDataManagementClientConfiguration(credentials, subscription_id, base_url) + super(HybridDataManagementClient, 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-06-01' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.operations = Operations( + self._client, self.config, self._serialize, self._deserialize) + self.data_managers = DataManagersOperations( + self._client, self.config, self._serialize, self._deserialize) + self.data_services = DataServicesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.job_definitions = JobDefinitionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.jobs = JobsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.data_stores = DataStoresOperations( + self._client, self.config, self._serialize, self._deserialize) + self.data_store_types = DataStoreTypesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.public_keys = PublicKeysOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/__init__.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/__init__.py new file mode 100644 index 000000000000..7d1a17d0997c --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/__init__.py @@ -0,0 +1,118 @@ +# 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. +# -------------------------------------------------------------------------- + +try: + from ._models_py3 import AvailableProviderOperation + from ._models_py3 import AvailableProviderOperationDisplay + from ._models_py3 import CustomerSecret + from ._models_py3 import DataManager + from ._models_py3 import DataManagerUpdateParameter + from ._models_py3 import DataService + from ._models_py3 import DataStore + from ._models_py3 import DataStoreFilter + from ._models_py3 import DataStoreType + from ._models_py3 import DmsBaseObject + from ._models_py3 import Error + from ._models_py3 import ErrorDetails + from ._models_py3 import Job + from ._models_py3 import JobDefinition + from ._models_py3 import JobDefinitionFilter + from ._models_py3 import JobDetails + from ._models_py3 import JobFilter + from ._models_py3 import JobStages + from ._models_py3 import Key + from ._models_py3 import PublicKey + from ._models_py3 import Resource + from ._models_py3 import RunParameters + from ._models_py3 import Schedule + from ._models_py3 import Sku +except (SyntaxError, ImportError): + from ._models import AvailableProviderOperation + from ._models import AvailableProviderOperationDisplay + from ._models import CustomerSecret + from ._models import DataManager + from ._models import DataManagerUpdateParameter + from ._models import DataService + from ._models import DataStore + from ._models import DataStoreFilter + from ._models import DataStoreType + from ._models import DmsBaseObject + from ._models import Error + from ._models import ErrorDetails + from ._models import Job + from ._models import JobDefinition + from ._models import JobDefinitionFilter + from ._models import JobDetails + from ._models import JobFilter + from ._models import JobStages + from ._models import Key + from ._models import PublicKey + from ._models import Resource + from ._models import RunParameters + from ._models import Schedule + from ._models import Sku +from ._paged_models import AvailableProviderOperationPaged +from ._paged_models import DataManagerPaged +from ._paged_models import DataServicePaged +from ._paged_models import DataStorePaged +from ._paged_models import DataStoreTypePaged +from ._paged_models import JobDefinitionPaged +from ._paged_models import JobPaged +from ._paged_models import PublicKeyPaged +from ._hybrid_data_management_client_enums import ( + SupportedAlgorithm, + State, + JobStatus, + IsJobCancellable, + RunLocation, + UserConfirmation, +) + +__all__ = [ + 'AvailableProviderOperation', + 'AvailableProviderOperationDisplay', + 'CustomerSecret', + 'DataManager', + 'DataManagerUpdateParameter', + 'DataService', + 'DataStore', + 'DataStoreFilter', + 'DataStoreType', + 'DmsBaseObject', + 'Error', + 'ErrorDetails', + 'Job', + 'JobDefinition', + 'JobDefinitionFilter', + 'JobDetails', + 'JobFilter', + 'JobStages', + 'Key', + 'PublicKey', + 'Resource', + 'RunParameters', + 'Schedule', + 'Sku', + 'AvailableProviderOperationPaged', + 'DataManagerPaged', + 'DataServicePaged', + 'JobDefinitionPaged', + 'JobPaged', + 'DataStorePaged', + 'DataStoreTypePaged', + 'PublicKeyPaged', + 'SupportedAlgorithm', + 'State', + 'JobStatus', + 'IsJobCancellable', + 'RunLocation', + 'UserConfirmation', +] diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_hybrid_data_management_client_enums.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_hybrid_data_management_client_enums.py new file mode 100644 index 000000000000..621e551b64a0 --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_hybrid_data_management_client_enums.py @@ -0,0 +1,82 @@ +# 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. +# -------------------------------------------------------------------------- + +from enum import Enum + + +class SupportedAlgorithm(str, Enum): + + none = "None" + rsa1_5 = "RSA1_5" + rsa_oaep = "RSA_OAEP" + plain_text = "PlainText" + + +class State(str, Enum): + + disabled = "Disabled" + enabled = "Enabled" + supported = "Supported" + + +class JobStatus(str, Enum): + + none = "None" + in_progress = "InProgress" + succeeded = "Succeeded" + waiting_for_action = "WaitingForAction" + failed = "Failed" + cancelled = "Cancelled" + cancelling = "Cancelling" + partially_succeeded = "PartiallySucceeded" + + +class IsJobCancellable(str, Enum): + + not_cancellable = "NotCancellable" + cancellable = "Cancellable" + + +class RunLocation(str, Enum): + + none = "none" + australiaeast = "australiaeast" + australiasoutheast = "australiasoutheast" + brazilsouth = "brazilsouth" + canadacentral = "canadacentral" + canadaeast = "canadaeast" + centralindia = "centralindia" + centralus = "centralus" + eastasia = "eastasia" + eastus = "eastus" + eastus2 = "eastus2" + japaneast = "japaneast" + japanwest = "japanwest" + koreacentral = "koreacentral" + koreasouth = "koreasouth" + southeastasia = "southeastasia" + southcentralus = "southcentralus" + southindia = "southindia" + northcentralus = "northcentralus" + northeurope = "northeurope" + uksouth = "uksouth" + ukwest = "ukwest" + westcentralus = "westcentralus" + westeurope = "westeurope" + westindia = "westindia" + westus = "westus" + westus2 = "westus2" + + +class UserConfirmation(str, Enum): + + not_required = "NotRequired" + required = "Required" diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_models.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_models.py new file mode 100644 index 000000000000..b014e4613635 --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_models.py @@ -0,0 +1,1003 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProviderOperation(Model): + """Class represents provider operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or Sets Name of the operations + :type name: str + :param display: Gets or sets Display information + Contains the localized display information for this particular + operation/action + :type display: + ~azure.mgmt.hybriddatamanager.models.AvailableProviderOperationDisplay + :param origin: Gets or sets Origin + The intended executor of the operation; governs the display of the + operation in the RBAC UX and the audit logs UX. + Default value is “user,system” + :type origin: str + :param properties: Gets or sets Properties + Reserved for future use + :type properties: object + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'AvailableProviderOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(AvailableProviderOperation, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + + +class AvailableProviderOperationDisplay(Model): + """Contains the localized display information for this particular operation / + action. + These value will be used by several clients for + (1) custom role definitions for RBAC; + (2) complex query filters for the event service; and (3) audit history / + records for management operations. + + :param provider: Gets or sets Provider + The localized friendly form of the resource provider name – it is expected + to also include the publisher/company responsible. + It should use Title Casing and begin with “Microsoft” for 1st party + services. + :type provider: str + :param resource: Gets or sets Resource + The localized friendly form of the resource type related to this + action/operation – it should match the public documentation for the + resource provider. + It should use Title Casing – for examples, please refer to the “name” + section. + :type resource: str + :param operation: Gets or sets Operation + The localized friendly name for the operation, as it should be shown to + the user. + It should be concise (to fit in drop downs) but clear (i.e. + self-documenting). It should use Title Casing and include the + entity/resource to which it applies. + :type operation: str + :param description: Gets or sets Description + The localized friendly description for the operation, as it should be + shown to the user. + It should be thorough, yet concise – it will be used in tool tips and + detailed views. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AvailableProviderOperationDisplay, self).__init__(**kwargs) + self.provider = kwargs.get('provider', None) + self.resource = kwargs.get('resource', None) + self.operation = kwargs.get('operation', None) + self.description = kwargs.get('description', None) + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomerSecret(Model): + """The pair of customer secret. + + All required parameters must be populated in order to send to Azure. + + :param key_identifier: Required. The identifier to the data service input + object which this secret corresponds to. + :type key_identifier: str + :param key_value: Required. It contains the encrypted customer secret. + :type key_value: str + :param algorithm: Required. The encryption algorithm used to encrypt data. + Possible values include: 'None', 'RSA1_5', 'RSA_OAEP', 'PlainText' + :type algorithm: str or + ~azure.mgmt.hybriddatamanager.models.SupportedAlgorithm + """ + + _validation = { + 'key_identifier': {'required': True}, + 'key_value': {'required': True}, + 'algorithm': {'required': True}, + } + + _attribute_map = { + 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + 'key_value': {'key': 'keyValue', 'type': 'str'}, + 'algorithm': {'key': 'algorithm', 'type': 'SupportedAlgorithm'}, + } + + def __init__(self, **kwargs): + super(CustomerSecret, self).__init__(**kwargs) + self.key_identifier = kwargs.get('key_identifier', None) + self.key_value = kwargs.get('key_value', None) + self.algorithm = kwargs.get('algorithm', None) + + +class Resource(Model): + """Model of the Resource. + + 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 Resource Id. + :vartype id: str + :ivar name: The Resource Name. + :vartype name: str + :ivar type: The Resource type. + :vartype type: str + :param location: Required. The location of the resource. This will be one + of the supported and registered Azure Geo Regions (e.g. West US, East + US, Southeast Asia, etc.). The geo region of a resource cannot be changed + once it is created, but if an identical geo + region is specified on update the request will succeed. + :type location: str + :param tags: The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource + (across resource groups). + :type tags: dict[str, str] + :param sku: The sku type. + :type sku: ~azure.mgmt.hybriddatamanager.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, **kwargs): + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = kwargs.get('location', None) + self.tags = kwargs.get('tags', None) + self.sku = kwargs.get('sku', None) + + +class DataManager(Resource): + """The DataManager resource. + + 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 Resource Id. + :vartype id: str + :ivar name: The Resource Name. + :vartype name: str + :ivar type: The Resource type. + :vartype type: str + :param location: Required. The location of the resource. This will be one + of the supported and registered Azure Geo Regions (e.g. West US, East + US, Southeast Asia, etc.). The geo region of a resource cannot be changed + once it is created, but if an identical geo + region is specified on update the request will succeed. + :type location: str + :param tags: The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource + (across resource groups). + :type tags: dict[str, str] + :param sku: The sku type. + :type sku: ~azure.mgmt.hybriddatamanager.models.Sku + :param etag: Etag of the Resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataManager, self).__init__(**kwargs) + self.etag = kwargs.get('etag', None) + + +class DataManagerUpdateParameter(Model): + """The DataManagerUpdateParameter. + + :param sku: The sku type. + :type sku: ~azure.mgmt.hybriddatamanager.models.Sku + :param tags: The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource + (across resource groups). + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, **kwargs): + super(DataManagerUpdateParameter, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.tags = kwargs.get('tags', None) + + +class DmsBaseObject(Model): + """Base class for all objects under DataManager Service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DmsBaseObject, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + + +class DataService(DmsBaseObject): + """Data Service. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param state: Required. State of the data service. Possible values + include: 'Disabled', 'Enabled', 'Supported' + :type state: str or ~azure.mgmt.hybriddatamanager.models.State + :param supported_data_sink_types: Supported data store types which can be + used as a sink. + :type supported_data_sink_types: list[str] + :param supported_data_source_types: Supported data store types which can + be used as a source. + :type supported_data_source_types: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'State'}, + 'supported_data_sink_types': {'key': 'properties.supportedDataSinkTypes', 'type': '[str]'}, + 'supported_data_source_types': {'key': 'properties.supportedDataSourceTypes', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(DataService, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.supported_data_sink_types = kwargs.get('supported_data_sink_types', None) + self.supported_data_source_types = kwargs.get('supported_data_source_types', None) + + +class DataStore(DmsBaseObject): + """Data store. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param repository_id: Arm Id for the manager resource to which the data + source is associated. This is optional. + :type repository_id: str + :param state: Required. State of the data source. Possible values include: + 'Disabled', 'Enabled', 'Supported' + :type state: str or ~azure.mgmt.hybriddatamanager.models.State + :param extended_properties: A generic json used differently by each data + source type. + :type extended_properties: object + :param data_store_type_id: Required. The arm id of the data store type. + :type data_store_type_id: str + :param customer_secrets: List of customer secrets containing a key + identifier and key value. The key identifier is a way for the specific + data source to understand the key. Value contains customer secret + encrypted by the encryptionKeys. + :type customer_secrets: + list[~azure.mgmt.hybriddatamanager.models.CustomerSecret] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'required': True}, + 'data_store_type_id': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_id': {'key': 'properties.repositoryId', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'State'}, + 'extended_properties': {'key': 'properties.extendedProperties', 'type': 'object'}, + 'data_store_type_id': {'key': 'properties.dataStoreTypeId', 'type': 'str'}, + 'customer_secrets': {'key': 'properties.customerSecrets', 'type': '[CustomerSecret]'}, + } + + def __init__(self, **kwargs): + super(DataStore, self).__init__(**kwargs) + self.repository_id = kwargs.get('repository_id', None) + self.state = kwargs.get('state', None) + self.extended_properties = kwargs.get('extended_properties', None) + self.data_store_type_id = kwargs.get('data_store_type_id', None) + self.customer_secrets = kwargs.get('customer_secrets', None) + + +class DataStoreFilter(Model): + """Contains the information about the filters for the DataStore. + + :param data_store_type_id: The data store type id. + :type data_store_type_id: str + """ + + _attribute_map = { + 'data_store_type_id': {'key': 'dataStoreTypeId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DataStoreFilter, self).__init__(**kwargs) + self.data_store_type_id = kwargs.get('data_store_type_id', None) + + +class DataStoreType(DmsBaseObject): + """Data Store Type. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param repository_type: Arm type for the manager resource to which the + data source type is associated. This is optional. + :type repository_type: str + :param state: Required. State of the data store type. Possible values + include: 'Disabled', 'Enabled', 'Supported' + :type state: str or ~azure.mgmt.hybriddatamanager.models.State + :param supported_data_services_as_sink: Supported data services where it + can be used as a sink. + :type supported_data_services_as_sink: list[str] + :param supported_data_services_as_source: Supported data services where it + can be used as a source. + :type supported_data_services_as_source: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_type': {'key': 'properties.repositoryType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'State'}, + 'supported_data_services_as_sink': {'key': 'properties.supportedDataServicesAsSink', 'type': '[str]'}, + 'supported_data_services_as_source': {'key': 'properties.supportedDataServicesAsSource', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(DataStoreType, self).__init__(**kwargs) + self.repository_type = kwargs.get('repository_type', None) + self.state = kwargs.get('state', None) + self.supported_data_services_as_sink = kwargs.get('supported_data_services_as_sink', None) + self.supported_data_services_as_source = kwargs.get('supported_data_services_as_source', None) + + +class Error(Model): + """Top level error for the job. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code that can be used to programmatically + identify the error. + :type code: str + :param message: Describes the error in detail and provides debugging + information. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Error, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + + +class ErrorDetails(Model): + """Error Details. + + :param error_message: Error message. + :type error_message: str + :param error_code: Error code. + :type error_code: int + :param recommended_action: Recommended action for the error. + :type recommended_action: str + :param exception_message: Contains the non localized exception message + :type exception_message: str + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, + 'exception_message': {'key': 'exceptionMessage', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ErrorDetails, self).__init__(**kwargs) + self.error_message = kwargs.get('error_message', None) + self.error_code = kwargs.get('error_code', None) + self.recommended_action = kwargs.get('recommended_action', None) + self.exception_message = kwargs.get('exception_message', None) + + +class Job(DmsBaseObject): + """Data service job. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param status: Required. Status of the job. Possible values include: + 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', + 'Cancelled', 'Cancelling', 'PartiallySucceeded' + :type status: str or ~azure.mgmt.hybriddatamanager.models.JobStatus + :param start_time: Required. Time at which the job was started in UTC ISO + 8601 format. + :type start_time: datetime + :param end_time: Time at which the job ended in UTC ISO 8601 format. + :type end_time: datetime + :param is_cancellable: Required. Describes whether the job is cancellable. + Possible values include: 'NotCancellable', 'Cancellable' + :type is_cancellable: str or + ~azure.mgmt.hybriddatamanager.models.IsJobCancellable + :param bytes_processed: Number of bytes processed by the job as of now. + :type bytes_processed: long + :param items_processed: Number of items processed by the job as of now + :type items_processed: long + :param total_bytes_to_process: Number of bytes to be processed by the job + in total. + :type total_bytes_to_process: long + :param total_items_to_process: Number of items to be processed by the job + in total + :type total_items_to_process: long + :param details: Details of a job run. This field will only be sent for + expand details filter. + :type details: ~azure.mgmt.hybriddatamanager.models.JobDetails + :param data_source_name: Name of the data source on which the job was + triggered. + :type data_source_name: str + :param data_sink_name: Name of the data sink on which the job was + triggered. + :type data_sink_name: str + :param error: Top level error for the job. + :type error: ~azure.mgmt.hybriddatamanager.models.Error + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'required': True}, + 'start_time': {'required': True}, + 'is_cancellable': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'JobStatus'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'IsJobCancellable'}, + 'bytes_processed': {'key': 'properties.bytesProcessed', 'type': 'long'}, + 'items_processed': {'key': 'properties.itemsProcessed', 'type': 'long'}, + 'total_bytes_to_process': {'key': 'properties.totalBytesToProcess', 'type': 'long'}, + 'total_items_to_process': {'key': 'properties.totalItemsToProcess', 'type': 'long'}, + 'details': {'key': 'properties.details', 'type': 'JobDetails'}, + 'data_source_name': {'key': 'properties.dataSourceName', 'type': 'str'}, + 'data_sink_name': {'key': 'properties.dataSinkName', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, **kwargs): + super(Job, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.start_time = kwargs.get('start_time', None) + self.end_time = kwargs.get('end_time', None) + self.is_cancellable = kwargs.get('is_cancellable', None) + self.bytes_processed = kwargs.get('bytes_processed', None) + self.items_processed = kwargs.get('items_processed', None) + self.total_bytes_to_process = kwargs.get('total_bytes_to_process', None) + self.total_items_to_process = kwargs.get('total_items_to_process', None) + self.details = kwargs.get('details', None) + self.data_source_name = kwargs.get('data_source_name', None) + self.data_sink_name = kwargs.get('data_sink_name', None) + self.error = kwargs.get('error', None) + + +class JobDefinition(DmsBaseObject): + """Job Definition. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param data_source_id: Required. Data Source Id associated to the job + definition. + :type data_source_id: str + :param data_sink_id: Required. Data Sink Id associated to the job + definition. + :type data_sink_id: str + :param schedules: Schedule for running the job definition + :type schedules: list[~azure.mgmt.hybriddatamanager.models.Schedule] + :param state: Required. State of the job definition. Possible values + include: 'Disabled', 'Enabled', 'Supported' + :type state: str or ~azure.mgmt.hybriddatamanager.models.State + :param last_modified_time: Last modified time of the job definition. + :type last_modified_time: datetime + :param run_location: This is the preferred geo location for the job to + run. Possible values include: 'none', 'australiaeast', + 'australiasoutheast', 'brazilsouth', 'canadacentral', 'canadaeast', + 'centralindia', 'centralus', 'eastasia', 'eastus', 'eastus2', 'japaneast', + 'japanwest', 'koreacentral', 'koreasouth', 'southeastasia', + 'southcentralus', 'southindia', 'northcentralus', 'northeurope', + 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', + 'westus2' + :type run_location: str or + ~azure.mgmt.hybriddatamanager.models.RunLocation + :param user_confirmation: Enum to detect if user confirmation is required. + If not passed will default to NotRequired. Possible values include: + 'NotRequired', 'Required'. Default value: "NotRequired" . + :type user_confirmation: str or + ~azure.mgmt.hybriddatamanager.models.UserConfirmation + :param data_service_input: A generic json used differently by each data + service type. + :type data_service_input: object + :param customer_secrets: List of customer secrets containing a key + identifier and key value. The key identifier is a way for the specific + data source to understand the key. Value contains customer secret + encrypted by the encryptionKeys. + :type customer_secrets: + list[~azure.mgmt.hybriddatamanager.models.CustomerSecret] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'data_source_id': {'required': True}, + 'data_sink_id': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_source_id': {'key': 'properties.dataSourceId', 'type': 'str'}, + 'data_sink_id': {'key': 'properties.dataSinkId', 'type': 'str'}, + 'schedules': {'key': 'properties.schedules', 'type': '[Schedule]'}, + 'state': {'key': 'properties.state', 'type': 'State'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'run_location': {'key': 'properties.runLocation', 'type': 'RunLocation'}, + 'user_confirmation': {'key': 'properties.userConfirmation', 'type': 'UserConfirmation'}, + 'data_service_input': {'key': 'properties.dataServiceInput', 'type': 'object'}, + 'customer_secrets': {'key': 'properties.customerSecrets', 'type': '[CustomerSecret]'}, + } + + def __init__(self, **kwargs): + super(JobDefinition, self).__init__(**kwargs) + self.data_source_id = kwargs.get('data_source_id', None) + self.data_sink_id = kwargs.get('data_sink_id', None) + self.schedules = kwargs.get('schedules', None) + self.state = kwargs.get('state', None) + self.last_modified_time = kwargs.get('last_modified_time', None) + self.run_location = kwargs.get('run_location', None) + self.user_confirmation = kwargs.get('user_confirmation', "NotRequired") + self.data_service_input = kwargs.get('data_service_input', None) + self.customer_secrets = kwargs.get('customer_secrets', None) + + +class JobDefinitionFilter(Model): + """Contains the supported job definition filters. + + All required parameters must be populated in order to send to Azure. + + :param state: Required. The state of the job definition. Possible values + include: 'Disabled', 'Enabled', 'Supported' + :type state: str or ~azure.mgmt.hybriddatamanager.models.State + :param data_source: The data source associated with the job definition + :type data_source: str + :param last_modified: The last modified date time of the data source. + :type last_modified: datetime + """ + + _validation = { + 'state': {'required': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'State'}, + 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(JobDefinitionFilter, self).__init__(**kwargs) + self.state = kwargs.get('state', None) + self.data_source = kwargs.get('data_source', None) + self.last_modified = kwargs.get('last_modified', None) + + +class JobDetails(Model): + """Job details. + + :param job_stages: List of stages that ran in the job + :type job_stages: list[~azure.mgmt.hybriddatamanager.models.JobStages] + :param job_definition: JobDefinition at the time of the run + :type job_definition: ~azure.mgmt.hybriddatamanager.models.JobDefinition + :param error_details: Error details for failure. This is optional. + :type error_details: + list[~azure.mgmt.hybriddatamanager.models.ErrorDetails] + :param item_details_link: Item Details Link to download files or see + details + :type item_details_link: str + """ + + _attribute_map = { + 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, + 'job_definition': {'key': 'jobDefinition', 'type': 'JobDefinition'}, + 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetails]'}, + 'item_details_link': {'key': 'itemDetailsLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobDetails, self).__init__(**kwargs) + self.job_stages = kwargs.get('job_stages', None) + self.job_definition = kwargs.get('job_definition', None) + self.error_details = kwargs.get('error_details', None) + self.item_details_link = kwargs.get('item_details_link', None) + + +class JobFilter(Model): + """Contains the information about the filters for the job. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The status of the job. Possible values include: + 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', + 'Cancelled', 'Cancelling', 'PartiallySucceeded' + :type status: str or ~azure.mgmt.hybriddatamanager.models.JobStatus + :param start_time: The start time of the job. + :type start_time: datetime + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'JobStatus'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + } + + def __init__(self, **kwargs): + super(JobFilter, self).__init__(**kwargs) + self.status = kwargs.get('status', None) + self.start_time = kwargs.get('start_time', None) + + +class JobStages(Model): + """Job stages. + + All required parameters must be populated in order to send to Azure. + + :param stage_name: Name of the job stage. + :type stage_name: str + :param stage_status: Required. Status of the job stage. Possible values + include: 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', + 'Cancelled', 'Cancelling', 'PartiallySucceeded' + :type stage_status: str or ~azure.mgmt.hybriddatamanager.models.JobStatus + :param job_stage_details: Job Stage Details + :type job_stage_details: object + :param error_details: Error details for the stage. This is optional + :type error_details: + list[~azure.mgmt.hybriddatamanager.models.ErrorDetails] + """ + + _validation = { + 'stage_status': {'required': True}, + } + + _attribute_map = { + 'stage_name': {'key': 'stageName', 'type': 'str'}, + 'stage_status': {'key': 'stageStatus', 'type': 'JobStatus'}, + 'job_stage_details': {'key': 'jobStageDetails', 'type': 'object'}, + 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetails]'}, + } + + def __init__(self, **kwargs): + super(JobStages, self).__init__(**kwargs) + self.stage_name = kwargs.get('stage_name', None) + self.stage_status = kwargs.get('stage_status', None) + self.job_stage_details = kwargs.get('job_stage_details', None) + self.error_details = kwargs.get('error_details', None) + + +class Key(Model): + """Encryption Key. + + All required parameters must be populated in order to send to Azure. + + :param key_modulus: Required. Modulus of the encryption key. + :type key_modulus: str + :param key_exponent: Required. Exponent of the encryption key. + :type key_exponent: str + :param encryption_chunk_size_in_bytes: Required. The maximum byte size + that can be encrypted by the key. For a key size larger than the size, + break into chunks and encrypt each chunk, append each encrypted chunk with + : to mark the end of the chunk. + :type encryption_chunk_size_in_bytes: int + """ + + _validation = { + 'key_modulus': {'required': True}, + 'key_exponent': {'required': True}, + 'encryption_chunk_size_in_bytes': {'required': True}, + } + + _attribute_map = { + 'key_modulus': {'key': 'keyModulus', 'type': 'str'}, + 'key_exponent': {'key': 'keyExponent', 'type': 'str'}, + 'encryption_chunk_size_in_bytes': {'key': 'encryptionChunkSizeInBytes', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(Key, self).__init__(**kwargs) + self.key_modulus = kwargs.get('key_modulus', None) + self.key_exponent = kwargs.get('key_exponent', None) + self.encryption_chunk_size_in_bytes = kwargs.get('encryption_chunk_size_in_bytes', None) + + +class PublicKey(DmsBaseObject): + """Public key. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param data_service_level1_key: Required. Level one public key for + encryption + :type data_service_level1_key: ~azure.mgmt.hybriddatamanager.models.Key + :param data_service_level2_key: Required. Level two public key for + encryption + :type data_service_level2_key: ~azure.mgmt.hybriddatamanager.models.Key + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'data_service_level1_key': {'required': True}, + 'data_service_level2_key': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_service_level1_key': {'key': 'properties.dataServiceLevel1Key', 'type': 'Key'}, + 'data_service_level2_key': {'key': 'properties.dataServiceLevel2Key', 'type': 'Key'}, + } + + def __init__(self, **kwargs): + super(PublicKey, self).__init__(**kwargs) + self.data_service_level1_key = kwargs.get('data_service_level1_key', None) + self.data_service_level2_key = kwargs.get('data_service_level2_key', None) + + +class RunParameters(Model): + """Run parameters for a job. + + :param user_confirmation: Enum to detect if user confirmation is required. + If not passed will default to NotRequired. Possible values include: + 'NotRequired', 'Required'. Default value: "NotRequired" . + :type user_confirmation: str or + ~azure.mgmt.hybriddatamanager.models.UserConfirmation + :param data_service_input: A generic json used differently by each data + service type. + :type data_service_input: object + :param customer_secrets: List of customer secrets containing a key + identifier and key value. The key identifier is a way for the specific + data source to understand the key. Value contains customer secret + encrypted by the encryptionKeys. + :type customer_secrets: + list[~azure.mgmt.hybriddatamanager.models.CustomerSecret] + """ + + _attribute_map = { + 'user_confirmation': {'key': 'userConfirmation', 'type': 'UserConfirmation'}, + 'data_service_input': {'key': 'dataServiceInput', 'type': 'object'}, + 'customer_secrets': {'key': 'customerSecrets', 'type': '[CustomerSecret]'}, + } + + def __init__(self, **kwargs): + super(RunParameters, self).__init__(**kwargs) + self.user_confirmation = kwargs.get('user_confirmation', "NotRequired") + self.data_service_input = kwargs.get('data_service_input', None) + self.customer_secrets = kwargs.get('customer_secrets', None) + + +class Schedule(Model): + """Schedule for the job run. + + :param name: Name of the schedule. + :type name: str + :param policy_list: A list of repetition intervals in ISO 8601 format. + :type policy_list: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'policy_list': {'key': 'policyList', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(Schedule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.policy_list = kwargs.get('policy_list', None) + + +class Sku(Model): + """The sku type. + + :param name: The sku name. Required for data manager creation, optional + for update. + :type name: str + :param tier: The sku tier. This is based on the SKU name. + :type tier: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Sku, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.tier = kwargs.get('tier', None) diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_models_py3.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_models_py3.py new file mode 100644 index 000000000000..d01ad49fe4b9 --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_models_py3.py @@ -0,0 +1,1003 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class AvailableProviderOperation(Model): + """Class represents provider operation. + + All required parameters must be populated in order to send to Azure. + + :param name: Required. Gets or Sets Name of the operations + :type name: str + :param display: Gets or sets Display information + Contains the localized display information for this particular + operation/action + :type display: + ~azure.mgmt.hybriddatamanager.models.AvailableProviderOperationDisplay + :param origin: Gets or sets Origin + The intended executor of the operation; governs the display of the + operation in the RBAC UX and the audit logs UX. + Default value is “user,system” + :type origin: str + :param properties: Gets or sets Properties + Reserved for future use + :type properties: object + """ + + _validation = { + 'name': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'display': {'key': 'display', 'type': 'AvailableProviderOperationDisplay'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, name: str, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(AvailableProviderOperation, self).__init__(**kwargs) + self.name = name + self.display = display + self.origin = origin + self.properties = properties + + +class AvailableProviderOperationDisplay(Model): + """Contains the localized display information for this particular operation / + action. + These value will be used by several clients for + (1) custom role definitions for RBAC; + (2) complex query filters for the event service; and (3) audit history / + records for management operations. + + :param provider: Gets or sets Provider + The localized friendly form of the resource provider name – it is expected + to also include the publisher/company responsible. + It should use Title Casing and begin with “Microsoft” for 1st party + services. + :type provider: str + :param resource: Gets or sets Resource + The localized friendly form of the resource type related to this + action/operation – it should match the public documentation for the + resource provider. + It should use Title Casing – for examples, please refer to the “name” + section. + :type resource: str + :param operation: Gets or sets Operation + The localized friendly name for the operation, as it should be shown to + the user. + It should be concise (to fit in drop downs) but clear (i.e. + self-documenting). It should use Title Casing and include the + entity/resource to which it applies. + :type operation: str + :param description: Gets or sets Description + The localized friendly description for the operation, as it should be + shown to the user. + It should be thorough, yet concise – it will be used in tool tips and + detailed views. + :type description: str + """ + + _attribute_map = { + 'provider': {'key': 'provider', 'type': 'str'}, + 'resource': {'key': 'resource', 'type': 'str'}, + 'operation': {'key': 'operation', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__(self, *, provider: str=None, resource: str=None, operation: str=None, description: str=None, **kwargs) -> None: + super(AvailableProviderOperationDisplay, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class CloudError(Model): + """CloudError. + """ + + _attribute_map = { + } + + +class CustomerSecret(Model): + """The pair of customer secret. + + All required parameters must be populated in order to send to Azure. + + :param key_identifier: Required. The identifier to the data service input + object which this secret corresponds to. + :type key_identifier: str + :param key_value: Required. It contains the encrypted customer secret. + :type key_value: str + :param algorithm: Required. The encryption algorithm used to encrypt data. + Possible values include: 'None', 'RSA1_5', 'RSA_OAEP', 'PlainText' + :type algorithm: str or + ~azure.mgmt.hybriddatamanager.models.SupportedAlgorithm + """ + + _validation = { + 'key_identifier': {'required': True}, + 'key_value': {'required': True}, + 'algorithm': {'required': True}, + } + + _attribute_map = { + 'key_identifier': {'key': 'keyIdentifier', 'type': 'str'}, + 'key_value': {'key': 'keyValue', 'type': 'str'}, + 'algorithm': {'key': 'algorithm', 'type': 'SupportedAlgorithm'}, + } + + def __init__(self, *, key_identifier: str, key_value: str, algorithm, **kwargs) -> None: + super(CustomerSecret, self).__init__(**kwargs) + self.key_identifier = key_identifier + self.key_value = key_value + self.algorithm = algorithm + + +class Resource(Model): + """Model of the Resource. + + 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 Resource Id. + :vartype id: str + :ivar name: The Resource Name. + :vartype name: str + :ivar type: The Resource type. + :vartype type: str + :param location: Required. The location of the resource. This will be one + of the supported and registered Azure Geo Regions (e.g. West US, East + US, Southeast Asia, etc.). The geo region of a resource cannot be changed + once it is created, but if an identical geo + region is specified on update the request will succeed. + :type location: str + :param tags: The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource + (across resource groups). + :type tags: dict[str, str] + :param sku: The sku type. + :type sku: ~azure.mgmt.hybriddatamanager.models.Sku + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + } + + def __init__(self, *, location: str, tags=None, sku=None, **kwargs) -> None: + super(Resource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.location = location + self.tags = tags + self.sku = sku + + +class DataManager(Resource): + """The DataManager resource. + + 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 Resource Id. + :vartype id: str + :ivar name: The Resource Name. + :vartype name: str + :ivar type: The Resource type. + :vartype type: str + :param location: Required. The location of the resource. This will be one + of the supported and registered Azure Geo Regions (e.g. West US, East + US, Southeast Asia, etc.). The geo region of a resource cannot be changed + once it is created, but if an identical geo + region is specified on update the request will succeed. + :type location: str + :param tags: The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource + (across resource groups). + :type tags: dict[str, str] + :param sku: The sku type. + :type sku: ~azure.mgmt.hybriddatamanager.models.Sku + :param etag: Etag of the Resource. + :type etag: str + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'location': {'required': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, location: str, tags=None, sku=None, etag: str=None, **kwargs) -> None: + super(DataManager, self).__init__(location=location, tags=tags, sku=sku, **kwargs) + self.etag = etag + + +class DataManagerUpdateParameter(Model): + """The DataManagerUpdateParameter. + + :param sku: The sku type. + :type sku: ~azure.mgmt.hybriddatamanager.models.Sku + :param tags: The list of key value pairs that describe the resource. These + tags can be used in viewing and grouping this resource + (across resource groups). + :type tags: dict[str, str] + """ + + _attribute_map = { + 'sku': {'key': 'sku', 'type': 'Sku'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + } + + def __init__(self, *, sku=None, tags=None, **kwargs) -> None: + super(DataManagerUpdateParameter, self).__init__(**kwargs) + self.sku = sku + self.tags = tags + + +class DmsBaseObject(Model): + """Base class for all objects under DataManager Service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs) -> None: + super(DmsBaseObject, self).__init__(**kwargs) + self.name = None + self.id = None + self.type = None + + +class DataService(DmsBaseObject): + """Data Service. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param state: Required. State of the data service. Possible values + include: 'Disabled', 'Enabled', 'Supported' + :type state: str or ~azure.mgmt.hybriddatamanager.models.State + :param supported_data_sink_types: Supported data store types which can be + used as a sink. + :type supported_data_sink_types: list[str] + :param supported_data_source_types: Supported data store types which can + be used as a source. + :type supported_data_source_types: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'State'}, + 'supported_data_sink_types': {'key': 'properties.supportedDataSinkTypes', 'type': '[str]'}, + 'supported_data_source_types': {'key': 'properties.supportedDataSourceTypes', 'type': '[str]'}, + } + + def __init__(self, *, state, supported_data_sink_types=None, supported_data_source_types=None, **kwargs) -> None: + super(DataService, self).__init__(**kwargs) + self.state = state + self.supported_data_sink_types = supported_data_sink_types + self.supported_data_source_types = supported_data_source_types + + +class DataStore(DmsBaseObject): + """Data store. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param repository_id: Arm Id for the manager resource to which the data + source is associated. This is optional. + :type repository_id: str + :param state: Required. State of the data source. Possible values include: + 'Disabled', 'Enabled', 'Supported' + :type state: str or ~azure.mgmt.hybriddatamanager.models.State + :param extended_properties: A generic json used differently by each data + source type. + :type extended_properties: object + :param data_store_type_id: Required. The arm id of the data store type. + :type data_store_type_id: str + :param customer_secrets: List of customer secrets containing a key + identifier and key value. The key identifier is a way for the specific + data source to understand the key. Value contains customer secret + encrypted by the encryptionKeys. + :type customer_secrets: + list[~azure.mgmt.hybriddatamanager.models.CustomerSecret] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'required': True}, + 'data_store_type_id': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_id': {'key': 'properties.repositoryId', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'State'}, + 'extended_properties': {'key': 'properties.extendedProperties', 'type': 'object'}, + 'data_store_type_id': {'key': 'properties.dataStoreTypeId', 'type': 'str'}, + 'customer_secrets': {'key': 'properties.customerSecrets', 'type': '[CustomerSecret]'}, + } + + def __init__(self, *, state, data_store_type_id: str, repository_id: str=None, extended_properties=None, customer_secrets=None, **kwargs) -> None: + super(DataStore, self).__init__(**kwargs) + self.repository_id = repository_id + self.state = state + self.extended_properties = extended_properties + self.data_store_type_id = data_store_type_id + self.customer_secrets = customer_secrets + + +class DataStoreFilter(Model): + """Contains the information about the filters for the DataStore. + + :param data_store_type_id: The data store type id. + :type data_store_type_id: str + """ + + _attribute_map = { + 'data_store_type_id': {'key': 'dataStoreTypeId', 'type': 'str'}, + } + + def __init__(self, *, data_store_type_id: str=None, **kwargs) -> None: + super(DataStoreFilter, self).__init__(**kwargs) + self.data_store_type_id = data_store_type_id + + +class DataStoreType(DmsBaseObject): + """Data Store Type. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param repository_type: Arm type for the manager resource to which the + data source type is associated. This is optional. + :type repository_type: str + :param state: Required. State of the data store type. Possible values + include: 'Disabled', 'Enabled', 'Supported' + :type state: str or ~azure.mgmt.hybriddatamanager.models.State + :param supported_data_services_as_sink: Supported data services where it + can be used as a sink. + :type supported_data_services_as_sink: list[str] + :param supported_data_services_as_source: Supported data services where it + can be used as a source. + :type supported_data_services_as_source: list[str] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'repository_type': {'key': 'properties.repositoryType', 'type': 'str'}, + 'state': {'key': 'properties.state', 'type': 'State'}, + 'supported_data_services_as_sink': {'key': 'properties.supportedDataServicesAsSink', 'type': '[str]'}, + 'supported_data_services_as_source': {'key': 'properties.supportedDataServicesAsSource', 'type': '[str]'}, + } + + def __init__(self, *, state, repository_type: str=None, supported_data_services_as_sink=None, supported_data_services_as_source=None, **kwargs) -> None: + super(DataStoreType, self).__init__(**kwargs) + self.repository_type = repository_type + self.state = state + self.supported_data_services_as_sink = supported_data_services_as_sink + self.supported_data_services_as_source = supported_data_services_as_source + + +class Error(Model): + """Top level error for the job. + + All required parameters must be populated in order to send to Azure. + + :param code: Required. Error code that can be used to programmatically + identify the error. + :type code: str + :param message: Describes the error in detail and provides debugging + information. + :type message: str + """ + + _validation = { + 'code': {'required': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__(self, *, code: str, message: str=None, **kwargs) -> None: + super(Error, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ErrorDetails(Model): + """Error Details. + + :param error_message: Error message. + :type error_message: str + :param error_code: Error code. + :type error_code: int + :param recommended_action: Recommended action for the error. + :type recommended_action: str + :param exception_message: Contains the non localized exception message + :type exception_message: str + """ + + _attribute_map = { + 'error_message': {'key': 'errorMessage', 'type': 'str'}, + 'error_code': {'key': 'errorCode', 'type': 'int'}, + 'recommended_action': {'key': 'recommendedAction', 'type': 'str'}, + 'exception_message': {'key': 'exceptionMessage', 'type': 'str'}, + } + + def __init__(self, *, error_message: str=None, error_code: int=None, recommended_action: str=None, exception_message: str=None, **kwargs) -> None: + super(ErrorDetails, self).__init__(**kwargs) + self.error_message = error_message + self.error_code = error_code + self.recommended_action = recommended_action + self.exception_message = exception_message + + +class Job(DmsBaseObject): + """Data service job. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param status: Required. Status of the job. Possible values include: + 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', + 'Cancelled', 'Cancelling', 'PartiallySucceeded' + :type status: str or ~azure.mgmt.hybriddatamanager.models.JobStatus + :param start_time: Required. Time at which the job was started in UTC ISO + 8601 format. + :type start_time: datetime + :param end_time: Time at which the job ended in UTC ISO 8601 format. + :type end_time: datetime + :param is_cancellable: Required. Describes whether the job is cancellable. + Possible values include: 'NotCancellable', 'Cancellable' + :type is_cancellable: str or + ~azure.mgmt.hybriddatamanager.models.IsJobCancellable + :param bytes_processed: Number of bytes processed by the job as of now. + :type bytes_processed: long + :param items_processed: Number of items processed by the job as of now + :type items_processed: long + :param total_bytes_to_process: Number of bytes to be processed by the job + in total. + :type total_bytes_to_process: long + :param total_items_to_process: Number of items to be processed by the job + in total + :type total_items_to_process: long + :param details: Details of a job run. This field will only be sent for + expand details filter. + :type details: ~azure.mgmt.hybriddatamanager.models.JobDetails + :param data_source_name: Name of the data source on which the job was + triggered. + :type data_source_name: str + :param data_sink_name: Name of the data sink on which the job was + triggered. + :type data_sink_name: str + :param error: Top level error for the job. + :type error: ~azure.mgmt.hybriddatamanager.models.Error + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'status': {'required': True}, + 'start_time': {'required': True}, + 'is_cancellable': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'JobStatus'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, + 'is_cancellable': {'key': 'properties.isCancellable', 'type': 'IsJobCancellable'}, + 'bytes_processed': {'key': 'properties.bytesProcessed', 'type': 'long'}, + 'items_processed': {'key': 'properties.itemsProcessed', 'type': 'long'}, + 'total_bytes_to_process': {'key': 'properties.totalBytesToProcess', 'type': 'long'}, + 'total_items_to_process': {'key': 'properties.totalItemsToProcess', 'type': 'long'}, + 'details': {'key': 'properties.details', 'type': 'JobDetails'}, + 'data_source_name': {'key': 'properties.dataSourceName', 'type': 'str'}, + 'data_sink_name': {'key': 'properties.dataSinkName', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'Error'}, + } + + def __init__(self, *, status, start_time, is_cancellable, end_time=None, bytes_processed: int=None, items_processed: int=None, total_bytes_to_process: int=None, total_items_to_process: int=None, details=None, data_source_name: str=None, data_sink_name: str=None, error=None, **kwargs) -> None: + super(Job, self).__init__(**kwargs) + self.status = status + self.start_time = start_time + self.end_time = end_time + self.is_cancellable = is_cancellable + self.bytes_processed = bytes_processed + self.items_processed = items_processed + self.total_bytes_to_process = total_bytes_to_process + self.total_items_to_process = total_items_to_process + self.details = details + self.data_source_name = data_source_name + self.data_sink_name = data_sink_name + self.error = error + + +class JobDefinition(DmsBaseObject): + """Job Definition. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param data_source_id: Required. Data Source Id associated to the job + definition. + :type data_source_id: str + :param data_sink_id: Required. Data Sink Id associated to the job + definition. + :type data_sink_id: str + :param schedules: Schedule for running the job definition + :type schedules: list[~azure.mgmt.hybriddatamanager.models.Schedule] + :param state: Required. State of the job definition. Possible values + include: 'Disabled', 'Enabled', 'Supported' + :type state: str or ~azure.mgmt.hybriddatamanager.models.State + :param last_modified_time: Last modified time of the job definition. + :type last_modified_time: datetime + :param run_location: This is the preferred geo location for the job to + run. Possible values include: 'none', 'australiaeast', + 'australiasoutheast', 'brazilsouth', 'canadacentral', 'canadaeast', + 'centralindia', 'centralus', 'eastasia', 'eastus', 'eastus2', 'japaneast', + 'japanwest', 'koreacentral', 'koreasouth', 'southeastasia', + 'southcentralus', 'southindia', 'northcentralus', 'northeurope', + 'uksouth', 'ukwest', 'westcentralus', 'westeurope', 'westindia', 'westus', + 'westus2' + :type run_location: str or + ~azure.mgmt.hybriddatamanager.models.RunLocation + :param user_confirmation: Enum to detect if user confirmation is required. + If not passed will default to NotRequired. Possible values include: + 'NotRequired', 'Required'. Default value: "NotRequired" . + :type user_confirmation: str or + ~azure.mgmt.hybriddatamanager.models.UserConfirmation + :param data_service_input: A generic json used differently by each data + service type. + :type data_service_input: object + :param customer_secrets: List of customer secrets containing a key + identifier and key value. The key identifier is a way for the specific + data source to understand the key. Value contains customer secret + encrypted by the encryptionKeys. + :type customer_secrets: + list[~azure.mgmt.hybriddatamanager.models.CustomerSecret] + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'data_source_id': {'required': True}, + 'data_sink_id': {'required': True}, + 'state': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_source_id': {'key': 'properties.dataSourceId', 'type': 'str'}, + 'data_sink_id': {'key': 'properties.dataSinkId', 'type': 'str'}, + 'schedules': {'key': 'properties.schedules', 'type': '[Schedule]'}, + 'state': {'key': 'properties.state', 'type': 'State'}, + 'last_modified_time': {'key': 'properties.lastModifiedTime', 'type': 'iso-8601'}, + 'run_location': {'key': 'properties.runLocation', 'type': 'RunLocation'}, + 'user_confirmation': {'key': 'properties.userConfirmation', 'type': 'UserConfirmation'}, + 'data_service_input': {'key': 'properties.dataServiceInput', 'type': 'object'}, + 'customer_secrets': {'key': 'properties.customerSecrets', 'type': '[CustomerSecret]'}, + } + + def __init__(self, *, data_source_id: str, data_sink_id: str, state, schedules=None, last_modified_time=None, run_location=None, user_confirmation="NotRequired", data_service_input=None, customer_secrets=None, **kwargs) -> None: + super(JobDefinition, self).__init__(**kwargs) + self.data_source_id = data_source_id + self.data_sink_id = data_sink_id + self.schedules = schedules + self.state = state + self.last_modified_time = last_modified_time + self.run_location = run_location + self.user_confirmation = user_confirmation + self.data_service_input = data_service_input + self.customer_secrets = customer_secrets + + +class JobDefinitionFilter(Model): + """Contains the supported job definition filters. + + All required parameters must be populated in order to send to Azure. + + :param state: Required. The state of the job definition. Possible values + include: 'Disabled', 'Enabled', 'Supported' + :type state: str or ~azure.mgmt.hybriddatamanager.models.State + :param data_source: The data source associated with the job definition + :type data_source: str + :param last_modified: The last modified date time of the data source. + :type last_modified: datetime + """ + + _validation = { + 'state': {'required': True}, + } + + _attribute_map = { + 'state': {'key': 'state', 'type': 'State'}, + 'data_source': {'key': 'dataSource', 'type': 'str'}, + 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, + } + + def __init__(self, *, state, data_source: str=None, last_modified=None, **kwargs) -> None: + super(JobDefinitionFilter, self).__init__(**kwargs) + self.state = state + self.data_source = data_source + self.last_modified = last_modified + + +class JobDetails(Model): + """Job details. + + :param job_stages: List of stages that ran in the job + :type job_stages: list[~azure.mgmt.hybriddatamanager.models.JobStages] + :param job_definition: JobDefinition at the time of the run + :type job_definition: ~azure.mgmt.hybriddatamanager.models.JobDefinition + :param error_details: Error details for failure. This is optional. + :type error_details: + list[~azure.mgmt.hybriddatamanager.models.ErrorDetails] + :param item_details_link: Item Details Link to download files or see + details + :type item_details_link: str + """ + + _attribute_map = { + 'job_stages': {'key': 'jobStages', 'type': '[JobStages]'}, + 'job_definition': {'key': 'jobDefinition', 'type': 'JobDefinition'}, + 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetails]'}, + 'item_details_link': {'key': 'itemDetailsLink', 'type': 'str'}, + } + + def __init__(self, *, job_stages=None, job_definition=None, error_details=None, item_details_link: str=None, **kwargs) -> None: + super(JobDetails, self).__init__(**kwargs) + self.job_stages = job_stages + self.job_definition = job_definition + self.error_details = error_details + self.item_details_link = item_details_link + + +class JobFilter(Model): + """Contains the information about the filters for the job. + + All required parameters must be populated in order to send to Azure. + + :param status: Required. The status of the job. Possible values include: + 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', + 'Cancelled', 'Cancelling', 'PartiallySucceeded' + :type status: str or ~azure.mgmt.hybriddatamanager.models.JobStatus + :param start_time: The start time of the job. + :type start_time: datetime + """ + + _validation = { + 'status': {'required': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'JobStatus'}, + 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, + } + + def __init__(self, *, status, start_time=None, **kwargs) -> None: + super(JobFilter, self).__init__(**kwargs) + self.status = status + self.start_time = start_time + + +class JobStages(Model): + """Job stages. + + All required parameters must be populated in order to send to Azure. + + :param stage_name: Name of the job stage. + :type stage_name: str + :param stage_status: Required. Status of the job stage. Possible values + include: 'None', 'InProgress', 'Succeeded', 'WaitingForAction', 'Failed', + 'Cancelled', 'Cancelling', 'PartiallySucceeded' + :type stage_status: str or ~azure.mgmt.hybriddatamanager.models.JobStatus + :param job_stage_details: Job Stage Details + :type job_stage_details: object + :param error_details: Error details for the stage. This is optional + :type error_details: + list[~azure.mgmt.hybriddatamanager.models.ErrorDetails] + """ + + _validation = { + 'stage_status': {'required': True}, + } + + _attribute_map = { + 'stage_name': {'key': 'stageName', 'type': 'str'}, + 'stage_status': {'key': 'stageStatus', 'type': 'JobStatus'}, + 'job_stage_details': {'key': 'jobStageDetails', 'type': 'object'}, + 'error_details': {'key': 'errorDetails', 'type': '[ErrorDetails]'}, + } + + def __init__(self, *, stage_status, stage_name: str=None, job_stage_details=None, error_details=None, **kwargs) -> None: + super(JobStages, self).__init__(**kwargs) + self.stage_name = stage_name + self.stage_status = stage_status + self.job_stage_details = job_stage_details + self.error_details = error_details + + +class Key(Model): + """Encryption Key. + + All required parameters must be populated in order to send to Azure. + + :param key_modulus: Required. Modulus of the encryption key. + :type key_modulus: str + :param key_exponent: Required. Exponent of the encryption key. + :type key_exponent: str + :param encryption_chunk_size_in_bytes: Required. The maximum byte size + that can be encrypted by the key. For a key size larger than the size, + break into chunks and encrypt each chunk, append each encrypted chunk with + : to mark the end of the chunk. + :type encryption_chunk_size_in_bytes: int + """ + + _validation = { + 'key_modulus': {'required': True}, + 'key_exponent': {'required': True}, + 'encryption_chunk_size_in_bytes': {'required': True}, + } + + _attribute_map = { + 'key_modulus': {'key': 'keyModulus', 'type': 'str'}, + 'key_exponent': {'key': 'keyExponent', 'type': 'str'}, + 'encryption_chunk_size_in_bytes': {'key': 'encryptionChunkSizeInBytes', 'type': 'int'}, + } + + def __init__(self, *, key_modulus: str, key_exponent: str, encryption_chunk_size_in_bytes: int, **kwargs) -> None: + super(Key, self).__init__(**kwargs) + self.key_modulus = key_modulus + self.key_exponent = key_exponent + self.encryption_chunk_size_in_bytes = encryption_chunk_size_in_bytes + + +class PublicKey(DmsBaseObject): + """Public key. + + 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 name: Name of the object. + :vartype name: str + :ivar id: Id of the object. + :vartype id: str + :ivar type: Type of the object. + :vartype type: str + :param data_service_level1_key: Required. Level one public key for + encryption + :type data_service_level1_key: ~azure.mgmt.hybriddatamanager.models.Key + :param data_service_level2_key: Required. Level two public key for + encryption + :type data_service_level2_key: ~azure.mgmt.hybriddatamanager.models.Key + """ + + _validation = { + 'name': {'readonly': True}, + 'id': {'readonly': True}, + 'type': {'readonly': True}, + 'data_service_level1_key': {'required': True}, + 'data_service_level2_key': {'required': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'data_service_level1_key': {'key': 'properties.dataServiceLevel1Key', 'type': 'Key'}, + 'data_service_level2_key': {'key': 'properties.dataServiceLevel2Key', 'type': 'Key'}, + } + + def __init__(self, *, data_service_level1_key, data_service_level2_key, **kwargs) -> None: + super(PublicKey, self).__init__(**kwargs) + self.data_service_level1_key = data_service_level1_key + self.data_service_level2_key = data_service_level2_key + + +class RunParameters(Model): + """Run parameters for a job. + + :param user_confirmation: Enum to detect if user confirmation is required. + If not passed will default to NotRequired. Possible values include: + 'NotRequired', 'Required'. Default value: "NotRequired" . + :type user_confirmation: str or + ~azure.mgmt.hybriddatamanager.models.UserConfirmation + :param data_service_input: A generic json used differently by each data + service type. + :type data_service_input: object + :param customer_secrets: List of customer secrets containing a key + identifier and key value. The key identifier is a way for the specific + data source to understand the key. Value contains customer secret + encrypted by the encryptionKeys. + :type customer_secrets: + list[~azure.mgmt.hybriddatamanager.models.CustomerSecret] + """ + + _attribute_map = { + 'user_confirmation': {'key': 'userConfirmation', 'type': 'UserConfirmation'}, + 'data_service_input': {'key': 'dataServiceInput', 'type': 'object'}, + 'customer_secrets': {'key': 'customerSecrets', 'type': '[CustomerSecret]'}, + } + + def __init__(self, *, user_confirmation="NotRequired", data_service_input=None, customer_secrets=None, **kwargs) -> None: + super(RunParameters, self).__init__(**kwargs) + self.user_confirmation = user_confirmation + self.data_service_input = data_service_input + self.customer_secrets = customer_secrets + + +class Schedule(Model): + """Schedule for the job run. + + :param name: Name of the schedule. + :type name: str + :param policy_list: A list of repetition intervals in ISO 8601 format. + :type policy_list: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'policy_list': {'key': 'policyList', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, policy_list=None, **kwargs) -> None: + super(Schedule, self).__init__(**kwargs) + self.name = name + self.policy_list = policy_list + + +class Sku(Model): + """The sku type. + + :param name: The sku name. Required for data manager creation, optional + for update. + :type name: str + :param tier: The sku tier. This is based on the SKU name. + :type tier: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'tier': {'key': 'tier', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, tier: str=None, **kwargs) -> None: + super(Sku, self).__init__(**kwargs) + self.name = name + self.tier = tier diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_paged_models.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_paged_models.py new file mode 100644 index 000000000000..7328d0aa7742 --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/models/_paged_models.py @@ -0,0 +1,118 @@ +# 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. +# -------------------------------------------------------------------------- + +from msrest.paging import Paged + + +class AvailableProviderOperationPaged(Paged): + """ + A paging container for iterating over a list of :class:`AvailableProviderOperation ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AvailableProviderOperation]'} + } + + def __init__(self, *args, **kwargs): + + super(AvailableProviderOperationPaged, self).__init__(*args, **kwargs) +class DataManagerPaged(Paged): + """ + A paging container for iterating over a list of :class:`DataManager ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DataManager]'} + } + + def __init__(self, *args, **kwargs): + + super(DataManagerPaged, self).__init__(*args, **kwargs) +class DataServicePaged(Paged): + """ + A paging container for iterating over a list of :class:`DataService ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DataService]'} + } + + def __init__(self, *args, **kwargs): + + super(DataServicePaged, self).__init__(*args, **kwargs) +class JobDefinitionPaged(Paged): + """ + A paging container for iterating over a list of :class:`JobDefinition ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[JobDefinition]'} + } + + def __init__(self, *args, **kwargs): + + super(JobDefinitionPaged, self).__init__(*args, **kwargs) +class JobPaged(Paged): + """ + A paging container for iterating over a list of :class:`Job ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[Job]'} + } + + def __init__(self, *args, **kwargs): + + super(JobPaged, self).__init__(*args, **kwargs) +class DataStorePaged(Paged): + """ + A paging container for iterating over a list of :class:`DataStore ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DataStore]'} + } + + def __init__(self, *args, **kwargs): + + super(DataStorePaged, self).__init__(*args, **kwargs) +class DataStoreTypePaged(Paged): + """ + A paging container for iterating over a list of :class:`DataStoreType ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[DataStoreType]'} + } + + def __init__(self, *args, **kwargs): + + super(DataStoreTypePaged, self).__init__(*args, **kwargs) +class PublicKeyPaged(Paged): + """ + A paging container for iterating over a list of :class:`PublicKey ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[PublicKey]'} + } + + def __init__(self, *args, **kwargs): + + super(PublicKeyPaged, self).__init__(*args, **kwargs) diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/__init__.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/__init__.py new file mode 100644 index 000000000000..02dd03511c5e --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/__init__.py @@ -0,0 +1,30 @@ +# 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. +# -------------------------------------------------------------------------- + +from ._operations import Operations +from ._data_managers_operations import DataManagersOperations +from ._data_services_operations import DataServicesOperations +from ._job_definitions_operations import JobDefinitionsOperations +from ._jobs_operations import JobsOperations +from ._data_stores_operations import DataStoresOperations +from ._data_store_types_operations import DataStoreTypesOperations +from ._public_keys_operations import PublicKeysOperations + +__all__ = [ + 'Operations', + 'DataManagersOperations', + 'DataServicesOperations', + 'JobDefinitionsOperations', + 'JobsOperations', + 'DataStoresOperations', + 'DataStoreTypesOperations', + 'PublicKeysOperations', +] diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_managers_operations.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_managers_operations.py new file mode 100644 index 000000000000..5e3e6e35b81a --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_managers_operations.py @@ -0,0 +1,543 @@ +# 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 DataManagersOperations(object): + """DataManagersOperations 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-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """Lists all the data manager resources available under the subscription. + + :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 DataManager + :rtype: + ~azure.mgmt.hybriddatamanager.models.DataManagerPaged[~azure.mgmt.hybriddatamanager.models.DataManager] + :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') + + 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.DataManagerPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.HybridData/dataManagers'} + + def list_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all the data manager resources available under the given resource + group. + + :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 DataManager + :rtype: + ~azure.mgmt.hybriddatamanager.models.DataManagerPaged[~azure.mgmt.hybriddatamanager.models.DataManager] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_resource_group.metadata['url'] + path_format_arguments = { + '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.DataManagerPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers'} + + def get( + self, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + """Gets information about the specified data manager resource. + + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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: DataManager or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hybriddatamanager.models.DataManager or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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('DataManager', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}'} + + + def _create_initial( + self, resource_group_name, data_manager_name, data_manager, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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(data_manager, 'DataManager') + + # 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('DataManager', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, data_manager_name, data_manager, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates a new data manager resource with the specified parameters. + Existing resources cannot be updated with this API + and should instead be updated with the Update data manager resource + API. + + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_name: str + :param data_manager: Data manager resource details from request body. + :type data_manager: ~azure.mgmt.hybriddatamanager.models.DataManager + :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 DataManager or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hybriddatamanager.models.DataManager] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hybriddatamanager.models.DataManager]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + data_manager_name=data_manager_name, + data_manager=data_manager, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DataManager', 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.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}'} + + + def _delete_initial( + self, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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, resource_group_name, data_manager_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a data manager resource in Microsoft Azure. + + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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( + resource_group_name=resource_group_name, + data_manager_name=data_manager_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.HybridData/dataManagers/{dataManagerName}'} + + + def _update_initial( + self, resource_group_name, data_manager_name, if_match=None, sku=None, tags=None, custom_headers=None, raw=False, **operation_config): + data_manager_update_parameter = models.DataManagerUpdateParameter(sku=sku, tags=tags) + + # Construct URL + url = self.update.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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 if_match is not None: + header_parameters['If-Match'] = self._serialize.header("if_match", if_match, 'str') + 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(data_manager_update_parameter, 'DataManagerUpdateParameter') + + # Construct and send request + request = self._client.patch(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('DataManager', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def update( + self, resource_group_name, data_manager_name, if_match=None, sku=None, tags=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Updates the properties of an existing data manager resource. + + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_name: str + :param if_match: Defines the If-Match condition. The patch will be + performed only if the ETag of the data manager resource on the server + matches this value. + :type if_match: str + :param sku: The sku type. + :type sku: ~azure.mgmt.hybriddatamanager.models.Sku + :param tags: The list of key value pairs that describe the resource. + These tags can be used in viewing and grouping this resource + (across resource groups). + :type tags: dict[str, 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 DataManager or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hybriddatamanager.models.DataManager] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hybriddatamanager.models.DataManager]] + :raises: :class:`CloudError` + """ + raw_result = self._update_initial( + resource_group_name=resource_group_name, + data_manager_name=data_manager_name, + if_match=if_match, + sku=sku, + tags=tags, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DataManager', 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) + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}'} diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_services_operations.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_services_operations.py new file mode 100644 index 000000000000..162b5a19cb84 --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_services_operations.py @@ -0,0 +1,181 @@ +# 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 DataServicesOperations(object): + """DataServicesOperations 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-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list_by_data_manager( + self, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + """This method gets all the data services. + + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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 DataService + :rtype: + ~azure.mgmt.hybriddatamanager.models.DataServicePaged[~azure.mgmt.hybriddatamanager.models.DataService] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_data_manager.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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.DataServicePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_data_manager.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices'} + + def get( + self, data_service_name, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + """Gets the data service that matches the data service name given. + + :param data_service_name: The name of the data service that is being + queried. + :type data_service_name: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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: DataService or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hybriddatamanager.models.DataService or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'dataServiceName': self._serialize.url("data_service_name", data_service_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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('DataService', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}'} diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_store_types_operations.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_store_types_operations.py new file mode 100644 index 000000000000..f9cf372881ca --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_store_types_operations.py @@ -0,0 +1,181 @@ +# 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 DataStoreTypesOperations(object): + """DataStoreTypesOperations 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-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list_by_data_manager( + self, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + """Gets all the data store/repository types that the resource supports. + + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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 DataStoreType + :rtype: + ~azure.mgmt.hybriddatamanager.models.DataStoreTypePaged[~azure.mgmt.hybriddatamanager.models.DataStoreType] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_data_manager.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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.DataStoreTypePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_data_manager.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes'} + + def get( + self, data_store_type_name, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + """Gets the data store/repository type given its name. + + :param data_store_type_name: The data store/repository type name for + which details are needed. + :type data_store_type_name: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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: DataStoreType or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hybriddatamanager.models.DataStoreType or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'dataStoreTypeName': self._serialize.url("data_store_type_name", data_store_type_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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('DataStoreType', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStoreTypes/{dataStoreTypeName}'} diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_stores_operations.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_stores_operations.py new file mode 100644 index 000000000000..221831fe997c --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_data_stores_operations.py @@ -0,0 +1,379 @@ +# 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 DataStoresOperations(object): + """DataStoresOperations 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-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list_by_data_manager( + self, resource_group_name, data_manager_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets all the data stores/repositories in the given resource. + + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_name: str + :param filter: OData Filter options + :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 DataStore + :rtype: + ~azure.mgmt.hybriddatamanager.models.DataStorePaged[~azure.mgmt.hybriddatamanager.models.DataStore] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_data_manager.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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.DataStorePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_data_manager.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores'} + + def get( + self, data_store_name, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + """This method gets the data store/repository by name. + + :param data_store_name: The data store/repository name queried. + :type data_store_name: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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: DataStore or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hybriddatamanager.models.DataStore or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'dataStoreName': self._serialize.url("data_store_name", data_store_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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('DataStore', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName}'} + + + def _create_or_update_initial( + self, data_store_name, data_store, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'dataStoreName': self._serialize.url("data_store_name", data_store_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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(data_store, 'DataStore') + + # 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('DataStore', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, data_store_name, data_store, resource_group_name, data_manager_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates the data store/repository in the data manager. + + :param data_store_name: The data store/repository name to be created + or updated. + :type data_store_name: str + :param data_store: The data store/repository object to be created or + updated. + :type data_store: ~azure.mgmt.hybriddatamanager.models.DataStore + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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 DataStore or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hybriddatamanager.models.DataStore] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hybriddatamanager.models.DataStore]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + data_store_name=data_store_name, + data_store=data_store, + resource_group_name=resource_group_name, + data_manager_name=data_manager_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('DataStore', 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.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName}'} + + + def _delete_initial( + self, data_store_name, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'dataStoreName': self._serialize.url("data_store_name", data_store_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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, data_store_name, resource_group_name, data_manager_name, custom_headers=None, raw=False, polling=True, **operation_config): + """This method deletes the given data store/repository. + + :param data_store_name: The data store/repository name to be deleted. + :type data_store_name: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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( + data_store_name=data_store_name, + resource_group_name=resource_group_name, + data_manager_name=data_manager_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.HybridData/dataManagers/{dataManagerName}/dataStores/{dataStoreName}'} diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_job_definitions_operations.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_job_definitions_operations.py new file mode 100644 index 000000000000..30730e4f0bfa --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_job_definitions_operations.py @@ -0,0 +1,571 @@ +# 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 JobDefinitionsOperations(object): + """JobDefinitionsOperations 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-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list_by_data_service( + self, data_service_name, resource_group_name, data_manager_name, filter=None, custom_headers=None, raw=False, **operation_config): + """This method gets all the job definitions of the given data service + name. + + :param data_service_name: The data service type of interest. + :type data_service_name: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_name: str + :param filter: OData Filter options + :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 JobDefinition + :rtype: + ~azure.mgmt.hybriddatamanager.models.JobDefinitionPaged[~azure.mgmt.hybriddatamanager.models.JobDefinition] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_data_service.metadata['url'] + path_format_arguments = { + 'dataServiceName': self._serialize.url("data_service_name", data_service_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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.JobDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_data_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions'} + + def get( + self, data_service_name, job_definition_name, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + """This method gets job definition object by name. + + :param data_service_name: The data service name of the job definition + :type data_service_name: str + :param job_definition_name: The job definition name that is being + queried. + :type job_definition_name: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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: JobDefinition or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hybriddatamanager.models.JobDefinition or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'dataServiceName': self._serialize.url("data_service_name", data_service_name, 'str'), + 'jobDefinitionName': self._serialize.url("job_definition_name", job_definition_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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('JobDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}'} + + + def _create_or_update_initial( + self, data_service_name, job_definition_name, job_definition, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'dataServiceName': self._serialize.url("data_service_name", data_service_name, 'str'), + 'jobDefinitionName': self._serialize.url("job_definition_name", job_definition_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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(job_definition, 'JobDefinition') + + # 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('JobDefinition', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, data_service_name, job_definition_name, job_definition, resource_group_name, data_manager_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a job definition. + + :param data_service_name: The data service type of the job definition. + :type data_service_name: str + :param job_definition_name: The job definition name to be created or + updated. + :type job_definition_name: str + :param job_definition: Job Definition object to be created or updated. + :type job_definition: + ~azure.mgmt.hybriddatamanager.models.JobDefinition + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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 JobDefinition or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.hybriddatamanager.models.JobDefinition] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.hybriddatamanager.models.JobDefinition]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + data_service_name=data_service_name, + job_definition_name=job_definition_name, + job_definition=job_definition, + resource_group_name=resource_group_name, + data_manager_name=data_manager_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('JobDefinition', 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.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}'} + + + def _delete_initial( + self, data_service_name, job_definition_name, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'dataServiceName': self._serialize.url("data_service_name", data_service_name, 'str'), + 'jobDefinitionName': self._serialize.url("job_definition_name", job_definition_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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, data_service_name, job_definition_name, resource_group_name, data_manager_name, custom_headers=None, raw=False, polling=True, **operation_config): + """This method deletes the given job definition. + + :param data_service_name: The data service type of the job definition. + :type data_service_name: str + :param job_definition_name: The job definition name to be deleted. + :type job_definition_name: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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( + data_service_name=data_service_name, + job_definition_name=job_definition_name, + resource_group_name=resource_group_name, + data_manager_name=data_manager_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.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}'} + + + def _run_initial( + self, data_service_name, job_definition_name, run_parameters, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.run.metadata['url'] + path_format_arguments = { + 'dataServiceName': self._serialize.url("data_service_name", data_service_name, 'str'), + 'jobDefinitionName': self._serialize.url("job_definition_name", job_definition_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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['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(run_parameters, 'RunParameters') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters, body_content) + 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 run( + self, data_service_name, job_definition_name, run_parameters, resource_group_name, data_manager_name, custom_headers=None, raw=False, polling=True, **operation_config): + """This method runs a job instance of the given job definition. + + :param data_service_name: The data service type of the job definition. + :type data_service_name: str + :param job_definition_name: Name of the job definition. + :type job_definition_name: str + :param run_parameters: Run time parameters for the job definition. + :type run_parameters: + ~azure.mgmt.hybriddatamanager.models.RunParameters + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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._run_initial( + data_service_name=data_service_name, + job_definition_name=job_definition_name, + run_parameters=run_parameters, + resource_group_name=resource_group_name, + data_manager_name=data_manager_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) + run.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/run'} + + def list_by_data_manager( + self, resource_group_name, data_manager_name, filter=None, custom_headers=None, raw=False, **operation_config): + """This method gets all the job definitions of the given data manager + resource. + + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_name: str + :param filter: OData Filter options + :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 JobDefinition + :rtype: + ~azure.mgmt.hybriddatamanager.models.JobDefinitionPaged[~azure.mgmt.hybriddatamanager.models.JobDefinition] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_data_manager.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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.JobDefinitionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_data_manager.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/jobDefinitions'} diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_jobs_operations.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_jobs_operations.py new file mode 100644 index 000000000000..7712cced2e71 --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_jobs_operations.py @@ -0,0 +1,554 @@ +# 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 JobsOperations(object): + """JobsOperations 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-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list_by_job_definition( + self, data_service_name, job_definition_name, resource_group_name, data_manager_name, filter=None, custom_headers=None, raw=False, **operation_config): + """This method gets all the jobs of a given job definition. + + :param data_service_name: The name of the data service of the job + definition. + :type data_service_name: str + :param job_definition_name: The name of the job definition for which + jobs are needed. + :type job_definition_name: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_name: str + :param filter: OData Filter options + :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 Job + :rtype: + ~azure.mgmt.hybriddatamanager.models.JobPaged[~azure.mgmt.hybriddatamanager.models.Job] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_job_definition.metadata['url'] + path_format_arguments = { + 'dataServiceName': self._serialize.url("data_service_name", data_service_name, 'str'), + 'jobDefinitionName': self._serialize.url("job_definition_name", job_definition_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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.JobPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_job_definition.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs'} + + def get( + self, data_service_name, job_definition_name, job_id, resource_group_name, data_manager_name, expand=None, custom_headers=None, raw=False, **operation_config): + """This method gets a data manager job given the jobId. + + :param data_service_name: The name of the data service of the job + definition. + :type data_service_name: str + :param job_definition_name: The name of the job definition of the job. + :type job_definition_name: str + :param job_id: The job id of the job queried. + :type job_id: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_name: str + :param expand: $expand is supported on details parameter for job, + which provides details on the job stages. + :type expand: 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: Job or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hybriddatamanager.models.Job or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'dataServiceName': self._serialize.url("data_service_name", data_service_name, 'str'), + 'jobDefinitionName': self._serialize.url("job_definition_name", job_definition_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, '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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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 expand is not None: + query_parameters['$expand'] = self._serialize.query("expand", expand, '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('Job', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}'} + + + def _cancel_initial( + self, data_service_name, job_definition_name, job_id, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.cancel.metadata['url'] + path_format_arguments = { + 'dataServiceName': self._serialize.url("data_service_name", data_service_name, 'str'), + 'jobDefinitionName': self._serialize.url("job_definition_name", job_definition_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, '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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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 [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 cancel( + self, data_service_name, job_definition_name, job_id, resource_group_name, data_manager_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Cancels the given job. + + :param data_service_name: The name of the data service of the job + definition. + :type data_service_name: str + :param job_definition_name: The name of the job definition of the job. + :type job_definition_name: str + :param job_id: The job id of the job queried. + :type job_id: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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._cancel_initial( + data_service_name=data_service_name, + job_definition_name=job_definition_name, + job_id=job_id, + resource_group_name=resource_group_name, + data_manager_name=data_manager_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) + cancel.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}/cancel'} + + + def _resume_initial( + self, data_service_name, job_definition_name, job_id, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.resume.metadata['url'] + path_format_arguments = { + 'dataServiceName': self._serialize.url("data_service_name", data_service_name, 'str'), + 'jobDefinitionName': self._serialize.url("job_definition_name", job_definition_name, 'str'), + 'jobId': self._serialize.url("job_id", job_id, '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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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 [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 resume( + self, data_service_name, job_definition_name, job_id, resource_group_name, data_manager_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Resumes the given job. + + :param data_service_name: The name of the data service of the job + definition. + :type data_service_name: str + :param job_definition_name: The name of the job definition of the job. + :type job_definition_name: str + :param job_id: The job id of the job queried. + :type job_id: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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._resume_initial( + data_service_name=data_service_name, + job_definition_name=job_definition_name, + job_id=job_id, + resource_group_name=resource_group_name, + data_manager_name=data_manager_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) + resume.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobDefinitions/{jobDefinitionName}/jobs/{jobId}/resume'} + + def list_by_data_service( + self, data_service_name, resource_group_name, data_manager_name, filter=None, custom_headers=None, raw=False, **operation_config): + """This method gets all the jobs of a data service type in a given + resource. + + :param data_service_name: The name of the data service of interest. + :type data_service_name: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_name: str + :param filter: OData Filter options + :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 Job + :rtype: + ~azure.mgmt.hybriddatamanager.models.JobPaged[~azure.mgmt.hybriddatamanager.models.Job] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_data_service.metadata['url'] + path_format_arguments = { + 'dataServiceName': self._serialize.url("data_service_name", data_service_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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.JobPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_data_service.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/dataServices/{dataServiceName}/jobs'} + + def list_by_data_manager( + self, resource_group_name, data_manager_name, filter=None, custom_headers=None, raw=False, **operation_config): + """This method gets all the jobs at the data manager resource level. + + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_name: str + :param filter: OData Filter options + :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 Job + :rtype: + ~azure.mgmt.hybriddatamanager.models.JobPaged[~azure.mgmt.hybriddatamanager.models.Job] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_data_manager.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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.JobPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_data_manager.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/jobs'} diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_operations.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_operations.py new file mode 100644 index 000000000000..28c5c80f45a4 --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_operations.py @@ -0,0 +1,102 @@ +# 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 Operations(object): + """Operations 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-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list( + self, custom_headers=None, raw=False, **operation_config): + """The list of operations for Microsoft.HybridData provider. + + :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 AvailableProviderOperation + :rtype: + ~azure.mgmt.hybriddatamanager.models.AvailableProviderOperationPaged[~azure.mgmt.hybriddatamanager.models.AvailableProviderOperation] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list.metadata['url'] + + # 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.AvailableProviderOperationPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/providers/Microsoft.HybridData/operations'} diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_public_keys_operations.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_public_keys_operations.py new file mode 100644 index 000000000000..7130c4a879d6 --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/operations/_public_keys_operations.py @@ -0,0 +1,181 @@ +# 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 PublicKeysOperations(object): + """PublicKeysOperations 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-06-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-06-01" + + self.config = config + + def list_by_data_manager( + self, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + """This method gets the list view of public keys, however it will only + have one element. + + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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 PublicKey + :rtype: + ~azure.mgmt.hybriddatamanager.models.PublicKeyPaged[~azure.mgmt.hybriddatamanager.models.PublicKey] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_by_data_manager.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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.PublicKeyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_by_data_manager.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys'} + + def get( + self, public_key_name, resource_group_name, data_manager_name, custom_headers=None, raw=False, **operation_config): + """This method gets the public keys. + + :param public_key_name: Name of the public key. + :type public_key_name: str + :param resource_group_name: The Resource Group Name + :type resource_group_name: str + :param data_manager_name: The name of the DataManager Resource within + the specified resource group. DataManager names must be between 3 and + 24 characters in length and use any alphanumeric and underscore only + :type data_manager_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: PublicKey or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.hybriddatamanager.models.PublicKey or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'publicKeyName': self._serialize.url("public_key_name", public_key_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'), + 'dataManagerName': self._serialize.url("data_manager_name", data_manager_name, 'str', max_length=24, min_length=3, pattern=r'^[-\w\.]+$') + } + 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('PublicKey', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridData/dataManagers/{dataManagerName}/publicKeys/{publicKeyName}'} diff --git a/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/version.py b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/version.py new file mode 100644 index 000000000000..4174449873ab --- /dev/null +++ b/sdk/azure-mgmt-hybriddatamanager/azure/mgmt/hybriddatamanager/version.py @@ -0,0 +1,13 @@ +# 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. +# -------------------------------------------------------------------------- + +VERSION = "2019-06-01" +