Skip to content
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
4 changes: 2 additions & 2 deletions sdk/cosmos/azure-mgmt-cosmosdb/_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"@autorest/[email protected]",
"@autorest/[email protected]"
],
"commit": "0baca05c851c1749e92beb0d2134cd958827dd54",
"commit": "f8bd09aa392dc15ac6f539a20a3b356bcda7d90d",
"repository_url": "https://github.com/Azure/azure-rest-api-specs",
"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",
"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",
"readme": "specification/cosmos-db/resource-manager/readme.md"
}
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 = "7.0.0b5"
VERSION = "0.7.0"

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -2178,16 +2178,16 @@ def get_long_running_output(pipeline_response):

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

async def _sql_container_retrieve_throughput_distribution_initial( # pylint: disable=inconsistent-return-statements
async def _sql_container_retrieve_throughput_distribution_initial(
self,
resource_group_name: str,
account_name: str,
database_name: str,
container_name: str,
retrieve_throughput_parameters: "_models.RetrieveThroughputParameters",
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
) -> Optional["_models.PhysicalPartitionThroughputInfoResult"]:
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PhysicalPartitionThroughputInfoResult"]]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -2219,26 +2219,32 @@ async def _sql_container_retrieve_throughput_distribution_initial( # pylint: di
)
response = pipeline_response.http_response

if response.status_code not in [202]:
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('PhysicalPartitionThroughputInfoResult', pipeline_response)

if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, deserialized, {})

return deserialized

_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


@distributed_trace_async
async def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=inconsistent-return-statements
async def begin_sql_container_retrieve_throughput_distribution(
self,
resource_group_name: str,
account_name: str,
database_name: str,
container_name: str,
retrieve_throughput_parameters: "_models.RetrieveThroughputParameters",
**kwargs: Any
) -> AsyncLROPoller[None]:
) -> AsyncLROPoller["_models.PhysicalPartitionThroughputInfoResult"]:
"""Retrieve throughput distribution for an Azure Cosmos DB SQL container.

:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -2260,14 +2266,16 @@ async def begin_sql_container_retrieve_throughput_distribution( # pylint: disab
: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 None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:return: An instance of AsyncLROPoller that returns either
PhysicalPartitionThroughputInfoResult or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2022-02-15-preview") # type: str
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
cls = kwargs.pop('cls', None) # type: ClsType["_models.PhysicalPartitionThroughputInfoResult"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
Expand All @@ -2288,8 +2296,11 @@ async def begin_sql_container_retrieve_throughput_distribution( # pylint: disab
kwargs.pop('error_map', None)

def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('PhysicalPartitionThroughputInfoResult', pipeline_response)
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, deserialized, {})
return deserialized


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

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

async def _sql_container_redistribute_throughput_initial( # pylint: disable=inconsistent-return-statements
async def _sql_container_redistribute_throughput_initial(
self,
resource_group_name: str,
account_name: str,
database_name: str,
container_name: str,
redistribute_throughput_parameters: "_models.RedistributeThroughputParameters",
**kwargs: Any
) -> None:
cls = kwargs.pop('cls', None) # type: ClsType[None]
) -> Optional["_models.PhysicalPartitionThroughputInfoResult"]:
cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.PhysicalPartitionThroughputInfoResult"]]
error_map = {
401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError
}
Expand Down Expand Up @@ -2347,26 +2358,32 @@ async def _sql_container_redistribute_throughput_initial( # pylint: disable=inc
)
response = pipeline_response.http_response

if response.status_code not in [202]:
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('PhysicalPartitionThroughputInfoResult', pipeline_response)

if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, deserialized, {})

return deserialized

_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


@distributed_trace_async
async def begin_sql_container_redistribute_throughput( # pylint: disable=inconsistent-return-statements
async def begin_sql_container_redistribute_throughput(
self,
resource_group_name: str,
account_name: str,
database_name: str,
container_name: str,
redistribute_throughput_parameters: "_models.RedistributeThroughputParameters",
**kwargs: Any
) -> AsyncLROPoller[None]:
) -> AsyncLROPoller["_models.PhysicalPartitionThroughputInfoResult"]:
"""Redistribute throughput for an Azure Cosmos DB SQL container.

