Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[ReleasePR track2_azure-mgmt-recoveryservices] [Hub Generated] Review request for Microsoft.RecoveryServices to add version stable/2022-02-01 #19507

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
include _meta.json
recursive-include tests *.py *.yaml
include *.md
include azure/__init__.py
Expand Down
11 changes: 11 additions & 0 deletions sdk/recoveryservices/azure-mgmt-recoveryservices/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"autorest": "3.4.2",
"use": [
"@autorest/python@5.8.1",
"@autorest/modelerfour@4.19.2"
],
"commit": "7f530e3727f746e26f5b5ece8a5874daf10cc56f",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"autorest_command": "autorest specification/recoveryservices/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.1 --use=@autorest/modelerfour@4.19.2 --version=3.4.2",
"readme": "specification/recoveryservices/resource-manager/readme.md"
}
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2016-06-01"
self.api_version = "2021-03-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-recoveryservices/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
{
"chosen_version": "2016-06-01",
"total_api_version_list": ["2016-06-01"],
"chosen_version": "2021-03-01",
"total_api_version_list": ["2021-03-01"],
"client": {
"name": "RecoveryServicesClient",
"filename": "_recovery_services_client",
"description": "Recovery Services Client.",
"base_url": "\u0027https://management.azure.com\u0027",
"custom_base_url": null,
"azure_arm": true,
"has_lro_operations": false,
"client_side_validation": false
"has_lro_operations": true,
"client_side_validation": false,
"sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RecoveryServicesClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}",
"async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"RecoveryServicesClientConfiguration\"], \"._operations_mixin\": [\"RecoveryServicesClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}"
},
"global_parameters": {
"sync": {
Expand All @@ -28,28 +30,72 @@
},
"async": {
"credential": {
"signature": "credential, # type: \"AsyncTokenCredential\"",
"signature": "credential: \"AsyncTokenCredential\",",
"description": "Credential needed for the client to connect to Azure.",
"docstring_type": "~azure.core.credentials_async.AsyncTokenCredential",
"required": true
},
"subscription_id": {
"signature": "subscription_id, # type: str",
"signature": "subscription_id: str,",
"description": "The subscription Id.",
"docstring_type": "str",
"required": true
}
},
"constant": {
},
"call": "credential, subscription_id"
"call": "credential, subscription_id",
"service_client_specific": {
"sync": {
"api_version": {
"signature": "api_version=None, # type: Optional[str]",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url=None, # type: Optional[str]",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile=KnownProfiles.default, # type: KnownProfiles",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
},
"async": {
"api_version": {
"signature": "api_version: Optional[str] = None,",
"description": "API version to use if no profile is provided, or if missing in profile.",
"docstring_type": "str",
"required": false
},
"base_url": {
"signature": "base_url: Optional[str] = None,",
"description": "Service URL",
"docstring_type": "str",
"required": false
},
"profile": {
"signature": "profile: KnownProfiles = KnownProfiles.default,",
"description": "A profile definition, from KnownProfiles to dict.",
"docstring_type": "azure.profiles.KnownProfiles",
"required": false
}
}
}
},
"config": {
"credential": true,
"credential_scopes": ["https://management.azure.com/.default"],
"credential_default_policy_type": "BearerTokenCredentialPolicy",
"credential_default_policy_type_has_async_version": true,
"credential_key_header_name": null
"credential_key_header_name": null,
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\"._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.configuration\": [\"Configuration\"], \"azure.core.pipeline\": [\"policies\"], \"azure.mgmt.core.policies\": [\"ARMHttpLoggingPolicy\"]}, \"local\": {\".._version\": [\"VERSION\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\"]}}, \"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}}"
},
"operation_groups": {
"vault_certificates": "VaultCertificatesOperations",
Expand All @@ -63,7 +109,33 @@
"usages": "UsagesOperations"
},
"operation_mixins": {
},
"sync_imports": "None",
"async_imports": "None"
"sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}",
"async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}",
"operations": {
"get_operation_status" : {
"sync": {
"signature": "def get_operation_status(\n self,\n resource_group_name, # type: str\n vault_name, # type: str\n operation_id, # type: str\n **kwargs # type: Any\n):\n",
"doc": "\"\"\"Gets the operation status for a resource.\n\n:param resource_group_name: The name of the resource group where the recovery services vault is\n present.\n:type resource_group_name: str\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\n:param operation_id:\n:type operation_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OperationResource, or the result of cls(response)\n:rtype: ~azure.mgmt.recoveryservices.models.OperationResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def get_operation_status(\n self,\n resource_group_name: str,\n vault_name: str,\n operation_id: str,\n **kwargs: Any\n) -\u003e \"_models.OperationResource\":\n",
"doc": "\"\"\"Gets the operation status for a resource.\n\n:param resource_group_name: The name of the resource group where the recovery services vault is\n present.\n:type resource_group_name: str\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\n:param operation_id:\n:type operation_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: OperationResource, or the result of cls(response)\n:rtype: ~azure.mgmt.recoveryservices.models.OperationResource\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": "resource_group_name, vault_name, operation_id"
},
"get_operation_result" : {
"sync": {
"signature": "def get_operation_result(\n self,\n resource_group_name, # type: str\n vault_name, # type: str\n operation_id, # type: str\n **kwargs # type: Any\n):\n",
"doc": "\"\"\"Gets the operation result for a resource.\n\n:param resource_group_name: The name of the resource group where the recovery services vault is\n present.\n:type resource_group_name: str\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\n:param operation_id:\n:type operation_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Vault, or the result of cls(response)\n:rtype: ~azure.mgmt.recoveryservices.models.Vault or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"async": {
"coroutine": true,
"signature": "async def get_operation_result(\n self,\n resource_group_name: str,\n vault_name: str,\n operation_id: str,\n **kwargs: Any\n) -\u003e Optional[\"_models.Vault\"]:\n",
"doc": "\"\"\"Gets the operation result for a resource.\n\n:param resource_group_name: The name of the resource group where the recovery services vault is\n present.\n:type resource_group_name: str\n:param vault_name: The name of the recovery services vault.\n:type vault_name: str\n:param operation_id:\n:type operation_id: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: Vault, or the result of cls(response)\n:rtype: ~azure.mgmt.recoveryservices.models.Vault or None\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\""
},
"call": "resource_group_name, vault_name, operation_id"
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
from typing import Any, Optional

from azure.core.credentials import TokenCredential
from azure.core.pipeline.transport import HttpRequest, HttpResponse

from ._configuration import RecoveryServicesClientConfiguration
from .operations import VaultCertificatesOperations
Expand All @@ -26,11 +27,12 @@
from .operations import VaultsOperations
from .operations import Operations
from .operations import VaultExtendedInfoOperations
from .operations import RecoveryServicesClientOperationsMixin
from .operations import UsagesOperations
from . import models


class RecoveryServicesClient(object):
class RecoveryServicesClient(RecoveryServicesClientOperationsMixin):
"""Recovery Services Client.

:ivar vault_certificates: VaultCertificatesOperations operations
Expand All @@ -56,6 +58,7 @@ class RecoveryServicesClient(object):
: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__(
Expand Down Expand Up @@ -95,6 +98,24 @@ def __init__(
self.usages = UsagesOperations(
self._client, self._config, self._serialize, self._deserialize)

def _send_request(self, http_request, **kwargs):
# type: (HttpRequest, Any) -> HttpResponse
"""Runs the network request through the client's chained policies.

:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.HttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

def close(self):
# type: () -> None
self._client.close()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# --------------------------------------------------------------------------

VERSION = "1.0.0"
VERSION = "1.0.0b1"
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def __init__(

self.credential = credential
self.subscription_id = subscription_id
self.api_version = "2016-06-01"
self.api_version = "2021-03-01"
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
kwargs.setdefault('sdk_moniker', 'mgmt-recoveryservices/{}'.format(VERSION))
self._configure(**kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from typing import Any, Optional, TYPE_CHECKING

from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest
from azure.mgmt.core import AsyncARMPipelineClient
from msrest import Deserializer, Serializer

Expand All @@ -24,11 +25,12 @@
from .operations import VaultsOperations
from .operations import Operations
from .operations import VaultExtendedInfoOperations
from .operations import RecoveryServicesClientOperationsMixin
from .operations import UsagesOperations
from .. import models


class RecoveryServicesClient(object):
class RecoveryServicesClient(RecoveryServicesClientOperationsMixin):
"""Recovery Services Client.

:ivar vault_certificates: VaultCertificatesOperations operations
Expand All @@ -54,6 +56,7 @@ class RecoveryServicesClient(object):
: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__(
Expand Down Expand Up @@ -92,6 +95,23 @@ def __init__(
self.usages = UsagesOperations(
self._client, self._config, self._serialize, self._deserialize)

async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse:
"""Runs the network request through the client's chained policies.

:param http_request: The network request you want to make. Required.
:type http_request: ~azure.core.pipeline.transport.HttpRequest
:keyword bool stream: Whether the response payload will be streamed. Defaults to True.
:return: The response of your network call. Does not do error handling on your response.
:rtype: ~azure.core.pipeline.transport.AsyncHttpResponse
"""
path_format_arguments = {
'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str'),
}
http_request.url = self._client.format_url(http_request.url, **path_format_arguments)
stream = kwargs.pop("stream", True)
pipeline_response = await self._client._pipeline.run(http_request, stream=stream, **kwargs)
return pipeline_response.http_response

async def close(self) -> None:
await self._client.close()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from ._vaults_operations import VaultsOperations
from ._operations import Operations
from ._vault_extended_info_operations import VaultExtendedInfoOperations
from ._recovery_services_client_operations import RecoveryServicesClientOperationsMixin
from ._usages_operations import UsagesOperations

__all__ = [
Expand All @@ -25,5 +26,6 @@
'VaultsOperations',
'Operations',
'VaultExtendedInfoOperations',
'RecoveryServicesClientOperationsMixin',
'UsagesOperations',
]
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def __init__(self, client, config, serializer, deserializer) -> None:

def list(
self,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.ClientDiscoveryResponse"]:
"""Returns the list of available operations.

Expand All @@ -57,7 +57,7 @@ def list(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2016-06-01"
api_version = "2021-03-01"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def list(
self,
resource_group_name: str,
vault_name: str,
**kwargs
**kwargs: Any
) -> AsyncIterable["_models.PrivateLinkResources"]:
"""Returns the list of private link resources that need to be created for Backup and SiteRecovery.

Expand All @@ -66,7 +66,7 @@ def list(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2016-06-01"
api_version = "2021-03-01"
accept = "application/json"

def prepare_request(next_link=None):
Expand Down Expand Up @@ -123,7 +123,7 @@ async def get(
resource_group_name: str,
vault_name: str,
private_link_resource_name: str,
**kwargs
**kwargs: Any
) -> "_models.PrivateLinkResource":
"""Returns a specified private link resource that need to be created for Backup and SiteRecovery.

Expand All @@ -146,7 +146,7 @@ async def get(
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
error_map.update(kwargs.pop('error_map', {}))
api_version = "2016-06-01"
api_version = "2021-03-01"
accept = "application/json"

# Construct URL
Expand Down
Loading