Skip to content

Commit 82eabb8

Browse files
author
SDKAuto
committed
CodeGen from PR 18087 in Azure/azure-rest-api-specs
Merge 956d91d33fb4478ce1e2fbd2ff8f8a9641eed1c7 into 043ce39a62c16d1b4d87be24b336f4d8900f0ca7
1 parent ecc852e commit 82eabb8

File tree

49 files changed

+1122
-220
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1122
-220
lines changed

sdk/cosmos/azure-mgmt-cosmosdb/_meta.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
"@autorest/[email protected]",
55
"@autorest/[email protected]"
66
],
7-
"commit": "c731fa175f77b7b53ef0579eb877c61b5d0467d6",
7+
"commit": "89c076604c6311b477134d8719befe1bed9cbd01",
88
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
9-
"autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --track2 --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
9+
"autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --multiapi --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --python3-only --use=@autorest/[email protected] --use=@autorest/[email protected] --version=3.7.2",
1010
"readme": "specification/cosmos-db/resource-manager/readme.md"
1111
}

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2021-11-15-preview"
48+
self.api_version = "2022-02-15-preview"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-cosmosdb/{}'.format(VERSION))
5151
self._configure(**kwargs)

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_metadata.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"chosen_version": "2021-11-15-preview",
3-
"total_api_version_list": ["2021-11-15-preview"],
2+
"chosen_version": "2022-02-15-preview",
3+
"total_api_version_list": ["2022-02-15-preview"],
44
"client": {
55
"name": "CosmosDBManagementClient",
66
"filename": "_cosmos_db_management_client",

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
77
# --------------------------------------------------------------------------
88

9-
VERSION = "7.0.0b3"
9+
VERSION = "0.7.0"

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def __init__(
4545

4646
self.credential = credential
4747
self.subscription_id = subscription_id
48-
self.api_version = "2021-11-15-preview"
48+
self.api_version = "2022-02-15-preview"
4949
self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default'])
5050
kwargs.setdefault('sdk_moniker', 'mgmt-cosmosdb/{}'.format(VERSION))
5151
self._configure(**kwargs)

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py

Lines changed: 132 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
from ... import models as _models
2424
from ..._vendor import _convert_request
25-
from ...operations._mongo_db_resources_operations import build_create_update_mongo_db_collection_request_initial, build_create_update_mongo_db_database_request_initial, build_create_update_mongo_role_definition_request_initial, build_create_update_mongo_user_definition_request_initial, build_delete_mongo_db_collection_request_initial, build_delete_mongo_db_database_request_initial, build_delete_mongo_role_definition_request_initial, build_delete_mongo_user_definition_request_initial, build_get_mongo_db_collection_request, build_get_mongo_db_collection_throughput_request, build_get_mongo_db_database_request, build_get_mongo_db_database_throughput_request, build_get_mongo_role_definition_request, build_get_mongo_user_definition_request, build_list_mongo_db_collections_request, build_list_mongo_db_databases_request, build_list_mongo_role_definitions_request, build_list_mongo_user_definitions_request, build_migrate_mongo_db_collection_to_autoscale_request_initial, build_migrate_mongo_db_collection_to_manual_throughput_request_initial, build_migrate_mongo_db_database_to_autoscale_request_initial, build_migrate_mongo_db_database_to_manual_throughput_request_initial, build_retrieve_continuous_backup_information_request_initial, build_update_mongo_db_collection_throughput_request_initial, build_update_mongo_db_database_throughput_request_initial
25+
from ...operations._mongo_db_resources_operations import build_create_update_mongo_db_collection_request_initial, build_create_update_mongo_db_database_request_initial, build_create_update_mongo_role_definition_request_initial, build_create_update_mongo_user_definition_request_initial, build_delete_mongo_db_collection_request_initial, build_delete_mongo_db_database_request_initial, build_delete_mongo_role_definition_request_initial, build_delete_mongo_user_definition_request_initial, build_get_mongo_db_collection_request, build_get_mongo_db_collection_throughput_request, build_get_mongo_db_database_request, build_get_mongo_db_database_throughput_request, build_get_mongo_role_definition_request, build_get_mongo_user_definition_request, build_list_mongo_db_collection_partition_merge_request_initial, build_list_mongo_db_collections_request, build_list_mongo_db_databases_request, build_list_mongo_role_definitions_request, build_list_mongo_user_definitions_request, build_migrate_mongo_db_collection_to_autoscale_request_initial, build_migrate_mongo_db_collection_to_manual_throughput_request_initial, build_migrate_mongo_db_database_to_autoscale_request_initial, build_migrate_mongo_db_database_to_manual_throughput_request_initial, build_retrieve_continuous_backup_information_request_initial, build_update_mongo_db_collection_throughput_request_initial, build_update_mongo_db_database_throughput_request_initial
2626
T = TypeVar('T')
2727
ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]]
2828

@@ -1197,6 +1197,137 @@ def get_long_running_output(pipeline_response):
11971197

11981198
begin_delete_mongo_db_collection.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}'} # type: ignore
11991199

