Skip to content

Commit 8b607fc

Browse files
author
SDKAuto
committed
CodeGen from PR 18867 in Azure/azure-rest-api-specs
Merge 4948fceea0d547c3dd806d2a266c61bfe4664120 into 50ed15bd61ac79f2368d769df0c207a00b9e099f
1 parent 9c28b76 commit 8b607fc

File tree

8 files changed

+324
-103
lines changed

8 files changed

+324
-103
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": "0baca05c851c1749e92beb0d2134cd958827dd54",
7+
"commit": "f8bd09aa392dc15ac6f539a20a3b356bcda7d90d",
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-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --python3-only --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/_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.0b5"
9+
VERSION = "0.7.0"

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

Lines changed: 50 additions & 28 deletions
Large diffs are not rendered by default.

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

Lines changed: 44 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2178,16 +2178,16 @@ def get_long_running_output(pipeline_response):
21782178

21792179
begin_migrate_sql_container_to_manual_throughput.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput"} # type: ignore
21802180

2181-
async def _sql_container_retrieve_throughput_distribution_initial( # pylint: disable=inconsistent-return-statements
2181+
async def _sql_container_retrieve_throughput_distribution_initial(
21822182
self,
21832183
resource_group_name: str,
21842184
account_name: str,
21852185
database_name: str,
21862186
container_name: str,
21872187
retrieve_throughput_parameters: "_models.RetrieveThroughputParameters",
21882188
**kwargs: Any
2189-
) -> None:
2190-
cls = kwargs.pop('cls', None) # type: ClsType[None]
2189+
) -> Optional["_models.PhysicalPartitionThroughputInfoResult"]:
2190+
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PhysicalPartitionThroughputInfoResult"]]
21912191
error_map = {
21922192
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
21932193
}
@@ -2219,26 +2219,32 @@ async def _sql_container_retrieve_throughput_distribution_initial( # pylint: di
22192219
)
22202220
response = pipeline_response.http_response
22212221

2222-
if response.status_code not in [202]:
2222+
if response.status_code not in [200, 202]:
22232223
map_error(status_code=response.status_code, response=response, error_map=error_map)
22242224
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
22252225

2226+
deserialized = None
2227+
if response.status_code == 200:
2228+
deserialized = self._deserialize('PhysicalPartitionThroughputInfoResult', pipeline_response)
2229+
22262230
if cls:
2227-
return cls(pipeline_response, None, {})
2231+
return cls(pipeline_response, deserialized, {})
2232+
2233+
return deserialized
22282234

22292235
_sql_container_retrieve_throughput_distribution_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore
22302236

22312237

