Release sdk resourcemover (#13665)
* Generated from b7867a975ec9c797332d735ed8796474322c6621 fix schemas parameter * init ci and version Co-authored-by: SDK Automation <sdkautomation@microsoft.com> Co-authored-by: xichen <xichen@microsoft.com>
This commit is contained in:
Родитель
0a6cbf80ca
Коммит
d91e0f5b92
|
@ -0,0 +1,5 @@
|
|||
# Release History
|
||||
|
||||
## 1.0.1b1 (2020-09-09)
|
||||
|
||||
* Initial Release
|
|
@ -0,0 +1,5 @@
|
|||
recursive-include tests *.py *.yaml
|
||||
include *.md
|
||||
include azure/__init__.py
|
||||
include azure/mgmt/__init__.py
|
||||
|
|
@ -0,0 +1,21 @@
|
|||
# Microsoft Azure SDK for Python
|
||||
|
||||
This is the Microsoft Azure Resource Mover Management Client Library.
|
||||
This package has been tested with Python 2.7, 3.5, 3.6, 3.7 and 3.8.
|
||||
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
|
||||
|
||||
|
||||
# Usage
|
||||
|
||||
For code examples, see [Resource Mover Management](https://docs.microsoft.com/python/api/overview/azure/)
|
||||
on docs.microsoft.com.
|
||||
|
||||
|
||||
# Provide Feedback
|
||||
|
||||
If you encounter any bugs or have suggestions, please file an issue in the
|
||||
[Issues](https://github.com/Azure/azure-sdk-for-python/issues)
|
||||
section of the project.
|
||||
|
||||
|
||||
![Impressions](https://azure-sdk-impressions.azurewebsites.net/api/impressions/azure-sdk-for-python%2Fazure-mgmt-resourcemover%2FREADME.png)
|
|
@ -0,0 +1 @@
|
|||
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
|
@ -0,0 +1 @@
|
|||
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
|
|
@ -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 ._resource_mover_service_api import ResourceMoverServiceAPI
|
||||
from ._version import VERSION
|
||||
|
||||
__version__ = VERSION
|
||||
__all__ = ['ResourceMoverServiceAPI']
|
||||
|
||||
try:
|
||||
from ._patch import patch_sdk
|
||||
patch_sdk()
|
||||
except ImportError:
|
||||
pass
|
|
@ -0,0 +1,70 @@
|
|||
# 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 typing import TYPE_CHECKING
|
||||
|
||||
from azure.core.configuration import Configuration
|
||||
from azure.core.pipeline import policies
|
||||
|
||||
from ._version import VERSION
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from typing import Any
|
||||
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
|
||||
class ResourceMoverServiceAPIConfiguration(Configuration):
|
||||
"""Configuration for ResourceMoverServiceAPI.
|
||||
|
||||
Note that all parameters used to create this instance are saved as instance
|
||||
attributes.
|
||||
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The Subscription ID.
|
||||
:type subscription_id: str
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential, # type: "TokenCredential"
|
||||
subscription_id, # type: str
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> None
|
||||
if credential is None:
|
||||
raise ValueError("Parameter 'credential' must not be None.")
|
||||
if subscription_id is None:
|
||||
raise ValueError("Parameter 'subscription_id' must not be None.")
|
||||
super(ResourceMoverServiceAPIConfiguration, self).__init__(**kwargs)
|
||||
|
||||
self.credential = credential
|
||||
self.subscription_id = subscription_id
|
||||
self.api_version = "2019-10-01-preview"
|
||||
self.credential_scopes = ['https://management.azure.com/.default']
|
||||
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
|
||||
kwargs.setdefault('sdk_moniker', 'mgmt-resourcemover/{}'.format(VERSION))
|
||||
self._configure(**kwargs)
|
||||
|
||||
def _configure(
|
||||
self,
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> None
|
||||
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
|
||||
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
|
||||
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
|
||||
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
|
||||
self.retry_policy = kwargs.get('retry_policy') or policies.RetryPolicy(**kwargs)
|
||||
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
|
||||
self.redirect_policy = kwargs.get('redirect_policy') or policies.RedirectPolicy(**kwargs)
|
||||
self.authentication_policy = kwargs.get('authentication_policy')
|
||||
if self.credential and not self.authentication_policy:
|
||||
self.authentication_policy = policies.BearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
|
|
@ -0,0 +1,56 @@
|
|||
{
|
||||
"chosen_version": "2019-10-01-preview",
|
||||
"total_api_version_list": ["2019-10-01-preview"],
|
||||
"client": {
|
||||
"name": "ResourceMoverServiceAPI",
|
||||
"filename": "_resource_mover_service_api",
|
||||
"description": "A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between zones within a region."
|
||||
},
|
||||
"global_parameters": {
|
||||
"sync_method": {
|
||||
"credential": {
|
||||
"method_signature": "credential, # type: \"TokenCredential\"",
|
||||
"description": "Credential needed for the client to connect to Azure.",
|
||||
"docstring_type": "~azure.core.credentials.TokenCredential",
|
||||
"required": true
|
||||
},
|
||||
"subscription_id": {
|
||||
"method_signature": "subscription_id, # type: str",
|
||||
"description": "The Subscription ID.",
|
||||
"docstring_type": "str",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"async_method": {
|
||||
"credential": {
|
||||
"method_signature": "credential, # type: \"AsyncTokenCredential\"",
|
||||
"description": "Credential needed for the client to connect to Azure.",
|
||||
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
|
||||
"required": true
|
||||
},
|
||||
"subscription_id": {
|
||||
"method_signature": "subscription_id, # type: str",
|
||||
"description": "The Subscription ID.",
|
||||
"docstring_type": "str",
|
||||
"required": true
|
||||
}
|
||||
},
|
||||
"constant": {
|
||||
},
|
||||
"call": "credential, subscription_id"
|
||||
},
|
||||
"config": {
|
||||
"credential": true,
|
||||
"credential_scopes": ["https://management.azure.com/.default"]
|
||||
},
|
||||
"operation_groups": {
|
||||
"move_collections": "MoveCollectionsOperations",
|
||||
"move_resources": "MoveResourcesOperations",
|
||||
"unresolved_dependencies": "UnresolvedDependenciesOperations",
|
||||
"operations_discovery": "OperationsDiscoveryOperations"
|
||||
},
|
||||
"operation_mixins": {
|
||||
},
|
||||
"sync_imports": "None",
|
||||
"async_imports": "None"
|
||||
}
|
|
@ -0,0 +1,84 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from azure.mgmt.core import ARMPipelineClient
|
||||
from msrest import Deserializer, Serializer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from typing import Any, Optional
|
||||
|
||||
from azure.core.credentials import TokenCredential
|
||||
|
||||
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(object):
|
||||
"""A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between zones within a region.
|
||||
|
||||
:ivar move_collections: MoveCollectionsOperations operations
|
||||
:vartype move_collections: resource_mover_service_api.operations.MoveCollectionsOperations
|
||||
:ivar move_resources: MoveResourcesOperations operations
|
||||
:vartype move_resources: resource_mover_service_api.operations.MoveResourcesOperations
|
||||
:ivar unresolved_dependencies: UnresolvedDependenciesOperations operations
|
||||
:vartype unresolved_dependencies: resource_mover_service_api.operations.UnresolvedDependenciesOperations
|
||||
:ivar operations_discovery: OperationsDiscoveryOperations operations
|
||||
:vartype operations_discovery: resource_mover_service_api.operations.OperationsDiscoveryOperations
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
:type credential: ~azure.core.credentials.TokenCredential
|
||||
:param subscription_id: The Subscription ID.
|
||||
:type subscription_id: str
|
||||
:param str base_url: Service URL
|
||||
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential, # type: "TokenCredential"
|
||||
subscription_id, # type: str
|
||||
base_url=None, # type: Optional[str]
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> None
|
||||
if not base_url:
|
||||
base_url = 'https://management.azure.com'
|
||||
self._config = ResourceMoverServiceAPIConfiguration(credential, subscription_id, **kwargs)
|
||||
self._client = ARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
|
||||
|
||||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
|
||||
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)
|
||||
|
||||
def close(self):
|
||||
# type: () -> None
|
||||
self._client.close()
|
||||
|
||||
def __enter__(self):
|
||||
# type: () -> ResourceMoverServiceAPI
|
||||
self._client.__enter__()
|
||||
return self
|
||||
|
||||
def __exit__(self, *exc_details):
|
||||
# type: (Any) -> None
|
||||
self._client.__exit__(*exc_details)
|
|
@ -0,0 +1,9 @@
|
|||
# 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 = "1.0.1b1"
|
|
@ -0,0 +1,10 @@
|
|||
# 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 ._resource_mover_service_api_async import ResourceMoverServiceAPI
|
||||
__all__ = ['ResourceMoverServiceAPI']
|
|
@ -0,0 +1,66 @@
|
|||
# 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 typing import Any, TYPE_CHECKING
|
||||
|
||||
from azure.core.configuration import Configuration
|
||||
from azure.core.pipeline import policies
|
||||
|
||||
from .._version import VERSION
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
|
||||
class ResourceMoverServiceAPIConfiguration(Configuration):
|
||||
"""Configuration for ResourceMoverServiceAPI.
|
||||
|
||||
Note that all parameters used to create this instance are saved as instance
|
||||
attributes.
|
||||
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The Subscription ID.
|
||||
:type subscription_id: str
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "AsyncTokenCredential",
|
||||
subscription_id: str,
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
if credential is None:
|
||||
raise ValueError("Parameter 'credential' must not be None.")
|
||||
if subscription_id is None:
|
||||
raise ValueError("Parameter 'subscription_id' must not be None.")
|
||||
super(ResourceMoverServiceAPIConfiguration, self).__init__(**kwargs)
|
||||
|
||||
self.credential = credential
|
||||
self.subscription_id = subscription_id
|
||||
self.api_version = "2019-10-01-preview"
|
||||
self.credential_scopes = ['https://management.azure.com/.default']
|
||||
self.credential_scopes.extend(kwargs.pop('credential_scopes', []))
|
||||
kwargs.setdefault('sdk_moniker', 'mgmt-resourcemover/{}'.format(VERSION))
|
||||
self._configure(**kwargs)
|
||||
|
||||
def _configure(
|
||||
self,
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
self.user_agent_policy = kwargs.get('user_agent_policy') or policies.UserAgentPolicy(**kwargs)
|
||||
self.headers_policy = kwargs.get('headers_policy') or policies.HeadersPolicy(**kwargs)
|
||||
self.proxy_policy = kwargs.get('proxy_policy') or policies.ProxyPolicy(**kwargs)
|
||||
self.logging_policy = kwargs.get('logging_policy') or policies.NetworkTraceLoggingPolicy(**kwargs)
|
||||
self.retry_policy = kwargs.get('retry_policy') or policies.AsyncRetryPolicy(**kwargs)
|
||||
self.custom_hook_policy = kwargs.get('custom_hook_policy') or policies.CustomHookPolicy(**kwargs)
|
||||
self.redirect_policy = kwargs.get('redirect_policy') or policies.AsyncRedirectPolicy(**kwargs)
|
||||
self.authentication_policy = kwargs.get('authentication_policy')
|
||||
if self.credential and not self.authentication_policy:
|
||||
self.authentication_policy = policies.AsyncBearerTokenCredentialPolicy(self.credential, *self.credential_scopes, **kwargs)
|
|
@ -0,0 +1,78 @@
|
|||
# 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 typing import Any, Optional, TYPE_CHECKING
|
||||
|
||||
from azure.mgmt.core import AsyncARMPipelineClient
|
||||
from msrest import Deserializer, Serializer
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from azure.core.credentials_async import AsyncTokenCredential
|
||||
|
||||
from ._configuration_async import ResourceMoverServiceAPIConfiguration
|
||||
from .operations_async import MoveCollectionsOperations
|
||||
from .operations_async import MoveResourcesOperations
|
||||
from .operations_async import UnresolvedDependenciesOperations
|
||||
from .operations_async import OperationsDiscoveryOperations
|
||||
from .. import models
|
||||
|
||||
|
||||
class ResourceMoverServiceAPI(object):
|
||||
"""A first party Azure service orchestrating the move of Azure resources from one Azure region to another or between zones within a region.
|
||||
|
||||
:ivar move_collections: MoveCollectionsOperations operations
|
||||
:vartype move_collections: resource_mover_service_api.aio.operations_async.MoveCollectionsOperations
|
||||
:ivar move_resources: MoveResourcesOperations operations
|
||||
:vartype move_resources: resource_mover_service_api.aio.operations_async.MoveResourcesOperations
|
||||
:ivar unresolved_dependencies: UnresolvedDependenciesOperations operations
|
||||
:vartype unresolved_dependencies: resource_mover_service_api.aio.operations_async.UnresolvedDependenciesOperations
|
||||
:ivar operations_discovery: OperationsDiscoveryOperations operations
|
||||
:vartype operations_discovery: resource_mover_service_api.aio.operations_async.OperationsDiscoveryOperations
|
||||
:param credential: Credential needed for the client to connect to Azure.
|
||||
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
|
||||
:param subscription_id: The Subscription ID.
|
||||
:type subscription_id: str
|
||||
:param str base_url: Service URL
|
||||
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
credential: "AsyncTokenCredential",
|
||||
subscription_id: str,
|
||||
base_url: Optional[str] = None,
|
||||
**kwargs: Any
|
||||
) -> None:
|
||||
if not base_url:
|
||||
base_url = 'https://management.azure.com'
|
||||
self._config = ResourceMoverServiceAPIConfiguration(credential, subscription_id, **kwargs)
|
||||
self._client = AsyncARMPipelineClient(base_url=base_url, config=self._config, **kwargs)
|
||||
|
||||
client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
|
||||
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)
|
||||
|
||||
async def close(self) -> None:
|
||||
await self._client.close()
|
||||
|
||||
async def __aenter__(self) -> "ResourceMoverServiceAPI":
|
||||
await self._client.__aenter__()
|
||||
return self
|
||||
|
||||
async def __aexit__(self, *exc_details) -> None:
|
||||
await self._client.__aexit__(*exc_details)
|
|
@ -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 ._move_collections_operations_async import MoveCollectionsOperations
|
||||
from ._move_resources_operations_async import MoveResourcesOperations
|
||||
from ._unresolved_dependencies_operations_async import UnresolvedDependenciesOperations
|
||||
from ._operations_discovery_operations_async import OperationsDiscoveryOperations
|
||||
|
||||
__all__ = [
|
||||
'MoveCollectionsOperations',
|
||||
'MoveResourcesOperations',
|
||||
'UnresolvedDependenciesOperations',
|
||||
'OperationsDiscoveryOperations',
|
||||
]
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,420 @@
|
|||
# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
|
||||
import warnings
|
||||
|
||||
from azure.core.async_paging import AsyncItemPaged, AsyncList
|
||||
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
|
||||
from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling
|
||||
|
||||
from ... import models
|
||||
|
||||
T = TypeVar('T')
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
class MoveResourcesOperations:
|
||||
"""MoveResourcesOperations async operations.
|
||||
|
||||
You should not instantiate this class directly. Instead, you should create a Client instance that
|
||||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~resource_mover_service_api.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
:param deserializer: An object model deserializer.
|
||||
"""
|
||||
|
||||
models = models
|
||||
|
||||
def __init__(self, client, config, serializer, deserializer) -> None:
|
||||
self._client = client
|
||||
self._serialize = serializer
|
||||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
|
||||
def list(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
move_collection_name: str,
|
||||
filter: Optional[str] = None,
|
||||
**kwargs
|
||||
) -> AsyncIterable["models.MoveResourceCollection"]:
|
||||
"""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
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either MoveResourceCollection or the result of cls(response)
|
||||
:rtype: ~azure.core.async_paging.AsyncItemPaged[~resource_mover_service_api.models.MoveResourceCollection]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MoveResourceCollection"]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
if not next_link:
|
||||
# Construct URL
|
||||
url = self.list.metadata['url'] # type: ignore
|
||||
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 = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
if filter is not None:
|
||||
query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
else:
|
||||
url = next_link
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
return request
|
||||
|
||||
async def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize('MoveResourceCollection', pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem)
|
||||
return deserialized.next_link or None, AsyncList(list_of_elem)
|
||||
|
||||
async def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return AsyncItemPaged(
|
||||
get_next, extract_data
|
||||
)
|
||||
list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources'} # type: ignore
|
||||
|
||||
async def _create_initial(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
move_collection_name: str,
|
||||
move_resource_name: str,
|
||||
body: Optional["models.MoveResource"] = None,
|
||||
**kwargs
|
||||
) -> Optional["models.MoveResource"]:
|
||||
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MoveResource"]]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
content_type = kwargs.pop("content_type", "application/json")
|
||||
|
||||
# Construct URL
|
||||
url = self._create_initial.metadata['url'] # type: ignore
|
||||
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 = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
body_content_kwargs = {} # type: Dict[str, Any]
|
||||
if body is not None:
|
||||
body_content = self._serialize.body(body, 'MoveResource')
|
||||
else:
|
||||
body_content = None
|
||||
body_content_kwargs['content'] = body_content
|
||||
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
|
||||
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200, 202]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = None
|
||||
if response.status_code == 200:
|
||||
deserialized = self._deserialize('MoveResource', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
_create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore
|
||||
|
||||
async def begin_create(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
move_collection_name: str,
|
||||
move_resource_name: str,
|
||||
body: Optional["models.MoveResource"] = None,
|
||||
**kwargs
|
||||
) -> AsyncLROPoller["models.MoveResource"]:
|
||||
"""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 body:
|
||||
:type body: ~resource_mover_service_api.models.MoveResource
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
|
||||
:keyword polling: True for ARMPolling, False for no polling, or a
|
||||
polling object for personal polling strategy
|
||||
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
|
||||
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
|
||||
:return: An instance of AsyncLROPoller that returns either MoveResource or the result of cls(response)
|
||||
:rtype: ~azure.core.polling.AsyncLROPoller[~resource_mover_service_api.models.MoveResource]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MoveResource"]
|
||||
lro_delay = kwargs.pop(
|
||||
'polling_interval',
|
||||
self._config.polling_interval
|
||||
)
|
||||
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
|
||||
if cont_token is None:
|
||||
raw_result = await self._create_initial(
|
||||
resource_group_name=resource_group_name,
|
||||
move_collection_name=move_collection_name,
|
||||
move_resource_name=move_resource_name,
|
||||
body=body,
|
||||
cls=lambda x,y,z: x,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
kwargs.pop('error_map', None)
|
||||
kwargs.pop('content_type', None)
|
||||
|
||||
def get_long_running_output(pipeline_response):
|
||||
deserialized = self._deserialize('MoveResource', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return deserialized
|
||||
|
||||
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
|
||||
elif polling is False: polling_method = AsyncNoPolling()
|
||||
else: polling_method = polling
|
||||
if cont_token:
|
||||
return AsyncLROPoller.from_continuation_token(
|
||||
polling_method=polling_method,
|
||||
continuation_token=cont_token,
|
||||
client=self._client,
|
||||
deserialization_callback=get_long_running_output
|
||||
)
|
||||
else:
|
||||
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
|
||||
begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore
|
||||
|
||||
async def _delete_initial(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
move_collection_name: str,
|
||||
move_resource_name: str,
|
||||
**kwargs
|
||||
) -> Optional["models.OperationStatus"]:
|
||||
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatus"]]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
|
||||
# Construct URL
|
||||
url = self._delete_initial.metadata['url'] # type: ignore
|
||||
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 = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
request = self._client.delete(url, query_parameters, header_parameters)
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200, 202, 204]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = None
|
||||
if response.status_code == 200:
|
||||
deserialized = self._deserialize('OperationStatus', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
_delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore
|
||||
|
||||
async def begin_delete(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
move_collection_name: str,
|
||||
move_resource_name: str,
|
||||
**kwargs
|
||||
) -> AsyncLROPoller["models.OperationStatus"]:
|
||||
"""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
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
|
||||
:keyword polling: True for ARMPolling, False for no polling, or a
|
||||
polling object for personal polling strategy
|
||||
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
|
||||
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
|
||||
:return: An instance of AsyncLROPoller that returns either OperationStatus or the result of cls(response)
|
||||
:rtype: ~azure.core.polling.AsyncLROPoller[~resource_mover_service_api.models.OperationStatus]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatus"]
|
||||
lro_delay = kwargs.pop(
|
||||
'polling_interval',
|
||||
self._config.polling_interval
|
||||
)
|
||||
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
|
||||
if cont_token is None:
|
||||
raw_result = await self._delete_initial(
|
||||
resource_group_name=resource_group_name,
|
||||
move_collection_name=move_collection_name,
|
||||
move_resource_name=move_resource_name,
|
||||
cls=lambda x,y,z: x,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
kwargs.pop('error_map', None)
|
||||
kwargs.pop('content_type', None)
|
||||
|
||||
def get_long_running_output(pipeline_response):
|
||||
deserialized = self._deserialize('OperationStatus', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return deserialized
|
||||
|
||||
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
|
||||
elif polling is False: polling_method = AsyncNoPolling()
|
||||
else: polling_method = polling
|
||||
if cont_token:
|
||||
return AsyncLROPoller.from_continuation_token(
|
||||
polling_method=polling_method,
|
||||
continuation_token=cont_token,
|
||||
client=self._client,
|
||||
deserialization_callback=get_long_running_output
|
||||
)
|
||||
else:
|
||||
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
|
||||
begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore
|
||||
|
||||
async def get(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
move_collection_name: str,
|
||||
move_resource_name: str,
|
||||
**kwargs
|
||||
) -> "models.MoveResource":
|
||||
"""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
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MoveResource, or the result of cls(response)
|
||||
:rtype: ~resource_mover_service_api.models.MoveResource
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MoveResource"]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
|
||||
# Construct URL
|
||||
url = self.get.metadata['url'] # type: ignore
|
||||
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 = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize('MoveResource', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore
|
|
@ -0,0 +1,84 @@
|
|||
# coding=utf-8
|
||||
# --------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
# Code generated by Microsoft (R) AutoRest Code Generator.
|
||||
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
||||
# --------------------------------------------------------------------------
|
||||
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
|
||||
import warnings
|
||||
|
||||
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from ... import models
|
||||
|
||||
T = TypeVar('T')
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
class OperationsDiscoveryOperations:
|
||||
"""OperationsDiscoveryOperations async operations.
|
||||
|
||||
You should not instantiate this class directly. Instead, you should create a Client instance that
|
||||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~resource_mover_service_api.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
:param deserializer: An object model deserializer.
|
||||
"""
|
||||
|
||||
models = models
|
||||
|
||||
def __init__(self, client, config, serializer, deserializer) -> None:
|
||||
self._client = client
|
||||
self._serialize = serializer
|
||||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
|
||||
async def get(
|
||||
self,
|
||||
**kwargs
|
||||
) -> "models.OperationsDiscoveryCollection":
|
||||
"""get.
|
||||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: OperationsDiscoveryCollection, or the result of cls(response)
|
||||
:rtype: ~resource_mover_service_api.models.OperationsDiscoveryCollection
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationsDiscoveryCollection"]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
|
||||
# Construct URL
|
||||
url = self.get.metadata['url'] # type: ignore
|
||||
|
||||
# Construct parameters
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize('OperationsDiscoveryCollection', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
get.metadata = {'url': '/providers/Microsoft.Migrate/operations'} # type: ignore
|
|
@ -0,0 +1,96 @@
|
|||
# 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 typing import Any, Callable, Dict, Generic, Optional, TypeVar
|
||||
import warnings
|
||||
|
||||
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from ... import models
|
||||
|
||||
T = TypeVar('T')
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
class UnresolvedDependenciesOperations:
|
||||
"""UnresolvedDependenciesOperations async operations.
|
||||
|
||||
You should not instantiate this class directly. Instead, you should create a Client instance that
|
||||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~resource_mover_service_api.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
:param deserializer: An object model deserializer.
|
||||
"""
|
||||
|
||||
models = models
|
||||
|
||||
def __init__(self, client, config, serializer, deserializer) -> None:
|
||||
self._client = client
|
||||
self._serialize = serializer
|
||||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
|
||||
async def get(
|
||||
self,
|
||||
resource_group_name: str,
|
||||
move_collection_name: str,
|
||||
**kwargs
|
||||
) -> "models.UnresolvedDependencyCollection":
|
||||
"""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
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: UnresolvedDependencyCollection, or the result of cls(response)
|
||||
:rtype: ~resource_mover_service_api.models.UnresolvedDependencyCollection
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.UnresolvedDependencyCollection"]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
|
||||
# Construct URL
|
||||
url = self.get.metadata['url'] # type: ignore
|
||||
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 = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize('UnresolvedDependencyCollection', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/unresolvedDependencies'} # type: ignore
|
|
@ -0,0 +1,206 @@
|
|||
# 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 CloudErrorBody
|
||||
from ._models_py3 import CommitRequest
|
||||
from ._models_py3 import DiscardRequest
|
||||
from ._models_py3 import Display
|
||||
from ._models_py3 import Identity
|
||||
from ._models_py3 import JobStatus
|
||||
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 MoveCollectionResultList
|
||||
from ._models_py3 import MoveErrorInfo
|
||||
from ._models_py3 import MoveResource
|
||||
from ._models_py3 import MoveResourceCollection
|
||||
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 MoveResourcePropertiesSourceResourceSettings
|
||||
from ._models_py3 import MoveResourceStatus
|
||||
from ._models_py3 import NetworkInterfaceResourceSettings
|
||||
from ._models_py3 import NetworkSecurityGroupResourceSettings
|
||||
from ._models_py3 import NicIpConfigurationResourceSettings
|
||||
from ._models_py3 import NsgSecurityRule
|
||||
from ._models_py3 import OperationErrorAdditionalInfo
|
||||
from ._models_py3 import OperationStatus
|
||||
from ._models_py3 import OperationStatusError
|
||||
from ._models_py3 import OperationsDiscovery
|
||||
from ._models_py3 import OperationsDiscoveryCollection
|
||||
from ._models_py3 import PrepareRequest
|
||||
from ._models_py3 import ProxyResourceReference
|
||||
from ._models_py3 import PublicIPAddressResourceSettings
|
||||
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 UnresolvedDependency
|
||||
from ._models_py3 import UnresolvedDependencyCollection
|
||||
from ._models_py3 import UpdateMoveCollectionRequest
|
||||
from ._models_py3 import VirtualMachineResourceSettings
|
||||
from ._models_py3 import VirtualNetworkResourceSettings
|
||||
except (SyntaxError, ImportError):
|
||||
from ._models import AffectedMoveResource # type: ignore
|
||||
from ._models import AutomaticResolutionProperties # type: ignore
|
||||
from ._models import AvailabilitySetResourceSettings # type: ignore
|
||||
from ._models import AzureResourceReference # type: ignore
|
||||
from ._models import CloudErrorBody # type: ignore
|
||||
from ._models import CommitRequest # type: ignore
|
||||
from ._models import DiscardRequest # type: ignore
|
||||
from ._models import Display # type: ignore
|
||||
from ._models import Identity # type: ignore
|
||||
from ._models import JobStatus # type: ignore
|
||||
from ._models import LBBackendAddressPoolResourceSettings # type: ignore
|
||||
from ._models import LBFrontendIPConfigurationResourceSettings # type: ignore
|
||||
from ._models import LoadBalancerBackendAddressPoolReference # type: ignore
|
||||
from ._models import LoadBalancerNatRuleReference # type: ignore
|
||||
from ._models import LoadBalancerResourceSettings # type: ignore
|
||||
from ._models import ManualResolutionProperties # type: ignore
|
||||
from ._models import MoveCollection # type: ignore
|
||||
from ._models import MoveCollectionProperties # type: ignore
|
||||
from ._models import MoveCollectionResultList # type: ignore
|
||||
from ._models import MoveErrorInfo # type: ignore
|
||||
from ._models import MoveResource # type: ignore
|
||||
from ._models import MoveResourceCollection # type: ignore
|
||||
from ._models import MoveResourceDependency # type: ignore
|
||||
from ._models import MoveResourceDependencyOverride # type: ignore
|
||||
from ._models import MoveResourceError # type: ignore
|
||||
from ._models import MoveResourceErrorBody # type: ignore
|
||||
from ._models import MoveResourceFilter # type: ignore
|
||||
from ._models import MoveResourceFilterProperties # type: ignore
|
||||
from ._models import MoveResourceProperties # type: ignore
|
||||
from ._models import MoveResourcePropertiesErrors # type: ignore
|
||||
from ._models import MoveResourcePropertiesMoveStatus # type: ignore
|
||||
from ._models import MoveResourcePropertiesSourceResourceSettings # type: ignore
|
||||
from ._models import MoveResourceStatus # type: ignore
|
||||
from ._models import NetworkInterfaceResourceSettings # type: ignore
|
||||
from ._models import NetworkSecurityGroupResourceSettings # type: ignore
|
||||
from ._models import NicIpConfigurationResourceSettings # type: ignore
|
||||
from ._models import NsgSecurityRule # type: ignore
|
||||
from ._models import OperationErrorAdditionalInfo # type: ignore
|
||||
from ._models import OperationStatus # type: ignore
|
||||
from ._models import OperationStatusError # type: ignore
|
||||
from ._models import OperationsDiscovery # type: ignore
|
||||
from ._models import OperationsDiscoveryCollection # type: ignore
|
||||
from ._models import PrepareRequest # type: ignore
|
||||
from ._models import ProxyResourceReference # type: ignore
|
||||
from ._models import PublicIPAddressResourceSettings # type: ignore
|
||||
from ._models import ResourceGroupResourceSettings # type: ignore
|
||||
from ._models import ResourceMoveRequest # type: ignore
|
||||
from ._models import ResourceSettings # type: ignore
|
||||
from ._models import SqlDatabaseResourceSettings # type: ignore
|
||||
from ._models import SqlElasticPoolResourceSettings # type: ignore
|
||||
from ._models import SqlServerResourceSettings # type: ignore
|
||||
from ._models import SubnetReference # type: ignore
|
||||
from ._models import SubnetResourceSettings # type: ignore
|
||||
from ._models import UnresolvedDependency # type: ignore
|
||||
from ._models import UnresolvedDependencyCollection # type: ignore
|
||||
from ._models import UpdateMoveCollectionRequest # type: ignore
|
||||
from ._models import VirtualMachineResourceSettings # type: ignore
|
||||
from ._models import VirtualNetworkResourceSettings # type: ignore
|
||||
|
||||
from ._resource_mover_service_api_enums import (
|
||||
DependencyType,
|
||||
MoveResourceInputType,
|
||||
MoveState,
|
||||
ProvisioningState,
|
||||
ResolutionType,
|
||||
ResourceIdentityType,
|
||||
TargetAvailabilityZone,
|
||||
ZoneRedundant,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
'AffectedMoveResource',
|
||||
'AutomaticResolutionProperties',
|
||||
'AvailabilitySetResourceSettings',
|
||||
'AzureResourceReference',
|
||||
'CloudErrorBody',
|
||||
'CommitRequest',
|
||||
'DiscardRequest',
|
||||
'Display',
|
||||
'Identity',
|
||||
'JobStatus',
|
||||
'LBBackendAddressPoolResourceSettings',
|
||||
'LBFrontendIPConfigurationResourceSettings',
|
||||
'LoadBalancerBackendAddressPoolReference',
|
||||
'LoadBalancerNatRuleReference',
|
||||
'LoadBalancerResourceSettings',
|
||||
'ManualResolutionProperties',
|
||||
'MoveCollection',
|
||||
'MoveCollectionProperties',
|
||||
'MoveCollectionResultList',
|
||||
'MoveErrorInfo',
|
||||
'MoveResource',
|
||||
'MoveResourceCollection',
|
||||
'MoveResourceDependency',
|
||||
'MoveResourceDependencyOverride',
|
||||
'MoveResourceError',
|
||||
'MoveResourceErrorBody',
|
||||
'MoveResourceFilter',
|
||||
'MoveResourceFilterProperties',
|
||||
'MoveResourceProperties',
|
||||
'MoveResourcePropertiesErrors',
|
||||
'MoveResourcePropertiesMoveStatus',
|
||||
'MoveResourcePropertiesSourceResourceSettings',
|
||||
'MoveResourceStatus',
|
||||
'NetworkInterfaceResourceSettings',
|
||||
'NetworkSecurityGroupResourceSettings',
|
||||
'NicIpConfigurationResourceSettings',
|
||||
'NsgSecurityRule',
|
||||
'OperationErrorAdditionalInfo',
|
||||
'OperationStatus',
|
||||
'OperationStatusError',
|
||||
'OperationsDiscovery',
|
||||
'OperationsDiscoveryCollection',
|
||||
'PrepareRequest',
|
||||
'ProxyResourceReference',
|
||||
'PublicIPAddressResourceSettings',
|
||||
'ResourceGroupResourceSettings',
|
||||
'ResourceMoveRequest',
|
||||
'ResourceSettings',
|
||||
'SqlDatabaseResourceSettings',
|
||||
'SqlElasticPoolResourceSettings',
|
||||
'SqlServerResourceSettings',
|
||||
'SubnetReference',
|
||||
'SubnetResourceSettings',
|
||||
'UnresolvedDependency',
|
||||
'UnresolvedDependencyCollection',
|
||||
'UpdateMoveCollectionRequest',
|
||||
'VirtualMachineResourceSettings',
|
||||
'VirtualNetworkResourceSettings',
|
||||
'DependencyType',
|
||||
'MoveResourceInputType',
|
||||
'MoveState',
|
||||
'ProvisioningState',
|
||||
'ResolutionType',
|
||||
'ResourceIdentityType',
|
||||
'TargetAvailabilityZone',
|
||||
'ZoneRedundant',
|
||||
]
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,81 @@
|
|||
# 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 DependencyType(str, Enum):
|
||||
"""Defines the dependency type.
|
||||
"""
|
||||
|
||||
required_for_prepare = "RequiredForPrepare"
|
||||
required_for_move = "RequiredForMove"
|
||||
|
||||
class MoveResourceInputType(str, Enum):
|
||||
"""Defines the move resource input type.
|
||||
"""
|
||||
|
||||
move_resource_id = "MoveResourceId"
|
||||
move_resource_source_id = "MoveResourceSourceId"
|
||||
|
||||
class MoveState(str, Enum):
|
||||
"""Defines the MoveResource states.
|
||||
"""
|
||||
|
||||
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"
|
||||
|
||||
class ProvisioningState(str, Enum):
|
||||
"""Defines the provisioning states.
|
||||
"""
|
||||
|
||||
succeeded = "Succeeded"
|
||||
updating = "Updating"
|
||||
creating = "Creating"
|
||||
failed = "Failed"
|
||||
|
||||
class ResolutionType(str, Enum):
|
||||
"""Defines the resolution type.
|
||||
"""
|
||||
|
||||
manual = "Manual"
|
||||
automatic = "Automatic"
|
||||
|
||||
class ResourceIdentityType(str, Enum):
|
||||
"""The type of identity used for the resource mover service.
|
||||
"""
|
||||
|
||||
none = "None"
|
||||
system_assigned = "SystemAssigned"
|
||||
user_assigned = "UserAssigned"
|
||||
|
||||
class TargetAvailabilityZone(str, Enum):
|
||||
"""Gets or sets the target availability zone.
|
||||
"""
|
||||
|
||||
one = "1"
|
||||
two = "2"
|
||||
three = "3"
|
||||
na = "NA"
|
||||
|
||||
class ZoneRedundant(str, Enum):
|
||||
"""Defines the zone redundant resource setting.
|
||||
"""
|
||||
|
||||
enable = "Enable"
|
||||
disable = "Disable"
|
|
@ -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 ._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',
|
||||
]
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,430 @@
|
|||
# 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 typing import TYPE_CHECKING
|
||||
import warnings
|
||||
|
||||
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
|
||||
from azure.core.paging import ItemPaged
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import HttpRequest, HttpResponse
|
||||
from azure.core.polling import LROPoller, NoPolling, PollingMethod
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
from azure.mgmt.core.polling.arm_polling import ARMPolling
|
||||
|
||||
from .. import models
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union
|
||||
|
||||
T = TypeVar('T')
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
class MoveResourcesOperations(object):
|
||||
"""MoveResourcesOperations operations.
|
||||
|
||||
You should not instantiate this class directly. Instead, you should create a Client instance that
|
||||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~resource_mover_service_api.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
:param deserializer: An object model deserializer.
|
||||
"""
|
||||
|
||||
models = models
|
||||
|
||||
def __init__(self, client, config, serializer, deserializer):
|
||||
self._client = client
|
||||
self._serialize = serializer
|
||||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
|
||||
def list(
|
||||
self,
|
||||
resource_group_name, # type: str
|
||||
move_collection_name, # type: str
|
||||
filter=None, # type: Optional[str]
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> Iterable["models.MoveResourceCollection"]
|
||||
"""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
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: An iterator like instance of either MoveResourceCollection or the result of cls(response)
|
||||
:rtype: ~azure.core.paging.ItemPaged[~resource_mover_service_api.models.MoveResourceCollection]
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MoveResourceCollection"]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
|
||||
def prepare_request(next_link=None):
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
if not next_link:
|
||||
# Construct URL
|
||||
url = self.list.metadata['url'] # type: ignore
|
||||
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 = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
if filter is not None:
|
||||
query_parameters['$filter'] = self._serialize.query("filter", filter, 'str')
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
else:
|
||||
url = next_link
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
return request
|
||||
|
||||
def extract_data(pipeline_response):
|
||||
deserialized = self._deserialize('MoveResourceCollection', pipeline_response)
|
||||
list_of_elem = deserialized.value
|
||||
if cls:
|
||||
list_of_elem = cls(list_of_elem)
|
||||
return deserialized.next_link or None, iter(list_of_elem)
|
||||
|
||||
def get_next(next_link=None):
|
||||
request = prepare_request(next_link)
|
||||
|
||||
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
return pipeline_response
|
||||
|
||||
return ItemPaged(
|
||||
get_next, extract_data
|
||||
)
|
||||
list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources'} # type: ignore
|
||||
|
||||
def _create_initial(
|
||||
self,
|
||||
resource_group_name, # type: str
|
||||
move_collection_name, # type: str
|
||||
move_resource_name, # type: str
|
||||
body=None, # type: Optional["models.MoveResource"]
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> Optional["models.MoveResource"]
|
||||
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.MoveResource"]]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
content_type = kwargs.pop("content_type", "application/json")
|
||||
|
||||
# Construct URL
|
||||
url = self._create_initial.metadata['url'] # type: ignore
|
||||
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 = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str')
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
body_content_kwargs = {} # type: Dict[str, Any]
|
||||
if body is not None:
|
||||
body_content = self._serialize.body(body, 'MoveResource')
|
||||
else:
|
||||
body_content = None
|
||||
body_content_kwargs['content'] = body_content
|
||||
request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs)
|
||||
|
||||
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200, 202]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = None
|
||||
if response.status_code == 200:
|
||||
deserialized = self._deserialize('MoveResource', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
_create_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore
|
||||
|
||||
def begin_create(
|
||||
self,
|
||||
resource_group_name, # type: str
|
||||
move_collection_name, # type: str
|
||||
move_resource_name, # type: str
|
||||
body=None, # type: Optional["models.MoveResource"]
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> LROPoller["models.MoveResource"]
|
||||
"""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 body:
|
||||
:type body: ~resource_mover_service_api.models.MoveResource
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
|
||||
:keyword polling: True for ARMPolling, False for no polling, or a
|
||||
polling object for personal polling strategy
|
||||
:paramtype polling: bool or ~azure.core.polling.PollingMethod
|
||||
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
|
||||
:return: An instance of LROPoller that returns either MoveResource or the result of cls(response)
|
||||
:rtype: ~azure.core.polling.LROPoller[~resource_mover_service_api.models.MoveResource]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MoveResource"]
|
||||
lro_delay = kwargs.pop(
|
||||
'polling_interval',
|
||||
self._config.polling_interval
|
||||
)
|
||||
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
|
||||
if cont_token is None:
|
||||
raw_result = self._create_initial(
|
||||
resource_group_name=resource_group_name,
|
||||
move_collection_name=move_collection_name,
|
||||
move_resource_name=move_resource_name,
|
||||
body=body,
|
||||
cls=lambda x,y,z: x,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
kwargs.pop('error_map', None)
|
||||
kwargs.pop('content_type', None)
|
||||
|
||||
def get_long_running_output(pipeline_response):
|
||||
deserialized = self._deserialize('MoveResource', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return deserialized
|
||||
|
||||
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
|
||||
elif polling is False: polling_method = NoPolling()
|
||||
else: polling_method = polling
|
||||
if cont_token:
|
||||
return LROPoller.from_continuation_token(
|
||||
polling_method=polling_method,
|
||||
continuation_token=cont_token,
|
||||
client=self._client,
|
||||
deserialization_callback=get_long_running_output
|
||||
)
|
||||
else:
|
||||
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
|
||||
begin_create.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore
|
||||
|
||||
def _delete_initial(
|
||||
self,
|
||||
resource_group_name, # type: str
|
||||
move_collection_name, # type: str
|
||||
move_resource_name, # type: str
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> Optional["models.OperationStatus"]
|
||||
cls = kwargs.pop('cls', None) # type: ClsType[Optional["models.OperationStatus"]]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
|
||||
# Construct URL
|
||||
url = self._delete_initial.metadata['url'] # type: ignore
|
||||
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 = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
request = self._client.delete(url, query_parameters, header_parameters)
|
||||
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200, 202, 204]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = None
|
||||
if response.status_code == 200:
|
||||
deserialized = self._deserialize('OperationStatus', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
_delete_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore
|
||||
|
||||
def begin_delete(
|
||||
self,
|
||||
resource_group_name, # type: str
|
||||
move_collection_name, # type: str
|
||||
move_resource_name, # type: str
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> LROPoller["models.OperationStatus"]
|
||||
"""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
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
|
||||
:keyword polling: True for ARMPolling, False for no polling, or a
|
||||
polling object for personal polling strategy
|
||||
:paramtype polling: bool or ~azure.core.polling.PollingMethod
|
||||
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present.
|
||||
:return: An instance of LROPoller that returns either OperationStatus or the result of cls(response)
|
||||
:rtype: ~azure.core.polling.LROPoller[~resource_mover_service_api.models.OperationStatus]
|
||||
:raises ~azure.core.exceptions.HttpResponseError:
|
||||
"""
|
||||
polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod]
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationStatus"]
|
||||
lro_delay = kwargs.pop(
|
||||
'polling_interval',
|
||||
self._config.polling_interval
|
||||
)
|
||||
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
|
||||
if cont_token is None:
|
||||
raw_result = self._delete_initial(
|
||||
resource_group_name=resource_group_name,
|
||||
move_collection_name=move_collection_name,
|
||||
move_resource_name=move_resource_name,
|
||||
cls=lambda x,y,z: x,
|
||||
**kwargs
|
||||
)
|
||||
|
||||
kwargs.pop('error_map', None)
|
||||
kwargs.pop('content_type', None)
|
||||
|
||||
def get_long_running_output(pipeline_response):
|
||||
deserialized = self._deserialize('OperationStatus', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
return deserialized
|
||||
|
||||
if polling is True: polling_method = ARMPolling(lro_delay, lro_options={'final-state-via': 'azure-async-operation'}, **kwargs)
|
||||
elif polling is False: polling_method = NoPolling()
|
||||
else: polling_method = polling
|
||||
if cont_token:
|
||||
return LROPoller.from_continuation_token(
|
||||
polling_method=polling_method,
|
||||
continuation_token=cont_token,
|
||||
client=self._client,
|
||||
deserialization_callback=get_long_running_output
|
||||
)
|
||||
else:
|
||||
return LROPoller(self._client, raw_result, get_long_running_output, polling_method)
|
||||
begin_delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore
|
||||
|
||||
def get(
|
||||
self,
|
||||
resource_group_name, # type: str
|
||||
move_collection_name, # type: str
|
||||
move_resource_name, # type: str
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> "models.MoveResource"
|
||||
"""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
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: MoveResource, or the result of cls(response)
|
||||
:rtype: ~resource_mover_service_api.models.MoveResource
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.MoveResource"]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
|
||||
# Construct URL
|
||||
url = self.get.metadata['url'] # type: ignore
|
||||
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 = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize('MoveResource', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/moveResources/{moveResourceName}'} # type: ignore
|
|
@ -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 typing import TYPE_CHECKING
|
||||
import warnings
|
||||
|
||||
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import HttpRequest, HttpResponse
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from .. import models
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
|
||||
|
||||
T = TypeVar('T')
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
class OperationsDiscoveryOperations(object):
|
||||
"""OperationsDiscoveryOperations operations.
|
||||
|
||||
You should not instantiate this class directly. Instead, you should create a Client instance that
|
||||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~resource_mover_service_api.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
:param deserializer: An object model deserializer.
|
||||
"""
|
||||
|
||||
models = models
|
||||
|
||||
def __init__(self, client, config, serializer, deserializer):
|
||||
self._client = client
|
||||
self._serialize = serializer
|
||||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
|
||||
def get(
|
||||
self,
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> "models.OperationsDiscoveryCollection"
|
||||
"""get.
|
||||
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: OperationsDiscoveryCollection, or the result of cls(response)
|
||||
:rtype: ~resource_mover_service_api.models.OperationsDiscoveryCollection
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.OperationsDiscoveryCollection"]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
|
||||
# Construct URL
|
||||
url = self.get.metadata['url'] # type: ignore
|
||||
|
||||
# Construct parameters
|
||||
query_parameters = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize('OperationsDiscoveryCollection', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
get.metadata = {'url': '/providers/Microsoft.Migrate/operations'} # type: ignore
|
|
@ -0,0 +1,101 @@
|
|||
# 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 typing import TYPE_CHECKING
|
||||
import warnings
|
||||
|
||||
from azure.core.exceptions import HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
|
||||
from azure.core.pipeline import PipelineResponse
|
||||
from azure.core.pipeline.transport import HttpRequest, HttpResponse
|
||||
from azure.mgmt.core.exceptions import ARMErrorFormat
|
||||
|
||||
from .. import models
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# pylint: disable=unused-import,ungrouped-imports
|
||||
from typing import Any, Callable, Dict, Generic, Optional, TypeVar
|
||||
|
||||
T = TypeVar('T')
|
||||
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]
|
||||
|
||||
class UnresolvedDependenciesOperations(object):
|
||||
"""UnresolvedDependenciesOperations operations.
|
||||
|
||||
You should not instantiate this class directly. Instead, you should create a Client instance that
|
||||
instantiates it for you and attaches it as an attribute.
|
||||
|
||||
:ivar models: Alias to model classes used in this operation group.
|
||||
:type models: ~resource_mover_service_api.models
|
||||
:param client: Client for service requests.
|
||||
:param config: Configuration of service client.
|
||||
:param serializer: An object model serializer.
|
||||
:param deserializer: An object model deserializer.
|
||||
"""
|
||||
|
||||
models = models
|
||||
|
||||
def __init__(self, client, config, serializer, deserializer):
|
||||
self._client = client
|
||||
self._serialize = serializer
|
||||
self._deserialize = deserializer
|
||||
self._config = config
|
||||
|
||||
def get(
|
||||
self,
|
||||
resource_group_name, # type: str
|
||||
move_collection_name, # type: str
|
||||
**kwargs # type: Any
|
||||
):
|
||||
# type: (...) -> "models.UnresolvedDependencyCollection"
|
||||
"""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
|
||||
:keyword callable cls: A custom type or function that will be passed the direct response
|
||||
:return: UnresolvedDependencyCollection, or the result of cls(response)
|
||||
:rtype: ~resource_mover_service_api.models.UnresolvedDependencyCollection
|
||||
:raises: ~azure.core.exceptions.HttpResponseError
|
||||
"""
|
||||
cls = kwargs.pop('cls', None) # type: ClsType["models.UnresolvedDependencyCollection"]
|
||||
error_map = {404: ResourceNotFoundError, 409: ResourceExistsError}
|
||||
error_map.update(kwargs.pop('error_map', {}))
|
||||
api_version = "2019-10-01-preview"
|
||||
|
||||
# Construct URL
|
||||
url = self.get.metadata['url'] # type: ignore
|
||||
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 = {} # type: Dict[str, Any]
|
||||
query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str')
|
||||
|
||||
# Construct headers
|
||||
header_parameters = {} # type: Dict[str, Any]
|
||||
header_parameters['Accept'] = 'application/json'
|
||||
|
||||
request = self._client.get(url, query_parameters, header_parameters)
|
||||
pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)
|
||||
response = pipeline_response.http_response
|
||||
|
||||
if response.status_code not in [200]:
|
||||
map_error(status_code=response.status_code, response=response, error_map=error_map)
|
||||
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
|
||||
|
||||
deserialized = self._deserialize('UnresolvedDependencyCollection', pipeline_response)
|
||||
|
||||
if cls:
|
||||
return cls(pipeline_response, deserialized, {})
|
||||
|
||||
return deserialized
|
||||
get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Migrate/moveCollections/{moveCollectionName}/unresolvedDependencies'} # type: ignore
|
|
@ -0,0 +1 @@
|
|||
# Marker file for PEP 561.
|
|
@ -0,0 +1 @@
|
|||
-e ../../../tools/azure-sdk-tools
|
|
@ -0,0 +1,8 @@
|
|||
[packaging]
|
||||
package_name = "azure-mgmt-resourcemover"
|
||||
package_nspkg = "azure-mgmt-nspkg"
|
||||
package_pprint_name = "Resource Mover Management"
|
||||
package_doc_id = ""
|
||||
is_stable = false
|
||||
is_arm = true
|
||||
need_msrestazure = true
|
|
@ -0,0 +1,2 @@
|
|||
[bdist_wheel]
|
||||
universal=1
|
|
@ -0,0 +1,90 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
#-------------------------------------------------------------------------
|
||||
# Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
# Licensed under the MIT License. See License.txt in the project root for
|
||||
# license information.
|
||||
#--------------------------------------------------------------------------
|
||||
|
||||
import re
|
||||
import os.path
|
||||
from io import open
|
||||
from setuptools import find_packages, setup
|
||||
|
||||
# Change the PACKAGE_NAME only to change folder and different name
|
||||
PACKAGE_NAME = "azure-mgmt-resourcemover"
|
||||
PACKAGE_PPRINT_NAME = "Resource Mover Management"
|
||||
|
||||
# a-b-c => a/b/c
|
||||
package_folder_path = PACKAGE_NAME.replace('-', '/')
|
||||
# a-b-c => a.b.c
|
||||
namespace_name = PACKAGE_NAME.replace('-', '.')
|
||||
|
||||
# azure v0.x is not compatible with this package
|
||||
# azure v0.x used to have a __version__ attribute (newer versions don't)
|
||||
try:
|
||||
import azure
|
||||
try:
|
||||
ver = azure.__version__
|
||||
raise Exception(
|
||||
'This package is incompatible with azure=={}. '.format(ver) +
|
||||
'Uninstall it with "pip uninstall azure".'
|
||||
)
|
||||
except AttributeError:
|
||||
pass
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
# Version extraction inspired from 'requests'
|
||||
with open(os.path.join(package_folder_path, 'version.py')
|
||||
if os.path.exists(os.path.join(package_folder_path, 'version.py'))
|
||||
else os.path.join(package_folder_path, '_version.py'), 'r') as fd:
|
||||
version = re.search(r'^VERSION\s*=\s*[\'"]([^\'"]*)[\'"]',
|
||||
fd.read(), re.MULTILINE).group(1)
|
||||
|
||||
if not version:
|
||||
raise RuntimeError('Cannot find version information')
|
||||
|
||||
with open('README.md', encoding='utf-8') as f:
|
||||
readme = f.read()
|
||||
with open('CHANGELOG.md', encoding='utf-8') as f:
|
||||
changelog = f.read()
|
||||
|
||||
setup(
|
||||
name=PACKAGE_NAME,
|
||||
version=version,
|
||||
description='Microsoft Azure {} Client Library for Python'.format(PACKAGE_PPRINT_NAME),
|
||||
long_description=readme + '\n\n' + changelog,
|
||||
long_description_content_type='text/markdown',
|
||||
license='MIT License',
|
||||
author='Microsoft Corporation',
|
||||
author_email='azpysdkhelp@microsoft.com',
|
||||
url='https://github.com/Azure/azure-sdk-for-python',
|
||||
classifiers=[
|
||||
'Development Status :: 4 - Beta',
|
||||
'Programming Language :: Python',
|
||||
'Programming Language :: Python :: 2',
|
||||
'Programming Language :: Python :: 2.7',
|
||||
'Programming Language :: Python :: 3',
|
||||
'Programming Language :: Python :: 3.5',
|
||||
'Programming Language :: Python :: 3.6',
|
||||
'Programming Language :: Python :: 3.7',
|
||||
'Programming Language :: Python :: 3.8',
|
||||
'License :: OSI Approved :: MIT License',
|
||||
],
|
||||
zip_safe=False,
|
||||
packages=find_packages(exclude=[
|
||||
'tests',
|
||||
# Exclude packages that will be covered by PEP420 or nspkg
|
||||
'azure',
|
||||
'azure.mgmt',
|
||||
]),
|
||||
install_requires=[
|
||||
'msrest>=0.5.0',
|
||||
'msrestazure>=0.4.32,<2.0.0',
|
||||
'azure-common~=1.1',
|
||||
],
|
||||
extras_require={
|
||||
":python_version<'3.0'": ['azure-mgmt-nspkg'],
|
||||
}
|
||||
)
|
Загрузка…
Ссылка в новой задаче