From 3670d044a410241c5ce2a72232271ebf1c22db19 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Mon, 25 Jan 2021 03:29:15 +0000 Subject: [PATCH] CodeGen from PR 12514 in Azure/azure-rest-api-specs Adding key vault and DES resource settings. (#12514) --- .../azure/mgmt/resourcemover/__init__.py | 19 + .../mgmt/resourcemover/_configuration.py | 48 + .../_resource_mover_service_api.py | 64 + .../mgmt/resourcemover/models/__init__.py | 233 ++ .../mgmt/resourcemover/models/_models.py | 2109 +++++++++++++++++ .../mgmt/resourcemover/models/_models_py3.py | 2109 +++++++++++++++++ .../resourcemover/models/_paged_models.py | 53 + .../_resource_mover_service_api_enums.py | 89 + .../mgmt/resourcemover/operations/__init__.py | 22 + .../_move_collections_operations.py | 1115 +++++++++ .../operations/_move_resources_operations.py | 392 +++ .../_operations_discovery_operations.py | 92 + .../_unresolved_dependencies_operations.py | 128 + .../azure/mgmt/resourcemover/version.py | 13 + 14 files changed, 6486 insertions(+) create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/__init__.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_configuration.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_resource_mover_service_api.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/__init__.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models_py3.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_paged_models.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_resource_mover_service_api_enums.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/__init__.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_collections_operations.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_resources_operations.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_operations_discovery_operations.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_unresolved_dependencies_operations.py create mode 100644 sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/version.py diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/__init__.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/__init__.py new file mode 100644 index 000000000000..dfa395e8a543 --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/__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 ResourceMoverServiceAPIConfiguration +from ._resource_mover_service_api import ResourceMoverServiceAPI +__all__ = ['ResourceMoverServiceAPI', 'ResourceMoverServiceAPIConfiguration'] + +from .version import VERSION + +__version__ = VERSION + diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_configuration.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_configuration.py new file mode 100644 index 000000000000..917d40ae9f98 --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_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 ResourceMoverServiceAPIConfiguration(AzureConfiguration): + """Configuration for ResourceMoverServiceAPI + 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(ResourceMoverServiceAPIConfiguration, 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-resourcemover/{}'.format(VERSION)) + self.add_user_agent('Azure-SDK-For-Python') + + self.credentials = credentials + self.subscription_id = subscription_id diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_resource_mover_service_api.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_resource_mover_service_api.py new file mode 100644 index 000000000000..ef4455eecabb --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/_resource_mover_service_api.py @@ -0,0 +1,64 @@ +# 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 ResourceMoverServiceAPIConfiguration +from .operations import MoveCollectionsOperations +from .operations import MoveResourcesOperations +from .operations import UnresolvedDependenciesOperations +from .operations import OperationsDiscoveryOperations +from . import models + + +class ResourceMoverServiceAPI(SDKClient): + """A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between zones within a region. + + :ivar config: Configuration for client. + :vartype config: ResourceMoverServiceAPIConfiguration + + :ivar move_collections: MoveCollections operations + :vartype move_collections: azure.mgmt.resourcemover.operations.MoveCollectionsOperations + :ivar move_resources: MoveResources operations + :vartype move_resources: azure.mgmt.resourcemover.operations.MoveResourcesOperations + :ivar unresolved_dependencies: UnresolvedDependencies operations + :vartype unresolved_dependencies: azure.mgmt.resourcemover.operations.UnresolvedDependenciesOperations + :ivar operations_discovery: OperationsDiscovery operations + :vartype operations_discovery: azure.mgmt.resourcemover.operations.OperationsDiscoveryOperations + + :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 = ResourceMoverServiceAPIConfiguration(credentials, subscription_id, base_url) + super(ResourceMoverServiceAPI, 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-10-01-preview' + self._serialize = Serializer(client_models) + self._deserialize = Deserializer(client_models) + + self.move_collections = MoveCollectionsOperations( + self._client, self.config, self._serialize, self._deserialize) + self.move_resources = MoveResourcesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.unresolved_dependencies = UnresolvedDependenciesOperations( + self._client, self.config, self._serialize, self._deserialize) + self.operations_discovery = OperationsDiscoveryOperations( + self._client, self.config, self._serialize, self._deserialize) diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/__init__.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/__init__.py new file mode 100644 index 000000000000..9783c4e496c6 --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/__init__.py @@ -0,0 +1,233 @@ +# 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 AffectedMoveResource + from ._models_py3 import AutomaticResolutionProperties + from ._models_py3 import AvailabilitySetResourceSettings + from ._models_py3 import AzureResourceReference + from ._models_py3 import BulkRemoveRequest + from ._models_py3 import CommitRequest + from ._models_py3 import DiscardRequest + from ._models_py3 import DiskEncryptionSetResourceSettings + from ._models_py3 import Display + from ._models_py3 import Identity + from ._models_py3 import JobStatus + from ._models_py3 import KeyVaultResourceSettings + from ._models_py3 import LBBackendAddressPoolResourceSettings + from ._models_py3 import LBFrontendIPConfigurationResourceSettings + from ._models_py3 import LoadBalancerBackendAddressPoolReference + from ._models_py3 import LoadBalancerNatRuleReference + from ._models_py3 import LoadBalancerResourceSettings + from ._models_py3 import ManualResolutionProperties + from ._models_py3 import MoveCollection + from ._models_py3 import MoveCollectionProperties + from ._models_py3 import MoveCollectionPropertiesErrors + from ._models_py3 import MoveErrorInfo + from ._models_py3 import MoveResource + from ._models_py3 import MoveResourceDependency + from ._models_py3 import MoveResourceDependencyOverride + from ._models_py3 import MoveResourceError + from ._models_py3 import MoveResourceErrorBody + from ._models_py3 import MoveResourceFilter + from ._models_py3 import MoveResourceFilterProperties + from ._models_py3 import MoveResourceProperties + from ._models_py3 import MoveResourcePropertiesErrors + from ._models_py3 import MoveResourcePropertiesMoveStatus + from ._models_py3 import MoveResourceStatus + from ._models_py3 import NetworkInterfaceResourceSettings + from ._models_py3 import NetworkSecurityGroupResourceSettings + from ._models_py3 import NicIpConfigurationResourceSettings + from ._models_py3 import NsgReference + from ._models_py3 import NsgSecurityRule + from ._models_py3 import OperationErrorAdditionalInfo + from ._models_py3 import OperationsDiscovery + from ._models_py3 import OperationsDiscoveryCollection + from ._models_py3 import OperationStatus + from ._models_py3 import OperationStatusError + from ._models_py3 import PrepareRequest + from ._models_py3 import ProxyResourceReference + from ._models_py3 import PublicIPAddressResourceSettings + from ._models_py3 import PublicIpReference + from ._models_py3 import ResourceGroupResourceSettings + from ._models_py3 import ResourceMoveRequest + from ._models_py3 import ResourceSettings + from ._models_py3 import SqlDatabaseResourceSettings + from ._models_py3 import SqlElasticPoolResourceSettings + from ._models_py3 import SqlServerResourceSettings + from ._models_py3 import SubnetReference + from ._models_py3 import SubnetResourceSettings + from ._models_py3 import Summary + from ._models_py3 import SummaryCollection + from ._models_py3 import UnresolvedDependenciesFilter + from ._models_py3 import UnresolvedDependenciesFilterProperties + from ._models_py3 import UnresolvedDependency + from ._models_py3 import UpdateMoveCollectionRequest + from ._models_py3 import VirtualMachineResourceSettings + from ._models_py3 import VirtualNetworkResourceSettings +except (SyntaxError, ImportError): + from ._models import AffectedMoveResource + from ._models import AutomaticResolutionProperties + from ._models import AvailabilitySetResourceSettings + from ._models import AzureResourceReference + from ._models import BulkRemoveRequest + from ._models import CommitRequest + from ._models import DiscardRequest + from ._models import DiskEncryptionSetResourceSettings + from ._models import Display + from ._models import Identity + from ._models import JobStatus + from ._models import KeyVaultResourceSettings + from ._models import LBBackendAddressPoolResourceSettings + from ._models import LBFrontendIPConfigurationResourceSettings + from ._models import LoadBalancerBackendAddressPoolReference + from ._models import LoadBalancerNatRuleReference + from ._models import LoadBalancerResourceSettings + from ._models import ManualResolutionProperties + from ._models import MoveCollection + from ._models import MoveCollectionProperties + from ._models import MoveCollectionPropertiesErrors + from ._models import MoveErrorInfo + from ._models import MoveResource + from ._models import MoveResourceDependency + from ._models import MoveResourceDependencyOverride + from ._models import MoveResourceError + from ._models import MoveResourceErrorBody + from ._models import MoveResourceFilter + from ._models import MoveResourceFilterProperties + from ._models import MoveResourceProperties + from ._models import MoveResourcePropertiesErrors + from ._models import MoveResourcePropertiesMoveStatus + from ._models import MoveResourceStatus + from ._models import NetworkInterfaceResourceSettings + from ._models import NetworkSecurityGroupResourceSettings + from ._models import NicIpConfigurationResourceSettings + from ._models import NsgReference + from ._models import NsgSecurityRule + from ._models import OperationErrorAdditionalInfo + from ._models import OperationsDiscovery + from ._models import OperationsDiscoveryCollection + from ._models import OperationStatus + from ._models import OperationStatusError + from ._models import PrepareRequest + from ._models import ProxyResourceReference + from ._models import PublicIPAddressResourceSettings + from ._models import PublicIpReference + from ._models import ResourceGroupResourceSettings + from ._models import ResourceMoveRequest + from ._models import ResourceSettings + from ._models import SqlDatabaseResourceSettings + from ._models import SqlElasticPoolResourceSettings + from ._models import SqlServerResourceSettings + from ._models import SubnetReference + from ._models import SubnetResourceSettings + from ._models import Summary + from ._models import SummaryCollection + from ._models import UnresolvedDependenciesFilter + from ._models import UnresolvedDependenciesFilterProperties + from ._models import UnresolvedDependency + from ._models import UpdateMoveCollectionRequest + from ._models import VirtualMachineResourceSettings + from ._models import VirtualNetworkResourceSettings +from ._paged_models import MoveCollectionPaged +from ._paged_models import MoveResourcePaged +from ._paged_models import UnresolvedDependencyPaged +from ._resource_mover_service_api_enums import ( + ResourceIdentityType, + MoveState, + MoveResourceInputType, + ProvisioningState, + JobName, + ResolutionType, + DependencyType, + TargetAvailabilityZone, + ZoneRedundant, + DependencyLevel, +) + +__all__ = [ + 'AffectedMoveResource', + 'AutomaticResolutionProperties', + 'AvailabilitySetResourceSettings', + 'AzureResourceReference', + 'BulkRemoveRequest', + 'CommitRequest', + 'DiscardRequest', + 'DiskEncryptionSetResourceSettings', + 'Display', + 'Identity', + 'JobStatus', + 'KeyVaultResourceSettings', + 'LBBackendAddressPoolResourceSettings', + 'LBFrontendIPConfigurationResourceSettings', + 'LoadBalancerBackendAddressPoolReference', + 'LoadBalancerNatRuleReference', + 'LoadBalancerResourceSettings', + 'ManualResolutionProperties', + 'MoveCollection', + 'MoveCollectionProperties', + 'MoveCollectionPropertiesErrors', + 'MoveErrorInfo', + 'MoveResource', + 'MoveResourceDependency', + 'MoveResourceDependencyOverride', + 'MoveResourceError', + 'MoveResourceErrorBody', + 'MoveResourceFilter', + 'MoveResourceFilterProperties', + 'MoveResourceProperties', + 'MoveResourcePropertiesErrors', + 'MoveResourcePropertiesMoveStatus', + 'MoveResourceStatus', + 'NetworkInterfaceResourceSettings', + 'NetworkSecurityGroupResourceSettings', + 'NicIpConfigurationResourceSettings', + 'NsgReference', + 'NsgSecurityRule', + 'OperationErrorAdditionalInfo', + 'OperationsDiscovery', + 'OperationsDiscoveryCollection', + 'OperationStatus', + 'OperationStatusError', + 'PrepareRequest', + 'ProxyResourceReference', + 'PublicIPAddressResourceSettings', + 'PublicIpReference', + 'ResourceGroupResourceSettings', + 'ResourceMoveRequest', + 'ResourceSettings', + 'SqlDatabaseResourceSettings', + 'SqlElasticPoolResourceSettings', + 'SqlServerResourceSettings', + 'SubnetReference', + 'SubnetResourceSettings', + 'Summary', + 'SummaryCollection', + 'UnresolvedDependenciesFilter', + 'UnresolvedDependenciesFilterProperties', + 'UnresolvedDependency', + 'UpdateMoveCollectionRequest', + 'VirtualMachineResourceSettings', + 'VirtualNetworkResourceSettings', + 'MoveCollectionPaged', + 'MoveResourcePaged', + 'UnresolvedDependencyPaged', + 'ResourceIdentityType', + 'MoveState', + 'MoveResourceInputType', + 'ProvisioningState', + 'JobName', + 'ResolutionType', + 'DependencyType', + 'TargetAvailabilityZone', + 'ZoneRedundant', + 'DependencyLevel', +] diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models.py new file mode 100644 index 000000000000..64dc5acfca9b --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models.py @@ -0,0 +1,2109 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class AffectedMoveResource(Model): + """The RP custom operation error info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The affected move resource id. + :vartype id: str + :ivar source_id: The affected move resource source id. + :vartype source_id: str + :ivar move_resources: The affected move resources. + :vartype move_resources: + list[~azure.mgmt.resourcemover.models.AffectedMoveResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'source_id': {'readonly': True}, + 'move_resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_id': {'key': 'sourceId', 'type': 'str'}, + 'move_resources': {'key': 'moveResources', 'type': '[AffectedMoveResource]'}, + } + + def __init__(self, **kwargs): + super(AffectedMoveResource, self).__init__(**kwargs) + self.id = None + self.source_id = None + self.move_resources = None + + +class AutomaticResolutionProperties(Model): + """Defines the properties for automatic resolution. + + :param move_resource_id: Gets the MoveResource ARM ID of + the dependent resource if the resolution type is Automatic. + :type move_resource_id: str + """ + + _attribute_map = { + 'move_resource_id': {'key': 'moveResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AutomaticResolutionProperties, self).__init__(**kwargs) + self.move_resource_id = kwargs.get('move_resource_id', None) + + +class ResourceSettings(Model): + """Gets or sets the resource settings. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VirtualMachineResourceSettings, + AvailabilitySetResourceSettings, VirtualNetworkResourceSettings, + NetworkInterfaceResourceSettings, NetworkSecurityGroupResourceSettings, + LoadBalancerResourceSettings, SqlServerResourceSettings, + SqlElasticPoolResourceSettings, SqlDatabaseResourceSettings, + ResourceGroupResourceSettings, PublicIPAddressResourceSettings, + KeyVaultResourceSettings, DiskEncryptionSetResourceSettings + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + _subtype_map = { + 'resource_type': {'Microsoft.Compute/virtualMachines': 'VirtualMachineResourceSettings', 'Microsoft.Compute/availabilitySets': 'AvailabilitySetResourceSettings', 'Microsoft.Network/virtualNetworks': 'VirtualNetworkResourceSettings', 'Microsoft.Network/networkInterfaces': 'NetworkInterfaceResourceSettings', 'Microsoft.Network/networkSecurityGroups': 'NetworkSecurityGroupResourceSettings', 'Microsoft.Network/loadBalancers': 'LoadBalancerResourceSettings', 'Microsoft.Sql/servers': 'SqlServerResourceSettings', 'Microsoft.Sql/servers/elasticPools': 'SqlElasticPoolResourceSettings', 'Microsoft.Sql/servers/databases': 'SqlDatabaseResourceSettings', 'resourceGroups': 'ResourceGroupResourceSettings', 'Microsoft.Network/publicIPAddresses': 'PublicIPAddressResourceSettings', 'Microsoft.KeyVault/vaults': 'KeyVaultResourceSettings', 'Microsoft.Compute/diskEncryptionSets': 'DiskEncryptionSetResourceSettings'} + } + + def __init__(self, **kwargs): + super(ResourceSettings, self).__init__(**kwargs) + self.target_resource_name = kwargs.get('target_resource_name', None) + self.resource_type = None + + +class AvailabilitySetResourceSettings(ResourceSettings): + """Gets or sets the availability set resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param fault_domain: Gets or sets the target fault domain. + :type fault_domain: int + :param update_domain: Gets or sets the target update domain. + :type update_domain: int + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + 'fault_domain': {'minimum': 1}, + 'update_domain': {'maximum': 20, 'minimum': 1}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'fault_domain': {'key': 'faultDomain', 'type': 'int'}, + 'update_domain': {'key': 'updateDomain', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AvailabilitySetResourceSettings, self).__init__(**kwargs) + self.fault_domain = kwargs.get('fault_domain', None) + self.update_domain = kwargs.get('update_domain', None) + self.resource_type = 'Microsoft.Compute/availabilitySets' + + +class AzureResourceReference(Model): + """Defines reference to an Azure resource. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureResourceReference, self).__init__(**kwargs) + self.source_arm_resource_id = kwargs.get('source_arm_resource_id', None) + + +class BulkRemoveRequest(Model): + """Defines the request body for bulk remove of move resources operation. + + :param validate_only: Gets or sets a value indicating whether the + operation needs to only run pre-requisite. + :type validate_only: bool + :param move_resources: Gets or sets the list of resource Id's, by default + it accepts move resource id's unless the input type is switched via + moveResourceInputType property. + :type move_resources: list[str] + :param move_resource_input_type: Possible values include: + 'MoveResourceId', 'MoveResourceSourceId' + :type move_resource_input_type: str or + ~azure.mgmt.resourcemover.models.MoveResourceInputType + """ + + _attribute_map = { + 'validate_only': {'key': 'validateOnly', 'type': 'bool'}, + 'move_resources': {'key': 'moveResources', 'type': '[str]'}, + 'move_resource_input_type': {'key': 'moveResourceInputType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(BulkRemoveRequest, self).__init__(**kwargs) + self.validate_only = kwargs.get('validate_only', None) + self.move_resources = kwargs.get('move_resources', None) + self.move_resource_input_type = kwargs.get('move_resource_input_type', None) + + +class CloudError(Model): + """An error response from the service. + + :param error: Cloud error body. + :type error: ~azure.mgmt.resourcemover.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, **kwargs): + super(CloudError, self).__init__(**kwargs) + self.error = kwargs.get('error', None) + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.resourcemover.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, **kwargs): + super(CloudErrorBody, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) + self.target = kwargs.get('target', None) + self.details = kwargs.get('details', None) + + +class CommitRequest(Model): + """Defines the request body for commit operation. + + All required parameters must be populated in order to send to Azure. + + :param validate_only: Gets or sets a value indicating whether the + operation needs to only run pre-requisite. + :type validate_only: bool + :param move_resources: Required. Gets or sets the list of resource Id's, + by default it accepts move resource id's unless the input type is switched + via moveResourceInputType property. + :type move_resources: list[str] + :param move_resource_input_type: Possible values include: + 'MoveResourceId', 'MoveResourceSourceId' + :type move_resource_input_type: str or + ~azure.mgmt.resourcemover.models.MoveResourceInputType + """ + + _validation = { + 'move_resources': {'required': True}, + } + + _attribute_map = { + 'validate_only': {'key': 'validateOnly', 'type': 'bool'}, + 'move_resources': {'key': 'moveResources', 'type': '[str]'}, + 'move_resource_input_type': {'key': 'moveResourceInputType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(CommitRequest, self).__init__(**kwargs) + self.validate_only = kwargs.get('validate_only', None) + self.move_resources = kwargs.get('move_resources', None) + self.move_resource_input_type = kwargs.get('move_resource_input_type', None) + + +class DiscardRequest(Model): + """Defines the request body for discard operation. + + All required parameters must be populated in order to send to Azure. + + :param validate_only: Gets or sets a value indicating whether the + operation needs to only run pre-requisite. + :type validate_only: bool + :param move_resources: Required. Gets or sets the list of resource Id's, + by default it accepts move resource id's unless the input type is switched + via moveResourceInputType property. + :type move_resources: list[str] + :param move_resource_input_type: Possible values include: + 'MoveResourceId', 'MoveResourceSourceId' + :type move_resource_input_type: str or + ~azure.mgmt.resourcemover.models.MoveResourceInputType + """ + + _validation = { + 'move_resources': {'required': True}, + } + + _attribute_map = { + 'validate_only': {'key': 'validateOnly', 'type': 'bool'}, + 'move_resources': {'key': 'moveResources', 'type': '[str]'}, + 'move_resource_input_type': {'key': 'moveResourceInputType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DiscardRequest, self).__init__(**kwargs) + self.validate_only = kwargs.get('validate_only', None) + self.move_resources = kwargs.get('move_resources', None) + self.move_resource_input_type = kwargs.get('move_resource_input_type', None) + + +class DiskEncryptionSetResourceSettings(ResourceSettings): + """Defines the disk encryption set resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(DiskEncryptionSetResourceSettings, self).__init__(**kwargs) + self.resource_type = 'Microsoft.Compute/diskEncryptionSets' + + +class Display(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 the 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. + e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + :type provider: str + :param resource: Gets or sets the resource. + The localized friendly form of the resource related to this + action/operation – it + should match the public documentation for the resource provider. + It should use Title Casing. + This value should be unique for a particular URL type (e.g. nested types + should *not* + reuse their parent’s display.resource field) + e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual + Machine VM Sizes" + or "Scheduler Jobs". + :type resource: str + :param operation: Gets or sets the 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. + Prescriptive guidance: Read Create or Update Delete 'ActionName'. + :type operation: str + :param description: Gets or sets the 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. + Prescriptive guidance for namespace: + Read any 'display.provider' resource + Create or Update any 'display.provider' resource + Delete any 'display.provider' resource + Perform any other action on any 'display.provider' resource + Prescriptive guidance for namespace: + Read any 'display.resource' Create or Update any 'display.resource' + Delete any + 'display.resource' 'ActionName' any 'display.resources'. + :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(Display, 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 Identity(Model): + """Defines the MSI properties of the Move Collection. + + :param type: Possible values include: 'None', 'SystemAssigned', + 'UserAssigned' + :type type: str or ~azure.mgmt.resourcemover.models.ResourceIdentityType + :param principal_id: Gets or sets the principal id. + :type principal_id: str + :param tenant_id: Gets or sets the tenant id. + :type tenant_id: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Identity, self).__init__(**kwargs) + self.type = kwargs.get('type', None) + self.principal_id = kwargs.get('principal_id', None) + self.tenant_id = kwargs.get('tenant_id', None) + + +class JobStatus(Model): + """Defines the job status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param job_name: Possible values include: 'InitialSync' + :type job_name: str or ~azure.mgmt.resourcemover.models.JobName + :ivar job_progress: Gets or sets the monitoring job percentage. + :vartype job_progress: str + """ + + _validation = { + 'job_progress': {'readonly': True}, + } + + _attribute_map = { + 'job_name': {'key': 'jobName', 'type': 'str'}, + 'job_progress': {'key': 'jobProgress', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(JobStatus, self).__init__(**kwargs) + self.job_name = kwargs.get('job_name', None) + self.job_progress = None + + +class KeyVaultResourceSettings(ResourceSettings): + """Defines the key vault resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(KeyVaultResourceSettings, self).__init__(**kwargs) + self.resource_type = 'Microsoft.KeyVault/vaults' + + +class LBBackendAddressPoolResourceSettings(Model): + """Defines load balancer backend address pool properties. + + :param name: Gets or sets the backend address pool name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LBBackendAddressPoolResourceSettings, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class LBFrontendIPConfigurationResourceSettings(Model): + """Defines load balancer frontend IP configuration properties. + + :param name: Gets or sets the frontend IP configuration name. + :type name: str + :param private_ip_address: Gets or sets the IP address of the Load + Balancer.This is only specified if a specific + private IP address shall be allocated from the subnet specified in + subnetRef. + :type private_ip_address: str + :param private_ip_allocation_method: Gets or sets PrivateIP allocation + method (Static/Dynamic). + :type private_ip_allocation_method: str + :param subnet: + :type subnet: ~azure.mgmt.resourcemover.models.SubnetReference + :param zones: Gets or sets the csv list of zones. + :type zones: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'privateIpAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'SubnetReference'}, + 'zones': {'key': 'zones', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LBFrontendIPConfigurationResourceSettings, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.zones = kwargs.get('zones', None) + + +class ProxyResourceReference(AzureResourceReference): + """Defines reference to a proxy resource. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + :param name: Gets the name of the proxy resource on the target side. + :type name: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ProxyResourceReference, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + + +class LoadBalancerBackendAddressPoolReference(ProxyResourceReference): + """Defines reference to load balancer backend address pools. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + :param name: Gets the name of the proxy resource on the target side. + :type name: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LoadBalancerBackendAddressPoolReference, self).__init__(**kwargs) + + +class LoadBalancerNatRuleReference(ProxyResourceReference): + """Defines reference to load balancer NAT rules. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + :param name: Gets the name of the proxy resource on the target side. + :type name: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LoadBalancerNatRuleReference, self).__init__(**kwargs) + + +class LoadBalancerResourceSettings(ResourceSettings): + """Defines the load balancer resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param sku: Gets or sets load balancer sku (Basic/Standard). + :type sku: str + :param frontend_ip_configurations: Gets or sets the frontend IP + configurations of the load balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.resourcemover.models.LBFrontendIPConfigurationResourceSettings] + :param backend_address_pools: Gets or sets the backend address pools of + the load balancer. + :type backend_address_pools: + list[~azure.mgmt.resourcemover.models.LBBackendAddressPoolResourceSettings] + :param zones: Gets or sets the csv list of zones common for all frontend + IP configurations. Note this is given + precedence only if frontend IP configurations settings are not present. + :type zones: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'frontend_ip_configurations': {'key': 'frontendIPConfigurations', 'type': '[LBFrontendIPConfigurationResourceSettings]'}, + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[LBBackendAddressPoolResourceSettings]'}, + 'zones': {'key': 'zones', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(LoadBalancerResourceSettings, self).__init__(**kwargs) + self.sku = kwargs.get('sku', None) + self.frontend_ip_configurations = kwargs.get('frontend_ip_configurations', None) + self.backend_address_pools = kwargs.get('backend_address_pools', None) + self.zones = kwargs.get('zones', None) + self.resource_type = 'Microsoft.Network/loadBalancers' + + +class ManualResolutionProperties(Model): + """Defines the properties for manual resolution. + + :param target_id: Gets or sets the target resource ARM ID of the dependent + resource if the resource type is Manual. + :type target_id: str + """ + + _attribute_map = { + 'target_id': {'key': 'targetId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ManualResolutionProperties, self).__init__(**kwargs) + self.target_id = kwargs.get('target_id', None) + + +class MoveCollection(Model): + """Define the move collection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: The etag of the resource. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The geo-location where the resource lives. + :type location: str + :param identity: + :type identity: ~azure.mgmt.resourcemover.models.Identity + :param properties: + :type properties: + ~azure.mgmt.resourcemover.models.MoveCollectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'properties': {'key': 'properties', 'type': 'MoveCollectionProperties'}, + } + + def __init__(self, **kwargs): + super(MoveCollection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.etag = None + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) + self.identity = kwargs.get('identity', None) + self.properties = kwargs.get('properties', None) + + +class MoveCollectionProperties(Model): + """Defines the move collection properties. + + 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. + + :param source_region: Required. Gets or sets the source region. + :type source_region: str + :param target_region: Required. Gets or sets the target region. + :type target_region: str + :param provisioning_state: Possible values include: 'Succeeded', + 'Updating', 'Creating', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.resourcemover.models.ProvisioningState + :ivar errors: Defines the move collection errors. + :vartype errors: + ~azure.mgmt.resourcemover.models.MoveCollectionPropertiesErrors + """ + + _validation = { + 'source_region': {'required': True}, + 'target_region': {'required': True}, + 'errors': {'readonly': True}, + } + + _attribute_map = { + 'source_region': {'key': 'sourceRegion', 'type': 'str'}, + 'target_region': {'key': 'targetRegion', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': 'MoveCollectionPropertiesErrors'}, + } + + def __init__(self, **kwargs): + super(MoveCollectionProperties, self).__init__(**kwargs) + self.source_region = kwargs.get('source_region', None) + self.target_region = kwargs.get('target_region', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.errors = None + + +class MoveResourceError(Model): + """An error response from the azure resource mover service. + + :param properties: The move resource error body. + :type properties: ~azure.mgmt.resourcemover.models.MoveResourceErrorBody + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'MoveResourceErrorBody'}, + } + + def __init__(self, **kwargs): + super(MoveResourceError, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class MoveCollectionPropertiesErrors(MoveResourceError): + """Defines the move collection errors. + + :param properties: The move resource error body. + :type properties: ~azure.mgmt.resourcemover.models.MoveResourceErrorBody + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'MoveResourceErrorBody'}, + } + + def __init__(self, **kwargs): + super(MoveCollectionPropertiesErrors, self).__init__(**kwargs) + + +class MoveErrorInfo(Model): + """The move custom error info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar move_resources: The affected move resources. + :vartype move_resources: + list[~azure.mgmt.resourcemover.models.AffectedMoveResource] + """ + + _validation = { + 'move_resources': {'readonly': True}, + } + + _attribute_map = { + 'move_resources': {'key': 'moveResources', 'type': '[AffectedMoveResource]'}, + } + + def __init__(self, **kwargs): + super(MoveErrorInfo, self).__init__(**kwargs) + self.move_resources = None + + +class MoveResource(Model): + """Defines the move resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: + :type properties: ~azure.mgmt.resourcemover.models.MoveResourceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MoveResourceProperties'}, + } + + def __init__(self, **kwargs): + super(MoveResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = kwargs.get('properties', None) + + +class MoveResourceDependency(Model): + """Defines the dependency of the move resource. + + :param id: Gets the source ARM ID of the dependent resource. + :type id: str + :param resolution_status: Gets the dependency resolution status. + :type resolution_status: str + :param resolution_type: Possible values include: 'Manual', 'Automatic' + :type resolution_type: str or + ~azure.mgmt.resourcemover.models.ResolutionType + :param dependency_type: Possible values include: 'RequiredForPrepare', + 'RequiredForMove' + :type dependency_type: str or + ~azure.mgmt.resourcemover.models.DependencyType + :param manual_resolution: + :type manual_resolution: + ~azure.mgmt.resourcemover.models.ManualResolutionProperties + :param automatic_resolution: + :type automatic_resolution: + ~azure.mgmt.resourcemover.models.AutomaticResolutionProperties + :param is_optional: Gets or sets a value indicating whether the dependency + is optional. + :type is_optional: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resolution_status': {'key': 'resolutionStatus', 'type': 'str'}, + 'resolution_type': {'key': 'resolutionType', 'type': 'str'}, + 'dependency_type': {'key': 'dependencyType', 'type': 'str'}, + 'manual_resolution': {'key': 'manualResolution', 'type': 'ManualResolutionProperties'}, + 'automatic_resolution': {'key': 'automaticResolution', 'type': 'AutomaticResolutionProperties'}, + 'is_optional': {'key': 'isOptional', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MoveResourceDependency, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.resolution_status = kwargs.get('resolution_status', None) + self.resolution_type = kwargs.get('resolution_type', None) + self.dependency_type = kwargs.get('dependency_type', None) + self.manual_resolution = kwargs.get('manual_resolution', None) + self.automatic_resolution = kwargs.get('automatic_resolution', None) + self.is_optional = kwargs.get('is_optional', None) + + +class MoveResourceDependencyOverride(Model): + """Defines the dependency override of the move resource. + + :param id: Gets or sets the ARM ID of the dependent resource. + :type id: str + :param target_id: Gets or sets the resource ARM id of either the + MoveResource or the resource ARM ID of + the dependent resource. + :type target_id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target_id': {'key': 'targetId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MoveResourceDependencyOverride, self).__init__(**kwargs) + self.id = kwargs.get('id', None) + self.target_id = kwargs.get('target_id', None) + + +class MoveResourceErrorBody(Model): + """An error response from the Azure Migrate service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for + display in a user interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of + the property in error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: + list[~azure.mgmt.resourcemover.models.MoveResourceErrorBody] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[MoveResourceErrorBody]'}, + } + + def __init__(self, **kwargs): + super(MoveResourceErrorBody, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + + +class MoveResourceFilter(Model): + """Move resource filter. + + :param properties: + :type properties: + ~azure.mgmt.resourcemover.models.MoveResourceFilterProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'MoveResourceFilterProperties'}, + } + + def __init__(self, **kwargs): + super(MoveResourceFilter, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class MoveResourceFilterProperties(Model): + """MoveResourceFilterProperties. + + :param provisioning_state: The provisioning state. + :type provisioning_state: str + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(MoveResourceFilterProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + + +class MoveResourceProperties(Model): + """Defines the move resource properties. + + 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. + + :param provisioning_state: Possible values include: 'Succeeded', + 'Updating', 'Creating', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.resourcemover.models.ProvisioningState + :param source_id: Required. Gets or sets the Source ARM Id of the + resource. + :type source_id: str + :ivar target_id: Gets or sets the Target ARM Id of the resource. + :vartype target_id: str + :param existing_target_id: Gets or sets the existing target ARM Id of the + resource. + :type existing_target_id: str + :param resource_settings: Gets or sets the resource settings. + :type resource_settings: ~azure.mgmt.resourcemover.models.ResourceSettings + :ivar source_resource_settings: Gets or sets the source resource settings. + :vartype source_resource_settings: + ~azure.mgmt.resourcemover.models.ResourceSettings + :ivar move_status: Defines the move resource status. + :vartype move_status: + ~azure.mgmt.resourcemover.models.MoveResourcePropertiesMoveStatus + :ivar depends_on: Gets or sets the move resource dependencies. + :vartype depends_on: + list[~azure.mgmt.resourcemover.models.MoveResourceDependency] + :param depends_on_overrides: Gets or sets the move resource dependencies + overrides. + :type depends_on_overrides: + list[~azure.mgmt.resourcemover.models.MoveResourceDependencyOverride] + :ivar is_resolve_required: Gets a value indicating whether the resolve + action is required over the move collection. + :vartype is_resolve_required: bool + :ivar errors: Defines the move resource errors. + :vartype errors: + ~azure.mgmt.resourcemover.models.MoveResourcePropertiesErrors + """ + + _validation = { + 'source_id': {'required': True}, + 'target_id': {'readonly': True}, + 'source_resource_settings': {'readonly': True}, + 'move_status': {'readonly': True}, + 'depends_on': {'readonly': True}, + 'is_resolve_required': {'readonly': True}, + 'errors': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'source_id': {'key': 'sourceId', 'type': 'str'}, + 'target_id': {'key': 'targetId', 'type': 'str'}, + 'existing_target_id': {'key': 'existingTargetId', 'type': 'str'}, + 'resource_settings': {'key': 'resourceSettings', 'type': 'ResourceSettings'}, + 'source_resource_settings': {'key': 'sourceResourceSettings', 'type': 'ResourceSettings'}, + 'move_status': {'key': 'moveStatus', 'type': 'MoveResourcePropertiesMoveStatus'}, + 'depends_on': {'key': 'dependsOn', 'type': '[MoveResourceDependency]'}, + 'depends_on_overrides': {'key': 'dependsOnOverrides', 'type': '[MoveResourceDependencyOverride]'}, + 'is_resolve_required': {'key': 'isResolveRequired', 'type': 'bool'}, + 'errors': {'key': 'errors', 'type': 'MoveResourcePropertiesErrors'}, + } + + def __init__(self, **kwargs): + super(MoveResourceProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.source_id = kwargs.get('source_id', None) + self.target_id = None + self.existing_target_id = kwargs.get('existing_target_id', None) + self.resource_settings = kwargs.get('resource_settings', None) + self.source_resource_settings = None + self.move_status = None + self.depends_on = None + self.depends_on_overrides = kwargs.get('depends_on_overrides', None) + self.is_resolve_required = None + self.errors = None + + +class MoveResourcePropertiesErrors(MoveResourceError): + """Defines the move resource errors. + + :param properties: The move resource error body. + :type properties: ~azure.mgmt.resourcemover.models.MoveResourceErrorBody + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'MoveResourceErrorBody'}, + } + + def __init__(self, **kwargs): + super(MoveResourcePropertiesErrors, self).__init__(**kwargs) + + +class MoveResourceStatus(Model): + """Defines the move resource status. + + :param move_state: Possible values include: 'AssignmentPending', + 'PreparePending', 'PrepareInProgress', 'PrepareFailed', 'MovePending', + 'MoveInProgress', 'MoveFailed', 'DiscardInProgress', 'DiscardFailed', + 'CommitPending', 'CommitInProgress', 'CommitFailed', 'Committed', + 'DeleteSourcePending', 'ResourceMoveCompleted' + :type move_state: str or ~azure.mgmt.resourcemover.models.MoveState + :param job_status: + :type job_status: ~azure.mgmt.resourcemover.models.JobStatus + :param errors: + :type errors: ~azure.mgmt.resourcemover.models.MoveResourceError + """ + + _attribute_map = { + 'move_state': {'key': 'moveState', 'type': 'str'}, + 'job_status': {'key': 'jobStatus', 'type': 'JobStatus'}, + 'errors': {'key': 'errors', 'type': 'MoveResourceError'}, + } + + def __init__(self, **kwargs): + super(MoveResourceStatus, self).__init__(**kwargs) + self.move_state = kwargs.get('move_state', None) + self.job_status = kwargs.get('job_status', None) + self.errors = kwargs.get('errors', None) + + +class MoveResourcePropertiesMoveStatus(MoveResourceStatus): + """Defines the move resource status. + + :param move_state: Possible values include: 'AssignmentPending', + 'PreparePending', 'PrepareInProgress', 'PrepareFailed', 'MovePending', + 'MoveInProgress', 'MoveFailed', 'DiscardInProgress', 'DiscardFailed', + 'CommitPending', 'CommitInProgress', 'CommitFailed', 'Committed', + 'DeleteSourcePending', 'ResourceMoveCompleted' + :type move_state: str or ~azure.mgmt.resourcemover.models.MoveState + :param job_status: + :type job_status: ~azure.mgmt.resourcemover.models.JobStatus + :param errors: + :type errors: ~azure.mgmt.resourcemover.models.MoveResourceError + """ + + _attribute_map = { + 'move_state': {'key': 'moveState', 'type': 'str'}, + 'job_status': {'key': 'jobStatus', 'type': 'JobStatus'}, + 'errors': {'key': 'errors', 'type': 'MoveResourceError'}, + } + + def __init__(self, **kwargs): + super(MoveResourcePropertiesMoveStatus, self).__init__(**kwargs) + + +class NetworkInterfaceResourceSettings(ResourceSettings): + """Defines the network interface resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param ip_configurations: Gets or sets the IP configurations of the NIC. + :type ip_configurations: + list[~azure.mgmt.resourcemover.models.NicIpConfigurationResourceSettings] + :param enable_accelerated_networking: Gets or sets a value indicating + whether accelerated networking is enabled. + :type enable_accelerated_networking: bool + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'ip_configurations': {'key': 'ipConfigurations', 'type': '[NicIpConfigurationResourceSettings]'}, + 'enable_accelerated_networking': {'key': 'enableAcceleratedNetworking', 'type': 'bool'}, + } + + def __init__(self, **kwargs): + super(NetworkInterfaceResourceSettings, self).__init__(**kwargs) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.enable_accelerated_networking = kwargs.get('enable_accelerated_networking', None) + self.resource_type = 'Microsoft.Network/networkInterfaces' + + +class NetworkSecurityGroupResourceSettings(ResourceSettings): + """Defines the NSG resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param security_rules: Gets or sets Security rules of network security + group. + :type security_rules: + list[~azure.mgmt.resourcemover.models.NsgSecurityRule] + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[NsgSecurityRule]'}, + } + + def __init__(self, **kwargs): + super(NetworkSecurityGroupResourceSettings, self).__init__(**kwargs) + self.security_rules = kwargs.get('security_rules', None) + self.resource_type = 'Microsoft.Network/networkSecurityGroups' + + +class NicIpConfigurationResourceSettings(Model): + """Defines NIC IP configuration properties. + + :param name: Gets or sets the IP configuration name. + :type name: str + :param private_ip_address: Gets or sets the private IP address of the + network interface IP Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: Gets or sets the private IP address + allocation method. + :type private_ip_allocation_method: str + :param subnet: + :type subnet: ~azure.mgmt.resourcemover.models.SubnetReference + :param primary: Gets or sets a value indicating whether this IP + configuration is the primary. + :type primary: bool + :param load_balancer_backend_address_pools: Gets or sets the references of + the load balancer backend address pools. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.resourcemover.models.LoadBalancerBackendAddressPoolReference] + :param load_balancer_nat_rules: Gets or sets the references of the load + balancer NAT rules. + :type load_balancer_nat_rules: + list[~azure.mgmt.resourcemover.models.LoadBalancerNatRuleReference] + :param public_ip: + :type public_ip: ~azure.mgmt.resourcemover.models.PublicIpReference + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'privateIpAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'SubnetReference'}, + 'primary': {'key': 'primary', 'type': 'bool'}, + 'load_balancer_backend_address_pools': {'key': 'loadBalancerBackendAddressPools', 'type': '[LoadBalancerBackendAddressPoolReference]'}, + 'load_balancer_nat_rules': {'key': 'loadBalancerNatRules', 'type': '[LoadBalancerNatRuleReference]'}, + 'public_ip': {'key': 'publicIp', 'type': 'PublicIpReference'}, + } + + def __init__(self, **kwargs): + super(NicIpConfigurationResourceSettings, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.private_ip_allocation_method = kwargs.get('private_ip_allocation_method', None) + self.subnet = kwargs.get('subnet', None) + self.primary = kwargs.get('primary', None) + self.load_balancer_backend_address_pools = kwargs.get('load_balancer_backend_address_pools', None) + self.load_balancer_nat_rules = kwargs.get('load_balancer_nat_rules', None) + self.public_ip = kwargs.get('public_ip', None) + + +class NsgReference(AzureResourceReference): + """Defines reference to NSG. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NsgReference, self).__init__(**kwargs) + + +class NsgSecurityRule(Model): + """Security Rule data model for Network Security Groups. + + :param name: Gets or sets the Security rule name. + :type name: str + :param access: Gets or sets whether network traffic is allowed or denied. + Possible values are “Allow” and “Deny”. + :type access: str + :param description: Gets or sets a description for this rule. Restricted + to 140 chars. + :type description: str + :param destination_address_prefix: Gets or sets destination address + prefix. CIDR or source IP range. + A “*” can also be used to match all source IPs. Default tags such + as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. + :type destination_address_prefix: str + :param destination_port_range: Gets or sets Destination Port or Range. + Integer or range between + 0 and 65535. A “*” can also be used to match all ports. + :type destination_port_range: str + :param direction: Gets or sets the direction of the rule.InBound or + Outbound. The + direction specifies if rule will be evaluated on incoming or outgoing + traffic. + :type direction: str + :param priority: Gets or sets the priority of the rule. The value can be + between + 100 and 4096. The priority number must be unique for each rule in the + collection. + The lower the priority number, the higher the priority of the rule. + :type priority: int + :param protocol: Gets or sets Network protocol this rule applies to. Can + be Tcp, Udp or All(*). + :type protocol: str + :param source_address_prefix: Gets or sets source address prefix. CIDR or + source IP range. A + “*” can also be used to match all source IPs. Default tags such as + ‘VirtualNetwork’, + ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress + rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param source_port_range: Gets or sets Source Port or Range. Integer or + range between 0 and + 65535. A “*” can also be used to match all ports. + :type source_port_range: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'access': {'key': 'access', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(NsgSecurityRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.access = kwargs.get('access', None) + self.description = kwargs.get('description', None) + self.destination_address_prefix = kwargs.get('destination_address_prefix', None) + self.destination_port_range = kwargs.get('destination_port_range', None) + self.direction = kwargs.get('direction', None) + self.priority = kwargs.get('priority', None) + self.protocol = kwargs.get('protocol', None) + self.source_address_prefix = kwargs.get('source_address_prefix', None) + self.source_port_range = kwargs.get('source_port_range', None) + + +class OperationErrorAdditionalInfo(Model): + """The operation error info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The error type. + :vartype type: str + :ivar info: The operation error info. + :vartype info: ~azure.mgmt.resourcemover.models.MoveErrorInfo + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'MoveErrorInfo'}, + } + + def __init__(self, **kwargs): + super(OperationErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class OperationsDiscovery(Model): + """Operations discovery class. + + :param name: Gets or sets Name of the API. + The name of the operation being performed on this particular object. It + should + match the action name that appears in RBAC / the event service. + Examples of operations include: + * Microsoft.Compute/virtualMachine/capture/action + * Microsoft.Compute/virtualMachine/restart/action + * Microsoft.Compute/virtualMachine/write + * Microsoft.Compute/virtualMachine/read + * Microsoft.Compute/virtualMachine/delete + Each action should include, in order: + (1) Resource Provider Namespace + (2) Type hierarchy for which the action applies (e.g. server/databases for + a SQL + Azure database) + (3) Read, Write, Action or Delete indicating which type applies. If it is + a PUT/PATCH + on a collection or named value, Write should be used. + If it is a GET, Read should be used. If it is a DELETE, Delete should be + used. If it + is a POST, Action should be used. + As a note: all resource providers would need to include the "{Resource + Provider + Namespace}/register/action" operation in their response. + This API is used to register for their service, and should include details + about the + operation (e.g. a localized name for the resource provider + any special + considerations like PII release). + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: + :type display: ~azure.mgmt.resourcemover.models.Display + :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: + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'Display'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(OperationsDiscovery, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.is_data_action = kwargs.get('is_data_action', None) + self.display = kwargs.get('display', None) + self.origin = kwargs.get('origin', None) + self.properties = kwargs.get('properties', None) + + +class OperationsDiscoveryCollection(Model): + """Collection of ClientDiscovery details. + + :param value: Gets or sets the ClientDiscovery details. + :type value: list[~azure.mgmt.resourcemover.models.OperationsDiscovery] + :param next_link: Gets or sets the value of next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationsDiscovery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(OperationsDiscoveryCollection, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + self.next_link = kwargs.get('next_link', None) + + +class OperationStatus(Model): + """Operation status REST resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Operation name. + :vartype name: str + :ivar status: Status of the operation. ARM expects the terminal status to + be one of Succeeded/ Failed/ Canceled. All other values imply that the + operation is still running. + :vartype status: str + :ivar start_time: Start time. + :vartype start_time: str + :ivar end_time: End time. + :vartype end_time: str + :ivar error: Error stating all error details for the operation. + :vartype error: ~azure.mgmt.resourcemover.models.OperationStatusError + :ivar properties: Custom data. + :vartype properties: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'OperationStatusError'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs): + super(OperationStatus, self).__init__(**kwargs) + self.id = None + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None + self.properties = None + + +class OperationStatusError(Model): + """Class for operation status errors. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resourcemover.models.OperationStatusError] + :ivar additional_info: The additional info. + :vartype additional_info: + list[~azure.mgmt.resourcemover.models.OperationErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[OperationStatusError]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[OperationErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs): + super(OperationStatusError, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + self.additional_info = None + + +class PrepareRequest(Model): + """Defines the request body for initiate prepare operation. + + All required parameters must be populated in order to send to Azure. + + :param validate_only: Gets or sets a value indicating whether the + operation needs to only run pre-requisite. + :type validate_only: bool + :param move_resources: Required. Gets or sets the list of resource Id's, + by default it accepts move resource id's unless the input type is switched + via moveResourceInputType property. + :type move_resources: list[str] + :param move_resource_input_type: Possible values include: + 'MoveResourceId', 'MoveResourceSourceId' + :type move_resource_input_type: str or + ~azure.mgmt.resourcemover.models.MoveResourceInputType + """ + + _validation = { + 'move_resources': {'required': True}, + } + + _attribute_map = { + 'validate_only': {'key': 'validateOnly', 'type': 'bool'}, + 'move_resources': {'key': 'moveResources', 'type': '[str]'}, + 'move_resource_input_type': {'key': 'moveResourceInputType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PrepareRequest, self).__init__(**kwargs) + self.validate_only = kwargs.get('validate_only', None) + self.move_resources = kwargs.get('move_resources', None) + self.move_resource_input_type = kwargs.get('move_resource_input_type', None) + + +class PublicIPAddressResourceSettings(ResourceSettings): + """Defines the public IP address resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param domain_name_label: Gets or sets the domain name label. + :type domain_name_label: str + :param fqdn: Gets or sets the fully qualified domain name. + :type fqdn: str + :param public_ip_allocation_method: Gets or sets public IP allocation + method. + :type public_ip_allocation_method: str + :param sku: Gets or sets public IP sku. + :type sku: str + :param zones: Gets or sets public IP zones. + :type zones: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'public_ip_allocation_method': {'key': 'publicIpAllocationMethod', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PublicIPAddressResourceSettings, self).__init__(**kwargs) + self.domain_name_label = kwargs.get('domain_name_label', None) + self.fqdn = kwargs.get('fqdn', None) + self.public_ip_allocation_method = kwargs.get('public_ip_allocation_method', None) + self.sku = kwargs.get('sku', None) + self.zones = kwargs.get('zones', None) + self.resource_type = 'Microsoft.Network/publicIPAddresses' + + +class PublicIpReference(AzureResourceReference): + """Defines reference to a public IP. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(PublicIpReference, self).__init__(**kwargs) + + +class ResourceGroupResourceSettings(ResourceSettings): + """Defines the resource group resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceGroupResourceSettings, self).__init__(**kwargs) + self.resource_type = 'resourceGroups' + + +class ResourceMoveRequest(Model): + """Defines the request body for resource move operation. + + All required parameters must be populated in order to send to Azure. + + :param validate_only: Gets or sets a value indicating whether the + operation needs to only run pre-requisite. + :type validate_only: bool + :param move_resources: Required. Gets or sets the list of resource Id's, + by default it accepts move resource id's unless the input type is switched + via moveResourceInputType property. + :type move_resources: list[str] + :param move_resource_input_type: Possible values include: + 'MoveResourceId', 'MoveResourceSourceId' + :type move_resource_input_type: str or + ~azure.mgmt.resourcemover.models.MoveResourceInputType + """ + + _validation = { + 'move_resources': {'required': True}, + } + + _attribute_map = { + 'validate_only': {'key': 'validateOnly', 'type': 'bool'}, + 'move_resources': {'key': 'moveResources', 'type': '[str]'}, + 'move_resource_input_type': {'key': 'moveResourceInputType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(ResourceMoveRequest, self).__init__(**kwargs) + self.validate_only = kwargs.get('validate_only', None) + self.move_resources = kwargs.get('move_resources', None) + self.move_resource_input_type = kwargs.get('move_resource_input_type', None) + + +class SqlDatabaseResourceSettings(ResourceSettings): + """Defines the Sql Database resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param zone_redundant: Possible values include: 'Enable', 'Disable' + :type zone_redundant: str or + ~azure.mgmt.resourcemover.models.ZoneRedundant + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'zone_redundant': {'key': 'zoneRedundant', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlDatabaseResourceSettings, self).__init__(**kwargs) + self.zone_redundant = kwargs.get('zone_redundant', None) + self.resource_type = 'Microsoft.Sql/servers/databases' + + +class SqlElasticPoolResourceSettings(ResourceSettings): + """Defines the Sql ElasticPool resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param zone_redundant: Possible values include: 'Enable', 'Disable' + :type zone_redundant: str or + ~azure.mgmt.resourcemover.models.ZoneRedundant + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'zone_redundant': {'key': 'zoneRedundant', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlElasticPoolResourceSettings, self).__init__(**kwargs) + self.zone_redundant = kwargs.get('zone_redundant', None) + self.resource_type = 'Microsoft.Sql/servers/elasticPools' + + +class SqlServerResourceSettings(ResourceSettings): + """Defines the SQL Server resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SqlServerResourceSettings, self).__init__(**kwargs) + self.resource_type = 'Microsoft.Sql/servers' + + +class SubnetReference(ProxyResourceReference): + """Defines reference to subnet. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + :param name: Gets the name of the proxy resource on the target side. + :type name: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(SubnetReference, self).__init__(**kwargs) + + +class SubnetResourceSettings(Model): + """Defines the virtual network subnets resource settings. + + :param name: Gets or sets the Subnet name. + :type name: str + :param address_prefix: Gets or sets address prefix for the subnet. + :type address_prefix: str + :param network_security_group: + :type network_security_group: + ~azure.mgmt.resourcemover.models.NsgReference + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'NsgReference'}, + } + + def __init__(self, **kwargs): + super(SubnetResourceSettings, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.address_prefix = kwargs.get('address_prefix', None) + self.network_security_group = kwargs.get('network_security_group', None) + + +class Summary(Model): + """Summary item. + + :param count: Gets the count. + :type count: int + :param item: Gets the item. + :type item: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'item': {'key': 'item', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(Summary, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.item = kwargs.get('item', None) + + +class SummaryCollection(Model): + """Summary Collection. + + :param field_name: Gets or sets the field name on which summary is done. + :type field_name: str + :param summary: Gets or sets the list of summary items. + :type summary: list[~azure.mgmt.resourcemover.models.Summary] + """ + + _attribute_map = { + 'field_name': {'key': 'fieldName', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': '[Summary]'}, + } + + def __init__(self, **kwargs): + super(SummaryCollection, self).__init__(**kwargs) + self.field_name = kwargs.get('field_name', None) + self.summary = kwargs.get('summary', None) + + +class UnresolvedDependenciesFilter(Model): + """Unresolved dependencies contract. + + :param properties: + :type properties: + ~azure.mgmt.resourcemover.models.UnresolvedDependenciesFilterProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'UnresolvedDependenciesFilterProperties'}, + } + + def __init__(self, **kwargs): + super(UnresolvedDependenciesFilter, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class UnresolvedDependenciesFilterProperties(Model): + """UnresolvedDependenciesFilterProperties. + + :param count: The count of the resource. + :type count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(UnresolvedDependenciesFilterProperties, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + + +class UnresolvedDependency(Model): + """Unresolved dependency. + + :param count: Gets or sets the count. + :type count: int + :param id: Gets or sets the arm id of the dependency. + :type id: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(UnresolvedDependency, self).__init__(**kwargs) + self.count = kwargs.get('count', None) + self.id = kwargs.get('id', None) + + +class UpdateMoveCollectionRequest(Model): + """Defines the request body for updating move collection. + + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :param identity: + :type identity: ~azure.mgmt.resourcemover.models.Identity + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, **kwargs): + super(UpdateMoveCollectionRequest, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) + + +class VirtualMachineResourceSettings(ResourceSettings): + """Gets or sets the virtual machine resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param target_availability_zone: Gets or sets the target availability + zone. Possible values include: '1', '2', '3', 'NA' + :type target_availability_zone: str or + ~azure.mgmt.resourcemover.models.TargetAvailabilityZone + :param target_vm_size: Gets or sets the target virtual machine size. + :type target_vm_size: str + :param target_availability_set_id: Gets or sets the target availability + set id for virtual machines not in an availability set at source. + :type target_availability_set_id: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, + 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, + 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualMachineResourceSettings, self).__init__(**kwargs) + self.target_availability_zone = kwargs.get('target_availability_zone', None) + self.target_vm_size = kwargs.get('target_vm_size', None) + self.target_availability_set_id = kwargs.get('target_availability_set_id', None) + self.resource_type = 'Microsoft.Compute/virtualMachines' + + +class VirtualNetworkResourceSettings(ResourceSettings): + """Defines the virtual network resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param enable_ddos_protection: Gets or sets a value indicating whether + gets or sets whether the + DDOS protection should be switched on. + :type enable_ddos_protection: bool + :param address_space: Gets or sets the address prefixes for the virtual + network. + :type address_space: list[str] + :param dns_servers: Gets or sets DHCPOptions that contains an array of DNS + servers available to VMs + deployed in the virtual network. + :type dns_servers: list[str] + :param subnets: Gets or sets List of subnets in a VirtualNetwork. + :type subnets: + list[~azure.mgmt.resourcemover.models.SubnetResourceSettings] + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'enable_ddos_protection': {'key': 'enableDdosProtection', 'type': 'bool'}, + 'address_space': {'key': 'addressSpace', 'type': '[str]'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'subnets': {'key': 'subnets', 'type': '[SubnetResourceSettings]'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkResourceSettings, self).__init__(**kwargs) + self.enable_ddos_protection = kwargs.get('enable_ddos_protection', None) + self.address_space = kwargs.get('address_space', None) + self.dns_servers = kwargs.get('dns_servers', None) + self.subnets = kwargs.get('subnets', None) + self.resource_type = 'Microsoft.Network/virtualNetworks' diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models_py3.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models_py3.py new file mode 100644 index 000000000000..843e0369e02e --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_models_py3.py @@ -0,0 +1,2109 @@ +# 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 +from msrest.exceptions import HttpOperationError + + +class AffectedMoveResource(Model): + """The RP custom operation error info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: The affected move resource id. + :vartype id: str + :ivar source_id: The affected move resource source id. + :vartype source_id: str + :ivar move_resources: The affected move resources. + :vartype move_resources: + list[~azure.mgmt.resourcemover.models.AffectedMoveResource] + """ + + _validation = { + 'id': {'readonly': True}, + 'source_id': {'readonly': True}, + 'move_resources': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'source_id': {'key': 'sourceId', 'type': 'str'}, + 'move_resources': {'key': 'moveResources', 'type': '[AffectedMoveResource]'}, + } + + def __init__(self, **kwargs) -> None: + super(AffectedMoveResource, self).__init__(**kwargs) + self.id = None + self.source_id = None + self.move_resources = None + + +class AutomaticResolutionProperties(Model): + """Defines the properties for automatic resolution. + + :param move_resource_id: Gets the MoveResource ARM ID of + the dependent resource if the resolution type is Automatic. + :type move_resource_id: str + """ + + _attribute_map = { + 'move_resource_id': {'key': 'moveResourceId', 'type': 'str'}, + } + + def __init__(self, *, move_resource_id: str=None, **kwargs) -> None: + super(AutomaticResolutionProperties, self).__init__(**kwargs) + self.move_resource_id = move_resource_id + + +class ResourceSettings(Model): + """Gets or sets the resource settings. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: VirtualMachineResourceSettings, + AvailabilitySetResourceSettings, VirtualNetworkResourceSettings, + NetworkInterfaceResourceSettings, NetworkSecurityGroupResourceSettings, + LoadBalancerResourceSettings, SqlServerResourceSettings, + SqlElasticPoolResourceSettings, SqlDatabaseResourceSettings, + ResourceGroupResourceSettings, PublicIPAddressResourceSettings, + KeyVaultResourceSettings, DiskEncryptionSetResourceSettings + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + _subtype_map = { + 'resource_type': {'Microsoft.Compute/virtualMachines': 'VirtualMachineResourceSettings', 'Microsoft.Compute/availabilitySets': 'AvailabilitySetResourceSettings', 'Microsoft.Network/virtualNetworks': 'VirtualNetworkResourceSettings', 'Microsoft.Network/networkInterfaces': 'NetworkInterfaceResourceSettings', 'Microsoft.Network/networkSecurityGroups': 'NetworkSecurityGroupResourceSettings', 'Microsoft.Network/loadBalancers': 'LoadBalancerResourceSettings', 'Microsoft.Sql/servers': 'SqlServerResourceSettings', 'Microsoft.Sql/servers/elasticPools': 'SqlElasticPoolResourceSettings', 'Microsoft.Sql/servers/databases': 'SqlDatabaseResourceSettings', 'resourceGroups': 'ResourceGroupResourceSettings', 'Microsoft.Network/publicIPAddresses': 'PublicIPAddressResourceSettings', 'Microsoft.KeyVault/vaults': 'KeyVaultResourceSettings', 'Microsoft.Compute/diskEncryptionSets': 'DiskEncryptionSetResourceSettings'} + } + + def __init__(self, *, target_resource_name: str, **kwargs) -> None: + super(ResourceSettings, self).__init__(**kwargs) + self.target_resource_name = target_resource_name + self.resource_type = None + + +class AvailabilitySetResourceSettings(ResourceSettings): + """Gets or sets the availability set resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param fault_domain: Gets or sets the target fault domain. + :type fault_domain: int + :param update_domain: Gets or sets the target update domain. + :type update_domain: int + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + 'fault_domain': {'minimum': 1}, + 'update_domain': {'maximum': 20, 'minimum': 1}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'fault_domain': {'key': 'faultDomain', 'type': 'int'}, + 'update_domain': {'key': 'updateDomain', 'type': 'int'}, + } + + def __init__(self, *, target_resource_name: str, fault_domain: int=None, update_domain: int=None, **kwargs) -> None: + super(AvailabilitySetResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.fault_domain = fault_domain + self.update_domain = update_domain + self.resource_type = 'Microsoft.Compute/availabilitySets' + + +class AzureResourceReference(Model): + """Defines reference to an Azure resource. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + } + + def __init__(self, *, source_arm_resource_id: str, **kwargs) -> None: + super(AzureResourceReference, self).__init__(**kwargs) + self.source_arm_resource_id = source_arm_resource_id + + +class BulkRemoveRequest(Model): + """Defines the request body for bulk remove of move resources operation. + + :param validate_only: Gets or sets a value indicating whether the + operation needs to only run pre-requisite. + :type validate_only: bool + :param move_resources: Gets or sets the list of resource Id's, by default + it accepts move resource id's unless the input type is switched via + moveResourceInputType property. + :type move_resources: list[str] + :param move_resource_input_type: Possible values include: + 'MoveResourceId', 'MoveResourceSourceId' + :type move_resource_input_type: str or + ~azure.mgmt.resourcemover.models.MoveResourceInputType + """ + + _attribute_map = { + 'validate_only': {'key': 'validateOnly', 'type': 'bool'}, + 'move_resources': {'key': 'moveResources', 'type': '[str]'}, + 'move_resource_input_type': {'key': 'moveResourceInputType', 'type': 'str'}, + } + + def __init__(self, *, validate_only: bool=None, move_resources=None, move_resource_input_type=None, **kwargs) -> None: + super(BulkRemoveRequest, self).__init__(**kwargs) + self.validate_only = validate_only + self.move_resources = move_resources + self.move_resource_input_type = move_resource_input_type + + +class CloudError(Model): + """An error response from the service. + + :param error: Cloud error body. + :type error: ~azure.mgmt.resourcemover.models.CloudErrorBody + """ + + _attribute_map = { + 'error': {'key': 'error', 'type': 'CloudErrorBody'}, + } + + def __init__(self, *, error=None, **kwargs) -> None: + super(CloudError, self).__init__(**kwargs) + self.error = error + + +class CloudErrorException(HttpOperationError): + """Server responsed with exception of type: 'CloudError'. + + :param deserialize: A deserializer + :param response: Server response to be deserialized. + """ + + def __init__(self, deserialize, response, *args): + + super(CloudErrorException, self).__init__(deserialize, response, 'CloudError', *args) + + +class CloudErrorBody(Model): + """An error response from the service. + + :param code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :type code: str + :param message: A message describing the error, intended to be suitable + for display in a user interface. + :type message: str + :param target: The target of the particular error. For example, the name + of the property in error. + :type target: str + :param details: A list of additional details about the error. + :type details: list[~azure.mgmt.resourcemover.models.CloudErrorBody] + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[CloudErrorBody]'}, + } + + def __init__(self, *, code: str=None, message: str=None, target: str=None, details=None, **kwargs) -> None: + super(CloudErrorBody, self).__init__(**kwargs) + self.code = code + self.message = message + self.target = target + self.details = details + + +class CommitRequest(Model): + """Defines the request body for commit operation. + + All required parameters must be populated in order to send to Azure. + + :param validate_only: Gets or sets a value indicating whether the + operation needs to only run pre-requisite. + :type validate_only: bool + :param move_resources: Required. Gets or sets the list of resource Id's, + by default it accepts move resource id's unless the input type is switched + via moveResourceInputType property. + :type move_resources: list[str] + :param move_resource_input_type: Possible values include: + 'MoveResourceId', 'MoveResourceSourceId' + :type move_resource_input_type: str or + ~azure.mgmt.resourcemover.models.MoveResourceInputType + """ + + _validation = { + 'move_resources': {'required': True}, + } + + _attribute_map = { + 'validate_only': {'key': 'validateOnly', 'type': 'bool'}, + 'move_resources': {'key': 'moveResources', 'type': '[str]'}, + 'move_resource_input_type': {'key': 'moveResourceInputType', 'type': 'str'}, + } + + def __init__(self, *, move_resources, validate_only: bool=None, move_resource_input_type=None, **kwargs) -> None: + super(CommitRequest, self).__init__(**kwargs) + self.validate_only = validate_only + self.move_resources = move_resources + self.move_resource_input_type = move_resource_input_type + + +class DiscardRequest(Model): + """Defines the request body for discard operation. + + All required parameters must be populated in order to send to Azure. + + :param validate_only: Gets or sets a value indicating whether the + operation needs to only run pre-requisite. + :type validate_only: bool + :param move_resources: Required. Gets or sets the list of resource Id's, + by default it accepts move resource id's unless the input type is switched + via moveResourceInputType property. + :type move_resources: list[str] + :param move_resource_input_type: Possible values include: + 'MoveResourceId', 'MoveResourceSourceId' + :type move_resource_input_type: str or + ~azure.mgmt.resourcemover.models.MoveResourceInputType + """ + + _validation = { + 'move_resources': {'required': True}, + } + + _attribute_map = { + 'validate_only': {'key': 'validateOnly', 'type': 'bool'}, + 'move_resources': {'key': 'moveResources', 'type': '[str]'}, + 'move_resource_input_type': {'key': 'moveResourceInputType', 'type': 'str'}, + } + + def __init__(self, *, move_resources, validate_only: bool=None, move_resource_input_type=None, **kwargs) -> None: + super(DiscardRequest, self).__init__(**kwargs) + self.validate_only = validate_only + self.move_resources = move_resources + self.move_resource_input_type = move_resource_input_type + + +class DiskEncryptionSetResourceSettings(ResourceSettings): + """Defines the disk encryption set resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, *, target_resource_name: str, **kwargs) -> None: + super(DiskEncryptionSetResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.resource_type = 'Microsoft.Compute/diskEncryptionSets' + + +class Display(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 the 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. + e.g. "Microsoft Monitoring Insights" or "Microsoft Compute.". + :type provider: str + :param resource: Gets or sets the resource. + The localized friendly form of the resource related to this + action/operation – it + should match the public documentation for the resource provider. + It should use Title Casing. + This value should be unique for a particular URL type (e.g. nested types + should *not* + reuse their parent’s display.resource field) + e.g. "Virtual Machines" or "Scheduler Job Collections", or "Virtual + Machine VM Sizes" + or "Scheduler Jobs". + :type resource: str + :param operation: Gets or sets the 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. + Prescriptive guidance: Read Create or Update Delete 'ActionName'. + :type operation: str + :param description: Gets or sets the 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. + Prescriptive guidance for namespace: + Read any 'display.provider' resource + Create or Update any 'display.provider' resource + Delete any 'display.provider' resource + Perform any other action on any 'display.provider' resource + Prescriptive guidance for namespace: + Read any 'display.resource' Create or Update any 'display.resource' + Delete any + 'display.resource' 'ActionName' any 'display.resources'. + :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(Display, self).__init__(**kwargs) + self.provider = provider + self.resource = resource + self.operation = operation + self.description = description + + +class Identity(Model): + """Defines the MSI properties of the Move Collection. + + :param type: Possible values include: 'None', 'SystemAssigned', + 'UserAssigned' + :type type: str or ~azure.mgmt.resourcemover.models.ResourceIdentityType + :param principal_id: Gets or sets the principal id. + :type principal_id: str + :param tenant_id: Gets or sets the tenant id. + :type tenant_id: str + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'tenant_id': {'key': 'tenantId', 'type': 'str'}, + } + + def __init__(self, *, type=None, principal_id: str=None, tenant_id: str=None, **kwargs) -> None: + super(Identity, self).__init__(**kwargs) + self.type = type + self.principal_id = principal_id + self.tenant_id = tenant_id + + +class JobStatus(Model): + """Defines the job status. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param job_name: Possible values include: 'InitialSync' + :type job_name: str or ~azure.mgmt.resourcemover.models.JobName + :ivar job_progress: Gets or sets the monitoring job percentage. + :vartype job_progress: str + """ + + _validation = { + 'job_progress': {'readonly': True}, + } + + _attribute_map = { + 'job_name': {'key': 'jobName', 'type': 'str'}, + 'job_progress': {'key': 'jobProgress', 'type': 'str'}, + } + + def __init__(self, *, job_name=None, **kwargs) -> None: + super(JobStatus, self).__init__(**kwargs) + self.job_name = job_name + self.job_progress = None + + +class KeyVaultResourceSettings(ResourceSettings): + """Defines the key vault resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, *, target_resource_name: str, **kwargs) -> None: + super(KeyVaultResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.resource_type = 'Microsoft.KeyVault/vaults' + + +class LBBackendAddressPoolResourceSettings(Model): + """Defines load balancer backend address pool properties. + + :param name: Gets or sets the backend address pool name. + :type name: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, **kwargs) -> None: + super(LBBackendAddressPoolResourceSettings, self).__init__(**kwargs) + self.name = name + + +class LBFrontendIPConfigurationResourceSettings(Model): + """Defines load balancer frontend IP configuration properties. + + :param name: Gets or sets the frontend IP configuration name. + :type name: str + :param private_ip_address: Gets or sets the IP address of the Load + Balancer.This is only specified if a specific + private IP address shall be allocated from the subnet specified in + subnetRef. + :type private_ip_address: str + :param private_ip_allocation_method: Gets or sets PrivateIP allocation + method (Static/Dynamic). + :type private_ip_allocation_method: str + :param subnet: + :type subnet: ~azure.mgmt.resourcemover.models.SubnetReference + :param zones: Gets or sets the csv list of zones. + :type zones: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'privateIpAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'SubnetReference'}, + 'zones': {'key': 'zones', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, private_ip_address: str=None, private_ip_allocation_method: str=None, subnet=None, zones: str=None, **kwargs) -> None: + super(LBFrontendIPConfigurationResourceSettings, self).__init__(**kwargs) + self.name = name + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.zones = zones + + +class ProxyResourceReference(AzureResourceReference): + """Defines reference to a proxy resource. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + :param name: Gets the name of the proxy resource on the target side. + :type name: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, source_arm_resource_id: str, name: str=None, **kwargs) -> None: + super(ProxyResourceReference, self).__init__(source_arm_resource_id=source_arm_resource_id, **kwargs) + self.name = name + + +class LoadBalancerBackendAddressPoolReference(ProxyResourceReference): + """Defines reference to load balancer backend address pools. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + :param name: Gets the name of the proxy resource on the target side. + :type name: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, source_arm_resource_id: str, name: str=None, **kwargs) -> None: + super(LoadBalancerBackendAddressPoolReference, self).__init__(source_arm_resource_id=source_arm_resource_id, name=name, **kwargs) + + +class LoadBalancerNatRuleReference(ProxyResourceReference): + """Defines reference to load balancer NAT rules. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + :param name: Gets the name of the proxy resource on the target side. + :type name: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, source_arm_resource_id: str, name: str=None, **kwargs) -> None: + super(LoadBalancerNatRuleReference, self).__init__(source_arm_resource_id=source_arm_resource_id, name=name, **kwargs) + + +class LoadBalancerResourceSettings(ResourceSettings): + """Defines the load balancer resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param sku: Gets or sets load balancer sku (Basic/Standard). + :type sku: str + :param frontend_ip_configurations: Gets or sets the frontend IP + configurations of the load balancer. + :type frontend_ip_configurations: + list[~azure.mgmt.resourcemover.models.LBFrontendIPConfigurationResourceSettings] + :param backend_address_pools: Gets or sets the backend address pools of + the load balancer. + :type backend_address_pools: + list[~azure.mgmt.resourcemover.models.LBBackendAddressPoolResourceSettings] + :param zones: Gets or sets the csv list of zones common for all frontend + IP configurations. Note this is given + precedence only if frontend IP configurations settings are not present. + :type zones: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'frontend_ip_configurations': {'key': 'frontendIPConfigurations', 'type': '[LBFrontendIPConfigurationResourceSettings]'}, + 'backend_address_pools': {'key': 'backendAddressPools', 'type': '[LBBackendAddressPoolResourceSettings]'}, + 'zones': {'key': 'zones', 'type': 'str'}, + } + + def __init__(self, *, target_resource_name: str, sku: str=None, frontend_ip_configurations=None, backend_address_pools=None, zones: str=None, **kwargs) -> None: + super(LoadBalancerResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.sku = sku + self.frontend_ip_configurations = frontend_ip_configurations + self.backend_address_pools = backend_address_pools + self.zones = zones + self.resource_type = 'Microsoft.Network/loadBalancers' + + +class ManualResolutionProperties(Model): + """Defines the properties for manual resolution. + + :param target_id: Gets or sets the target resource ARM ID of the dependent + resource if the resource type is Manual. + :type target_id: str + """ + + _attribute_map = { + 'target_id': {'key': 'targetId', 'type': 'str'}, + } + + def __init__(self, *, target_id: str=None, **kwargs) -> None: + super(ManualResolutionProperties, self).__init__(**kwargs) + self.target_id = target_id + + +class MoveCollection(Model): + """Define the move collection. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :ivar etag: The etag of the resource. + :vartype etag: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param location: The geo-location where the resource lives. + :type location: str + :param identity: + :type identity: ~azure.mgmt.resourcemover.models.Identity + :param properties: + :type properties: + ~azure.mgmt.resourcemover.models.MoveCollectionProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + 'properties': {'key': 'properties', 'type': 'MoveCollectionProperties'}, + } + + def __init__(self, *, tags=None, location: str=None, identity=None, properties=None, **kwargs) -> None: + super(MoveCollection, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.etag = None + self.tags = tags + self.location = location + self.identity = identity + self.properties = properties + + +class MoveCollectionProperties(Model): + """Defines the move collection properties. + + 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. + + :param source_region: Required. Gets or sets the source region. + :type source_region: str + :param target_region: Required. Gets or sets the target region. + :type target_region: str + :param provisioning_state: Possible values include: 'Succeeded', + 'Updating', 'Creating', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.resourcemover.models.ProvisioningState + :ivar errors: Defines the move collection errors. + :vartype errors: + ~azure.mgmt.resourcemover.models.MoveCollectionPropertiesErrors + """ + + _validation = { + 'source_region': {'required': True}, + 'target_region': {'required': True}, + 'errors': {'readonly': True}, + } + + _attribute_map = { + 'source_region': {'key': 'sourceRegion', 'type': 'str'}, + 'target_region': {'key': 'targetRegion', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'errors': {'key': 'errors', 'type': 'MoveCollectionPropertiesErrors'}, + } + + def __init__(self, *, source_region: str, target_region: str, provisioning_state=None, **kwargs) -> None: + super(MoveCollectionProperties, self).__init__(**kwargs) + self.source_region = source_region + self.target_region = target_region + self.provisioning_state = provisioning_state + self.errors = None + + +class MoveResourceError(Model): + """An error response from the azure resource mover service. + + :param properties: The move resource error body. + :type properties: ~azure.mgmt.resourcemover.models.MoveResourceErrorBody + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'MoveResourceErrorBody'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(MoveResourceError, self).__init__(**kwargs) + self.properties = properties + + +class MoveCollectionPropertiesErrors(MoveResourceError): + """Defines the move collection errors. + + :param properties: The move resource error body. + :type properties: ~azure.mgmt.resourcemover.models.MoveResourceErrorBody + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'MoveResourceErrorBody'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(MoveCollectionPropertiesErrors, self).__init__(properties=properties, **kwargs) + + +class MoveErrorInfo(Model): + """The move custom error info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar move_resources: The affected move resources. + :vartype move_resources: + list[~azure.mgmt.resourcemover.models.AffectedMoveResource] + """ + + _validation = { + 'move_resources': {'readonly': True}, + } + + _attribute_map = { + 'move_resources': {'key': 'moveResources', 'type': '[AffectedMoveResource]'}, + } + + def __init__(self, **kwargs) -> None: + super(MoveErrorInfo, self).__init__(**kwargs) + self.move_resources = None + + +class MoveResource(Model): + """Defines the move resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Fully qualified resource Id for the resource. + :vartype id: str + :ivar name: The name of the resource + :vartype name: str + :ivar type: The type of the resource. + :vartype type: str + :param properties: + :type properties: ~azure.mgmt.resourcemover.models.MoveResourceProperties + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'MoveResourceProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(MoveResource, self).__init__(**kwargs) + self.id = None + self.name = None + self.type = None + self.properties = properties + + +class MoveResourceDependency(Model): + """Defines the dependency of the move resource. + + :param id: Gets the source ARM ID of the dependent resource. + :type id: str + :param resolution_status: Gets the dependency resolution status. + :type resolution_status: str + :param resolution_type: Possible values include: 'Manual', 'Automatic' + :type resolution_type: str or + ~azure.mgmt.resourcemover.models.ResolutionType + :param dependency_type: Possible values include: 'RequiredForPrepare', + 'RequiredForMove' + :type dependency_type: str or + ~azure.mgmt.resourcemover.models.DependencyType + :param manual_resolution: + :type manual_resolution: + ~azure.mgmt.resourcemover.models.ManualResolutionProperties + :param automatic_resolution: + :type automatic_resolution: + ~azure.mgmt.resourcemover.models.AutomaticResolutionProperties + :param is_optional: Gets or sets a value indicating whether the dependency + is optional. + :type is_optional: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'resolution_status': {'key': 'resolutionStatus', 'type': 'str'}, + 'resolution_type': {'key': 'resolutionType', 'type': 'str'}, + 'dependency_type': {'key': 'dependencyType', 'type': 'str'}, + 'manual_resolution': {'key': 'manualResolution', 'type': 'ManualResolutionProperties'}, + 'automatic_resolution': {'key': 'automaticResolution', 'type': 'AutomaticResolutionProperties'}, + 'is_optional': {'key': 'isOptional', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, resolution_status: str=None, resolution_type=None, dependency_type=None, manual_resolution=None, automatic_resolution=None, is_optional: str=None, **kwargs) -> None: + super(MoveResourceDependency, self).__init__(**kwargs) + self.id = id + self.resolution_status = resolution_status + self.resolution_type = resolution_type + self.dependency_type = dependency_type + self.manual_resolution = manual_resolution + self.automatic_resolution = automatic_resolution + self.is_optional = is_optional + + +class MoveResourceDependencyOverride(Model): + """Defines the dependency override of the move resource. + + :param id: Gets or sets the ARM ID of the dependent resource. + :type id: str + :param target_id: Gets or sets the resource ARM id of either the + MoveResource or the resource ARM ID of + the dependent resource. + :type target_id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'target_id': {'key': 'targetId', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, target_id: str=None, **kwargs) -> None: + super(MoveResourceDependencyOverride, self).__init__(**kwargs) + self.id = id + self.target_id = target_id + + +class MoveResourceErrorBody(Model): + """An error response from the Azure Migrate service. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: An identifier for the error. Codes are invariant and are + intended to be consumed programmatically. + :vartype code: str + :ivar message: A message describing the error, intended to be suitable for + display in a user interface. + :vartype message: str + :ivar target: The target of the particular error. For example, the name of + the property in error. + :vartype target: str + :ivar details: A list of additional details about the error. + :vartype details: + list[~azure.mgmt.resourcemover.models.MoveResourceErrorBody] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'target': {'readonly': True}, + 'details': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'target': {'key': 'target', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[MoveResourceErrorBody]'}, + } + + def __init__(self, **kwargs) -> None: + super(MoveResourceErrorBody, self).__init__(**kwargs) + self.code = None + self.message = None + self.target = None + self.details = None + + +class MoveResourceFilter(Model): + """Move resource filter. + + :param properties: + :type properties: + ~azure.mgmt.resourcemover.models.MoveResourceFilterProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'MoveResourceFilterProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(MoveResourceFilter, self).__init__(**kwargs) + self.properties = properties + + +class MoveResourceFilterProperties(Model): + """MoveResourceFilterProperties. + + :param provisioning_state: The provisioning state. + :type provisioning_state: str + """ + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + } + + def __init__(self, *, provisioning_state: str=None, **kwargs) -> None: + super(MoveResourceFilterProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + + +class MoveResourceProperties(Model): + """Defines the move resource properties. + + 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. + + :param provisioning_state: Possible values include: 'Succeeded', + 'Updating', 'Creating', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.resourcemover.models.ProvisioningState + :param source_id: Required. Gets or sets the Source ARM Id of the + resource. + :type source_id: str + :ivar target_id: Gets or sets the Target ARM Id of the resource. + :vartype target_id: str + :param existing_target_id: Gets or sets the existing target ARM Id of the + resource. + :type existing_target_id: str + :param resource_settings: Gets or sets the resource settings. + :type resource_settings: ~azure.mgmt.resourcemover.models.ResourceSettings + :ivar source_resource_settings: Gets or sets the source resource settings. + :vartype source_resource_settings: + ~azure.mgmt.resourcemover.models.ResourceSettings + :ivar move_status: Defines the move resource status. + :vartype move_status: + ~azure.mgmt.resourcemover.models.MoveResourcePropertiesMoveStatus + :ivar depends_on: Gets or sets the move resource dependencies. + :vartype depends_on: + list[~azure.mgmt.resourcemover.models.MoveResourceDependency] + :param depends_on_overrides: Gets or sets the move resource dependencies + overrides. + :type depends_on_overrides: + list[~azure.mgmt.resourcemover.models.MoveResourceDependencyOverride] + :ivar is_resolve_required: Gets a value indicating whether the resolve + action is required over the move collection. + :vartype is_resolve_required: bool + :ivar errors: Defines the move resource errors. + :vartype errors: + ~azure.mgmt.resourcemover.models.MoveResourcePropertiesErrors + """ + + _validation = { + 'source_id': {'required': True}, + 'target_id': {'readonly': True}, + 'source_resource_settings': {'readonly': True}, + 'move_status': {'readonly': True}, + 'depends_on': {'readonly': True}, + 'is_resolve_required': {'readonly': True}, + 'errors': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'source_id': {'key': 'sourceId', 'type': 'str'}, + 'target_id': {'key': 'targetId', 'type': 'str'}, + 'existing_target_id': {'key': 'existingTargetId', 'type': 'str'}, + 'resource_settings': {'key': 'resourceSettings', 'type': 'ResourceSettings'}, + 'source_resource_settings': {'key': 'sourceResourceSettings', 'type': 'ResourceSettings'}, + 'move_status': {'key': 'moveStatus', 'type': 'MoveResourcePropertiesMoveStatus'}, + 'depends_on': {'key': 'dependsOn', 'type': '[MoveResourceDependency]'}, + 'depends_on_overrides': {'key': 'dependsOnOverrides', 'type': '[MoveResourceDependencyOverride]'}, + 'is_resolve_required': {'key': 'isResolveRequired', 'type': 'bool'}, + 'errors': {'key': 'errors', 'type': 'MoveResourcePropertiesErrors'}, + } + + def __init__(self, *, source_id: str, provisioning_state=None, existing_target_id: str=None, resource_settings=None, depends_on_overrides=None, **kwargs) -> None: + super(MoveResourceProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.source_id = source_id + self.target_id = None + self.existing_target_id = existing_target_id + self.resource_settings = resource_settings + self.source_resource_settings = None + self.move_status = None + self.depends_on = None + self.depends_on_overrides = depends_on_overrides + self.is_resolve_required = None + self.errors = None + + +class MoveResourcePropertiesErrors(MoveResourceError): + """Defines the move resource errors. + + :param properties: The move resource error body. + :type properties: ~azure.mgmt.resourcemover.models.MoveResourceErrorBody + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'MoveResourceErrorBody'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(MoveResourcePropertiesErrors, self).__init__(properties=properties, **kwargs) + + +class MoveResourceStatus(Model): + """Defines the move resource status. + + :param move_state: Possible values include: 'AssignmentPending', + 'PreparePending', 'PrepareInProgress', 'PrepareFailed', 'MovePending', + 'MoveInProgress', 'MoveFailed', 'DiscardInProgress', 'DiscardFailed', + 'CommitPending', 'CommitInProgress', 'CommitFailed', 'Committed', + 'DeleteSourcePending', 'ResourceMoveCompleted' + :type move_state: str or ~azure.mgmt.resourcemover.models.MoveState + :param job_status: + :type job_status: ~azure.mgmt.resourcemover.models.JobStatus + :param errors: + :type errors: ~azure.mgmt.resourcemover.models.MoveResourceError + """ + + _attribute_map = { + 'move_state': {'key': 'moveState', 'type': 'str'}, + 'job_status': {'key': 'jobStatus', 'type': 'JobStatus'}, + 'errors': {'key': 'errors', 'type': 'MoveResourceError'}, + } + + def __init__(self, *, move_state=None, job_status=None, errors=None, **kwargs) -> None: + super(MoveResourceStatus, self).__init__(**kwargs) + self.move_state = move_state + self.job_status = job_status + self.errors = errors + + +class MoveResourcePropertiesMoveStatus(MoveResourceStatus): + """Defines the move resource status. + + :param move_state: Possible values include: 'AssignmentPending', + 'PreparePending', 'PrepareInProgress', 'PrepareFailed', 'MovePending', + 'MoveInProgress', 'MoveFailed', 'DiscardInProgress', 'DiscardFailed', + 'CommitPending', 'CommitInProgress', 'CommitFailed', 'Committed', + 'DeleteSourcePending', 'ResourceMoveCompleted' + :type move_state: str or ~azure.mgmt.resourcemover.models.MoveState + :param job_status: + :type job_status: ~azure.mgmt.resourcemover.models.JobStatus + :param errors: + :type errors: ~azure.mgmt.resourcemover.models.MoveResourceError + """ + + _attribute_map = { + 'move_state': {'key': 'moveState', 'type': 'str'}, + 'job_status': {'key': 'jobStatus', 'type': 'JobStatus'}, + 'errors': {'key': 'errors', 'type': 'MoveResourceError'}, + } + + def __init__(self, *, move_state=None, job_status=None, errors=None, **kwargs) -> None: + super(MoveResourcePropertiesMoveStatus, self).__init__(move_state=move_state, job_status=job_status, errors=errors, **kwargs) + + +class NetworkInterfaceResourceSettings(ResourceSettings): + """Defines the network interface resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param ip_configurations: Gets or sets the IP configurations of the NIC. + :type ip_configurations: + list[~azure.mgmt.resourcemover.models.NicIpConfigurationResourceSettings] + :param enable_accelerated_networking: Gets or sets a value indicating + whether accelerated networking is enabled. + :type enable_accelerated_networking: bool + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'ip_configurations': {'key': 'ipConfigurations', 'type': '[NicIpConfigurationResourceSettings]'}, + 'enable_accelerated_networking': {'key': 'enableAcceleratedNetworking', 'type': 'bool'}, + } + + def __init__(self, *, target_resource_name: str, ip_configurations=None, enable_accelerated_networking: bool=None, **kwargs) -> None: + super(NetworkInterfaceResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.ip_configurations = ip_configurations + self.enable_accelerated_networking = enable_accelerated_networking + self.resource_type = 'Microsoft.Network/networkInterfaces' + + +class NetworkSecurityGroupResourceSettings(ResourceSettings): + """Defines the NSG resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param security_rules: Gets or sets Security rules of network security + group. + :type security_rules: + list[~azure.mgmt.resourcemover.models.NsgSecurityRule] + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'security_rules': {'key': 'securityRules', 'type': '[NsgSecurityRule]'}, + } + + def __init__(self, *, target_resource_name: str, security_rules=None, **kwargs) -> None: + super(NetworkSecurityGroupResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.security_rules = security_rules + self.resource_type = 'Microsoft.Network/networkSecurityGroups' + + +class NicIpConfigurationResourceSettings(Model): + """Defines NIC IP configuration properties. + + :param name: Gets or sets the IP configuration name. + :type name: str + :param private_ip_address: Gets or sets the private IP address of the + network interface IP Configuration. + :type private_ip_address: str + :param private_ip_allocation_method: Gets or sets the private IP address + allocation method. + :type private_ip_allocation_method: str + :param subnet: + :type subnet: ~azure.mgmt.resourcemover.models.SubnetReference + :param primary: Gets or sets a value indicating whether this IP + configuration is the primary. + :type primary: bool + :param load_balancer_backend_address_pools: Gets or sets the references of + the load balancer backend address pools. + :type load_balancer_backend_address_pools: + list[~azure.mgmt.resourcemover.models.LoadBalancerBackendAddressPoolReference] + :param load_balancer_nat_rules: Gets or sets the references of the load + balancer NAT rules. + :type load_balancer_nat_rules: + list[~azure.mgmt.resourcemover.models.LoadBalancerNatRuleReference] + :param public_ip: + :type public_ip: ~azure.mgmt.resourcemover.models.PublicIpReference + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'private_ip_address': {'key': 'privateIpAddress', 'type': 'str'}, + 'private_ip_allocation_method': {'key': 'privateIpAllocationMethod', 'type': 'str'}, + 'subnet': {'key': 'subnet', 'type': 'SubnetReference'}, + 'primary': {'key': 'primary', 'type': 'bool'}, + 'load_balancer_backend_address_pools': {'key': 'loadBalancerBackendAddressPools', 'type': '[LoadBalancerBackendAddressPoolReference]'}, + 'load_balancer_nat_rules': {'key': 'loadBalancerNatRules', 'type': '[LoadBalancerNatRuleReference]'}, + 'public_ip': {'key': 'publicIp', 'type': 'PublicIpReference'}, + } + + def __init__(self, *, name: str=None, private_ip_address: str=None, private_ip_allocation_method: str=None, subnet=None, primary: bool=None, load_balancer_backend_address_pools=None, load_balancer_nat_rules=None, public_ip=None, **kwargs) -> None: + super(NicIpConfigurationResourceSettings, self).__init__(**kwargs) + self.name = name + self.private_ip_address = private_ip_address + self.private_ip_allocation_method = private_ip_allocation_method + self.subnet = subnet + self.primary = primary + self.load_balancer_backend_address_pools = load_balancer_backend_address_pools + self.load_balancer_nat_rules = load_balancer_nat_rules + self.public_ip = public_ip + + +class NsgReference(AzureResourceReference): + """Defines reference to NSG. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + } + + def __init__(self, *, source_arm_resource_id: str, **kwargs) -> None: + super(NsgReference, self).__init__(source_arm_resource_id=source_arm_resource_id, **kwargs) + + +class NsgSecurityRule(Model): + """Security Rule data model for Network Security Groups. + + :param name: Gets or sets the Security rule name. + :type name: str + :param access: Gets or sets whether network traffic is allowed or denied. + Possible values are “Allow” and “Deny”. + :type access: str + :param description: Gets or sets a description for this rule. Restricted + to 140 chars. + :type description: str + :param destination_address_prefix: Gets or sets destination address + prefix. CIDR or source IP range. + A “*” can also be used to match all source IPs. Default tags such + as ‘VirtualNetwork’, ‘AzureLoadBalancer’ and ‘Internet’ can also be used. + :type destination_address_prefix: str + :param destination_port_range: Gets or sets Destination Port or Range. + Integer or range between + 0 and 65535. A “*” can also be used to match all ports. + :type destination_port_range: str + :param direction: Gets or sets the direction of the rule.InBound or + Outbound. The + direction specifies if rule will be evaluated on incoming or outgoing + traffic. + :type direction: str + :param priority: Gets or sets the priority of the rule. The value can be + between + 100 and 4096. The priority number must be unique for each rule in the + collection. + The lower the priority number, the higher the priority of the rule. + :type priority: int + :param protocol: Gets or sets Network protocol this rule applies to. Can + be Tcp, Udp or All(*). + :type protocol: str + :param source_address_prefix: Gets or sets source address prefix. CIDR or + source IP range. A + “*” can also be used to match all source IPs. Default tags such as + ‘VirtualNetwork’, + ‘AzureLoadBalancer’ and ‘Internet’ can also be used. If this is an ingress + rule, specifies where network traffic originates from. + :type source_address_prefix: str + :param source_port_range: Gets or sets Source Port or Range. Integer or + range between 0 and + 65535. A “*” can also be used to match all ports. + :type source_port_range: str + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'access': {'key': 'access', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'destination_address_prefix': {'key': 'destinationAddressPrefix', 'type': 'str'}, + 'destination_port_range': {'key': 'destinationPortRange', 'type': 'str'}, + 'direction': {'key': 'direction', 'type': 'str'}, + 'priority': {'key': 'priority', 'type': 'int'}, + 'protocol': {'key': 'protocol', 'type': 'str'}, + 'source_address_prefix': {'key': 'sourceAddressPrefix', 'type': 'str'}, + 'source_port_range': {'key': 'sourcePortRange', 'type': 'str'}, + } + + def __init__(self, *, name: str=None, access: str=None, description: str=None, destination_address_prefix: str=None, destination_port_range: str=None, direction: str=None, priority: int=None, protocol: str=None, source_address_prefix: str=None, source_port_range: str=None, **kwargs) -> None: + super(NsgSecurityRule, self).__init__(**kwargs) + self.name = name + self.access = access + self.description = description + self.destination_address_prefix = destination_address_prefix + self.destination_port_range = destination_port_range + self.direction = direction + self.priority = priority + self.protocol = protocol + self.source_address_prefix = source_address_prefix + self.source_port_range = source_port_range + + +class OperationErrorAdditionalInfo(Model): + """The operation error info. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar type: The error type. + :vartype type: str + :ivar info: The operation error info. + :vartype info: ~azure.mgmt.resourcemover.models.MoveErrorInfo + """ + + _validation = { + 'type': {'readonly': True}, + 'info': {'readonly': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'info': {'key': 'info', 'type': 'MoveErrorInfo'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationErrorAdditionalInfo, self).__init__(**kwargs) + self.type = None + self.info = None + + +class OperationsDiscovery(Model): + """Operations discovery class. + + :param name: Gets or sets Name of the API. + The name of the operation being performed on this particular object. It + should + match the action name that appears in RBAC / the event service. + Examples of operations include: + * Microsoft.Compute/virtualMachine/capture/action + * Microsoft.Compute/virtualMachine/restart/action + * Microsoft.Compute/virtualMachine/write + * Microsoft.Compute/virtualMachine/read + * Microsoft.Compute/virtualMachine/delete + Each action should include, in order: + (1) Resource Provider Namespace + (2) Type hierarchy for which the action applies (e.g. server/databases for + a SQL + Azure database) + (3) Read, Write, Action or Delete indicating which type applies. If it is + a PUT/PATCH + on a collection or named value, Write should be used. + If it is a GET, Read should be used. If it is a DELETE, Delete should be + used. If it + is a POST, Action should be used. + As a note: all resource providers would need to include the "{Resource + Provider + Namespace}/register/action" operation in their response. + This API is used to register for their service, and should include details + about the + operation (e.g. a localized name for the resource provider + any special + considerations like PII release). + :type name: str + :param is_data_action: Indicates whether the operation is a data action + :type is_data_action: bool + :param display: + :type display: ~azure.mgmt.resourcemover.models.Display + :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: + :type properties: object + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'is_data_action': {'key': 'isDataAction', 'type': 'bool'}, + 'display': {'key': 'display', 'type': 'Display'}, + 'origin': {'key': 'origin', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, *, name: str=None, is_data_action: bool=None, display=None, origin: str=None, properties=None, **kwargs) -> None: + super(OperationsDiscovery, self).__init__(**kwargs) + self.name = name + self.is_data_action = is_data_action + self.display = display + self.origin = origin + self.properties = properties + + +class OperationsDiscoveryCollection(Model): + """Collection of ClientDiscovery details. + + :param value: Gets or sets the ClientDiscovery details. + :type value: list[~azure.mgmt.resourcemover.models.OperationsDiscovery] + :param next_link: Gets or sets the value of next link. + :type next_link: str + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[OperationsDiscovery]'}, + 'next_link': {'key': 'nextLink', 'type': 'str'}, + } + + def __init__(self, *, value=None, next_link: str=None, **kwargs) -> None: + super(OperationsDiscoveryCollection, self).__init__(**kwargs) + self.value = value + self.next_link = next_link + + +class OperationStatus(Model): + """Operation status REST resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar id: Resource Id. + :vartype id: str + :ivar name: Operation name. + :vartype name: str + :ivar status: Status of the operation. ARM expects the terminal status to + be one of Succeeded/ Failed/ Canceled. All other values imply that the + operation is still running. + :vartype status: str + :ivar start_time: Start time. + :vartype start_time: str + :ivar end_time: End time. + :vartype end_time: str + :ivar error: Error stating all error details for the operation. + :vartype error: ~azure.mgmt.resourcemover.models.OperationStatusError + :ivar properties: Custom data. + :vartype properties: object + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'status': {'readonly': True}, + 'start_time': {'readonly': True}, + 'end_time': {'readonly': True}, + 'error': {'readonly': True}, + 'properties': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'start_time': {'key': 'startTime', 'type': 'str'}, + 'end_time': {'key': 'endTime', 'type': 'str'}, + 'error': {'key': 'error', 'type': 'OperationStatusError'}, + 'properties': {'key': 'properties', 'type': 'object'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationStatus, self).__init__(**kwargs) + self.id = None + self.name = None + self.status = None + self.start_time = None + self.end_time = None + self.error = None + self.properties = None + + +class OperationStatusError(Model): + """Class for operation status errors. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :ivar code: The error code. + :vartype code: str + :ivar message: The error message. + :vartype message: str + :ivar details: The error details. + :vartype details: + list[~azure.mgmt.resourcemover.models.OperationStatusError] + :ivar additional_info: The additional info. + :vartype additional_info: + list[~azure.mgmt.resourcemover.models.OperationErrorAdditionalInfo] + """ + + _validation = { + 'code': {'readonly': True}, + 'message': {'readonly': True}, + 'details': {'readonly': True}, + 'additional_info': {'readonly': True}, + } + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + 'details': {'key': 'details', 'type': '[OperationStatusError]'}, + 'additional_info': {'key': 'additionalInfo', 'type': '[OperationErrorAdditionalInfo]'}, + } + + def __init__(self, **kwargs) -> None: + super(OperationStatusError, self).__init__(**kwargs) + self.code = None + self.message = None + self.details = None + self.additional_info = None + + +class PrepareRequest(Model): + """Defines the request body for initiate prepare operation. + + All required parameters must be populated in order to send to Azure. + + :param validate_only: Gets or sets a value indicating whether the + operation needs to only run pre-requisite. + :type validate_only: bool + :param move_resources: Required. Gets or sets the list of resource Id's, + by default it accepts move resource id's unless the input type is switched + via moveResourceInputType property. + :type move_resources: list[str] + :param move_resource_input_type: Possible values include: + 'MoveResourceId', 'MoveResourceSourceId' + :type move_resource_input_type: str or + ~azure.mgmt.resourcemover.models.MoveResourceInputType + """ + + _validation = { + 'move_resources': {'required': True}, + } + + _attribute_map = { + 'validate_only': {'key': 'validateOnly', 'type': 'bool'}, + 'move_resources': {'key': 'moveResources', 'type': '[str]'}, + 'move_resource_input_type': {'key': 'moveResourceInputType', 'type': 'str'}, + } + + def __init__(self, *, move_resources, validate_only: bool=None, move_resource_input_type=None, **kwargs) -> None: + super(PrepareRequest, self).__init__(**kwargs) + self.validate_only = validate_only + self.move_resources = move_resources + self.move_resource_input_type = move_resource_input_type + + +class PublicIPAddressResourceSettings(ResourceSettings): + """Defines the public IP address resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param domain_name_label: Gets or sets the domain name label. + :type domain_name_label: str + :param fqdn: Gets or sets the fully qualified domain name. + :type fqdn: str + :param public_ip_allocation_method: Gets or sets public IP allocation + method. + :type public_ip_allocation_method: str + :param sku: Gets or sets public IP sku. + :type sku: str + :param zones: Gets or sets public IP zones. + :type zones: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'domain_name_label': {'key': 'domainNameLabel', 'type': 'str'}, + 'fqdn': {'key': 'fqdn', 'type': 'str'}, + 'public_ip_allocation_method': {'key': 'publicIpAllocationMethod', 'type': 'str'}, + 'sku': {'key': 'sku', 'type': 'str'}, + 'zones': {'key': 'zones', 'type': 'str'}, + } + + def __init__(self, *, target_resource_name: str, domain_name_label: str=None, fqdn: str=None, public_ip_allocation_method: str=None, sku: str=None, zones: str=None, **kwargs) -> None: + super(PublicIPAddressResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.domain_name_label = domain_name_label + self.fqdn = fqdn + self.public_ip_allocation_method = public_ip_allocation_method + self.sku = sku + self.zones = zones + self.resource_type = 'Microsoft.Network/publicIPAddresses' + + +class PublicIpReference(AzureResourceReference): + """Defines reference to a public IP. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + } + + def __init__(self, *, source_arm_resource_id: str, **kwargs) -> None: + super(PublicIpReference, self).__init__(source_arm_resource_id=source_arm_resource_id, **kwargs) + + +class ResourceGroupResourceSettings(ResourceSettings): + """Defines the resource group resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, *, target_resource_name: str, **kwargs) -> None: + super(ResourceGroupResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.resource_type = 'resourceGroups' + + +class ResourceMoveRequest(Model): + """Defines the request body for resource move operation. + + All required parameters must be populated in order to send to Azure. + + :param validate_only: Gets or sets a value indicating whether the + operation needs to only run pre-requisite. + :type validate_only: bool + :param move_resources: Required. Gets or sets the list of resource Id's, + by default it accepts move resource id's unless the input type is switched + via moveResourceInputType property. + :type move_resources: list[str] + :param move_resource_input_type: Possible values include: + 'MoveResourceId', 'MoveResourceSourceId' + :type move_resource_input_type: str or + ~azure.mgmt.resourcemover.models.MoveResourceInputType + """ + + _validation = { + 'move_resources': {'required': True}, + } + + _attribute_map = { + 'validate_only': {'key': 'validateOnly', 'type': 'bool'}, + 'move_resources': {'key': 'moveResources', 'type': '[str]'}, + 'move_resource_input_type': {'key': 'moveResourceInputType', 'type': 'str'}, + } + + def __init__(self, *, move_resources, validate_only: bool=None, move_resource_input_type=None, **kwargs) -> None: + super(ResourceMoveRequest, self).__init__(**kwargs) + self.validate_only = validate_only + self.move_resources = move_resources + self.move_resource_input_type = move_resource_input_type + + +class SqlDatabaseResourceSettings(ResourceSettings): + """Defines the Sql Database resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param zone_redundant: Possible values include: 'Enable', 'Disable' + :type zone_redundant: str or + ~azure.mgmt.resourcemover.models.ZoneRedundant + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'zone_redundant': {'key': 'zoneRedundant', 'type': 'str'}, + } + + def __init__(self, *, target_resource_name: str, zone_redundant=None, **kwargs) -> None: + super(SqlDatabaseResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.zone_redundant = zone_redundant + self.resource_type = 'Microsoft.Sql/servers/databases' + + +class SqlElasticPoolResourceSettings(ResourceSettings): + """Defines the Sql ElasticPool resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param zone_redundant: Possible values include: 'Enable', 'Disable' + :type zone_redundant: str or + ~azure.mgmt.resourcemover.models.ZoneRedundant + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'zone_redundant': {'key': 'zoneRedundant', 'type': 'str'}, + } + + def __init__(self, *, target_resource_name: str, zone_redundant=None, **kwargs) -> None: + super(SqlElasticPoolResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.zone_redundant = zone_redundant + self.resource_type = 'Microsoft.Sql/servers/elasticPools' + + +class SqlServerResourceSettings(ResourceSettings): + """Defines the SQL Server resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + } + + def __init__(self, *, target_resource_name: str, **kwargs) -> None: + super(SqlServerResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.resource_type = 'Microsoft.Sql/servers' + + +class SubnetReference(ProxyResourceReference): + """Defines reference to subnet. + + All required parameters must be populated in order to send to Azure. + + :param source_arm_resource_id: Required. Gets the ARM resource ID of the + tracked resource being referenced. + :type source_arm_resource_id: str + :param name: Gets the name of the proxy resource on the target side. + :type name: str + """ + + _validation = { + 'source_arm_resource_id': {'required': True}, + } + + _attribute_map = { + 'source_arm_resource_id': {'key': 'sourceArmResourceId', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + } + + def __init__(self, *, source_arm_resource_id: str, name: str=None, **kwargs) -> None: + super(SubnetReference, self).__init__(source_arm_resource_id=source_arm_resource_id, name=name, **kwargs) + + +class SubnetResourceSettings(Model): + """Defines the virtual network subnets resource settings. + + :param name: Gets or sets the Subnet name. + :type name: str + :param address_prefix: Gets or sets address prefix for the subnet. + :type address_prefix: str + :param network_security_group: + :type network_security_group: + ~azure.mgmt.resourcemover.models.NsgReference + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'address_prefix': {'key': 'addressPrefix', 'type': 'str'}, + 'network_security_group': {'key': 'networkSecurityGroup', 'type': 'NsgReference'}, + } + + def __init__(self, *, name: str=None, address_prefix: str=None, network_security_group=None, **kwargs) -> None: + super(SubnetResourceSettings, self).__init__(**kwargs) + self.name = name + self.address_prefix = address_prefix + self.network_security_group = network_security_group + + +class Summary(Model): + """Summary item. + + :param count: Gets the count. + :type count: int + :param item: Gets the item. + :type item: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'item': {'key': 'item', 'type': 'str'}, + } + + def __init__(self, *, count: int=None, item: str=None, **kwargs) -> None: + super(Summary, self).__init__(**kwargs) + self.count = count + self.item = item + + +class SummaryCollection(Model): + """Summary Collection. + + :param field_name: Gets or sets the field name on which summary is done. + :type field_name: str + :param summary: Gets or sets the list of summary items. + :type summary: list[~azure.mgmt.resourcemover.models.Summary] + """ + + _attribute_map = { + 'field_name': {'key': 'fieldName', 'type': 'str'}, + 'summary': {'key': 'summary', 'type': '[Summary]'}, + } + + def __init__(self, *, field_name: str=None, summary=None, **kwargs) -> None: + super(SummaryCollection, self).__init__(**kwargs) + self.field_name = field_name + self.summary = summary + + +class UnresolvedDependenciesFilter(Model): + """Unresolved dependencies contract. + + :param properties: + :type properties: + ~azure.mgmt.resourcemover.models.UnresolvedDependenciesFilterProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'UnresolvedDependenciesFilterProperties'}, + } + + def __init__(self, *, properties=None, **kwargs) -> None: + super(UnresolvedDependenciesFilter, self).__init__(**kwargs) + self.properties = properties + + +class UnresolvedDependenciesFilterProperties(Model): + """UnresolvedDependenciesFilterProperties. + + :param count: The count of the resource. + :type count: int + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + } + + def __init__(self, *, count: int=None, **kwargs) -> None: + super(UnresolvedDependenciesFilterProperties, self).__init__(**kwargs) + self.count = count + + +class UnresolvedDependency(Model): + """Unresolved dependency. + + :param count: Gets or sets the count. + :type count: int + :param id: Gets or sets the arm id of the dependency. + :type id: str + """ + + _attribute_map = { + 'count': {'key': 'count', 'type': 'int'}, + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, count: int=None, id: str=None, **kwargs) -> None: + super(UnresolvedDependency, self).__init__(**kwargs) + self.count = count + self.id = id + + +class UpdateMoveCollectionRequest(Model): + """Defines the request body for updating move collection. + + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :param identity: + :type identity: ~azure.mgmt.resourcemover.models.Identity + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'Identity'}, + } + + def __init__(self, *, tags=None, identity=None, **kwargs) -> None: + super(UpdateMoveCollectionRequest, self).__init__(**kwargs) + self.tags = tags + self.identity = identity + + +class VirtualMachineResourceSettings(ResourceSettings): + """Gets or sets the virtual machine resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param target_availability_zone: Gets or sets the target availability + zone. Possible values include: '1', '2', '3', 'NA' + :type target_availability_zone: str or + ~azure.mgmt.resourcemover.models.TargetAvailabilityZone + :param target_vm_size: Gets or sets the target virtual machine size. + :type target_vm_size: str + :param target_availability_set_id: Gets or sets the target availability + set id for virtual machines not in an availability set at source. + :type target_availability_set_id: str + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'target_availability_zone': {'key': 'targetAvailabilityZone', 'type': 'str'}, + 'target_vm_size': {'key': 'targetVmSize', 'type': 'str'}, + 'target_availability_set_id': {'key': 'targetAvailabilitySetId', 'type': 'str'}, + } + + def __init__(self, *, target_resource_name: str, target_availability_zone=None, target_vm_size: str=None, target_availability_set_id: str=None, **kwargs) -> None: + super(VirtualMachineResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.target_availability_zone = target_availability_zone + self.target_vm_size = target_vm_size + self.target_availability_set_id = target_availability_set_id + self.resource_type = 'Microsoft.Compute/virtualMachines' + + +class VirtualNetworkResourceSettings(ResourceSettings): + """Defines the virtual network resource settings. + + All required parameters must be populated in order to send to Azure. + + :param target_resource_name: Required. Gets or sets the target Resource + name. + :type target_resource_name: str + :param resource_type: Required. Constant filled by server. + :type resource_type: str + :param enable_ddos_protection: Gets or sets a value indicating whether + gets or sets whether the + DDOS protection should be switched on. + :type enable_ddos_protection: bool + :param address_space: Gets or sets the address prefixes for the virtual + network. + :type address_space: list[str] + :param dns_servers: Gets or sets DHCPOptions that contains an array of DNS + servers available to VMs + deployed in the virtual network. + :type dns_servers: list[str] + :param subnets: Gets or sets List of subnets in a VirtualNetwork. + :type subnets: + list[~azure.mgmt.resourcemover.models.SubnetResourceSettings] + """ + + _validation = { + 'target_resource_name': {'required': True}, + 'resource_type': {'required': True}, + } + + _attribute_map = { + 'target_resource_name': {'key': 'targetResourceName', 'type': 'str'}, + 'resource_type': {'key': 'resourceType', 'type': 'str'}, + 'enable_ddos_protection': {'key': 'enableDdosProtection', 'type': 'bool'}, + 'address_space': {'key': 'addressSpace', 'type': '[str]'}, + 'dns_servers': {'key': 'dnsServers', 'type': '[str]'}, + 'subnets': {'key': 'subnets', 'type': '[SubnetResourceSettings]'}, + } + + def __init__(self, *, target_resource_name: str, enable_ddos_protection: bool=None, address_space=None, dns_servers=None, subnets=None, **kwargs) -> None: + super(VirtualNetworkResourceSettings, self).__init__(target_resource_name=target_resource_name, **kwargs) + self.enable_ddos_protection = enable_ddos_protection + self.address_space = address_space + self.dns_servers = dns_servers + self.subnets = subnets + self.resource_type = 'Microsoft.Network/virtualNetworks' diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_paged_models.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_paged_models.py new file mode 100644 index 000000000000..30378959ccb2 --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_paged_models.py @@ -0,0 +1,53 @@ +# 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 MoveCollectionPaged(Paged): + """ + A paging container for iterating over a list of :class:`MoveCollection ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MoveCollection]'} + } + + def __init__(self, *args, **kwargs): + + super(MoveCollectionPaged, self).__init__(*args, **kwargs) +class MoveResourcePaged(Paged): + """ + A paging container for iterating over a list of :class:`MoveResource ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[MoveResource]'} + } + + def __init__(self, *args, **kwargs): + + super(MoveResourcePaged, self).__init__(*args, **kwargs) +class UnresolvedDependencyPaged(Paged): + """ + A paging container for iterating over a list of :class:`UnresolvedDependency ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[UnresolvedDependency]'} + } + + def __init__(self, *args, **kwargs): + + super(UnresolvedDependencyPaged, self).__init__(*args, **kwargs) diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_resource_mover_service_api_enums.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_resource_mover_service_api_enums.py new file mode 100644 index 000000000000..539195ae0fe4 --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/models/_resource_mover_service_api_enums.py @@ -0,0 +1,89 @@ +# 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 ResourceIdentityType(str, Enum): + + none = "None" + system_assigned = "SystemAssigned" + user_assigned = "UserAssigned" + + +class MoveState(str, Enum): + + assignment_pending = "AssignmentPending" + prepare_pending = "PreparePending" + prepare_in_progress = "PrepareInProgress" + prepare_failed = "PrepareFailed" + move_pending = "MovePending" + move_in_progress = "MoveInProgress" + move_failed = "MoveFailed" + discard_in_progress = "DiscardInProgress" + discard_failed = "DiscardFailed" + commit_pending = "CommitPending" + commit_in_progress = "CommitInProgress" + commit_failed = "CommitFailed" + committed = "Committed" + delete_source_pending = "DeleteSourcePending" + resource_move_completed = "ResourceMoveCompleted" + + +class MoveResourceInputType(str, Enum): + + move_resource_id = "MoveResourceId" + move_resource_source_id = "MoveResourceSourceId" + + +class ProvisioningState(str, Enum): + + succeeded = "Succeeded" + updating = "Updating" + creating = "Creating" + failed = "Failed" + + +class JobName(str, Enum): + + initial_sync = "InitialSync" + + +class ResolutionType(str, Enum): + + manual = "Manual" + automatic = "Automatic" + + +class DependencyType(str, Enum): + + required_for_prepare = "RequiredForPrepare" + required_for_move = "RequiredForMove" + + +class TargetAvailabilityZone(str, Enum): + + one = "1" + two = "2" + three = "3" + na = "NA" + + +class ZoneRedundant(str, Enum): + + enable = "Enable" + disable = "Disable" + + +class DependencyLevel(str, Enum): + + direct = "Direct" + descendant = "Descendant" diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/__init__.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/__init__.py new file mode 100644 index 000000000000..7ebcfa64d8c2 --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/__init__.py @@ -0,0 +1,22 @@ +# 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 ._move_collections_operations import MoveCollectionsOperations +from ._move_resources_operations import MoveResourcesOperations +from ._unresolved_dependencies_operations import UnresolvedDependenciesOperations +from ._operations_discovery_operations import OperationsDiscoveryOperations + +__all__ = [ + 'MoveCollectionsOperations', + 'MoveResourcesOperations', + 'UnresolvedDependenciesOperations', + 'OperationsDiscoveryOperations', +] diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_collections_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_collections_operations.py new file mode 100644 index 000000000000..b3b5efe5df68 --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_collections_operations.py @@ -0,0 +1,1115 @@ +# 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 MoveCollectionsOperations(object): + """MoveCollectionsOperations 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: Client Api Version. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def create( + self, resource_group_name, move_collection_name, body=None, custom_headers=None, raw=False, **operation_config): + """Creates or updates a move collection. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_name: str + :param body: + :type body: ~azure.mgmt.resourcemover.models.MoveCollection + :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: MoveCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resourcemover.models.MoveCollection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # 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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'MoveCollection') + else: + body_content = None + + # 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, 201]: + 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('MoveCollection', response) + if response.status_code == 201: + deserialized = self._deserialize('MoveCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} + + def update( + self, resource_group_name, move_collection_name, tags=None, identity=None, custom_headers=None, raw=False, **operation_config): + """Updates a move collection. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_name: str + :param tags: Gets or sets the Resource tags. + :type tags: dict[str, str] + :param identity: + :type identity: ~azure.mgmt.resourcemover.models.Identity + :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: MoveCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resourcemover.models.MoveCollection or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + body = None + if tags is not None or identity is not None: + body = models.UpdateMoveCollectionRequest(tags=tags, identity=identity) + + # 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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'UpdateMoveCollectionRequest') + else: + body_content = None + + # 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]: + 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('MoveCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} + + + def _delete_initial( + self, resource_group_name, move_collection_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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + 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('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, move_collection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a move collection. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_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 OperationStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resourcemover.models.OperationStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resourcemover.models.OperationStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatus', 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} + + def get( + self, resource_group_name, move_collection_name, custom_headers=None, raw=False, **operation_config): + """Gets the move collection. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_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: MoveCollection or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resourcemover.models.MoveCollection 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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MoveCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}'} + + + def _prepare_initial( + self, resource_group_name, move_collection_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.prepare.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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'PrepareRequest') + else: + body_content = None + + # 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 [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('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def prepare( + self, resource_group_name, move_collection_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Initiates prepare for the set of resources included in the request + body. The prepare operation is on the moveResources that are in the + moveState 'PreparePending' or 'PrepareFailed', on a successful + completion the moveResource moveState do a transition to MovePending. + To aid the user to prerequisite the operation the client can call + operation with validateOnly property set to true. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_name: str + :param body: + :type body: ~azure.mgmt.resourcemover.models.PrepareRequest + :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 OperationStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resourcemover.models.OperationStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resourcemover.models.OperationStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._prepare_initial( + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatus', 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, lro_options={'final-state-via': 'azure-async-operation'}, **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) + prepare.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/prepare'} + + + def _initiate_move_initial( + self, resource_group_name, move_collection_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.initiate_move.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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'ResourceMoveRequest') + else: + body_content = None + + # 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 [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('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def initiate_move( + self, resource_group_name, move_collection_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Moves the set of resources included in the request body. The move + operation is triggered after the moveResources are in the moveState + 'MovePending' or 'MoveFailed', on a successful completion the + moveResource moveState do a transition to CommitPending. To aid the + user to prerequisite the operation the client can call operation with + validateOnly property set to true. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_name: str + :param body: + :type body: ~azure.mgmt.resourcemover.models.ResourceMoveRequest + :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 OperationStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resourcemover.models.OperationStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resourcemover.models.OperationStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._initiate_move_initial( + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatus', 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, lro_options={'final-state-via': 'azure-async-operation'}, **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) + initiate_move.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/initiateMove'} + + + def _commit_initial( + self, resource_group_name, move_collection_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.commit.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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'CommitRequest') + else: + body_content = None + + # 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 [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('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def commit( + self, resource_group_name, move_collection_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Commits the set of resources included in the request body. The commit + operation is triggered on the moveResources in the moveState + 'CommitPending' or 'CommitFailed', on a successful completion the + moveResource moveState do a transition to Committed. To aid the user to + prerequisite the operation the client can call operation with + validateOnly property set to true. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_name: str + :param body: + :type body: ~azure.mgmt.resourcemover.models.CommitRequest + :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 OperationStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resourcemover.models.OperationStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resourcemover.models.OperationStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._commit_initial( + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatus', 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, lro_options={'final-state-via': 'azure-async-operation'}, **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) + commit.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/commit'} + + + def _discard_initial( + self, resource_group_name, move_collection_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.discard.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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'DiscardRequest') + else: + body_content = None + + # 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 [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('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def discard( + self, resource_group_name, move_collection_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Discards the set of resources included in the request body. The discard + operation is triggered on the moveResources in the moveState + 'CommitPending' or 'DiscardFailed', on a successful completion the + moveResource moveState do a transition to MovePending. To aid the user + to prerequisite the operation the client can call operation with + validateOnly property set to true. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_name: str + :param body: + :type body: ~azure.mgmt.resourcemover.models.DiscardRequest + :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 OperationStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resourcemover.models.OperationStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resourcemover.models.OperationStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._discard_initial( + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatus', 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, lro_options={'final-state-via': 'azure-async-operation'}, **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) + discard.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/discard'} + + + def _resolve_dependencies_initial( + self, resource_group_name, move_collection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.resolve_dependencies.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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def resolve_dependencies( + self, resource_group_name, move_collection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Computes, resolves and validate the dependencies of the moveResources + in the move collection. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_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 OperationStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resourcemover.models.OperationStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resourcemover.models.OperationStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._resolve_dependencies_initial( + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatus', 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, lro_options={'final-state-via': 'azure-async-operation'}, **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) + resolve_dependencies.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/resolveDependencies'} + + + def _bulk_remove_initial( + self, resource_group_name, move_collection_name, body=None, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.bulk_remove.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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'BulkRemoveRequest') + else: + body_content = None + + # 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 [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('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def bulk_remove( + self, resource_group_name, move_collection_name, body=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Removes the set of move resources included in the request body from + move collection. The orchestration is done by service. To aid the user + to prerequisite the operation the client can call operation with + validateOnly property set to true. + + :param resource_group_name: + :type resource_group_name: str + :param move_collection_name: + :type move_collection_name: str + :param body: + :type body: ~azure.mgmt.resourcemover.models.BulkRemoveRequest + :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 OperationStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resourcemover.models.OperationStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resourcemover.models.OperationStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._bulk_remove_initial( + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + body=body, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatus', 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, lro_options={'final-state-via': 'azure-async-operation'}, **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) + bulk_remove.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/bulkRemove'} + + def list_move_collections_by_subscription( + self, custom_headers=None, raw=False, **operation_config): + """Get all Move Collections. + + Get all the Move Collections in 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 MoveCollection + :rtype: + ~azure.mgmt.resourcemover.models.MoveCollectionPaged[~azure.mgmt.resourcemover.models.MoveCollection] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_move_collections_by_subscription.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.MoveCollectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_move_collections_by_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Migrate/moveCollections'} + + def list_move_collections_by_resource_group( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Get all Move Collections. + + Get all the Move Collections in the 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 MoveCollection + :rtype: + ~azure.mgmt.resourcemover.models.MoveCollectionPaged[~azure.mgmt.resourcemover.models.MoveCollection] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_move_collections_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.MoveCollectionPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list_move_collections_by_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections'} diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_resources_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_resources_operations.py new file mode 100644 index 000000000000..08583b08aa6c --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_move_resources_operations.py @@ -0,0 +1,392 @@ +# 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 MoveResourcesOperations(object): + """MoveResourcesOperations 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: Client Api Version. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def list( + self, resource_group_name, move_collection_name, filter=None, custom_headers=None, raw=False, **operation_config): + """Lists the Move Resources in the move collection. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_name: str + :param filter: The filter to apply on the operation. For example, you + can use $filter=Properties/ProvisioningState eq 'Succeeded'. + :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 MoveResource + :rtype: + ~azure.mgmt.resourcemover.models.MoveResourcePaged[~azure.mgmt.resourcemover.models.MoveResource] + :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'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_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') + 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.MoveResourcePaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources'} + + + def _create_initial( + self, resource_group_name, move_collection_name, move_resource_name, properties=None, custom_headers=None, raw=False, **operation_config): + body = None + if properties is not None: + body = models.MoveResource(properties=properties) + + # 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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), + 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + if body is not None: + body_content = self._serialize.body(body, 'MoveResource') + else: + body_content = None + + # 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('MoveResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create( + self, resource_group_name, move_collection_name, move_resource_name, properties=None, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates a Move Resource in the move collection. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_name: str + :param move_resource_name: The Move Resource Name. + :type move_resource_name: str + :param properties: + :type properties: + ~azure.mgmt.resourcemover.models.MoveResourceProperties + :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 MoveResource or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resourcemover.models.MoveResource] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resourcemover.models.MoveResource]] + :raises: :class:`CloudError` + """ + raw_result = self._create_initial( + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + move_resource_name=move_resource_name, + properties=properties, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('MoveResource', 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.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} + + + def _delete_initial( + self, resource_group_name, move_collection_name, move_resource_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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), + 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + 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('OperationStatus', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def delete( + self, resource_group_name, move_collection_name, move_resource_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes a Move Resource from the move collection. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_name: str + :param move_resource_name: The Move Resource Name. + :type move_resource_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 OperationStatus or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.resourcemover.models.OperationStatus] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.resourcemover.models.OperationStatus]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + move_collection_name=move_collection_name, + move_resource_name=move_resource_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('OperationStatus', 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) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} + + def get( + self, resource_group_name, move_collection_name, move_resource_name, custom_headers=None, raw=False, **operation_config): + """Gets the Move Resource. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_name: str + :param move_resource_name: The Move Resource Name. + :type move_resource_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: MoveResource or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.resourcemover.models.MoveResource 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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str'), + 'moveResourceName': self._serialize.url("move_resource_name", move_resource_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.get(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('MoveResource', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_operations_discovery_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_operations_discovery_operations.py new file mode 100644 index 000000000000..3242b9a6fc64 --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_operations_discovery_operations.py @@ -0,0 +1,92 @@ +# 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 OperationsDiscoveryOperations(object): + """OperationsDiscoveryOperations 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: Client Api Version. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def get( + self, custom_headers=None, raw=False, **operation_config): + """ + + :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: OperationsDiscoveryCollection or ClientRawResponse if + raw=true + :rtype: ~azure.mgmt.resourcemover.models.OperationsDiscoveryCollection + or ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + + # 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('OperationsDiscoveryCollection', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/providers/Microsoft.Migrate/operations'} diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_unresolved_dependencies_operations.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_unresolved_dependencies_operations.py new file mode 100644 index 000000000000..0ed25e8b377e --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/operations/_unresolved_dependencies_operations.py @@ -0,0 +1,128 @@ +# 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 UnresolvedDependenciesOperations(object): + """UnresolvedDependenciesOperations 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: Client Api Version. Constant value: "2019-10-01-preview". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2019-10-01-preview" + + self.config = config + + def get( + self, resource_group_name, move_collection_name, dependency_level=None, orderby=None, filter=None, custom_headers=None, raw=False, **operation_config): + """Gets a list of unresolved dependencies. + + :param resource_group_name: The Resource Group Name. + :type resource_group_name: str + :param move_collection_name: The Move Collection Name. + :type move_collection_name: str + :param dependency_level: Defines the dependency level. Possible values + include: 'Direct', 'Descendant' + :type dependency_level: str or + ~azure.mgmt.resourcemover.models.DependencyLevel + :param orderby: OData order by query option. For example, you can use + $orderby=Count desc. + :type orderby: str + :param filter: The filter to apply on the operation. For example, + $apply=filter(count eq 2). + :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 UnresolvedDependency + :rtype: + ~azure.mgmt.resourcemover.models.UnresolvedDependencyPaged[~azure.mgmt.resourcemover.models.UnresolvedDependency] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # 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'), + 'moveCollectionName': self._serialize.url("move_collection_name", move_collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + if dependency_level is not None: + query_parameters['dependencyLevel'] = self._serialize.query("dependency_level", dependency_level, 'str') + if orderby is not None: + query_parameters['$orderby'] = self._serialize.query("orderby", orderby, 'str') + 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.UnresolvedDependencyPaged(internal_paging, self._deserialize.dependencies, header_dict) + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/unresolvedDependencies'} diff --git a/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/version.py b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/version.py new file mode 100644 index 000000000000..cd837f555bb2 --- /dev/null +++ b/sdk/resourcemover/azure-mgmt-resourcemover/azure/mgmt/resourcemover/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 = "0.1.0-preview" +