22322238
@distributed_trace_async
2233-
async def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=inconsistent-return-statements
2239+
async def begin_sql_container_retrieve_throughput_distribution(
22342240
self,
22352241
resource_group_name: str,
22362242
account_name: str,
22372243
database_name: str,
22382244
container_name: str,
22392245
retrieve_throughput_parameters: "_models.RetrieveThroughputParameters",
22402246
**kwargs: Any
2241-
) -> AsyncLROPoller[None]:
2247+
) -> AsyncLROPoller["_models.PhysicalPartitionThroughputInfoResult"]:
22422248
"""Retrieve throughput distribution for an Azure Cosmos DB SQL container.
22432249
22442250
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2260,14 +2266,16 @@ async def begin_sql_container_retrieve_throughput_distribution( # pylint: disab
22602266
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
22612267
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
22622268
Retry-After header is present.
2263-
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
2264-
:rtype: ~azure.core.polling.AsyncLROPoller[None]
2269+
:return: An instance of AsyncLROPoller that returns either
2270+
PhysicalPartitionThroughputInfoResult or the result of cls(response)
2271+
:rtype:
2272+
~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult]
22652273
:raises: ~azure.core.exceptions.HttpResponseError
22662274
"""
22672275
api_version = kwargs.pop('api_version', "2022-02-15-preview") # type: str
22682276
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
22692277
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
2270-
cls = kwargs.pop('cls', None) # type: ClsType[None]
2278+
cls = kwargs.pop('cls', None) # type: ClsType["_models.PhysicalPartitionThroughputInfoResult"]
22712279
lro_delay = kwargs.pop(
22722280
'polling_interval',
22732281
self._config.polling_interval
@@ -2288,8 +2296,11 @@ async def begin_sql_container_retrieve_throughput_distribution( # pylint: disab
22882296
kwargs.pop('error_map', None)
22892297

22902298
def get_long_running_output(pipeline_response):
2299+
response = pipeline_response.http_response
2300+
deserialized = self._deserialize('PhysicalPartitionThroughputInfoResult', pipeline_response)
22912301
if cls:
2292-
return cls(pipeline_response, None, {})
2302+
return cls(pipeline_response, deserialized, {})
2303+
return deserialized
22932304

22942305

22952306
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
@@ -2306,16 +2317,16 @@ def get_long_running_output(pipeline_response):
23062317

23072318
begin_sql_container_retrieve_throughput_distribution.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution"} # type: ignore
23082319

2309-
async def _sql_container_redistribute_throughput_initial( # pylint: disable=inconsistent-return-statements
2320+
async def _sql_container_redistribute_throughput_initial(
23102321
self,
23112322
resource_group_name: str,
23122323
account_name: str,
23132324
database_name: str,
23142325
container_name: str,
23152326
redistribute_throughput_parameters: "_models.RedistributeThroughputParameters",
23162327
**kwargs: Any
2317-
) -> None:
2318-
cls = kwargs.pop('cls', None) # type: ClsType[None]
2328+
) -> Optional["_models.PhysicalPartitionThroughputInfoResult"]:
2329+
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PhysicalPartitionThroughputInfoResult"]]
23192330
error_map = {
23202331
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
23212332
}
@@ -2347,26 +2358,32 @@ async def _sql_container_redistribute_throughput_initial( # pylint: disable=inc
23472358
)
23482359
response = pipeline_response.http_response
23492360

2350-
if response.status_code not in [202]:
2361+
if response.status_code not in [200, 202]:
23512362
map_error(status_code=response.status_code, response=response, error_map=error_map)
23522363
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
23532364

2365+
deserialized = None
2366+
if response.status_code == 200:
2367+
deserialized = self._deserialize('PhysicalPartitionThroughputInfoResult', pipeline_response)
2368+
23542369
if cls:
2355-
return cls(pipeline_response, None, {})
2370+
return cls(pipeline_response, deserialized, {})
2371+
2372+
return deserialized
23562373

23572374
_sql_container_redistribute_throughput_initial.metadata = {'url': "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput"} # type: ignore
23582375

23592376

23602377
@distributed_trace_async
2361-
async def begin_sql_container_redistribute_throughput( # pylint: disable=inconsistent-return-statements
2378+
async def begin_sql_container_redistribute_throughput(
23622379
self,
23632380
resource_group_name: str,
23642381
account_name: str,
23652382
database_name: str,
23662383
container_name: str,
23672384
redistribute_throughput_parameters: "_models.RedistributeThroughputParameters",
23682385
**kwargs: Any
2369-
) -> AsyncLROPoller[None]:
2386+
) -> AsyncLROPoller["_models.PhysicalPartitionThroughputInfoResult"]:
23702387
"""Redistribute throughput for an Azure Cosmos DB SQL container.
23712388
23722389
:param resource_group_name: The name of the resource group. The name is case insensitive.
@@ -2389,14 +2406,16 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=incons
23892406
:paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod
23902407
:keyword int polling_interval: Default waiting time between two polls for LRO operations if no
23912408
Retry-After header is present.
2392-
:return: An instance of AsyncLROPoller that returns either None or the result of cls(response)
2393-
:rtype: ~azure.core.polling.AsyncLROPoller[None]
2409+
:return: An instance of AsyncLROPoller that returns either
2410+
PhysicalPartitionThroughputInfoResult or the result of cls(response)
2411+
:rtype:
2412+
~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult]
23942413
:raises: ~azure.core.exceptions.HttpResponseError
23952414
"""
23962415
api_version = kwargs.pop('api_version', "2022-02-15-preview") # type: str
23972416
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
23982417
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
2399-
cls = kwargs.pop('cls', None) # type: ClsType[None]
2418+
cls = kwargs.pop('cls', None) # type: ClsType["_models.PhysicalPartitionThroughputInfoResult"]
24002419
lro_delay = kwargs.pop(
24012420
'polling_interval',
24022421
self._config.polling_interval
@@ -2417,8 +2436,11 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=incons
24172436
kwargs.pop('error_map', None)
24182437

24192438
def get_long_running_output(pipeline_response):
2439+
response = pipeline_response.http_response
2440+
deserialized = self._deserialize('PhysicalPartitionThroughputInfoResult', pipeline_response)
24202441
if cls:
2421-
return cls(pipeline_response, None, {})
2442+
return cls(pipeline_response, deserialized, {})
2443+
return deserialized
24222444

24232445

24242446
if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,10 @@
190190
from ._models_py3 import PhysicalPartitionId
191191
from ._models_py3 import PhysicalPartitionStorageInfo
192192
from ._models_py3 import PhysicalPartitionStorageInfoCollection
193+
from ._models_py3 import PhysicalPartitionThroughputInfoProperties
193194
from ._models_py3 import PhysicalPartitionThroughputInfoResource
195+
from ._models_py3 import PhysicalPartitionThroughputInfoResult
196+
from ._models_py3 import PhysicalPartitionThroughputInfoResultPropertiesResource
194197
from ._models_py3 import PrivateEndpointConnection
195198
from ._models_py3 import PrivateEndpointConnectionListResult
196199
from ._models_py3 import PrivateEndpointProperty
@@ -532,7 +535,10 @@
532535
'PhysicalPartitionId',
533536
'PhysicalPartitionStorageInfo',
534537
'PhysicalPartitionStorageInfoCollection',
538+
'PhysicalPartitionThroughputInfoProperties',
535539
'PhysicalPartitionThroughputInfoResource',
540+
'PhysicalPartitionThroughputInfoResult',
541+
'PhysicalPartitionThroughputInfoResultPropertiesResource',
536542
'PrivateEndpointConnection',
537543
'PrivateEndpointConnectionListResult',
538544
'PrivateEndpointProperty',

sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9533,6 +9533,34 @@ def __init__(
95339533
self.physical_partition_storage_info_collection = None
95349534

95359535

9536+
class PhysicalPartitionThroughputInfoProperties(msrest.serialization.Model):
9537+
"""The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object.
9538+
9539+
:ivar physical_partition_throughput_info: Array of physical partition throughput info objects.
9540+
:vartype physical_partition_throughput_info:
9541+
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
9542+
"""
9543+
9544+
_attribute_map = {
9545+
'physical_partition_throughput_info': {'key': 'physicalPartitionThroughputInfo', 'type': '[PhysicalPartitionThroughputInfoResource]'},
9546+
}
9547+
9548+
def __init__(
9549+
self,
9550+
*,
9551+
physical_partition_throughput_info: Optional[List["PhysicalPartitionThroughputInfoResource"]] = None,
9552+
**kwargs
9553+
):
9554+
"""
9555+
:keyword physical_partition_throughput_info: Array of physical partition throughput info
9556+
objects.
9557+
:paramtype physical_partition_throughput_info:
9558+
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
9559+
"""
9560+
super(PhysicalPartitionThroughputInfoProperties, self).__init__(**kwargs)
9561+
self.physical_partition_throughput_info = physical_partition_throughput_info
9562+
9563+
95369564
class PhysicalPartitionThroughputInfoResource(msrest.serialization.Model):
95379565
"""PhysicalPartitionThroughputInfo object.
95389566

@@ -9571,6 +9599,105 @@ def __init__(
95719599
self.throughput = throughput
95729600

95739601

9602+
class PhysicalPartitionThroughputInfoResult(ARMResourceProperties):
9603+
"""An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.
9604+
9605+
Variables are only populated by the server, and will be ignored when sending a request.
9606+
9607+
:ivar id: The unique resource identifier of the ARM resource.
9608+
:vartype id: str
9609+
:ivar name: The name of the ARM resource.
9610+
:vartype name: str
9611+
:ivar type: The type of Azure resource.
9612+
:vartype type: str
9613+
:ivar location: The location of the resource group to which the resource belongs.
9614+
:vartype location: str
9615+
:ivar tags: A set of tags. Tags are a list of key-value pairs that describe the resource. These
9616+
tags can be used in viewing and grouping this resource (across resource groups). A maximum of
9617+
15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters
9618+
and value no greater than 256 characters. For example, the default experience for a template
9619+
type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also
9620+
include "Table", "Graph", "DocumentDB", and "MongoDB".
9621+
:vartype tags: dict[str, str]
9622+
:ivar identity: Identity for the resource.
9623+
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
9624+
:ivar resource: properties of physical partition throughput info.
9625+
:vartype resource:
9626+
~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResultPropertiesResource
9627+
"""
9628+
9629+
_validation = {
9630+
'id': {'readonly': True},
9631+
'name': {'readonly': True},
9632+
'type': {'readonly': True},
9633+
}
9634+
9635+
_attribute_map = {
9636+
'id': {'key': 'id', 'type': 'str'},
9637+
'name': {'key': 'name', 'type': 'str'},
9638+
'type': {'key': 'type', 'type': 'str'},
9639+
'location': {'key': 'location', 'type': 'str'},
9640+
'tags': {'key': 'tags', 'type': '{str}'},
9641+
'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'},
9642+
'resource': {'key': 'properties.resource', 'type': 'PhysicalPartitionThroughputInfoResultPropertiesResource'},
9643+
}
9644+
9645+
def __init__(
9646+
self,
9647+
*,
9648+
location: Optional[str] = None,
9649+
tags: Optional[Dict[str, str]] = None,
9650+
identity: Optional["ManagedServiceIdentity"] = None,
9651+
resource: Optional["PhysicalPartitionThroughputInfoResultPropertiesResource"] = None,
9652+
**kwargs
9653+
):
9654+
"""
9655+
:keyword location: The location of the resource group to which the resource belongs.
9656+
:paramtype location: str
9657+
:keyword tags: A set of tags. Tags are a list of key-value pairs that describe the resource.
9658+
These tags can be used in viewing and grouping this resource (across resource groups). A
9659+
maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128
9660+
characters and value no greater than 256 characters. For example, the default experience for a
9661+
template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values
9662+
also include "Table", "Graph", "DocumentDB", and "MongoDB".
9663+
:paramtype tags: dict[str, str]
9664+
:keyword identity: Identity for the resource.
9665+
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
9666+
:keyword resource: properties of physical partition throughput info.
9667+
:paramtype resource:
9668+
~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResultPropertiesResource
9669+
"""
9670+
super(PhysicalPartitionThroughputInfoResult, self).__init__(location=location, tags=tags, identity=identity, **kwargs)
9671+
self.resource = resource
9672+
9673+
9674+
class PhysicalPartitionThroughputInfoResultPropertiesResource(PhysicalPartitionThroughputInfoProperties):
9675+
"""properties of physical partition throughput info.
9676+
9677+
:ivar physical_partition_throughput_info: Array of physical partition throughput info objects.
9678+
:vartype physical_partition_throughput_info:
9679+
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
9680+
"""
9681+
9682+
_attribute_map = {
9683+
'physical_partition_throughput_info': {'key': 'physicalPartitionThroughputInfo', 'type': '[PhysicalPartitionThroughputInfoResource]'},
9684+
}
9685+
9686+
def __init__(
9687+
self,
9688+
*,
9689+
physical_partition_throughput_info: Optional[List["PhysicalPartitionThroughputInfoResource"]] = None,
9690+
**kwargs
9691+
):
9692+
"""
9693+
:keyword physical_partition_throughput_info: Array of physical partition throughput info
9694+
objects.
9695+
:paramtype physical_partition_throughput_info:
9696+
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
9697+
"""
9698+
super(PhysicalPartitionThroughputInfoResultPropertiesResource, self).__init__(physical_partition_throughput_info=physical_partition_throughput_info, **kwargs)
9699+
9700+
95749701
class Resource(msrest.serialization.Model):
95759702
"""Common fields that are returned in the response for all Azure Resource Manager resources.
95769703

0 commit comments

Comments
 (0)