:param resource_group_name: The name of the resource group. The name is case insensitive.
Expand All @@ -2389,14 +2406,16 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=incons
: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 None or the result of cls(response)
:rtype: ~azure.core.polling.AsyncLROPoller[None]
:return: An instance of AsyncLROPoller that returns either
PhysicalPartitionThroughputInfoResult or the result of cls(response)
:rtype:
~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult]
:raises: ~azure.core.exceptions.HttpResponseError
"""
api_version = kwargs.pop('api_version', "2022-02-15-preview") # type: str
content_type = kwargs.pop('content_type', "application/json") # type: Optional[str]
polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod]
cls = kwargs.pop('cls', None) # type: ClsType[None]
cls = kwargs.pop('cls', None) # type: ClsType["_models.PhysicalPartitionThroughputInfoResult"]
lro_delay = kwargs.pop(
'polling_interval',
self._config.polling_interval
Expand All @@ -2417,8 +2436,11 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=incons
kwargs.pop('error_map', None)

def get_long_running_output(pipeline_response):
response = pipeline_response.http_response
deserialized = self._deserialize('PhysicalPartitionThroughputInfoResult', pipeline_response)
if cls:
return cls(pipeline_response, None, {})
return cls(pipeline_response, deserialized, {})
return deserialized


if polling is True: polling_method = AsyncARMPolling(lro_delay, lro_options={'final-state-via': 'location'}, **kwargs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,10 @@
from ._models_py3 import PhysicalPartitionId
from ._models_py3 import PhysicalPartitionStorageInfo
from ._models_py3 import PhysicalPartitionStorageInfoCollection
from ._models_py3 import PhysicalPartitionThroughputInfoProperties
from ._models_py3 import PhysicalPartitionThroughputInfoResource
from ._models_py3 import PhysicalPartitionThroughputInfoResult
from ._models_py3 import PhysicalPartitionThroughputInfoResultPropertiesResource
from ._models_py3 import PrivateEndpointConnection
from ._models_py3 import PrivateEndpointConnectionListResult
from ._models_py3 import PrivateEndpointProperty
Expand Down Expand Up @@ -532,7 +535,10 @@
'PhysicalPartitionId',
'PhysicalPartitionStorageInfo',
'PhysicalPartitionStorageInfoCollection',
'PhysicalPartitionThroughputInfoProperties',
'PhysicalPartitionThroughputInfoResource',
'PhysicalPartitionThroughputInfoResult',
'PhysicalPartitionThroughputInfoResultPropertiesResource',
'PrivateEndpointConnection',
'PrivateEndpointConnectionListResult',
'PrivateEndpointProperty',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9533,6 +9533,34 @@ def __init__(
self.physical_partition_storage_info_collection = None


class PhysicalPartitionThroughputInfoProperties(msrest.serialization.Model):
"""The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object.

:ivar physical_partition_throughput_info: Array of physical partition throughput info objects.
:vartype physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
"""

_attribute_map = {
'physical_partition_throughput_info': {'key': 'physicalPartitionThroughputInfo', 'type': '[PhysicalPartitionThroughputInfoResource]'},
}

def __init__(
self,
*,
physical_partition_throughput_info: Optional[List["PhysicalPartitionThroughputInfoResource"]] = None,
**kwargs
):
"""
:keyword physical_partition_throughput_info: Array of physical partition throughput info
objects.
:paramtype physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
"""
super(PhysicalPartitionThroughputInfoProperties, self).__init__(**kwargs)
self.physical_partition_throughput_info = physical_partition_throughput_info


class PhysicalPartitionThroughputInfoResource(msrest.serialization.Model):
"""PhysicalPartitionThroughputInfo object.

