Skip to content

Commit d3f4840

Browse files
authored
code and test (#34594)
Co-authored-by: azure-sdk <PythonSdkPipelines>
1 parent 3b74339 commit d3f4840

File tree

310 files changed

+839
-601
lines changed

Some content is hidden

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

310 files changed

+839
-601
lines changed

sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
# Release History
22

3+
## 10.0.0b3 (2024-03-18)
4+
5+
### Features Added
6+
7+
- Added operation DataTransferJobsOperations.complete
8+
- Model DatabaseAccountCreateUpdateParameters has a new parameter enable_per_region_per_partition_autoscale
9+
- Model DatabaseAccountGetResults has a new parameter enable_per_region_per_partition_autoscale
10+
- Model DatabaseAccountUpdateParameters has a new parameter enable_per_region_per_partition_autoscale
11+
- Model PrivateEndpointConnection has a new parameter system_data
12+
- Model ProxyResource has a new parameter system_data
13+
- Model Resource has a new parameter system_data
14+
- Model ResourceRestoreParameters has a new parameter restore_with_ttl_disabled
15+
- Model RestoreParameters has a new parameter restore_with_ttl_disabled
16+
- Model RestoreParametersBase has a new parameter restore_with_ttl_disabled
17+
318
## 10.0.0b2 (2024-01-26)
419

520
### Features Added

sdk/cosmos/azure-mgmt-cosmosdb/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Microsoft Azure SDK for Python
22

33
This is the Microsoft Azure Cosmos DB Management Client Library.
4-
This package has been tested with Python 3.7+.
4+
This package has been tested with Python 3.8+.
55
For a more complete view of Azure libraries, see the [azure sdk python release](https://aka.ms/azsdk/python/all).
66

77
## _Disclaimer_
@@ -12,7 +12,7 @@ _Azure SDK Python packages support for Python 2.7 has ended 01 January 2022. For
1212

1313
### Prerequisites
1414

15-
- Python 3.7+ is required to use this package.
15+
- Python 3.8+ is required to use this package.
1616
- [Azure subscription](https://azure.microsoft.com/free/)
1717

1818
### Install the package

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"commit": "8e674dd2a88ae73868c6fa7593a0ba4371e45991",
2+
"commit": "01a71545e82bb98b8137d3038150c436d46a59ed",
33
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
44
"autorest": "3.9.7",
55
"use": [

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=t
2929
:type credential: ~azure.core.credentials.TokenCredential
3030
:param subscription_id: The ID of the target subscription. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-11-15-preview". Note that overriding
32+
:keyword api_version: Api Version. Default value is "2024-02-15-preview". Note that overriding
3333
this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

3737
def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None:
3838
super(CosmosDBManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-11-15-preview")
39+
api_version: str = kwargs.pop("api_version", "2024-02-15-preview")
4040

4141
if credential is None:
4242
raise ValueError("Parameter 'credential' must not be None.")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke
182182
:type subscription_id: str
183183
:param base_url: Service URL. Default value is "https://management.azure.com".
184184
:type base_url: str
185-
:keyword api_version: Api Version. Default value is "2023-11-15-preview". Note that overriding
185+
:keyword api_version: Api Version. Default value is "2024-02-15-preview". Note that overriding
186186
this default value may result in unsupported behavior.
187187
:paramtype api_version: str
188188
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no

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 = "10.0.0b2"
9+
VERSION = "10.0.0b3"

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@ class CosmosDBManagementClientConfiguration(Configuration): # pylint: disable=t
2929
:type credential: ~azure.core.credentials_async.AsyncTokenCredential
3030
:param subscription_id: The ID of the target subscription. Required.
3131
:type subscription_id: str
32-
:keyword api_version: Api Version. Default value is "2023-11-15-preview". Note that overriding
32+
:keyword api_version: Api Version. Default value is "2024-02-15-preview". Note that overriding
3333
this default value may result in unsupported behavior.
3434
:paramtype api_version: str
3535
"""
3636

3737
def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None:
3838
super(CosmosDBManagementClientConfiguration, self).__init__(**kwargs)
39-
api_version: str = kwargs.pop("api_version", "2023-11-15-preview")
39+
api_version: str = kwargs.pop("api_version", "2024-02-15-preview")
4040

4141
if credential is None:
4242
raise ValueError("Parameter 'credential' must not be None.")

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke
185185
:type subscription_id: str
186186
:param base_url: Service URL. Default value is "https://management.azure.com".
187187
:type base_url: str
188-
:keyword api_version: Api Version. Default value is "2023-11-15-preview". Note that overriding
188+
:keyword api_version: Api Version. Default value is "2024-02-15-preview". Note that overriding
189189
this default value may result in unsupported behavior.
190190
:paramtype api_version: str
191191
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,7 +1608,7 @@ async def get_backup(
16081608
}
16091609

16101610
async def _deallocate_initial( # pylint: disable=inconsistent-return-statements
1611-
self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[bool] = None, **kwargs: Any
1611+
self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[str] = None, **kwargs: Any
16121612
) -> None:
16131613
error_map = {
16141614
401: ClientAuthenticationError,
@@ -1657,7 +1657,7 @@ async def _deallocate_initial( # pylint: disable=inconsistent-return-statements
16571657

16581658
@distributed_trace_async
16591659
async def begin_deallocate(
1660-
self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[bool] = None, **kwargs: Any
1660+
self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[str] = None, **kwargs: Any
16611661
) -> AsyncLROPoller[None]:
16621662
"""Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will
16631663
deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do
@@ -1671,7 +1671,7 @@ async def begin_deallocate(
16711671
:param x_ms_force_deallocate: Force to deallocate a cluster of Cluster Type Production. Force
16721672
to deallocate a cluster of Cluster Type Production might cause data loss. Default value is
16731673
None.
1674-
:type x_ms_force_deallocate: bool
1674+
:type x_ms_force_deallocate: str
16751675
:keyword callable cls: A custom type or function that will be passed the direct response
16761676
:keyword str continuation_token: A continuation token to restart a poller from a saved state.
16771677
:keyword polling: By default, your polling method will be AsyncARMPolling. Pass in False for

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

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from ..._vendor import _convert_request
3232
from ...operations._data_transfer_jobs_operations import (
3333
build_cancel_request,
34+
build_complete_request,
3435
build_create_request,
3536
build_get_request,
3637
build_list_by_database_account_request,
@@ -480,6 +481,73 @@ async def cancel(
480481
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel"
481482
}
482483

484+
@distributed_trace_async
485+
async def complete(
486+
self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any
487+
) -> _models.DataTransferJobGetResults:
488+
"""Completes a Data Transfer Online Job.
489+
490+
:param resource_group_name: The name of the resource group. The name is case insensitive.
491+
Required.
492+
:type resource_group_name: str
493+
:param account_name: Cosmos DB database account name. Required.
494+
:type account_name: str
495+
:param job_name: Name of the Data Transfer Job. Required.
496+
:type job_name: str
497+
:keyword callable cls: A custom type or function that will be passed the direct response
498+
:return: DataTransferJobGetResults or the result of cls(response)
499+
:rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults
500+
:raises ~azure.core.exceptions.HttpResponseError:
501+
"""
502+
error_map = {
503+
401: ClientAuthenticationError,
504+
404: ResourceNotFoundError,
505+
409: ResourceExistsError,
506+
304: ResourceNotModifiedError,
507+
}
508+
error_map.update(kwargs.pop("error_map", {}) or {})
509+
510+
_headers = kwargs.pop("headers", {}) or {}
511+
_params = case_insensitive_dict(kwargs.pop("params", {}) or {})
512+
513+
api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version))
514+
cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None)
515+
516+
request = build_complete_request(
517+
resource_group_name=resource_group_name,
518+
account_name=account_name,
519+
job_name=job_name,
520+
subscription_id=self._config.subscription_id,
521+
api_version=api_version,
522+
template_url=self.complete.metadata["url"],
523+
headers=_headers,
524+
params=_params,
525+
)
526+
request = _convert_request(request)
527+
request.url = self._client.format_url(request.url)
528+
529+
_stream = False
530+
pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access
531+
request, stream=_stream, **kwargs
532+
)
533+
534+
response = pipeline_response.http_response
535+
536+
if response.status_code not in [200]:
537+
map_error(status_code=response.status_code, response=response, error_map=error_map)
538+
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
539+
540+
deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response)
541+
542+
if cls:
543+
return cls(pipeline_response, deserialized, {})
544+
545+
return deserialized
546+
547+
complete.metadata = {
548+
"url": "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete"
549+
}
550+
483551
@distributed_trace
484552
def list_by_database_account(
485553
self, resource_group_name: str, account_name: str, **kwargs: Any

0 commit comments

Comments
 (0)