1200+
async def _list_mongo_db_collection_partition_merge_initial(
1201+
self,
1202+
resource_group_name: str,
1203+
account_name: str,
1204+
database_name: str,
1205+
collection_name: str,
1206+
merge_parameters: "_models.MergeParameters",
1207+
**kwargs: Any
1208+
) -> Optional["_models.PhysicalPartitionStorageInfoCollection"]:
1209+
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PhysicalPartitionStorageInfoCollection"]]
1210+
error_map = {
1211+
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
1212+
}
1213+
error_map.update(kwargs.pop('error_map', {}))
1214+
1215+
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
1216+
1217+
_json = self._serialize.body(merge_parameters, 'MergeParameters')
1218+
1219+
request = build_list_mongo_db_collection_partition_merge_request_initial(
1220+
subscription_id=self._config.subscription_id,
1221+
resource_group_name=resource_group_name,
1222+
account_name=account_name,
1223+
database_name=database_name,
1224+
collection_name=collection_name,
1225+
content_type=content_type,
1226+
json=_json,
1227+
template_url=self._list_mongo_db_collection_partition_merge_initial.metadata['url'],
1228+
)
1229+
request = _convert_request(request)
1230+
request.url = self._client.format_url(request.url)
1231+
1232+
pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs)
1233+
response = pipeline_response.http_response
1234+
1235+
if response.status_code not in [200, 202]:
1236+
map_error(status_code=response.status_code, response=response, error_map=error_map)
1237+
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
1238+
1239+
deserialized = None
1240+
if response.status_code == 200:
1241+
deserialized = self._deserialize('PhysicalPartitionStorageInfoCollection', pipeline_response)
1242+
1243+
if cls:
1244+
return cls(pipeline_response, deserialized, {})
1245+
1246+
return deserialized
1247+
1248+
_list_mongo_db_collection_partition_merge_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge'} # type: ignore
1249+
1250+
1251+
@distributed_trace_async
1252+
async def begin_list_mongo_db_collection_partition_merge(
1253+
self,
1254+
resource_group_name: str,
1255+
account_name: str,
1256+
database_name: str,
1257+
collection_name: str,
1258+
merge_parameters: "_models.MergeParameters",
1259+
**kwargs: Any
1260+
) -> AsyncLROPoller["_models.PhysicalPartitionStorageInfoCollection"]:
1261+
"""Merges the partitions of a MongoDB Collection.
1262+
1263+
:param resource_group_name: The name of the resource group. The name is case insensitive.
1264+
:type resource_group_name: str
1265+
:param account_name: Cosmos DB database account name.
1266+
:type account_name: str
1267+
:param database_name: Cosmos DB database name.
1268+
:type database_name: str
1269+
:param collection_name: Cosmos DB collection name.
1270+
:type collection_name: str
1271+
:param merge_parameters: The parameters for the merge operation.
1272+
:type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters
1273+
:keyword callable cls: A custom type or function that will be passed the direct response
1274+
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
1275+
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for
1276+
this operation to not poll, or pass in your own initialized polling object for a personal
1277+
polling strategy.
1278+
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
1279+
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
1280+
Retry-After header is present.
1281+
:return: An instance of AsyncLROPoller that returns either
1282+
PhysicalPartitionStorageInfoCollection or the result of cls(response)
1283+
:rtype:
1284+
~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection]
1285+
:raises: ~azure.core.exceptions.HttpResponseError
1286+
"""
1287+
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
1288+
polling = kwargs.pop('polling', True) # type: Union[bool, azure.core.polling.AsyncPollingMethod]
1289+
cls = kwargs.pop('cls', None) # type: ClsType["_models.PhysicalPartitionStorageInfoCollection"]
1290+
lro_delay = kwargs.pop(
1291+
'polling_interval',
1292+
self._config.polling_interval
1293+
)
1294+
cont_token = kwargs.pop('continuation_token', None) # type: Optional[str]
1295+
if cont_token is None:
1296+
raw_result = await self._list_mongo_db_collection_partition_merge_initial(
1297+
resource_group_name=resource_group_name,
1298+
account_name=account_name,
1299+
database_name=database_name,
1300+
collection_name=collection_name,
1301+
merge_parameters=merge_parameters,
1302+
content_type=content_type,
1303+
cls=lambda x,y,z: x,
1304+
**kwargs
1305+
)
1306+
kwargs.pop('error_map', None)
1307+
1308+
def get_long_running_output(pipeline_response):
1309+
response = pipeline_response.http_response
1310+
deserialized = self._deserialize('PhysicalPartitionStorageInfoCollection', pipeline_response)
1311+
if cls:
1312+
return cls(pipeline_response, deserialized, {})
1313+
return deserialized
1314+
1315+
1316+
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
1317+
elif polling is False: polling_method = AsyncNoPolling()
1318+
else: polling_method = polling
1319+
if cont_token:
1320+
return AsyncLROPoller.from_continuation_token(
1321+
polling_method=polling_method,
1322+
continuation_token=cont_token,
1323+
client=self._client,
1324+
deserialization_callback=get_long_running_output
1325+
)
1326+
else:
1327+
return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method)
1328+
1329+
begin_list_mongo_db_collection_partition_merge.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge'} # type: ignore
1330+
12001331
@distributed_trace_async
12011332
async def get_mongo_db_collection_throughput(
12021333
self,

0 commit comments

Comments
 (0)