Expand Down Expand Up @@ -9571,6 +9599,105 @@ def __init__(
self.throughput = throughput


class PhysicalPartitionThroughputInfoResult(ARMResourceProperties):
"""An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object.

Variables are only populated by the server, and will be ignored when sending a request.

:ivar id: The unique resource identifier of the ARM resource.
:vartype id: str
:ivar name: The name of the ARM resource.
:vartype name: str
:ivar type: The type of Azure resource.
:vartype type: str
:ivar location: The location of the resource group to which the resource belongs.
:vartype location: str
:ivar tags: A set of tags. Tags are a list of key-value pairs that describe the resource. These
tags can be used in viewing and grouping this resource (across resource groups). A maximum of
15 tags can be provided for a resource. Each tag must have a key no greater than 128 characters
and value no greater than 256 characters. For example, the default experience for a template
type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also
include "Table", "Graph", "DocumentDB", and "MongoDB".
:vartype tags: dict[str, str]
:ivar identity: Identity for the resource.
:vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:ivar resource: properties of physical partition throughput info.
:vartype resource:
~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResultPropertiesResource
"""

_validation = {
'id': {'readonly': True},
'name': {'readonly': True},
'type': {'readonly': True},
}

_attribute_map = {
'id': {'key': 'id', 'type': 'str'},
'name': {'key': 'name', 'type': 'str'},
'type': {'key': 'type', 'type': 'str'},
'location': {'key': 'location', 'type': 'str'},
'tags': {'key': 'tags', 'type': '{str}'},
'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'},
'resource': {'key': 'properties.resource', 'type': 'PhysicalPartitionThroughputInfoResultPropertiesResource'},
}

def __init__(
self,
*,
location: Optional[str] = None,
tags: Optional[Dict[str, str]] = None,
identity: Optional["ManagedServiceIdentity"] = None,
resource: Optional["PhysicalPartitionThroughputInfoResultPropertiesResource"] = None,
**kwargs
):
"""
:keyword location: The location of the resource group to which the resource belongs.
:paramtype location: str
:keyword tags: A set of tags. Tags are a list of key-value pairs that describe the resource.
These tags can be used in viewing and grouping this resource (across resource groups). A
maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128
characters and value no greater than 256 characters. For example, the default experience for a
template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values
also include "Table", "Graph", "DocumentDB", and "MongoDB".
:paramtype tags: dict[str, str]
:keyword identity: Identity for the resource.
:paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity
:keyword resource: properties of physical partition throughput info.
:paramtype resource:
~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResultPropertiesResource
"""
super(PhysicalPartitionThroughputInfoResult, self).__init__(location=location, tags=tags, identity=identity, **kwargs)
self.resource = resource


class PhysicalPartitionThroughputInfoResultPropertiesResource(PhysicalPartitionThroughputInfoProperties):
"""properties of physical partition throughput info.

:ivar physical_partition_throughput_info: Array of physical partition throughput info objects.
:vartype physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
"""

_attribute_map = {
'physical_partition_throughput_info': {'key': 'physicalPartitionThroughputInfo', 'type': '[PhysicalPartitionThroughputInfoResource]'},
}

def __init__(
self,
*,
physical_partition_throughput_info: Optional[List["PhysicalPartitionThroughputInfoResource"]] = None,
**kwargs
):
"""
:keyword physical_partition_throughput_info: Array of physical partition throughput info
objects.
:paramtype physical_partition_throughput_info:
list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource]
"""
super(PhysicalPartitionThroughputInfoResultPropertiesResource, self).__init__(physical_partition_throughput_info=physical_partition_throughput_info, **kwargs)


class Resource(msrest.serialization.Model):
"""Common fields that are returned in the response for all Azure Resource Manager resources.

Expand Down
Loading