diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json index 2564da71383a..6948583bbe7c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json +++ b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json @@ -1,11 +1,11 @@ { - "commit": "b72e0199fa3242d64b0b49f38e71586066a8c048", + "commit": "17518d89647c0ac5de0acd9cfeff1369fe8906b2", "repository_url": "https://github.com/Azure/azure-rest-api-specs", "autorest": "3.10.2", "use": [ "@autorest/python@6.19.0", "@autorest/modelerfour@4.27.0" ], - "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/home/vsts/work/1/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", + "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --generate-sample=True --generate-test=True --include-x-ms-examples-original-file=True --python --python-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-python/sdk --use=@autorest/python@6.19.0 --use=@autorest/modelerfour@4.27.0 --version=3.10.2 --version-tolerant=False", "readme": "specification/cosmos-db/resource-manager/readme.md" } \ No newline at end of file diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py index 94ecc65212d3..5296303fdec7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py @@ -28,13 +28,13 @@ class CosmosDBManagementClientConfiguration: # pylint: disable=too-many-instanc :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-09-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-11-15". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "TokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-09-01-preview") + api_version: str = kwargs.pop("api_version", "2024-11-15") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py index dcbf52885a13..06c53aa6016b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_cosmos_db_management_client.py @@ -22,20 +22,16 @@ CassandraClustersOperations, CassandraDataCentersOperations, CassandraResourcesOperations, - ChaosFaultOperations, CollectionOperations, CollectionPartitionOperations, CollectionPartitionRegionOperations, CollectionRegionOperations, - DataTransferJobsOperations, DatabaseAccountRegionOperations, DatabaseAccountsOperations, DatabaseOperations, - GraphResourcesOperations, GremlinResourcesOperations, LocationsOperations, MongoDBResourcesOperations, - NetworkSecurityPerimeterConfigurationsOperations, NotebookWorkspacesOperations, Operations, PartitionKeyRangeIdOperations, @@ -60,10 +56,6 @@ ServiceOperations, SqlResourcesOperations, TableResourcesOperations, - ThroughputPoolAccountOperations, - ThroughputPoolAccountsOperations, - ThroughputPoolOperations, - ThroughputPoolsOperations, ) if TYPE_CHECKING: @@ -104,8 +96,6 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke :ivar partition_key_range_id_region: PartitionKeyRangeIdRegionOperations operations :vartype partition_key_range_id_region: azure.mgmt.cosmosdb.operations.PartitionKeyRangeIdRegionOperations - :ivar graph_resources: GraphResourcesOperations operations - :vartype graph_resources: azure.mgmt.cosmosdb.operations.GraphResourcesOperations :ivar sql_resources: SqlResourcesOperations operations :vartype sql_resources: azure.mgmt.cosmosdb.operations.SqlResourcesOperations :ivar mongo_db_resources: MongoDBResourcesOperations operations @@ -118,16 +108,10 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke :vartype gremlin_resources: azure.mgmt.cosmosdb.operations.GremlinResourcesOperations :ivar locations: LocationsOperations operations :vartype locations: azure.mgmt.cosmosdb.operations.LocationsOperations - :ivar data_transfer_jobs: DataTransferJobsOperations operations - :vartype data_transfer_jobs: azure.mgmt.cosmosdb.operations.DataTransferJobsOperations :ivar cassandra_clusters: CassandraClustersOperations operations :vartype cassandra_clusters: azure.mgmt.cosmosdb.operations.CassandraClustersOperations :ivar cassandra_data_centers: CassandraDataCentersOperations operations :vartype cassandra_data_centers: azure.mgmt.cosmosdb.operations.CassandraDataCentersOperations - :ivar network_security_perimeter_configurations: - NetworkSecurityPerimeterConfigurationsOperations operations - :vartype network_security_perimeter_configurations: - azure.mgmt.cosmosdb.operations.NetworkSecurityPerimeterConfigurationsOperations :ivar notebook_workspaces: NotebookWorkspacesOperations operations :vartype notebook_workspaces: azure.mgmt.cosmosdb.operations.NotebookWorkspacesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations @@ -172,26 +156,14 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke azure.mgmt.cosmosdb.operations.RestorableTableResourcesOperations :ivar service: ServiceOperations operations :vartype service: azure.mgmt.cosmosdb.operations.ServiceOperations - :ivar throughput_pools: ThroughputPoolsOperations operations - :vartype throughput_pools: azure.mgmt.cosmosdb.operations.ThroughputPoolsOperations - :ivar throughput_pool: ThroughputPoolOperations operations - :vartype throughput_pool: azure.mgmt.cosmosdb.operations.ThroughputPoolOperations - :ivar throughput_pool_accounts: ThroughputPoolAccountsOperations operations - :vartype throughput_pool_accounts: - azure.mgmt.cosmosdb.operations.ThroughputPoolAccountsOperations - :ivar throughput_pool_account: ThroughputPoolAccountOperations operations - :vartype throughput_pool_account: - azure.mgmt.cosmosdb.operations.ThroughputPoolAccountOperations - :ivar chaos_fault: ChaosFaultOperations operations - :vartype chaos_fault: azure.mgmt.cosmosdb.operations.ChaosFaultOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-09-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-11-15". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -262,7 +234,6 @@ def __init__( self.partition_key_range_id_region = PartitionKeyRangeIdRegionOperations( self._client, self._config, self._serialize, self._deserialize ) - self.graph_resources = GraphResourcesOperations(self._client, self._config, self._serialize, self._deserialize) self.sql_resources = SqlResourcesOperations(self._client, self._config, self._serialize, self._deserialize) self.mongo_db_resources = MongoDBResourcesOperations( self._client, self._config, self._serialize, self._deserialize @@ -275,18 +246,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_transfer_jobs = DataTransferJobsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.cassandra_clusters = CassandraClustersOperations( self._client, self._config, self._serialize, self._deserialize ) self.cassandra_data_centers = CassandraDataCentersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.notebook_workspaces = NotebookWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -333,17 +298,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize) - self.throughput_pools = ThroughputPoolsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.throughput_pool = ThroughputPoolOperations(self._client, self._config, self._serialize, self._deserialize) - self.throughput_pool_accounts = ThroughputPoolAccountsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.throughput_pool_account = ThroughputPoolAccountOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.chaos_fault = ChaosFaultOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request(self, request: HttpRequest, *, stream: bool = False, **kwargs: Any) -> HttpResponse: """Runs the network request through the client's chained policies. diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py index 7c993d652bbd..a712687790e5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_version.py @@ -6,4 +6,4 @@ # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------- -VERSION = "10.0.0b4" +VERSION = "0.7.0" diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py index 42b70bdac415..3c7bec439c0a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_configuration.py @@ -28,13 +28,13 @@ class CosmosDBManagementClientConfiguration: # pylint: disable=too-many-instanc :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str - :keyword api_version: Api Version. Default value is "2024-09-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-11-15". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str """ def __init__(self, credential: "AsyncTokenCredential", subscription_id: str, **kwargs: Any) -> None: - api_version: str = kwargs.pop("api_version", "2024-09-01-preview") + api_version: str = kwargs.pop("api_version", "2024-11-15") if credential is None: raise ValueError("Parameter 'credential' must not be None.") diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py index 99bbf2ad941c..6499683d864e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/_cosmos_db_management_client.py @@ -22,20 +22,16 @@ CassandraClustersOperations, CassandraDataCentersOperations, CassandraResourcesOperations, - ChaosFaultOperations, CollectionOperations, CollectionPartitionOperations, CollectionPartitionRegionOperations, CollectionRegionOperations, - DataTransferJobsOperations, DatabaseAccountRegionOperations, DatabaseAccountsOperations, DatabaseOperations, - GraphResourcesOperations, GremlinResourcesOperations, LocationsOperations, MongoDBResourcesOperations, - NetworkSecurityPerimeterConfigurationsOperations, NotebookWorkspacesOperations, Operations, PartitionKeyRangeIdOperations, @@ -60,10 +56,6 @@ ServiceOperations, SqlResourcesOperations, TableResourcesOperations, - ThroughputPoolAccountOperations, - ThroughputPoolAccountsOperations, - ThroughputPoolOperations, - ThroughputPoolsOperations, ) if TYPE_CHECKING: @@ -105,8 +97,6 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke :ivar partition_key_range_id_region: PartitionKeyRangeIdRegionOperations operations :vartype partition_key_range_id_region: azure.mgmt.cosmosdb.aio.operations.PartitionKeyRangeIdRegionOperations - :ivar graph_resources: GraphResourcesOperations operations - :vartype graph_resources: azure.mgmt.cosmosdb.aio.operations.GraphResourcesOperations :ivar sql_resources: SqlResourcesOperations operations :vartype sql_resources: azure.mgmt.cosmosdb.aio.operations.SqlResourcesOperations :ivar mongo_db_resources: MongoDBResourcesOperations operations @@ -119,17 +109,11 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke :vartype gremlin_resources: azure.mgmt.cosmosdb.aio.operations.GremlinResourcesOperations :ivar locations: LocationsOperations operations :vartype locations: azure.mgmt.cosmosdb.aio.operations.LocationsOperations - :ivar data_transfer_jobs: DataTransferJobsOperations operations - :vartype data_transfer_jobs: azure.mgmt.cosmosdb.aio.operations.DataTransferJobsOperations :ivar cassandra_clusters: CassandraClustersOperations operations :vartype cassandra_clusters: azure.mgmt.cosmosdb.aio.operations.CassandraClustersOperations :ivar cassandra_data_centers: CassandraDataCentersOperations operations :vartype cassandra_data_centers: azure.mgmt.cosmosdb.aio.operations.CassandraDataCentersOperations - :ivar network_security_perimeter_configurations: - NetworkSecurityPerimeterConfigurationsOperations operations - :vartype network_security_perimeter_configurations: - azure.mgmt.cosmosdb.aio.operations.NetworkSecurityPerimeterConfigurationsOperations :ivar notebook_workspaces: NotebookWorkspacesOperations operations :vartype notebook_workspaces: azure.mgmt.cosmosdb.aio.operations.NotebookWorkspacesOperations :ivar private_endpoint_connections: PrivateEndpointConnectionsOperations operations @@ -175,26 +159,14 @@ class CosmosDBManagementClient: # pylint: disable=client-accepts-api-version-ke azure.mgmt.cosmosdb.aio.operations.RestorableTableResourcesOperations :ivar service: ServiceOperations operations :vartype service: azure.mgmt.cosmosdb.aio.operations.ServiceOperations - :ivar throughput_pools: ThroughputPoolsOperations operations - :vartype throughput_pools: azure.mgmt.cosmosdb.aio.operations.ThroughputPoolsOperations - :ivar throughput_pool: ThroughputPoolOperations operations - :vartype throughput_pool: azure.mgmt.cosmosdb.aio.operations.ThroughputPoolOperations - :ivar throughput_pool_accounts: ThroughputPoolAccountsOperations operations - :vartype throughput_pool_accounts: - azure.mgmt.cosmosdb.aio.operations.ThroughputPoolAccountsOperations - :ivar throughput_pool_account: ThroughputPoolAccountOperations operations - :vartype throughput_pool_account: - azure.mgmt.cosmosdb.aio.operations.ThroughputPoolAccountOperations - :ivar chaos_fault: ChaosFaultOperations operations - :vartype chaos_fault: azure.mgmt.cosmosdb.aio.operations.ChaosFaultOperations :param credential: Credential needed for the client to connect to Azure. Required. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. Required. :type subscription_id: str :param base_url: Service URL. Default value is "https://management.azure.com". :type base_url: str - :keyword api_version: Api Version. Default value is "2024-09-01-preview". Note that overriding - this default value may result in unsupported behavior. + :keyword api_version: Api Version. Default value is "2024-11-15". Note that overriding this + default value may result in unsupported behavior. :paramtype api_version: str :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. @@ -265,7 +237,6 @@ def __init__( self.partition_key_range_id_region = PartitionKeyRangeIdRegionOperations( self._client, self._config, self._serialize, self._deserialize ) - self.graph_resources = GraphResourcesOperations(self._client, self._config, self._serialize, self._deserialize) self.sql_resources = SqlResourcesOperations(self._client, self._config, self._serialize, self._deserialize) self.mongo_db_resources = MongoDBResourcesOperations( self._client, self._config, self._serialize, self._deserialize @@ -278,18 +249,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.locations = LocationsOperations(self._client, self._config, self._serialize, self._deserialize) - self.data_transfer_jobs = DataTransferJobsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.cassandra_clusters = CassandraClustersOperations( self._client, self._config, self._serialize, self._deserialize ) self.cassandra_data_centers = CassandraDataCentersOperations( self._client, self._config, self._serialize, self._deserialize ) - self.network_security_perimeter_configurations = NetworkSecurityPerimeterConfigurationsOperations( - self._client, self._config, self._serialize, self._deserialize - ) self.notebook_workspaces = NotebookWorkspacesOperations( self._client, self._config, self._serialize, self._deserialize ) @@ -336,17 +301,6 @@ def __init__( self._client, self._config, self._serialize, self._deserialize ) self.service = ServiceOperations(self._client, self._config, self._serialize, self._deserialize) - self.throughput_pools = ThroughputPoolsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.throughput_pool = ThroughputPoolOperations(self._client, self._config, self._serialize, self._deserialize) - self.throughput_pool_accounts = ThroughputPoolAccountsOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.throughput_pool_account = ThroughputPoolAccountOperations( - self._client, self._config, self._serialize, self._deserialize - ) - self.chaos_fault = ChaosFaultOperations(self._client, self._config, self._serialize, self._deserialize) def _send_request( self, request: HttpRequest, *, stream: bool = False, **kwargs: Any diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py index a6aff077c84a..0a347515778b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/__init__.py @@ -19,17 +19,14 @@ from ._collection_partition_operations import CollectionPartitionOperations from ._partition_key_range_id_operations import PartitionKeyRangeIdOperations from ._partition_key_range_id_region_operations import PartitionKeyRangeIdRegionOperations -from ._graph_resources_operations import GraphResourcesOperations from ._sql_resources_operations import SqlResourcesOperations from ._mongo_db_resources_operations import MongoDBResourcesOperations from ._table_resources_operations import TableResourcesOperations from ._cassandra_resources_operations import CassandraResourcesOperations from ._gremlin_resources_operations import GremlinResourcesOperations from ._locations_operations import LocationsOperations -from ._data_transfer_jobs_operations import DataTransferJobsOperations from ._cassandra_clusters_operations import CassandraClustersOperations from ._cassandra_data_centers_operations import CassandraDataCentersOperations -from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations from ._notebook_workspaces_operations import NotebookWorkspacesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations @@ -46,11 +43,6 @@ from ._restorable_tables_operations import RestorableTablesOperations from ._restorable_table_resources_operations import RestorableTableResourcesOperations from ._service_operations import ServiceOperations -from ._throughput_pools_operations import ThroughputPoolsOperations -from ._throughput_pool_operations import ThroughputPoolOperations -from ._throughput_pool_accounts_operations import ThroughputPoolAccountsOperations -from ._throughput_pool_account_operations import ThroughputPoolAccountOperations -from ._chaos_fault_operations import ChaosFaultOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -70,17 +62,14 @@ "CollectionPartitionOperations", "PartitionKeyRangeIdOperations", "PartitionKeyRangeIdRegionOperations", - "GraphResourcesOperations", "SqlResourcesOperations", "MongoDBResourcesOperations", "TableResourcesOperations", "CassandraResourcesOperations", "GremlinResourcesOperations", "LocationsOperations", - "DataTransferJobsOperations", "CassandraClustersOperations", "CassandraDataCentersOperations", - "NetworkSecurityPerimeterConfigurationsOperations", "NotebookWorkspacesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", @@ -97,11 +86,6 @@ "RestorableTablesOperations", "RestorableTableResourcesOperations", "ServiceOperations", - "ThroughputPoolsOperations", - "ThroughputPoolOperations", - "ThroughputPoolAccountsOperations", - "ThroughputPoolAccountOperations", - "ChaosFaultOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py index aa57362888a0..8c695f20a17f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_clusters_operations.py @@ -36,15 +36,10 @@ build_create_update_request, build_deallocate_request, build_delete_request, - build_get_backup_request, - build_get_command_async_request, build_get_request, - build_invoke_command_async_request, build_invoke_command_request, - build_list_backups_request, build_list_by_resource_group_request, build_list_by_subscription_request, - build_list_command_request, build_start_request, build_status_request, build_update_request, @@ -58,7 +53,7 @@ ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] -class CassandraClustersOperations: # pylint: disable=too-many-public-methods +class CassandraClustersOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -968,495 +963,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _invoke_command_async_initial( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CommandPostBody, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "CommandPostBody") - - _request = build_invoke_command_async_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: _models.CommandPostBody, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. Required. - :type body: ~azure.mgmt.cosmosdb.models.CommandPostBody - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either CommandPublicResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either CommandPublicResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CommandPostBody, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. Is either a CommandPostBody type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.CommandPostBody or IO[bytes] - :return: An instance of AsyncLROPoller that returns either CommandPublicResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommandPublicResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._invoke_command_async_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommandPublicResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CommandPublicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CommandPublicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_command( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.CommandPublicResource"]: - """List all commands currently running on ring info. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :return: An iterator like instance of either CommandPublicResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ListCommands] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_command_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListCommands", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_command_async( - self, resource_group_name: str, cluster_name: str, command_id: str, **kwargs: Any - ) -> _models.ListCommands: - """Get details about a specified command that was run asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param command_id: Managed Cassandra cluster command id. Required. - :type command_id: str - :return: ListCommands or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ListCommands - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ListCommands] = kwargs.pop("cls", None) - - _request = build_get_command_async_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - command_id=command_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ListCommands", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_backups( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> AsyncIterable["_models.BackupResource"]: - """List the backups of this cluster that are available to restore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :return: An iterator like instance of either BackupResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.BackupResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ListBackups] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_backups_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ListBackups", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_backup( - self, resource_group_name: str, cluster_name: str, backup_id: str, **kwargs: Any - ) -> _models.BackupResource: - """Get the properties of an individual backup of this cluster that is available to restore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param backup_id: Id of a restorable backup of a Cassandra cluster. Required. - :type backup_id: str - :return: BackupResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.BackupResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BackupResource] = kwargs.pop("cls", None) - - _request = build_get_backup_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - backup_id=backup_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BackupResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - async def _deallocate_initial( - self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[str] = None, **kwargs: Any + self, resource_group_name: str, cluster_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -1476,7 +984,6 @@ async def _deallocate_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, - x_ms_force_deallocate=x_ms_force_deallocate, api_version=api_version, headers=_headers, params=_params, @@ -1508,7 +1015,7 @@ async def _deallocate_initial( @distributed_trace_async async def begin_deallocate( - self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[str] = None, **kwargs: Any + self, resource_group_name: str, cluster_name: str, **kwargs: Any ) -> AsyncLROPoller[None]: """Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do @@ -1519,10 +1026,6 @@ async def begin_deallocate( :type resource_group_name: str :param cluster_name: Managed Cassandra cluster name. Required. :type cluster_name: str - :param x_ms_force_deallocate: Force to deallocate a cluster of Cluster Type Production. Force - to deallocate a cluster of Cluster Type Production might cause data loss. Default value is - None. - :type x_ms_force_deallocate: str :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -1539,7 +1042,6 @@ async def begin_deallocate( raw_result = await self._deallocate_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - x_ms_force_deallocate=x_ms_force_deallocate, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py index 955c2e5507cc..ad400dc181b7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_resources_operations.py @@ -35,28 +35,20 @@ from ...operations._cassandra_resources_operations import ( build_create_update_cassandra_keyspace_request, build_create_update_cassandra_table_request, - build_create_update_cassandra_view_request, build_delete_cassandra_keyspace_request, build_delete_cassandra_table_request, - build_delete_cassandra_view_request, build_get_cassandra_keyspace_request, build_get_cassandra_keyspace_throughput_request, build_get_cassandra_table_request, build_get_cassandra_table_throughput_request, - build_get_cassandra_view_request, - build_get_cassandra_view_throughput_request, build_list_cassandra_keyspaces_request, build_list_cassandra_tables_request, - build_list_cassandra_views_request, build_migrate_cassandra_keyspace_to_autoscale_request, build_migrate_cassandra_keyspace_to_manual_throughput_request, build_migrate_cassandra_table_to_autoscale_request, build_migrate_cassandra_table_to_manual_throughput_request, - build_migrate_cassandra_view_to_autoscale_request, - build_migrate_cassandra_view_to_manual_throughput_request, build_update_cassandra_keyspace_throughput_request, build_update_cassandra_table_throughput_request, - build_update_cassandra_view_throughput_request, ) if sys.version_info >= (3, 9): @@ -2143,1049 +2135,3 @@ def get_long_running_output(pipeline_response): return AsyncLROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - - @distributed_trace - def list_cassandra_views( - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> AsyncIterable["_models.CassandraViewGetResults"]: - """Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :return: An iterator like instance of either CassandraViewGetResults or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CassandraViewListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_cassandra_views_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("CassandraViewListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_cassandra_view( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> _models.CassandraViewGetResults: - """Gets the Cassandra view under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: CassandraViewGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.CassandraViewGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) - - _request = build_get_cassandra_view_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CassandraViewGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_update_cassandra_view_initial( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: Union[_models.CassandraViewCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_cassandra_view_parameters, (IOBase, bytes)): - _content = create_update_cassandra_view_parameters - else: - _json = self._serialize.body(create_update_cassandra_view_parameters, "CassandraViewCreateUpdateParameters") - - _request = build_create_update_cassandra_view_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_update_cassandra_view( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: _models.CassandraViewCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Required. - :type create_update_cassandra_view_parameters: - ~azure.mgmt.cosmosdb.models.CassandraViewCreateUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either CassandraViewGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_update_cassandra_view( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Required. - :type create_update_cassandra_view_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either CassandraViewGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_update_cassandra_view( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: Union[_models.CassandraViewCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Is either a CassandraViewCreateUpdateParameters type or a IO[bytes] type. - Required. - :type create_update_cassandra_view_parameters: - ~azure.mgmt.cosmosdb.models.CassandraViewCreateUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either CassandraViewGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_update_cassandra_view_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - create_update_cassandra_view_parameters=create_update_cassandra_view_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CassandraViewGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.CassandraViewGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.CassandraViewGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_cassandra_view_initial( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_cassandra_view_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete_cassandra_view( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_cassandra_view_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace_async - async def get_cassandra_view_throughput( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> _models.ThroughputSettingsGetResults: - """Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database - account with the provided name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: ThroughputSettingsGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - - _request = build_get_cassandra_view_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _update_cassandra_view_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_throughput_parameters, (IOBase, bytes)): - _content = update_throughput_parameters - else: - _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - - _request = build_update_cassandra_view_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update_cassandra_view_throughput( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_cassandra_view_throughput( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Required. - :type update_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_cassandra_view_throughput( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - view_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] - type. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_cassandra_view_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - update_throughput_parameters=update_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _migrate_cassandra_view_to_autoscale_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_cassandra_view_to_autoscale_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_migrate_cassandra_view_to_autoscale( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._migrate_cassandra_view_to_autoscale_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _migrate_cassandra_view_to_manual_throughput_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_cassandra_view_to_manual_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_migrate_cassandra_view_to_manual_throughput( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._migrate_cassandra_view_to_manual_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - view_name=view_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_chaos_fault_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_chaos_fault_operations.py deleted file mode 100644 index fc75ea58bb26..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_chaos_fault_operations.py +++ /dev/null @@ -1,414 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._chaos_fault_operations import build_enable_disable_request, build_get_request, build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ChaosFaultOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`chaos_fault` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ChaosFaultResource"]: - """List Chaos Faults for CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either ChaosFaultResource or the result of cls(response) - :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ChaosFaultListResponse] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ChaosFaultListResponse", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - async def _enable_disable_initial( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: Union[_models.ChaosFaultResource, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(chaos_fault_request, (IOBase, bytes)): - _content = chaos_fault_request - else: - _json = self._serialize.body(chaos_fault_request, "ChaosFaultResource") - - _request = build_enable_disable_request( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: _models.ChaosFaultResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Required. - :type chaos_fault_request: ~azure.mgmt.cosmosdb.models.ChaosFaultResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Required. - :type chaos_fault_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: Union[_models.ChaosFaultResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Is either a - ChaosFaultResource type or a IO[bytes] type. Required. - :type chaos_fault_request: ~azure.mgmt.cosmosdb.models.ChaosFaultResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ChaosFaultResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._enable_disable_initial( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - chaos_fault_request=chaos_fault_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ChaosFaultResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ChaosFaultResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ChaosFaultResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get( - self, resource_group_name: str, account_name: str, chaos_fault: str, **kwargs: Any - ) -> _models.ChaosFaultResource: - """Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :return: ChaosFaultResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ChaosFaultResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ChaosFaultResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ChaosFaultResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_data_transfer_jobs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_data_transfer_jobs_operations.py deleted file mode 100644 index 58b78d7b91bd..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_data_transfer_jobs_operations.py +++ /dev/null @@ -1,590 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._data_transfer_jobs_operations import ( - build_cancel_request, - build_complete_request, - build_create_request, - build_get_request, - build_list_by_database_account_request, - build_pause_request, - build_resume_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class DataTransferJobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`data_transfer_jobs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - async def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: _models.CreateJobRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Required. - :type job_create_parameters: ~azure.mgmt.cosmosdb.models.CreateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Required. - :type job_create_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: Union[_models.CreateJobRequest, IO[bytes]], - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Is either a CreateJobRequest type or a IO[bytes] type. Required. - :type job_create_parameters: ~azure.mgmt.cosmosdb.models.CreateJobRequest or IO[bytes] - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_create_parameters, (IOBase, bytes)): - _content = job_create_parameters - else: - _json = self._serialize.body(job_create_parameters, "CreateJobRequest") - - _request = build_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def get( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Get a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def pause( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Pause a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_pause_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def resume( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Resumes a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_resume_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def cancel( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Cancels a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def complete( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Completes a Data Transfer Online Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_complete_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_database_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.DataTransferJobGetResults"]: - """Get a list of Data Transfer jobs. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either DataTransferJobGetResults or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.DataTransferJobGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobFeedResults] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("DataTransferJobFeedResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py deleted file mode 100644 index 61b15d499f0e..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py +++ /dev/null @@ -1,544 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._graph_resources_operations import ( - build_create_update_graph_request, - build_delete_graph_resource_request, - build_get_graph_request, - build_list_graphs_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class GraphResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`graph_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_graphs( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.GraphResourceGetResults"]: - """Lists the graphs under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either GraphResourceGetResults or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GraphResourcesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_graphs_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("GraphResourcesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_graph( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> _models.GraphResourceGetResults: - """Gets the Graph resource under an existing Azure Cosmos DB database account with the provided - name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :return: GraphResourceGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.GraphResourceGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) - - _request = build_get_graph_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GraphResourceGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_update_graph_initial( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: Union[_models.GraphResourceCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_graph_parameters, (IOBase, bytes)): - _content = create_update_graph_parameters - else: - _json = self._serialize.body(create_update_graph_parameters, "GraphResourceCreateUpdateParameters") - - _request = build_create_update_graph_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: _models.GraphResourceCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. - Required. - :type create_update_graph_parameters: - ~azure.mgmt.cosmosdb.models.GraphResourceCreateUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either GraphResourceGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. - Required. - :type create_update_graph_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either GraphResourceGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: Union[_models.GraphResourceCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. Is - either a GraphResourceCreateUpdateParameters type or a IO[bytes] type. Required. - :type create_update_graph_parameters: - ~azure.mgmt.cosmosdb.models.GraphResourceCreateUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either GraphResourceGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_update_graph_initial( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - create_update_graph_parameters=create_update_graph_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GraphResourceGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.GraphResourceGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.GraphResourceGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_graph_resource_initial( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_graph_resource_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete_graph_resource( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB Graph Resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_graph_resource_initial( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py index 07e7de4201c2..8bf04def918b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_mongo_db_resources_operations.py @@ -47,7 +47,6 @@ 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, build_list_mongo_db_collections_request, build_list_mongo_db_databases_request, build_list_mongo_role_definitions_request, @@ -56,11 +55,6 @@ build_migrate_mongo_db_collection_to_manual_throughput_request, build_migrate_mongo_db_database_to_autoscale_request, build_migrate_mongo_db_database_to_manual_throughput_request, - build_mongo_db_container_redistribute_throughput_request, - build_mongo_db_container_retrieve_throughput_distribution_request, - build_mongo_db_database_partition_merge_request, - build_mongo_db_database_redistribute_throughput_request, - build_mongo_db_database_retrieve_throughput_distribution_request, build_retrieve_continuous_backup_information_request, build_update_mongo_db_collection_throughput_request, build_update_mongo_db_database_throughput_request, @@ -1100,157 +1094,11 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _mongo_db_database_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_mongo_db_database_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @overload - async def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @distributed_trace_async - async def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. + @distributed_trace + def list_mongo_db_collections( + self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any + ) -> AsyncIterable["_models.MongoDBCollectionGetResults"]: + """Lists the MongoDB collection under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1259,75 +1107,18 @@ async def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: d :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Is either a RetrieveThroughputParameters type or - a IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) + :return: An iterator like instance of either MongoDBCollectionGetResults or the result of + cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._mongo_db_database_retrieve_throughput_distribution_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + cls: ClsType[_models.MongoDBCollectionListResult] = kwargs.pop("cls", None) - async def _mongo_db_database_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1336,990 +1127,66 @@ async def _mongo_db_database_redistribute_throughput_initial( # pylint: disable } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + def prepare_request(next_link=None): + if not next_link: - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + _request = build_list_mongo_db_collections_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request - _request = build_mongo_db_database_redistribute_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + async def extract_data(pipeline_response): + deserialized = self._deserialize("MongoDBCollectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + async def get_next(next_link=None): + _request = prepare_request(next_link) - response = pipeline_response.http_response + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @overload - async def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @distributed_trace_async - async def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Is either a RedistributeThroughputParameters type - or a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :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: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._mongo_db_database_redistribute_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _mongo_db_container_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_mongo_db_container_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @overload - async def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @distributed_trace_async - async def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Is either a RetrieveThroughputParameters type - or a IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :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: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._mongo_db_container_retrieve_throughput_distribution_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _mongo_db_container_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") - - _request = build_mongo_db_container_redistribute_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @overload - async def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @distributed_trace_async - async def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Is either a RedistributeThroughputParameters type - or a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :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: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._mongo_db_container_redistribute_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_mongo_db_collections( - self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterable["_models.MongoDBCollectionGetResults"]: - """Lists the MongoDB collection under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :return: An iterator like instance of either MongoDBCollectionGetResults or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MongoDBCollectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_mongo_db_collections_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("MongoDBCollectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get_mongo_db_collection( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> _models.MongoDBCollectionGetResults: - """Gets the MongoDB collection under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :return: MongoDBCollectionGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) - - _request = build_get_mongo_db_collection_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_update_mongo_db_collection_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_mongo_db_collection_parameters, (IOBase, bytes)): - _content = create_update_mongo_db_collection_parameters - else: - _json = self._serialize.body( - create_update_mongo_db_collection_parameters, "MongoDBCollectionCreateUpdateParameters" - ) - - _request = build_create_update_mongo_db_collection_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: _models.MongoDBCollectionCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Required. - :type create_update_mongo_db_collection_parameters: - ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Required. - :type create_update_mongo_db_collection_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. + async def get_mongo_db_collection( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any + ) -> _models.MongoDBCollectionGetResults: + """Gets the MongoDB collection under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2330,69 +1197,10 @@ async def begin_create_update_mongo_db_collection( :type database_name: str :param collection_name: Cosmos DB collection name. Required. :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Is either a MongoDBCollectionCreateUpdateParameters type or a IO[bytes] - type. Required. - :type create_update_mongo_db_collection_parameters: - ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_update_mongo_db_collection_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - create_update_mongo_db_collection_parameters=create_update_mongo_db_collection_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.MongoDBCollectionGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.MongoDBCollectionGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_mongo_db_collection_initial( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: + :return: MongoDBCollectionGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -2405,9 +1213,9 @@ async def _delete_mongo_db_collection_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) - _request = build_delete_mongo_db_collection_request( + _request = build_get_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2419,103 +1227,31 @@ async def _delete_mongo_db_collection_initial( ) _request.url = self._client.format_url(_request.url) - _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = False pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace_async - async def begin_delete_mongo_db_collection( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_mongo_db_collection_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - async def _mongo_db_database_partition_merge_initial( # pylint: disable=name-too-long + async def _create_update_mongo_db_collection_initial( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], + collection_name: str, + create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -2536,15 +1272,18 @@ async def _mongo_db_database_partition_merge_initial( # pylint: disable=name-to content_type = content_type or "application/json" _json = None _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters + if isinstance(create_update_mongo_db_collection_parameters, (IOBase, bytes)): + _content = create_update_mongo_db_collection_parameters else: - _json = self._serialize.body(merge_parameters, "MergeParameters") + _json = self._serialize.body( + create_update_mongo_db_collection_parameters, "MongoDBCollectionCreateUpdateParameters" + ) - _request = build_mongo_db_database_partition_merge_request( + _request = build_create_update_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, + collection_name=collection_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -2586,17 +1325,18 @@ async def _mongo_db_database_partition_merge_initial( # pylint: disable=name-to return deserialized # type: ignore @overload - async def begin_mongo_db_database_partition_merge( + async def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: _models.MergeParameters, + collection_name: str, + create_update_mongo_db_collection_parameters: _models.MongoDBCollectionCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2605,30 +1345,35 @@ async def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Required. + :type create_update_mongo_db_collection_parameters: + ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_mongo_db_database_partition_merge( + async def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: IO[bytes], + collection_name: str, + create_update_mongo_db_collection_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2637,28 +1382,32 @@ async def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Required. + :type create_update_mongo_db_collection_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_mongo_db_database_partition_merge( + async def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], + collection_name: str, + create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> AsyncLROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2667,13 +1416,17 @@ async def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Is either a MongoDBCollectionCreateUpdateParameters type or a IO[bytes] + type. Required. + :type create_update_mongo_db_collection_parameters: + ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either MongoDBCollectionGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2681,16 +1434,17 @@ async def begin_mongo_db_database_partition_merge( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._mongo_db_database_partition_merge_initial( + raw_result = await self._create_update_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - merge_parameters=merge_parameters, + collection_name=collection_name, + create_update_mongo_db_collection_parameters=create_update_mongo_db_collection_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -2702,38 +1456,30 @@ async def begin_mongo_db_database_partition_merge( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) + deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( + return AsyncLROPoller[_models.MongoDBCollectionGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]( + return AsyncLROPoller[_models.MongoDBCollectionGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _list_mongo_db_collection_partition_merge_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any + async def _delete_mongo_db_collection_initial( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -2743,31 +1489,19 @@ async def _list_mongo_db_collection_partition_merge_initial( # pylint: disable= } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_list_mongo_db_collection_partition_merge_request( + _request = build_delete_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, collection_name=collection_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -2781,7 +1515,7 @@ async def _list_mongo_db_collection_partition_merge_initial( # pylint: disable= response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -2803,87 +1537,11 @@ async def _list_mongo_db_collection_partition_merge_initial( # pylint: disable= return deserialized # type: ignore - @overload - async def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace_async - async def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. + async def begin_delete_mongo_db_collection( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an existing Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2894,33 +1552,25 @@ async def begin_list_mongo_db_collection_partition_merge( # pylint: disable=nam :type database_name: str :param collection_name: Cosmos DB collection name. Required. :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._list_mongo_db_collection_partition_merge_initial( + raw_result = await self._delete_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, collection_name=collection_name, - merge_parameters=merge_parameters, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -2929,30 +1579,24 @@ async def begin_list_mongo_db_collection_partition_merge( # pylint: disable=nam await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( + return AsyncLROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async async def get_mongo_db_collection_throughput( diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_network_security_perimeter_configurations_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_network_security_perimeter_configurations_operations.py deleted file mode 100644 index aa3e304fa475..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_network_security_perimeter_configurations_operations.py +++ /dev/null @@ -1,341 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, AsyncIterator, Callable, Dict, Optional, Type, TypeVar, Union, cast -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._network_security_perimeter_configurations_operations import ( - build_get_request, - build_list_request, - build_reconcile_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`network_security_perimeter_configurations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> AsyncIterable["_models.NetworkSecurityPerimeterConfiguration"]: - """Gets list of effective Network Security Perimeter Configuration for cosmos db account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either NetworkSecurityPerimeterConfiguration or the - result of cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkSecurityPerimeterConfigurationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace_async - async def get( - self, - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> _models.NetworkSecurityPerimeterConfiguration: - """Gets effective Network Security Perimeter Configuration for association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param network_security_perimeter_configuration_name: The name for Network Security Perimeter - configuration. Required. - :type network_security_perimeter_configuration_name: str - :return: NetworkSecurityPerimeterConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _reconcile_initial( - self, - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_reconcile_request( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_reconcile( - self, - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> AsyncLROPoller[None]: - """Refreshes any information about the association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param network_security_perimeter_configuration_name: The name for Network Security Perimeter - configuration. Required. - :type network_security_perimeter_configuration_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._reconcile_initial( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py index 89512c0ae494..b48c44726384 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_service_operations.py @@ -210,10 +210,17 @@ async def _create_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("azure-AsyncOperation") + ) + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py index a068d20daeb0..67cafa788b06 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_sql_resources_operations.py @@ -59,7 +59,6 @@ build_get_sql_trigger_request, build_get_sql_user_defined_function_request, build_list_client_encryption_keys_request, - build_list_sql_container_partition_merge_request, build_list_sql_containers_request, build_list_sql_databases_request, build_list_sql_role_assignments_request, @@ -72,11 +71,6 @@ build_migrate_sql_database_to_autoscale_request, build_migrate_sql_database_to_manual_throughput_request, build_retrieve_continuous_backup_information_request, - build_sql_container_redistribute_throughput_request, - build_sql_container_retrieve_throughput_distribution_request, - build_sql_database_partition_merge_request, - build_sql_database_redistribute_throughput_request, - build_sql_database_retrieve_throughput_distribution_request, build_update_sql_container_throughput_request, build_update_sql_database_throughput_request, ) @@ -1110,10 +1104,10 @@ def get_long_running_output(pipeline_response): ) @distributed_trace - def list_client_encryption_keys( + def list_sql_containers( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ClientEncryptionKeyGetResults"]: - """Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + ) -> AsyncIterable["_models.SqlContainerGetResults"]: + """Lists the SQL container under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1122,17 +1116,17 @@ def list_client_encryption_keys( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :return: An iterator like instance of either ClientEncryptionKeyGetResults or the result of + :return: An iterator like instance of either SqlContainerGetResults or the result of cls(response) :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -1145,7 +1139,7 @@ def list_client_encryption_keys( def prepare_request(next_link=None): if not next_link: - _request = build_list_client_encryption_keys_request( + _request = build_list_sql_containers_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1174,7 +1168,7 @@ def prepare_request(next_link=None): return _request async def extract_data(pipeline_response): - deserialized = self._deserialize("ClientEncryptionKeysListResult", pipeline_response) + deserialized = self._deserialize("SqlContainerListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -1198,15 +1192,10 @@ async def get_next(next_link=None): return AsyncItemPaged(get_next, extract_data) @distributed_trace_async - async def get_client_encryption_key( - self, - resource_group_name: str, - account_name: str, - database_name: str, - client_encryption_key_name: str, - **kwargs: Any - ) -> _models.ClientEncryptionKeyGetResults: - """Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + async def get_sql_container( + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> _models.SqlContainerGetResults: + """Gets the SQL container under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1215,10 +1204,10 @@ async def get_client_encryption_key( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :return: ClientEncryptionKeyGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :return: SqlContainerGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.SqlContainerGetResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -1233,13 +1222,13 @@ async def get_client_encryption_key( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) - _request = build_get_client_encryption_key_request( + _request = build_get_sql_container_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - client_encryption_key_name=client_encryption_key_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -1258,22 +1247,20 @@ async def get_client_encryption_key( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) + deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_update_client_encryption_key_initial( # pylint: disable=name-too-long + async def _create_update_sql_container_initial( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: Union[ - _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] - ], + container_name: str, + create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -1294,18 +1281,16 @@ async def _create_update_client_encryption_key_initial( # pylint: disable=name- content_type = content_type or "application/json" _json = None _content = None - if isinstance(create_update_client_encryption_key_parameters, (IOBase, bytes)): - _content = create_update_client_encryption_key_parameters + if isinstance(create_update_sql_container_parameters, (IOBase, bytes)): + _content = create_update_sql_container_parameters else: - _json = self._serialize.body( - create_update_client_encryption_key_parameters, "ClientEncryptionKeyCreateUpdateParameters" - ) + _json = self._serialize.body(create_update_sql_container_parameters, "SqlContainerCreateUpdateParameters") - _request = build_create_update_client_encryption_key_request( + _request = build_create_update_sql_container_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - client_encryption_key_name=client_encryption_key_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -1347,19 +1332,18 @@ async def _create_update_client_encryption_key_initial( # pylint: disable=name- return deserialized # type: ignore @overload - async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long + async def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: _models.ClientEncryptionKeyCreateUpdateParameters, + container_name: str, + create_update_sql_container_parameters: _models.SqlContainerCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). + ) -> AsyncLROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1368,36 +1352,34 @@ async def begin_create_update_client_encryption_key( # pylint: disable=name-too :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Required. - :type create_update_client_encryption_key_parameters: - ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Required. + :type create_update_sql_container_parameters: + ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :return: An instance of AsyncLROPoller that returns either SqlContainerGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long + async def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: IO[bytes], + container_name: str, + create_update_sql_container_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). + ) -> AsyncLROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1406,35 +1388,31 @@ async def begin_create_update_client_encryption_key( # pylint: disable=name-too :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Required. - :type create_update_client_encryption_key_parameters: IO[bytes] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Required. + :type create_update_sql_container_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :return: An instance of AsyncLROPoller that returns either SqlContainerGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long + async def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: Union[ - _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] - ], + container_name: str, + create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). + ) -> AsyncLROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1443,17 +1421,15 @@ async def begin_create_update_client_encryption_key( # pylint: disable=name-too :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Is either a ClientEncryptionKeyCreateUpdateParameters type or a IO[bytes] type. - Required. - :type create_update_client_encryption_key_parameters: - ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Is either a SqlContainerCreateUpdateParameters type or a IO[bytes] type. Required. + :type create_update_sql_container_parameters: + ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either SqlContainerGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1461,17 +1437,17 @@ async def begin_create_update_client_encryption_key( # pylint: disable=name-too api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_client_encryption_key_initial( + raw_result = await self._create_update_sql_container_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - client_encryption_key_name=client_encryption_key_name, - create_update_client_encryption_key_parameters=create_update_client_encryption_key_parameters, + container_name=container_name, + create_update_sql_container_parameters=create_update_sql_container_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -1483,7 +1459,7 @@ async def begin_create_update_client_encryption_key( # pylint: disable=name-too kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) + deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1495,21 +1471,80 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.ClientEncryptionKeyGetResults].from_continuation_token( + return AsyncLROPoller[_models.SqlContainerGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.ClientEncryptionKeyGetResults]( + return AsyncLROPoller[_models.SqlContainerGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - @distributed_trace - def list_sql_containers( - self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> AsyncIterable["_models.SqlContainerGetResults"]: - """Lists the SQL container under an existing Azure Cosmos DB database account. + async def _delete_sql_container_initial( + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> AsyncIterator[bytes]: + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) + + _request = build_delete_sql_container_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + container_name=container_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _decompress = kwargs.pop("decompress", True) + _stream = True + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [202, 204]: + try: + await response.read() # Load the body in memory and close the socket + except (StreamConsumedError, StreamClosedError): + pass + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + response_headers = {} + if response.status_code == 202: + response_headers["azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("azure-AsyncOperation") + ) + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + + if cls: + return cls(pipeline_response, deserialized, response_headers) # type: ignore + + return deserialized # type: ignore + + @distributed_trace_async + async def begin_delete_sql_container( + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> AsyncLROPoller[None]: + """Deletes an existing Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1518,86 +1553,60 @@ def list_sql_containers( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :return: An iterator like instance of either SqlContainerGetResults or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_sql_containers_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request + cls: ClsType[None] = kwargs.pop("cls", None) + polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) + lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) + cont_token: Optional[str] = kwargs.pop("continuation_token", None) + if cont_token is None: + raw_result = await self._delete_sql_container_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + container_name=container_name, + api_version=api_version, + cls=lambda x, y, z: x, + headers=_headers, + params=_params, + **kwargs + ) + await raw_result.http_response.read() # type: ignore + kwargs.pop("error_map", None) - async def extract_data(pipeline_response): - deserialized = self._deserialize("SqlContainerListResult", pipeline_response) - list_of_elem = deserialized.value + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) + return cls(pipeline_response, None, {}) # type: ignore - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs + if polling is True: + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) + elif polling is False: + polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) + else: + polling_method = polling + if cont_token: + return AsyncLROPoller[None].from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output, ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) + return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace_async - async def get_sql_container( + async def get_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> _models.SqlContainerGetResults: - """Gets the SQL container under an existing Azure Cosmos DB database account. + ) -> _models.ThroughputSettingsGetResults: + """Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database + account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1608,8 +1617,8 @@ async def get_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :return: SqlContainerGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.SqlContainerGetResults + :return: ThroughputSettingsGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -1624,9 +1633,9 @@ async def get_sql_container( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - _request = build_get_sql_container_request( + _request = build_get_sql_container_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1649,20 +1658,20 @@ async def get_sql_container( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - async def _create_update_sql_container_initial( + async def _update_sql_container_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], + update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -1683,12 +1692,12 @@ async def _create_update_sql_container_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(create_update_sql_container_parameters, (IOBase, bytes)): - _content = create_update_sql_container_parameters + if isinstance(update_throughput_parameters, (IOBase, bytes)): + _content = update_throughput_parameters else: - _json = self._serialize.body(create_update_sql_container_parameters, "SqlContainerCreateUpdateParameters") + _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - _request = build_create_update_sql_container_request( + _request = build_update_sql_container_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1734,18 +1743,18 @@ async def _create_update_sql_container_initial( return deserialized # type: ignore @overload - async def begin_create_update_sql_container( + async def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: _models.SqlContainerCreateUpdateParameters, + update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1756,32 +1765,33 @@ async def begin_create_update_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Required. - :type create_update_sql_container_parameters: - ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Required. + :type update_throughput_parameters: + ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SqlContainerGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_create_update_sql_container( + async def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: IO[bytes], + update_throughput_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1792,29 +1802,30 @@ async def begin_create_update_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Required. - :type create_update_sql_container_parameters: IO[bytes] + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Required. + :type update_throughput_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either SqlContainerGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_create_update_sql_container( + async def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], + update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any - ) -> AsyncLROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1825,13 +1836,15 @@ async def begin_create_update_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Is either a SqlContainerCreateUpdateParameters type or a IO[bytes] type. Required. - :type create_update_sql_container_parameters: - ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either SqlContainerGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. + Required. + :type update_throughput_parameters: + ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -1839,17 +1852,17 @@ async def begin_create_update_sql_container( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._create_update_sql_container_initial( + raw_result = await self._update_sql_container_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, container_name=container_name, - create_update_sql_container_parameters=create_update_sql_container_parameters, + update_throughput_parameters=update_throughput_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -1861,7 +1874,7 @@ async def begin_create_update_sql_container( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -1873,17 +1886,17 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.SqlContainerGetResults].from_continuation_token( + return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.SqlContainerGetResults]( + return AsyncLROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _delete_sql_container_initial( + async def _migrate_sql_container_to_autoscale_initial( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -1900,7 +1913,7 @@ async def _delete_sql_container_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - _request = build_delete_sql_container_request( + _request = build_migrate_sql_container_to_autoscale_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1920,7 +1933,7 @@ async def _delete_sql_container_initial( response = pipeline_response.http_response - if response.status_code not in [202, 204]: + if response.status_code not in [200, 202]: try: await response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -1943,10 +1956,10 @@ async def _delete_sql_container_initial( return deserialized # type: ignore @distributed_trace_async - async def begin_delete_sql_container( + async def begin_migrate_sql_container_to_autoscale( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: + """Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -1957,20 +1970,22 @@ async def begin_delete_sql_container( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :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 ThroughputSettingsGetResults or the + result of cls(response) + :rtype: + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._delete_sql_container_initial( + raw_result = await self._migrate_sql_container_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -1984,9 +1999,11 @@ async def begin_delete_sql_container( await raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements + def get_long_running_output(pipeline_response): + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: - return cls(pipeline_response, None, {}) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore + return deserialized if polling is True: polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) @@ -1995,21 +2012,18 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- else: polling_method = polling if cont_token: - return AsyncLROPoller[None].from_continuation_token( + return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore + return AsyncLROPoller[_models.ThroughputSettingsGetResults]( + self._client, raw_result, get_long_running_output, polling_method # type: ignore + ) - async def _sql_database_partition_merge_initial( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any + async def _migrate_sql_container_to_manual_throughput_initial( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -2019,30 +2033,19 @@ async def _sql_database_partition_merge_initial( } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_sql_database_partition_merge_request( + _request = build_migrate_sql_container_to_manual_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -2078,1523 +2081,11 @@ async def _sql_database_partition_merge_initial( return deserialized # type: ignore - @overload - async def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._sql_database_partition_merge_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - merge_parameters=merge_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _list_sql_container_partition_merge_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_list_sql_container_partition_merge_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionStorageInfoCollection or the result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._list_sql_container_partition_merge_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - merge_parameters=merge_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace_async - async def get_sql_container_throughput( - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> _models.ThroughputSettingsGetResults: - """Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: ThroughputSettingsGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - - _request = build_get_sql_container_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _update_sql_container_throughput_initial( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_throughput_parameters, (IOBase, bytes)): - _content = update_throughput_parameters - else: - _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - - _request = build_update_sql_container_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update_sql_container_throughput( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update_sql_container_throughput( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Required. - :type update_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update_sql_container_throughput( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. - Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_sql_container_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - update_throughput_parameters=update_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _migrate_sql_container_to_autoscale_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_sql_container_to_autoscale_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_migrate_sql_container_to_autoscale( - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._migrate_sql_container_to_autoscale_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _migrate_sql_container_to_manual_throughput_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_sql_container_to_manual_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_migrate_sql_container_to_manual_throughput( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._migrate_sql_container_to_manual_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _sql_database_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_sql_database_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @overload - async def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @distributed_trace_async - async def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Is either a RetrieveThroughputParameters type or a - IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :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: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._sql_database_retrieve_throughput_distribution_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _sql_database_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") - - _request = build_sql_database_redistribute_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @overload - async def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @distributed_trace_async - async def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Is either a RedistributeThroughputParameters type or a - IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :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: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._sql_database_redistribute_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _sql_container_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_sql_container_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> 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. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - - @overload - async def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> 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. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :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: - """ - @distributed_trace_async - async def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL container. + async def begin_migrate_sql_container_to_manual_throughput( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> AsyncLROPoller[_models.ThroughputSettingsGetResults]: + """Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3605,35 +2096,27 @@ async def begin_sql_container_retrieve_throughput_distribution( # pylint: disab :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Is either a RetrieveThroughputParameters type or a - IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._sql_container_retrieve_throughput_distribution_initial( + raw_result = await self._migrate_sql_container_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, container_name=container_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -3643,37 +2126,193 @@ async def begin_sql_container_retrieve_throughput_distribution( # pylint: disab kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( + return AsyncLROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( + return AsyncLROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - async def _sql_container_redistribute_throughput_initial( # pylint: disable=name-too-long + @distributed_trace + def list_client_encryption_keys( + self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any + ) -> AsyncIterable["_models.ClientEncryptionKeyGetResults"]: + """Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. Required. + :type account_name: str + :param database_name: Cosmos DB database name. Required. + :type database_name: str + :return: An iterator like instance of either ClientEncryptionKeyGetResults or the result of + cls(response) + :rtype: + ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_client_encryption_keys_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + async def extract_data(pipeline_response): + deserialized = self._deserialize("ClientEncryptionKeysListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return AsyncItemPaged(get_next, extract_data) + + @distributed_trace_async + async def get_client_encryption_key( self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], + client_encryption_key_name: str, + **kwargs: Any + ) -> _models.ClientEncryptionKeyGetResults: + """Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. Required. + :type account_name: str + :param database_name: Cosmos DB database name. Required. + :type database_name: str + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :return: ClientEncryptionKeyGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + + _request = build_get_client_encryption_key_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + client_encryption_key_name=client_encryption_key_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + async def _create_update_client_encryption_key_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + account_name: str, + database_name: str, + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: Union[ + _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] + ], **kwargs: Any ) -> AsyncIterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -3694,16 +2333,18 @@ async def _sql_container_redistribute_throughput_initial( # pylint: disable=nam content_type = content_type or "application/json" _json = None _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters + if isinstance(create_update_client_encryption_key_parameters, (IOBase, bytes)): + _content = create_update_client_encryption_key_parameters else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") + _json = self._serialize.body( + create_update_client_encryption_key_parameters, "ClientEncryptionKeyCreateUpdateParameters" + ) - _request = build_sql_container_redistribute_throughput_request( + _request = build_create_update_client_encryption_key_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - container_name=container_name, + client_encryption_key_name=client_encryption_key_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -3745,18 +2386,19 @@ async def _sql_container_redistribute_throughput_initial( # pylint: disable=nam return deserialized # type: ignore @overload - async def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: _models.ClientEncryptionKeyCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3765,35 +2407,36 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=name-t :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Required. + :type create_update_client_encryption_key_parameters: + ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - async def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: IO[bytes], + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3802,32 +2445,35 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=name-t :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Required. - :type redistribute_throughput_parameters: IO[bytes] + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Required. + :type create_update_client_encryption_key_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) + :return: An instance of AsyncLROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace_async - async def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + async def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: Union[ + _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] + ], **kwargs: Any - ) -> AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> AsyncLROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3836,17 +2482,17 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=name-t :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Is either a RedistributeThroughputParameters type or - a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of AsyncLROPoller that returns either - PhysicalPartitionThroughputInfoResult or the result of cls(response) + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Is either a ClientEncryptionKeyCreateUpdateParameters type or a IO[bytes] type. + Required. + :type create_update_client_encryption_key_parameters: + ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters or IO[bytes] + :return: An instance of AsyncLROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3854,17 +2500,17 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=name-t api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = await self._sql_container_redistribute_throughput_initial( + raw_result = await self._create_update_client_encryption_key_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - container_name=container_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, + client_encryption_key_name=client_encryption_key_name, + create_update_client_encryption_key_parameters=create_update_client_encryption_key_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3876,27 +2522,25 @@ async def begin_sql_container_redistribute_throughput( # pylint: disable=name-t kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) + deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, AsyncARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) else: polling_method = polling if cont_token: - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( + return AsyncLROPoller[_models.ClientEncryptionKeyGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return AsyncLROPoller[_models.PhysicalPartitionThroughputInfoResult]( + return AsyncLROPoller[_models.ClientEncryptionKeyGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_account_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_account_operations.py deleted file mode 100644 index 7044b9d5b3f5..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_account_operations.py +++ /dev/null @@ -1,460 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._throughput_pool_account_operations import ( - build_create_request, - build_delete_request, - build_get_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ThroughputPoolAccountOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`throughput_pool_account` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> _models.ThroughputPoolAccountResource: - """Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :return: ThroughputPoolAccountResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolAccountResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputPoolAccountResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_initial( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: Union[_models.ThroughputPoolAccountResource, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ThroughputPoolAccountResource") - - _request = build_create_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: _models.ThroughputPoolAccountResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: Union[_models.ThroughputPoolAccountResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. Is either a - ThroughputPoolAccountResource type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ThroughputPoolAccountResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_initial( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolAccountResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputPoolAccountResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputPoolAccountResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Removes an existing Azure Cosmos DB database account from a throughput pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_accounts_operations.py deleted file mode 100644 index 952fe9da8d73..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_accounts_operations.py +++ /dev/null @@ -1,142 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._throughput_pool_accounts_operations import build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ThroughputPoolAccountsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`throughput_pool_accounts` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ThroughputPoolAccountResource"]: - """Lists all the Azure Cosmos DB accounts available under the subscription. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: An iterator like instance of either ThroughputPoolAccountResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolAccountsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolAccountsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_operations.py deleted file mode 100644 index 6c924aad5fd9..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pool_operations.py +++ /dev/null @@ -1,640 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, AsyncIterator, Callable, Dict, IO, Optional, Type, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator_async import distributed_trace_async -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling - -from ... import models as _models -from ...operations._throughput_pool_operations import ( - build_create_or_update_request, - build_delete_request, - build_get_request, - build_update_request, -) - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ThroughputPoolOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`throughput_pool` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace_async - async def get( - self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any - ) -> _models.ThroughputPoolResource: - """Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: ThroughputPoolResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - async def _create_or_update_initial( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Union[_models.ThroughputPoolResource, IO[bytes]], - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ThroughputPoolResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: _models.ThroughputPoolResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Union[_models.ThroughputPoolResource, IO[bytes]], - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. Is either a - ThroughputPoolResource type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ThroughputPoolResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._create_or_update_initial( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputPoolResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputPoolResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _update_initial( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[Union[_models.ThroughputPoolUpdate, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _json = self._serialize.body(body, "ThroughputPoolUpdate") - else: - _json = None - - _request = build_update_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - async def begin_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[_models.ThroughputPoolUpdate] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Default value is None. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - async def begin_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of AsyncLROPoller that returns either ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace_async - async def begin_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[Union[_models.ThroughputPoolUpdate, IO[bytes]]] = None, - **kwargs: Any - ) -> AsyncLROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Is either a - ThroughputPoolUpdate type or a IO[bytes] type. Default value is None. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolUpdate or IO[bytes] - :return: An instance of AsyncLROPoller that returns either ThroughputPoolResource or the result - of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ThroughputPoolResource] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._update_initial( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: AsyncPollingMethod = cast( - AsyncPollingMethod, - AsyncARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs), - ) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[_models.ThroughputPoolResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[_models.ThroughputPoolResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - async def _delete_initial( - self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any - ) -> AsyncIterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[AsyncIterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - await response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace_async - async def begin_delete( - self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any - ) -> AsyncLROPoller[None]: - """Deletes an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.AsyncLROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, AsyncPollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = await self._delete_initial( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - await raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: AsyncPollingMethod = cast(AsyncPollingMethod, AsyncARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(AsyncPollingMethod, AsyncNoPolling()) - else: - polling_method = polling - if cont_token: - return AsyncLROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return AsyncLROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pools_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pools_operations.py deleted file mode 100644 index 2e2477813bba..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_throughput_pools_operations.py +++ /dev/null @@ -1,216 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, AsyncIterable, Callable, Dict, Optional, Type, TypeVar -import urllib.parse - -from azure.core.async_paging import AsyncItemPaged, AsyncList -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.rest import AsyncHttpResponse, HttpRequest -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from ... import models as _models -from ...operations._throughput_pools_operations import build_list_by_resource_group_request, build_list_request - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] - - -class ThroughputPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.aio.CosmosDBManagementClient`'s - :attr:`throughput_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs) -> None: - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> AsyncIterable["_models.ThroughputPoolResource"]: - """Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - - :return: An iterator like instance of either ThroughputPoolResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> AsyncIterable["_models.ThroughputPoolResource"]: - """List all the ThroughputPools in a given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either ThroughputPoolResource or the result of - cls(response) - :rtype: - ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - async def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, AsyncList(list_of_elem) - - async def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = await self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return AsyncItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py index e41e894306b7..ec1965a08595 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py @@ -8,9 +8,6 @@ from ._models_py3 import ARMProxyResource from ._models_py3 import ARMResourceProperties -from ._models_py3 import AccessRule -from ._models_py3 import AccessRuleProperties -from ._models_py3 import AccessRulePropertiesSubscriptionsItem from ._models_py3 import AccountKeyMetadata from ._models_py3 import AnalyticalStorageConfiguration from ._models_py3 import ApiProperties @@ -18,16 +15,11 @@ from ._models_py3 import AutoUpgradePolicyResource from ._models_py3 import AutoscaleSettings from ._models_py3 import AutoscaleSettingsResource -from ._models_py3 import AzureBlobDataTransferDataSourceSink from ._models_py3 import BackupInformation from ._models_py3 import BackupPolicy from ._models_py3 import BackupPolicyMigrationState -from ._models_py3 import BackupResource -from ._models_py3 import BackupSchedule -from ._models_py3 import BaseCosmosDataTransferDataSourceSink from ._models_py3 import Capability from ._models_py3 import Capacity -from ._models_py3 import CapacityModeChangeTransitionState from ._models_py3 import CassandraClusterDataCenterNodeItem from ._models_py3 import CassandraClusterPublicStatus from ._models_py3 import CassandraClusterPublicStatusDataCentersItem @@ -46,15 +38,7 @@ from ._models_py3 import CassandraTableGetResults from ._models_py3 import CassandraTableListResult from ._models_py3 import CassandraTableResource -from ._models_py3 import CassandraViewCreateUpdateParameters -from ._models_py3 import CassandraViewGetPropertiesOptions -from ._models_py3 import CassandraViewGetPropertiesResource -from ._models_py3 import CassandraViewGetResults -from ._models_py3 import CassandraViewListResult -from ._models_py3 import CassandraViewResource from ._models_py3 import Certificate -from ._models_py3 import ChaosFaultListResponse -from ._models_py3 import ChaosFaultResource from ._models_py3 import ClientEncryptionIncludedPath from ._models_py3 import ClientEncryptionKeyCreateUpdateParameters from ._models_py3 import ClientEncryptionKeyGetPropertiesResource @@ -68,7 +52,6 @@ from ._models_py3 import Column from ._models_py3 import CommandOutput from ._models_py3 import CommandPostBody -from ._models_py3 import CommandPublicResource from ._models_py3 import CompositePath from ._models_py3 import ComputedProperty from ._models_py3 import ConflictResolutionPolicy @@ -80,18 +63,9 @@ from ._models_py3 import ContinuousModeBackupPolicy from ._models_py3 import ContinuousModeProperties from ._models_py3 import CorsPolicy -from ._models_py3 import CosmosCassandraDataTransferDataSourceSink -from ._models_py3 import CosmosMongoDataTransferDataSourceSink -from ._models_py3 import CosmosMongoVCoreDataTransferDataSourceSink -from ._models_py3 import CosmosSqlDataTransferDataSourceSink -from ._models_py3 import CreateJobRequest from ._models_py3 import CreateUpdateOptions from ._models_py3 import DataCenterResource from ._models_py3 import DataCenterResourceProperties -from ._models_py3 import DataTransferDataSourceSink -from ._models_py3 import DataTransferJobFeedResults -from ._models_py3 import DataTransferJobGetResults -from ._models_py3 import DataTransferJobProperties from ._models_py3 import DataTransferRegionalServiceResource from ._models_py3 import DataTransferServiceResource from ._models_py3 import DataTransferServiceResourceCreateUpdateProperties @@ -107,7 +81,6 @@ from ._models_py3 import DatabaseAccountUpdateParameters from ._models_py3 import DatabaseAccountsListResult from ._models_py3 import DatabaseRestoreResource -from ._models_py3 import DiagnosticLogSettings from ._models_py3 import ErrorAdditionalInfo from ._models_py3 import ErrorDetail from ._models_py3 import ErrorResponse @@ -120,12 +93,6 @@ from ._models_py3 import GraphAPIComputeServiceResource from ._models_py3 import GraphAPIComputeServiceResourceCreateUpdateProperties from ._models_py3 import GraphAPIComputeServiceResourceProperties -from ._models_py3 import GraphResource -from ._models_py3 import GraphResourceCreateUpdateParameters -from ._models_py3 import GraphResourceGetPropertiesOptions -from ._models_py3 import GraphResourceGetPropertiesResource -from ._models_py3 import GraphResourceGetResults -from ._models_py3 import GraphResourcesListResult from ._models_py3 import GremlinDatabaseCreateUpdateParameters from ._models_py3 import GremlinDatabaseGetPropertiesOptions from ._models_py3 import GremlinDatabaseGetPropertiesResource @@ -144,9 +111,7 @@ from ._models_py3 import IndexingPolicy from ._models_py3 import IpAddressOrRange from ._models_py3 import KeyWrapMetadata -from ._models_py3 import ListBackups from ._models_py3 import ListClusters -from ._models_py3 import ListCommands from ._models_py3 import ListDataCenters from ._models_py3 import Location from ._models_py3 import LocationGetResult @@ -157,12 +122,10 @@ from ._models_py3 import ManagedCassandraReaperStatus from ._models_py3 import ManagedServiceIdentity from ._models_py3 import ManagedServiceIdentityUserAssignedIdentity -from ._models_py3 import MaterializedViewDefinition from ._models_py3 import MaterializedViewsBuilderRegionalServiceResource from ._models_py3 import MaterializedViewsBuilderServiceResource from ._models_py3 import MaterializedViewsBuilderServiceResourceCreateUpdateProperties from ._models_py3 import MaterializedViewsBuilderServiceResourceProperties -from ._models_py3 import MergeParameters from ._models_py3 import Metric from ._models_py3 import MetricAvailability from ._models_py3 import MetricDefinition @@ -191,11 +154,6 @@ from ._models_py3 import MongoUserDefinitionCreateUpdateParameters from ._models_py3 import MongoUserDefinitionGetResults from ._models_py3 import MongoUserDefinitionListResult -from ._models_py3 import NetworkSecurityPerimeter -from ._models_py3 import NetworkSecurityPerimeterConfiguration -from ._models_py3 import NetworkSecurityPerimeterConfigurationListResult -from ._models_py3 import NetworkSecurityPerimeterConfigurationProperties -from ._models_py3 import NetworkSecurityProfile from ._models_py3 import NotebookWorkspace from ._models_py3 import NotebookWorkspaceConnectionInfoResult from ._models_py3 import NotebookWorkspaceCreateUpdateParameters @@ -214,13 +172,6 @@ from ._models_py3 import PeriodicModeBackupPolicy from ._models_py3 import PeriodicModeProperties from ._models_py3 import Permission -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 @@ -229,15 +180,10 @@ from ._models_py3 import PrivateLinkServiceConnectionStateProperty from ._models_py3 import Privilege from ._models_py3 import PrivilegeResource -from ._models_py3 import ProvisioningIssue -from ._models_py3 import ProvisioningIssueProperties from ._models_py3 import ProxyResource -from ._models_py3 import RedistributeThroughputParameters -from ._models_py3 import RedistributeThroughputPropertiesResource from ._models_py3 import RegionForOnlineOffline from ._models_py3 import RegionalServiceResource from ._models_py3 import Resource -from ._models_py3 import ResourceAssociation from ._models_py3 import ResourceRestoreParameters from ._models_py3 import RestorableDatabaseAccountGetResult from ._models_py3 import RestorableDatabaseAccountsListResult @@ -275,8 +221,6 @@ from ._models_py3 import RestorableTablesListResult from ._models_py3 import RestoreParameters from ._models_py3 import RestoreParametersBase -from ._models_py3 import RetrieveThroughputParameters -from ._models_py3 import RetrieveThroughputPropertiesResource from ._models_py3 import Role from ._models_py3 import SeedNode from ._models_py3 import ServiceResource @@ -330,37 +274,26 @@ from ._models_py3 import TableListResult from ._models_py3 import TableResource from ._models_py3 import ThroughputPolicyResource -from ._models_py3 import ThroughputPoolAccountCreateParameters -from ._models_py3 import ThroughputPoolAccountResource -from ._models_py3 import ThroughputPoolAccountsListResult -from ._models_py3 import ThroughputPoolResource -from ._models_py3 import ThroughputPoolUpdate -from ._models_py3 import ThroughputPoolsListResult from ._models_py3 import ThroughputSettingsGetPropertiesResource from ._models_py3 import ThroughputSettingsGetResults from ._models_py3 import ThroughputSettingsResource from ._models_py3 import ThroughputSettingsUpdateParameters -from ._models_py3 import TrackedResource from ._models_py3 import UniqueKey from ._models_py3 import UniqueKeyPolicy from ._models_py3 import Usage from ._models_py3 import UsagesResult +from ._models_py3 import VectorEmbedding +from ._models_py3 import VectorEmbeddingPolicy +from ._models_py3 import VectorIndex from ._models_py3 import VirtualNetworkRule -from ._cosmos_db_management_client_enums import AccessRuleDirection from ._cosmos_db_management_client_enums import AnalyticalStorageSchemaType from ._cosmos_db_management_client_enums import ApiType from ._cosmos_db_management_client_enums import AuthenticationMethod -from ._cosmos_db_management_client_enums import AutoReplicate from ._cosmos_db_management_client_enums import AzureConnectionType from ._cosmos_db_management_client_enums import BackupPolicyMigrationStatus from ._cosmos_db_management_client_enums import BackupPolicyType -from ._cosmos_db_management_client_enums import BackupState from ._cosmos_db_management_client_enums import BackupStorageRedundancy -from ._cosmos_db_management_client_enums import CapacityMode -from ._cosmos_db_management_client_enums import CapacityModeTransitionStatus -from ._cosmos_db_management_client_enums import ClusterType -from ._cosmos_db_management_client_enums import CommandStatus from ._cosmos_db_management_client_enums import CompositePathSortOrder from ._cosmos_db_management_client_enums import ConflictResolutionMode from ._cosmos_db_management_client_enums import ConnectionState @@ -368,17 +301,13 @@ from ._cosmos_db_management_client_enums import ContinuousTier from ._cosmos_db_management_client_enums import CreateMode from ._cosmos_db_management_client_enums import CreatedByType -from ._cosmos_db_management_client_enums import DataTransferComponent -from ._cosmos_db_management_client_enums import DataTransferJobMode from ._cosmos_db_management_client_enums import DataType from ._cosmos_db_management_client_enums import DatabaseAccountKind from ._cosmos_db_management_client_enums import DedicatedGatewayType from ._cosmos_db_management_client_enums import DefaultConsistencyLevel -from ._cosmos_db_management_client_enums import DefaultPriorityLevel -from ._cosmos_db_management_client_enums import EnableFullTextQuery +from ._cosmos_db_management_client_enums import DistanceFunction from ._cosmos_db_management_client_enums import IndexKind from ._cosmos_db_management_client_enums import IndexingMode -from ._cosmos_db_management_client_enums import IssueType from ._cosmos_db_management_client_enums import KeyKind from ._cosmos_db_management_client_enums import Kind from ._cosmos_db_management_client_enums import ManagedCassandraProvisioningState @@ -386,7 +315,6 @@ from ._cosmos_db_management_client_enums import MinimalTlsVersion from ._cosmos_db_management_client_enums import MongoRoleDefinitionType from ._cosmos_db_management_client_enums import NetworkAclBypass -from ._cosmos_db_management_client_enums import NetworkSecurityPerimeterConfigurationProvisioningState from ._cosmos_db_management_client_enums import NodeState from ._cosmos_db_management_client_enums import NodeStatus from ._cosmos_db_management_client_enums import NotebookWorkspaceName @@ -394,24 +322,21 @@ from ._cosmos_db_management_client_enums import PartitionKind from ._cosmos_db_management_client_enums import PrimaryAggregationType from ._cosmos_db_management_client_enums import PublicNetworkAccess -from ._cosmos_db_management_client_enums import ResourceAssociationAccessMode from ._cosmos_db_management_client_enums import ResourceIdentityType from ._cosmos_db_management_client_enums import RestoreMode from ._cosmos_db_management_client_enums import RoleDefinitionType -from ._cosmos_db_management_client_enums import ScheduledEventStrategy from ._cosmos_db_management_client_enums import ServerVersion from ._cosmos_db_management_client_enums import ServiceSize from ._cosmos_db_management_client_enums import ServiceStatus from ._cosmos_db_management_client_enums import ServiceType -from ._cosmos_db_management_client_enums import Severity from ._cosmos_db_management_client_enums import SpatialType from ._cosmos_db_management_client_enums import Status -from ._cosmos_db_management_client_enums import SupportedActions -from ._cosmos_db_management_client_enums import ThroughputPolicyType from ._cosmos_db_management_client_enums import TriggerOperation from ._cosmos_db_management_client_enums import TriggerType from ._cosmos_db_management_client_enums import Type from ._cosmos_db_management_client_enums import UnitType +from ._cosmos_db_management_client_enums import VectorDataType +from ._cosmos_db_management_client_enums import VectorIndexType from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import from ._patch import patch_sdk as _patch_sdk @@ -419,9 +344,6 @@ __all__ = [ "ARMProxyResource", "ARMResourceProperties", - "AccessRule", - "AccessRuleProperties", - "AccessRulePropertiesSubscriptionsItem", "AccountKeyMetadata", "AnalyticalStorageConfiguration", "ApiProperties", @@ -429,16 +351,11 @@ "AutoUpgradePolicyResource", "AutoscaleSettings", "AutoscaleSettingsResource", - "AzureBlobDataTransferDataSourceSink", "BackupInformation", "BackupPolicy", "BackupPolicyMigrationState", - "BackupResource", - "BackupSchedule", - "BaseCosmosDataTransferDataSourceSink", "Capability", "Capacity", - "CapacityModeChangeTransitionState", "CassandraClusterDataCenterNodeItem", "CassandraClusterPublicStatus", "CassandraClusterPublicStatusDataCentersItem", @@ -457,15 +374,7 @@ "CassandraTableGetResults", "CassandraTableListResult", "CassandraTableResource", - "CassandraViewCreateUpdateParameters", - "CassandraViewGetPropertiesOptions", - "CassandraViewGetPropertiesResource", - "CassandraViewGetResults", - "CassandraViewListResult", - "CassandraViewResource", "Certificate", - "ChaosFaultListResponse", - "ChaosFaultResource", "ClientEncryptionIncludedPath", "ClientEncryptionKeyCreateUpdateParameters", "ClientEncryptionKeyGetPropertiesResource", @@ -479,7 +388,6 @@ "Column", "CommandOutput", "CommandPostBody", - "CommandPublicResource", "CompositePath", "ComputedProperty", "ConflictResolutionPolicy", @@ -491,18 +399,9 @@ "ContinuousModeBackupPolicy", "ContinuousModeProperties", "CorsPolicy", - "CosmosCassandraDataTransferDataSourceSink", - "CosmosMongoDataTransferDataSourceSink", - "CosmosMongoVCoreDataTransferDataSourceSink", - "CosmosSqlDataTransferDataSourceSink", - "CreateJobRequest", "CreateUpdateOptions", "DataCenterResource", "DataCenterResourceProperties", - "DataTransferDataSourceSink", - "DataTransferJobFeedResults", - "DataTransferJobGetResults", - "DataTransferJobProperties", "DataTransferRegionalServiceResource", "DataTransferServiceResource", "DataTransferServiceResourceCreateUpdateProperties", @@ -518,7 +417,6 @@ "DatabaseAccountUpdateParameters", "DatabaseAccountsListResult", "DatabaseRestoreResource", - "DiagnosticLogSettings", "ErrorAdditionalInfo", "ErrorDetail", "ErrorResponse", @@ -531,12 +429,6 @@ "GraphAPIComputeServiceResource", "GraphAPIComputeServiceResourceCreateUpdateProperties", "GraphAPIComputeServiceResourceProperties", - "GraphResource", - "GraphResourceCreateUpdateParameters", - "GraphResourceGetPropertiesOptions", - "GraphResourceGetPropertiesResource", - "GraphResourceGetResults", - "GraphResourcesListResult", "GremlinDatabaseCreateUpdateParameters", "GremlinDatabaseGetPropertiesOptions", "GremlinDatabaseGetPropertiesResource", @@ -555,9 +447,7 @@ "IndexingPolicy", "IpAddressOrRange", "KeyWrapMetadata", - "ListBackups", "ListClusters", - "ListCommands", "ListDataCenters", "Location", "LocationGetResult", @@ -568,12 +458,10 @@ "ManagedCassandraReaperStatus", "ManagedServiceIdentity", "ManagedServiceIdentityUserAssignedIdentity", - "MaterializedViewDefinition", "MaterializedViewsBuilderRegionalServiceResource", "MaterializedViewsBuilderServiceResource", "MaterializedViewsBuilderServiceResourceCreateUpdateProperties", "MaterializedViewsBuilderServiceResourceProperties", - "MergeParameters", "Metric", "MetricAvailability", "MetricDefinition", @@ -602,11 +490,6 @@ "MongoUserDefinitionCreateUpdateParameters", "MongoUserDefinitionGetResults", "MongoUserDefinitionListResult", - "NetworkSecurityPerimeter", - "NetworkSecurityPerimeterConfiguration", - "NetworkSecurityPerimeterConfigurationListResult", - "NetworkSecurityPerimeterConfigurationProperties", - "NetworkSecurityProfile", "NotebookWorkspace", "NotebookWorkspaceConnectionInfoResult", "NotebookWorkspaceCreateUpdateParameters", @@ -625,13 +508,6 @@ "PeriodicModeBackupPolicy", "PeriodicModeProperties", "Permission", - "PhysicalPartitionId", - "PhysicalPartitionStorageInfo", - "PhysicalPartitionStorageInfoCollection", - "PhysicalPartitionThroughputInfoProperties", - "PhysicalPartitionThroughputInfoResource", - "PhysicalPartitionThroughputInfoResult", - "PhysicalPartitionThroughputInfoResultPropertiesResource", "PrivateEndpointConnection", "PrivateEndpointConnectionListResult", "PrivateEndpointProperty", @@ -640,15 +516,10 @@ "PrivateLinkServiceConnectionStateProperty", "Privilege", "PrivilegeResource", - "ProvisioningIssue", - "ProvisioningIssueProperties", "ProxyResource", - "RedistributeThroughputParameters", - "RedistributeThroughputPropertiesResource", "RegionForOnlineOffline", "RegionalServiceResource", "Resource", - "ResourceAssociation", "ResourceRestoreParameters", "RestorableDatabaseAccountGetResult", "RestorableDatabaseAccountsListResult", @@ -686,8 +557,6 @@ "RestorableTablesListResult", "RestoreParameters", "RestoreParametersBase", - "RetrieveThroughputParameters", - "RetrieveThroughputPropertiesResource", "Role", "SeedNode", "ServiceResource", @@ -741,36 +610,25 @@ "TableListResult", "TableResource", "ThroughputPolicyResource", - "ThroughputPoolAccountCreateParameters", - "ThroughputPoolAccountResource", - "ThroughputPoolAccountsListResult", - "ThroughputPoolResource", - "ThroughputPoolUpdate", - "ThroughputPoolsListResult", "ThroughputSettingsGetPropertiesResource", "ThroughputSettingsGetResults", "ThroughputSettingsResource", "ThroughputSettingsUpdateParameters", - "TrackedResource", "UniqueKey", "UniqueKeyPolicy", "Usage", "UsagesResult", + "VectorEmbedding", + "VectorEmbeddingPolicy", + "VectorIndex", "VirtualNetworkRule", - "AccessRuleDirection", "AnalyticalStorageSchemaType", "ApiType", "AuthenticationMethod", - "AutoReplicate", "AzureConnectionType", "BackupPolicyMigrationStatus", "BackupPolicyType", - "BackupState", "BackupStorageRedundancy", - "CapacityMode", - "CapacityModeTransitionStatus", - "ClusterType", - "CommandStatus", "CompositePathSortOrder", "ConflictResolutionMode", "ConnectionState", @@ -778,17 +636,13 @@ "ContinuousTier", "CreateMode", "CreatedByType", - "DataTransferComponent", - "DataTransferJobMode", "DataType", "DatabaseAccountKind", "DedicatedGatewayType", "DefaultConsistencyLevel", - "DefaultPriorityLevel", - "EnableFullTextQuery", + "DistanceFunction", "IndexKind", "IndexingMode", - "IssueType", "KeyKind", "Kind", "ManagedCassandraProvisioningState", @@ -796,7 +650,6 @@ "MinimalTlsVersion", "MongoRoleDefinitionType", "NetworkAclBypass", - "NetworkSecurityPerimeterConfigurationProvisioningState", "NodeState", "NodeStatus", "NotebookWorkspaceName", @@ -804,24 +657,21 @@ "PartitionKind", "PrimaryAggregationType", "PublicNetworkAccess", - "ResourceAssociationAccessMode", "ResourceIdentityType", "RestoreMode", "RoleDefinitionType", - "ScheduledEventStrategy", "ServerVersion", "ServiceSize", "ServiceStatus", "ServiceType", - "Severity", "SpatialType", "Status", - "SupportedActions", - "ThroughputPolicyType", "TriggerOperation", "TriggerType", "Type", "UnitType", + "VectorDataType", + "VectorIndexType", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py index fd1f8e81d5a6..6e70c1ff4084 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_cosmos_db_management_client_enums.py @@ -10,15 +10,6 @@ from azure.core import CaseInsensitiveEnumMeta -class AccessRuleDirection(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Direction of Access Rule.""" - - INBOUND = "Inbound" - """Applies to inbound network traffic to the secured resources.""" - OUTBOUND = "Outbound" - """Applies to outbound network traffic from the secured resources""" - - class AnalyticalStorageSchemaType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Describes the types of schema for analytical storage.""" @@ -48,14 +39,6 @@ class AuthenticationMethod(str, Enum, metaclass=CaseInsensitiveEnumMeta): LDAP = "Ldap" -class AutoReplicate(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The form of AutoReplicate that is being used by this cluster.""" - - NONE = "None" - SYSTEM_KEYSPACES = "SystemKeyspaces" - ALL_KEYSPACES = "AllKeyspaces" - - class AzureConnectionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """How to connect to the azure services needed for running the cluster.""" @@ -79,15 +62,6 @@ class BackupPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CONTINUOUS = "Continuous" -class BackupState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The current state of the backup.""" - - INITIATED = "Initiated" - IN_PROGRESS = "InProgress" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - - class BackupStorageRedundancy(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Enum to indicate type of backup storage redundancy.""" @@ -96,42 +70,6 @@ class BackupStorageRedundancy(str, Enum, metaclass=CaseInsensitiveEnumMeta): ZONE = "Zone" -class CapacityMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the capacity mode of the account.""" - - NONE = "None" - PROVISIONED = "Provisioned" - SERVERLESS = "Serverless" - - -class CapacityModeTransitionStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """The transition status of capacity mode.""" - - INVALID = "Invalid" - INITIALIZED = "Initialized" - IN_PROGRESS = "InProgress" - COMPLETED = "Completed" - FAILED = "Failed" - - -class ClusterType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of the cluster. If set to Production, some operations might not be permitted on cluster.""" - - PRODUCTION = "Production" - NON_PRODUCTION = "NonProduction" - - -class CommandStatus(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Status of the command.""" - - DONE = "Done" - RUNNING = "Running" - ENQUEUE = "Enqueue" - PROCESSING = "Processing" - FINISHED = "Finished" - FAILED = "Failed" - - class CompositePathSortOrder(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Sort order for composite paths.""" @@ -194,23 +132,6 @@ class DatabaseAccountKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): PARSE = "Parse" -class DataTransferComponent(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """DataTransferComponent.""" - - COSMOS_DB_CASSANDRA = "CosmosDBCassandra" - COSMOS_DB_MONGO = "CosmosDBMongo" - COSMOS_DB_MONGO_V_CORE = "CosmosDBMongoVCore" - COSMOS_DB_SQL = "CosmosDBSql" - AZURE_BLOB_STORAGE = "AzureBlobStorage" - - -class DataTransferJobMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Mode of job execution.""" - - OFFLINE = "Offline" - ONLINE = "Online" - - class DataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The datatype for which the indexing behavior is applied to.""" @@ -239,19 +160,12 @@ class DefaultConsistencyLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): CONSISTENT_PREFIX = "ConsistentPrefix" -class DefaultPriorityLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Enum to indicate default priorityLevel of requests.""" - - HIGH = "High" - LOW = "Low" - - -class EnableFullTextQuery(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Describe the level of detail with which queries are to be logged.""" +class DistanceFunction(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The distance function to use for distance calculation in between vectors.""" - NONE = "None" - TRUE = "True" - FALSE = "False" + EUCLIDEAN = "euclidean" + COSINE = "cosine" + DOTPRODUCT = "dotproduct" class IndexingMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -270,22 +184,6 @@ class IndexKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): SPATIAL = "Spatial" -class IssueType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Type of issue.""" - - UNKNOWN = "Unknown" - """Unknown issue type""" - CONFIGURATION_PROPAGATION_FAILURE = "ConfigurationPropagationFailure" - """An error occurred while applying the network security perimeter (NSP) configuration.""" - MISSING_PERIMETER_CONFIGURATION = "MissingPerimeterConfiguration" - """A network connectivity issue is happening on the resource which could be addressed either by - adding new resources to the network security perimeter (NSP) or by modifying access rules.""" - MISSING_IDENTITY_CONFIGURATION = "MissingIdentityConfiguration" - """An managed identity hasn't been associated with the resource. The resource will still be able - to validate inbound traffic from the network security perimeter (NSP) or matching inbound - access rules, but it won't be able to perform outbound access as a member of the NSP.""" - - class KeyKind(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The access key to regenerate.""" @@ -323,8 +221,8 @@ class ManagedCassandraResourceIdentityType(str, Enum, metaclass=CaseInsensitiveE class MinimalTlsVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and - Mongo API's, which only work with Tls 1.2. + """Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo + APIs only work with Tls 1.2. """ TLS = "Tls" @@ -346,20 +244,6 @@ class NetworkAclBypass(str, Enum, metaclass=CaseInsensitiveEnumMeta): AZURE_SERVICES = "AzureServices" -class NetworkSecurityPerimeterConfigurationProvisioningState(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Provisioning state of a network security perimeter configuration that is being created or - updated. - """ - - SUCCEEDED = "Succeeded" - CREATING = "Creating" - UPDATING = "Updating" - DELETING = "Deleting" - ACCEPTED = "Accepted" - FAILED = "Failed" - CANCELED = "Canceled" - - class NodeState(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The state of the node in Cassandra ring.""" @@ -422,17 +306,6 @@ class PublicNetworkAccess(str, Enum, metaclass=CaseInsensitiveEnumMeta): SECURED_BY_PERIMETER = "SecuredByPerimeter" -class ResourceAssociationAccessMode(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Access mode of the resource association.""" - - ENFORCED = "Enforced" - """Enforced access mode - traffic to the resource that failed access checks is blocked""" - LEARNING = "Learning" - """Learning access mode - traffic to the resource is enabled for analysis but not blocked""" - AUDIT = "Audit" - """Audit access mode - traffic to the resource that fails access checks is logged but not blocked""" - - class ResourceIdentityType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """The type of identity used for the resource. The type 'SystemAssigned,UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will @@ -458,14 +331,6 @@ class RoleDefinitionType(str, Enum, metaclass=CaseInsensitiveEnumMeta): CUSTOM_ROLE = "CustomRole" -class ScheduledEventStrategy(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """How the nodes in the cluster react to scheduled events.""" - - IGNORE = "Ignore" - STOP_ANY = "StopAny" - STOP_BY_RACK = "StopByRack" - - class ServerVersion(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Describes the version of the MongoDB account.""" @@ -506,13 +371,6 @@ class ServiceType(str, Enum, metaclass=CaseInsensitiveEnumMeta): MATERIALIZED_VIEWS_BUILDER = "MaterializedViewsBuilder" -class Severity(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Severity of the issue.""" - - WARNING = "Warning" - ERROR = "Error" - - class SpatialType(str, Enum, metaclass=CaseInsensitiveEnumMeta): """Indicates the spatial type of index.""" @@ -530,25 +388,6 @@ class Status(str, Enum, metaclass=CaseInsensitiveEnumMeta): INTERNALLY_READY = "InternallyReady" ONLINE = "Online" DELETING = "Deleting" - SUCCEEDED = "Succeeded" - FAILED = "Failed" - CANCELED = "Canceled" - UPDATING = "Updating" - - -class SupportedActions(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """Indicates whether what action to take for the Chaos Fault.""" - - ENABLE = "Enable" - DISABLE = "Disable" - - -class ThroughputPolicyType(str, Enum, metaclass=CaseInsensitiveEnumMeta): - """ThroughputPolicy to apply for throughput redistribution.""" - - NONE = "none" - EQUAL = "equal" - CUSTOM = "custom" class TriggerOperation(str, Enum, metaclass=CaseInsensitiveEnumMeta): @@ -592,3 +431,19 @@ class UnitType(str, Enum, metaclass=CaseInsensitiveEnumMeta): COUNT_PER_SECOND = "CountPerSecond" BYTES_PER_SECOND = "BytesPerSecond" MILLISECONDS = "Milliseconds" + + +class VectorDataType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """Indicates the data type of vector.""" + + FLOAT32 = "float32" + UINT8 = "uint8" + INT8 = "int8" + + +class VectorIndexType(str, Enum, metaclass=CaseInsensitiveEnumMeta): + """The index type of the vector. Currently, flat, diskANN, and quantizedFlat are supported.""" + + FLAT = "flat" + DISK_ANN = "diskANN" + QUANTIZED_FLAT = "quantizedFlat" diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py index 1d9a9c000dba..100541c73721 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models_py3.py @@ -8,140 +8,13 @@ # -------------------------------------------------------------------------- import datetime -import sys from typing import Any, Dict, List, Optional, TYPE_CHECKING, Union from .. import _serialization -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports - if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from .. import models as _models -JSON = MutableMapping[str, Any] # pylint: disable=unsubscriptable-object - - -class AccessRule(_serialization.Model): - """Access rule in a network security perimeter configuration profile. - - :ivar name: Name of the access rule. - :vartype name: str - :ivar properties: Properties of Access Rule. - :vartype properties: ~azure.mgmt.cosmosdb.models.AccessRuleProperties - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "properties": {"key": "properties", "type": "AccessRuleProperties"}, - } - - def __init__( - self, *, name: Optional[str] = None, properties: Optional["_models.AccessRuleProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword name: Name of the access rule. - :paramtype name: str - :keyword properties: Properties of Access Rule. - :paramtype properties: ~azure.mgmt.cosmosdb.models.AccessRuleProperties - """ - super().__init__(**kwargs) - self.name = name - self.properties = properties - - -class AccessRuleProperties(_serialization.Model): - """Properties of Access Rule. - - :ivar direction: Direction of Access Rule. Known values are: "Inbound" and "Outbound". - :vartype direction: str or ~azure.mgmt.cosmosdb.models.AccessRuleDirection - :ivar address_prefixes: Address prefixes in the CIDR format for inbound rules. - :vartype address_prefixes: list[str] - :ivar subscriptions: Subscriptions for inbound rules. - :vartype subscriptions: list[~azure.mgmt.cosmosdb.models.AccessRulePropertiesSubscriptionsItem] - :ivar network_security_perimeters: Network security perimeters for inbound rules. - :vartype network_security_perimeters: - list[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeter] - :ivar fully_qualified_domain_names: Fully qualified domain names (FQDN) for outbound rules. - :vartype fully_qualified_domain_names: list[str] - :ivar email_addresses: Email addresses for outbound rules. - :vartype email_addresses: list[str] - :ivar phone_numbers: Phone numbers for outbound rules. - :vartype phone_numbers: list[str] - """ - - _attribute_map = { - "direction": {"key": "direction", "type": "str"}, - "address_prefixes": {"key": "addressPrefixes", "type": "[str]"}, - "subscriptions": {"key": "subscriptions", "type": "[AccessRulePropertiesSubscriptionsItem]"}, - "network_security_perimeters": {"key": "networkSecurityPerimeters", "type": "[NetworkSecurityPerimeter]"}, - "fully_qualified_domain_names": {"key": "fullyQualifiedDomainNames", "type": "[str]"}, - "email_addresses": {"key": "emailAddresses", "type": "[str]"}, - "phone_numbers": {"key": "phoneNumbers", "type": "[str]"}, - } - - def __init__( - self, - *, - direction: Optional[Union[str, "_models.AccessRuleDirection"]] = None, - address_prefixes: Optional[List[str]] = None, - subscriptions: Optional[List["_models.AccessRulePropertiesSubscriptionsItem"]] = None, - network_security_perimeters: Optional[List["_models.NetworkSecurityPerimeter"]] = None, - fully_qualified_domain_names: Optional[List[str]] = None, - email_addresses: Optional[List[str]] = None, - phone_numbers: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword direction: Direction of Access Rule. Known values are: "Inbound" and "Outbound". - :paramtype direction: str or ~azure.mgmt.cosmosdb.models.AccessRuleDirection - :keyword address_prefixes: Address prefixes in the CIDR format for inbound rules. - :paramtype address_prefixes: list[str] - :keyword subscriptions: Subscriptions for inbound rules. - :paramtype subscriptions: - list[~azure.mgmt.cosmosdb.models.AccessRulePropertiesSubscriptionsItem] - :keyword network_security_perimeters: Network security perimeters for inbound rules. - :paramtype network_security_perimeters: - list[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeter] - :keyword fully_qualified_domain_names: Fully qualified domain names (FQDN) for outbound rules. - :paramtype fully_qualified_domain_names: list[str] - :keyword email_addresses: Email addresses for outbound rules. - :paramtype email_addresses: list[str] - :keyword phone_numbers: Phone numbers for outbound rules. - :paramtype phone_numbers: list[str] - """ - super().__init__(**kwargs) - self.direction = direction - self.address_prefixes = address_prefixes - self.subscriptions = subscriptions - self.network_security_perimeters = network_security_perimeters - self.fully_qualified_domain_names = fully_qualified_domain_names - self.email_addresses = email_addresses - self.phone_numbers = phone_numbers - - -class AccessRulePropertiesSubscriptionsItem(_serialization.Model): - """Subscription identifiers. - - :ivar id: The fully qualified Azure resource ID of the subscription e.g. - ('/subscriptions/00000000-0000-0000-0000-000000000000'). - :vartype id: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: Optional[str] = None, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: The fully qualified Azure resource ID of the subscription e.g. - ('/subscriptions/00000000-0000-0000-0000-000000000000'). - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id class AccountKeyMetadata(_serialization.Model): @@ -269,8 +142,6 @@ class ARMResourceProperties(_serialization.Model): 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 """ _validation = { @@ -285,17 +156,9 @@ class ARMResourceProperties(_serialization.Model): "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, } - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: """ :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str @@ -306,8 +169,6 @@ def __init__( 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 """ super().__init__(**kwargs) self.id = None @@ -315,7 +176,6 @@ def __init__( self.type = None self.location = location self.tags = tags - self.identity = identity class AuthenticationMethodLdapProperties(_serialization.Model): @@ -490,80 +350,6 @@ def __init__( self.throughput_policy = throughput_policy -class DataTransferDataSourceSink(_serialization.Model): - """Base class for all DataTransfer source/sink. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - AzureBlobDataTransferDataSourceSink, BaseCosmosDataTransferDataSourceSink, - CosmosMongoVCoreDataTransferDataSourceSink - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - """ - - _validation = { - "component": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - } - - _subtype_map = { - "component": { - "AzureBlobStorage": "AzureBlobDataTransferDataSourceSink", - "BaseCosmosDataTransferDataSourceSink": "BaseCosmosDataTransferDataSourceSink", - "CosmosDBMongoVCore": "CosmosMongoVCoreDataTransferDataSourceSink", - } - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.component: Optional[str] = None - - -class AzureBlobDataTransferDataSourceSink(DataTransferDataSourceSink): - """An Azure Blob Storage data source/sink. - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar container_name: Required. - :vartype container_name: str - :ivar endpoint_url: - :vartype endpoint_url: str - """ - - _validation = { - "component": {"required": True}, - "container_name": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "container_name": {"key": "containerName", "type": "str"}, - "endpoint_url": {"key": "endpointUrl", "type": "str"}, - } - - def __init__(self, *, container_name: str, endpoint_url: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword container_name: Required. - :paramtype container_name: str - :keyword endpoint_url: - :paramtype endpoint_url: str - """ - super().__init__(**kwargs) - self.component: str = "AzureBlobStorage" - self.container_name = container_name - self.endpoint_url = endpoint_url - - class BackupInformation(_serialization.Model): """Backup information of a resource. @@ -670,145 +456,6 @@ def __init__( self.start_time = start_time -class BackupResource(_serialization.Model): - """A restorable backup of a Cassandra cluster. - - :ivar backup_id: The unique identifier of backup. - :vartype backup_id: str - :ivar backup_state: The current state of the backup. Known values are: "Initiated", - "InProgress", "Succeeded", and "Failed". - :vartype backup_state: str or ~azure.mgmt.cosmosdb.models.BackupState - :ivar backup_start_timestamp: The time at which the backup process begins. - :vartype backup_start_timestamp: ~datetime.datetime - :ivar backup_stop_timestamp: The time at which the backup process ends. - :vartype backup_stop_timestamp: ~datetime.datetime - :ivar backup_expiry_timestamp: The time at which the backup will expire. - :vartype backup_expiry_timestamp: ~datetime.datetime - """ - - _attribute_map = { - "backup_id": {"key": "backupId", "type": "str"}, - "backup_state": {"key": "backupState", "type": "str"}, - "backup_start_timestamp": {"key": "backupStartTimestamp", "type": "iso-8601"}, - "backup_stop_timestamp": {"key": "backupStopTimestamp", "type": "iso-8601"}, - "backup_expiry_timestamp": {"key": "backupExpiryTimestamp", "type": "iso-8601"}, - } - - def __init__( - self, - *, - backup_id: Optional[str] = None, - backup_state: Optional[Union[str, "_models.BackupState"]] = None, - backup_start_timestamp: Optional[datetime.datetime] = None, - backup_stop_timestamp: Optional[datetime.datetime] = None, - backup_expiry_timestamp: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword backup_id: The unique identifier of backup. - :paramtype backup_id: str - :keyword backup_state: The current state of the backup. Known values are: "Initiated", - "InProgress", "Succeeded", and "Failed". - :paramtype backup_state: str or ~azure.mgmt.cosmosdb.models.BackupState - :keyword backup_start_timestamp: The time at which the backup process begins. - :paramtype backup_start_timestamp: ~datetime.datetime - :keyword backup_stop_timestamp: The time at which the backup process ends. - :paramtype backup_stop_timestamp: ~datetime.datetime - :keyword backup_expiry_timestamp: The time at which the backup will expire. - :paramtype backup_expiry_timestamp: ~datetime.datetime - """ - super().__init__(**kwargs) - self.backup_id = backup_id - self.backup_state = backup_state - self.backup_start_timestamp = backup_start_timestamp - self.backup_stop_timestamp = backup_stop_timestamp - self.backup_expiry_timestamp = backup_expiry_timestamp - - -class BackupSchedule(_serialization.Model): - """BackupSchedule. - - :ivar schedule_name: The unique identifier of backup schedule. - :vartype schedule_name: str - :ivar cron_expression: The cron expression that defines when you want to back up your data. - :vartype cron_expression: str - :ivar retention_in_hours: The retention period (hours) of the backups. If you want to retain - data forever, set retention to 0. - :vartype retention_in_hours: int - """ - - _attribute_map = { - "schedule_name": {"key": "scheduleName", "type": "str"}, - "cron_expression": {"key": "cronExpression", "type": "str"}, - "retention_in_hours": {"key": "retentionInHours", "type": "int"}, - } - - def __init__( - self, - *, - schedule_name: Optional[str] = None, - cron_expression: Optional[str] = None, - retention_in_hours: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword schedule_name: The unique identifier of backup schedule. - :paramtype schedule_name: str - :keyword cron_expression: The cron expression that defines when you want to back up your data. - :paramtype cron_expression: str - :keyword retention_in_hours: The retention period (hours) of the backups. If you want to retain - data forever, set retention to 0. - :paramtype retention_in_hours: int - """ - super().__init__(**kwargs) - self.schedule_name = schedule_name - self.cron_expression = cron_expression - self.retention_in_hours = retention_in_hours - - -class BaseCosmosDataTransferDataSourceSink(DataTransferDataSourceSink): - """A base CosmosDB data source/sink. - - You probably want to use the sub-classes and not this class directly. Known sub-classes are: - CosmosCassandraDataTransferDataSourceSink, CosmosMongoDataTransferDataSourceSink, - CosmosSqlDataTransferDataSourceSink - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar remote_account_name: - :vartype remote_account_name: str - """ - - _validation = { - "component": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "remote_account_name": {"key": "remoteAccountName", "type": "str"}, - } - - _subtype_map = { - "component": { - "CosmosDBCassandra": "CosmosCassandraDataTransferDataSourceSink", - "CosmosDBMongo": "CosmosMongoDataTransferDataSourceSink", - "CosmosDBSql": "CosmosSqlDataTransferDataSourceSink", - } - } - - def __init__(self, *, remote_account_name: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword remote_account_name: - :paramtype remote_account_name: str - """ - super().__init__(**kwargs) - self.component: str = "BaseCosmosDataTransferDataSourceSink" - self.remote_account_name = remote_account_name - - class Capability(_serialization.Model): """Cosmos DB capability object. @@ -861,77 +508,6 @@ def __init__(self, *, total_throughput_limit: Optional[int] = None, **kwargs: An self.total_throughput_limit = total_throughput_limit -class CapacityModeChangeTransitionState(_serialization.Model): - """The transition state information related capacity mode change with update request. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar capacity_mode_transition_status: The transition status of capacity mode. Known values - are: "Invalid", "Initialized", "InProgress", "Completed", and "Failed". - :vartype capacity_mode_transition_status: str or - ~azure.mgmt.cosmosdb.models.CapacityModeTransitionStatus - :ivar current_capacity_mode: Indicates the current capacity mode of the account. Known values - are: "None", "Provisioned", and "Serverless". - :vartype current_capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :ivar previous_capacity_mode: Indicates the previous capacity mode of the account before - successful transition. Known values are: "None", "Provisioned", and "Serverless". - :vartype previous_capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :ivar capacity_mode_transition_begin_timestamp: Begin time in UTC of the capacity mode change. - :vartype capacity_mode_transition_begin_timestamp: ~datetime.datetime - :ivar capacity_mode_transition_end_timestamp: End time in UTC of the capacity mode change. - :vartype capacity_mode_transition_end_timestamp: ~datetime.datetime - :ivar capacity_mode_last_successful_transition_end_timestamp: End time in UTC of the last - successful capacity mode change. - :vartype capacity_mode_last_successful_transition_end_timestamp: ~datetime.datetime - """ - - _validation = { - "capacity_mode_transition_begin_timestamp": {"readonly": True}, - "capacity_mode_transition_end_timestamp": {"readonly": True}, - "capacity_mode_last_successful_transition_end_timestamp": {"readonly": True}, - } - - _attribute_map = { - "capacity_mode_transition_status": {"key": "capacityModeTransitionStatus", "type": "str"}, - "current_capacity_mode": {"key": "currentCapacityMode", "type": "str"}, - "previous_capacity_mode": {"key": "previousCapacityMode", "type": "str"}, - "capacity_mode_transition_begin_timestamp": {"key": "capacityModeTransitionBeginTimestamp", "type": "iso-8601"}, - "capacity_mode_transition_end_timestamp": {"key": "capacityModeTransitionEndTimestamp", "type": "iso-8601"}, - "capacity_mode_last_successful_transition_end_timestamp": { - "key": "capacityModeLastSuccessfulTransitionEndTimestamp", - "type": "iso-8601", - }, - } - - def __init__( - self, - *, - capacity_mode_transition_status: Optional[Union[str, "_models.CapacityModeTransitionStatus"]] = None, - current_capacity_mode: Optional[Union[str, "_models.CapacityMode"]] = None, - previous_capacity_mode: Optional[Union[str, "_models.CapacityMode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword capacity_mode_transition_status: The transition status of capacity mode. Known values - are: "Invalid", "Initialized", "InProgress", "Completed", and "Failed". - :paramtype capacity_mode_transition_status: str or - ~azure.mgmt.cosmosdb.models.CapacityModeTransitionStatus - :keyword current_capacity_mode: Indicates the current capacity mode of the account. Known - values are: "None", "Provisioned", and "Serverless". - :paramtype current_capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :keyword previous_capacity_mode: Indicates the previous capacity mode of the account before - successful transition. Known values are: "None", "Provisioned", and "Serverless". - :paramtype previous_capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - """ - super().__init__(**kwargs) - self.capacity_mode_transition_status = capacity_mode_transition_status - self.current_capacity_mode = current_capacity_mode - self.previous_capacity_mode = previous_capacity_mode - self.capacity_mode_transition_begin_timestamp = None - self.capacity_mode_transition_end_timestamp = None - self.capacity_mode_last_successful_transition_end_timestamp = None - - class CassandraClusterDataCenterNodeItem(_serialization.Model): # pylint: disable=too-many-instance-attributes """CassandraClusterDataCenterNodeItem. @@ -973,8 +549,6 @@ class CassandraClusterDataCenterNodeItem(_serialization.Model): # pylint: disab :vartype memory_total_kb: int :ivar cpu_usage: A float representing the current system-wide CPU utilization as a percentage. :vartype cpu_usage: float - :ivar is_latest_model: If node has been updated to latest model. - :vartype is_latest_model: bool """ _attribute_map = { @@ -995,7 +569,6 @@ class CassandraClusterDataCenterNodeItem(_serialization.Model): # pylint: disab "memory_free_kb": {"key": "memoryFreeKB", "type": "int"}, "memory_total_kb": {"key": "memoryTotalKB", "type": "int"}, "cpu_usage": {"key": "cpuUsage", "type": "float"}, - "is_latest_model": {"key": "isLatestModel", "type": "bool"}, } def __init__( @@ -1018,7 +591,6 @@ def __init__( memory_free_kb: Optional[int] = None, memory_total_kb: Optional[int] = None, cpu_usage: Optional[float] = None, - is_latest_model: Optional[bool] = None, **kwargs: Any ) -> None: """ @@ -1062,8 +634,6 @@ def __init__( :keyword cpu_usage: A float representing the current system-wide CPU utilization as a percentage. :paramtype cpu_usage: float - :keyword is_latest_model: If node has been updated to latest model. - :paramtype is_latest_model: bool """ super().__init__(**kwargs) self.address = address @@ -1083,7 +653,6 @@ def __init__( self.memory_free_kb = memory_free_kb self.memory_total_kb = memory_total_kb self.cpu_usage = cpu_usage - self.is_latest_model = is_latest_model class CassandraClusterPublicStatus(_serialization.Model): @@ -1252,8 +821,6 @@ class CassandraKeyspaceCreateUpdateParameters(ARMResourceProperties): 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: The standard JSON format of a Cassandra keyspace. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to @@ -1274,7 +841,6 @@ class CassandraKeyspaceCreateUpdateParameters(ARMResourceProperties): "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": "CassandraKeyspaceResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } @@ -1285,7 +851,6 @@ def __init__( resource: "_models.CassandraKeyspaceResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -1299,15 +864,13 @@ def __init__( 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: The standard JSON format of a Cassandra keyspace. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -1482,8 +1045,6 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): 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: :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesResource :ivar options: @@ -1502,7 +1063,6 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): "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": "CassandraKeyspaceGetPropertiesResource"}, "options": {"key": "properties.options", "type": "CassandraKeyspaceGetPropertiesOptions"}, } @@ -1512,7 +1072,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.CassandraKeyspaceGetPropertiesResource"] = None, options: Optional["_models.CassandraKeyspaceGetPropertiesOptions"] = None, **kwargs: Any @@ -1527,14 +1086,12 @@ def __init__( 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: :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesResource :keyword options: :paramtype options: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -1643,8 +1200,6 @@ class CassandraTableCreateUpdateParameters(ARMResourceProperties): 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: The standard JSON format of a Cassandra table. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraTableResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to @@ -1665,7 +1220,6 @@ class CassandraTableCreateUpdateParameters(ARMResourceProperties): "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": "CassandraTableResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } @@ -1676,7 +1230,6 @@ def __init__( resource: "_models.CassandraTableResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -1690,15 +1243,13 @@ def __init__( 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: The standard JSON format of a Cassandra table. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraTableResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -1858,8 +1409,6 @@ class CassandraTableGetResults(ARMResourceProperties): 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: :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesResource :ivar options: @@ -1878,7 +1427,6 @@ class CassandraTableGetResults(ARMResourceProperties): "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": "CassandraTableGetPropertiesResource"}, "options": {"key": "properties.options", "type": "CassandraTableGetPropertiesOptions"}, } @@ -1888,7 +1436,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.CassandraTableGetPropertiesResource"] = None, options: Optional["_models.CassandraTableGetPropertiesOptions"] = None, **kwargs: Any @@ -1903,14 +1450,12 @@ def __init__( 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: :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesResource :keyword options: :paramtype options: ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -1938,139 +1483,170 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class CassandraViewCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB Cassandra view. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. +class Certificate(_serialization.Model): + """Certificate. - :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: 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: The standard JSON format of a Cassandra view. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraViewResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :ivar pem: PEM formatted public key. + :vartype pem: str """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": 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": "CassandraViewResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, + "pem": {"key": "pem", "type": "str"}, } - def __init__( - self, - *, - resource: "_models.CassandraViewResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs: Any - ) -> None: + def __init__(self, *, pem: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword 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: The standard JSON format of a Cassandra view. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraViewResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :keyword pem: PEM formatted public key. + :paramtype pem: str """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options + super().__init__(**kwargs) + self.pem = pem -class CassandraViewGetPropertiesOptions(OptionsResource): - """CassandraViewGetPropertiesOptions. +class ClientEncryptionIncludedPath(_serialization.Model): + """. - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + All required parameters must be populated in order to send to server. + + :ivar path: Path that needs to be encrypted. Required. + :vartype path: str + :ivar client_encryption_key_id: The identifier of the Client Encryption Key to be used to + encrypt the path. Required. + :vartype client_encryption_key_id: str + :ivar encryption_type: The type of encryption to be performed. Eg - Deterministic, Randomized. + Required. + :vartype encryption_type: str + :ivar encryption_algorithm: The encryption algorithm which will be used. Eg - + AEAD_AES_256_CBC_HMAC_SHA256. Required. + :vartype encryption_algorithm: str """ + _validation = { + "path": {"required": True}, + "client_encryption_key_id": {"required": True}, + "encryption_type": {"required": True}, + "encryption_algorithm": {"required": True}, + } + + _attribute_map = { + "path": {"key": "path", "type": "str"}, + "client_encryption_key_id": {"key": "clientEncryptionKeyId", "type": "str"}, + "encryption_type": {"key": "encryptionType", "type": "str"}, + "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, + } + + def __init__( + self, + *, + path: str, + client_encryption_key_id: str, + encryption_type: str, + encryption_algorithm: str, + **kwargs: Any + ) -> None: + """ + :keyword path: Path that needs to be encrypted. Required. + :paramtype path: str + :keyword client_encryption_key_id: The identifier of the Client Encryption Key to be used to + encrypt the path. Required. + :paramtype client_encryption_key_id: str + :keyword encryption_type: The type of encryption to be performed. Eg - Deterministic, + Randomized. Required. + :paramtype encryption_type: str + :keyword encryption_algorithm: The encryption algorithm which will be used. Eg - + AEAD_AES_256_CBC_HMAC_SHA256. Required. + :paramtype encryption_algorithm: str + """ + super().__init__(**kwargs) + self.path = path + self.client_encryption_key_id = client_encryption_key_id + self.encryption_type = encryption_type + self.encryption_algorithm = encryption_algorithm + -class CassandraViewResource(_serialization.Model): - """Cosmos DB Cassandra view resource object. +class ClientEncryptionKeyCreateUpdateParameters(_serialization.Model): # pylint: disable=name-too-long + """Parameters to create and update ClientEncryptionKey. All required parameters must be populated in order to send to server. - :ivar id: Name of the Cosmos DB Cassandra view. Required. - :vartype id: str - :ivar view_definition: View Definition of the Cosmos DB Cassandra view. Required. - :vartype view_definition: str + :ivar resource: The standard JSON format of a ClientEncryptionKey. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyResource """ _validation = { - "id": {"required": True}, - "view_definition": {"required": True}, + "resource": {"required": True}, + } + + _attribute_map = { + "resource": {"key": "properties.resource", "type": "ClientEncryptionKeyResource"}, } + def __init__(self, *, resource: "_models.ClientEncryptionKeyResource", **kwargs: Any) -> None: + """ + :keyword resource: The standard JSON format of a ClientEncryptionKey. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyResource + """ + super().__init__(**kwargs) + self.resource = resource + + +class ClientEncryptionKeyResource(_serialization.Model): + """Cosmos DB client encryption key resource object. + + :ivar id: Name of the ClientEncryptionKey. + :vartype id: str + :ivar encryption_algorithm: Encryption algorithm that will be used along with this client + encryption key to encrypt/decrypt data. + :vartype encryption_algorithm: str + :ivar wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte + array. + :vartype wrapped_data_encryption_key: bytes + :ivar key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the + wrapped client encryption key. + :vartype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata + """ + _attribute_map = { "id": {"key": "id", "type": "str"}, - "view_definition": {"key": "viewDefinition", "type": "str"}, + "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, + "wrapped_data_encryption_key": {"key": "wrappedDataEncryptionKey", "type": "bytearray"}, + "key_wrap_metadata": {"key": "keyWrapMetadata", "type": "KeyWrapMetadata"}, } - def __init__(self, *, id: str, view_definition: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + encryption_algorithm: Optional[str] = None, + wrapped_data_encryption_key: Optional[bytes] = None, + key_wrap_metadata: Optional["_models.KeyWrapMetadata"] = None, + **kwargs: Any + ) -> None: """ - :keyword id: Name of the Cosmos DB Cassandra view. Required. + :keyword id: Name of the ClientEncryptionKey. :paramtype id: str - :keyword view_definition: View Definition of the Cosmos DB Cassandra view. Required. - :paramtype view_definition: str + :keyword encryption_algorithm: Encryption algorithm that will be used along with this client + encryption key to encrypt/decrypt data. + :paramtype encryption_algorithm: str + :keyword wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte + array. + :paramtype wrapped_data_encryption_key: bytes + :keyword key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the + wrapped client encryption key. + :paramtype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata """ super().__init__(**kwargs) self.id = id - self.view_definition = view_definition + self.encryption_algorithm = encryption_algorithm + self.wrapped_data_encryption_key = wrapped_data_encryption_key + self.key_wrap_metadata = key_wrap_metadata -class CassandraViewGetPropertiesResource(CassandraViewResource, ExtendedResourceProperties): - """CassandraViewGetPropertiesResource. +class ClientEncryptionKeyGetPropertiesResource(ClientEncryptionKeyResource, ExtendedResourceProperties): + """ClientEncryptionKeyGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - :ivar rid: A system generated property. A unique identifier. :vartype rid: str :ivar ts: A system generated property that denotes the last updated timestamp of the resource. @@ -2078,18 +1654,23 @@ class CassandraViewGetPropertiesResource(CassandraViewResource, ExtendedResource :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :ivar id: Name of the Cosmos DB Cassandra view. Required. + :ivar id: Name of the ClientEncryptionKey. :vartype id: str - :ivar view_definition: View Definition of the Cosmos DB Cassandra view. Required. - :vartype view_definition: str + :ivar encryption_algorithm: Encryption algorithm that will be used along with this client + encryption key to encrypt/decrypt data. + :vartype encryption_algorithm: str + :ivar wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte + array. + :vartype wrapped_data_encryption_key: bytes + :ivar key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the + wrapped client encryption key. + :vartype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata """ _validation = { "rid": {"readonly": True}, "ts": {"readonly": True}, "etag": {"readonly": True}, - "id": {"required": True}, - "view_definition": {"required": True}, } _attribute_map = { @@ -2097,50 +1678,62 @@ class CassandraViewGetPropertiesResource(CassandraViewResource, ExtendedResource "ts": {"key": "_ts", "type": "float"}, "etag": {"key": "_etag", "type": "str"}, "id": {"key": "id", "type": "str"}, - "view_definition": {"key": "viewDefinition", "type": "str"}, + "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, + "wrapped_data_encryption_key": {"key": "wrappedDataEncryptionKey", "type": "bytearray"}, + "key_wrap_metadata": {"key": "keyWrapMetadata", "type": "KeyWrapMetadata"}, } - def __init__(self, *, id: str, view_definition: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin + def __init__( + self, + *, + id: Optional[str] = None, # pylint: disable=redefined-builtin + encryption_algorithm: Optional[str] = None, + wrapped_data_encryption_key: Optional[bytes] = None, + key_wrap_metadata: Optional["_models.KeyWrapMetadata"] = None, + **kwargs: Any + ) -> None: """ - :keyword id: Name of the Cosmos DB Cassandra view. Required. + :keyword id: Name of the ClientEncryptionKey. :paramtype id: str - :keyword view_definition: View Definition of the Cosmos DB Cassandra view. Required. - :paramtype view_definition: str + :keyword encryption_algorithm: Encryption algorithm that will be used along with this client + encryption key to encrypt/decrypt data. + :paramtype encryption_algorithm: str + :keyword wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte + array. + :paramtype wrapped_data_encryption_key: bytes + :keyword key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the + wrapped client encryption key. + :paramtype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata """ - super().__init__(id=id, view_definition=view_definition, **kwargs) + super().__init__( + id=id, + encryption_algorithm=encryption_algorithm, + wrapped_data_encryption_key=wrapped_data_encryption_key, + key_wrap_metadata=key_wrap_metadata, + **kwargs + ) self.rid = None self.ts = None self.etag = None self.id = id - self.view_definition = view_definition + self.encryption_algorithm = encryption_algorithm + self.wrapped_data_encryption_key = wrapped_data_encryption_key + self.key_wrap_metadata = key_wrap_metadata -class CassandraViewGetResults(ARMResourceProperties): - """An Azure Cosmos DB Cassandra view. +class ClientEncryptionKeyGetResults(ARMProxyResource): + """Client Encryption Key. 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. + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the database account. :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: 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: - :vartype resource: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesOptions + :vartype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetPropertiesResource """ _validation = { @@ -2153,52 +1746,27 @@ class CassandraViewGetResults(ARMResourceProperties): "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": "CassandraViewGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "CassandraViewGetPropertiesOptions"}, + "resource": {"key": "properties.resource", "type": "ClientEncryptionKeyGetPropertiesResource"}, } def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.CassandraViewGetPropertiesResource"] = None, - options: Optional["_models.CassandraViewGetPropertiesOptions"] = None, - **kwargs: Any + self, *, resource: Optional["_models.ClientEncryptionKeyGetPropertiesResource"] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword 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: - :paramtype resource: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesOptions + :paramtype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetPropertiesResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(**kwargs) self.resource = resource - self.options = options -class CassandraViewListResult(_serialization.Model): - """The List operation response, that contains the Cassandra views and their properties. +class ClientEncryptionKeysListResult(_serialization.Model): + """The List operation response, that contains the client encryption keys and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Cassandra views and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] + :ivar value: List of client encryption keys and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] """ _validation = { @@ -2206,7 +1774,7 @@ class CassandraViewListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[CassandraViewGetResults]"}, + "value": {"key": "value", "type": "[ClientEncryptionKeyGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -2215,682 +1783,216 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class Certificate(_serialization.Model): - """Certificate. +class ClientEncryptionPolicy(_serialization.Model): + """Cosmos DB client encryption policy. - :ivar pem: PEM formatted public key. - :vartype pem: str - """ + All required parameters must be populated in order to send to server. - _attribute_map = { - "pem": {"key": "pem", "type": "str"}, + :ivar included_paths: Paths of the item that need encryption along with path-specific settings. + Required. + :vartype included_paths: list[~azure.mgmt.cosmosdb.models.ClientEncryptionIncludedPath] + :ivar policy_format_version: Version of the client encryption policy definition. Supported + versions are 1 and 2. Version 2 supports id and partition key path encryption. Required. + :vartype policy_format_version: int + """ + + _validation = { + "included_paths": {"required": True}, + "policy_format_version": {"required": True, "maximum": 2, "minimum": 1}, } - def __init__(self, *, pem: Optional[str] = None, **kwargs: Any) -> None: + _attribute_map = { + "included_paths": {"key": "includedPaths", "type": "[ClientEncryptionIncludedPath]"}, + "policy_format_version": {"key": "policyFormatVersion", "type": "int"}, + } + + def __init__( + self, *, included_paths: List["_models.ClientEncryptionIncludedPath"], policy_format_version: int, **kwargs: Any + ) -> None: """ - :keyword pem: PEM formatted public key. - :paramtype pem: str + :keyword included_paths: Paths of the item that need encryption along with path-specific + settings. Required. + :paramtype included_paths: list[~azure.mgmt.cosmosdb.models.ClientEncryptionIncludedPath] + :keyword policy_format_version: Version of the client encryption policy definition. Supported + versions are 1 and 2. Version 2 supports id and partition key path encryption. Required. + :paramtype policy_format_version: int """ super().__init__(**kwargs) - self.pem = pem - + self.included_paths = included_paths + self.policy_format_version = policy_format_version -class ChaosFaultListResponse(_serialization.Model): - """Chaos Fault List Response. - Variables are only populated by the server, and will be ignored when sending a request. +class ClusterKey(_serialization.Model): + """Cosmos DB Cassandra table cluster key. - :ivar value: List of Chaos Faults. - :vartype value: list[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :ivar next_link: The link used to get the next page of results. - :vartype next_link: str + :ivar name: Name of the Cosmos DB Cassandra table cluster key. + :vartype name: str + :ivar order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and + "Desc". + :vartype order_by: str """ - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[ChaosFaultResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "name": {"key": "name", "type": "str"}, + "order_by": {"key": "orderBy", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, name: Optional[str] = None, order_by: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword name: Name of the Cosmos DB Cassandra table cluster key. + :paramtype name: str + :keyword order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and + "Desc". + :paramtype order_by: str + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.name = name + self.order_by = order_by -class Resource(_serialization.Model): - """Common fields that are returned in the response for all Azure Resource Manager resources. +class ManagedCassandraARMResourceProperties(_serialization.Model): + """The core properties of ARM resources. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the ARM resource. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The type of Azure resource. :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar 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.ManagedCassandraManagedServiceIdentity """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "system_data": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": {"key": "identity", "type": "ManagedCassandraManagedServiceIdentity"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, + **kwargs: Any + ) -> None: + """ + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword 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.ManagedCassandraManagedServiceIdentity + """ super().__init__(**kwargs) self.id = None self.name = None self.type = None - self.system_data = None - - -class ProxyResource(Resource): - """The resource model definition for a Azure Resource Manager proxy resource. It will not have - tags and a location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - """ + self.location = location + self.tags = tags + self.identity = identity -class ChaosFaultResource(ProxyResource): - """A request object to enable/disable the chaos fault. +class ClusterResource(ManagedCassandraARMResourceProperties): + """Representation of a managed Cassandra cluster. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the ARM resource. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The type of Azure resource. :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - :ivar action: Indicates whether what action to take for the Chaos Fault. Known values are: - "Enable" and "Disable". - :vartype action: str or ~azure.mgmt.cosmosdb.models.SupportedActions - :ivar region: Region of the account where the Chaos Fault is to be enabled/disabled. - :vartype region: str - :ivar database_name: Database name. - :vartype database_name: str - :ivar container_name: Container name. - :vartype container_name: str - :ivar provisioning_state: A provisioning state of the Chaos Fault. - :vartype provisioning_state: str + :ivar location: The location of the resource group to which the resource belongs. + :vartype location: str + :ivar 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.ManagedCassandraManagedServiceIdentity + :ivar properties: Properties of a managed Cassandra cluster. + :vartype properties: ~azure.mgmt.cosmosdb.models.ClusterResourceProperties """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "system_data": {"readonly": True}, - "provisioning_state": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "action": {"key": "properties.action", "type": "str"}, - "region": {"key": "properties.region", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "container_name": {"key": "properties.containerName", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "tags": {"key": "tags", "type": "{str}"}, + "identity": {"key": "identity", "type": "ManagedCassandraManagedServiceIdentity"}, + "properties": {"key": "properties", "type": "ClusterResourceProperties"}, } def __init__( self, *, - action: Optional[Union[str, "_models.SupportedActions"]] = None, - region: Optional[str] = None, - database_name: Optional[str] = None, - container_name: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, + properties: Optional["_models.ClusterResourceProperties"] = None, **kwargs: Any ) -> None: """ - :keyword action: Indicates whether what action to take for the Chaos Fault. Known values are: - "Enable" and "Disable". - :paramtype action: str or ~azure.mgmt.cosmosdb.models.SupportedActions - :keyword region: Region of the account where the Chaos Fault is to be enabled/disabled. - :paramtype region: str - :keyword database_name: Database name. - :paramtype database_name: str - :keyword container_name: Container name. - :paramtype container_name: str + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str + :keyword 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.ManagedCassandraManagedServiceIdentity + :keyword properties: Properties of a managed Cassandra cluster. + :paramtype properties: ~azure.mgmt.cosmosdb.models.ClusterResourceProperties """ - super().__init__(**kwargs) - self.action = action - self.region = region - self.database_name = database_name - self.container_name = container_name - self.provisioning_state = None - - -class ClientEncryptionIncludedPath(_serialization.Model): - """. - - All required parameters must be populated in order to send to server. - - :ivar path: Path that needs to be encrypted. Required. - :vartype path: str - :ivar client_encryption_key_id: The identifier of the Client Encryption Key to be used to - encrypt the path. Required. - :vartype client_encryption_key_id: str - :ivar encryption_type: The type of encryption to be performed. Eg - Deterministic, Randomized. - Required. - :vartype encryption_type: str - :ivar encryption_algorithm: The encryption algorithm which will be used. Eg - - AEAD_AES_256_CBC_HMAC_SHA256. Required. - :vartype encryption_algorithm: str - """ - - _validation = { - "path": {"required": True}, - "client_encryption_key_id": {"required": True}, - "encryption_type": {"required": True}, - "encryption_algorithm": {"required": True}, - } - - _attribute_map = { - "path": {"key": "path", "type": "str"}, - "client_encryption_key_id": {"key": "clientEncryptionKeyId", "type": "str"}, - "encryption_type": {"key": "encryptionType", "type": "str"}, - "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, - } + super().__init__(location=location, tags=tags, identity=identity, **kwargs) + self.properties = properties - def __init__( - self, - *, - path: str, - client_encryption_key_id: str, - encryption_type: str, - encryption_algorithm: str, - **kwargs: Any - ) -> None: - """ - :keyword path: Path that needs to be encrypted. Required. - :paramtype path: str - :keyword client_encryption_key_id: The identifier of the Client Encryption Key to be used to - encrypt the path. Required. - :paramtype client_encryption_key_id: str - :keyword encryption_type: The type of encryption to be performed. Eg - Deterministic, - Randomized. Required. - :paramtype encryption_type: str - :keyword encryption_algorithm: The encryption algorithm which will be used. Eg - - AEAD_AES_256_CBC_HMAC_SHA256. Required. - :paramtype encryption_algorithm: str - """ - super().__init__(**kwargs) - self.path = path - self.client_encryption_key_id = client_encryption_key_id - self.encryption_type = encryption_type - self.encryption_algorithm = encryption_algorithm +class ClusterResourceProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes + """Properties of a managed Cassandra cluster. -class ClientEncryptionKeyCreateUpdateParameters(_serialization.Model): # pylint: disable=name-too-long - """Parameters to create and update ClientEncryptionKey. - - All required parameters must be populated in order to send to server. - - :ivar resource: The standard JSON format of a ClientEncryptionKey. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyResource - """ - - _validation = { - "resource": {"required": True}, - } - - _attribute_map = { - "resource": {"key": "properties.resource", "type": "ClientEncryptionKeyResource"}, - } - - def __init__(self, *, resource: "_models.ClientEncryptionKeyResource", **kwargs: Any) -> None: - """ - :keyword resource: The standard JSON format of a ClientEncryptionKey. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyResource - """ - super().__init__(**kwargs) - self.resource = resource - - -class ClientEncryptionKeyResource(_serialization.Model): - """Cosmos DB client encryption key resource object. - - :ivar id: Name of the ClientEncryptionKey. - :vartype id: str - :ivar encryption_algorithm: Encryption algorithm that will be used along with this client - encryption key to encrypt/decrypt data. - :vartype encryption_algorithm: str - :ivar wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte - array. - :vartype wrapped_data_encryption_key: bytes - :ivar key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the - wrapped client encryption key. - :vartype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, - "wrapped_data_encryption_key": {"key": "wrappedDataEncryptionKey", "type": "bytearray"}, - "key_wrap_metadata": {"key": "keyWrapMetadata", "type": "KeyWrapMetadata"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - encryption_algorithm: Optional[str] = None, - wrapped_data_encryption_key: Optional[bytes] = None, - key_wrap_metadata: Optional["_models.KeyWrapMetadata"] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: Name of the ClientEncryptionKey. - :paramtype id: str - :keyword encryption_algorithm: Encryption algorithm that will be used along with this client - encryption key to encrypt/decrypt data. - :paramtype encryption_algorithm: str - :keyword wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte - array. - :paramtype wrapped_data_encryption_key: bytes - :keyword key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the - wrapped client encryption key. - :paramtype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata - """ - super().__init__(**kwargs) - self.id = id - self.encryption_algorithm = encryption_algorithm - self.wrapped_data_encryption_key = wrapped_data_encryption_key - self.key_wrap_metadata = key_wrap_metadata - - -class ClientEncryptionKeyGetPropertiesResource(ClientEncryptionKeyResource, ExtendedResourceProperties): - """ClientEncryptionKeyGetPropertiesResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the ClientEncryptionKey. - :vartype id: str - :ivar encryption_algorithm: Encryption algorithm that will be used along with this client - encryption key to encrypt/decrypt data. - :vartype encryption_algorithm: str - :ivar wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte - array. - :vartype wrapped_data_encryption_key: bytes - :ivar key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the - wrapped client encryption key. - :vartype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata - """ - - _validation = { - "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - } - - _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "encryption_algorithm": {"key": "encryptionAlgorithm", "type": "str"}, - "wrapped_data_encryption_key": {"key": "wrappedDataEncryptionKey", "type": "bytearray"}, - "key_wrap_metadata": {"key": "keyWrapMetadata", "type": "KeyWrapMetadata"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - encryption_algorithm: Optional[str] = None, - wrapped_data_encryption_key: Optional[bytes] = None, - key_wrap_metadata: Optional["_models.KeyWrapMetadata"] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: Name of the ClientEncryptionKey. - :paramtype id: str - :keyword encryption_algorithm: Encryption algorithm that will be used along with this client - encryption key to encrypt/decrypt data. - :paramtype encryption_algorithm: str - :keyword wrapped_data_encryption_key: Wrapped (encrypted) form of the key represented as a byte - array. - :paramtype wrapped_data_encryption_key: bytes - :keyword key_wrap_metadata: Metadata for the wrapping provider that can be used to unwrap the - wrapped client encryption key. - :paramtype key_wrap_metadata: ~azure.mgmt.cosmosdb.models.KeyWrapMetadata - """ - super().__init__( - id=id, - encryption_algorithm=encryption_algorithm, - wrapped_data_encryption_key=wrapped_data_encryption_key, - key_wrap_metadata=key_wrap_metadata, - **kwargs - ) - self.rid = None - self.ts = None - self.etag = None - self.id = id - self.encryption_algorithm = encryption_algorithm - self.wrapped_data_encryption_key = wrapped_data_encryption_key - self.key_wrap_metadata = key_wrap_metadata - - -class ClientEncryptionKeyGetResults(ARMProxyResource): - """Client Encryption Key. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar resource: - :vartype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetPropertiesResource - """ - - _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"}, - "resource": {"key": "properties.resource", "type": "ClientEncryptionKeyGetPropertiesResource"}, - } - - def __init__( - self, *, resource: Optional["_models.ClientEncryptionKeyGetPropertiesResource"] = None, **kwargs: Any - ) -> None: - """ - :keyword resource: - :paramtype resource: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetPropertiesResource - """ - super().__init__(**kwargs) - self.resource = resource - - -class ClientEncryptionKeysListResult(_serialization.Model): - """The List operation response, that contains the client encryption keys and their properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of client encryption keys and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[ClientEncryptionKeyGetResults]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - -class ClientEncryptionPolicy(_serialization.Model): - """Cosmos DB client encryption policy. - - All required parameters must be populated in order to send to server. - - :ivar included_paths: Paths of the item that need encryption along with path-specific settings. - Required. - :vartype included_paths: list[~azure.mgmt.cosmosdb.models.ClientEncryptionIncludedPath] - :ivar policy_format_version: Version of the client encryption policy definition. Supported - versions are 1 and 2. Version 2 supports id and partition key path encryption. Required. - :vartype policy_format_version: int - """ - - _validation = { - "included_paths": {"required": True}, - "policy_format_version": {"required": True, "maximum": 2, "minimum": 1}, - } - - _attribute_map = { - "included_paths": {"key": "includedPaths", "type": "[ClientEncryptionIncludedPath]"}, - "policy_format_version": {"key": "policyFormatVersion", "type": "int"}, - } - - def __init__( - self, *, included_paths: List["_models.ClientEncryptionIncludedPath"], policy_format_version: int, **kwargs: Any - ) -> None: - """ - :keyword included_paths: Paths of the item that need encryption along with path-specific - settings. Required. - :paramtype included_paths: list[~azure.mgmt.cosmosdb.models.ClientEncryptionIncludedPath] - :keyword policy_format_version: Version of the client encryption policy definition. Supported - versions are 1 and 2. Version 2 supports id and partition key path encryption. Required. - :paramtype policy_format_version: int - """ - super().__init__(**kwargs) - self.included_paths = included_paths - self.policy_format_version = policy_format_version - - -class ClusterKey(_serialization.Model): - """Cosmos DB Cassandra table cluster key. - - :ivar name: Name of the Cosmos DB Cassandra table cluster key. - :vartype name: str - :ivar order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and - "Desc". - :vartype order_by: str - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "order_by": {"key": "orderBy", "type": "str"}, - } - - def __init__(self, *, name: Optional[str] = None, order_by: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword name: Name of the Cosmos DB Cassandra table cluster key. - :paramtype name: str - :keyword order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and - "Desc". - :paramtype order_by: str - """ - super().__init__(**kwargs) - self.name = name - self.order_by = order_by - - -class ManagedCassandraARMResourceProperties(_serialization.Model): - """The core properties of ARM resources. - - 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: 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.ManagedCassandraManagedServiceIdentity - """ - - _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": "ManagedCassandraManagedServiceIdentity"}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword 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.ManagedCassandraManagedServiceIdentity - """ - super().__init__(**kwargs) - self.id = None - self.name = None - self.type = None - self.location = location - self.tags = tags - self.identity = identity - - -class ClusterResource(ManagedCassandraARMResourceProperties): - """Representation of a managed Cassandra cluster. - - 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: 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.ManagedCassandraManagedServiceIdentity - :ivar properties: Properties of a managed Cassandra cluster. - :vartype properties: ~azure.mgmt.cosmosdb.models.ClusterResourceProperties - """ - - _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": "ManagedCassandraManagedServiceIdentity"}, - "properties": {"key": "properties", "type": "ClusterResourceProperties"}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedCassandraManagedServiceIdentity"] = None, - properties: Optional["_models.ClusterResourceProperties"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword 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.ManagedCassandraManagedServiceIdentity - :keyword properties: Properties of a managed Cassandra cluster. - :paramtype properties: ~azure.mgmt.cosmosdb.models.ClusterResourceProperties - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.properties = properties - - -class ClusterResourceProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """Properties of a managed Cassandra cluster. - - Variables are only populated by the server, and will be ignored when sending a request. + Variables are only populated by the server, and will be ignored when sending a request. :ivar provisioning_state: The status of the resource at the time the operation was called. Known values are: "Creating", "Updating", "Deleting", "Succeeded", "Failed", and "Canceled". @@ -2928,9 +2030,6 @@ class ClusterResourceProperties(_serialization.Model): # pylint: disable=too-ma and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. :vartype repair_enabled: bool - :ivar auto_replicate: The form of AutoReplicate that is being used by this cluster. Known - values are: "None", "SystemKeyspaces", and "AllKeyspaces". - :vartype auto_replicate: str or ~azure.mgmt.cosmosdb.models.AutoReplicate :ivar client_certificates: List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not @@ -2951,9 +2050,6 @@ class ClusterResourceProperties(_serialization.Model): # pylint: disable=too-ma :ivar seed_nodes: List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. :vartype seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] - :ivar external_data_centers: List of the data center names for unmanaged data centers in this - cluster to be included in auto-replication. - :vartype external_data_centers: list[str] :ivar hours_between_backups: (Deprecated) Number of hours to wait between taking a backup of the cluster. :vartype hours_between_backups: int @@ -2961,23 +2057,12 @@ class ClusterResourceProperties(_serialization.Model): # pylint: disable=too-ma :vartype deallocated: bool :ivar cassandra_audit_logging_enabled: Whether Cassandra audit logging is enabled. :vartype cassandra_audit_logging_enabled: bool - :ivar cluster_type: Type of the cluster. If set to Production, some operations might not be - permitted on cluster. Known values are: "Production" and "NonProduction". - :vartype cluster_type: str or ~azure.mgmt.cosmosdb.models.ClusterType :ivar provision_error: Error related to resource provisioning. :vartype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError - :ivar extensions: Extensions to be added or updated on cluster. - :vartype extensions: list[str] - :ivar backup_schedules: List of backup schedules that define when you want to back up your - data. - :vartype backup_schedules: list[~azure.mgmt.cosmosdb.models.BackupSchedule] - :ivar scheduled_event_strategy: How the nodes in the cluster react to scheduled events. Known - values are: "Ignore", "StopAny", and "StopByRack". - :vartype scheduled_event_strategy: str or ~azure.mgmt.cosmosdb.models.ScheduledEventStrategy :ivar azure_connection_method: How to connect to the azure services needed for running the cluster. Known values are: "None" and "VPN". :vartype azure_connection_method: str or ~azure.mgmt.cosmosdb.models.AzureConnectionType - :ivar private_link_resource_id: If the Connection Method is Vpn, this is the Id of the private + :ivar private_link_resource_id: If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect to. :vartype private_link_resource_id: str """ @@ -2998,26 +2083,20 @@ class ClusterResourceProperties(_serialization.Model): # pylint: disable=too-ma "initial_cassandra_admin_password": {"key": "initialCassandraAdminPassword", "type": "str"}, "prometheus_endpoint": {"key": "prometheusEndpoint", "type": "SeedNode"}, "repair_enabled": {"key": "repairEnabled", "type": "bool"}, - "auto_replicate": {"key": "autoReplicate", "type": "str"}, "client_certificates": {"key": "clientCertificates", "type": "[Certificate]"}, "external_gossip_certificates": {"key": "externalGossipCertificates", "type": "[Certificate]"}, "gossip_certificates": {"key": "gossipCertificates", "type": "[Certificate]"}, "external_seed_nodes": {"key": "externalSeedNodes", "type": "[SeedNode]"}, "seed_nodes": {"key": "seedNodes", "type": "[SeedNode]"}, - "external_data_centers": {"key": "externalDataCenters", "type": "[str]"}, "hours_between_backups": {"key": "hoursBetweenBackups", "type": "int"}, "deallocated": {"key": "deallocated", "type": "bool"}, "cassandra_audit_logging_enabled": {"key": "cassandraAuditLoggingEnabled", "type": "bool"}, - "cluster_type": {"key": "clusterType", "type": "str"}, "provision_error": {"key": "provisionError", "type": "CassandraError"}, - "extensions": {"key": "extensions", "type": "[str]"}, - "backup_schedules": {"key": "backupSchedules", "type": "[BackupSchedule]"}, - "scheduled_event_strategy": {"key": "scheduledEventStrategy", "type": "str"}, "azure_connection_method": {"key": "azureConnectionMethod", "type": "str"}, "private_link_resource_id": {"key": "privateLinkResourceId", "type": "str"}, } - def __init__( # pylint: disable=too-many-locals + def __init__( self, *, provisioning_state: Optional[Union[str, "_models.ManagedCassandraProvisioningState"]] = None, @@ -3029,19 +2108,13 @@ def __init__( # pylint: disable=too-many-locals initial_cassandra_admin_password: Optional[str] = None, prometheus_endpoint: Optional["_models.SeedNode"] = None, repair_enabled: Optional[bool] = None, - auto_replicate: Optional[Union[str, "_models.AutoReplicate"]] = None, client_certificates: Optional[List["_models.Certificate"]] = None, external_gossip_certificates: Optional[List["_models.Certificate"]] = None, external_seed_nodes: Optional[List["_models.SeedNode"]] = None, - external_data_centers: Optional[List[str]] = None, hours_between_backups: Optional[int] = None, deallocated: Optional[bool] = None, cassandra_audit_logging_enabled: Optional[bool] = None, - cluster_type: Optional[Union[str, "_models.ClusterType"]] = None, provision_error: Optional["_models.CassandraError"] = None, - extensions: Optional[List[str]] = None, - backup_schedules: Optional[List["_models.BackupSchedule"]] = None, - scheduled_event_strategy: Optional[Union[str, "_models.ScheduledEventStrategy"]] = None, azure_connection_method: Optional[Union[str, "_models.AzureConnectionType"]] = None, **kwargs: Any ) -> None: @@ -3082,9 +2155,6 @@ def __init__( # pylint: disable=too-many-locals true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. :paramtype repair_enabled: bool - :keyword auto_replicate: The form of AutoReplicate that is being used by this cluster. Known - values are: "None", "SystemKeyspaces", and "AllKeyspaces". - :paramtype auto_replicate: str or ~azure.mgmt.cosmosdb.models.AutoReplicate :keyword client_certificates: List of TLS certificates used to authorize clients connecting to the cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is set, the managed Cassandra cluster will reject all connections not @@ -3098,9 +2168,6 @@ def __init__( # pylint: disable=too-many-locals :keyword external_seed_nodes: List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed nodes. :paramtype external_seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] - :keyword external_data_centers: List of the data center names for unmanaged data centers in - this cluster to be included in auto-replication. - :paramtype external_data_centers: list[str] :keyword hours_between_backups: (Deprecated) Number of hours to wait between taking a backup of the cluster. :paramtype hours_between_backups: int @@ -3108,19 +2175,8 @@ def __init__( # pylint: disable=too-many-locals :paramtype deallocated: bool :keyword cassandra_audit_logging_enabled: Whether Cassandra audit logging is enabled. :paramtype cassandra_audit_logging_enabled: bool - :keyword cluster_type: Type of the cluster. If set to Production, some operations might not be - permitted on cluster. Known values are: "Production" and "NonProduction". - :paramtype cluster_type: str or ~azure.mgmt.cosmosdb.models.ClusterType :keyword provision_error: Error related to resource provisioning. :paramtype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError - :keyword extensions: Extensions to be added or updated on cluster. - :paramtype extensions: list[str] - :keyword backup_schedules: List of backup schedules that define when you want to back up your - data. - :paramtype backup_schedules: list[~azure.mgmt.cosmosdb.models.BackupSchedule] - :keyword scheduled_event_strategy: How the nodes in the cluster react to scheduled events. - Known values are: "Ignore", "StopAny", and "StopByRack". - :paramtype scheduled_event_strategy: str or ~azure.mgmt.cosmosdb.models.ScheduledEventStrategy :keyword azure_connection_method: How to connect to the azure services needed for running the cluster. Known values are: "None" and "VPN". :paramtype azure_connection_method: str or ~azure.mgmt.cosmosdb.models.AzureConnectionType @@ -3135,21 +2191,15 @@ def __init__( # pylint: disable=too-many-locals self.initial_cassandra_admin_password = initial_cassandra_admin_password self.prometheus_endpoint = prometheus_endpoint self.repair_enabled = repair_enabled - self.auto_replicate = auto_replicate self.client_certificates = client_certificates self.external_gossip_certificates = external_gossip_certificates self.gossip_certificates = None self.external_seed_nodes = external_seed_nodes self.seed_nodes = None - self.external_data_centers = external_data_centers self.hours_between_backups = hours_between_backups self.deallocated = deallocated self.cassandra_audit_logging_enabled = cassandra_audit_logging_enabled - self.cluster_type = cluster_type self.provision_error = provision_error - self.extensions = extensions - self.backup_schedules = backup_schedules - self.scheduled_event_strategy = scheduled_event_strategy self.azure_connection_method = azure_connection_method self.private_link_resource_id = None @@ -3208,15 +2258,15 @@ class CommandPostBody(_serialization.Model): :ivar command: The command which should be run. Required. :vartype command: str :ivar arguments: The arguments for the command to be run. - :vartype arguments: JSON + :vartype arguments: dict[str, str] :ivar host: IP address of the cassandra host to run the command on. Required. :vartype host: str :ivar cassandra_stop_start: If true, stops cassandra before executing the command and then start it again. :vartype cassandra_stop_start: bool - :ivar read_write: If true, allows the command to *write* to the cassandra directory, otherwise + :ivar readwrite: If true, allows the command to *write* to the cassandra directory, otherwise read-only. - :vartype read_write: bool + :vartype readwrite: bool """ _validation = { @@ -3226,10 +2276,10 @@ class CommandPostBody(_serialization.Model): _attribute_map = { "command": {"key": "command", "type": "str"}, - "arguments": {"key": "arguments", "type": "object"}, + "arguments": {"key": "arguments", "type": "{str}"}, "host": {"key": "host", "type": "str"}, "cassandra_stop_start": {"key": "cassandra-stop-start", "type": "bool"}, - "read_write": {"key": "readWrite", "type": "bool"}, + "readwrite": {"key": "readwrite", "type": "bool"}, } def __init__( @@ -3237,125 +2287,31 @@ def __init__( *, command: str, host: str, - arguments: Optional[JSON] = None, + arguments: Optional[Dict[str, str]] = None, cassandra_stop_start: Optional[bool] = None, - read_write: Optional[bool] = None, + readwrite: Optional[bool] = None, **kwargs: Any ) -> None: """ :keyword command: The command which should be run. Required. :paramtype command: str :keyword arguments: The arguments for the command to be run. - :paramtype arguments: JSON + :paramtype arguments: dict[str, str] :keyword host: IP address of the cassandra host to run the command on. Required. :paramtype host: str :keyword cassandra_stop_start: If true, stops cassandra before executing the command and then start it again. :paramtype cassandra_stop_start: bool - :keyword read_write: If true, allows the command to *write* to the cassandra directory, - otherwise read-only. - :paramtype read_write: bool - """ - super().__init__(**kwargs) - self.command = command - self.arguments = arguments - self.host = host - self.cassandra_stop_start = cassandra_stop_start - self.read_write = read_write - - -class CommandPublicResource(_serialization.Model): - """resource representing a command. - - :ivar command: The command which should be run. - :vartype command: str - :ivar command_id: The unique id of command. - :vartype command_id: str - :ivar arguments: The arguments for the command to be run. - :vartype arguments: JSON - :ivar host: IP address of the cassandra host to run the command on. - :vartype host: str - :ivar is_admin: Whether command has admin privileges. - :vartype is_admin: bool - :ivar cassandra_stop_start: If true, stops cassandra before executing the command and then - start it again. - :vartype cassandra_stop_start: bool - :ivar read_write: If true, allows the command to *write* to the cassandra directory, otherwise - read-only. - :vartype read_write: bool - :ivar result: Result output of the command. - :vartype result: str - :ivar status: Status of the command. Known values are: "Done", "Running", "Enqueue", - "Processing", "Finished", and "Failed". - :vartype status: str or ~azure.mgmt.cosmosdb.models.CommandStatus - :ivar output_file: The name of the file where the result is written. - :vartype output_file: str - """ - - _attribute_map = { - "command": {"key": "command", "type": "str"}, - "command_id": {"key": "commandId", "type": "str"}, - "arguments": {"key": "arguments", "type": "object"}, - "host": {"key": "host", "type": "str"}, - "is_admin": {"key": "isAdmin", "type": "bool"}, - "cassandra_stop_start": {"key": "cassandraStopStart", "type": "bool"}, - "read_write": {"key": "readWrite", "type": "bool"}, - "result": {"key": "result", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "output_file": {"key": "outputFile", "type": "str"}, - } - - def __init__( - self, - *, - command: Optional[str] = None, - command_id: Optional[str] = None, - arguments: Optional[JSON] = None, - host: Optional[str] = None, - is_admin: Optional[bool] = None, - cassandra_stop_start: Optional[bool] = None, - read_write: Optional[bool] = None, - result: Optional[str] = None, - status: Optional[Union[str, "_models.CommandStatus"]] = None, - output_file: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword command: The command which should be run. - :paramtype command: str - :keyword command_id: The unique id of command. - :paramtype command_id: str - :keyword arguments: The arguments for the command to be run. - :paramtype arguments: JSON - :keyword host: IP address of the cassandra host to run the command on. - :paramtype host: str - :keyword is_admin: Whether command has admin privileges. - :paramtype is_admin: bool - :keyword cassandra_stop_start: If true, stops cassandra before executing the command and then - start it again. - :paramtype cassandra_stop_start: bool - :keyword read_write: If true, allows the command to *write* to the cassandra directory, + :keyword readwrite: If true, allows the command to *write* to the cassandra directory, otherwise read-only. - :paramtype read_write: bool - :keyword result: Result output of the command. - :paramtype result: str - :keyword status: Status of the command. Known values are: "Done", "Running", "Enqueue", - "Processing", "Finished", and "Failed". - :paramtype status: str or ~azure.mgmt.cosmosdb.models.CommandStatus - :keyword output_file: The name of the file where the result is written. - :paramtype output_file: str + :paramtype readwrite: bool """ super().__init__(**kwargs) self.command = command - self.command_id = command_id self.arguments = arguments self.host = host - self.is_admin = is_admin self.cassandra_stop_start = cassandra_stop_start - self.read_write = read_write - self.result = result - self.status = status - self.output_file = output_file + self.readwrite = readwrite class CompositePath(_serialization.Model): @@ -3724,8 +2680,8 @@ def __init__( class ContinuousModeProperties(_serialization.Model): """Configuration values for periodic mode backup. - :ivar tier: Enum to indicate type of Continuos backup mode. Known values are: "Continuous7Days" - and "Continuous30Days". + :ivar tier: Enum to indicate type of Continuous backup mode. Known values are: + "Continuous7Days" and "Continuous30Days". :vartype tier: str or ~azure.mgmt.cosmosdb.models.ContinuousTier """ @@ -3735,7 +2691,7 @@ class ContinuousModeProperties(_serialization.Model): def __init__(self, *, tier: Optional[Union[str, "_models.ContinuousTier"]] = None, **kwargs: Any) -> None: """ - :keyword tier: Enum to indicate type of Continuos backup mode. Known values are: + :keyword tier: Enum to indicate type of Continuous backup mode. Known values are: "Continuous7Days" and "Continuous30Days". :paramtype tier: str or ~azure.mgmt.cosmosdb.models.ContinuousTier """ @@ -3747,307 +2703,70 @@ class CorsPolicy(_serialization.Model): """The CORS policy for the Cosmos DB database account. All required parameters must be populated in order to send to server. - - :ivar allowed_origins: The origin domains that are permitted to make a request against the - service via CORS. Required. - :vartype allowed_origins: str - :ivar allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a - CORS request. - :vartype allowed_methods: str - :ivar allowed_headers: The request headers that the origin domain may specify on the CORS - request. - :vartype allowed_headers: str - :ivar exposed_headers: The response headers that may be sent in the response to the CORS - request and exposed by the browser to the request issuer. - :vartype exposed_headers: str - :ivar max_age_in_seconds: The maximum amount time that a browser should cache the preflight - OPTIONS request. - :vartype max_age_in_seconds: int - """ - - _validation = { - "allowed_origins": {"required": True}, - "max_age_in_seconds": {"maximum": 2147483647, "minimum": 1}, - } - - _attribute_map = { - "allowed_origins": {"key": "allowedOrigins", "type": "str"}, - "allowed_methods": {"key": "allowedMethods", "type": "str"}, - "allowed_headers": {"key": "allowedHeaders", "type": "str"}, - "exposed_headers": {"key": "exposedHeaders", "type": "str"}, - "max_age_in_seconds": {"key": "maxAgeInSeconds", "type": "int"}, - } - - def __init__( - self, - *, - allowed_origins: str, - allowed_methods: Optional[str] = None, - allowed_headers: Optional[str] = None, - exposed_headers: Optional[str] = None, - max_age_in_seconds: Optional[int] = None, - **kwargs: Any - ) -> None: - """ - :keyword allowed_origins: The origin domains that are permitted to make a request against the - service via CORS. Required. - :paramtype allowed_origins: str - :keyword allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a - CORS request. - :paramtype allowed_methods: str - :keyword allowed_headers: The request headers that the origin domain may specify on the CORS - request. - :paramtype allowed_headers: str - :keyword exposed_headers: The response headers that may be sent in the response to the CORS - request and exposed by the browser to the request issuer. - :paramtype exposed_headers: str - :keyword max_age_in_seconds: The maximum amount time that a browser should cache the preflight - OPTIONS request. - :paramtype max_age_in_seconds: int - """ - super().__init__(**kwargs) - self.allowed_origins = allowed_origins - self.allowed_methods = allowed_methods - self.allowed_headers = allowed_headers - self.exposed_headers = exposed_headers - self.max_age_in_seconds = max_age_in_seconds - - -class CosmosCassandraDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): # pylint: disable=name-too-long - """A CosmosDB Cassandra API data source/sink. - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar remote_account_name: - :vartype remote_account_name: str - :ivar keyspace_name: Required. - :vartype keyspace_name: str - :ivar table_name: Required. - :vartype table_name: str - """ - - _validation = { - "component": {"required": True}, - "keyspace_name": {"required": True}, - "table_name": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "remote_account_name": {"key": "remoteAccountName", "type": "str"}, - "keyspace_name": {"key": "keyspaceName", "type": "str"}, - "table_name": {"key": "tableName", "type": "str"}, - } - - def __init__( - self, *, keyspace_name: str, table_name: str, remote_account_name: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword remote_account_name: - :paramtype remote_account_name: str - :keyword keyspace_name: Required. - :paramtype keyspace_name: str - :keyword table_name: Required. - :paramtype table_name: str - """ - super().__init__(remote_account_name=remote_account_name, **kwargs) - self.component: str = "CosmosDBCassandra" - self.keyspace_name = keyspace_name - self.table_name = table_name - - -class CosmosMongoDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): - """A CosmosDB Mongo API data source/sink. - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar remote_account_name: - :vartype remote_account_name: str - :ivar database_name: Required. - :vartype database_name: str - :ivar collection_name: Required. - :vartype collection_name: str - """ - - _validation = { - "component": {"required": True}, - "database_name": {"required": True}, - "collection_name": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "remote_account_name": {"key": "remoteAccountName", "type": "str"}, - "database_name": {"key": "databaseName", "type": "str"}, - "collection_name": {"key": "collectionName", "type": "str"}, - } - - def __init__( - self, *, database_name: str, collection_name: str, remote_account_name: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword remote_account_name: - :paramtype remote_account_name: str - :keyword database_name: Required. - :paramtype database_name: str - :keyword collection_name: Required. - :paramtype collection_name: str - """ - super().__init__(remote_account_name=remote_account_name, **kwargs) - self.component: str = "CosmosDBMongo" - self.database_name = database_name - self.collection_name = collection_name - - -class CosmosMongoVCoreDataTransferDataSourceSink(DataTransferDataSourceSink): # pylint: disable=name-too-long - """A CosmosDB Mongo vCore API data source/sink. - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar database_name: Required. - :vartype database_name: str - :ivar collection_name: Required. - :vartype collection_name: str - :ivar host_name: - :vartype host_name: str - :ivar connection_string_key_vault_uri: - :vartype connection_string_key_vault_uri: str - """ - - _validation = { - "component": {"required": True}, - "database_name": {"required": True}, - "collection_name": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "database_name": {"key": "databaseName", "type": "str"}, - "collection_name": {"key": "collectionName", "type": "str"}, - "host_name": {"key": "hostName", "type": "str"}, - "connection_string_key_vault_uri": {"key": "connectionStringKeyVaultUri", "type": "str"}, - } - - def __init__( - self, - *, - database_name: str, - collection_name: str, - host_name: Optional[str] = None, - connection_string_key_vault_uri: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword database_name: Required. - :paramtype database_name: str - :keyword collection_name: Required. - :paramtype collection_name: str - :keyword host_name: - :paramtype host_name: str - :keyword connection_string_key_vault_uri: - :paramtype connection_string_key_vault_uri: str - """ - super().__init__(**kwargs) - self.component: str = "CosmosDBMongoVCore" - self.database_name = database_name - self.collection_name = collection_name - self.host_name = host_name - self.connection_string_key_vault_uri = connection_string_key_vault_uri - - -class CosmosSqlDataTransferDataSourceSink(BaseCosmosDataTransferDataSourceSink): - """A CosmosDB No Sql API data source/sink. - - All required parameters must be populated in order to send to server. - - :ivar component: Known values are: "CosmosDBCassandra", "CosmosDBMongo", "CosmosDBMongoVCore", - "CosmosDBSql", and "AzureBlobStorage". - :vartype component: str or ~azure.mgmt.cosmosdb.models.DataTransferComponent - :ivar remote_account_name: - :vartype remote_account_name: str - :ivar database_name: Required. - :vartype database_name: str - :ivar container_name: Required. - :vartype container_name: str - """ - - _validation = { - "component": {"required": True}, - "database_name": {"required": True}, - "container_name": {"required": True}, - } - - _attribute_map = { - "component": {"key": "component", "type": "str"}, - "remote_account_name": {"key": "remoteAccountName", "type": "str"}, - "database_name": {"key": "databaseName", "type": "str"}, - "container_name": {"key": "containerName", "type": "str"}, - } - - def __init__( - self, *, database_name: str, container_name: str, remote_account_name: Optional[str] = None, **kwargs: Any - ) -> None: - """ - :keyword remote_account_name: - :paramtype remote_account_name: str - :keyword database_name: Required. - :paramtype database_name: str - :keyword container_name: Required. - :paramtype container_name: str - """ - super().__init__(remote_account_name=remote_account_name, **kwargs) - self.component: str = "CosmosDBSql" - self.database_name = database_name - self.container_name = container_name - - -class CreateJobRequest(ARMProxyResource): - """Parameters to create Data Transfer Job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar properties: Data Transfer Create Job Properties. Required. - :vartype properties: ~azure.mgmt.cosmosdb.models.DataTransferJobProperties + + :ivar allowed_origins: The origin domains that are permitted to make a request against the + service via CORS. Required. + :vartype allowed_origins: str + :ivar allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a + CORS request. + :vartype allowed_methods: str + :ivar allowed_headers: The request headers that the origin domain may specify on the CORS + request. + :vartype allowed_headers: str + :ivar exposed_headers: The response headers that may be sent in the response to the CORS + request and exposed by the browser to the request issuer. + :vartype exposed_headers: str + :ivar max_age_in_seconds: The maximum amount time that a browser should cache the preflight + OPTIONS request. + :vartype max_age_in_seconds: int """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "properties": {"required": True}, + "allowed_origins": {"required": True}, + "max_age_in_seconds": {"maximum": 2147483647, "minimum": 1}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "properties": {"key": "properties", "type": "DataTransferJobProperties"}, + "allowed_origins": {"key": "allowedOrigins", "type": "str"}, + "allowed_methods": {"key": "allowedMethods", "type": "str"}, + "allowed_headers": {"key": "allowedHeaders", "type": "str"}, + "exposed_headers": {"key": "exposedHeaders", "type": "str"}, + "max_age_in_seconds": {"key": "maxAgeInSeconds", "type": "int"}, } - def __init__(self, *, properties: "_models.DataTransferJobProperties", **kwargs: Any) -> None: + def __init__( + self, + *, + allowed_origins: str, + allowed_methods: Optional[str] = None, + allowed_headers: Optional[str] = None, + exposed_headers: Optional[str] = None, + max_age_in_seconds: Optional[int] = None, + **kwargs: Any + ) -> None: """ - :keyword properties: Data Transfer Create Job Properties. Required. - :paramtype properties: ~azure.mgmt.cosmosdb.models.DataTransferJobProperties + :keyword allowed_origins: The origin domains that are permitted to make a request against the + service via CORS. Required. + :paramtype allowed_origins: str + :keyword allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a + CORS request. + :paramtype allowed_methods: str + :keyword allowed_headers: The request headers that the origin domain may specify on the CORS + request. + :paramtype allowed_headers: str + :keyword exposed_headers: The response headers that may be sent in the response to the CORS + request and exposed by the browser to the request issuer. + :paramtype exposed_headers: str + :keyword max_age_in_seconds: The maximum amount time that a browser should cache the preflight + OPTIONS request. + :paramtype max_age_in_seconds: int """ super().__init__(**kwargs) - self.properties = properties + self.allowed_origins = allowed_origins + self.allowed_methods = allowed_methods + self.allowed_headers = allowed_headers + self.exposed_headers = exposed_headers + self.max_age_in_seconds = max_age_in_seconds class CreateUpdateOptions(_serialization.Model): @@ -4148,11 +2867,11 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): # pylint: d 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 kind: Indicates the type of database account. This can only be set at database account creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". :vartype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :ivar consistency_policy: The consistency policy for the Cosmos DB account. :vartype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy :ivar locations: An array that contains the georeplication locations enabled for the Cosmos DB @@ -4217,9 +2936,6 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): # pylint: d :ivar network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. :vartype network_acl_bypass_resource_ids: list[str] - :ivar diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :vartype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings :ivar disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. :vartype disable_local_auth: bool @@ -4228,12 +2944,6 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): # pylint: d :ivar capacity: The object that represents all properties related to capacity enforcement on an account. :vartype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :ivar capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :vartype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :ivar enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :vartype enable_materialized_views: bool :ivar keys_metadata: This property is ignored during the update/create operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. @@ -4241,24 +2951,18 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): # pylint: d :ivar enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on the account. :vartype enable_partition_merge: bool - :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :vartype enable_burst_capacity: bool - :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls 1.0, - except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: "Tls", - "Tls11", and "Tls12". + :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default value is Tls + 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". :vartype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature on + the account. + :vartype enable_burst_capacity: bool :ivar customer_managed_key_status: Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. :vartype customer_managed_key_status: str - :ivar enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :vartype enable_priority_based_execution: bool - :ivar default_priority_level: Enum to indicate default Priority Level of request for Priority - Based Execution. Known values are: "High" and "Low". - :vartype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel :ivar enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. + PerRegionPerPartitionAutoscale feature on the account. :vartype enable_per_region_per_partition_autoscale: bool """ @@ -4277,8 +2981,8 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): # pylint: d "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "kind": {"key": "kind", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "consistency_policy": {"key": "properties.consistencyPolicy", "type": "ConsistencyPolicy"}, "locations": {"key": "properties.locations", "type": "[Location]"}, "database_account_offer_type": {"key": "properties.databaseAccountOfferType", "type": "str"}, @@ -4309,19 +3013,14 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): # pylint: d "cors": {"key": "properties.cors", "type": "[CorsPolicy]"}, "network_acl_bypass": {"key": "properties.networkAclBypass", "type": "str"}, "network_acl_bypass_resource_ids": {"key": "properties.networkAclBypassResourceIds", "type": "[str]"}, - "diagnostic_log_settings": {"key": "properties.diagnosticLogSettings", "type": "DiagnosticLogSettings"}, "disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"}, "restore_parameters": {"key": "properties.restoreParameters", "type": "RestoreParameters"}, "capacity": {"key": "properties.capacity", "type": "Capacity"}, - "capacity_mode": {"key": "properties.capacityMode", "type": "str"}, - "enable_materialized_views": {"key": "properties.enableMaterializedViews", "type": "bool"}, "keys_metadata": {"key": "properties.keysMetadata", "type": "DatabaseAccountKeysMetadata"}, "enable_partition_merge": {"key": "properties.enablePartitionMerge", "type": "bool"}, - "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, + "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, "customer_managed_key_status": {"key": "properties.customerManagedKeyStatus", "type": "str"}, - "enable_priority_based_execution": {"key": "properties.enablePriorityBasedExecution", "type": "bool"}, - "default_priority_level": {"key": "properties.defaultPriorityLevel", "type": "str"}, "enable_per_region_per_partition_autoscale": { "key": "properties.enablePerRegionPerPartitionAutoscale", "type": "bool", @@ -4336,8 +3035,8 @@ def __init__( # pylint: disable=too-many-locals locations: List["_models.Location"], location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, kind: Optional[Union[str, "_models.DatabaseAccountKind"]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, consistency_policy: Optional["_models.ConsistencyPolicy"] = None, ip_rules: Optional[List["_models.IpAddressOrRange"]] = None, is_virtual_network_filter_enabled: Optional[bool] = None, @@ -4360,18 +3059,13 @@ def __init__( # pylint: disable=too-many-locals cors: Optional[List["_models.CorsPolicy"]] = None, network_acl_bypass: Optional[Union[str, "_models.NetworkAclBypass"]] = None, network_acl_bypass_resource_ids: Optional[List[str]] = None, - diagnostic_log_settings: Optional["_models.DiagnosticLogSettings"] = None, disable_local_auth: Optional[bool] = None, restore_parameters: Optional["_models.RestoreParameters"] = None, capacity: Optional["_models.Capacity"] = None, - capacity_mode: Optional[Union[str, "_models.CapacityMode"]] = None, - enable_materialized_views: Optional[bool] = None, enable_partition_merge: Optional[bool] = None, - enable_burst_capacity: Optional[bool] = None, minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, + enable_burst_capacity: Optional[bool] = None, customer_managed_key_status: Optional[str] = None, - enable_priority_based_execution: Optional[bool] = None, - default_priority_level: Optional[Union[str, "_models.DefaultPriorityLevel"]] = None, enable_per_region_per_partition_autoscale: Optional[bool] = None, **kwargs: Any ) -> None: @@ -4385,11 +3079,11 @@ def __init__( # pylint: disable=too-many-locals 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 kind: Indicates the type of database account. This can only be set at database account creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". :paramtype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :keyword consistency_policy: The consistency policy for the Cosmos DB account. :paramtype consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy :keyword locations: An array that contains the georeplication locations enabled for the Cosmos @@ -4452,9 +3146,6 @@ def __init__( # pylint: disable=too-many-locals :keyword network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. :paramtype network_acl_bypass_resource_ids: list[str] - :keyword diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :paramtype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings :keyword disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. :paramtype disable_local_auth: bool @@ -4463,37 +3154,26 @@ def __init__( # pylint: disable=too-many-locals :keyword capacity: The object that represents all properties related to capacity enforcement on an account. :paramtype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :keyword capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :paramtype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :keyword enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :paramtype enable_materialized_views: bool :keyword enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on the account. :paramtype enable_partition_merge: bool - :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :paramtype enable_burst_capacity: bool - :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls - 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: - "Tls", "Tls11", and "Tls12". + :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default value is + Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". :paramtype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature + on the account. + :paramtype enable_burst_capacity: bool :keyword customer_managed_key_status: Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. :paramtype customer_managed_key_status: str - :keyword enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :paramtype enable_priority_based_execution: bool - :keyword default_priority_level: Enum to indicate default Priority Level of request for - Priority Based Execution. Known values are: "High" and "Low". - :paramtype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel :keyword enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. + PerRegionPerPartitionAutoscale feature on the account. :paramtype enable_per_region_per_partition_autoscale: bool """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.kind = kind + self.identity = identity self.consistency_policy = consistency_policy self.locations = locations self.ip_rules = ip_rules @@ -4517,19 +3197,14 @@ def __init__( # pylint: disable=too-many-locals self.cors = cors self.network_acl_bypass = network_acl_bypass self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids - self.diagnostic_log_settings = diagnostic_log_settings self.disable_local_auth = disable_local_auth self.restore_parameters = restore_parameters self.capacity = capacity - self.capacity_mode = capacity_mode - self.enable_materialized_views = enable_materialized_views self.keys_metadata = None self.enable_partition_merge = enable_partition_merge - self.enable_burst_capacity = enable_burst_capacity self.minimal_tls_version = minimal_tls_version + self.enable_burst_capacity = enable_burst_capacity self.customer_managed_key_status = customer_managed_key_status - self.enable_priority_based_execution = enable_priority_based_execution - self.default_priority_level = default_priority_level self.enable_per_region_per_partition_autoscale = enable_per_region_per_partition_autoscale @@ -4553,11 +3228,11 @@ class DatabaseAccountGetResults(ARMResourceProperties): # pylint: disable=too-m 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 kind: Indicates the type of database account. This can only be set at database account creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". :vartype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :ivar identity: Identity for the resource. + :vartype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :ivar system_data: The system meta data relating to this resource. :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData :ivar provisioning_state: The status of the Cosmos DB account at the time the operation was @@ -4649,49 +3324,30 @@ class DatabaseAccountGetResults(ARMResourceProperties): # pylint: disable=too-m :ivar network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. :vartype network_acl_bypass_resource_ids: list[str] - :ivar diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :vartype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings :ivar disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. :vartype disable_local_auth: bool :ivar capacity: The object that represents all properties related to capacity enforcement on an account. :vartype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :ivar capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :vartype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :ivar capacity_mode_change_transition_state: The object that represents the migration state for - the CapacityMode of the Cosmos DB account. - :vartype capacity_mode_change_transition_state: - ~azure.mgmt.cosmosdb.models.CapacityModeChangeTransitionState - :ivar enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :vartype enable_materialized_views: bool :ivar keys_metadata: The object that represents the metadata for the Account Keys of the Cosmos DB account. :vartype keys_metadata: ~azure.mgmt.cosmosdb.models.DatabaseAccountKeysMetadata :ivar enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on the account. :vartype enable_partition_merge: bool - :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :vartype enable_burst_capacity: bool - :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls 1.0, - except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: "Tls", - "Tls11", and "Tls12". + :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default value is Tls + 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". :vartype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature on + the account. + :vartype enable_burst_capacity: bool :ivar customer_managed_key_status: Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. :vartype customer_managed_key_status: str - :ivar enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :vartype enable_priority_based_execution: bool - :ivar default_priority_level: Enum to indicate default Priority Level of request for Priority - Based Execution. Known values are: "High" and "Low". - :vartype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel :ivar enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. + PerRegionPerPartitionAutoscale feature on the account. :vartype enable_per_region_per_partition_autoscale: bool """ @@ -4718,8 +3374,8 @@ class DatabaseAccountGetResults(ARMResourceProperties): # pylint: disable=too-m "type": {"key": "type", "type": "str"}, "location": {"key": "location", "type": "str"}, "tags": {"key": "tags", "type": "{str}"}, - "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "kind": {"key": "kind", "type": "str"}, + "identity": {"key": "identity", "type": "ManagedServiceIdentity"}, "system_data": {"key": "systemData", "type": "SystemData"}, "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, "document_endpoint": {"key": "properties.documentEndpoint", "type": "str"}, @@ -4762,22 +3418,13 @@ class DatabaseAccountGetResults(ARMResourceProperties): # pylint: disable=too-m "cors": {"key": "properties.cors", "type": "[CorsPolicy]"}, "network_acl_bypass": {"key": "properties.networkAclBypass", "type": "str"}, "network_acl_bypass_resource_ids": {"key": "properties.networkAclBypassResourceIds", "type": "[str]"}, - "diagnostic_log_settings": {"key": "properties.diagnosticLogSettings", "type": "DiagnosticLogSettings"}, "disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"}, "capacity": {"key": "properties.capacity", "type": "Capacity"}, - "capacity_mode": {"key": "properties.capacityMode", "type": "str"}, - "capacity_mode_change_transition_state": { - "key": "properties.capacityModeChangeTransitionState", - "type": "CapacityModeChangeTransitionState", - }, - "enable_materialized_views": {"key": "properties.enableMaterializedViews", "type": "bool"}, "keys_metadata": {"key": "properties.keysMetadata", "type": "DatabaseAccountKeysMetadata"}, "enable_partition_merge": {"key": "properties.enablePartitionMerge", "type": "bool"}, - "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, + "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, "customer_managed_key_status": {"key": "properties.customerManagedKeyStatus", "type": "str"}, - "enable_priority_based_execution": {"key": "properties.enablePriorityBasedExecution", "type": "bool"}, - "default_priority_level": {"key": "properties.defaultPriorityLevel", "type": "str"}, "enable_per_region_per_partition_autoscale": { "key": "properties.enablePerRegionPerPartitionAutoscale", "type": "bool", @@ -4789,8 +3436,8 @@ def __init__( # pylint: disable=too-many-locals *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, kind: Optional[Union[str, "_models.DatabaseAccountKind"]] = None, + identity: Optional["_models.ManagedServiceIdentity"] = None, ip_rules: Optional[List["_models.IpAddressOrRange"]] = None, is_virtual_network_filter_enabled: Optional[bool] = None, enable_automatic_failover: Optional[bool] = None, @@ -4814,18 +3461,12 @@ def __init__( # pylint: disable=too-many-locals cors: Optional[List["_models.CorsPolicy"]] = None, network_acl_bypass: Optional[Union[str, "_models.NetworkAclBypass"]] = None, network_acl_bypass_resource_ids: Optional[List[str]] = None, - diagnostic_log_settings: Optional["_models.DiagnosticLogSettings"] = None, disable_local_auth: Optional[bool] = None, capacity: Optional["_models.Capacity"] = None, - capacity_mode: Optional[Union[str, "_models.CapacityMode"]] = None, - capacity_mode_change_transition_state: Optional["_models.CapacityModeChangeTransitionState"] = None, - enable_materialized_views: Optional[bool] = None, enable_partition_merge: Optional[bool] = None, - enable_burst_capacity: Optional[bool] = None, minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, + enable_burst_capacity: Optional[bool] = None, customer_managed_key_status: Optional[str] = None, - enable_priority_based_execution: Optional[bool] = None, - default_priority_level: Optional[Union[str, "_models.DefaultPriorityLevel"]] = None, enable_per_region_per_partition_autoscale: Optional[bool] = None, **kwargs: Any ) -> None: @@ -4839,11 +3480,11 @@ def __init__( # pylint: disable=too-many-locals 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 kind: Indicates the type of database account. This can only be set at database account creation. Known values are: "GlobalDocumentDB", "MongoDB", and "Parse". :paramtype kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :keyword identity: Identity for the resource. + :paramtype identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :keyword ip_rules: List of IpRules. :paramtype ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] :keyword is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual @@ -4905,50 +3546,32 @@ def __init__( # pylint: disable=too-many-locals :keyword network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. :paramtype network_acl_bypass_resource_ids: list[str] - :keyword diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :paramtype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings :keyword disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. :paramtype disable_local_auth: bool :keyword capacity: The object that represents all properties related to capacity enforcement on an account. :paramtype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :keyword capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :paramtype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :keyword capacity_mode_change_transition_state: The object that represents the migration state - for the CapacityMode of the Cosmos DB account. - :paramtype capacity_mode_change_transition_state: - ~azure.mgmt.cosmosdb.models.CapacityModeChangeTransitionState - :keyword enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :paramtype enable_materialized_views: bool :keyword enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on the account. :paramtype enable_partition_merge: bool - :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :paramtype enable_burst_capacity: bool - :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls - 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: - "Tls", "Tls11", and "Tls12". + :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default value is + Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". :paramtype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature + on the account. + :paramtype enable_burst_capacity: bool :keyword customer_managed_key_status: Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. :paramtype customer_managed_key_status: str - :keyword enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :paramtype enable_priority_based_execution: bool - :keyword default_priority_level: Enum to indicate default Priority Level of request for - Priority Based Execution. Known values are: "High" and "Low". - :paramtype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel :keyword enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. + PerRegionPerPartitionAutoscale feature on the account. :paramtype enable_per_region_per_partition_autoscale: bool """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.kind = kind + self.identity = identity self.system_data = None self.provisioning_state = None self.document_endpoint = None @@ -4982,19 +3605,13 @@ def __init__( # pylint: disable=too-many-locals self.cors = cors self.network_acl_bypass = network_acl_bypass self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids - self.diagnostic_log_settings = diagnostic_log_settings self.disable_local_auth = disable_local_auth self.capacity = capacity - self.capacity_mode = capacity_mode - self.capacity_mode_change_transition_state = capacity_mode_change_transition_state - self.enable_materialized_views = enable_materialized_views self.keys_metadata = None self.enable_partition_merge = enable_partition_merge - self.enable_burst_capacity = enable_burst_capacity self.minimal_tls_version = minimal_tls_version + self.enable_burst_capacity = enable_burst_capacity self.customer_managed_key_status = customer_managed_key_status - self.enable_priority_based_execution = enable_priority_based_execution - self.default_priority_level = default_priority_level self.enable_per_region_per_partition_autoscale = enable_per_region_per_partition_autoscale @@ -5254,45 +3871,30 @@ class DatabaseAccountUpdateParameters(_serialization.Model): # pylint: disable= :ivar network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. :vartype network_acl_bypass_resource_ids: list[str] - :ivar diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :vartype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings :ivar disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. :vartype disable_local_auth: bool :ivar capacity: The object that represents all properties related to capacity enforcement on an account. :vartype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :ivar capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :vartype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :ivar enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :vartype enable_materialized_views: bool :ivar keys_metadata: This property is ignored during the update operation, as the metadata is read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. :vartype keys_metadata: ~azure.mgmt.cosmosdb.models.DatabaseAccountKeysMetadata :ivar enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on the account. :vartype enable_partition_merge: bool - :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :vartype enable_burst_capacity: bool - :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls 1.0, - except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: "Tls", - "Tls11", and "Tls12". + :ivar minimal_tls_version: Indicates the minimum allowed Tls version. The default value is Tls + 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". :vartype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :ivar enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature on + the account. + :vartype enable_burst_capacity: bool :ivar customer_managed_key_status: Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. :vartype customer_managed_key_status: str - :ivar enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :vartype enable_priority_based_execution: bool - :ivar default_priority_level: Enum to indicate default Priority Level of request for Priority - Based Execution. Known values are: "High" and "Low". - :vartype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel :ivar enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. + PerRegionPerPartitionAutoscale feature on the account. :vartype enable_per_region_per_partition_autoscale: bool """ @@ -5332,18 +3934,13 @@ class DatabaseAccountUpdateParameters(_serialization.Model): # pylint: disable= "cors": {"key": "properties.cors", "type": "[CorsPolicy]"}, "network_acl_bypass": {"key": "properties.networkAclBypass", "type": "str"}, "network_acl_bypass_resource_ids": {"key": "properties.networkAclBypassResourceIds", "type": "[str]"}, - "diagnostic_log_settings": {"key": "properties.diagnosticLogSettings", "type": "DiagnosticLogSettings"}, "disable_local_auth": {"key": "properties.disableLocalAuth", "type": "bool"}, "capacity": {"key": "properties.capacity", "type": "Capacity"}, - "capacity_mode": {"key": "properties.capacityMode", "type": "str"}, - "enable_materialized_views": {"key": "properties.enableMaterializedViews", "type": "bool"}, "keys_metadata": {"key": "properties.keysMetadata", "type": "DatabaseAccountKeysMetadata"}, "enable_partition_merge": {"key": "properties.enablePartitionMerge", "type": "bool"}, - "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, "minimal_tls_version": {"key": "properties.minimalTlsVersion", "type": "str"}, + "enable_burst_capacity": {"key": "properties.enableBurstCapacity", "type": "bool"}, "customer_managed_key_status": {"key": "properties.customerManagedKeyStatus", "type": "str"}, - "enable_priority_based_execution": {"key": "properties.enablePriorityBasedExecution", "type": "bool"}, - "default_priority_level": {"key": "properties.defaultPriorityLevel", "type": "str"}, "enable_per_region_per_partition_autoscale": { "key": "properties.enablePerRegionPerPartitionAutoscale", "type": "bool", @@ -5378,17 +3975,12 @@ def __init__( # pylint: disable=too-many-locals cors: Optional[List["_models.CorsPolicy"]] = None, network_acl_bypass: Optional[Union[str, "_models.NetworkAclBypass"]] = None, network_acl_bypass_resource_ids: Optional[List[str]] = None, - diagnostic_log_settings: Optional["_models.DiagnosticLogSettings"] = None, disable_local_auth: Optional[bool] = None, capacity: Optional["_models.Capacity"] = None, - capacity_mode: Optional[Union[str, "_models.CapacityMode"]] = None, - enable_materialized_views: Optional[bool] = None, enable_partition_merge: Optional[bool] = None, - enable_burst_capacity: Optional[bool] = None, minimal_tls_version: Optional[Union[str, "_models.MinimalTlsVersion"]] = None, + enable_burst_capacity: Optional[bool] = None, customer_managed_key_status: Optional[str] = None, - enable_priority_based_execution: Optional[bool] = None, - default_priority_level: Optional[Union[str, "_models.DefaultPriorityLevel"]] = None, enable_per_region_per_partition_autoscale: Optional[bool] = None, **kwargs: Any ) -> None: @@ -5463,42 +4055,27 @@ def __init__( # pylint: disable=too-many-locals :keyword network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. :paramtype network_acl_bypass_resource_ids: list[str] - :keyword diagnostic_log_settings: The Object representing the different Diagnostic log settings - for the Cosmos DB Account. - :paramtype diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings :keyword disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. :paramtype disable_local_auth: bool :keyword capacity: The object that represents all properties related to capacity enforcement on an account. :paramtype capacity: ~azure.mgmt.cosmosdb.models.Capacity - :keyword capacity_mode: Indicates the capacityMode of the Cosmos DB account. Known values are: - "None", "Provisioned", and "Serverless". - :paramtype capacity_mode: str or ~azure.mgmt.cosmosdb.models.CapacityMode - :keyword enable_materialized_views: Flag to indicate whether to enable MaterializedViews on the - Cosmos DB account. - :paramtype enable_materialized_views: bool :keyword enable_partition_merge: Flag to indicate enabling/disabling of Partition Merge feature on the account. :paramtype enable_partition_merge: bool - :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity Preview - feature on the account. - :paramtype enable_burst_capacity: bool - :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default is Tls - 1.0, except for Cassandra and Mongo API's, which only work with Tls 1.2. Known values are: - "Tls", "Tls11", and "Tls12". + :keyword minimal_tls_version: Indicates the minimum allowed Tls version. The default value is + Tls 1.2. Cassandra and Mongo APIs only work with Tls 1.2. Known values are: "Tls", "Tls11", and + "Tls12". :paramtype minimal_tls_version: str or ~azure.mgmt.cosmosdb.models.MinimalTlsVersion + :keyword enable_burst_capacity: Flag to indicate enabling/disabling of Burst Capacity feature + on the account. + :paramtype enable_burst_capacity: bool :keyword customer_managed_key_status: Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property provides troubleshooting guidance. :paramtype customer_managed_key_status: str - :keyword enable_priority_based_execution: Flag to indicate enabling/disabling of Priority Based - Execution Preview feature on the account. - :paramtype enable_priority_based_execution: bool - :keyword default_priority_level: Enum to indicate default Priority Level of request for - Priority Based Execution. Known values are: "High" and "Low". - :paramtype default_priority_level: str or ~azure.mgmt.cosmosdb.models.DefaultPriorityLevel :keyword enable_per_region_per_partition_autoscale: Flag to indicate enabling/disabling of - Per-Region Per-partition autoscale Preview feature on the account. + PerRegionPerPartitionAutoscale feature on the account. :paramtype enable_per_region_per_partition_autoscale: bool """ super().__init__(**kwargs) @@ -5527,18 +4104,13 @@ def __init__( # pylint: disable=too-many-locals self.cors = cors self.network_acl_bypass = network_acl_bypass self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids - self.diagnostic_log_settings = diagnostic_log_settings self.disable_local_auth = disable_local_auth self.capacity = capacity - self.capacity_mode = capacity_mode - self.enable_materialized_views = enable_materialized_views self.keys_metadata = None self.enable_partition_merge = enable_partition_merge - self.enable_burst_capacity = enable_burst_capacity self.minimal_tls_version = minimal_tls_version + self.enable_burst_capacity = enable_burst_capacity self.customer_managed_key_status = customer_managed_key_status - self.enable_priority_based_execution = enable_priority_based_execution - self.default_priority_level = default_priority_level self.enable_per_region_per_partition_autoscale = enable_per_region_per_partition_autoscale @@ -5734,269 +4306,51 @@ def __init__( :keyword base64_encoded_cassandra_yaml_fragment: A fragment of a cassandra.yaml configuration file to be included in the cassandra.yaml for all nodes in this data center. The fragment should be Base64 encoded, and only a subset of keys are allowed. - :paramtype base64_encoded_cassandra_yaml_fragment: str - :keyword managed_disk_customer_key_uri: Key uri to use for encryption of managed disks. Ensure - the system assigned identity of the cluster has been assigned appropriate permissions(key - get/wrap/unwrap permissions) on the key. - :paramtype managed_disk_customer_key_uri: str - :keyword backup_storage_customer_key_uri: Indicates the Key Uri of the customer key to use for - encryption of the backup storage account. - :paramtype backup_storage_customer_key_uri: str - :keyword sku: Virtual Machine SKU used for data centers. Default value is Standard_DS14_v2. - :paramtype sku: str - :keyword disk_sku: Disk SKU used for data centers. Default value is P30. - :paramtype disk_sku: str - :keyword disk_capacity: Number of disks attached to each node. Default is 4. - :paramtype disk_capacity: int - :keyword availability_zone: If the data center has Availability Zone support, apply it to the - Virtual Machine ScaleSet that host the cassandra data center virtual machines. - :paramtype availability_zone: bool - :keyword authentication_method_ldap_properties: Ldap authentication method properties. This - feature is in preview. - :paramtype authentication_method_ldap_properties: - ~azure.mgmt.cosmosdb.models.AuthenticationMethodLdapProperties - :keyword deallocated: Whether the data center has been deallocated. - :paramtype deallocated: bool - :keyword provision_error: Error related to resource provisioning. - :paramtype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError - :keyword private_endpoint_ip_address: Ip of the VPN Endpoint for this data center. - :paramtype private_endpoint_ip_address: str - """ - super().__init__(**kwargs) - self.provisioning_state = provisioning_state - self.data_center_location = data_center_location - self.delegated_subnet_id = delegated_subnet_id - self.node_count = node_count - self.seed_nodes = None - self.base64_encoded_cassandra_yaml_fragment = base64_encoded_cassandra_yaml_fragment - self.managed_disk_customer_key_uri = managed_disk_customer_key_uri - self.backup_storage_customer_key_uri = backup_storage_customer_key_uri - self.sku = sku - self.disk_sku = disk_sku - self.disk_capacity = disk_capacity - self.availability_zone = availability_zone - self.authentication_method_ldap_properties = authentication_method_ldap_properties - self.deallocated = deallocated - self.provision_error = provision_error - self.private_endpoint_ip_address = private_endpoint_ip_address - - -class DataTransferJobFeedResults(_serialization.Model): - """The List operation response, that contains the Data Transfer jobs and their properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Data Transfer jobs and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.DataTransferJobGetResults] - :ivar next_link: URL to get the next set of Data Transfer job list results if there are any. - :vartype next_link: str - """ - - _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[DataTransferJobGetResults]"}, - "next_link": {"key": "nextLink", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - self.next_link = None - - -class DataTransferJobGetResults(ARMProxyResource): # pylint: disable=too-many-instance-attributes - """A Cosmos DB Data Transfer Job. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar job_name: Job Name. - :vartype job_name: str - :ivar source: Source DataStore details. - :vartype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :ivar destination: Destination DataStore details. - :vartype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :ivar status: Job Status. - :vartype status: str - :ivar processed_count: Processed Count. - :vartype processed_count: int - :ivar total_count: Total Count. - :vartype total_count: int - :ivar last_updated_utc_time: Last Updated Time (ISO-8601 format). - :vartype last_updated_utc_time: ~datetime.datetime - :ivar worker_count: Worker count. - :vartype worker_count: int - :ivar error: Error response for Faulted job. - :vartype error: ~azure.mgmt.cosmosdb.models.ErrorResponse - :ivar duration: Total Duration of Job. - :vartype duration: str - :ivar mode: Mode of job execution. Known values are: "Offline" and "Online". - :vartype mode: str or ~azure.mgmt.cosmosdb.models.DataTransferJobMode - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "job_name": {"readonly": True}, - "status": {"readonly": True}, - "processed_count": {"readonly": True}, - "total_count": {"readonly": True}, - "last_updated_utc_time": {"readonly": True}, - "worker_count": {"minimum": 0}, - "error": {"readonly": True}, - "duration": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "job_name": {"key": "properties.jobName", "type": "str"}, - "source": {"key": "properties.source", "type": "DataTransferDataSourceSink"}, - "destination": {"key": "properties.destination", "type": "DataTransferDataSourceSink"}, - "status": {"key": "properties.status", "type": "str"}, - "processed_count": {"key": "properties.processedCount", "type": "int"}, - "total_count": {"key": "properties.totalCount", "type": "int"}, - "last_updated_utc_time": {"key": "properties.lastUpdatedUtcTime", "type": "iso-8601"}, - "worker_count": {"key": "properties.workerCount", "type": "int"}, - "error": {"key": "properties.error", "type": "ErrorResponse"}, - "duration": {"key": "properties.duration", "type": "str"}, - "mode": {"key": "properties.mode", "type": "str"}, - } - - def __init__( - self, - *, - source: Optional["_models.DataTransferDataSourceSink"] = None, - destination: Optional["_models.DataTransferDataSourceSink"] = None, - worker_count: Optional[int] = None, - mode: Optional[Union[str, "_models.DataTransferJobMode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword source: Source DataStore details. - :paramtype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :keyword destination: Destination DataStore details. - :paramtype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :keyword worker_count: Worker count. - :paramtype worker_count: int - :keyword mode: Mode of job execution. Known values are: "Offline" and "Online". - :paramtype mode: str or ~azure.mgmt.cosmosdb.models.DataTransferJobMode - """ - super().__init__(**kwargs) - self.job_name = None - self.source = source - self.destination = destination - self.status = None - self.processed_count = None - self.total_count = None - self.last_updated_utc_time = None - self.worker_count = worker_count - self.error = None - self.duration = None - self.mode = mode - - -class DataTransferJobProperties(_serialization.Model): # pylint: disable=too-many-instance-attributes - """The properties of a DataTransfer Job. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar job_name: Job Name. - :vartype job_name: str - :ivar source: Source DataStore details. Required. - :vartype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :ivar destination: Destination DataStore details. Required. - :vartype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :ivar status: Job Status. - :vartype status: str - :ivar processed_count: Processed Count. - :vartype processed_count: int - :ivar total_count: Total Count. - :vartype total_count: int - :ivar last_updated_utc_time: Last Updated Time (ISO-8601 format). - :vartype last_updated_utc_time: ~datetime.datetime - :ivar worker_count: Worker count. - :vartype worker_count: int - :ivar error: Error response for Faulted job. - :vartype error: ~azure.mgmt.cosmosdb.models.ErrorResponse - :ivar duration: Total Duration of Job. - :vartype duration: str - :ivar mode: Mode of job execution. Known values are: "Offline" and "Online". - :vartype mode: str or ~azure.mgmt.cosmosdb.models.DataTransferJobMode - """ - - _validation = { - "job_name": {"readonly": True}, - "source": {"required": True}, - "destination": {"required": True}, - "status": {"readonly": True}, - "processed_count": {"readonly": True}, - "total_count": {"readonly": True}, - "last_updated_utc_time": {"readonly": True}, - "worker_count": {"minimum": 0}, - "error": {"readonly": True}, - "duration": {"readonly": True}, - } - - _attribute_map = { - "job_name": {"key": "jobName", "type": "str"}, - "source": {"key": "source", "type": "DataTransferDataSourceSink"}, - "destination": {"key": "destination", "type": "DataTransferDataSourceSink"}, - "status": {"key": "status", "type": "str"}, - "processed_count": {"key": "processedCount", "type": "int"}, - "total_count": {"key": "totalCount", "type": "int"}, - "last_updated_utc_time": {"key": "lastUpdatedUtcTime", "type": "iso-8601"}, - "worker_count": {"key": "workerCount", "type": "int"}, - "error": {"key": "error", "type": "ErrorResponse"}, - "duration": {"key": "duration", "type": "str"}, - "mode": {"key": "mode", "type": "str"}, - } - - def __init__( - self, - *, - source: "_models.DataTransferDataSourceSink", - destination: "_models.DataTransferDataSourceSink", - worker_count: Optional[int] = None, - mode: Optional[Union[str, "_models.DataTransferJobMode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword source: Source DataStore details. Required. - :paramtype source: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :keyword destination: Destination DataStore details. Required. - :paramtype destination: ~azure.mgmt.cosmosdb.models.DataTransferDataSourceSink - :keyword worker_count: Worker count. - :paramtype worker_count: int - :keyword mode: Mode of job execution. Known values are: "Offline" and "Online". - :paramtype mode: str or ~azure.mgmt.cosmosdb.models.DataTransferJobMode + :paramtype base64_encoded_cassandra_yaml_fragment: str + :keyword managed_disk_customer_key_uri: Key uri to use for encryption of managed disks. Ensure + the system assigned identity of the cluster has been assigned appropriate permissions(key + get/wrap/unwrap permissions) on the key. + :paramtype managed_disk_customer_key_uri: str + :keyword backup_storage_customer_key_uri: Indicates the Key Uri of the customer key to use for + encryption of the backup storage account. + :paramtype backup_storage_customer_key_uri: str + :keyword sku: Virtual Machine SKU used for data centers. Default value is Standard_DS14_v2. + :paramtype sku: str + :keyword disk_sku: Disk SKU used for data centers. Default value is P30. + :paramtype disk_sku: str + :keyword disk_capacity: Number of disks attached to each node. Default is 4. + :paramtype disk_capacity: int + :keyword availability_zone: If the data center has Availability Zone support, apply it to the + Virtual Machine ScaleSet that host the cassandra data center virtual machines. + :paramtype availability_zone: bool + :keyword authentication_method_ldap_properties: Ldap authentication method properties. This + feature is in preview. + :paramtype authentication_method_ldap_properties: + ~azure.mgmt.cosmosdb.models.AuthenticationMethodLdapProperties + :keyword deallocated: Whether the data center has been deallocated. + :paramtype deallocated: bool + :keyword provision_error: Error related to resource provisioning. + :paramtype provision_error: ~azure.mgmt.cosmosdb.models.CassandraError + :keyword private_endpoint_ip_address: Ip of the VPN Endpoint for this data center. + :paramtype private_endpoint_ip_address: str """ super().__init__(**kwargs) - self.job_name = None - self.source = source - self.destination = destination - self.status = None - self.processed_count = None - self.total_count = None - self.last_updated_utc_time = None - self.worker_count = worker_count - self.error = None - self.duration = None - self.mode = mode + self.provisioning_state = provisioning_state + self.data_center_location = data_center_location + self.delegated_subnet_id = delegated_subnet_id + self.node_count = node_count + self.seed_nodes = None + self.base64_encoded_cassandra_yaml_fragment = base64_encoded_cassandra_yaml_fragment + self.managed_disk_customer_key_uri = managed_disk_customer_key_uri + self.backup_storage_customer_key_uri = backup_storage_customer_key_uri + self.sku = sku + self.disk_sku = disk_sku + self.disk_capacity = disk_capacity + self.availability_zone = availability_zone + self.authentication_method_ldap_properties = authentication_method_ldap_properties + self.deallocated = deallocated + self.provision_error = provision_error + self.private_endpoint_ip_address = private_endpoint_ip_address class RegionalServiceResource(_serialization.Model): @@ -6331,30 +4685,6 @@ def __init__( self.locations = None -class DiagnosticLogSettings(_serialization.Model): - """Indicates what diagnostic log settings are to be enabled. - - :ivar enable_full_text_query: Describe the level of detail with which queries are to be logged. - Known values are: "None", "True", and "False". - :vartype enable_full_text_query: str or ~azure.mgmt.cosmosdb.models.EnableFullTextQuery - """ - - _attribute_map = { - "enable_full_text_query": {"key": "enableFullTextQuery", "type": "str"}, - } - - def __init__( - self, *, enable_full_text_query: Optional[Union[str, "_models.EnableFullTextQuery"]] = None, **kwargs: Any - ) -> None: - """ - :keyword enable_full_text_query: Describe the level of detail with which queries are to be - logged. Known values are: "None", "True", and "False". - :paramtype enable_full_text_query: str or ~azure.mgmt.cosmosdb.models.EnableFullTextQuery - """ - super().__init__(**kwargs) - self.enable_full_text_query = enable_full_text_query - - class ErrorAdditionalInfo(_serialization.Model): """The resource management error additional info. @@ -6748,236 +5078,7 @@ def __init__( ) self.service_type: str = "GraphAPICompute" self.graph_api_compute_endpoint = graph_api_compute_endpoint - self.locations = None - - -class GraphResource(_serialization.Model): - """Cosmos DB Graph resource object. - - All required parameters must be populated in order to send to server. - - :ivar id: Name of the Cosmos DB Graph. Required. - :vartype id: str - """ - - _validation = { - "id": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: Name of the Cosmos DB Graph. Required. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class GraphResourceCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB Graph resource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :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: 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: The standard JSON format of a Graph resource. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.GraphResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": 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": "GraphResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, - } - - def __init__( - self, - *, - resource: "_models.GraphResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword 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: The standard JSON format of a Graph resource. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.GraphResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options - - -class GraphResourceGetPropertiesOptions(OptionsResource): - """GraphResourceGetPropertiesOptions. - - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings - """ - - -class GraphResourceGetPropertiesResource(GraphResource): - """GraphResourceGetPropertiesResource. - - All required parameters must be populated in order to send to server. - - :ivar id: Name of the Cosmos DB Graph. Required. - :vartype id: str - """ - - -class GraphResourceGetResults(ARMResourceProperties): - """An Azure Cosmos DB Graph resource. - - 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: 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: - :vartype resource: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesOptions - """ - - _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": "GraphResourceGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "GraphResourceGetPropertiesOptions"}, - } - - def __init__( - self, - *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.GraphResourceGetPropertiesResource"] = None, - options: Optional["_models.GraphResourceGetPropertiesOptions"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword 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: - :paramtype resource: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesOptions - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options - - -class GraphResourcesListResult(_serialization.Model): - """The List operation response, that contains the Graph resource and their properties. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of Graph resource and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[GraphResourceGetResults]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None + self.locations = None class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): @@ -7002,8 +5103,6 @@ class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): 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: The standard JSON format of a Gremlin database. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to @@ -7024,7 +5123,6 @@ class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): "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": "GremlinDatabaseResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } @@ -7035,7 +5133,6 @@ def __init__( resource: "_models.GremlinDatabaseResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -7049,15 +5146,13 @@ def __init__( 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: The standard JSON format of a Gremlin database. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -7205,8 +5300,6 @@ class GremlinDatabaseGetResults(ARMResourceProperties): 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: :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource :ivar options: @@ -7225,7 +5318,6 @@ class GremlinDatabaseGetResults(ARMResourceProperties): "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": "GremlinDatabaseGetPropertiesResource"}, "options": {"key": "properties.options", "type": "GremlinDatabaseGetPropertiesOptions"}, } @@ -7235,7 +5327,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.GremlinDatabaseGetPropertiesResource"] = None, options: Optional["_models.GremlinDatabaseGetPropertiesOptions"] = None, **kwargs: Any @@ -7250,14 +5341,12 @@ def __init__( 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: :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource :keyword options: :paramtype options: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -7335,8 +5424,6 @@ class GremlinGraphCreateUpdateParameters(ARMResourceProperties): 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: The standard JSON format of a Gremlin graph. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to @@ -7357,7 +5444,6 @@ class GremlinGraphCreateUpdateParameters(ARMResourceProperties): "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": "GremlinGraphResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } @@ -7368,7 +5454,6 @@ def __init__( resource: "_models.GremlinGraphResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -7382,15 +5467,13 @@ def __init__( 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: The standard JSON format of a Gremlin graph. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -7647,8 +5730,6 @@ class GremlinGraphGetResults(ARMResourceProperties): 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: :vartype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource :ivar options: @@ -7667,7 +5748,6 @@ class GremlinGraphGetResults(ARMResourceProperties): "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": "GremlinGraphGetPropertiesResource"}, "options": {"key": "properties.options", "type": "GremlinGraphGetPropertiesOptions"}, } @@ -7677,7 +5757,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.GremlinGraphGetPropertiesResource"] = None, options: Optional["_models.GremlinGraphGetPropertiesOptions"] = None, **kwargs: Any @@ -7692,14 +5771,12 @@ def __init__( 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: :paramtype resource: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource :keyword options: :paramtype options: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -7814,6 +5891,8 @@ class IndexingPolicy(_serialization.Model): :vartype composite_indexes: list[list[~azure.mgmt.cosmosdb.models.CompositePath]] :ivar spatial_indexes: List of spatial specifics. :vartype spatial_indexes: list[~azure.mgmt.cosmosdb.models.SpatialSpec] + :ivar vector_indexes: List of paths to include in the vector indexing. + :vartype vector_indexes: list[~azure.mgmt.cosmosdb.models.VectorIndex] """ _attribute_map = { @@ -7823,6 +5902,7 @@ class IndexingPolicy(_serialization.Model): "excluded_paths": {"key": "excludedPaths", "type": "[ExcludedPath]"}, "composite_indexes": {"key": "compositeIndexes", "type": "[[CompositePath]]"}, "spatial_indexes": {"key": "spatialIndexes", "type": "[SpatialSpec]"}, + "vector_indexes": {"key": "vectorIndexes", "type": "[VectorIndex]"}, } def __init__( @@ -7834,6 +5914,7 @@ def __init__( excluded_paths: Optional[List["_models.ExcludedPath"]] = None, composite_indexes: Optional[List[List["_models.CompositePath"]]] = None, spatial_indexes: Optional[List["_models.SpatialSpec"]] = None, + vector_indexes: Optional[List["_models.VectorIndex"]] = None, **kwargs: Any ) -> None: """ @@ -7850,6 +5931,8 @@ def __init__( :paramtype composite_indexes: list[list[~azure.mgmt.cosmosdb.models.CompositePath]] :keyword spatial_indexes: List of spatial specifics. :paramtype spatial_indexes: list[~azure.mgmt.cosmosdb.models.SpatialSpec] + :keyword vector_indexes: List of paths to include in the vector indexing. + :paramtype vector_indexes: list[~azure.mgmt.cosmosdb.models.VectorIndex] """ super().__init__(**kwargs) self.automatic = automatic @@ -7858,6 +5941,7 @@ def __init__( self.excluded_paths = excluded_paths self.composite_indexes = composite_indexes self.spatial_indexes = spatial_indexes + self.vector_indexes = vector_indexes class IpAddressOrRange(_serialization.Model): @@ -7934,29 +6018,6 @@ def __init__( self.algorithm = algorithm -class ListBackups(_serialization.Model): - """List of restorable backups for a Cassandra cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Container for array of backups. - :vartype value: list[~azure.mgmt.cosmosdb.models.BackupResource] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[BackupResource]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - class ListClusters(_serialization.Model): """List of managed Cassandra clusters. @@ -7977,29 +6038,6 @@ def __init__(self, *, value: Optional[List["_models.ClusterResource"]] = None, * self.value = value -class ListCommands(_serialization.Model): - """List of commands for cluster. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: Container for array of commands. - :vartype value: list[~azure.mgmt.cosmosdb.models.CommandPublicResource] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[CommandPublicResource]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - class ListDataCenters(_serialization.Model): """List of managed Cassandra data centers and their properties. @@ -8179,8 +6217,7 @@ class LocationProperties(_serialization.Model): have access in region for Availability Zones(Az). :vartype is_subscription_region_access_allowed_for_az: bool :ivar status: Enum to indicate current buildout status of the region. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". + "Uninitialized", "Initializing", "InternallyReady", "Online", and "Deleting". :vartype status: str or ~azure.mgmt.cosmosdb.models.Status """ @@ -8387,51 +6424,6 @@ def __init__(self, **kwargs: Any) -> None: self.client_id = None -class MaterializedViewDefinition(_serialization.Model): - """Materialized View definition for the container. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar source_collection_rid: An unique identifier for the source collection. This is a system - generated property. - :vartype source_collection_rid: str - :ivar source_collection_id: The name of the source container on which the Materialized View - will be created. Required. - :vartype source_collection_id: str - :ivar definition: The definition should be an SQL query which would be used to fetch data from - the source container to populate into the Materialized View container. Required. - :vartype definition: str - """ - - _validation = { - "source_collection_rid": {"readonly": True}, - "source_collection_id": {"required": True}, - "definition": {"required": True}, - } - - _attribute_map = { - "source_collection_rid": {"key": "sourceCollectionRid", "type": "str"}, - "source_collection_id": {"key": "sourceCollectionId", "type": "str"}, - "definition": {"key": "definition", "type": "str"}, - } - - def __init__(self, *, source_collection_id: str, definition: str, **kwargs: Any) -> None: - """ - :keyword source_collection_id: The name of the source container on which the Materialized View - will be created. Required. - :paramtype source_collection_id: str - :keyword definition: The definition should be an SQL query which would be used to fetch data - from the source container to populate into the Materialized View container. Required. - :paramtype definition: str - """ - super().__init__(**kwargs) - self.source_collection_rid = None - self.source_collection_id = source_collection_id - self.definition = definition - - class MaterializedViewsBuilderRegionalServiceResource(RegionalServiceResource): # pylint: disable=name-too-long """Resource for a regional service location. @@ -8591,26 +6583,6 @@ def __init__( self.locations = None -class MergeParameters(_serialization.Model): - """The properties of an Azure Cosmos DB merge operations. - - :ivar is_dry_run: Specifies whether the operation is a real merge operation or a simulation. - :vartype is_dry_run: bool - """ - - _attribute_map = { - "is_dry_run": {"key": "isDryRun", "type": "bool"}, - } - - def __init__(self, *, is_dry_run: Optional[bool] = None, **kwargs: Any) -> None: - """ - :keyword is_dry_run: Specifies whether the operation is a real merge operation or a simulation. - :paramtype is_dry_run: bool - """ - super().__init__(**kwargs) - self.is_dry_run = is_dry_run - - class Metric(_serialization.Model): """Metric data. @@ -8877,8 +6849,6 @@ class MongoDBCollectionCreateUpdateParameters(ARMResourceProperties): 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: The standard JSON format of a MongoDB collection. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to @@ -8899,7 +6869,6 @@ class MongoDBCollectionCreateUpdateParameters(ARMResourceProperties): "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": "MongoDBCollectionResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } @@ -8910,7 +6879,6 @@ def __init__( resource: "_models.MongoDBCollectionResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -8924,15 +6892,13 @@ def __init__( 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: The standard JSON format of a MongoDB collection. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -9130,8 +7096,6 @@ class MongoDBCollectionGetResults(ARMResourceProperties): 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: :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource :ivar options: @@ -9150,7 +7114,6 @@ class MongoDBCollectionGetResults(ARMResourceProperties): "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": "MongoDBCollectionGetPropertiesResource"}, "options": {"key": "properties.options", "type": "MongoDBCollectionGetPropertiesOptions"}, } @@ -9160,7 +7123,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.MongoDBCollectionGetPropertiesResource"] = None, options: Optional["_models.MongoDBCollectionGetPropertiesOptions"] = None, **kwargs: Any @@ -9175,14 +7137,12 @@ def __init__( 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: :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource :keyword options: :paramtype options: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -9232,8 +7192,6 @@ class MongoDBDatabaseCreateUpdateParameters(ARMResourceProperties): 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: The standard JSON format of a MongoDB database. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to @@ -9254,7 +7212,6 @@ class MongoDBDatabaseCreateUpdateParameters(ARMResourceProperties): "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": "MongoDBDatabaseResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } @@ -9265,7 +7222,6 @@ def __init__( resource: "_models.MongoDBDatabaseResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -9279,15 +7235,13 @@ def __init__( 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: The standard JSON format of a MongoDB database. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -9435,8 +7389,6 @@ class MongoDBDatabaseGetResults(ARMResourceProperties): 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: :vartype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource :ivar options: @@ -9455,7 +7407,6 @@ class MongoDBDatabaseGetResults(ARMResourceProperties): "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": "MongoDBDatabaseGetPropertiesResource"}, "options": {"key": "properties.options", "type": "MongoDBDatabaseGetPropertiesOptions"}, } @@ -9465,7 +7416,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.MongoDBDatabaseGetPropertiesResource"] = None, options: Optional["_models.MongoDBDatabaseGetPropertiesOptions"] = None, **kwargs: Any @@ -9480,14 +7430,12 @@ def __init__( 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: :paramtype resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource :keyword options: :paramtype options: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -9819,343 +7767,114 @@ def __init__( super().__init__(**kwargs) self.user_name = user_name self.password = password - self.database_name = database_name - self.custom_data = custom_data - self.roles = roles - self.mechanisms = mechanisms - - -class MongoUserDefinitionGetResults(ARMProxyResource): - """An Azure Cosmos DB User Definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar user_name: The user name for User Definition. - :vartype user_name: str - :ivar password: The password for User Definition. Response does not contain user password. - :vartype password: str - :ivar database_name: The database name for which access is being granted for this User - Definition. - :vartype database_name: str - :ivar custom_data: A custom definition for the USer Definition. - :vartype custom_data: str - :ivar roles: The set of roles inherited by the User Definition. - :vartype roles: list[~azure.mgmt.cosmosdb.models.Role] - :ivar mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism - SCRAM-SHA-256. - :vartype mechanisms: str - """ - - _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"}, - "user_name": {"key": "properties.userName", "type": "str"}, - "password": {"key": "properties.password", "type": "str"}, - "database_name": {"key": "properties.databaseName", "type": "str"}, - "custom_data": {"key": "properties.customData", "type": "str"}, - "roles": {"key": "properties.roles", "type": "[Role]"}, - "mechanisms": {"key": "properties.mechanisms", "type": "str"}, - } - - def __init__( - self, - *, - user_name: Optional[str] = None, - password: Optional[str] = None, - database_name: Optional[str] = None, - custom_data: Optional[str] = None, - roles: Optional[List["_models.Role"]] = None, - mechanisms: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword user_name: The user name for User Definition. - :paramtype user_name: str - :keyword password: The password for User Definition. Response does not contain user password. - :paramtype password: str - :keyword database_name: The database name for which access is being granted for this User - Definition. - :paramtype database_name: str - :keyword custom_data: A custom definition for the USer Definition. - :paramtype custom_data: str - :keyword roles: The set of roles inherited by the User Definition. - :paramtype roles: list[~azure.mgmt.cosmosdb.models.Role] - :keyword mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism - SCRAM-SHA-256. - :paramtype mechanisms: str - """ - super().__init__(**kwargs) - self.user_name = user_name - self.password = password - self.database_name = database_name - self.custom_data = custom_data - self.roles = roles - self.mechanisms = mechanisms - - -class MongoUserDefinitionListResult(_serialization.Model): - """The relevant User Definition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar value: List of User Definition and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.MongoUserDefinitionGetResults] - """ - - _validation = { - "value": {"readonly": True}, - } - - _attribute_map = { - "value": {"key": "value", "type": "[MongoUserDefinitionGetResults]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - -class NetworkSecurityPerimeter(_serialization.Model): - """Information about a network security perimeter (NSP). - - :ivar id: Fully qualified Azure resource ID of the NSP resource. - :vartype id: str - :ivar perimeter_guid: Universal unique ID (UUID) of the network security perimeter. - :vartype perimeter_guid: str - :ivar location: Location of the network security perimeter. - :vartype location: str - """ - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "perimeter_guid": {"key": "perimeterGuid", "type": "str"}, - "location": {"key": "location", "type": "str"}, - } - - def __init__( - self, - *, - id: Optional[str] = None, # pylint: disable=redefined-builtin - perimeter_guid: Optional[str] = None, - location: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword id: Fully qualified Azure resource ID of the NSP resource. - :paramtype id: str - :keyword perimeter_guid: Universal unique ID (UUID) of the network security perimeter. - :paramtype perimeter_guid: str - :keyword location: Location of the network security perimeter. - :paramtype location: str - """ - super().__init__(**kwargs) - self.id = id - self.perimeter_guid = perimeter_guid - self.location = location + self.database_name = database_name + self.custom_data = custom_data + self.roles = roles + self.mechanisms = mechanisms -class NetworkSecurityPerimeterConfiguration(ProxyResource): - """Network security perimeter (NSP) configuration resource. +class MongoUserDefinitionGetResults(ARMProxyResource): + """An Azure Cosmos DB User Definition. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the database account. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The type of Azure resource. :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - :ivar properties: Network security configuration properties. - :vartype properties: - ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfigurationProperties + :ivar user_name: The user name for User Definition. + :vartype user_name: str + :ivar password: The password for User Definition. Response does not contain user password. + :vartype password: str + :ivar database_name: The database name for which access is being granted for this User + Definition. + :vartype database_name: str + :ivar custom_data: A custom definition for the USer Definition. + :vartype custom_data: str + :ivar roles: The set of roles inherited by the User Definition. + :vartype roles: list[~azure.mgmt.cosmosdb.models.Role] + :ivar mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism + SCRAM-SHA-256. + :vartype mechanisms: str """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "system_data": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "properties": {"key": "properties", "type": "NetworkSecurityPerimeterConfigurationProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.NetworkSecurityPerimeterConfigurationProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: Network security configuration properties. - :paramtype properties: - ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfigurationProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class NetworkSecurityPerimeterConfigurationListResult(_serialization.Model): # pylint: disable=name-too-long - """Result of a list NSP (network security perimeter) configurations request. - - :ivar value: Array of network security perimeter results. - :vartype value: list[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration] - :ivar next_link: The link used to get the next page of results. - :vartype next_link: str - """ - - _attribute_map = { - "value": {"key": "value", "type": "[NetworkSecurityPerimeterConfiguration]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "user_name": {"key": "properties.userName", "type": "str"}, + "password": {"key": "properties.password", "type": "str"}, + "database_name": {"key": "properties.databaseName", "type": "str"}, + "custom_data": {"key": "properties.customData", "type": "str"}, + "roles": {"key": "properties.roles", "type": "[Role]"}, + "mechanisms": {"key": "properties.mechanisms", "type": "str"}, } def __init__( self, *, - value: Optional[List["_models.NetworkSecurityPerimeterConfiguration"]] = None, - next_link: Optional[str] = None, + user_name: Optional[str] = None, + password: Optional[str] = None, + database_name: Optional[str] = None, + custom_data: Optional[str] = None, + roles: Optional[List["_models.Role"]] = None, + mechanisms: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword value: Array of network security perimeter results. - :paramtype value: list[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration] - :keyword next_link: The link used to get the next page of results. - :paramtype next_link: str + :keyword user_name: The user name for User Definition. + :paramtype user_name: str + :keyword password: The password for User Definition. Response does not contain user password. + :paramtype password: str + :keyword database_name: The database name for which access is being granted for this User + Definition. + :paramtype database_name: str + :keyword custom_data: A custom definition for the USer Definition. + :paramtype custom_data: str + :keyword roles: The set of roles inherited by the User Definition. + :paramtype roles: list[~azure.mgmt.cosmosdb.models.Role] + :keyword mechanisms: The Mongo Auth mechanism. For now, we only support auth mechanism + SCRAM-SHA-256. + :paramtype mechanisms: str """ super().__init__(**kwargs) - self.value = value - self.next_link = next_link + self.user_name = user_name + self.password = password + self.database_name = database_name + self.custom_data = custom_data + self.roles = roles + self.mechanisms = mechanisms -class NetworkSecurityPerimeterConfigurationProperties(_serialization.Model): # pylint: disable=name-too-long - """Network security configuration properties. +class MongoUserDefinitionListResult(_serialization.Model): + """The relevant User Definition. Variables are only populated by the server, and will be ignored when sending a request. - :ivar provisioning_state: Provisioning state of a network security perimeter configuration that - is being created or updated. Known values are: "Succeeded", "Creating", "Updating", "Deleting", - "Accepted", "Failed", and "Canceled". - :vartype provisioning_state: str or - ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfigurationProvisioningState - :ivar provisioning_issues: List of provisioning issues, if any. - :vartype provisioning_issues: list[~azure.mgmt.cosmosdb.models.ProvisioningIssue] - :ivar network_security_perimeter: Information about a network security perimeter (NSP). - :vartype network_security_perimeter: ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeter - :ivar resource_association: Information about resource association. - :vartype resource_association: ~azure.mgmt.cosmosdb.models.ResourceAssociation - :ivar profile: Network security perimeter configuration profile. - :vartype profile: ~azure.mgmt.cosmosdb.models.NetworkSecurityProfile + :ivar value: List of User Definition and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.MongoUserDefinitionGetResults] """ _validation = { - "provisioning_state": {"readonly": True}, - "provisioning_issues": {"readonly": True}, - } - - _attribute_map = { - "provisioning_state": {"key": "provisioningState", "type": "str"}, - "provisioning_issues": {"key": "provisioningIssues", "type": "[ProvisioningIssue]"}, - "network_security_perimeter": {"key": "networkSecurityPerimeter", "type": "NetworkSecurityPerimeter"}, - "resource_association": {"key": "resourceAssociation", "type": "ResourceAssociation"}, - "profile": {"key": "profile", "type": "NetworkSecurityProfile"}, + "value": {"readonly": True}, } - def __init__( - self, - *, - network_security_perimeter: Optional["_models.NetworkSecurityPerimeter"] = None, - resource_association: Optional["_models.ResourceAssociation"] = None, - profile: Optional["_models.NetworkSecurityProfile"] = None, - **kwargs: Any - ) -> None: - """ - :keyword network_security_perimeter: Information about a network security perimeter (NSP). - :paramtype network_security_perimeter: ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeter - :keyword resource_association: Information about resource association. - :paramtype resource_association: ~azure.mgmt.cosmosdb.models.ResourceAssociation - :keyword profile: Network security perimeter configuration profile. - :paramtype profile: ~azure.mgmt.cosmosdb.models.NetworkSecurityProfile - """ - super().__init__(**kwargs) - self.provisioning_state = None - self.provisioning_issues = None - self.network_security_perimeter = network_security_perimeter - self.resource_association = resource_association - self.profile = profile - - -class NetworkSecurityProfile(_serialization.Model): - """Network security perimeter configuration profile. - - :ivar name: Name of the profile. - :vartype name: str - :ivar access_rules_version: Current access rules version. - :vartype access_rules_version: int - :ivar access_rules: List of Access Rules. - :vartype access_rules: list[~azure.mgmt.cosmosdb.models.AccessRule] - :ivar diagnostic_settings_version: Current diagnostic settings version. - :vartype diagnostic_settings_version: int - :ivar enabled_log_categories: List of log categories that are enabled. - :vartype enabled_log_categories: list[str] - """ - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "access_rules_version": {"key": "accessRulesVersion", "type": "int"}, - "access_rules": {"key": "accessRules", "type": "[AccessRule]"}, - "diagnostic_settings_version": {"key": "diagnosticSettingsVersion", "type": "int"}, - "enabled_log_categories": {"key": "enabledLogCategories", "type": "[str]"}, + "value": {"key": "value", "type": "[MongoUserDefinitionGetResults]"}, } - def __init__( - self, - *, - name: Optional[str] = None, - access_rules_version: Optional[int] = None, - access_rules: Optional[List["_models.AccessRule"]] = None, - diagnostic_settings_version: Optional[int] = None, - enabled_log_categories: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the profile. - :paramtype name: str - :keyword access_rules_version: Current access rules version. - :paramtype access_rules_version: int - :keyword access_rules: List of Access Rules. - :paramtype access_rules: list[~azure.mgmt.cosmosdb.models.AccessRule] - :keyword diagnostic_settings_version: Current diagnostic settings version. - :paramtype diagnostic_settings_version: int - :keyword enabled_log_categories: List of log categories that are enabled. - :paramtype enabled_log_categories: list[str] - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.name = name - self.access_rules_version = access_rules_version - self.access_rules = access_rules - self.diagnostic_settings_version = diagnostic_settings_version - self.enabled_log_categories = enabled_log_categories + self.value = None class NotebookWorkspace(ARMProxyResource): @@ -10739,270 +8458,111 @@ def __init__( migration_state: Optional["_models.BackupPolicyMigrationState"] = None, periodic_mode_properties: Optional["_models.PeriodicModeProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword migration_state: The object representing the state of the migration between the backup - policies. - :paramtype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState - :keyword periodic_mode_properties: Configuration values for periodic mode backup. - :paramtype periodic_mode_properties: ~azure.mgmt.cosmosdb.models.PeriodicModeProperties - """ - super().__init__(migration_state=migration_state, **kwargs) - self.type: str = "Periodic" - self.periodic_mode_properties = periodic_mode_properties - - -class PeriodicModeProperties(_serialization.Model): - """Configuration values for periodic mode backup. - - :ivar backup_interval_in_minutes: An integer representing the interval in minutes between two - backups. - :vartype backup_interval_in_minutes: int - :ivar backup_retention_interval_in_hours: An integer representing the time (in hours) that each - backup is retained. - :vartype backup_retention_interval_in_hours: int - :ivar backup_storage_redundancy: Enum to indicate type of backup residency. Known values are: - "Geo", "Local", and "Zone". - :vartype backup_storage_redundancy: str or ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy - """ - - _validation = { - "backup_interval_in_minutes": {"minimum": 0}, - "backup_retention_interval_in_hours": {"minimum": 0}, - } - - _attribute_map = { - "backup_interval_in_minutes": {"key": "backupIntervalInMinutes", "type": "int"}, - "backup_retention_interval_in_hours": {"key": "backupRetentionIntervalInHours", "type": "int"}, - "backup_storage_redundancy": {"key": "backupStorageRedundancy", "type": "str"}, - } - - def __init__( - self, - *, - backup_interval_in_minutes: Optional[int] = None, - backup_retention_interval_in_hours: Optional[int] = None, - backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword backup_interval_in_minutes: An integer representing the interval in minutes between - two backups. - :paramtype backup_interval_in_minutes: int - :keyword backup_retention_interval_in_hours: An integer representing the time (in hours) that - each backup is retained. - :paramtype backup_retention_interval_in_hours: int - :keyword backup_storage_redundancy: Enum to indicate type of backup residency. Known values - are: "Geo", "Local", and "Zone". - :paramtype backup_storage_redundancy: str or - ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy - """ - super().__init__(**kwargs) - self.backup_interval_in_minutes = backup_interval_in_minutes - self.backup_retention_interval_in_hours = backup_retention_interval_in_hours - self.backup_storage_redundancy = backup_storage_redundancy - - -class Permission(_serialization.Model): - """The set of data plane operations permitted through this Role Definition. - - :ivar data_actions: An array of data actions that are allowed. - :vartype data_actions: list[str] - :ivar not_data_actions: An array of data actions that are denied. - :vartype not_data_actions: list[str] - """ - - _attribute_map = { - "data_actions": {"key": "dataActions", "type": "[str]"}, - "not_data_actions": {"key": "notDataActions", "type": "[str]"}, - } - - def __init__( - self, *, data_actions: Optional[List[str]] = None, not_data_actions: Optional[List[str]] = None, **kwargs: Any - ) -> None: - """ - :keyword data_actions: An array of data actions that are allowed. - :paramtype data_actions: list[str] - :keyword not_data_actions: An array of data actions that are denied. - :paramtype not_data_actions: list[str] - """ - super().__init__(**kwargs) - self.data_actions = data_actions - self.not_data_actions = not_data_actions - - -class PhysicalPartitionId(_serialization.Model): - """PhysicalPartitionId object. - - All required parameters must be populated in order to send to server. - - :ivar id: Id of a physical partition. Required. - :vartype id: str - """ - - _validation = { - "id": {"required": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - } - - def __init__(self, *, id: str, **kwargs: Any) -> None: # pylint: disable=redefined-builtin - """ - :keyword id: Id of a physical partition. Required. - :paramtype id: str - """ - super().__init__(**kwargs) - self.id = id - - -class PhysicalPartitionStorageInfo(_serialization.Model): - """The storage of a physical partition. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar id: The unique identifier of the partition. - :vartype id: str - :ivar storage_in_kb: The storage in KB for the physical partition. - :vartype storage_in_kb: float - """ - - _validation = { - "id": {"readonly": True}, - "storage_in_kb": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "storage_in_kb": {"key": "storageInKB", "type": "float"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.id = None - self.storage_in_kb = None - + ) -> None: + """ + :keyword migration_state: The object representing the state of the migration between the backup + policies. + :paramtype migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState + :keyword periodic_mode_properties: Configuration values for periodic mode backup. + :paramtype periodic_mode_properties: ~azure.mgmt.cosmosdb.models.PeriodicModeProperties + """ + super().__init__(migration_state=migration_state, **kwargs) + self.type: str = "Periodic" + self.periodic_mode_properties = periodic_mode_properties -class PhysicalPartitionStorageInfoCollection(_serialization.Model): - """List of physical partitions and their properties returned by a merge operation. - Variables are only populated by the server, and will be ignored when sending a request. +class PeriodicModeProperties(_serialization.Model): + """Configuration values for periodic mode backup. - :ivar physical_partition_storage_info_collection: List of physical partitions and their - properties. - :vartype physical_partition_storage_info_collection: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfo] + :ivar backup_interval_in_minutes: An integer representing the interval in minutes between two + backups. + :vartype backup_interval_in_minutes: int + :ivar backup_retention_interval_in_hours: An integer representing the time (in hours) that each + backup is retained. + :vartype backup_retention_interval_in_hours: int + :ivar backup_storage_redundancy: Enum to indicate type of backup residency. Known values are: + "Geo", "Local", and "Zone". + :vartype backup_storage_redundancy: str or ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy """ _validation = { - "physical_partition_storage_info_collection": {"readonly": True}, - } - - _attribute_map = { - "physical_partition_storage_info_collection": { - "key": "physicalPartitionStorageInfoCollection", - "type": "[PhysicalPartitionStorageInfo]", - }, + "backup_interval_in_minutes": {"minimum": 0}, + "backup_retention_interval_in_hours": {"minimum": 0}, } - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.physical_partition_storage_info_collection = None - - -class PhysicalPartitionThroughputInfoProperties(_serialization.Model): # pylint: disable=name-too-long - """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]", - }, + "backup_interval_in_minutes": {"key": "backupIntervalInMinutes", "type": "int"}, + "backup_retention_interval_in_hours": {"key": "backupRetentionIntervalInHours", "type": "int"}, + "backup_storage_redundancy": {"key": "backupStorageRedundancy", "type": "str"}, } def __init__( self, *, - physical_partition_throughput_info: Optional[List["_models.PhysicalPartitionThroughputInfoResource"]] = None, + backup_interval_in_minutes: Optional[int] = None, + backup_retention_interval_in_hours: Optional[int] = None, + backup_storage_redundancy: Optional[Union[str, "_models.BackupStorageRedundancy"]] = None, **kwargs: Any ) -> None: """ - :keyword physical_partition_throughput_info: Array of physical partition throughput info - objects. - :paramtype physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] + :keyword backup_interval_in_minutes: An integer representing the interval in minutes between + two backups. + :paramtype backup_interval_in_minutes: int + :keyword backup_retention_interval_in_hours: An integer representing the time (in hours) that + each backup is retained. + :paramtype backup_retention_interval_in_hours: int + :keyword backup_storage_redundancy: Enum to indicate type of backup residency. Known values + are: "Geo", "Local", and "Zone". + :paramtype backup_storage_redundancy: str or + ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy """ super().__init__(**kwargs) - self.physical_partition_throughput_info = physical_partition_throughput_info - + self.backup_interval_in_minutes = backup_interval_in_minutes + self.backup_retention_interval_in_hours = backup_retention_interval_in_hours + self.backup_storage_redundancy = backup_storage_redundancy -class PhysicalPartitionThroughputInfoResource(_serialization.Model): - """PhysicalPartitionThroughputInfo object. - All required parameters must be populated in order to send to server. +class Permission(_serialization.Model): + """The set of data plane operations permitted through this Role Definition. - :ivar id: Id of a physical partition. Required. - :vartype id: str - :ivar throughput: Throughput of a physical partition. - :vartype throughput: float + :ivar data_actions: An array of data actions that are allowed. + :vartype data_actions: list[str] + :ivar not_data_actions: An array of data actions that are denied. + :vartype not_data_actions: list[str] """ - _validation = { - "id": {"required": True}, - } - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "throughput": {"key": "throughput", "type": "float"}, + "data_actions": {"key": "dataActions", "type": "[str]"}, + "not_data_actions": {"key": "notDataActions", "type": "[str]"}, } def __init__( - self, *, id: str, throughput: Optional[float] = None, **kwargs: Any # pylint: disable=redefined-builtin + self, *, data_actions: Optional[List[str]] = None, not_data_actions: Optional[List[str]] = None, **kwargs: Any ) -> None: """ - :keyword id: Id of a physical partition. Required. - :paramtype id: str - :keyword throughput: Throughput of a physical partition. - :paramtype throughput: float + :keyword data_actions: An array of data actions that are allowed. + :paramtype data_actions: list[str] + :keyword not_data_actions: An array of data actions that are denied. + :paramtype not_data_actions: list[str] """ super().__init__(**kwargs) - self.id = id - self.throughput = throughput + self.data_actions = data_actions + self.not_data_actions = not_data_actions -class PhysicalPartitionThroughputInfoResult(ARMResourceProperties): - """An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. +class Resource(_serialization.Model): + """Common fields that are returned in the response for all Azure Resource Manager resources. 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. + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the resource. :vartype name: str - :ivar type: The type of Azure resource. + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar location: The location of the resource group to which the resource belongs. - :vartype location: str - :ivar 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 = { @@ -11015,49 +8575,30 @@ class PhysicalPartitionThroughputInfoResult(ARMResourceProperties): "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["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.PhysicalPartitionThroughputInfoResultPropertiesResource"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword 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().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource + def __init__(self, **kwargs: Any) -> None: + """ """ + super().__init__(**kwargs) + self.id = None + self.name = None + self.type = None -class PhysicalPartitionThroughputInfoResultPropertiesResource( - PhysicalPartitionThroughputInfoProperties -): # pylint: disable=name-too-long - """properties of physical partition throughput info. +class ProxyResource(Resource): + """The resource model definition for a Azure Resource Manager proxy resource. It will not have + tags and a location. + + Variables are only populated by the server, and will be ignored when sending a request. - :ivar physical_partition_throughput_info: Array of physical partition throughput info objects. - :vartype physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long + :vartype id: str + :ivar name: The name of the resource. + :vartype name: str + :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or + "Microsoft.Storage/storageAccounts". + :vartype type: str """ @@ -11066,17 +8607,14 @@ class PrivateEndpointConnection(ProxyResource): Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: Fully qualified resource ID for the resource. Ex - + /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}. # pylint: disable=line-too-long :vartype id: str :ivar name: The name of the resource. :vartype name: str :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts". :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData :ivar private_endpoint: Private endpoint which the connection belongs to. :vartype private_endpoint: ~azure.mgmt.cosmosdb.models.PrivateEndpointProperty :ivar private_link_service_connection_state: Connection State of the Private Endpoint @@ -11093,14 +8631,12 @@ class PrivateEndpointConnection(ProxyResource): "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "system_data": {"readonly": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, "private_endpoint": {"key": "properties.privateEndpoint", "type": "PrivateEndpointProperty"}, "private_link_service_connection_state": { "key": "properties.privateLinkServiceConnectionState", @@ -11262,297 +8798,80 @@ class PrivateLinkServiceConnectionStateProperty(_serialization.Model): # pylint } _attribute_map = { - "status": {"key": "status", "type": "str"}, - "description": {"key": "description", "type": "str"}, - "actions_required": {"key": "actionsRequired", "type": "str"}, - } - - def __init__(self, *, status: Optional[str] = None, description: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword status: The private link service connection status. - :paramtype status: str - :keyword description: The private link service connection description. - :paramtype description: str - """ - super().__init__(**kwargs) - self.status = status - self.description = description - self.actions_required = None - - -class Privilege(_serialization.Model): - """The set of data plane operations permitted through this Role Definition. - - :ivar resource: An Azure Cosmos DB Mongo DB Resource. - :vartype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource - :ivar actions: An array of actions that are allowed. - :vartype actions: list[str] - """ - - _attribute_map = { - "resource": {"key": "resource", "type": "PrivilegeResource"}, - "actions": {"key": "actions", "type": "[str]"}, - } - - def __init__( - self, - *, - resource: Optional["_models.PrivilegeResource"] = None, - actions: Optional[List[str]] = None, - **kwargs: Any - ) -> None: - """ - :keyword resource: An Azure Cosmos DB Mongo DB Resource. - :paramtype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource - :keyword actions: An array of actions that are allowed. - :paramtype actions: list[str] - """ - super().__init__(**kwargs) - self.resource = resource - self.actions = actions - - -class PrivilegeResource(_serialization.Model): - """An Azure Cosmos DB Mongo DB Resource. - - :ivar db: The database name the role is applied. - :vartype db: str - :ivar collection: The collection name the role is applied. - :vartype collection: str - """ - - _attribute_map = { - "db": {"key": "db", "type": "str"}, - "collection": {"key": "collection", "type": "str"}, - } - - def __init__(self, *, db: Optional[str] = None, collection: Optional[str] = None, **kwargs: Any) -> None: - """ - :keyword db: The database name the role is applied. - :paramtype db: str - :keyword collection: The collection name the role is applied. - :paramtype collection: str - """ - super().__init__(**kwargs) - self.db = db - self.collection = collection - - -class ProvisioningIssue(_serialization.Model): - """Describes a provisioning issue for a network security perimeter configuration. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: Name of the issue. - :vartype name: str - :ivar properties: Details of a provisioning issue for a network security perimeter (NSP) - configuration. Resource providers should generate separate provisioning issue elements for each - separate issue detected, and include a meaningful and distinctive description, as well as any - appropriate suggestedResourceIds and suggestedAccessRules. - :vartype properties: ~azure.mgmt.cosmosdb.models.ProvisioningIssueProperties - """ - - _validation = { - "name": {"readonly": True}, - "properties": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "properties": {"key": "properties", "type": "ProvisioningIssueProperties"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.name = None - self.properties = None - - -class ProvisioningIssueProperties(_serialization.Model): - """Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource - providers should generate separate provisioning issue elements for each separate issue - detected, and include a meaningful and distinctive description, as well as any appropriate - suggestedResourceIds and suggestedAccessRules. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar issue_type: Type of issue. Known values are: "Unknown", - "ConfigurationPropagationFailure", "MissingPerimeterConfiguration", and - "MissingIdentityConfiguration". - :vartype issue_type: str or ~azure.mgmt.cosmosdb.models.IssueType - :ivar severity: Severity of the issue. Known values are: "Warning" and "Error". - :vartype severity: str or ~azure.mgmt.cosmosdb.models.Severity - :ivar description: Description of the issue. - :vartype description: str - :ivar suggested_resource_ids: Fully qualified resource IDs of suggested resources that can be - associated to the network security perimeter (NSP) to remediate the issue. - :vartype suggested_resource_ids: list[str] - :ivar suggested_access_rules: Access rules that can be added to the network security profile - (NSP) to remediate the issue. - :vartype suggested_access_rules: list[~azure.mgmt.cosmosdb.models.AccessRule] - """ - - _validation = { - "issue_type": {"readonly": True}, - "severity": {"readonly": True}, - "description": {"readonly": True}, - "suggested_resource_ids": {"readonly": True}, - "suggested_access_rules": {"readonly": True}, - } - - _attribute_map = { - "issue_type": {"key": "issueType", "type": "str"}, - "severity": {"key": "severity", "type": "str"}, + "status": {"key": "status", "type": "str"}, "description": {"key": "description", "type": "str"}, - "suggested_resource_ids": {"key": "suggestedResourceIds", "type": "[str]"}, - "suggested_access_rules": {"key": "suggestedAccessRules", "type": "[AccessRule]"}, + "actions_required": {"key": "actionsRequired", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__(self, *, status: Optional[str] = None, description: Optional[str] = None, **kwargs: Any) -> None: + """ + :keyword status: The private link service connection status. + :paramtype status: str + :keyword description: The private link service connection description. + :paramtype description: str + """ super().__init__(**kwargs) - self.issue_type = None - self.severity = None - self.description = None - self.suggested_resource_ids = None - self.suggested_access_rules = None - - -class RedistributeThroughputParameters(ARMResourceProperties): - """Cosmos DB redistribute throughput parameters object. + self.status = status + self.description = description + self.actions_required = None - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. +class Privilege(_serialization.Model): + """The set of data plane operations permitted through this Role Definition. - :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: 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: The standard JSON format of a resource throughput. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.RedistributeThroughputPropertiesResource + :ivar resource: An Azure Cosmos DB Mongo DB Resource. + :vartype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource + :ivar actions: An array of actions that are allowed. + :vartype actions: list[str] """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": 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": "RedistributeThroughputPropertiesResource"}, + "resource": {"key": "resource", "type": "PrivilegeResource"}, + "actions": {"key": "actions", "type": "[str]"}, } def __init__( self, *, - resource: "_models.RedistributeThroughputPropertiesResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, + resource: Optional["_models.PrivilegeResource"] = None, + actions: Optional[List[str]] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword 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: The standard JSON format of a resource throughput. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.RedistributeThroughputPropertiesResource + :keyword resource: An Azure Cosmos DB Mongo DB Resource. + :paramtype resource: ~azure.mgmt.cosmosdb.models.PrivilegeResource + :keyword actions: An array of actions that are allowed. + :paramtype actions: list[str] """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(**kwargs) self.resource = resource + self.actions = actions -class RedistributeThroughputPropertiesResource(_serialization.Model): - """Resource to redistribute throughput for Azure Cosmos DB resource. - - All required parameters must be populated in order to send to server. +class PrivilegeResource(_serialization.Model): + """An Azure Cosmos DB Mongo DB Resource. - :ivar throughput_policy: ThroughputPolicy to apply for throughput redistribution. Required. - Known values are: "none", "equal", and "custom". - :vartype throughput_policy: str or ~azure.mgmt.cosmosdb.models.ThroughputPolicyType - :ivar target_physical_partition_throughput_info: Array of - PhysicalPartitionThroughputInfoResource objects. Required. - :vartype target_physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] - :ivar source_physical_partition_throughput_info: Array of - PhysicalPartitionThroughputInfoResource objects. Required. - :vartype source_physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] + :ivar db: The database name the role is applied. + :vartype db: str + :ivar collection: The collection name the role is applied. + :vartype collection: str """ - _validation = { - "throughput_policy": {"required": True}, - "target_physical_partition_throughput_info": {"required": True}, - "source_physical_partition_throughput_info": {"required": True}, - } - _attribute_map = { - "throughput_policy": {"key": "throughputPolicy", "type": "str"}, - "target_physical_partition_throughput_info": { - "key": "targetPhysicalPartitionThroughputInfo", - "type": "[PhysicalPartitionThroughputInfoResource]", - }, - "source_physical_partition_throughput_info": { - "key": "sourcePhysicalPartitionThroughputInfo", - "type": "[PhysicalPartitionThroughputInfoResource]", - }, + "db": {"key": "db", "type": "str"}, + "collection": {"key": "collection", "type": "str"}, } - def __init__( - self, - *, - throughput_policy: Union[str, "_models.ThroughputPolicyType"], - target_physical_partition_throughput_info: List["_models.PhysicalPartitionThroughputInfoResource"], - source_physical_partition_throughput_info: List["_models.PhysicalPartitionThroughputInfoResource"], - **kwargs: Any - ) -> None: + def __init__(self, *, db: Optional[str] = None, collection: Optional[str] = None, **kwargs: Any) -> None: """ - :keyword throughput_policy: ThroughputPolicy to apply for throughput redistribution. Required. - Known values are: "none", "equal", and "custom". - :paramtype throughput_policy: str or ~azure.mgmt.cosmosdb.models.ThroughputPolicyType - :keyword target_physical_partition_throughput_info: Array of - PhysicalPartitionThroughputInfoResource objects. Required. - :paramtype target_physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] - :keyword source_physical_partition_throughput_info: Array of - PhysicalPartitionThroughputInfoResource objects. Required. - :paramtype source_physical_partition_throughput_info: - list[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResource] + :keyword db: The database name the role is applied. + :paramtype db: str + :keyword collection: The collection name the role is applied. + :paramtype collection: str """ super().__init__(**kwargs) - self.throughput_policy = throughput_policy - self.target_physical_partition_throughput_info = target_physical_partition_throughput_info - self.source_physical_partition_throughput_info = source_physical_partition_throughput_info + self.db = db + self.collection = collection class RegionForOnlineOffline(_serialization.Model): @@ -11582,40 +8901,6 @@ def __init__(self, *, region: str, **kwargs: Any) -> None: self.region = region -class ResourceAssociation(_serialization.Model): - """Information about resource association. - - :ivar name: Name of the resource association. - :vartype name: str - :ivar access_mode: Access mode of the resource association. Known values are: "Enforced", - "Learning", and "Audit". - :vartype access_mode: str or ~azure.mgmt.cosmosdb.models.ResourceAssociationAccessMode - """ - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "access_mode": {"key": "accessMode", "type": "str"}, - } - - def __init__( - self, - *, - name: Optional[str] = None, - access_mode: Optional[Union[str, "_models.ResourceAssociationAccessMode"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword name: Name of the resource association. - :paramtype name: str - :keyword access_mode: Access mode of the resource association. Known values are: "Enforced", - "Learning", and "Audit". - :paramtype access_mode: str or ~azure.mgmt.cosmosdb.models.ResourceAssociationAccessMode - """ - super().__init__(**kwargs) - self.name = name - self.access_mode = access_mode - - class RestoreParametersBase(_serialization.Model): """Parameters to indicate the information about the restore. @@ -11694,12 +8979,12 @@ class RestorableDatabaseAccountGetResult(_serialization.Model): :vartype account_name: str :ivar creation_time: The creation time of the restorable database account (ISO-8601 format). :vartype creation_time: ~datetime.datetime - :ivar oldest_restorable_time: The least recent time at which the database account can be - restored to (ISO-8601 format). - :vartype oldest_restorable_time: ~datetime.datetime :ivar deletion_time: The time at which the restorable database account has been deleted (ISO-8601 format). :vartype deletion_time: ~datetime.datetime + :ivar oldest_restorable_time: The least recent time at which the database account can be + restored to (ISO-8601 format). + :vartype oldest_restorable_time: ~datetime.datetime :ivar api_type: The API type of the restorable database account. Known values are: "MongoDB", "Gremlin", "Cassandra", "Table", "Sql", and "GremlinV2". :vartype api_type: str or ~azure.mgmt.cosmosdb.models.ApiType @@ -11723,8 +9008,8 @@ class RestorableDatabaseAccountGetResult(_serialization.Model): "location": {"key": "location", "type": "str"}, "account_name": {"key": "properties.accountName", "type": "str"}, "creation_time": {"key": "properties.creationTime", "type": "iso-8601"}, - "oldest_restorable_time": {"key": "properties.oldestRestorableTime", "type": "iso-8601"}, "deletion_time": {"key": "properties.deletionTime", "type": "iso-8601"}, + "oldest_restorable_time": {"key": "properties.oldestRestorableTime", "type": "iso-8601"}, "api_type": {"key": "properties.apiType", "type": "str"}, "restorable_locations": {"key": "properties.restorableLocations", "type": "[RestorableLocationResource]"}, } @@ -11735,8 +9020,8 @@ def __init__( location: Optional[str] = None, account_name: Optional[str] = None, creation_time: Optional[datetime.datetime] = None, - oldest_restorable_time: Optional[datetime.datetime] = None, deletion_time: Optional[datetime.datetime] = None, + oldest_restorable_time: Optional[datetime.datetime] = None, **kwargs: Any ) -> None: """ @@ -11746,12 +9031,12 @@ def __init__( :paramtype account_name: str :keyword creation_time: The creation time of the restorable database account (ISO-8601 format). :paramtype creation_time: ~datetime.datetime - :keyword oldest_restorable_time: The least recent time at which the database account can be - restored to (ISO-8601 format). - :paramtype oldest_restorable_time: ~datetime.datetime :keyword deletion_time: The time at which the restorable database account has been deleted (ISO-8601 format). :paramtype deletion_time: ~datetime.datetime + :keyword oldest_restorable_time: The least recent time at which the database account can be + restored to (ISO-8601 format). + :paramtype oldest_restorable_time: ~datetime.datetime """ super().__init__(**kwargs) self.id = None @@ -11760,8 +9045,8 @@ def __init__( self.location = location self.account_name = account_name self.creation_time = creation_time - self.oldest_restorable_time = oldest_restorable_time self.deletion_time = deletion_time + self.oldest_restorable_time = oldest_restorable_time self.api_type = None self.restorable_locations = None @@ -12591,11 +9876,10 @@ class SqlContainerResource(_serialization.Model): # pylint: disable=too-many-in :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" and "Restore". :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :ivar materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition :ivar computed_properties: List of computed properties. :vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :ivar vector_embedding_policy: The vector embedding policy for the container. + :vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy """ _validation = { @@ -12613,8 +9897,8 @@ class SqlContainerResource(_serialization.Model): # pylint: disable=too-many-in "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, "create_mode": {"key": "createMode", "type": "str"}, - "materialized_view_definition": {"key": "materializedViewDefinition", "type": "MaterializedViewDefinition"}, "computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"}, + "vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"}, } def __init__( @@ -12630,8 +9914,8 @@ def __init__( analytical_storage_ttl: Optional[int] = None, restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, create_mode: Union[str, "_models.CreateMode"] = "Default", - materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None, computed_properties: Optional[List["_models.ComputedProperty"]] = None, + vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None, **kwargs: Any ) -> None: """ @@ -12659,11 +9943,10 @@ def __init__( :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" and "Restore". :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :keyword materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition :keyword computed_properties: List of computed properties. :paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :keyword vector_embedding_policy: The vector embedding policy for the container. + :paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy """ super().__init__(**kwargs) self.id = id @@ -12676,8 +9959,8 @@ def __init__( self.analytical_storage_ttl = analytical_storage_ttl self.restore_parameters = restore_parameters self.create_mode = create_mode - self.materialized_view_definition = materialized_view_definition self.computed_properties = computed_properties + self.vector_embedding_policy = vector_embedding_policy class RestorableSqlContainerPropertiesResourceContainer( @@ -12720,11 +10003,10 @@ class RestorableSqlContainerPropertiesResourceContainer( :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" and "Restore". :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :ivar materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition :ivar computed_properties: List of computed properties. :vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :ivar vector_embedding_policy: The vector embedding policy for the container. + :vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy :ivar self_property: A system generated property that specifies the addressable path of the container resource. :vartype self_property: str @@ -12752,8 +10034,8 @@ class RestorableSqlContainerPropertiesResourceContainer( "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, "create_mode": {"key": "createMode", "type": "str"}, - "materialized_view_definition": {"key": "materializedViewDefinition", "type": "MaterializedViewDefinition"}, "computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"}, + "vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"}, "self_property": {"key": "_self", "type": "str"}, } @@ -12770,8 +10052,8 @@ def __init__( analytical_storage_ttl: Optional[int] = None, restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, create_mode: Union[str, "_models.CreateMode"] = "Default", - materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None, computed_properties: Optional[List["_models.ComputedProperty"]] = None, + vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None, **kwargs: Any ) -> None: """ @@ -12799,11 +10081,10 @@ def __init__( :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" and "Restore". :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :keyword materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition :keyword computed_properties: List of computed properties. :paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :keyword vector_embedding_policy: The vector embedding policy for the container. + :paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy """ super().__init__( id=id, @@ -12816,8 +10097,8 @@ def __init__( analytical_storage_ttl=analytical_storage_ttl, restore_parameters=restore_parameters, create_mode=create_mode, - materialized_view_definition=materialized_view_definition, computed_properties=computed_properties, + vector_embedding_policy=vector_embedding_policy, **kwargs ) self.rid = None @@ -12834,8 +10115,8 @@ def __init__( self.analytical_storage_ttl = analytical_storage_ttl self.restore_parameters = restore_parameters self.create_mode = create_mode - self.materialized_view_definition = materialized_view_definition self.computed_properties = computed_properties + self.vector_embedding_policy = vector_embedding_policy class RestorableSqlContainersListResult(_serialization.Model): @@ -13391,8 +10672,6 @@ class RestoreParameters(RestoreParametersBase): list[~azure.mgmt.cosmosdb.models.GremlinDatabaseRestoreResource] :ivar tables_to_restore: List of specific tables available for restore. :vartype tables_to_restore: list[str] - :ivar source_backup_location: The source backup location for restore. - :vartype source_backup_location: str """ _attribute_map = { @@ -13406,7 +10685,6 @@ class RestoreParameters(RestoreParametersBase): "type": "[GremlinDatabaseRestoreResource]", }, "tables_to_restore": {"key": "tablesToRestore", "type": "[str]"}, - "source_backup_location": {"key": "sourceBackupLocation", "type": "str"}, } def __init__( @@ -13419,7 +10697,6 @@ def __init__( databases_to_restore: Optional[List["_models.DatabaseRestoreResource"]] = None, gremlin_databases_to_restore: Optional[List["_models.GremlinDatabaseRestoreResource"]] = None, tables_to_restore: Optional[List[str]] = None, - source_backup_location: Optional[str] = None, **kwargs: Any ) -> None: """ @@ -13443,8 +10720,6 @@ def __init__( list[~azure.mgmt.cosmosdb.models.GremlinDatabaseRestoreResource] :keyword tables_to_restore: List of specific tables available for restore. :paramtype tables_to_restore: list[str] - :keyword source_backup_location: The source backup location for restore. - :paramtype source_backup_location: str """ super().__init__( restore_source=restore_source, @@ -13456,106 +10731,6 @@ def __init__( self.databases_to_restore = databases_to_restore self.gremlin_databases_to_restore = gremlin_databases_to_restore self.tables_to_restore = tables_to_restore - self.source_backup_location = source_backup_location - - -class RetrieveThroughputParameters(ARMResourceProperties): - """Cosmos DB retrieve throughput parameters object. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :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: 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: The standard JSON format of a resource throughput. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.RetrieveThroughputPropertiesResource - """ - - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "resource": {"required": 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": "RetrieveThroughputPropertiesResource"}, - } - - def __init__( - self, - *, - resource: "_models.RetrieveThroughputPropertiesResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - **kwargs: Any - ) -> None: - """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword 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: The standard JSON format of a resource throughput. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.RetrieveThroughputPropertiesResource - """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - - -class RetrieveThroughputPropertiesResource(_serialization.Model): - """Resource to retrieve throughput information for Cosmos DB resource. - - All required parameters must be populated in order to send to server. - - :ivar physical_partition_ids: Array of PhysicalPartitionId objects. Required. - :vartype physical_partition_ids: list[~azure.mgmt.cosmosdb.models.PhysicalPartitionId] - """ - - _validation = { - "physical_partition_ids": {"required": True}, - } - - _attribute_map = { - "physical_partition_ids": {"key": "physicalPartitionIds", "type": "[PhysicalPartitionId]"}, - } - - def __init__(self, *, physical_partition_ids: List["_models.PhysicalPartitionId"], **kwargs: Any) -> None: - """ - :keyword physical_partition_ids: Array of PhysicalPartitionId objects. Required. - :paramtype physical_partition_ids: list[~azure.mgmt.cosmosdb.models.PhysicalPartitionId] - """ - super().__init__(**kwargs) - self.physical_partition_ids = physical_partition_ids class Role(_serialization.Model): @@ -13742,8 +10917,6 @@ class SqlContainerCreateUpdateParameters(ARMResourceProperties): 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: The standard JSON format of a container. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to @@ -13764,7 +10937,6 @@ class SqlContainerCreateUpdateParameters(ARMResourceProperties): "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": "SqlContainerResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } @@ -13775,7 +10947,6 @@ def __init__( resource: "_models.SqlContainerResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -13789,15 +10960,13 @@ def __init__( 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: The standard JSON format of a container. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -13853,11 +11022,10 @@ class SqlContainerGetPropertiesResource( :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" and "Restore". :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :ivar materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :vartype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition :ivar computed_properties: List of computed properties. :vartype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :ivar vector_embedding_policy: The vector embedding policy for the container. + :vartype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy """ _validation = { @@ -13881,8 +11049,8 @@ class SqlContainerGetPropertiesResource( "analytical_storage_ttl": {"key": "analyticalStorageTtl", "type": "int"}, "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, "create_mode": {"key": "createMode", "type": "str"}, - "materialized_view_definition": {"key": "materializedViewDefinition", "type": "MaterializedViewDefinition"}, "computed_properties": {"key": "computedProperties", "type": "[ComputedProperty]"}, + "vector_embedding_policy": {"key": "vectorEmbeddingPolicy", "type": "VectorEmbeddingPolicy"}, } def __init__( @@ -13898,8 +11066,8 @@ def __init__( analytical_storage_ttl: Optional[int] = None, restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, create_mode: Union[str, "_models.CreateMode"] = "Default", - materialized_view_definition: Optional["_models.MaterializedViewDefinition"] = None, computed_properties: Optional[List["_models.ComputedProperty"]] = None, + vector_embedding_policy: Optional["_models.VectorEmbeddingPolicy"] = None, **kwargs: Any ) -> None: """ @@ -13927,11 +11095,10 @@ def __init__( :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" and "Restore". :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :keyword materialized_view_definition: The configuration for defining Materialized Views. This - must be specified only for creating a Materialized View container. - :paramtype materialized_view_definition: ~azure.mgmt.cosmosdb.models.MaterializedViewDefinition :keyword computed_properties: List of computed properties. :paramtype computed_properties: list[~azure.mgmt.cosmosdb.models.ComputedProperty] + :keyword vector_embedding_policy: The vector embedding policy for the container. + :paramtype vector_embedding_policy: ~azure.mgmt.cosmosdb.models.VectorEmbeddingPolicy """ super().__init__( id=id, @@ -13944,8 +11111,8 @@ def __init__( analytical_storage_ttl=analytical_storage_ttl, restore_parameters=restore_parameters, create_mode=create_mode, - materialized_view_definition=materialized_view_definition, computed_properties=computed_properties, + vector_embedding_policy=vector_embedding_policy, **kwargs ) self.rid = None @@ -13961,8 +11128,8 @@ def __init__( self.analytical_storage_ttl = analytical_storage_ttl self.restore_parameters = restore_parameters self.create_mode = create_mode - self.materialized_view_definition = materialized_view_definition self.computed_properties = computed_properties + self.vector_embedding_policy = vector_embedding_policy class SqlContainerGetResults(ARMResourceProperties): @@ -13985,8 +11152,6 @@ class SqlContainerGetResults(ARMResourceProperties): 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: :vartype resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource :ivar options: @@ -14005,7 +11170,6 @@ class SqlContainerGetResults(ARMResourceProperties): "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": "SqlContainerGetPropertiesResource"}, "options": {"key": "properties.options", "type": "SqlContainerGetPropertiesOptions"}, } @@ -14015,7 +11179,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.SqlContainerGetPropertiesResource"] = None, options: Optional["_models.SqlContainerGetPropertiesOptions"] = None, **kwargs: Any @@ -14030,14 +11193,12 @@ def __init__( 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: :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource :keyword options: :paramtype options: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -14087,8 +11248,6 @@ class SqlDatabaseCreateUpdateParameters(ARMResourceProperties): 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: The standard JSON format of a SQL database. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to @@ -14109,7 +11268,6 @@ class SqlDatabaseCreateUpdateParameters(ARMResourceProperties): "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": "SqlDatabaseResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } @@ -14120,7 +11278,6 @@ def __init__( resource: "_models.SqlDatabaseResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -14134,15 +11291,13 @@ def __init__( 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: The standard JSON format of a SQL database. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -14260,9 +11415,7 @@ class SqlDatabaseGetResults(ARMResourceProperties): 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 + :vartype tags: dict[str, str] :ivar resource: :vartype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource :ivar options: @@ -14281,7 +11434,6 @@ class SqlDatabaseGetResults(ARMResourceProperties): "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": "SqlDatabaseGetPropertiesResource"}, "options": {"key": "properties.options", "type": "SqlDatabaseGetPropertiesOptions"}, } @@ -14291,7 +11443,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.SqlDatabaseGetPropertiesResource"] = None, options: Optional["_models.SqlDatabaseGetPropertiesOptions"] = None, **kwargs: Any @@ -14306,14 +11457,12 @@ def __init__( 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: :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource :keyword options: :paramtype options: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -14333,695 +11482,430 @@ class SqlDatabaseListResult(_serialization.Model): _attribute_map = { "value": {"key": "value", "type": "[SqlDatabaseGetResults]"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.value = None - - -class SqlDedicatedGatewayRegionalServiceResource(RegionalServiceResource): # pylint: disable=name-too-long - """Resource for a regional service location. - - Variables are only populated by the server, and will be ignored when sending a request. - - :ivar name: The regional service name. - :vartype name: str - :ivar location: The location name. - :vartype location: str - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus - :ivar sql_dedicated_gateway_endpoint: The regional endpoint for SqlDedicatedGateway. - :vartype sql_dedicated_gateway_endpoint: str - """ - - _validation = { - "name": {"readonly": True}, - "location": {"readonly": True}, - "status": {"readonly": True}, - "sql_dedicated_gateway_endpoint": {"readonly": True}, - } - - _attribute_map = { - "name": {"key": "name", "type": "str"}, - "location": {"key": "location", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "sql_dedicated_gateway_endpoint": {"key": "sqlDedicatedGatewayEndpoint", "type": "str"}, - } - - def __init__(self, **kwargs: Any) -> None: - """ """ - super().__init__(**kwargs) - self.sql_dedicated_gateway_endpoint = None - - -class SqlDedicatedGatewayServiceResource(_serialization.Model): - """Describes the service response property for SqlDedicatedGateway. - - :ivar properties: Properties for SqlDedicatedGatewayServiceResource. - :vartype properties: ~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayServiceResourceProperties - """ - - _attribute_map = { - "properties": {"key": "properties", "type": "SqlDedicatedGatewayServiceResourceProperties"}, - } - - def __init__( - self, *, properties: Optional["_models.SqlDedicatedGatewayServiceResourceProperties"] = None, **kwargs: Any - ) -> None: - """ - :keyword properties: Properties for SqlDedicatedGatewayServiceResource. - :paramtype properties: ~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayServiceResourceProperties - """ - super().__init__(**kwargs) - self.properties = properties - - -class SqlDedicatedGatewayServiceResourceCreateUpdateProperties( - ServiceResourceCreateUpdateProperties -): # pylint: disable=name-too-long - """Properties for Create or Update request for SqlDedicatedGatewayServiceResource. - - All required parameters must be populated in order to send to server. - - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType - :ivar dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: - "IntegratedCache" and "DistributedQuery". - :vartype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType - """ - - _validation = { - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, - } - - _attribute_map = { - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, - "dedicated_gateway_type": {"key": "dedicatedGatewayType", "type": "str"}, - } - - def __init__( - self, - *, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, - dedicated_gateway_type: Optional[Union[str, "_models.DedicatedGatewayType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int - :keyword dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: - "IntegratedCache" and "DistributedQuery". - :paramtype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType - """ - super().__init__(instance_size=instance_size, instance_count=instance_count, **kwargs) - self.service_type: str = "SqlDedicatedGateway" - self.dedicated_gateway_type = dedicated_gateway_type - - -class SqlDedicatedGatewayServiceResourceProperties(ServiceResourceProperties): # pylint: disable=name-too-long - """Properties for SqlDedicatedGatewayServiceResource. - - Variables are only populated by the server, and will be ignored when sending a request. - - All required parameters must be populated in order to send to server. - - :ivar additional_properties: Unmatched properties from the message are deserialized to this - collection. - :vartype additional_properties: dict[str, any] - :ivar creation_time: Time of the last state change (ISO-8601 format). - :vartype creation_time: ~datetime.datetime - :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :ivar instance_count: Instance count for the service. - :vartype instance_count: int - :ivar service_type: ServiceType for the service. Required. Known values are: - "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". - :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType - :ivar status: Describes the status of a service. Known values are: "Creating", "Running", - "Updating", "Deleting", "Error", and "Stopped". - :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus - :ivar sql_dedicated_gateway_endpoint: SqlDedicatedGateway endpoint for the service. - :vartype sql_dedicated_gateway_endpoint: str - :ivar dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: - "IntegratedCache" and "DistributedQuery". - :vartype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType - :ivar locations: An array that contains all of the locations for the service. - :vartype locations: - list[~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayRegionalServiceResource] - """ - - _validation = { - "creation_time": {"readonly": True}, - "instance_count": {"minimum": 0}, - "service_type": {"required": True}, - "status": {"readonly": True}, - "locations": {"readonly": True}, - } - - _attribute_map = { - "additional_properties": {"key": "", "type": "{object}"}, - "creation_time": {"key": "creationTime", "type": "iso-8601"}, - "instance_size": {"key": "instanceSize", "type": "str"}, - "instance_count": {"key": "instanceCount", "type": "int"}, - "service_type": {"key": "serviceType", "type": "str"}, - "status": {"key": "status", "type": "str"}, - "sql_dedicated_gateway_endpoint": {"key": "sqlDedicatedGatewayEndpoint", "type": "str"}, - "dedicated_gateway_type": {"key": "dedicatedGatewayType", "type": "str"}, - "locations": {"key": "locations", "type": "[SqlDedicatedGatewayRegionalServiceResource]"}, - } - - def __init__( - self, - *, - additional_properties: Optional[Dict[str, Any]] = None, - instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, - instance_count: Optional[int] = None, - sql_dedicated_gateway_endpoint: Optional[str] = None, - dedicated_gateway_type: Optional[Union[str, "_models.DedicatedGatewayType"]] = None, - **kwargs: Any - ) -> None: - """ - :keyword additional_properties: Unmatched properties from the message are deserialized to this - collection. - :paramtype additional_properties: dict[str, any] - :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", - "Cosmos.D8s", and "Cosmos.D16s". - :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize - :keyword instance_count: Instance count for the service. - :paramtype instance_count: int - :keyword sql_dedicated_gateway_endpoint: SqlDedicatedGateway endpoint for the service. - :paramtype sql_dedicated_gateway_endpoint: str - :keyword dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: - "IntegratedCache" and "DistributedQuery". - :paramtype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType - """ - super().__init__( - additional_properties=additional_properties, - instance_size=instance_size, - instance_count=instance_count, - **kwargs - ) - self.service_type: str = "SqlDedicatedGateway" - self.sql_dedicated_gateway_endpoint = sql_dedicated_gateway_endpoint - self.dedicated_gateway_type = dedicated_gateway_type - self.locations = None - - -class SqlRoleAssignmentCreateUpdateParameters(_serialization.Model): - """Parameters to create and update an Azure Cosmos DB SQL Role Assignment. - - :ivar role_definition_id: The unique identifier for the associated Role Definition. - :vartype role_definition_id: str - :ivar scope: The data plane resource path for which access is being granted through this Role - Assignment. - :vartype scope: str - :ivar principal_id: The unique identifier for the associated AAD principal in the AAD graph to - which access is being granted through this Role Assignment. Tenant ID for the principal is - inferred using the tenant associated with the subscription. - :vartype principal_id: str - """ - - _attribute_map = { - "role_definition_id": {"key": "properties.roleDefinitionId", "type": "str"}, - "scope": {"key": "properties.scope", "type": "str"}, - "principal_id": {"key": "properties.principalId", "type": "str"}, - } - - def __init__( - self, - *, - role_definition_id: Optional[str] = None, - scope: Optional[str] = None, - principal_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword role_definition_id: The unique identifier for the associated Role Definition. - :paramtype role_definition_id: str - :keyword scope: The data plane resource path for which access is being granted through this - Role Assignment. - :paramtype scope: str - :keyword principal_id: The unique identifier for the associated AAD principal in the AAD graph - to which access is being granted through this Role Assignment. Tenant ID for the principal is - inferred using the tenant associated with the subscription. - :paramtype principal_id: str - """ + } + + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.role_definition_id = role_definition_id - self.scope = scope - self.principal_id = principal_id + self.value = None -class SqlRoleAssignmentGetResults(ARMProxyResource): - """An Azure Cosmos DB Role Assignment. +class SqlDedicatedGatewayRegionalServiceResource(RegionalServiceResource): # pylint: disable=name-too-long + """Resource for a regional service location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. + :ivar name: The regional service name. :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar role_definition_id: The unique identifier for the associated Role Definition. - :vartype role_definition_id: str - :ivar scope: The data plane resource path for which access is being granted through this Role - Assignment. - :vartype scope: str - :ivar principal_id: The unique identifier for the associated AAD principal in the AAD graph to - which access is being granted through this Role Assignment. Tenant ID for the principal is - inferred using the tenant associated with the subscription. - :vartype principal_id: str + :ivar location: The location name. + :vartype location: str + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar sql_dedicated_gateway_endpoint: The regional endpoint for SqlDedicatedGateway. + :vartype sql_dedicated_gateway_endpoint: str """ _validation = { - "id": {"readonly": True}, "name": {"readonly": True}, - "type": {"readonly": True}, + "location": {"readonly": True}, + "status": {"readonly": True}, + "sql_dedicated_gateway_endpoint": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "role_definition_id": {"key": "properties.roleDefinitionId", "type": "str"}, - "scope": {"key": "properties.scope", "type": "str"}, - "principal_id": {"key": "properties.principalId", "type": "str"}, + "location": {"key": "location", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "sql_dedicated_gateway_endpoint": {"key": "sqlDedicatedGatewayEndpoint", "type": "str"}, } - def __init__( - self, - *, - role_definition_id: Optional[str] = None, - scope: Optional[str] = None, - principal_id: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword role_definition_id: The unique identifier for the associated Role Definition. - :paramtype role_definition_id: str - :keyword scope: The data plane resource path for which access is being granted through this - Role Assignment. - :paramtype scope: str - :keyword principal_id: The unique identifier for the associated AAD principal in the AAD graph - to which access is being granted through this Role Assignment. Tenant ID for the principal is - inferred using the tenant associated with the subscription. - :paramtype principal_id: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.role_definition_id = role_definition_id - self.scope = scope - self.principal_id = principal_id - + self.sql_dedicated_gateway_endpoint = None -class SqlRoleAssignmentListResult(_serialization.Model): - """The relevant Role Assignments. - Variables are only populated by the server, and will be ignored when sending a request. +class SqlDedicatedGatewayServiceResource(_serialization.Model): + """Describes the service response property for SqlDedicatedGateway. - :ivar value: List of Role Assignments and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlRoleAssignmentGetResults] + :ivar properties: Properties for SqlDedicatedGatewayServiceResource. + :vartype properties: ~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayServiceResourceProperties """ - _validation = { - "value": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[SqlRoleAssignmentGetResults]"}, + "properties": {"key": "properties", "type": "SqlDedicatedGatewayServiceResourceProperties"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, *, properties: Optional["_models.SqlDedicatedGatewayServiceResourceProperties"] = None, **kwargs: Any + ) -> None: + """ + :keyword properties: Properties for SqlDedicatedGatewayServiceResource. + :paramtype properties: ~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayServiceResourceProperties + """ super().__init__(**kwargs) - self.value = None + self.properties = properties -class SqlRoleDefinitionCreateUpdateParameters(_serialization.Model): - """Parameters to create and update an Azure Cosmos DB SQL Role Definition. +class SqlDedicatedGatewayServiceResourceCreateUpdateProperties( + ServiceResourceCreateUpdateProperties +): # pylint: disable=name-too-long + """Properties for Create or Update request for SqlDedicatedGatewayServiceResource. - :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database - account. - :vartype role_name: str - :ivar type: Indicates whether the Role Definition was built-in or user created. Known values - are: "BuiltInRole" and "CustomRole". - :vartype type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :ivar assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments may - be created using this Role Definition. This will allow application of this Role Definition on - the entire database account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as assignable Scopes. Note - that resources referenced in assignable Scopes need not exist. - :vartype assignable_scopes: list[str] - :ivar permissions: The set of operations allowed through this Role Definition. - :vartype permissions: list[~azure.mgmt.cosmosdb.models.Permission] + All required parameters must be populated in order to send to server. + + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: + "IntegratedCache" and "DistributedQuery". + :vartype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType """ + _validation = { + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, + } + _attribute_map = { - "role_name": {"key": "properties.roleName", "type": "str"}, - "type": {"key": "properties.type", "type": "str"}, - "assignable_scopes": {"key": "properties.assignableScopes", "type": "[str]"}, - "permissions": {"key": "properties.permissions", "type": "[Permission]"}, + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, + "dedicated_gateway_type": {"key": "dedicatedGatewayType", "type": "str"}, } def __init__( self, *, - role_name: Optional[str] = None, - type: Optional[Union[str, "_models.RoleDefinitionType"]] = None, - assignable_scopes: Optional[List[str]] = None, - permissions: Optional[List["_models.Permission"]] = None, + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, + dedicated_gateway_type: Optional[Union[str, "_models.DedicatedGatewayType"]] = None, **kwargs: Any ) -> None: """ - :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the - database account. - :paramtype role_name: str - :keyword type: Indicates whether the Role Definition was built-in or user created. Known values - are: "BuiltInRole" and "CustomRole". - :paramtype type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :keyword assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments - may be created using this Role Definition. This will allow application of this Role Definition - on the entire database account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as assignable Scopes. Note - that resources referenced in assignable Scopes need not exist. - :paramtype assignable_scopes: list[str] - :keyword permissions: The set of operations allowed through this Role Definition. - :paramtype permissions: list[~azure.mgmt.cosmosdb.models.Permission] + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int + :keyword dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: + "IntegratedCache" and "DistributedQuery". + :paramtype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType """ - super().__init__(**kwargs) - self.role_name = role_name - self.type = type - self.assignable_scopes = assignable_scopes - self.permissions = permissions + super().__init__(instance_size=instance_size, instance_count=instance_count, **kwargs) + self.service_type: str = "SqlDedicatedGateway" + self.dedicated_gateway_type = dedicated_gateway_type -class SqlRoleDefinitionGetResults(ARMProxyResource): - """An Azure Cosmos DB SQL Role Definition. +class SqlDedicatedGatewayServiceResourceProperties(ServiceResourceProperties): # pylint: disable=name-too-long + """Properties for SqlDedicatedGatewayServiceResource. Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: The unique resource identifier of the database account. - :vartype id: str - :ivar name: The name of the database account. - :vartype name: str - :ivar type: The type of Azure resource. - :vartype type: str - :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database - account. - :vartype role_name: str - :ivar type_properties_type: Indicates whether the Role Definition was built-in or user created. - Known values are: "BuiltInRole" and "CustomRole". - :vartype type_properties_type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :ivar assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments may - be created using this Role Definition. This will allow application of this Role Definition on - the entire database account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as assignable Scopes. Note - that resources referenced in assignable Scopes need not exist. - :vartype assignable_scopes: list[str] - :ivar permissions: The set of operations allowed through this Role Definition. - :vartype permissions: list[~azure.mgmt.cosmosdb.models.Permission] + All required parameters must be populated in order to send to server. + + :ivar additional_properties: Unmatched properties from the message are deserialized to this + collection. + :vartype additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :ivar instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :vartype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :ivar instance_count: Instance count for the service. + :vartype instance_count: int + :ivar service_type: ServiceType for the service. Required. Known values are: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute", and "MaterializedViewsBuilder". + :vartype service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Known values are: "Creating", "Running", + "Updating", "Deleting", "Error", and "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar sql_dedicated_gateway_endpoint: SqlDedicatedGateway endpoint for the service. + :vartype sql_dedicated_gateway_endpoint: str + :ivar dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: + "IntegratedCache" and "DistributedQuery". + :vartype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType + :ivar locations: An array that contains all of the locations for the service. + :vartype locations: + list[~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayRegionalServiceResource] """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, + "creation_time": {"readonly": True}, + "instance_count": {"minimum": 0}, + "service_type": {"required": True}, + "status": {"readonly": True}, + "locations": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "role_name": {"key": "properties.roleName", "type": "str"}, - "type_properties_type": {"key": "properties.type", "type": "str"}, - "assignable_scopes": {"key": "properties.assignableScopes", "type": "[str]"}, - "permissions": {"key": "properties.permissions", "type": "[Permission]"}, + "additional_properties": {"key": "", "type": "{object}"}, + "creation_time": {"key": "creationTime", "type": "iso-8601"}, + "instance_size": {"key": "instanceSize", "type": "str"}, + "instance_count": {"key": "instanceCount", "type": "int"}, + "service_type": {"key": "serviceType", "type": "str"}, + "status": {"key": "status", "type": "str"}, + "sql_dedicated_gateway_endpoint": {"key": "sqlDedicatedGatewayEndpoint", "type": "str"}, + "dedicated_gateway_type": {"key": "dedicatedGatewayType", "type": "str"}, + "locations": {"key": "locations", "type": "[SqlDedicatedGatewayRegionalServiceResource]"}, } def __init__( self, *, - role_name: Optional[str] = None, - type_properties_type: Optional[Union[str, "_models.RoleDefinitionType"]] = None, - assignable_scopes: Optional[List[str]] = None, - permissions: Optional[List["_models.Permission"]] = None, + additional_properties: Optional[Dict[str, Any]] = None, + instance_size: Optional[Union[str, "_models.ServiceSize"]] = None, + instance_count: Optional[int] = None, + sql_dedicated_gateway_endpoint: Optional[str] = None, + dedicated_gateway_type: Optional[Union[str, "_models.DedicatedGatewayType"]] = None, **kwargs: Any ) -> None: """ - :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the - database account. - :paramtype role_name: str - :keyword type_properties_type: Indicates whether the Role Definition was built-in or user - created. Known values are: "BuiltInRole" and "CustomRole". - :paramtype type_properties_type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :keyword assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments - may be created using this Role Definition. This will allow application of this Role Definition - on the entire database account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as assignable Scopes. Note - that resources referenced in assignable Scopes need not exist. - :paramtype assignable_scopes: list[str] - :keyword permissions: The set of operations allowed through this Role Definition. - :paramtype permissions: list[~azure.mgmt.cosmosdb.models.Permission] + :keyword additional_properties: Unmatched properties from the message are deserialized to this + collection. + :paramtype additional_properties: dict[str, any] + :keyword instance_size: Instance type for the service. Known values are: "Cosmos.D4s", + "Cosmos.D8s", and "Cosmos.D16s". + :paramtype instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :keyword instance_count: Instance count for the service. + :paramtype instance_count: int + :keyword sql_dedicated_gateway_endpoint: SqlDedicatedGateway endpoint for the service. + :paramtype sql_dedicated_gateway_endpoint: str + :keyword dedicated_gateway_type: DedicatedGatewayType for the service. Known values are: + "IntegratedCache" and "DistributedQuery". + :paramtype dedicated_gateway_type: str or ~azure.mgmt.cosmosdb.models.DedicatedGatewayType """ - super().__init__(**kwargs) - self.role_name = role_name - self.type_properties_type = type_properties_type - self.assignable_scopes = assignable_scopes - self.permissions = permissions - + super().__init__( + additional_properties=additional_properties, + instance_size=instance_size, + instance_count=instance_count, + **kwargs + ) + self.service_type: str = "SqlDedicatedGateway" + self.sql_dedicated_gateway_endpoint = sql_dedicated_gateway_endpoint + self.dedicated_gateway_type = dedicated_gateway_type + self.locations = None -class SqlRoleDefinitionListResult(_serialization.Model): - """The relevant Role Definitions. - Variables are only populated by the server, and will be ignored when sending a request. +class SqlRoleAssignmentCreateUpdateParameters(_serialization.Model): + """Parameters to create and update an Azure Cosmos DB SQL Role Assignment. - :ivar value: List of Role Definitions and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlRoleDefinitionGetResults] + :ivar role_definition_id: The unique identifier for the associated Role Definition. + :vartype role_definition_id: str + :ivar scope: The data plane resource path for which access is being granted through this Role + Assignment. + :vartype scope: str + :ivar principal_id: The unique identifier for the associated AAD principal in the AAD graph to + which access is being granted through this Role Assignment. Tenant ID for the principal is + inferred using the tenant associated with the subscription. + :vartype principal_id: str """ - _validation = { - "value": {"readonly": True}, - } - _attribute_map = { - "value": {"key": "value", "type": "[SqlRoleDefinitionGetResults]"}, + "role_definition_id": {"key": "properties.roleDefinitionId", "type": "str"}, + "scope": {"key": "properties.scope", "type": "str"}, + "principal_id": {"key": "properties.principalId", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + role_definition_id: Optional[str] = None, + scope: Optional[str] = None, + principal_id: Optional[str] = None, + **kwargs: Any + ) -> None: + """ + :keyword role_definition_id: The unique identifier for the associated Role Definition. + :paramtype role_definition_id: str + :keyword scope: The data plane resource path for which access is being granted through this + Role Assignment. + :paramtype scope: str + :keyword principal_id: The unique identifier for the associated AAD principal in the AAD graph + to which access is being granted through this Role Assignment. Tenant ID for the principal is + inferred using the tenant associated with the subscription. + :paramtype principal_id: str + """ super().__init__(**kwargs) - self.value = None + self.role_definition_id = role_definition_id + self.scope = scope + self.principal_id = principal_id -class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB storedProcedure. +class SqlRoleAssignmentGetResults(ARMProxyResource): + """An Azure Cosmos DB Role Assignment. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - - :ivar id: The unique resource identifier of the ARM resource. + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the database account. :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: 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: The standard JSON format of a storedProcedure. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureResource - :ivar options: A key-value pair of options to be applied for the request. This corresponds to - the headers sent with the request. - :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :ivar role_definition_id: The unique identifier for the associated Role Definition. + :vartype role_definition_id: str + :ivar scope: The data plane resource path for which access is being granted through this Role + Assignment. + :vartype scope: str + :ivar principal_id: The unique identifier for the associated AAD principal in the AAD graph to + which access is being granted through this Role Assignment. Tenant ID for the principal is + inferred using the tenant associated with the subscription. + :vartype principal_id: str """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "resource": {"required": 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": "SqlStoredProcedureResource"}, - "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, + "role_definition_id": {"key": "properties.roleDefinitionId", "type": "str"}, + "scope": {"key": "properties.scope", "type": "str"}, + "principal_id": {"key": "properties.principalId", "type": "str"}, } def __init__( self, *, - resource: "_models.SqlStoredProcedureResource", - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - options: Optional["_models.CreateUpdateOptions"] = None, + role_definition_id: Optional[str] = None, + scope: Optional[str] = None, + principal_id: Optional[str] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword 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: The standard JSON format of a storedProcedure. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureResource - :keyword options: A key-value pair of options to be applied for the request. This corresponds - to the headers sent with the request. - :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions + :keyword role_definition_id: The unique identifier for the associated Role Definition. + :paramtype role_definition_id: str + :keyword scope: The data plane resource path for which access is being granted through this + Role Assignment. + :paramtype scope: str + :keyword principal_id: The unique identifier for the associated AAD principal in the AAD graph + to which access is being granted through this Role Assignment. Tenant ID for the principal is + inferred using the tenant associated with the subscription. + :paramtype principal_id: str """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource - self.options = options + super().__init__(**kwargs) + self.role_definition_id = role_definition_id + self.scope = scope + self.principal_id = principal_id -class SqlStoredProcedureResource(_serialization.Model): - """Cosmos DB SQL storedProcedure resource object. +class SqlRoleAssignmentListResult(_serialization.Model): + """The relevant Role Assignments. - All required parameters must be populated in order to send to server. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar id: Name of the Cosmos DB SQL storedProcedure. Required. - :vartype id: str - :ivar body: Body of the Stored Procedure. - :vartype body: str + :ivar value: List of Role Assignments and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlRoleAssignmentGetResults] """ _validation = { - "id": {"required": True}, + "value": {"readonly": True}, } _attribute_map = { - "id": {"key": "id", "type": "str"}, - "body": {"key": "body", "type": "str"}, + "value": {"key": "value", "type": "[SqlRoleAssignmentGetResults]"}, } - def __init__( - self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin - ) -> None: - """ - :keyword id: Name of the Cosmos DB SQL storedProcedure. Required. - :paramtype id: str - :keyword body: Body of the Stored Procedure. - :paramtype body: str - """ + def __init__(self, **kwargs: Any) -> None: + """ """ super().__init__(**kwargs) - self.id = id - self.body = body - - -class SqlStoredProcedureGetPropertiesResource(SqlStoredProcedureResource, ExtendedResourceProperties): - """SqlStoredProcedureGetPropertiesResource. + self.value = None - Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. +class SqlRoleDefinitionCreateUpdateParameters(_serialization.Model): + """Parameters to create and update an Azure Cosmos DB SQL Role Definition. - :ivar rid: A system generated property. A unique identifier. - :vartype rid: str - :ivar ts: A system generated property that denotes the last updated timestamp of the resource. - :vartype ts: float - :ivar etag: A system generated property representing the resource etag required for optimistic - concurrency control. - :vartype etag: str - :ivar id: Name of the Cosmos DB SQL storedProcedure. Required. - :vartype id: str - :ivar body: Body of the Stored Procedure. - :vartype body: str + :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database + account. + :vartype role_name: str + :ivar type: Indicates whether the Role Definition was built-in or user created. Known values + are: "BuiltInRole" and "CustomRole". + :vartype type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType + :ivar assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments may + be created using this Role Definition. This will allow application of this Role Definition on + the entire database account or any underlying Database / Collection. Must have at least one + element. Scopes higher than Database account are not enforceable as assignable Scopes. Note + that resources referenced in assignable Scopes need not exist. + :vartype assignable_scopes: list[str] + :ivar permissions: The set of operations allowed through this Role Definition. + :vartype permissions: list[~azure.mgmt.cosmosdb.models.Permission] """ - _validation = { - "rid": {"readonly": True}, - "ts": {"readonly": True}, - "etag": {"readonly": True}, - "id": {"required": True}, - } - _attribute_map = { - "rid": {"key": "_rid", "type": "str"}, - "ts": {"key": "_ts", "type": "float"}, - "etag": {"key": "_etag", "type": "str"}, - "id": {"key": "id", "type": "str"}, - "body": {"key": "body", "type": "str"}, + "role_name": {"key": "properties.roleName", "type": "str"}, + "type": {"key": "properties.type", "type": "str"}, + "assignable_scopes": {"key": "properties.assignableScopes", "type": "[str]"}, + "permissions": {"key": "properties.permissions", "type": "[Permission]"}, } def __init__( - self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin + self, + *, + role_name: Optional[str] = None, + type: Optional[Union[str, "_models.RoleDefinitionType"]] = None, + assignable_scopes: Optional[List[str]] = None, + permissions: Optional[List["_models.Permission"]] = None, + **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB SQL storedProcedure. Required. - :paramtype id: str - :keyword body: Body of the Stored Procedure. - :paramtype body: str + :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the + database account. + :paramtype role_name: str + :keyword type: Indicates whether the Role Definition was built-in or user created. Known values + are: "BuiltInRole" and "CustomRole". + :paramtype type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType + :keyword assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments + may be created using this Role Definition. This will allow application of this Role Definition + on the entire database account or any underlying Database / Collection. Must have at least one + element. Scopes higher than Database account are not enforceable as assignable Scopes. Note + that resources referenced in assignable Scopes need not exist. + :paramtype assignable_scopes: list[str] + :keyword permissions: The set of operations allowed through this Role Definition. + :paramtype permissions: list[~azure.mgmt.cosmosdb.models.Permission] """ - super().__init__(id=id, body=body, **kwargs) - self.rid = None - self.ts = None - self.etag = None - self.id = id - self.body = body + super().__init__(**kwargs) + self.role_name = role_name + self.type = type + self.assignable_scopes = assignable_scopes + self.permissions = permissions -class SqlStoredProcedureGetResults(ARMResourceProperties): - """An Azure Cosmos DB storedProcedure. +class SqlRoleDefinitionGetResults(ARMProxyResource): + """An Azure Cosmos DB SQL Role Definition. 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. + :ivar id: The unique resource identifier of the database account. :vartype id: str - :ivar name: The name of the ARM resource. + :ivar name: The name of the database account. :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: 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: - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource + :ivar role_name: A user-friendly name for the Role Definition. Must be unique for the database + account. + :vartype role_name: str + :ivar type_properties_type: Indicates whether the Role Definition was built-in or user created. + Known values are: "BuiltInRole" and "CustomRole". + :vartype type_properties_type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType + :ivar assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments may + be created using this Role Definition. This will allow application of this Role Definition on + the entire database account or any underlying Database / Collection. Must have at least one + element. Scopes higher than Database account are not enforceable as assignable Scopes. Note + that resources referenced in assignable Scopes need not exist. + :vartype assignable_scopes: list[str] + :ivar permissions: The set of operations allowed through this Role Definition. + :vartype permissions: list[~azure.mgmt.cosmosdb.models.Permission] """ _validation = { @@ -15034,47 +11918,51 @@ class SqlStoredProcedureGetResults(ARMResourceProperties): "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": "SqlStoredProcedureGetPropertiesResource"}, + "role_name": {"key": "properties.roleName", "type": "str"}, + "type_properties_type": {"key": "properties.type", "type": "str"}, + "assignable_scopes": {"key": "properties.assignableScopes", "type": "[str]"}, + "permissions": {"key": "properties.permissions", "type": "[Permission]"}, } def __init__( self, *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.SqlStoredProcedureGetPropertiesResource"] = None, + role_name: Optional[str] = None, + type_properties_type: Optional[Union[str, "_models.RoleDefinitionType"]] = None, + assignable_scopes: Optional[List[str]] = None, + permissions: Optional[List["_models.Permission"]] = None, **kwargs: Any ) -> None: """ - :keyword location: The location of the resource group to which the resource belongs. - :paramtype location: str - :keyword 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: - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource + :keyword role_name: A user-friendly name for the Role Definition. Must be unique for the + database account. + :paramtype role_name: str + :keyword type_properties_type: Indicates whether the Role Definition was built-in or user + created. Known values are: "BuiltInRole" and "CustomRole". + :paramtype type_properties_type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType + :keyword assignable_scopes: A set of fully qualified Scopes at or below which Role Assignments + may be created using this Role Definition. This will allow application of this Role Definition + on the entire database account or any underlying Database / Collection. Must have at least one + element. Scopes higher than Database account are not enforceable as assignable Scopes. Note + that resources referenced in assignable Scopes need not exist. + :paramtype assignable_scopes: list[str] + :keyword permissions: The set of operations allowed through this Role Definition. + :paramtype permissions: list[~azure.mgmt.cosmosdb.models.Permission] """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) - self.resource = resource + super().__init__(**kwargs) + self.role_name = role_name + self.type_properties_type = type_properties_type + self.assignable_scopes = assignable_scopes + self.permissions = permissions -class SqlStoredProcedureListResult(_serialization.Model): - """The List operation response, that contains the storedProcedures and their properties. +class SqlRoleDefinitionListResult(_serialization.Model): + """The relevant Role Definitions. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of storedProcedures and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetResults] + :ivar value: List of Role Definitions and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlRoleDefinitionGetResults] """ _validation = { @@ -15082,7 +11970,7 @@ class SqlStoredProcedureListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[SqlStoredProcedureGetResults]"}, + "value": {"key": "value", "type": "[SqlRoleDefinitionGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -15091,8 +11979,8 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class SqlTriggerCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB trigger. +class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB storedProcedure. Variables are only populated by the server, and will be ignored when sending a request. @@ -15113,10 +12001,8 @@ class SqlTriggerCreateUpdateParameters(ARMResourceProperties): 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: The standard JSON format of a trigger. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerResource + :ivar resource: The standard JSON format of a storedProcedure. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions @@ -15135,18 +12021,16 @@ class SqlTriggerCreateUpdateParameters(ARMResourceProperties): "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": "SqlTriggerResource"}, + "resource": {"key": "properties.resource", "type": "SqlStoredProcedureResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, - resource: "_models.SqlTriggerResource", + resource: "_models.SqlStoredProcedureResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -15160,33 +12044,26 @@ def __init__( 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: The standard JSON format of a trigger. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerResource + :keyword resource: The standard JSON format of a storedProcedure. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options -class SqlTriggerResource(_serialization.Model): - """Cosmos DB SQL trigger resource object. +class SqlStoredProcedureResource(_serialization.Model): + """Cosmos DB SQL storedProcedure resource object. All required parameters must be populated in order to send to server. - :ivar id: Name of the Cosmos DB SQL trigger. Required. + :ivar id: Name of the Cosmos DB SQL storedProcedure. Required. :vartype id: str - :ivar body: Body of the Trigger. + :ivar body: Body of the Stored Procedure. :vartype body: str - :ivar trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". - :vartype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType - :ivar trigger_operation: The operation the trigger is associated with. Known values are: "All", - "Create", "Update", "Delete", and "Replace". - :vartype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ _validation = { @@ -15196,39 +12073,24 @@ class SqlTriggerResource(_serialization.Model): _attribute_map = { "id": {"key": "id", "type": "str"}, "body": {"key": "body", "type": "str"}, - "trigger_type": {"key": "triggerType", "type": "str"}, - "trigger_operation": {"key": "triggerOperation", "type": "str"}, } def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - body: Optional[str] = None, - trigger_type: Optional[Union[str, "_models.TriggerType"]] = None, - trigger_operation: Optional[Union[str, "_models.TriggerOperation"]] = None, - **kwargs: Any + self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin ) -> None: """ - :keyword id: Name of the Cosmos DB SQL trigger. Required. + :keyword id: Name of the Cosmos DB SQL storedProcedure. Required. :paramtype id: str - :keyword body: Body of the Trigger. + :keyword body: Body of the Stored Procedure. :paramtype body: str - :keyword trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". - :paramtype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType - :keyword trigger_operation: The operation the trigger is associated with. Known values are: - "All", "Create", "Update", "Delete", and "Replace". - :paramtype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ super().__init__(**kwargs) self.id = id self.body = body - self.trigger_type = trigger_type - self.trigger_operation = trigger_operation -class SqlTriggerGetPropertiesResource(SqlTriggerResource, ExtendedResourceProperties): - """SqlTriggerGetPropertiesResource. +class SqlStoredProcedureGetPropertiesResource(SqlStoredProcedureResource, ExtendedResourceProperties): + """SqlStoredProcedureGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. @@ -15241,15 +12103,10 @@ class SqlTriggerGetPropertiesResource(SqlTriggerResource, ExtendedResourceProper :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :ivar id: Name of the Cosmos DB SQL trigger. Required. + :ivar id: Name of the Cosmos DB SQL storedProcedure. Required. :vartype id: str - :ivar body: Body of the Trigger. + :ivar body: Body of the Stored Procedure. :vartype body: str - :ivar trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". - :vartype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType - :ivar trigger_operation: The operation the trigger is associated with. Known values are: "All", - "Create", "Update", "Delete", and "Replace". - :vartype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ _validation = { @@ -15265,42 +12122,27 @@ class SqlTriggerGetPropertiesResource(SqlTriggerResource, ExtendedResourceProper "etag": {"key": "_etag", "type": "str"}, "id": {"key": "id", "type": "str"}, "body": {"key": "body", "type": "str"}, - "trigger_type": {"key": "triggerType", "type": "str"}, - "trigger_operation": {"key": "triggerOperation", "type": "str"}, } def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - body: Optional[str] = None, - trigger_type: Optional[Union[str, "_models.TriggerType"]] = None, - trigger_operation: Optional[Union[str, "_models.TriggerOperation"]] = None, - **kwargs: Any + self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin ) -> None: """ - :keyword id: Name of the Cosmos DB SQL trigger. Required. + :keyword id: Name of the Cosmos DB SQL storedProcedure. Required. :paramtype id: str - :keyword body: Body of the Trigger. + :keyword body: Body of the Stored Procedure. :paramtype body: str - :keyword trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". - :paramtype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType - :keyword trigger_operation: The operation the trigger is associated with. Known values are: - "All", "Create", "Update", "Delete", and "Replace". - :paramtype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ - super().__init__(id=id, body=body, trigger_type=trigger_type, trigger_operation=trigger_operation, **kwargs) + super().__init__(id=id, body=body, **kwargs) self.rid = None self.ts = None self.etag = None self.id = id self.body = body - self.trigger_type = trigger_type - self.trigger_operation = trigger_operation -class SqlTriggerGetResults(ARMResourceProperties): - """An Azure Cosmos DB trigger. +class SqlStoredProcedureGetResults(ARMResourceProperties): + """An Azure Cosmos DB storedProcedure. Variables are only populated by the server, and will be ignored when sending a request. @@ -15319,10 +12161,8 @@ class SqlTriggerGetResults(ARMResourceProperties): 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: - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource """ _validation = { @@ -15337,8 +12177,7 @@ class SqlTriggerGetResults(ARMResourceProperties): "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": "SqlTriggerGetPropertiesResource"}, + "resource": {"key": "properties.resource", "type": "SqlStoredProcedureGetPropertiesResource"}, } def __init__( @@ -15346,8 +12185,7 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.SqlTriggerGetPropertiesResource"] = None, + resource: Optional["_models.SqlStoredProcedureGetPropertiesResource"] = None, **kwargs: Any ) -> None: """ @@ -15360,22 +12198,20 @@ def __init__( 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: - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource -class SqlTriggerListResult(_serialization.Model): - """The List operation response, that contains the triggers and their properties. - +class SqlStoredProcedureListResult(_serialization.Model): + """The List operation response, that contains the storedProcedures and their properties. + Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of triggers and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlTriggerGetResults] + :ivar value: List of storedProcedures and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetResults] """ _validation = { @@ -15383,7 +12219,7 @@ class SqlTriggerListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[SqlTriggerGetResults]"}, + "value": {"key": "value", "type": "[SqlStoredProcedureGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -15392,8 +12228,8 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): # pylint: disable=name-too-long - """Parameters to create and update Cosmos DB userDefinedFunction. +class SqlTriggerCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB trigger. Variables are only populated by the server, and will be ignored when sending a request. @@ -15414,10 +12250,8 @@ class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): # py 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: The standard JSON format of a userDefinedFunction. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource + :ivar resource: The standard JSON format of a trigger. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions @@ -15436,18 +12270,16 @@ class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): # py "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": "SqlUserDefinedFunctionResource"}, + "resource": {"key": "properties.resource", "type": "SqlTriggerResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, - resource: "_models.SqlUserDefinedFunctionResource", + resource: "_models.SqlTriggerResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -15461,28 +12293,31 @@ def __init__( 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: The standard JSON format of a userDefinedFunction. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource + :keyword resource: The standard JSON format of a trigger. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options -class SqlUserDefinedFunctionResource(_serialization.Model): - """Cosmos DB SQL userDefinedFunction resource object. +class SqlTriggerResource(_serialization.Model): + """Cosmos DB SQL trigger resource object. All required parameters must be populated in order to send to server. - :ivar id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :ivar id: Name of the Cosmos DB SQL trigger. Required. :vartype id: str - :ivar body: Body of the User Defined Function. + :ivar body: Body of the Trigger. :vartype body: str + :ivar trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". + :vartype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType + :ivar trigger_operation: The operation the trigger is associated with. Known values are: "All", + "Create", "Update", "Delete", and "Replace". + :vartype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ _validation = { @@ -15492,26 +12327,39 @@ class SqlUserDefinedFunctionResource(_serialization.Model): _attribute_map = { "id": {"key": "id", "type": "str"}, "body": {"key": "body", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "trigger_operation": {"key": "triggerOperation", "type": "str"}, } def __init__( - self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin + self, + *, + id: str, # pylint: disable=redefined-builtin + body: Optional[str] = None, + trigger_type: Optional[Union[str, "_models.TriggerType"]] = None, + trigger_operation: Optional[Union[str, "_models.TriggerOperation"]] = None, + **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :keyword id: Name of the Cosmos DB SQL trigger. Required. :paramtype id: str - :keyword body: Body of the User Defined Function. + :keyword body: Body of the Trigger. :paramtype body: str + :keyword trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". + :paramtype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType + :keyword trigger_operation: The operation the trigger is associated with. Known values are: + "All", "Create", "Update", "Delete", and "Replace". + :paramtype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ super().__init__(**kwargs) self.id = id self.body = body + self.trigger_type = trigger_type + self.trigger_operation = trigger_operation -class SqlUserDefinedFunctionGetPropertiesResource( - SqlUserDefinedFunctionResource, ExtendedResourceProperties -): # pylint: disable=name-too-long - """SqlUserDefinedFunctionGetPropertiesResource. +class SqlTriggerGetPropertiesResource(SqlTriggerResource, ExtendedResourceProperties): + """SqlTriggerGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. @@ -15524,10 +12372,15 @@ class SqlUserDefinedFunctionGetPropertiesResource( :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :ivar id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :ivar id: Name of the Cosmos DB SQL trigger. Required. :vartype id: str - :ivar body: Body of the User Defined Function. + :ivar body: Body of the Trigger. :vartype body: str + :ivar trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". + :vartype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType + :ivar trigger_operation: The operation the trigger is associated with. Known values are: "All", + "Create", "Update", "Delete", and "Replace". + :vartype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ _validation = { @@ -15543,27 +12396,42 @@ class SqlUserDefinedFunctionGetPropertiesResource( "etag": {"key": "_etag", "type": "str"}, "id": {"key": "id", "type": "str"}, "body": {"key": "body", "type": "str"}, + "trigger_type": {"key": "triggerType", "type": "str"}, + "trigger_operation": {"key": "triggerOperation", "type": "str"}, } def __init__( - self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin + self, + *, + id: str, # pylint: disable=redefined-builtin + body: Optional[str] = None, + trigger_type: Optional[Union[str, "_models.TriggerType"]] = None, + trigger_operation: Optional[Union[str, "_models.TriggerOperation"]] = None, + **kwargs: Any ) -> None: """ - :keyword id: Name of the Cosmos DB SQL userDefinedFunction. Required. + :keyword id: Name of the Cosmos DB SQL trigger. Required. :paramtype id: str - :keyword body: Body of the User Defined Function. + :keyword body: Body of the Trigger. :paramtype body: str + :keyword trigger_type: Type of the Trigger. Known values are: "Pre" and "Post". + :paramtype trigger_type: str or ~azure.mgmt.cosmosdb.models.TriggerType + :keyword trigger_operation: The operation the trigger is associated with. Known values are: + "All", "Create", "Update", "Delete", and "Replace". + :paramtype trigger_operation: str or ~azure.mgmt.cosmosdb.models.TriggerOperation """ - super().__init__(id=id, body=body, **kwargs) + super().__init__(id=id, body=body, trigger_type=trigger_type, trigger_operation=trigger_operation, **kwargs) self.rid = None self.ts = None self.etag = None self.id = id self.body = body + self.trigger_type = trigger_type + self.trigger_operation = trigger_operation -class SqlUserDefinedFunctionGetResults(ARMResourceProperties): - """An Azure Cosmos DB userDefinedFunction. +class SqlTriggerGetResults(ARMResourceProperties): + """An Azure Cosmos DB trigger. Variables are only populated by the server, and will be ignored when sending a request. @@ -15582,10 +12450,8 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): 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: - :vartype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource """ _validation = { @@ -15600,8 +12466,7 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): "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": "SqlUserDefinedFunctionGetPropertiesResource"}, + "resource": {"key": "properties.resource", "type": "SqlTriggerGetPropertiesResource"}, } def __init__( @@ -15609,8 +12474,7 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.SqlUserDefinedFunctionGetPropertiesResource"] = None, + resource: Optional["_models.SqlTriggerGetPropertiesResource"] = None, **kwargs: Any ) -> None: """ @@ -15623,22 +12487,20 @@ def __init__( 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: - :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource -class SqlUserDefinedFunctionListResult(_serialization.Model): - """The List operation response, that contains the userDefinedFunctions and their properties. +class SqlTriggerListResult(_serialization.Model): + """The List operation response, that contains the triggers and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of userDefinedFunctions and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetResults] + :ivar value: List of triggers and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlTriggerGetResults] """ _validation = { @@ -15646,7 +12508,7 @@ class SqlUserDefinedFunctionListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[SqlUserDefinedFunctionGetResults]"}, + "value": {"key": "value", "type": "[SqlTriggerGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -15655,72 +12517,8 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class SystemData(_serialization.Model): - """Metadata pertaining to creation and last modification of the resource. - - :ivar created_by: The identity that created the resource. - :vartype created_by: str - :ivar created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :vartype created_by_type: str or ~azure.mgmt.cosmosdb.models.CreatedByType - :ivar created_at: The timestamp of resource creation (UTC). - :vartype created_at: ~datetime.datetime - :ivar last_modified_by: The identity that last modified the resource. - :vartype last_modified_by: str - :ivar last_modified_by_type: The type of identity that last modified the resource. Known values - are: "User", "Application", "ManagedIdentity", and "Key". - :vartype last_modified_by_type: str or ~azure.mgmt.cosmosdb.models.CreatedByType - :ivar last_modified_at: The timestamp of resource last modification (UTC). - :vartype last_modified_at: ~datetime.datetime - """ - - _attribute_map = { - "created_by": {"key": "createdBy", "type": "str"}, - "created_by_type": {"key": "createdByType", "type": "str"}, - "created_at": {"key": "createdAt", "type": "iso-8601"}, - "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, - "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, - "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, - } - - def __init__( - self, - *, - created_by: Optional[str] = None, - created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - created_at: Optional[datetime.datetime] = None, - last_modified_by: Optional[str] = None, - last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, - last_modified_at: Optional[datetime.datetime] = None, - **kwargs: Any - ) -> None: - """ - :keyword created_by: The identity that created the resource. - :paramtype created_by: str - :keyword created_by_type: The type of identity that created the resource. Known values are: - "User", "Application", "ManagedIdentity", and "Key". - :paramtype created_by_type: str or ~azure.mgmt.cosmosdb.models.CreatedByType - :keyword created_at: The timestamp of resource creation (UTC). - :paramtype created_at: ~datetime.datetime - :keyword last_modified_by: The identity that last modified the resource. - :paramtype last_modified_by: str - :keyword last_modified_by_type: The type of identity that last modified the resource. Known - values are: "User", "Application", "ManagedIdentity", and "Key". - :paramtype last_modified_by_type: str or ~azure.mgmt.cosmosdb.models.CreatedByType - :keyword last_modified_at: The timestamp of resource last modification (UTC). - :paramtype last_modified_at: ~datetime.datetime - """ - super().__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - -class TableCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB Table. +class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): # pylint: disable=name-too-long + """Parameters to create and update Cosmos DB userDefinedFunction. Variables are only populated by the server, and will be ignored when sending a request. @@ -15741,10 +12539,8 @@ class TableCreateUpdateParameters(ARMResourceProperties): 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: The standard JSON format of a Table. Required. - :vartype resource: ~azure.mgmt.cosmosdb.models.TableResource + :ivar resource: The standard JSON format of a userDefinedFunction. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource :ivar options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions @@ -15763,18 +12559,16 @@ class TableCreateUpdateParameters(ARMResourceProperties): "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": "TableResource"}, + "resource": {"key": "properties.resource", "type": "SqlUserDefinedFunctionResource"}, "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, - resource: "_models.TableResource", + resource: "_models.SqlUserDefinedFunctionResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: @@ -15788,42 +12582,26 @@ def __init__( 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: The standard JSON format of a Table. Required. - :paramtype resource: ~azure.mgmt.cosmosdb.models.TableResource + :keyword resource: The standard JSON format of a userDefinedFunction. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource :keyword options: A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options -class TableGetPropertiesOptions(OptionsResource): - """TableGetPropertiesOptions. - - :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the - ThroughputSetting resource when retrieving offer details. - :vartype throughput: int - :ivar autoscale_settings: Specifies the Autoscale settings. - :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings - """ - - -class TableResource(_serialization.Model): - """Cosmos DB table resource object. +class SqlUserDefinedFunctionResource(_serialization.Model): + """Cosmos DB SQL userDefinedFunction resource object. All required parameters must be populated in order to send to server. - :ivar id: Name of the Cosmos DB table. Required. + :ivar id: Name of the Cosmos DB SQL userDefinedFunction. Required. :vartype id: str - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar body: Body of the User Defined Function. + :vartype body: str """ _validation = { @@ -15832,35 +12610,27 @@ class TableResource(_serialization.Model): _attribute_map = { "id": {"key": "id", "type": "str"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "body": {"key": "body", "type": "str"}, } def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs: Any + self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin ) -> None: """ - :keyword id: Name of the Cosmos DB table. Required. + :keyword id: Name of the Cosmos DB SQL userDefinedFunction. Required. :paramtype id: str - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword body: Body of the User Defined Function. + :paramtype body: str """ super().__init__(**kwargs) self.id = id - self.restore_parameters = restore_parameters - self.create_mode = create_mode + self.body = body -class TableGetPropertiesResource(TableResource, ExtendedResourceProperties): - """TableGetPropertiesResource. +class SqlUserDefinedFunctionGetPropertiesResource( + SqlUserDefinedFunctionResource, ExtendedResourceProperties +): # pylint: disable=name-too-long + """SqlUserDefinedFunctionGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. @@ -15873,13 +12643,10 @@ class TableGetPropertiesResource(TableResource, ExtendedResourceProperties): :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :ivar id: Name of the Cosmos DB table. Required. + :ivar id: Name of the Cosmos DB SQL userDefinedFunction. Required. :vartype id: str - :ivar restore_parameters: Parameters to indicate the information about the restore. - :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" - and "Restore". - :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :ivar body: Body of the User Defined Function. + :vartype body: str """ _validation = { @@ -15894,38 +12661,28 @@ class TableGetPropertiesResource(TableResource, ExtendedResourceProperties): "ts": {"key": "_ts", "type": "float"}, "etag": {"key": "_etag", "type": "str"}, "id": {"key": "id", "type": "str"}, - "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, - "create_mode": {"key": "createMode", "type": "str"}, + "body": {"key": "body", "type": "str"}, } def __init__( - self, - *, - id: str, # pylint: disable=redefined-builtin - restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, - create_mode: Union[str, "_models.CreateMode"] = "Default", - **kwargs: Any + self, *, id: str, body: Optional[str] = None, **kwargs: Any # pylint: disable=redefined-builtin ) -> None: """ - :keyword id: Name of the Cosmos DB table. Required. + :keyword id: Name of the Cosmos DB SQL userDefinedFunction. Required. :paramtype id: str - :keyword restore_parameters: Parameters to indicate the information about the restore. - :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters - :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: - "Default" and "Restore". - :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :keyword body: Body of the User Defined Function. + :paramtype body: str """ - super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) + super().__init__(id=id, body=body, **kwargs) self.rid = None self.ts = None self.etag = None self.id = id - self.restore_parameters = restore_parameters - self.create_mode = create_mode + self.body = body -class TableGetResults(ARMResourceProperties): - """An Azure Cosmos DB Table. +class SqlUserDefinedFunctionGetResults(ARMResourceProperties): + """An Azure Cosmos DB userDefinedFunction. Variables are only populated by the server, and will be ignored when sending a request. @@ -15944,12 +12701,8 @@ class TableGetResults(ARMResourceProperties): 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: - :vartype resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource - :ivar options: - :vartype options: ~azure.mgmt.cosmosdb.models.TableGetPropertiesOptions + :vartype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource """ _validation = { @@ -15964,9 +12717,7 @@ class TableGetResults(ARMResourceProperties): "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": "TableGetPropertiesResource"}, - "options": {"key": "properties.options", "type": "TableGetPropertiesOptions"}, + "resource": {"key": "properties.resource", "type": "SqlUserDefinedFunctionGetPropertiesResource"}, } def __init__( @@ -15974,9 +12725,7 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, - resource: Optional["_models.TableGetPropertiesResource"] = None, - options: Optional["_models.TableGetPropertiesOptions"] = None, + resource: Optional["_models.SqlUserDefinedFunctionGetPropertiesResource"] = None, **kwargs: Any ) -> None: """ @@ -15989,25 +12738,20 @@ def __init__( 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: - :paramtype resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource - :keyword options: - :paramtype options: ~azure.mgmt.cosmosdb.models.TableGetPropertiesOptions + :paramtype resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource - self.options = options -class TableListResult(_serialization.Model): - """The List operation response, that contains the Table and their properties. +class SqlUserDefinedFunctionListResult(_serialization.Model): + """The List operation response, that contains the userDefinedFunctions and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of Table and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.TableGetResults] + :ivar value: List of userDefinedFunctions and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetResults] """ _validation = { @@ -16015,7 +12759,7 @@ class TableListResult(_serialization.Model): } _attribute_map = { - "value": {"key": "value", "type": "[TableGetResults]"}, + "value": {"key": "value", "type": "[SqlUserDefinedFunctionGetResults]"}, } def __init__(self, **kwargs: Any) -> None: @@ -16024,39 +12768,85 @@ def __init__(self, **kwargs: Any) -> None: self.value = None -class ThroughputPolicyResource(_serialization.Model): - """Cosmos DB resource throughput policy. +class SystemData(_serialization.Model): + """Metadata pertaining to creation and last modification of the resource. - :ivar is_enabled: Determines whether the ThroughputPolicy is active or not. - :vartype is_enabled: bool - :ivar increment_percent: Represents the percentage by which throughput can increase every time - throughput policy kicks in. - :vartype increment_percent: int + :ivar created_by: The identity that created the resource. + :vartype created_by: str + :ivar created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :vartype created_by_type: str or ~azure.mgmt.cosmosdb.models.CreatedByType + :ivar created_at: The timestamp of resource creation (UTC). + :vartype created_at: ~datetime.datetime + :ivar last_modified_by: The identity that last modified the resource. + :vartype last_modified_by: str + :ivar last_modified_by_type: The type of identity that last modified the resource. Known values + are: "User", "Application", "ManagedIdentity", and "Key". + :vartype last_modified_by_type: str or ~azure.mgmt.cosmosdb.models.CreatedByType + :ivar last_modified_at: The timestamp of resource last modification (UTC). + :vartype last_modified_at: ~datetime.datetime """ _attribute_map = { - "is_enabled": {"key": "isEnabled", "type": "bool"}, - "increment_percent": {"key": "incrementPercent", "type": "int"}, + "created_by": {"key": "createdBy", "type": "str"}, + "created_by_type": {"key": "createdByType", "type": "str"}, + "created_at": {"key": "createdAt", "type": "iso-8601"}, + "last_modified_by": {"key": "lastModifiedBy", "type": "str"}, + "last_modified_by_type": {"key": "lastModifiedByType", "type": "str"}, + "last_modified_at": {"key": "lastModifiedAt", "type": "iso-8601"}, } def __init__( - self, *, is_enabled: Optional[bool] = None, increment_percent: Optional[int] = None, **kwargs: Any + self, + *, + created_by: Optional[str] = None, + created_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + created_at: Optional[datetime.datetime] = None, + last_modified_by: Optional[str] = None, + last_modified_by_type: Optional[Union[str, "_models.CreatedByType"]] = None, + last_modified_at: Optional[datetime.datetime] = None, + **kwargs: Any ) -> None: """ - :keyword is_enabled: Determines whether the ThroughputPolicy is active or not. - :paramtype is_enabled: bool - :keyword increment_percent: Represents the percentage by which throughput can increase every - time throughput policy kicks in. - :paramtype increment_percent: int + :keyword created_by: The identity that created the resource. + :paramtype created_by: str + :keyword created_by_type: The type of identity that created the resource. Known values are: + "User", "Application", "ManagedIdentity", and "Key". + :paramtype created_by_type: str or ~azure.mgmt.cosmosdb.models.CreatedByType + :keyword created_at: The timestamp of resource creation (UTC). + :paramtype created_at: ~datetime.datetime + :keyword last_modified_by: The identity that last modified the resource. + :paramtype last_modified_by: str + :keyword last_modified_by_type: The type of identity that last modified the resource. Known + values are: "User", "Application", "ManagedIdentity", and "Key". + :paramtype last_modified_by_type: str or ~azure.mgmt.cosmosdb.models.CreatedByType + :keyword last_modified_at: The timestamp of resource last modification (UTC). + :paramtype last_modified_at: ~datetime.datetime """ super().__init__(**kwargs) - self.is_enabled = is_enabled - self.increment_percent = increment_percent + self.created_by = created_by + self.created_by_type = created_by_type + self.created_at = created_at + self.last_modified_by = last_modified_by + self.last_modified_by_type = last_modified_by_type + self.last_modified_at = last_modified_at + + +class TableCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB Table. + Variables are only populated by the server, and will be ignored when sending a request. -class ThroughputPoolAccountCreateParameters(_serialization.Model): - """Parameters for creating a Azure Cosmos DB throughput pool account. + All required parameters must be populated in order to send to server. + :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: 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 @@ -16064,28 +12854,42 @@ class ThroughputPoolAccountCreateParameters(_serialization.Model): with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :vartype tags: dict[str, str] - :ivar account_resource_identifier: The resource identifier of global database account in the - throughputPool. - :vartype account_resource_identifier: str - :ivar account_location: The location of global database account in the throughputPool. - :vartype account_location: str + :ivar resource: The standard JSON format of a Table. Required. + :vartype resource: ~azure.mgmt.cosmosdb.models.TableResource + :ivar options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :vartype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ + _validation = { + "id": {"readonly": True}, + "name": {"readonly": True}, + "type": {"readonly": True}, + "resource": {"required": 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}"}, - "account_resource_identifier": {"key": "properties.accountResourceIdentifier", "type": "str"}, - "account_location": {"key": "properties.accountLocation", "type": "str"}, + "resource": {"key": "properties.resource", "type": "TableResource"}, + "options": {"key": "properties.options", "type": "CreateUpdateOptions"}, } def __init__( self, *, + resource: "_models.TableResource", + location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - account_resource_identifier: Optional[str] = None, - account_location: Optional[str] = None, + options: Optional["_models.CreateUpdateOptions"] = None, **kwargs: Any ) -> None: """ + :keyword location: The location of the resource group to which the resource belongs. + :paramtype location: str :keyword 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 @@ -16093,313 +12897,262 @@ def __init__( with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :paramtype tags: dict[str, str] - :keyword account_resource_identifier: The resource identifier of global database account in the - throughputPool. - :paramtype account_resource_identifier: str - :keyword account_location: The location of global database account in the throughputPool. - :paramtype account_location: str + :keyword resource: The standard JSON format of a Table. Required. + :paramtype resource: ~azure.mgmt.cosmosdb.models.TableResource + :keyword options: A key-value pair of options to be applied for the request. This corresponds + to the headers sent with the request. + :paramtype options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - super().__init__(**kwargs) - self.tags = tags - self.account_resource_identifier = account_resource_identifier - self.account_location = account_location - + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class ThroughputPoolAccountResource(ProxyResource): - """An Azure Cosmos DB Throughputpool Account. - Variables are only populated by the server, and will be ignored when sending a request. +class TableGetPropertiesOptions(OptionsResource): + """TableGetPropertiesOptions. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long - :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - :ivar provisioning_state: A provisioning state of the ThroughputPool Account. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :vartype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :ivar account_resource_identifier: The resource identifier of global database account in the - throughputPool. - :vartype account_resource_identifier: str - :ivar account_location: The location of global database account in the throughputPool. - :vartype account_location: str - :ivar account_instance_id: The instance id of global database account in the throughputPool. - :vartype account_instance_id: str + :ivar throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :vartype throughput: int + :ivar autoscale_settings: Specifies the Autoscale settings. + :vartype autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings """ - _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "account_instance_id": {"readonly": True}, - } - - _attribute_map = { - "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "account_resource_identifier": {"key": "properties.accountResourceIdentifier", "type": "str"}, - "account_location": {"key": "properties.accountLocation", "type": "str"}, - "account_instance_id": {"key": "properties.accountInstanceId", "type": "str"}, - } - - def __init__( - self, - *, - provisioning_state: Optional[Union[str, "_models.Status"]] = None, - account_resource_identifier: Optional[str] = None, - account_location: Optional[str] = None, - **kwargs: Any - ) -> None: - """ - :keyword provisioning_state: A provisioning state of the ThroughputPool Account. Known values - are: "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :paramtype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :keyword account_resource_identifier: The resource identifier of global database account in the - throughputPool. - :paramtype account_resource_identifier: str - :keyword account_location: The location of global database account in the throughputPool. - :paramtype account_location: str - """ - super().__init__(**kwargs) - self.provisioning_state = provisioning_state - self.account_resource_identifier = account_resource_identifier - self.account_location = account_location - self.account_instance_id = None - -class ThroughputPoolAccountsListResult(_serialization.Model): - """The List operation response, that contains the global database accounts and their properties. +class TableResource(_serialization.Model): + """Cosmos DB table resource object. - Variables are only populated by the server, and will be ignored when sending a request. + All required parameters must be populated in order to send to server. - :ivar value: List of global database accounts in a throughput pool and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :ivar next_link: The link used to get the next page of results. - :vartype next_link: str + :ivar id: Name of the Cosmos DB table. Required. + :vartype id: str + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "value": {"readonly": True}, - "next_link": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { - "value": {"key": "value", "type": "[ThroughputPoolAccountResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "id": {"key": "id", "type": "str"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } - def __init__(self, **kwargs: Any) -> None: - """ """ + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + **kwargs: Any + ) -> None: + """ + :keyword id: Name of the Cosmos DB table. Required. + :paramtype id: str + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + """ super().__init__(**kwargs) - self.value = None - self.next_link = None + self.id = id + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class TrackedResource(Resource): - """The resource model definition for an Azure Resource Manager tracked top level resource which - has 'tags' and a 'location'. +class TableGetPropertiesResource(TableResource, ExtendedResourceProperties): + """TableGetPropertiesResource. Variables are only populated by the server, and will be ignored when sending a request. All required parameters must be populated in order to send to server. - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar rid: A system generated property. A unique identifier. + :vartype rid: str + :ivar ts: A system generated property that denotes the last updated timestamp of the resource. + :vartype ts: float + :ivar etag: A system generated property representing the resource etag required for optimistic + concurrency control. + :vartype etag: str + :ivar id: Name of the Cosmos DB table. Required. :vartype id: str - :ivar name: The name of the resource. - :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". - :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. - :vartype location: str + :ivar restore_parameters: Parameters to indicate the information about the restore. + :vartype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :ivar create_mode: Enum to indicate the mode of resource creation. Known values are: "Default" + and "Restore". + :vartype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ _validation = { - "id": {"readonly": True}, - "name": {"readonly": True}, - "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, + "rid": {"readonly": True}, + "ts": {"readonly": True}, + "etag": {"readonly": True}, + "id": {"required": True}, } _attribute_map = { + "rid": {"key": "_rid", "type": "str"}, + "ts": {"key": "_ts", "type": "float"}, + "etag": {"key": "_etag", "type": "str"}, "id": {"key": "id", "type": "str"}, - "name": {"key": "name", "type": "str"}, - "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, - "location": {"key": "location", "type": "str"}, + "restore_parameters": {"key": "restoreParameters", "type": "ResourceRestoreParameters"}, + "create_mode": {"key": "createMode", "type": "str"}, } - def __init__(self, *, location: str, tags: Optional[Dict[str, str]] = None, **kwargs: Any) -> None: + def __init__( + self, + *, + id: str, # pylint: disable=redefined-builtin + restore_parameters: Optional["_models.ResourceRestoreParameters"] = None, + create_mode: Union[str, "_models.CreateMode"] = "Default", + **kwargs: Any + ) -> None: """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. - :paramtype location: str + :keyword id: Name of the Cosmos DB table. Required. + :paramtype id: str + :keyword restore_parameters: Parameters to indicate the information about the restore. + :paramtype restore_parameters: ~azure.mgmt.cosmosdb.models.ResourceRestoreParameters + :keyword create_mode: Enum to indicate the mode of resource creation. Known values are: + "Default" and "Restore". + :paramtype create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode """ - super().__init__(**kwargs) - self.tags = tags - self.location = location + super().__init__(id=id, restore_parameters=restore_parameters, create_mode=create_mode, **kwargs) + self.rid = None + self.ts = None + self.etag = None + self.id = id + self.restore_parameters = restore_parameters + self.create_mode = create_mode -class ThroughputPoolResource(TrackedResource): - """An Azure Cosmos DB Throughputpool. +class TableGetResults(ARMResourceProperties): + """An Azure Cosmos DB Table. Variables are only populated by the server, and will be ignored when sending a request. - All required parameters must be populated in order to send to server. - - :ivar id: Fully qualified resource ID for the resource. E.g. - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName}". # pylint: disable=line-too-long + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :ivar name: The name of the resource. + :ivar name: The name of the ARM resource. :vartype name: str - :ivar type: The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or - "Microsoft.Storage/storageAccounts". + :ivar type: The type of Azure resource. :vartype type: str - :ivar system_data: Azure Resource Manager metadata containing createdBy and modifiedBy - information. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData - :ivar tags: Resource tags. - :vartype tags: dict[str, str] - :ivar location: The geo-location where the resource lives. Required. + :ivar location: The location of the resource group to which the resource belongs. :vartype location: str - :ivar provisioning_state: A provisioning state of the ThroughputPool. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :vartype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :ivar max_throughput: Value for throughput to be shared among CosmosDB resources in the pool. - :vartype max_throughput: int + :ivar 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 resource: + :vartype resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource + :ivar options: + :vartype options: ~azure.mgmt.cosmosdb.models.TableGetPropertiesOptions """ _validation = { "id": {"readonly": True}, "name": {"readonly": True}, "type": {"readonly": True}, - "system_data": {"readonly": True}, - "location": {"required": True}, } _attribute_map = { "id": {"key": "id", "type": "str"}, "name": {"key": "name", "type": "str"}, "type": {"key": "type", "type": "str"}, - "system_data": {"key": "systemData", "type": "SystemData"}, - "tags": {"key": "tags", "type": "{str}"}, "location": {"key": "location", "type": "str"}, - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "max_throughput": {"key": "properties.maxThroughput", "type": "int"}, + "tags": {"key": "tags", "type": "{str}"}, + "resource": {"key": "properties.resource", "type": "TableGetPropertiesResource"}, + "options": {"key": "properties.options", "type": "TableGetPropertiesOptions"}, } def __init__( self, *, - location: str, + location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - provisioning_state: Optional[Union[str, "_models.Status"]] = None, - max_throughput: Optional[int] = None, + resource: Optional["_models.TableGetPropertiesResource"] = None, + options: Optional["_models.TableGetPropertiesOptions"] = None, **kwargs: Any ) -> None: """ - :keyword tags: Resource tags. - :paramtype tags: dict[str, str] - :keyword location: The geo-location where the resource lives. Required. + :keyword location: The location of the resource group to which the resource belongs. :paramtype location: str - :keyword provisioning_state: A provisioning state of the ThroughputPool. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :paramtype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :keyword max_throughput: Value for throughput to be shared among CosmosDB resources in the - pool. - :paramtype max_throughput: int + :keyword 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 resource: + :paramtype resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource + :keyword options: + :paramtype options: ~azure.mgmt.cosmosdb.models.TableGetPropertiesOptions """ - super().__init__(tags=tags, location=location, **kwargs) - self.provisioning_state = provisioning_state - self.max_throughput = max_throughput + super().__init__(location=location, tags=tags, **kwargs) + self.resource = resource + self.options = options -class ThroughputPoolsListResult(_serialization.Model): - """The List operation response, that contains the throughput pools and their properties. +class TableListResult(_serialization.Model): + """The List operation response, that contains the Table and their properties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar value: List of throughput pools and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :ivar next_link: The link used to get the next page of results. - :vartype next_link: str + :ivar value: List of Table and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.TableGetResults] """ _validation = { "value": {"readonly": True}, - "next_link": {"readonly": True}, } _attribute_map = { - "value": {"key": "value", "type": "[ThroughputPoolResource]"}, - "next_link": {"key": "nextLink", "type": "str"}, + "value": {"key": "value", "type": "[TableGetResults]"}, } def __init__(self, **kwargs: Any) -> None: """ """ super().__init__(**kwargs) self.value = None - self.next_link = None -class ThroughputPoolUpdate(_serialization.Model): - """Represents a throughput pool resource for updates. +class ThroughputPolicyResource(_serialization.Model): + """Cosmos DB resource throughput policy. - :ivar provisioning_state: A provisioning state of the ThroughputPool. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :vartype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :ivar max_throughput: Value for throughput to be shared among CosmosDB resources in the pool. - :vartype max_throughput: int + :ivar is_enabled: Determines whether the ThroughputPolicy is active or not. + :vartype is_enabled: bool + :ivar increment_percent: Represents the percentage by which throughput can increase every time + throughput policy kicks in. + :vartype increment_percent: int """ _attribute_map = { - "provisioning_state": {"key": "properties.provisioningState", "type": "str"}, - "max_throughput": {"key": "properties.maxThroughput", "type": "int"}, + "is_enabled": {"key": "isEnabled", "type": "bool"}, + "increment_percent": {"key": "incrementPercent", "type": "int"}, } def __init__( - self, - *, - provisioning_state: Optional[Union[str, "_models.Status"]] = None, - max_throughput: Optional[int] = None, - **kwargs: Any + self, *, is_enabled: Optional[bool] = None, increment_percent: Optional[int] = None, **kwargs: Any ) -> None: """ - :keyword provisioning_state: A provisioning state of the ThroughputPool. Known values are: - "Uninitialized", "Initializing", "InternallyReady", "Online", "Deleting", "Succeeded", - "Failed", "Canceled", and "Updating". - :paramtype provisioning_state: str or ~azure.mgmt.cosmosdb.models.Status - :keyword max_throughput: Value for throughput to be shared among CosmosDB resources in the - pool. - :paramtype max_throughput: int + :keyword is_enabled: Determines whether the ThroughputPolicy is active or not. + :paramtype is_enabled: bool + :keyword increment_percent: Represents the percentage by which throughput can increase every + time throughput policy kicks in. + :paramtype increment_percent: int """ super().__init__(**kwargs) - self.provisioning_state = provisioning_state - self.max_throughput = max_throughput + self.is_enabled = is_enabled + self.increment_percent = increment_percent class ThroughputSettingsResource(_serialization.Model): @@ -16565,8 +13318,6 @@ class ThroughputSettingsGetResults(ARMResourceProperties): 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: :vartype resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetPropertiesResource """ @@ -16583,7 +13334,6 @@ class ThroughputSettingsGetResults(ARMResourceProperties): "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": "ThroughputSettingsGetPropertiesResource"}, } @@ -16592,7 +13342,6 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, resource: Optional["_models.ThroughputSettingsGetPropertiesResource"] = None, **kwargs: Any ) -> None: @@ -16606,12 +13355,10 @@ def __init__( 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: :paramtype resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetPropertiesResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource @@ -16637,8 +13384,6 @@ class ThroughputSettingsUpdateParameters(ARMResourceProperties): 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: The standard JSON format of a resource throughput. Required. :vartype resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsResource """ @@ -16656,7 +13401,6 @@ class ThroughputSettingsUpdateParameters(ARMResourceProperties): "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": "ThroughputSettingsResource"}, } @@ -16666,7 +13410,6 @@ def __init__( resource: "_models.ThroughputSettingsResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, - identity: Optional["_models.ManagedServiceIdentity"] = None, **kwargs: Any ) -> None: """ @@ -16679,12 +13422,10 @@ def __init__( 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: The standard JSON format of a resource throughput. Required. :paramtype resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsResource """ - super().__init__(location=location, tags=tags, identity=identity, **kwargs) + super().__init__(location=location, tags=tags, **kwargs) self.resource = resource @@ -16755,6 +13496,121 @@ def __init__(self, **kwargs: Any) -> None: self.value = None +class VectorEmbedding(_serialization.Model): + """Represents a vector embedding. A vector embedding is used to define a vector field in the + documents. + + All required parameters must be populated in order to send to server. + + :ivar path: The path to the vector field in the document. Required. + :vartype path: str + :ivar data_type: Indicates the data type of vector. Required. Known values are: "float32", + "uint8", and "int8". + :vartype data_type: str or ~azure.mgmt.cosmosdb.models.VectorDataType + :ivar distance_function: The distance function to use for distance calculation in between + vectors. Required. Known values are: "euclidean", "cosine", and "dotproduct". + :vartype distance_function: str or ~azure.mgmt.cosmosdb.models.DistanceFunction + :ivar dimensions: The number of dimensions in the vector. Required. + :vartype dimensions: int + """ + + _validation = { + "path": {"required": True}, + "data_type": {"required": True}, + "distance_function": {"required": True}, + "dimensions": {"required": True}, + } + + _attribute_map = { + "path": {"key": "path", "type": "str"}, + "data_type": {"key": "dataType", "type": "str"}, + "distance_function": {"key": "distanceFunction", "type": "str"}, + "dimensions": {"key": "dimensions", "type": "int"}, + } + + def __init__( + self, + *, + path: str, + data_type: Union[str, "_models.VectorDataType"], + distance_function: Union[str, "_models.DistanceFunction"], + dimensions: int, + **kwargs: Any + ) -> None: + """ + :keyword path: The path to the vector field in the document. Required. + :paramtype path: str + :keyword data_type: Indicates the data type of vector. Required. Known values are: "float32", + "uint8", and "int8". + :paramtype data_type: str or ~azure.mgmt.cosmosdb.models.VectorDataType + :keyword distance_function: The distance function to use for distance calculation in between + vectors. Required. Known values are: "euclidean", "cosine", and "dotproduct". + :paramtype distance_function: str or ~azure.mgmt.cosmosdb.models.DistanceFunction + :keyword dimensions: The number of dimensions in the vector. Required. + :paramtype dimensions: int + """ + super().__init__(**kwargs) + self.path = path + self.data_type = data_type + self.distance_function = distance_function + self.dimensions = dimensions + + +class VectorEmbeddingPolicy(_serialization.Model): + """Cosmos DB Vector Embedding Policy. + + :ivar vector_embeddings: List of vector embeddings. + :vartype vector_embeddings: list[~azure.mgmt.cosmosdb.models.VectorEmbedding] + """ + + _attribute_map = { + "vector_embeddings": {"key": "vectorEmbeddings", "type": "[VectorEmbedding]"}, + } + + def __init__(self, *, vector_embeddings: Optional[List["_models.VectorEmbedding"]] = None, **kwargs: Any) -> None: + """ + :keyword vector_embeddings: List of vector embeddings. + :paramtype vector_embeddings: list[~azure.mgmt.cosmosdb.models.VectorEmbedding] + """ + super().__init__(**kwargs) + self.vector_embeddings = vector_embeddings + + +class VectorIndex(_serialization.Model): + """VectorIndex. + + All required parameters must be populated in order to send to server. + + :ivar path: The path to the vector field in the document. Required. + :vartype path: str + :ivar type: The index type of the vector. Currently, flat, diskANN, and quantizedFlat are + supported. Required. Known values are: "flat", "diskANN", and "quantizedFlat". + :vartype type: str or ~azure.mgmt.cosmosdb.models.VectorIndexType + """ + + _validation = { + "path": {"required": True}, + "type": {"required": True}, + } + + _attribute_map = { + "path": {"key": "path", "type": "str"}, + "type": {"key": "type", "type": "str"}, + } + + def __init__(self, *, path: str, type: Union[str, "_models.VectorIndexType"], **kwargs: Any) -> None: + """ + :keyword path: The path to the vector field in the document. Required. + :paramtype path: str + :keyword type: The index type of the vector. Currently, flat, diskANN, and quantizedFlat are + supported. Required. Known values are: "flat", "diskANN", and "quantizedFlat". + :paramtype type: str or ~azure.mgmt.cosmosdb.models.VectorIndexType + """ + super().__init__(**kwargs) + self.path = path + self.type = type + + class VirtualNetworkRule(_serialization.Model): """Virtual Network ACL Rule object. diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py index a6aff077c84a..0a347515778b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py @@ -19,17 +19,14 @@ from ._collection_partition_operations import CollectionPartitionOperations from ._partition_key_range_id_operations import PartitionKeyRangeIdOperations from ._partition_key_range_id_region_operations import PartitionKeyRangeIdRegionOperations -from ._graph_resources_operations import GraphResourcesOperations from ._sql_resources_operations import SqlResourcesOperations from ._mongo_db_resources_operations import MongoDBResourcesOperations from ._table_resources_operations import TableResourcesOperations from ._cassandra_resources_operations import CassandraResourcesOperations from ._gremlin_resources_operations import GremlinResourcesOperations from ._locations_operations import LocationsOperations -from ._data_transfer_jobs_operations import DataTransferJobsOperations from ._cassandra_clusters_operations import CassandraClustersOperations from ._cassandra_data_centers_operations import CassandraDataCentersOperations -from ._network_security_perimeter_configurations_operations import NetworkSecurityPerimeterConfigurationsOperations from ._notebook_workspaces_operations import NotebookWorkspacesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations @@ -46,11 +43,6 @@ from ._restorable_tables_operations import RestorableTablesOperations from ._restorable_table_resources_operations import RestorableTableResourcesOperations from ._service_operations import ServiceOperations -from ._throughput_pools_operations import ThroughputPoolsOperations -from ._throughput_pool_operations import ThroughputPoolOperations -from ._throughput_pool_accounts_operations import ThroughputPoolAccountsOperations -from ._throughput_pool_account_operations import ThroughputPoolAccountOperations -from ._chaos_fault_operations import ChaosFaultOperations from ._patch import __all__ as _patch_all from ._patch import * # pylint: disable=unused-wildcard-import @@ -70,17 +62,14 @@ "CollectionPartitionOperations", "PartitionKeyRangeIdOperations", "PartitionKeyRangeIdRegionOperations", - "GraphResourcesOperations", "SqlResourcesOperations", "MongoDBResourcesOperations", "TableResourcesOperations", "CassandraResourcesOperations", "GremlinResourcesOperations", "LocationsOperations", - "DataTransferJobsOperations", "CassandraClustersOperations", "CassandraDataCentersOperations", - "NetworkSecurityPerimeterConfigurationsOperations", "NotebookWorkspacesOperations", "PrivateEndpointConnectionsOperations", "PrivateLinkResourcesOperations", @@ -97,11 +86,6 @@ "RestorableTablesOperations", "RestorableTableResourcesOperations", "ServiceOperations", - "ThroughputPoolsOperations", - "ThroughputPoolOperations", - "ThroughputPoolAccountsOperations", - "ThroughputPoolAccountOperations", - "ChaosFaultOperations", ] __all__.extend([p for p in _patch_all if p not in __all__]) _patch_sdk() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py index db4392b3c4f1..c989e6328414 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_clusters_operations.py @@ -48,7 +48,7 @@ def build_list_by_subscription_request(subscription_id: str, **kwargs: Any) -> H _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -74,7 +74,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -104,7 +104,7 @@ def build_get_request(resource_group_name: str, cluster_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -139,7 +139,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -174,7 +174,7 @@ def build_create_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -212,7 +212,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -250,7 +250,7 @@ def build_invoke_command_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -282,200 +282,13 @@ def build_invoke_command_request( return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_invoke_command_async_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommandAsync", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url( - "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_command_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url( - "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_command_async_request( - resource_group_name: str, cluster_name: str, command_id: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands/{commandId}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url( - "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - "commandId": _SERIALIZER.url( - "command_id", command_id, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_backups_request( - resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url( - "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_backup_request( - resource_group_name: str, cluster_name: str, backup_id: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "clusterName": _SERIALIZER.url( - "cluster_name", cluster_name, "str", max_length=100, min_length=1, pattern=r"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$" - ), - "backupId": _SERIALIZER.url("backup_id", backup_id, "str", max_length=15, min_length=1, pattern=r"^[0-9]+$"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - def build_deallocate_request( - resource_group_name: str, - cluster_name: str, - subscription_id: str, - *, - x_ms_force_deallocate: Optional[str] = None, - **kwargs: Any + resource_group_name: str, cluster_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -499,8 +312,6 @@ def build_deallocate_request( _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if x_ms_force_deallocate is not None: - _headers["x-ms-force-deallocate"] = _SERIALIZER.header("x_ms_force_deallocate", x_ms_force_deallocate, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) @@ -512,7 +323,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -547,7 +358,7 @@ def build_status_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -576,7 +387,7 @@ def build_status_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -class CassandraClustersOperations: # pylint: disable=too-many-public-methods +class CassandraClustersOperations: """ .. warning:: **DO NOT** instantiate this class directly. @@ -1484,495 +1295,7 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _invoke_command_async_initial( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CommandPostBody, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "CommandPostBody") - - _request = build_invoke_command_async_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: _models.CommandPostBody, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. Required. - :type body: ~azure.mgmt.cosmosdb.models.CommandPostBody - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either CommandPublicResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either CommandPublicResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_invoke_command_async( - self, - resource_group_name: str, - cluster_name: str, - body: Union[_models.CommandPostBody, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CommandPublicResource]: - """Invoke a command like nodetool for cassandra maintenance asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param body: Specification which command to run where. Is either a CommandPostBody type or a - IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.CommandPostBody or IO[bytes] - :return: An instance of LROPoller that returns either CommandPublicResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CommandPublicResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._invoke_command_async_initial( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CommandPublicResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CommandPublicResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CommandPublicResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_command( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> Iterable["_models.CommandPublicResource"]: - """List all commands currently running on ring info. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :return: An iterator like instance of either CommandPublicResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.CommandPublicResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ListCommands] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_command_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListCommands", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_command_async( - self, resource_group_name: str, cluster_name: str, command_id: str, **kwargs: Any - ) -> _models.ListCommands: - """Get details about a specified command that was run asynchronously. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param command_id: Managed Cassandra cluster command id. Required. - :type command_id: str - :return: ListCommands or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ListCommands - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ListCommands] = kwargs.pop("cls", None) - - _request = build_get_command_async_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - command_id=command_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ListCommands", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_backups( - self, resource_group_name: str, cluster_name: str, **kwargs: Any - ) -> Iterable["_models.BackupResource"]: - """List the backups of this cluster that are available to restore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :return: An iterator like instance of either BackupResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.BackupResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ListBackups] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_backups_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ListBackups", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_backup( - self, resource_group_name: str, cluster_name: str, backup_id: str, **kwargs: Any - ) -> _models.BackupResource: - """Get the properties of an individual backup of this cluster that is available to restore. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param cluster_name: Managed Cassandra cluster name. Required. - :type cluster_name: str - :param backup_id: Id of a restorable backup of a Cassandra cluster. Required. - :type backup_id: str - :return: BackupResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.BackupResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.BackupResource] = kwargs.pop("cls", None) - - _request = build_get_backup_request( - resource_group_name=resource_group_name, - cluster_name=cluster_name, - backup_id=backup_id, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("BackupResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _deallocate_initial( - self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[str] = None, **kwargs: Any - ) -> Iterator[bytes]: + def _deallocate_initial(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -1991,7 +1314,6 @@ def _deallocate_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, subscription_id=self._config.subscription_id, - x_ms_force_deallocate=x_ms_force_deallocate, api_version=api_version, headers=_headers, params=_params, @@ -2022,9 +1344,7 @@ def _deallocate_initial( return deserialized # type: ignore @distributed_trace - def begin_deallocate( - self, resource_group_name: str, cluster_name: str, x_ms_force_deallocate: Optional[str] = None, **kwargs: Any - ) -> LROPoller[None]: + def begin_deallocate(self, resource_group_name: str, cluster_name: str, **kwargs: Any) -> LROPoller[None]: """Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated cluster. Use Start to restart the cluster. @@ -2034,10 +1354,6 @@ def begin_deallocate( :type resource_group_name: str :param cluster_name: Managed Cassandra cluster name. Required. :type cluster_name: str - :param x_ms_force_deallocate: Force to deallocate a cluster of Cluster Type Production. Force - to deallocate a cluster of Cluster Type Production might cause data loss. Default value is - None. - :type x_ms_force_deallocate: str :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2054,7 +1370,6 @@ def begin_deallocate( raw_result = self._deallocate_initial( resource_group_name=resource_group_name, cluster_name=cluster_name, - x_ms_force_deallocate=x_ms_force_deallocate, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py index c5ebd825dfda..31d793a37ec9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_data_centers_operations.py @@ -48,7 +48,7 @@ def build_list_request(resource_group_name: str, cluster_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -126,7 +126,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -169,7 +169,7 @@ def build_create_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -215,7 +215,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py index 8cb21dd3b538..de5657308272 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cassandra_resources_operations.py @@ -50,7 +50,7 @@ def build_list_cassandra_keyspaces_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_cassandra_keyspace_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_create_update_cassandra_keyspace_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -159,7 +159,7 @@ def build_delete_cassandra_keyspace_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", @@ -190,7 +190,7 @@ def build_get_cassandra_keyspace_throughput_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +226,7 @@ def build_update_cassandra_keyspace_throughput_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -265,7 +265,7 @@ def build_migrate_cassandra_keyspace_to_autoscale_request( # pylint: disable=na _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -301,7 +301,7 @@ def build_migrate_cassandra_keyspace_to_manual_throughput_request( # pylint: di _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -337,7 +337,7 @@ def build_list_cassandra_tables_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -378,7 +378,7 @@ def build_get_cassandra_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -420,7 +420,7 @@ def build_create_update_cassandra_table_request( # pylint: disable=name-too-lon _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -464,7 +464,7 @@ def build_delete_cassandra_table_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", @@ -501,7 +501,7 @@ def build_get_cassandra_table_throughput_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -543,7 +543,7 @@ def build_update_cassandra_table_throughput_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -588,7 +588,7 @@ def build_migrate_cassandra_table_to_autoscale_request( # pylint: disable=name- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -630,7 +630,7 @@ def build_migrate_cassandra_table_to_manual_throughput_request( # pylint: disab _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -661,1341 +661,46 @@ def build_migrate_cassandra_table_to_manual_throughput_request( # pylint: disab return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_cassandra_views_request( - resource_group_name: str, account_name: str, keyspace_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_cassandra_view_request( - resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_update_cassandra_view_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_cassandra_view_request( - resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_get_cassandra_view_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_cassandra_view_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_migrate_cassandra_view_to_autoscale_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_migrate_cassandra_view_to_manual_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "keyspaceName": _SERIALIZER.url("keyspace_name", keyspace_name, "str"), - "viewName": _SERIALIZER.url("view_name", view_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class CassandraResourcesOperations: # pylint: disable=too-many-public-methods - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`cassandra_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_cassandra_keyspaces( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> Iterable["_models.CassandraKeyspaceGetResults"]: - """Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either CassandraKeyspaceGetResults or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CassandraKeyspaceListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_cassandra_keyspaces_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("CassandraKeyspaceListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_cassandra_keyspace( - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> _models.CassandraKeyspaceGetResults: - """Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the - provided name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :return: CassandraKeyspaceGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) - - _request = build_get_cassandra_keyspace_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("CassandraKeyspaceGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_update_cassandra_keyspace_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - create_update_cassandra_keyspace_parameters: Union[_models.CassandraKeyspaceCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_cassandra_keyspace_parameters, (IOBase, bytes)): - _content = create_update_cassandra_keyspace_parameters - else: - _json = self._serialize.body( - create_update_cassandra_keyspace_parameters, "CassandraKeyspaceCreateUpdateParameters" - ) - - _request = build_create_update_cassandra_keyspace_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_update_cassandra_keyspace( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - create_update_cassandra_keyspace_parameters: _models.CassandraKeyspaceCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CassandraKeyspaceGetResults]: - """Create or update an Azure Cosmos DB Cassandra keyspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param create_update_cassandra_keyspace_parameters: The parameters to provide for the current - Cassandra keyspace. Required. - :type create_update_cassandra_keyspace_parameters: - ~azure.mgmt.cosmosdb.models.CassandraKeyspaceCreateUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either CassandraKeyspaceGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_update_cassandra_keyspace( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - create_update_cassandra_keyspace_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.CassandraKeyspaceGetResults]: - """Create or update an Azure Cosmos DB Cassandra keyspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param create_update_cassandra_keyspace_parameters: The parameters to provide for the current - Cassandra keyspace. Required. - :type create_update_cassandra_keyspace_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either CassandraKeyspaceGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_update_cassandra_keyspace( - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - create_update_cassandra_keyspace_parameters: Union[_models.CassandraKeyspaceCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.CassandraKeyspaceGetResults]: - """Create or update an Azure Cosmos DB Cassandra keyspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param create_update_cassandra_keyspace_parameters: The parameters to provide for the current - Cassandra keyspace. Is either a CassandraKeyspaceCreateUpdateParameters type or a IO[bytes] - type. Required. - :type create_update_cassandra_keyspace_parameters: - ~azure.mgmt.cosmosdb.models.CassandraKeyspaceCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either CassandraKeyspaceGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_update_cassandra_keyspace_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - create_update_cassandra_keyspace_parameters=create_update_cassandra_keyspace_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CassandraKeyspaceGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.CassandraKeyspaceGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.CassandraKeyspaceGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_cassandra_keyspace_initial( - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_cassandra_keyspace_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_cassandra_keyspace( - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB Cassandra keyspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_cassandra_keyspace_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - @distributed_trace - def get_cassandra_keyspace_throughput( - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> _models.ThroughputSettingsGetResults: - """Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database - account with the provided name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :return: ThroughputSettingsGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - - _request = build_get_cassandra_keyspace_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _update_cassandra_keyspace_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_throughput_parameters, (IOBase, bytes)): - _content = update_throughput_parameters - else: - _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - - _request = build_update_cassandra_keyspace_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update_cassandra_keyspace_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra Keyspace. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update_cassandra_keyspace_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - update_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra Keyspace. Required. - :type update_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update_cassandra_keyspace_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - keyspace_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra Keyspace. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] - type. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_cassandra_keyspace_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - update_throughput_parameters=update_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _migrate_cassandra_keyspace_to_autoscale_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_cassandra_keyspace_to_autoscale_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_migrate_cassandra_keyspace_to_autoscale( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._migrate_cassandra_keyspace_to_autoscale_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _migrate_cassandra_keyspace_to_manual_throughput_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_migrate_cassandra_keyspace_to_manual_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_migrate_cassandra_keyspace_to_manual_throughput( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) +class CassandraResourcesOperations: # pylint: disable=too-many-public-methods + """ + .. warning:: + **DO NOT** instantiate this class directly. - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._migrate_cassandra_keyspace_to_manual_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - keyspace_name=keyspace_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) + Instead, you should access the following operations through + :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s + :attr:`cassandra_resources` attribute. + """ - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + models = _models - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + def __init__(self, *args, **kwargs): + input_args = list(args) + self._client = input_args.pop(0) if input_args else kwargs.pop("client") + self._config = input_args.pop(0) if input_args else kwargs.pop("config") + self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") + self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") @distributed_trace - def list_cassandra_tables( - self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> Iterable["_models.CassandraTableGetResults"]: - """Lists the Cassandra table under an existing Azure Cosmos DB database account. + def list_cassandra_keyspaces( + self, resource_group_name: str, account_name: str, **kwargs: Any + ) -> Iterable["_models.CassandraKeyspaceGetResults"]: + """Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. :type resource_group_name: str :param account_name: Cosmos DB database account name. Required. :type account_name: str - :param keyspace_name: Cosmos DB keyspace name. Required. - :type keyspace_name: str - :return: An iterator like instance of either CassandraTableGetResults or the result of + :return: An iterator like instance of either CassandraKeyspaceGetResults or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.CassandraTableGetResults] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CassandraTableListResult] = kwargs.pop("cls", None) + cls: ClsType[_models.CassandraKeyspaceListResult] = kwargs.pop("cls", None) error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -2008,10 +713,9 @@ def list_cassandra_tables( def prepare_request(next_link=None): if not next_link: - _request = build_list_cassandra_tables_request( + _request = build_list_cassandra_keyspaces_request( resource_group_name=resource_group_name, account_name=account_name, - keyspace_name=keyspace_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -2037,7 +741,7 @@ def prepare_request(next_link=None): return _request def extract_data(pipeline_response): - deserialized = self._deserialize("CassandraTableListResult", pipeline_response) + deserialized = self._deserialize("CassandraKeyspaceListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -2061,10 +765,11 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_cassandra_table( - self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any - ) -> _models.CassandraTableGetResults: - """Gets the Cassandra table under an existing Azure Cosmos DB database account. + def get_cassandra_keyspace( + self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any + ) -> _models.CassandraKeyspaceGetResults: + """Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the + provided name. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2073,10 +778,8 @@ def get_cassandra_table( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param table_name: Cosmos DB table name. Required. - :type table_name: str - :return: CassandraTableGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.CassandraTableGetResults + :return: CassandraKeyspaceGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -2091,13 +794,12 @@ def get_cassandra_table( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) - _request = build_get_cassandra_table_request( + _request = build_get_cassandra_keyspace_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -2116,20 +818,19 @@ def get_cassandra_table( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("CassandraTableGetResults", pipeline_response.http_response) + deserialized = self._deserialize("CassandraKeyspaceGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_update_cassandra_table_initial( + def _create_update_cassandra_keyspace_initial( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, keyspace_name: str, - table_name: str, - create_update_cassandra_table_parameters: Union[_models.CassandraTableCreateUpdateParameters, IO[bytes]], + create_update_cassandra_keyspace_parameters: Union[_models.CassandraKeyspaceCreateUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -2150,18 +851,17 @@ def _create_update_cassandra_table_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(create_update_cassandra_table_parameters, (IOBase, bytes)): - _content = create_update_cassandra_table_parameters + if isinstance(create_update_cassandra_keyspace_parameters, (IOBase, bytes)): + _content = create_update_cassandra_keyspace_parameters else: _json = self._serialize.body( - create_update_cassandra_table_parameters, "CassandraTableCreateUpdateParameters" + create_update_cassandra_keyspace_parameters, "CassandraKeyspaceCreateUpdateParameters" ) - _request = build_create_update_cassandra_table_request( + _request = build_create_update_cassandra_keyspace_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -2203,18 +903,17 @@ def _create_update_cassandra_table_initial( return deserialized # type: ignore @overload - def begin_create_update_cassandra_table( + def begin_create_update_cassandra_keyspace( self, resource_group_name: str, account_name: str, keyspace_name: str, - table_name: str, - create_update_cassandra_table_parameters: _models.CassandraTableCreateUpdateParameters, + create_update_cassandra_keyspace_parameters: _models.CassandraKeyspaceCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CassandraTableGetResults]: - """Create or update an Azure Cosmos DB Cassandra Table. + ) -> LROPoller[_models.CassandraKeyspaceGetResults]: + """Create or update an Azure Cosmos DB Cassandra keyspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2223,34 +922,31 @@ def begin_create_update_cassandra_table( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param table_name: Cosmos DB table name. Required. - :type table_name: str - :param create_update_cassandra_table_parameters: The parameters to provide for the current - Cassandra Table. Required. - :type create_update_cassandra_table_parameters: - ~azure.mgmt.cosmosdb.models.CassandraTableCreateUpdateParameters + :param create_update_cassandra_keyspace_parameters: The parameters to provide for the current + Cassandra keyspace. Required. + :type create_update_cassandra_keyspace_parameters: + ~azure.mgmt.cosmosdb.models.CassandraKeyspaceCreateUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either CassandraTableGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraTableGetResults] + :return: An instance of LROPoller that returns either CassandraKeyspaceGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_update_cassandra_table( + def begin_create_update_cassandra_keyspace( self, resource_group_name: str, account_name: str, keyspace_name: str, - table_name: str, - create_update_cassandra_table_parameters: IO[bytes], + create_update_cassandra_keyspace_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CassandraTableGetResults]: - """Create or update an Azure Cosmos DB Cassandra Table. + ) -> LROPoller[_models.CassandraKeyspaceGetResults]: + """Create or update an Azure Cosmos DB Cassandra keyspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2259,31 +955,28 @@ def begin_create_update_cassandra_table( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param table_name: Cosmos DB table name. Required. - :type table_name: str - :param create_update_cassandra_table_parameters: The parameters to provide for the current - Cassandra Table. Required. - :type create_update_cassandra_table_parameters: IO[bytes] + :param create_update_cassandra_keyspace_parameters: The parameters to provide for the current + Cassandra keyspace. Required. + :type create_update_cassandra_keyspace_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either CassandraTableGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraTableGetResults] + :return: An instance of LROPoller that returns either CassandraKeyspaceGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_update_cassandra_table( + def begin_create_update_cassandra_keyspace( self, resource_group_name: str, account_name: str, keyspace_name: str, - table_name: str, - create_update_cassandra_table_parameters: Union[_models.CassandraTableCreateUpdateParameters, IO[bytes]], + create_update_cassandra_keyspace_parameters: Union[_models.CassandraKeyspaceCreateUpdateParameters, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.CassandraTableGetResults]: - """Create or update an Azure Cosmos DB Cassandra Table. + ) -> LROPoller[_models.CassandraKeyspaceGetResults]: + """Create or update an Azure Cosmos DB Cassandra keyspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2292,16 +985,14 @@ def begin_create_update_cassandra_table( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param table_name: Cosmos DB table name. Required. - :type table_name: str - :param create_update_cassandra_table_parameters: The parameters to provide for the current - Cassandra Table. Is either a CassandraTableCreateUpdateParameters type or a IO[bytes] type. - Required. - :type create_update_cassandra_table_parameters: - ~azure.mgmt.cosmosdb.models.CassandraTableCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either CassandraTableGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraTableGetResults] + :param create_update_cassandra_keyspace_parameters: The parameters to provide for the current + Cassandra keyspace. Is either a CassandraKeyspaceCreateUpdateParameters type or a IO[bytes] + type. Required. + :type create_update_cassandra_keyspace_parameters: + ~azure.mgmt.cosmosdb.models.CassandraKeyspaceCreateUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns either CassandraKeyspaceGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -2309,17 +1000,16 @@ def begin_create_update_cassandra_table( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.CassandraKeyspaceGetResults] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_cassandra_table_initial( + raw_result = self._create_update_cassandra_keyspace_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, - create_update_cassandra_table_parameters=create_update_cassandra_table_parameters, + create_update_cassandra_keyspace_parameters=create_update_cassandra_keyspace_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -2331,7 +1021,7 @@ def begin_create_update_cassandra_table( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CassandraTableGetResults", pipeline_response.http_response) + deserialized = self._deserialize("CassandraKeyspaceGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -2343,18 +1033,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.CassandraTableGetResults].from_continuation_token( + return LROPoller[_models.CassandraKeyspaceGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.CassandraTableGetResults]( + return LROPoller[_models.CassandraKeyspaceGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_cassandra_table_initial( - self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any + def _delete_cassandra_keyspace_initial( + self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -2370,11 +1060,10 @@ def _delete_cassandra_table_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_delete_cassandra_table_request( + _request = build_delete_cassandra_keyspace_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -2413,10 +1102,10 @@ def _delete_cassandra_table_initial( return deserialized # type: ignore @distributed_trace - def begin_delete_cassandra_table( - self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any + def begin_delete_cassandra_keyspace( + self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB Cassandra table. + """Deletes an existing Azure Cosmos DB Cassandra keyspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2425,8 +1114,6 @@ def begin_delete_cassandra_table( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param table_name: Cosmos DB table name. Required. - :type table_name: str :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -2440,11 +1127,10 @@ def begin_delete_cassandra_table( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_cassandra_table_initial( + raw_result = self._delete_cassandra_keyspace_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -2474,10 +1160,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def get_cassandra_table_throughput( - self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any + def get_cassandra_keyspace_throughput( + self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any ) -> _models.ThroughputSettingsGetResults: - """Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database + """Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the provided name. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -2487,8 +1173,6 @@ def get_cassandra_table_throughput( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param table_name: Cosmos DB table name. Required. - :type table_name: str :return: ThroughputSettingsGetResults or the result of cls(response) :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults :raises ~azure.core.exceptions.HttpResponseError: @@ -2507,11 +1191,10 @@ def get_cassandra_table_throughput( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - _request = build_get_cassandra_table_throughput_request( + _request = build_get_cassandra_keyspace_throughput_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -2537,12 +1220,11 @@ def get_cassandra_table_throughput( return deserialized # type: ignore - def _update_cassandra_table_throughput_initial( # pylint: disable=name-too-long + def _update_cassandra_keyspace_throughput_initial( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, keyspace_name: str, - table_name: str, update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: @@ -2569,11 +1251,10 @@ def _update_cassandra_table_throughput_initial( # pylint: disable=name-too-long else: _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - _request = build_update_cassandra_table_throughput_request( + _request = build_update_cassandra_keyspace_throughput_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -2615,18 +1296,17 @@ def _update_cassandra_table_throughput_initial( # pylint: disable=name-too-long return deserialized # type: ignore @overload - def begin_update_cassandra_table_throughput( + def begin_update_cassandra_keyspace_throughput( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, keyspace_name: str, - table_name: str, update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra table. + """Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2635,10 +1315,8 @@ def begin_update_cassandra_table_throughput( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param table_name: Cosmos DB table name. Required. - :type table_name: str :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra table. Required. + current Cassandra Keyspace. Required. :type update_throughput_parameters: ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -2651,18 +1329,17 @@ def begin_update_cassandra_table_throughput( """ @overload - def begin_update_cassandra_table_throughput( + def begin_update_cassandra_keyspace_throughput( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, keyspace_name: str, - table_name: str, update_throughput_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra table. + """Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2671,10 +1348,8 @@ def begin_update_cassandra_table_throughput( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param table_name: Cosmos DB table name. Required. - :type table_name: str :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra table. Required. + current Cassandra Keyspace. Required. :type update_throughput_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -2686,16 +1361,15 @@ def begin_update_cassandra_table_throughput( """ @distributed_trace - def begin_update_cassandra_table_throughput( + def begin_update_cassandra_keyspace_throughput( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, keyspace_name: str, - table_name: str, update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra table. + """Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2704,10 +1378,8 @@ def begin_update_cassandra_table_throughput( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param table_name: Cosmos DB table name. Required. - :type table_name: str :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra table. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] + current Cassandra Keyspace. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. Required. :type update_throughput_parameters: ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] @@ -2726,11 +1398,10 @@ def begin_update_cassandra_table_throughput( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_cassandra_table_throughput_initial( + raw_result = self._update_cassandra_keyspace_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, update_throughput_parameters=update_throughput_parameters, api_version=api_version, content_type=content_type, @@ -2765,8 +1436,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _migrate_cassandra_table_to_autoscale_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any + def _migrate_cassandra_keyspace_to_autoscale_initial( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -2782,11 +1453,10 @@ def _migrate_cassandra_table_to_autoscale_initial( # pylint: disable=name-too-l api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_migrate_cassandra_table_to_autoscale_request( + _request = build_migrate_cassandra_keyspace_to_autoscale_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -2825,10 +1495,10 @@ def _migrate_cassandra_table_to_autoscale_initial( # pylint: disable=name-too-l return deserialized # type: ignore @distributed_trace - def begin_migrate_cassandra_table_to_autoscale( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any + def begin_migrate_cassandra_keyspace_to_autoscale( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + """Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2837,8 +1507,6 @@ def begin_migrate_cassandra_table_to_autoscale( # pylint: disable=name-too-long :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param table_name: Cosmos DB table name. Required. - :type table_name: str :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] @@ -2853,11 +1521,10 @@ def begin_migrate_cassandra_table_to_autoscale( # pylint: disable=name-too-long lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_table_to_autoscale_initial( + raw_result = self._migrate_cassandra_keyspace_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -2890,8 +1557,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _migrate_cassandra_table_to_manual_throughput_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any + def _migrate_cassandra_keyspace_to_manual_throughput_initial( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -2907,11 +1574,10 @@ def _migrate_cassandra_table_to_manual_throughput_initial( # pylint: disable=na api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_migrate_cassandra_table_to_manual_throughput_request( + _request = build_migrate_cassandra_keyspace_to_manual_throughput_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -2950,10 +1616,10 @@ def _migrate_cassandra_table_to_manual_throughput_initial( # pylint: disable=na return deserialized # type: ignore @distributed_trace - def begin_migrate_cassandra_table_to_manual_throughput( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any + def begin_migrate_cassandra_keyspace_to_manual_throughput( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + """Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2962,8 +1628,6 @@ def begin_migrate_cassandra_table_to_manual_throughput( # pylint: disable=name- :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param table_name: Cosmos DB table name. Required. - :type table_name: str :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] @@ -2978,11 +1642,10 @@ def begin_migrate_cassandra_table_to_manual_throughput( # pylint: disable=name- lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_table_to_manual_throughput_initial( + raw_result = self._migrate_cassandra_keyspace_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - table_name=table_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -3016,10 +1679,10 @@ def get_long_running_output(pipeline_response): ) @distributed_trace - def list_cassandra_views( + def list_cassandra_tables( self, resource_group_name: str, account_name: str, keyspace_name: str, **kwargs: Any - ) -> Iterable["_models.CassandraViewGetResults"]: - """Lists the Cassandra materialized views under an existing Azure Cosmos DB database account. + ) -> Iterable["_models.CassandraTableGetResults"]: + """Lists the Cassandra table under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3028,16 +1691,16 @@ def list_cassandra_views( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :return: An iterator like instance of either CassandraViewGetResults or the result of + :return: An iterator like instance of either CassandraTableGetResults or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.CassandraTableGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CassandraViewListResult] = kwargs.pop("cls", None) + cls: ClsType[_models.CassandraTableListResult] = kwargs.pop("cls", None) error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -3050,7 +1713,7 @@ def list_cassandra_views( def prepare_request(next_link=None): if not next_link: - _request = build_list_cassandra_views_request( + _request = build_list_cassandra_tables_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, @@ -3079,7 +1742,7 @@ def prepare_request(next_link=None): return _request def extract_data(pipeline_response): - deserialized = self._deserialize("CassandraViewListResult", pipeline_response) + deserialized = self._deserialize("CassandraTableListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -3103,10 +1766,10 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_cassandra_view( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any - ) -> _models.CassandraViewGetResults: - """Gets the Cassandra view under an existing Azure Cosmos DB database account. + def get_cassandra_table( + self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any + ) -> _models.CassandraTableGetResults: + """Gets the Cassandra table under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3115,10 +1778,10 @@ def get_cassandra_view( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :return: CassandraViewGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.CassandraViewGetResults + :param table_name: Cosmos DB table name. Required. + :type table_name: str + :return: CassandraTableGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.CassandraTableGetResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -3133,13 +1796,13 @@ def get_cassandra_view( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) - _request = build_get_cassandra_view_request( + _request = build_get_cassandra_table_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, + table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -3158,20 +1821,20 @@ def get_cassandra_view( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("CassandraViewGetResults", pipeline_response.http_response) + deserialized = self._deserialize("CassandraTableGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_update_cassandra_view_initial( + def _create_update_cassandra_table_initial( self, resource_group_name: str, account_name: str, keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: Union[_models.CassandraViewCreateUpdateParameters, IO[bytes]], + table_name: str, + create_update_cassandra_table_parameters: Union[_models.CassandraTableCreateUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -3192,16 +1855,18 @@ def _create_update_cassandra_view_initial( content_type = content_type or "application/json" _json = None _content = None - if isinstance(create_update_cassandra_view_parameters, (IOBase, bytes)): - _content = create_update_cassandra_view_parameters + if isinstance(create_update_cassandra_table_parameters, (IOBase, bytes)): + _content = create_update_cassandra_table_parameters else: - _json = self._serialize.body(create_update_cassandra_view_parameters, "CassandraViewCreateUpdateParameters") + _json = self._serialize.body( + create_update_cassandra_table_parameters, "CassandraTableCreateUpdateParameters" + ) - _request = build_create_update_cassandra_view_request( + _request = build_create_update_cassandra_table_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, + table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -3243,18 +1908,18 @@ def _create_update_cassandra_view_initial( return deserialized # type: ignore @overload - def begin_create_update_cassandra_view( + def begin_create_update_cassandra_table( self, resource_group_name: str, account_name: str, keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: _models.CassandraViewCreateUpdateParameters, + table_name: str, + create_update_cassandra_table_parameters: _models.CassandraTableCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. + ) -> LROPoller[_models.CassandraTableGetResults]: + """Create or update an Azure Cosmos DB Cassandra Table. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3263,34 +1928,34 @@ def begin_create_update_cassandra_view( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Required. - :type create_update_cassandra_view_parameters: - ~azure.mgmt.cosmosdb.models.CassandraViewCreateUpdateParameters + :param table_name: Cosmos DB table name. Required. + :type table_name: str + :param create_update_cassandra_table_parameters: The parameters to provide for the current + Cassandra Table. Required. + :type create_update_cassandra_table_parameters: + ~azure.mgmt.cosmosdb.models.CassandraTableCreateUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either CassandraViewGetResults or the result of + :return: An instance of LROPoller that returns either CassandraTableGetResults or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraTableGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_create_update_cassandra_view( + def begin_create_update_cassandra_table( self, resource_group_name: str, account_name: str, keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: IO[bytes], + table_name: str, + create_update_cassandra_table_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. + ) -> LROPoller[_models.CassandraTableGetResults]: + """Create or update an Azure Cosmos DB Cassandra Table. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3299,31 +1964,31 @@ def begin_create_update_cassandra_view( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Required. - :type create_update_cassandra_view_parameters: IO[bytes] + :param table_name: Cosmos DB table name. Required. + :type table_name: str + :param create_update_cassandra_table_parameters: The parameters to provide for the current + Cassandra Table. Required. + :type create_update_cassandra_table_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either CassandraViewGetResults or the result of + :return: An instance of LROPoller that returns either CassandraTableGetResults or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraTableGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_create_update_cassandra_view( + def begin_create_update_cassandra_table( self, resource_group_name: str, account_name: str, keyspace_name: str, - view_name: str, - create_update_cassandra_view_parameters: Union[_models.CassandraViewCreateUpdateParameters, IO[bytes]], + table_name: str, + create_update_cassandra_table_parameters: Union[_models.CassandraTableCreateUpdateParameters, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.CassandraViewGetResults]: - """Create or update an Azure Cosmos DB Cassandra View. + ) -> LROPoller[_models.CassandraTableGetResults]: + """Create or update an Azure Cosmos DB Cassandra Table. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3332,16 +1997,16 @@ def begin_create_update_cassandra_view( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str - :param create_update_cassandra_view_parameters: The parameters to provide for the current - Cassandra View. Is either a CassandraViewCreateUpdateParameters type or a IO[bytes] type. + :param table_name: Cosmos DB table name. Required. + :type table_name: str + :param create_update_cassandra_table_parameters: The parameters to provide for the current + Cassandra Table. Is either a CassandraTableCreateUpdateParameters type or a IO[bytes] type. Required. - :type create_update_cassandra_view_parameters: - ~azure.mgmt.cosmosdb.models.CassandraViewCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either CassandraViewGetResults or the result of + :type create_update_cassandra_table_parameters: + ~azure.mgmt.cosmosdb.models.CassandraTableCreateUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns either CassandraTableGetResults or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraTableGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3349,17 +2014,17 @@ def begin_create_update_cassandra_view( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.CassandraViewGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.CassandraTableGetResults] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._create_update_cassandra_view_initial( + raw_result = self._create_update_cassandra_table_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, - create_update_cassandra_view_parameters=create_update_cassandra_view_parameters, + table_name=table_name, + create_update_cassandra_table_parameters=create_update_cassandra_table_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3371,7 +2036,7 @@ def begin_create_update_cassandra_view( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("CassandraViewGetResults", pipeline_response.http_response) + deserialized = self._deserialize("CassandraTableGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -3383,18 +2048,18 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.CassandraViewGetResults].from_continuation_token( + return LROPoller[_models.CassandraTableGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.CassandraViewGetResults]( + return LROPoller[_models.CassandraTableGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _delete_cassandra_view_initial( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any + def _delete_cassandra_table_initial( + self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -3410,11 +2075,11 @@ def _delete_cassandra_view_initial( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_delete_cassandra_view_request( + _request = build_delete_cassandra_table_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, + table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -3430,7 +2095,7 @@ def _delete_cassandra_view_initial( response = pipeline_response.http_response - if response.status_code not in [200, 202, 204]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -3453,10 +2118,10 @@ def _delete_cassandra_view_initial( return deserialized # type: ignore @distributed_trace - def begin_delete_cassandra_view( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any + def begin_delete_cassandra_table( + self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB Cassandra view. + """Deletes an existing Azure Cosmos DB Cassandra table. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3465,8 +2130,8 @@ def begin_delete_cassandra_view( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str + :param table_name: Cosmos DB table name. Required. + :type table_name: str :return: An instance of LROPoller that returns either None or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: @@ -3480,11 +2145,11 @@ def begin_delete_cassandra_view( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._delete_cassandra_view_initial( + raw_result = self._delete_cassandra_table_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, + table_name=table_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -3514,10 +2179,10 @@ def get_long_running_output(pipeline_response): # pylint: disable=inconsistent- return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace - def get_cassandra_view_throughput( - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any + def get_cassandra_table_throughput( + self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any ) -> _models.ThroughputSettingsGetResults: - """Gets the RUs per second of the Cassandra view under an existing Azure Cosmos DB database + """Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the provided name. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -3527,8 +2192,8 @@ def get_cassandra_view_throughput( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str + :param table_name: Cosmos DB table name. Required. + :type table_name: str :return: ThroughputSettingsGetResults or the result of cls(response) :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults :raises ~azure.core.exceptions.HttpResponseError: @@ -3547,11 +2212,11 @@ def get_cassandra_view_throughput( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - _request = build_get_cassandra_view_throughput_request( + _request = build_get_cassandra_table_throughput_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, + table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -3577,12 +2242,12 @@ def get_cassandra_view_throughput( return deserialized # type: ignore - def _update_cassandra_view_throughput_initial( # pylint: disable=name-too-long + def _update_cassandra_table_throughput_initial( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, keyspace_name: str, - view_name: str, + table_name: str, update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: @@ -3609,11 +2274,11 @@ def _update_cassandra_view_throughput_initial( # pylint: disable=name-too-long else: _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - _request = build_update_cassandra_view_throughput_request( + _request = build_update_cassandra_table_throughput_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, + table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -3655,18 +2320,18 @@ def _update_cassandra_view_throughput_initial( # pylint: disable=name-too-long return deserialized # type: ignore @overload - def begin_update_cassandra_view_throughput( + def begin_update_cassandra_table_throughput( self, resource_group_name: str, account_name: str, keyspace_name: str, - view_name: str, + table_name: str, update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. + """Update RUs per second of an Azure Cosmos DB Cassandra table. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3675,10 +2340,10 @@ def begin_update_cassandra_view_throughput( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str + :param table_name: Cosmos DB table name. Required. + :type table_name: str :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Required. + current Cassandra table. Required. :type update_throughput_parameters: ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. @@ -3691,18 +2356,18 @@ def begin_update_cassandra_view_throughput( """ @overload - def begin_update_cassandra_view_throughput( + def begin_update_cassandra_table_throughput( self, resource_group_name: str, account_name: str, keyspace_name: str, - view_name: str, + table_name: str, update_throughput_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. + """Update RUs per second of an Azure Cosmos DB Cassandra table. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3711,10 +2376,10 @@ def begin_update_cassandra_view_throughput( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str + :param table_name: Cosmos DB table name. Required. + :type table_name: str :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Required. + current Cassandra table. Required. :type update_throughput_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". @@ -3726,16 +2391,16 @@ def begin_update_cassandra_view_throughput( """ @distributed_trace - def begin_update_cassandra_view_throughput( + def begin_update_cassandra_table_throughput( self, resource_group_name: str, account_name: str, keyspace_name: str, - view_name: str, + table_name: str, update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB Cassandra view. + """Update RUs per second of an Azure Cosmos DB Cassandra table. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3744,10 +2409,10 @@ def begin_update_cassandra_view_throughput( :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str + :param table_name: Cosmos DB table name. Required. + :type table_name: str :param update_throughput_parameters: The RUs per second of the parameters to provide for the - current Cassandra view. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] + current Cassandra table. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. Required. :type update_throughput_parameters: ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] @@ -3766,11 +2431,11 @@ def begin_update_cassandra_view_throughput( lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_cassandra_view_throughput_initial( + raw_result = self._update_cassandra_table_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, + table_name=table_name, update_throughput_parameters=update_throughput_parameters, api_version=api_version, content_type=content_type, @@ -3805,8 +2470,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _migrate_cassandra_view_to_autoscale_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any + def _migrate_cassandra_table_to_autoscale_initial( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -3822,11 +2487,11 @@ def _migrate_cassandra_view_to_autoscale_initial( # pylint: disable=name-too-lo api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_migrate_cassandra_view_to_autoscale_request( + _request = build_migrate_cassandra_table_to_autoscale_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, + table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -3865,10 +2530,10 @@ def _migrate_cassandra_view_to_autoscale_initial( # pylint: disable=name-too-lo return deserialized # type: ignore @distributed_trace - def begin_migrate_cassandra_view_to_autoscale( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any + def begin_migrate_cassandra_table_to_autoscale( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra view from manual throughput to autoscale. + """Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3877,8 +2542,8 @@ def begin_migrate_cassandra_view_to_autoscale( # pylint: disable=name-too-long :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str + :param table_name: Cosmos DB table name. Required. + :type table_name: str :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] @@ -3893,11 +2558,11 @@ def begin_migrate_cassandra_view_to_autoscale( # pylint: disable=name-too-long lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_view_to_autoscale_initial( + raw_result = self._migrate_cassandra_table_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, + table_name=table_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, @@ -3930,8 +2595,8 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _migrate_cassandra_view_to_manual_throughput_initial( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any + def _migrate_cassandra_table_to_manual_throughput_initial( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -3947,11 +2612,11 @@ def _migrate_cassandra_view_to_manual_throughput_initial( # pylint: disable=nam api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_migrate_cassandra_view_to_manual_throughput_request( + _request = build_migrate_cassandra_table_to_manual_throughput_request( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, + table_name=table_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -3990,10 +2655,10 @@ def _migrate_cassandra_view_to_manual_throughput_initial( # pylint: disable=nam return deserialized # type: ignore @distributed_trace - def begin_migrate_cassandra_view_to_manual_throughput( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, keyspace_name: str, view_name: str, **kwargs: Any + def begin_migrate_cassandra_table_to_manual_throughput( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, keyspace_name: str, table_name: str, **kwargs: Any ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB Cassandra view from autoscale to manual throughput. + """Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4002,8 +2667,8 @@ def begin_migrate_cassandra_view_to_manual_throughput( # pylint: disable=name-t :type account_name: str :param keyspace_name: Cosmos DB keyspace name. Required. :type keyspace_name: str - :param view_name: Cosmos DB view name. Required. - :type view_name: str + :param table_name: Cosmos DB table name. Required. + :type table_name: str :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the result of cls(response) :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] @@ -4018,11 +2683,11 @@ def begin_migrate_cassandra_view_to_manual_throughput( # pylint: disable=name-t lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_cassandra_view_to_manual_throughput_initial( + raw_result = self._migrate_cassandra_table_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, keyspace_name=keyspace_name, - view_name=view_name, + table_name=table_name, api_version=api_version, cls=lambda x, y, z: x, headers=_headers, diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_chaos_fault_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_chaos_fault_operations.py deleted file mode 100644 index 7cc4b3af386f..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_chaos_fault_operations.py +++ /dev/null @@ -1,524 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_enable_disable_request( - resource_group_name: str, account_name: str, chaos_fault: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "chaosFault": _SERIALIZER.url("chaos_fault", chaos_fault, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, account_name: str, chaos_fault: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "chaosFault": _SERIALIZER.url("chaos_fault", chaos_fault, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ChaosFaultOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`chaos_fault` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> Iterable["_models.ChaosFaultResource"]: - """List Chaos Faults for CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either ChaosFaultResource or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ChaosFaultListResponse] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ChaosFaultListResponse", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - def _enable_disable_initial( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: Union[_models.ChaosFaultResource, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(chaos_fault_request, (IOBase, bytes)): - _content = chaos_fault_request - else: - _json = self._serialize.body(chaos_fault_request, "ChaosFaultResource") - - _request = build_enable_disable_request( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: _models.ChaosFaultResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Required. - :type chaos_fault_request: ~azure.mgmt.cosmosdb.models.ChaosFaultResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Required. - :type chaos_fault_request: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_enable_disable( - self, - resource_group_name: str, - account_name: str, - chaos_fault: str, - chaos_fault_request: Union[_models.ChaosFaultResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ChaosFaultResource]: - """Enable, disable Chaos Fault in a CosmosDB account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :param chaos_fault_request: A request object to enable/disable the chaos fault. Is either a - ChaosFaultResource type or a IO[bytes] type. Required. - :type chaos_fault_request: ~azure.mgmt.cosmosdb.models.ChaosFaultResource or IO[bytes] - :return: An instance of LROPoller that returns either ChaosFaultResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ChaosFaultResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ChaosFaultResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._enable_disable_initial( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - chaos_fault_request=chaos_fault_request, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ChaosFaultResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ChaosFaultResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ChaosFaultResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, chaos_fault: str, **kwargs: Any - ) -> _models.ChaosFaultResource: - """Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param chaos_fault: The name of the ChaosFault. Required. - :type chaos_fault: str - :return: ChaosFaultResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ChaosFaultResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ChaosFaultResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - chaos_fault=chaos_fault, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ChaosFaultResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py index a9c84bb05076..56e09406cf1a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_operations.py @@ -52,7 +52,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -141,7 +141,7 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py index a58d29c57929..8680b1ddffab 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_operations.py @@ -52,7 +52,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py index f8e54a81f95b..1795a9e0ace2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_partition_region_operations.py @@ -53,7 +53,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py index 43c05977b7f8..230c5025c4b4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_collection_region_operations.py @@ -53,7 +53,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_data_transfer_jobs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_data_transfer_jobs_operations.py deleted file mode 100644 index 8ae381b21c4f..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_data_transfer_jobs_operations.py +++ /dev/null @@ -1,837 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Optional, Type, TypeVar, Union, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_create_request( - resource_group_name: str, account_name: str, job_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, account_name: str, job_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_pause_request( - resource_group_name: str, account_name: str, job_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_resume_request( - resource_group_name: str, account_name: str, job_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_cancel_request( - resource_group_name: str, account_name: str, job_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_complete_request( - resource_group_name: str, account_name: str, job_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "jobName": _SERIALIZER.url("job_name", job_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_database_account_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class DataTransferJobsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`data_transfer_jobs` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @overload - def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: _models.CreateJobRequest, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Required. - :type job_create_parameters: ~azure.mgmt.cosmosdb.models.CreateJobRequest - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Required. - :type job_create_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def create( - self, - resource_group_name: str, - account_name: str, - job_name: str, - job_create_parameters: Union[_models.CreateJobRequest, IO[bytes]], - **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Creates a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :param job_create_parameters: Is either a CreateJobRequest type or a IO[bytes] type. Required. - :type job_create_parameters: ~azure.mgmt.cosmosdb.models.CreateJobRequest or IO[bytes] - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(job_create_parameters, (IOBase, bytes)): - _content = job_create_parameters - else: - _json = self._serialize.body(job_create_parameters, "CreateJobRequest") - - _request = build_create_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def get( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Get a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def pause( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Pause a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_pause_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def resume( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Resumes a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_resume_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def cancel( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Cancels a Data Transfer Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_cancel_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def complete( - self, resource_group_name: str, account_name: str, job_name: str, **kwargs: Any - ) -> _models.DataTransferJobGetResults: - """Completes a Data Transfer Online Job. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param job_name: Name of the Data Transfer Job. Required. - :type job_name: str - :return: DataTransferJobGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.DataTransferJobGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobGetResults] = kwargs.pop("cls", None) - - _request = build_complete_request( - resource_group_name=resource_group_name, - account_name=account_name, - job_name=job_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("DataTransferJobGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def list_by_database_account( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> Iterable["_models.DataTransferJobGetResults"]: - """Get a list of Data Transfer jobs. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either DataTransferJobGetResults or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.DataTransferJobGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.DataTransferJobFeedResults] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_database_account_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("DataTransferJobFeedResults", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py index df8ef5d933e5..bb1055ae9ae5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_account_region_operations.py @@ -45,7 +45,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py index ebf1c50bbe0a..a5ace477525c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_accounts_operations.py @@ -48,7 +48,7 @@ def build_get_request(resource_group_name: str, account_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -121,7 +121,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -158,7 +158,7 @@ def build_delete_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", @@ -188,7 +188,7 @@ def build_failover_priority_change_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -221,7 +221,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -245,7 +245,7 @@ def build_list_by_resource_group_request(resource_group_name: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -277,7 +277,7 @@ def build_list_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -312,7 +312,7 @@ def build_list_connection_strings_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -347,7 +347,7 @@ def build_offline_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -385,7 +385,7 @@ def build_online_region_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -423,7 +423,7 @@ def build_get_read_only_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -458,7 +458,7 @@ def build_list_read_only_keys_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -493,7 +493,7 @@ def build_regenerate_key_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) # Construct URL _url = kwargs.pop( @@ -525,7 +525,7 @@ def build_regenerate_key_request( def build_check_name_exists_request(account_name: str, **kwargs: Any) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop("template_url", "/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}") path_format_arguments = { @@ -548,7 +548,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -584,7 +584,7 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -621,7 +621,7 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py index 5739b36aa4ac..cfe133ebda20 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_database_operations.py @@ -45,7 +45,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -88,7 +88,7 @@ def build_list_usages_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -126,7 +126,7 @@ def build_list_metric_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py deleted file mode 100644 index f7f7a4927f1d..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py +++ /dev/null @@ -1,680 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterable, Iterator, Optional, Type, TypeVar, Union, cast, overload -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_graphs_request( - resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_graph_request( - resource_group_name: str, account_name: str, graph_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_update_graph_request( - resource_group_name: str, account_name: str, graph_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_graph_resource_request( - resource_group_name: str, account_name: str, graph_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "graphName": _SERIALIZER.url("graph_name", graph_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -class GraphResourcesOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`graph_resources` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list_graphs( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> Iterable["_models.GraphResourceGetResults"]: - """Lists the graphs under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either GraphResourceGetResults or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GraphResourcesListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_graphs_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("GraphResourcesListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_graph( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> _models.GraphResourceGetResults: - """Gets the Graph resource under an existing Azure Cosmos DB database account with the provided - name. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :return: GraphResourceGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.GraphResourceGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) - - _request = build_get_graph_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("GraphResourceGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_update_graph_initial( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: Union[_models.GraphResourceCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_graph_parameters, (IOBase, bytes)): - _content = create_update_graph_parameters - else: - _json = self._serialize.body(create_update_graph_parameters, "GraphResourceCreateUpdateParameters") - - _request = build_create_update_graph_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: _models.GraphResourceCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. - Required. - :type create_update_graph_parameters: - ~azure.mgmt.cosmosdb.models.GraphResourceCreateUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either GraphResourceGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. - Required. - :type create_update_graph_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either GraphResourceGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_update_graph( - self, - resource_group_name: str, - account_name: str, - graph_name: str, - create_update_graph_parameters: Union[_models.GraphResourceCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.GraphResourceGetResults]: - """Create or update an Azure Cosmos DB Graph. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :param create_update_graph_parameters: The parameters to provide for the current graph. Is - either a GraphResourceCreateUpdateParameters type or a IO[bytes] type. Required. - :type create_update_graph_parameters: - ~azure.mgmt.cosmosdb.models.GraphResourceCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either GraphResourceGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.GraphResourceGetResults] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_update_graph_initial( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - create_update_graph_parameters=create_update_graph_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("GraphResourceGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.GraphResourceGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.GraphResourceGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_graph_resource_initial( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_graph_resource_request( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_graph_resource( - self, resource_group_name: str, account_name: str, graph_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB Graph Resource. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param graph_name: Cosmos DB graph resource name. Required. - :type graph_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_graph_resource_initial( - resource_group_name=resource_group_name, - account_name=account_name, - graph_name=graph_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py index c0c945a4a699..15900e7d8dd3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_gremlin_resources_operations.py @@ -50,7 +50,7 @@ def build_list_gremlin_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_gremlin_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_create_update_gremlin_database_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -159,7 +159,7 @@ def build_delete_gremlin_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", @@ -190,7 +190,7 @@ def build_get_gremlin_database_throughput_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +226,7 @@ def build_update_gremlin_database_throughput_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -265,7 +265,7 @@ def build_migrate_gremlin_database_to_autoscale_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -301,7 +301,7 @@ def build_migrate_gremlin_database_to_manual_throughput_request( # pylint: disa _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -337,7 +337,7 @@ def build_list_gremlin_graphs_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -378,7 +378,7 @@ def build_get_gremlin_graph_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -420,7 +420,7 @@ def build_create_update_gremlin_graph_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -464,7 +464,7 @@ def build_delete_gremlin_graph_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", @@ -501,7 +501,7 @@ def build_get_gremlin_graph_throughput_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -543,7 +543,7 @@ def build_update_gremlin_graph_throughput_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -588,7 +588,7 @@ def build_migrate_gremlin_graph_to_autoscale_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -630,7 +630,7 @@ def build_migrate_gremlin_graph_to_manual_throughput_request( # pylint: disable _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -672,7 +672,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py index e6adf89cb03b..425f8b0f5ba8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_locations_operations.py @@ -43,7 +43,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -67,7 +67,7 @@ def build_get_request(location: str, subscription_id: str, **kwargs: Any) -> Htt _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py index 419a8324c2dd..003131a06f3d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_mongo_db_resources_operations.py @@ -50,7 +50,7 @@ def build_list_mongo_db_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_mongo_db_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_create_update_mongo_db_database_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -159,7 +159,7 @@ def build_delete_mongo_db_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", @@ -190,7 +190,7 @@ def build_get_mongo_db_database_throughput_request( # pylint: disable=name-too- _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +226,7 @@ def build_update_mongo_db_database_throughput_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -265,7 +265,7 @@ def build_migrate_mongo_db_database_to_autoscale_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -301,7 +301,7 @@ def build_migrate_mongo_db_database_to_manual_throughput_request( # pylint: dis _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -331,181 +331,13 @@ def build_migrate_mongo_db_database_to_manual_throughput_request( # pylint: dis return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_mongo_db_database_retrieve_throughput_distribution_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_mongo_db_database_redistribute_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_mongo_db_container_retrieve_throughput_distribution_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_mongo_db_container_redistribute_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - def build_list_mongo_db_collections_request( resource_group_name: str, account_name: str, database_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -546,7 +378,7 @@ def build_get_mongo_db_collection_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -588,7 +420,7 @@ def build_create_update_mongo_db_collection_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -632,7 +464,7 @@ def build_delete_mongo_db_collection_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", @@ -658,90 +490,6 @@ def build_delete_mongo_db_collection_request( return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_mongo_db_database_partition_merge_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_mongo_db_collection_partition_merge_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "collectionName": _SERIALIZER.url("collection_name", collection_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - def build_get_mongo_db_collection_throughput_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, @@ -753,7 +501,7 @@ def build_get_mongo_db_collection_throughput_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -795,7 +543,7 @@ def build_update_mongo_db_collection_throughput_request( # pylint: disable=name _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -840,7 +588,7 @@ def build_migrate_mongo_db_collection_to_autoscale_request( # pylint: disable=n _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -882,7 +630,7 @@ def build_migrate_mongo_db_collection_to_manual_throughput_request( # pylint: d _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -919,7 +667,7 @@ def build_get_mongo_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -955,7 +703,7 @@ def build_create_update_mongo_role_definition_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -994,7 +742,7 @@ def build_delete_mongo_role_definition_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1030,7 +778,7 @@ def build_list_mongo_role_definitions_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1065,7 +813,7 @@ def build_get_mongo_user_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1101,7 +849,7 @@ def build_create_update_mongo_user_definition_request( # pylint: disable=name-t _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1140,7 +888,7 @@ def build_delete_mongo_user_definition_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1176,7 +924,7 @@ def build_list_mongo_user_definitions_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1216,7 +964,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -2267,917 +2015,11 @@ def get_long_running_output(pipeline_response): self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _mongo_db_database_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_mongo_db_database_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_mongo_db_database_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB database. Is either a RetrieveThroughputParameters type or - a IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._mongo_db_database_retrieve_throughput_distribution_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _mongo_db_database_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") - - _request = build_mongo_db_database_redistribute_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_mongo_db_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB database. Is either a RedistributeThroughputParameters type - or a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._mongo_db_database_redistribute_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _mongo_db_container_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_mongo_db_container_retrieve_throughput_distribution_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_mongo_db_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current MongoDB container. Is either a RetrieveThroughputParameters type - or a IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._mongo_db_container_retrieve_throughput_distribution_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _mongo_db_container_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") - - _request = build_mongo_db_container_redistribute_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_mongo_db_container_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB MongoDB container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current MongoDB container. Is either a RedistributeThroughputParameters type - or a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._mongo_db_container_redistribute_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_mongo_db_collections( - self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> Iterable["_models.MongoDBCollectionGetResults"]: - """Lists the MongoDB collection under an existing Azure Cosmos DB database account. + @distributed_trace + def list_mongo_db_collections( + self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any + ) -> Iterable["_models.MongoDBCollectionGetResults"]: + """Lists the MongoDB collection under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3194,144 +2036,9 @@ def list_mongo_db_collections( _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MongoDBCollectionListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_mongo_db_collections_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("MongoDBCollectionListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_mongo_db_collection( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> _models.MongoDBCollectionGetResults: - """Gets the MongoDB collection under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :return: MongoDBCollectionGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) - - _request = build_get_mongo_db_collection_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.MongoDBCollectionListResult] = kwargs.pop("cls", None) - def _create_update_mongo_db_collection_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3340,150 +2047,66 @@ def _create_update_mongo_db_collection_initial( # pylint: disable=name-too-long } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_mongo_db_collection_parameters, (IOBase, bytes)): - _content = create_update_mongo_db_collection_parameters - else: - _json = self._serialize.body( - create_update_mongo_db_collection_parameters, "MongoDBCollectionCreateUpdateParameters" - ) + def prepare_request(next_link=None): + if not next_link: - _request = build_create_update_mongo_db_collection_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) + _request = build_list_mongo_db_collections_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request - response = pipeline_response.http_response + def extract_data(pipeline_response): + deserialized = self._deserialize("MongoDBCollectionListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, iter(list_of_elem) - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) + def get_next(next_link=None): + _request = prepare_request(next_link) - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: _models.MongoDBCollectionCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. + response = pipeline_response.http_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Required. - :type create_update_mongo_db_collection_parameters: - ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either MongoDBCollectionGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) - @overload - def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. + return pipeline_response - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Required. - :type create_update_mongo_db_collection_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either MongoDBCollectionGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ + return ItemPaged(get_next, extract_data) @distributed_trace - def begin_create_update_mongo_db_collection( - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.MongoDBCollectionGetResults]: - """Create or update an Azure Cosmos DB MongoDB Collection. + def get_mongo_db_collection( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any + ) -> _models.MongoDBCollectionGetResults: + """Gets the MongoDB collection under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3494,68 +2117,10 @@ def begin_create_update_mongo_db_collection( :type database_name: str :param collection_name: Cosmos DB collection name. Required. :type collection_name: str - :param create_update_mongo_db_collection_parameters: The parameters to provide for the current - MongoDB Collection. Is either a MongoDBCollectionCreateUpdateParameters type or a IO[bytes] - type. Required. - :type create_update_mongo_db_collection_parameters: - ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either MongoDBCollectionGetResults or the result - of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] + :return: MongoDBCollectionGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_update_mongo_db_collection_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - create_update_mongo_db_collection_parameters=create_update_mongo_db_collection_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.MongoDBCollectionGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.MongoDBCollectionGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_mongo_db_collection_initial( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -3568,9 +2133,9 @@ def _delete_mongo_db_collection_initial( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) - _request = build_delete_mongo_db_collection_request( + _request = build_get_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -3582,103 +2147,31 @@ def _delete_mongo_db_collection_initial( ) _request.url = self._client.format_url(_request.url) - _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access _request, stream=_stream, **kwargs ) response = pipeline_response.http_response - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass + if response.status_code not in [200]: map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) + deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore + return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - @distributed_trace - def begin_delete_mongo_db_collection( - self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_mongo_db_collection_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - collection_name=collection_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _mongo_db_database_partition_merge_initial( # pylint: disable=name-too-long + def _create_update_mongo_db_collection_initial( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], + collection_name: str, + create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -3699,15 +2192,18 @@ def _mongo_db_database_partition_merge_initial( # pylint: disable=name-too-long content_type = content_type or "application/json" _json = None _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters + if isinstance(create_update_mongo_db_collection_parameters, (IOBase, bytes)): + _content = create_update_mongo_db_collection_parameters else: - _json = self._serialize.body(merge_parameters, "MergeParameters") + _json = self._serialize.body( + create_update_mongo_db_collection_parameters, "MongoDBCollectionCreateUpdateParameters" + ) - _request = build_mongo_db_database_partition_merge_request( + _request = build_create_update_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, + collection_name=collection_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -3749,17 +2245,18 @@ def _mongo_db_database_partition_merge_initial( # pylint: disable=name-too-long return deserialized # type: ignore @overload - def begin_mongo_db_database_partition_merge( + def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: _models.MergeParameters, + collection_name: str, + create_update_mongo_db_collection_parameters: _models.MongoDBCollectionCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> LROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3768,30 +2265,34 @@ def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Required. + :type create_update_mongo_db_collection_parameters: + ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + :return: An instance of LROPoller that returns either MongoDBCollectionGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_mongo_db_database_partition_merge( + def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: IO[bytes], + collection_name: str, + create_update_mongo_db_collection_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> LROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3800,28 +2301,31 @@ def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Required. + :type create_update_mongo_db_collection_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + :return: An instance of LROPoller that returns either MongoDBCollectionGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_mongo_db_database_partition_merge( + def begin_create_update_mongo_db_collection( self, resource_group_name: str, account_name: str, database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], + collection_name: str, + create_update_mongo_db_collection_parameters: Union[_models.MongoDBCollectionCreateUpdateParameters, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB database. + ) -> LROPoller[_models.MongoDBCollectionGetResults]: + """Create or update an Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3830,13 +2334,16 @@ def begin_mongo_db_database_partition_merge( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + :param collection_name: Cosmos DB collection name. Required. + :type collection_name: str + :param create_update_mongo_db_collection_parameters: The parameters to provide for the current + MongoDB Collection. Is either a MongoDBCollectionCreateUpdateParameters type or a IO[bytes] + type. Required. + :type create_update_mongo_db_collection_parameters: + ~azure.mgmt.cosmosdb.models.MongoDBCollectionCreateUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns either MongoDBCollectionGetResults or the result + of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.MongoDBCollectionGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -3844,16 +2351,17 @@ def begin_mongo_db_database_partition_merge( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + cls: ClsType[_models.MongoDBCollectionGetResults] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._mongo_db_database_partition_merge_initial( + raw_result = self._create_update_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - merge_parameters=merge_parameters, + collection_name=collection_name, + create_update_mongo_db_collection_parameters=create_update_mongo_db_collection_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -3865,38 +2373,30 @@ def begin_mongo_db_database_partition_merge( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) + deserialized = self._deserialize("MongoDBCollectionGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( + return LROPoller[_models.MongoDBCollectionGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PhysicalPartitionStorageInfoCollection]( + return LROPoller[_models.MongoDBCollectionGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _list_mongo_db_collection_partition_merge_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any + def _delete_mongo_db_collection_initial( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -3906,31 +2406,19 @@ def _list_mongo_db_collection_partition_merge_initial( # pylint: disable=name-t } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_list_mongo_db_collection_partition_merge_request( + _request = build_delete_mongo_db_collection_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, collection_name=collection_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -3944,7 +2432,7 @@ def _list_mongo_db_collection_partition_merge_initial( # pylint: disable=name-t response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -3966,87 +2454,11 @@ def _list_mongo_db_collection_partition_merge_initial( # pylint: disable=name-t return deserialized # type: ignore - @overload - def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param collection_name: Cosmos DB collection name. Required. - :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - collection_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a MongoDB Collection. + def begin_delete_mongo_db_collection( + self, resource_group_name: str, account_name: str, database_name: str, collection_name: str, **kwargs: Any + ) -> LROPoller[None]: + """Deletes an existing Azure Cosmos DB MongoDB Collection. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4057,33 +2469,25 @@ def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too- :type database_name: str :param collection_name: Cosmos DB collection name. Required. :type collection_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._list_mongo_db_collection_partition_merge_initial( + raw_result = self._delete_mongo_db_collection_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, collection_name=collection_name, - merge_parameters=merge_parameters, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -4092,30 +2496,24 @@ def begin_list_mongo_db_collection_partition_merge( # pylint: disable=name-too- raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore @distributed_trace def get_mongo_db_collection_throughput( diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_network_security_perimeter_configurations_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_network_security_perimeter_configurations_operations.py deleted file mode 100644 index 78b765b4bf62..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_network_security_perimeter_configurations_operations.py +++ /dev/null @@ -1,462 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Iterator, Optional, Type, TypeVar, Union, cast -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(resource_group_name: str, account_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_request( - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "networkSecurityPerimeterConfigurationName": _SERIALIZER.url( - "network_security_perimeter_configuration_name", - network_security_perimeter_configuration_name, - "str", - pattern=r"^.*$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_reconcile_request( - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "networkSecurityPerimeterConfigurationName": _SERIALIZER.url( - "network_security_perimeter_configuration_name", - network_security_perimeter_configuration_name, - "str", - pattern=r"^.*$", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -class NetworkSecurityPerimeterConfigurationsOperations: # pylint: disable=name-too-long - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`network_security_perimeter_configurations` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, account_name: str, **kwargs: Any - ) -> Iterable["_models.NetworkSecurityPerimeterConfiguration"]: - """Gets list of effective Network Security Perimeter Configuration for cosmos db account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :return: An iterator like instance of either NetworkSecurityPerimeterConfiguration or the - result of cls(response) - :rtype: - ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfigurationListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - account_name=account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("NetworkSecurityPerimeterConfigurationListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get( - self, - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> _models.NetworkSecurityPerimeterConfiguration: - """Gets effective Network Security Perimeter Configuration for association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param network_security_perimeter_configuration_name: The name for Network Security Perimeter - configuration. Required. - :type network_security_perimeter_configuration_name: str - :return: NetworkSecurityPerimeterConfiguration or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.NetworkSecurityPerimeterConfiguration - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.NetworkSecurityPerimeterConfiguration] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("NetworkSecurityPerimeterConfiguration", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _reconcile_initial( - self, - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_reconcile_request( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - response_headers["Location"] = self._deserialize("str", response.headers.get("Location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_reconcile( - self, - resource_group_name: str, - account_name: str, - network_security_perimeter_configuration_name: str, - **kwargs: Any - ) -> LROPoller[None]: - """Refreshes any information about the association. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param network_security_perimeter_configuration_name: The name for Network Security Perimeter - configuration. Required. - :type network_security_perimeter_configuration_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._reconcile_initial( - resource_group_name=resource_group_name, - account_name=account_name, - network_security_perimeter_configuration_name=network_security_perimeter_configuration_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py index 10c2ccba4dcc..228a024c413e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_notebook_workspaces_operations.py @@ -50,7 +50,7 @@ def build_list_by_database_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -129,7 +129,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -172,7 +172,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -212,7 +212,7 @@ def build_list_connection_info_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -252,7 +252,7 @@ def build_regenerate_auth_token_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -292,7 +292,7 @@ def build_start_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py index 646477151c14..6895122705ce 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_operations.py @@ -43,7 +43,7 @@ def build_list_request(**kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py index af5a44d645ea..5165d38a54dd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_operations.py @@ -53,7 +53,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py index 8d7f9943b2c8..203522a26afe 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_partition_key_range_id_region_operations.py @@ -54,7 +54,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py index 556611756b67..16f6f020f7c5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_operations.py @@ -45,7 +45,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py index 95b680470568..5d2d47a56f60 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_source_target_operations.py @@ -52,7 +52,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py index cf59ddf0d282..ae3c8c7e7398 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_percentile_target_operations.py @@ -45,7 +45,7 @@ def build_list_metrics_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py index 8297bde07a27..59d541efb4c8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_endpoint_connections_operations.py @@ -50,7 +50,7 @@ def build_list_by_database_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -89,7 +89,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -131,7 +131,7 @@ def build_create_or_update_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -176,7 +176,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py index ce438e6a78ee..36efa9526eda 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_private_link_resources_operations.py @@ -45,7 +45,7 @@ def build_list_by_database_account_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -80,7 +80,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py index fe1cdb179e43..21ec035e65e3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py @@ -43,7 +43,7 @@ def build_list_by_location_request(location: str, subscription_id: str, **kwargs _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -71,7 +71,7 @@ def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -97,7 +97,7 @@ def build_get_by_location_request(location: str, instance_id: str, subscription_ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py index 4954ecb31447..33d42b2ecf81 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_databases_operations.py @@ -43,7 +43,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py index 2a0cb958b43c..40a14534f67e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_graphs_operations.py @@ -52,7 +52,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py index 45558c30aa1b..ce133cb42bb0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_gremlin_resources_operations.py @@ -51,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py index 9e9274bdaaac..4570aac4eb65 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_collections_operations.py @@ -52,7 +52,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py index 1cf1fadc3b81..f2d39316e650 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_databases_operations.py @@ -43,7 +43,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py index 43293501d5e4..ac35ee88344b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_mongodb_resources_operations.py @@ -51,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py index ea8e34c0b640..5ab9fc83ffef 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_containers_operations.py @@ -52,7 +52,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py index b5ada9dbf2b5..bc84754ec592 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_databases_operations.py @@ -43,7 +43,7 @@ def build_list_request(location: str, instance_id: str, subscription_id: str, ** _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py index ade7bd264311..5896e3d2cde5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_sql_resources_operations.py @@ -51,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py index a94ce0d3361a..49bfc7c1fb73 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_table_resources_operations.py @@ -51,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py index 6a15c7e67f0f..f97cc61fece4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_tables_operations.py @@ -51,7 +51,7 @@ def build_list_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py index 826569589fe4..c55b731d5d1b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_service_operations.py @@ -48,7 +48,7 @@ def build_list_request(resource_group_name: str, account_name: str, subscription _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -83,7 +83,7 @@ def build_create_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -122,7 +122,7 @@ def build_get_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -158,7 +158,7 @@ def build_delete_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -349,10 +349,17 @@ def _create_initial( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) + response_headers = {} + if response.status_code == 202: + response_headers["azure-AsyncOperation"] = self._deserialize( + "str", response.headers.get("azure-AsyncOperation") + ) + response_headers["location"] = self._deserialize("str", response.headers.get("location")) + deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore + return cls(pipeline_response, deserialized, response_headers) # type: ignore return deserialized # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py index 6e961b3a5a84..6af6c04f29a1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_sql_resources_operations.py @@ -50,7 +50,7 @@ def build_list_sql_databases_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_sql_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_create_update_sql_database_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -159,7 +159,7 @@ def build_delete_sql_database_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", @@ -190,7 +190,7 @@ def build_get_sql_database_throughput_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +226,7 @@ def build_update_sql_database_throughput_request( # pylint: disable=name-too-lo _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -265,7 +265,7 @@ def build_migrate_sql_database_to_autoscale_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -301,7 +301,7 @@ def build_migrate_sql_database_to_manual_throughput_request( # pylint: disable= _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -331,19 +331,19 @@ def build_migrate_sql_database_to_manual_throughput_request( # pylint: disable= return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_client_encryption_keys_request( # pylint: disable=name-too-long +def build_list_sql_containers_request( resource_group_name: str, account_name: str, database_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -367,24 +367,24 @@ def build_list_client_encryption_keys_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_client_encryption_key_request( +def build_get_sql_container_request( resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, + container_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -395,7 +395,7 @@ def build_get_client_encryption_key_request( "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_name, "str"), + "containerName": _SERIALIZER.url("container_name", container_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -409,25 +409,25 @@ def build_get_client_encryption_key_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_update_client_encryption_key_request( # pylint: disable=name-too-long +def build_create_update_sql_container_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, + container_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -438,7 +438,7 @@ def build_create_update_client_encryption_key_request( # pylint: disable=name-t "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_name, "str"), + "containerName": _SERIALIZER.url("container_name", container_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -454,19 +454,21 @@ def build_create_update_client_encryption_key_request( # pylint: disable=name-t return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_sql_containers_request( - resource_group_name: str, account_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_delete_sql_container_request( + resource_group_name: str, + account_name: str, + database_name: str, + container_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -477,6 +479,7 @@ def build_list_sql_containers_request( "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "containerName": _SERIALIZER.url("container_name", container_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -484,13 +487,10 @@ def build_list_sql_containers_request( # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_get_sql_container_request( +def build_get_sql_container_throughput_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, @@ -501,13 +501,13 @@ def build_get_sql_container_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -532,7 +532,7 @@ def build_get_sql_container_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_update_sql_container_request( # pylint: disable=name-too-long +def build_update_sql_container_throughput_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, @@ -543,14 +543,14 @@ def build_create_update_sql_container_request( # pylint: disable=name-too-long _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -577,56 +577,24 @@ def build_create_update_sql_container_request( # pylint: disable=name-too-long return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_sql_container_request( +def build_migrate_sql_container_to_autoscale_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, container_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_sql_database_partition_merge_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -637,6 +605,7 @@ def build_sql_database_partition_merge_request( # pylint: disable=name-too-long "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "containerName": _SERIALIZER.url("container_name", container_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -645,14 +614,12 @@ def build_sql_database_partition_merge_request( # pylint: disable=name-too-long _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_list_sql_container_partition_merge_request( # pylint: disable=name-too-long +def build_migrate_sql_container_to_manual_throughput_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, @@ -663,14 +630,13 @@ def build_list_sql_container_partition_merge_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -690,31 +656,24 @@ def build_list_sql_container_partition_merge_request( # pylint: disable=name-to _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_sql_container_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - subscription_id: str, - **kwargs: Any +def build_list_client_encryption_keys_request( # pylint: disable=name-too-long + resource_group_name: str, account_name: str, database_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -725,7 +684,6 @@ def build_get_sql_container_throughput_request( # pylint: disable=name-too-long "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -739,25 +697,24 @@ def build_get_sql_container_throughput_request( # pylint: disable=name-too-long return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_update_sql_container_throughput_request( # pylint: disable=name-too-long +def build_get_client_encryption_key_request( resource_group_name: str, account_name: str, database_name: str, - container_name: str, + client_encryption_key_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -768,7 +725,7 @@ def build_update_sql_container_throughput_request( # pylint: disable=name-too-l "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), + "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -777,31 +734,30 @@ def build_update_sql_container_throughput_request( # pylint: disable=name-too-l _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_migrate_sql_container_to_autoscale_request( # pylint: disable=name-too-long +def build_create_update_client_encryption_key_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, - container_name: str, + client_encryption_key_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) + content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/clientEncryptionKeys/{clientEncryptionKeyName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -812,7 +768,7 @@ def build_migrate_sql_container_to_autoscale_request( # pylint: disable=name-to "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), + "clientEncryptionKeyName": _SERIALIZER.url("client_encryption_key_name", client_encryption_key_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -821,12 +777,14 @@ def build_migrate_sql_container_to_autoscale_request( # pylint: disable=name-to _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers + if content_type is not None: + _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_migrate_sql_container_to_manual_throughput_request( # pylint: disable=name-too-long +def build_list_sql_stored_procedures_request( resource_group_name: str, account_name: str, database_name: str, @@ -837,13 +795,13 @@ def build_migrate_sql_container_to_manual_throughput_request( # pylint: disable _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -865,62 +823,28 @@ def build_migrate_sql_container_to_manual_throughput_request( # pylint: disable # Construct headers _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_sql_database_retrieve_throughput_distribution_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_sql_database_redistribute_throughput_request( # pylint: disable=name-too-long - resource_group_name: str, account_name: str, database_name: str, subscription_id: str, **kwargs: Any +def build_get_sql_stored_procedure_request( + resource_group_name: str, + account_name: str, + database_name: str, + container_name: str, + stored_procedure_name: str, + subscription_id: str, + **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -931,6 +855,8 @@ def build_sql_database_redistribute_throughput_request( # pylint: disable=name- "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), + "containerName": _SERIALIZER.url("container_name", container_name, "str"), + "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -939,32 +865,31 @@ def build_sql_database_redistribute_throughput_request( # pylint: disable=name- _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_sql_container_retrieve_throughput_distribution_request( # pylint: disable=name-too-long +def build_create_update_sql_stored_procedure_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, container_name: str, + stored_procedure_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -976,6 +901,7 @@ def build_sql_container_retrieve_throughput_distribution_request( # pylint: dis ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "containerName": _SERIALIZER.url("container_name", container_name, "str"), + "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -988,28 +914,25 @@ def build_sql_container_retrieve_throughput_distribution_request( # pylint: dis _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_sql_container_redistribute_throughput_request( # pylint: disable=name-too-long +def build_delete_sql_stored_procedure_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, container_name: str, + stored_procedure_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1021,6 +944,7 @@ def build_sql_container_redistribute_throughput_request( # pylint: disable=name ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "containerName": _SERIALIZER.url("container_name", container_name, "str"), + "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1028,15 +952,10 @@ def build_sql_container_redistribute_throughput_request( # pylint: disable=name # Construct parameters _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="POST", url=_url, params=_params, headers=_headers, **kwargs) + return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_list_sql_stored_procedures_request( +def build_list_sql_user_defined_functions_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, @@ -1047,13 +966,13 @@ def build_list_sql_stored_procedures_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1078,25 +997,25 @@ def build_list_sql_stored_procedures_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_sql_stored_procedure_request( +def build_get_sql_user_defined_function_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, container_name: str, - stored_procedure_name: str, + user_defined_function_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1108,7 +1027,7 @@ def build_get_sql_stored_procedure_request( ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), + "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1122,26 +1041,26 @@ def build_get_sql_stored_procedure_request( return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_update_sql_stored_procedure_request( # pylint: disable=name-too-long +def build_create_update_sql_user_defined_function_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, container_name: str, - stored_procedure_name: str, + user_defined_function_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1153,7 +1072,7 @@ def build_create_update_sql_stored_procedure_request( # pylint: disable=name-to ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), + "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1169,22 +1088,22 @@ def build_create_update_sql_stored_procedure_request( # pylint: disable=name-to return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) -def build_delete_sql_stored_procedure_request( # pylint: disable=name-too-long +def build_delete_sql_user_defined_function_request( # pylint: disable=name-too-long resource_group_name: str, account_name: str, database_name: str, container_name: str, - stored_procedure_name: str, + user_defined_function_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures/{storedProcedureName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1196,7 +1115,7 @@ def build_delete_sql_stored_procedure_request( # pylint: disable=name-too-long ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "storedProcedureName": _SERIALIZER.url("stored_procedure_name", stored_procedure_name, "str"), + "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1207,7 +1126,7 @@ def build_delete_sql_stored_procedure_request( # pylint: disable=name-too-long return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) -def build_list_sql_user_defined_functions_request( # pylint: disable=name-too-long +def build_list_sql_triggers_request( resource_group_name: str, account_name: str, database_name: str, @@ -1218,13 +1137,13 @@ def build_list_sql_user_defined_functions_request( # pylint: disable=name-too-l _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1249,25 +1168,25 @@ def build_list_sql_user_defined_functions_request( # pylint: disable=name-too-l return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_get_sql_user_defined_function_request( # pylint: disable=name-too-long +def build_get_sql_trigger_request( resource_group_name: str, account_name: str, database_name: str, container_name: str, - user_defined_function_name: str, + trigger_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1279,7 +1198,7 @@ def build_get_sql_user_defined_function_request( # pylint: disable=name-too-lon ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1293,26 +1212,26 @@ def build_get_sql_user_defined_function_request( # pylint: disable=name-too-lon return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) -def build_create_update_sql_user_defined_function_request( # pylint: disable=name-too-long +def build_create_update_sql_trigger_request( resource_group_name: str, account_name: str, database_name: str, container_name: str, - user_defined_function_name: str, + trigger_name: str, subscription_id: str, **kwargs: Any ) -> HttpRequest: _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") # Construct URL _url = kwargs.pop( "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", + "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", ) # pylint: disable=line-too-long path_format_arguments = { "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), @@ -1324,178 +1243,7 @@ def build_create_update_sql_user_defined_function_request( # pylint: disable=na ), "databaseName": _SERIALIZER.url("database_name", database_name, "str"), "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_sql_user_defined_function_request( # pylint: disable=name-too-long - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - user_defined_function_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions/{userDefinedFunctionName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "userDefinedFunctionName": _SERIALIZER.url("user_defined_function_name", user_defined_function_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, **kwargs) - - -def build_list_sql_triggers_request( - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_get_sql_trigger_request( - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - trigger_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_update_sql_trigger_request( - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - trigger_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "accountName": _SERIALIZER.url( - "account_name", account_name, "str", max_length=50, min_length=3, pattern=r"^[a-z0-9]+(-[a-z0-9]+)*" - ), - "databaseName": _SERIALIZER.url("database_name", database_name, "str"), - "containerName": _SERIALIZER.url("container_name", container_name, "str"), - "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), + "triggerName": _SERIALIZER.url("trigger_name", trigger_name, "str"), } _url: str = _url.format(**path_format_arguments) # type: ignore @@ -1522,7 +1270,7 @@ def build_delete_sql_trigger_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", @@ -1555,7 +1303,7 @@ def build_get_sql_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1591,7 +1339,7 @@ def build_create_update_sql_role_definition_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1630,7 +1378,7 @@ def build_delete_sql_role_definition_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1666,7 +1414,7 @@ def build_list_sql_role_definitions_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1701,7 +1449,7 @@ def build_get_sql_role_assignment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1737,7 +1485,7 @@ def build_create_update_sql_role_assignment_request( # pylint: disable=name-too _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -1776,7 +1524,7 @@ def build_delete_sql_role_assignment_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1812,7 +1560,7 @@ def build_list_sql_role_assignments_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -1852,7 +1600,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -2901,10 +2649,10 @@ def get_long_running_output(pipeline_response): ) @distributed_trace - def list_client_encryption_keys( + def list_sql_containers( self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> Iterable["_models.ClientEncryptionKeyGetResults"]: - """Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + ) -> Iterable["_models.SqlContainerGetResults"]: + """Lists the SQL container under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -2913,16 +2661,16 @@ def list_client_encryption_keys( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :return: An iterator like instance of either ClientEncryptionKeyGetResults or the result of + :return: An iterator like instance of either SqlContainerGetResults or the result of cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -2935,7 +2683,7 @@ def list_client_encryption_keys( def prepare_request(next_link=None): if not next_link: - _request = build_list_client_encryption_keys_request( + _request = build_list_sql_containers_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -2964,7 +2712,7 @@ def prepare_request(next_link=None): return _request def extract_data(pipeline_response): - deserialized = self._deserialize("ClientEncryptionKeysListResult", pipeline_response) + deserialized = self._deserialize("SqlContainerListResult", pipeline_response) list_of_elem = deserialized.value if cls: list_of_elem = cls(list_of_elem) # type: ignore @@ -2988,15 +2736,10 @@ def get_next(next_link=None): return ItemPaged(get_next, extract_data) @distributed_trace - def get_client_encryption_key( - self, - resource_group_name: str, - account_name: str, - database_name: str, - client_encryption_key_name: str, - **kwargs: Any - ) -> _models.ClientEncryptionKeyGetResults: - """Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + def get_sql_container( + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> _models.SqlContainerGetResults: + """Gets the SQL container under an existing Azure Cosmos DB database account. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3005,10 +2748,10 @@ def get_client_encryption_key( :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :return: ClientEncryptionKeyGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :return: SqlContainerGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.SqlContainerGetResults :raises ~azure.core.exceptions.HttpResponseError: """ error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -3023,13 +2766,13 @@ def get_client_encryption_key( _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) - _request = build_get_client_encryption_key_request( + _request = build_get_sql_container_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - client_encryption_key_name=client_encryption_key_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, headers=_headers, @@ -3048,22 +2791,20 @@ def get_client_encryption_key( map_error(status_code=response.status_code, response=response, error_map=error_map) raise HttpResponseError(response=response, error_format=ARMErrorFormat) - deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) + deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized # type: ignore - def _create_update_client_encryption_key_initial( # pylint: disable=name-too-long + def _create_update_sql_container_initial( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: Union[ - _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] - ], + container_name: str, + create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -3084,18 +2825,16 @@ def _create_update_client_encryption_key_initial( # pylint: disable=name-too-lo content_type = content_type or "application/json" _json = None _content = None - if isinstance(create_update_client_encryption_key_parameters, (IOBase, bytes)): - _content = create_update_client_encryption_key_parameters + if isinstance(create_update_sql_container_parameters, (IOBase, bytes)): + _content = create_update_sql_container_parameters else: - _json = self._serialize.body( - create_update_client_encryption_key_parameters, "ClientEncryptionKeyCreateUpdateParameters" - ) + _json = self._serialize.body(create_update_sql_container_parameters, "SqlContainerCreateUpdateParameters") - _request = build_create_update_client_encryption_key_request( + _request = build_create_update_sql_container_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - client_encryption_key_name=client_encryption_key_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -3137,19 +2876,18 @@ def _create_update_client_encryption_key_initial( # pylint: disable=name-too-lo return deserialized # type: ignore @overload - def begin_create_update_client_encryption_key( # pylint: disable=name-too-long + def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: _models.ClientEncryptionKeyCreateUpdateParameters, + container_name: str, + create_update_sql_container_parameters: _models.SqlContainerCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). + ) -> LROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -3158,1274 +2896,34 @@ def begin_create_update_client_encryption_key( # pylint: disable=name-too-long :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Required. - :type create_update_client_encryption_key_parameters: - ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Required. + :type create_update_sql_container_parameters: + ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_update_client_encryption_key( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Required. - :type create_update_client_encryption_key_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_update_client_encryption_key( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - client_encryption_key_name: str, - create_update_client_encryption_key_parameters: Union[ - _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] - ], - **kwargs: Any - ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: - """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the - Azure Powershell (instead of directly). - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. - :type client_encryption_key_name: str - :param create_update_client_encryption_key_parameters: The parameters to provide for the client - encryption key. Is either a ClientEncryptionKeyCreateUpdateParameters type or a IO[bytes] type. - Required. - :type create_update_client_encryption_key_parameters: - ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either ClientEncryptionKeyGetResults or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_update_client_encryption_key_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - client_encryption_key_name=client_encryption_key_name, - create_update_client_encryption_key_parameters=create_update_client_encryption_key_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ClientEncryptionKeyGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ClientEncryptionKeyGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def list_sql_containers( - self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any - ) -> Iterable["_models.SqlContainerGetResults"]: - """Lists the SQL container under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :return: An iterator like instance of either SqlContainerGetResults or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlContainerListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_sql_containers_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("SqlContainerListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def get_sql_container( - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> _models.SqlContainerGetResults: - """Gets the SQL container under an existing Azure Cosmos DB database account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: SqlContainerGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.SqlContainerGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) - - _request = build_get_sql_container_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_update_sql_container_initial( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(create_update_sql_container_parameters, (IOBase, bytes)): - _content = create_update_sql_container_parameters - else: - _json = self._serialize.body(create_update_sql_container_parameters, "SqlContainerCreateUpdateParameters") - - _request = build_create_update_sql_container_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_update_sql_container( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - create_update_sql_container_parameters: _models.SqlContainerCreateUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Required. - :type create_update_sql_container_parameters: - ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either SqlContainerGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_update_sql_container( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - create_update_sql_container_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Required. - :type create_update_sql_container_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either SqlContainerGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_update_sql_container( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.SqlContainerGetResults]: - """Create or update an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param create_update_sql_container_parameters: The parameters to provide for the current SQL - container. Is either a SqlContainerCreateUpdateParameters type or a IO[bytes] type. Required. - :type create_update_sql_container_parameters: - ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either SqlContainerGetResults or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_update_sql_container_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - create_update_sql_container_parameters=create_update_sql_container_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.SqlContainerGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.SqlContainerGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_sql_container_initial( - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_sql_container_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete_sql_container( - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_sql_container_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - - def _sql_database_partition_merge_initial( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_sql_database_partition_merge_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_sql_database_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._sql_database_partition_merge_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - merge_parameters=merge_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _list_sql_container_partition_merge_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(merge_parameters, (IOBase, bytes)): - _content = merge_parameters - else: - _json = self._serialize.body(merge_parameters, "MergeParameters") - - _request = build_list_sql_container_partition_merge_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: _models.MergeParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Required. - :type merge_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_list_sql_container_partition_merge( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - merge_parameters: Union[_models.MergeParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionStorageInfoCollection]: - """Merges the partitions of a SQL Container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param merge_parameters: The parameters for the merge operation. Is either a MergeParameters - type or a IO[bytes] type. Required. - :type merge_parameters: ~azure.mgmt.cosmosdb.models.MergeParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionStorageInfoCollection or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionStorageInfoCollection] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionStorageInfoCollection] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._list_sql_container_partition_merge_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - merge_parameters=merge_parameters, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionStorageInfoCollection", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.PhysicalPartitionStorageInfoCollection].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.PhysicalPartitionStorageInfoCollection]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - @distributed_trace - def get_sql_container_throughput( - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> _models.ThroughputSettingsGetResults: - """Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database - account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: ThroughputSettingsGetResults or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - - _request = build_get_sql_container_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _update_sql_container_throughput_initial( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(update_throughput_parameters, (IOBase, bytes)): - _content = update_throughput_parameters - else: - _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - - _request = build_update_sql_container_throughput_request( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update_sql_container_throughput( - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + :return: An instance of LROPoller that returns either SqlContainerGetResults or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_update_sql_container_throughput( + def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - update_throughput_parameters: IO[bytes], + create_update_sql_container_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. + ) -> LROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4436,29 +2934,29 @@ def begin_update_sql_container_throughput( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Required. - :type update_throughput_parameters: IO[bytes] + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Required. + :type create_update_sql_container_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + :return: An instance of LROPoller that returns either SqlContainerGetResults or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_update_sql_container_throughput( + def begin_create_update_sql_container( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, - update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], + create_update_sql_container_parameters: Union[_models.SqlContainerCreateUpdateParameters, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Update RUs per second of an Azure Cosmos DB SQL container. + ) -> LROPoller[_models.SqlContainerGetResults]: + """Create or update an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4469,14 +2967,13 @@ def begin_update_sql_container_throughput( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param update_throughput_parameters: The parameters to provide for the RUs per second of the - current SQL container. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. - Required. - :type update_throughput_parameters: - ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + :param create_update_sql_container_parameters: The parameters to provide for the current SQL + container. Is either a SqlContainerCreateUpdateParameters type or a IO[bytes] type. Required. + :type create_update_sql_container_parameters: + ~azure.mgmt.cosmosdb.models.SqlContainerCreateUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns either SqlContainerGetResults or the result of + cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.SqlContainerGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4484,17 +2981,17 @@ def begin_update_sql_container_throughput( api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + cls: ClsType[_models.SqlContainerGetResults] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._update_sql_container_throughput_initial( + raw_result = self._create_update_sql_container_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, container_name=container_name, - update_throughput_parameters=update_throughput_parameters, + create_update_sql_container_parameters=create_update_sql_container_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -4506,7 +3003,7 @@ def begin_update_sql_container_throughput( kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) + deserialized = self._deserialize("SqlContainerGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized @@ -4518,17 +3015,17 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( + return LROPoller[_models.SqlContainerGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ThroughputSettingsGetResults]( + return LROPoller[_models.SqlContainerGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _migrate_sql_container_to_autoscale_initial( # pylint: disable=name-too-long + def _delete_sql_container_initial( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -4545,7 +3042,7 @@ def _migrate_sql_container_to_autoscale_initial( # pylint: disable=name-too-lon api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - _request = build_migrate_sql_container_to_autoscale_request( + _request = build_delete_sql_container_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4565,7 +3062,7 @@ def _migrate_sql_container_to_autoscale_initial( # pylint: disable=name-too-lon response = pipeline_response.http_response - if response.status_code not in [200, 202]: + if response.status_code not in [202, 204]: try: response.read() # Load the body in memory and close the socket except (StreamConsumedError, StreamClosedError): @@ -4588,10 +3085,10 @@ def _migrate_sql_container_to_autoscale_initial( # pylint: disable=name-too-lon return deserialized # type: ignore @distributed_trace - def begin_migrate_sql_container_to_autoscale( + def begin_delete_sql_container( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. + ) -> LROPoller[None]: + """Deletes an existing Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4602,21 +3099,20 @@ def begin_migrate_sql_container_to_autoscale( :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + :return: An instance of LROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[None] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) + cls: ClsType[None] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._migrate_sql_container_to_autoscale_initial( + raw_result = self._delete_sql_container_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4630,11 +3126,9 @@ def begin_migrate_sql_container_to_autoscale( raw_result.http_response.read() # type: ignore kwargs.pop("error_map", None) - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) + def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized + return cls(pipeline_response, None, {}) # type: ignore if polling is True: polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) @@ -4643,19 +3137,34 @@ def get_long_running_output(pipeline_response): else: polling_method = polling if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( + return LROPoller[None].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) + return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore - def _migrate_sql_container_to_manual_throughput_initial( # pylint: disable=name-too-long + @distributed_trace + def get_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> Iterator[bytes]: + ) -> _models.ThroughputSettingsGetResults: + """Gets the RUs per second of the SQL container under an existing Azure Cosmos DB database + account. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. Required. + :type account_name: str + :param database_name: Cosmos DB database name. Required. + :type database_name: str + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :return: ThroughputSettingsGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults + :raises ~azure.core.exceptions.HttpResponseError: + """ error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, @@ -4668,9 +3177,9 @@ def _migrate_sql_container_to_manual_throughput_initial( # pylint: disable=name _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - _request = build_migrate_sql_container_to_manual_throughput_request( + _request = build_get_sql_container_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, @@ -4682,108 +3191,31 @@ def _migrate_sql_container_to_manual_throughput_initial( # pylint: disable=name ) _request.url = self._client.format_url(_request.url) - _decompress = kwargs.pop("decompress", True) - _stream = True + _stream = False pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - raise HttpResponseError(response=response, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_migrate_sql_container_to_manual_throughput( # pylint: disable=name-too-long - self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any - ) -> LROPoller[_models.ThroughputSettingsGetResults]: - """Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the - result of cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._migrate_sql_container_to_manual_throughput_initial( - resource_group_name=resource_group_name, - account_name=account_name, - database_name=database_name, - container_name=container_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputSettingsGetResults]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore + _request, stream=_stream, **kwargs ) - def _sql_database_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _update_sql_container_throughput_initial( self, resource_group_name: str, account_name: str, database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], + container_name: str, + update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -4804,15 +3236,16 @@ def _sql_database_retrieve_throughput_distribution_initial( # pylint: disable=n content_type = content_type or "application/json" _json = None _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters + if isinstance(update_throughput_parameters, (IOBase, bytes)): + _content = update_throughput_parameters else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") + _json = self._serialize.body(update_throughput_parameters, "ThroughputSettingsUpdateParameters") - _request = build_sql_database_retrieve_throughput_distribution_request( + _request = build_update_sql_container_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -4854,17 +3287,18 @@ def _sql_database_retrieve_throughput_distribution_initial( # pylint: disable=n return deserialized # type: ignore @overload - def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long + def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, + container_name: str, + update_throughput_parameters: _models.ThroughputSettingsUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. + ) -> LROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4873,31 +3307,34 @@ def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Required. + :type update_throughput_parameters: + ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long + def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, - retrieve_throughput_parameters: IO[bytes], + container_name: str, + update_throughput_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. + ) -> LROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4906,29 +3343,31 @@ def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Required. - :type retrieve_throughput_parameters: IO[bytes] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Required. + :type update_throughput_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name-too-long + def begin_update_sql_container_throughput( self, resource_group_name: str, account_name: str, database_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], + container_name: str, + update_throughput_parameters: Union[_models.ThroughputSettingsUpdateParameters, IO[bytes]], **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL database. + ) -> LROPoller[_models.ThroughputSettingsGetResults]: + """Update RUs per second of an Azure Cosmos DB SQL container. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -4937,15 +3376,16 @@ def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL database. Is either a RetrieveThroughputParameters type or a - IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :param update_throughput_parameters: The parameters to provide for the RUs per second of the + current SQL container. Is either a ThroughputSettingsUpdateParameters type or a IO[bytes] type. + Required. + :type update_throughput_parameters: + ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -4953,16 +3393,17 @@ def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_database_retrieve_throughput_distribution_initial( + raw_result = self._update_sql_container_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, + container_name=container_name, + update_throughput_parameters=update_throughput_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -4974,37 +3415,30 @@ def begin_sql_database_retrieve_throughput_distribution( # pylint: disable=name kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( + return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( + return LROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _sql_database_redistribute_throughput_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any + def _migrate_sql_container_to_autoscale_initial( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -5014,30 +3448,19 @@ def _sql_database_redistribute_throughput_initial( # pylint: disable=name-too-l } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters - else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") - - _request = build_sql_database_redistribute_throughput_request( + _request = build_migrate_sql_container_to_autoscale_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, + container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -5073,83 +3496,11 @@ def _sql_database_redistribute_throughput_initial( # pylint: disable=name-too-l return deserialized # type: ignore - @overload - def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Required. - :type redistribute_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL database. + def begin_migrate_sql_container_to_autoscale( + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> LROPoller[_models.ThroughputSettingsGetResults]: + """Migrate an Azure Cosmos DB SQL container from manual throughput to autoscale. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5158,34 +3509,28 @@ def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL database. Is either a RedistributeThroughputParameters type or a - IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + :param container_name: Cosmos DB container name. Required. + :type container_name: str + :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_database_redistribute_throughput_initial( + raw_result = self._migrate_sql_container_to_autoscale_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, + container_name=container_name, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -5195,38 +3540,30 @@ def begin_sql_database_redistribute_throughput( # pylint: disable=name-too-long kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( + return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( + return LROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _sql_container_retrieve_throughput_distribution_initial( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any + def _migrate_sql_container_to_manual_throughput_initial( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { 401: ClientAuthenticationError, @@ -5236,31 +3573,19 @@ def _sql_container_retrieve_throughput_distribution_initial( # pylint: disable= } error_map.update(kwargs.pop("error_map", {}) or {}) - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(retrieve_throughput_parameters, (IOBase, bytes)): - _content = retrieve_throughput_parameters - else: - _json = self._serialize.body(retrieve_throughput_parameters, "RetrieveThroughputParameters") - - _request = build_sql_container_retrieve_throughput_distribution_request( + _request = build_migrate_sql_container_to_manual_throughput_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, container_name=container_name, subscription_id=self._config.subscription_id, api_version=api_version, - content_type=content_type, - json=_json, - content=_content, headers=_headers, params=_params, ) @@ -5296,89 +3621,11 @@ def _sql_container_retrieve_throughput_distribution_initial( # pylint: disable= return deserialized # type: ignore - @overload - def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: _models.RetrieveThroughputParameters, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_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. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_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. - Required. - :type resource_group_name: str - :param account_name: Cosmos DB database account name. Required. - :type account_name: str - :param database_name: Cosmos DB database name. Required. - :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Required. - :type retrieve_throughput_parameters: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] - :raises ~azure.core.exceptions.HttpResponseError: - """ - @distributed_trace - def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=name-too-long - self, - resource_group_name: str, - account_name: str, - database_name: str, - container_name: str, - retrieve_throughput_parameters: Union[_models.RetrieveThroughputParameters, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Retrieve throughput distribution for an Azure Cosmos DB SQL container. + def begin_migrate_sql_container_to_manual_throughput( # pylint: disable=name-too-long + self, resource_group_name: str, account_name: str, database_name: str, container_name: str, **kwargs: Any + ) -> LROPoller[_models.ThroughputSettingsGetResults]: + """Migrate an Azure Cosmos DB SQL container from autoscale to manual throughput. :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5389,35 +3636,26 @@ def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=nam :type database_name: str :param container_name: Cosmos DB container name. Required. :type container_name: str - :param retrieve_throughput_parameters: The parameters to provide for retrieving throughput - distribution for the current SQL container. Is either a RetrieveThroughputParameters type or a - IO[bytes] type. Required. - :type retrieve_throughput_parameters: ~azure.mgmt.cosmosdb.models.RetrieveThroughputParameters - or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + :return: An instance of LROPoller that returns either ThroughputSettingsGetResults or the + result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) + _headers = kwargs.pop("headers", {}) or {} _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + cls: ClsType[_models.ThroughputSettingsGetResults] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_container_retrieve_throughput_distribution_initial( + raw_result = self._migrate_sql_container_to_manual_throughput_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, container_name=container_name, - retrieve_throughput_parameters=retrieve_throughput_parameters, api_version=api_version, - content_type=content_type, cls=lambda x, y, z: x, headers=_headers, params=_params, @@ -5427,37 +3665,192 @@ def begin_sql_container_retrieve_throughput_distribution( # pylint: disable=nam kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) + deserialized = self._deserialize("ThroughputSettingsGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( + return LROPoller[_models.ThroughputSettingsGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( + return LROPoller[_models.ThroughputSettingsGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) - def _sql_container_redistribute_throughput_initial( # pylint: disable=name-too-long + @distributed_trace + def list_client_encryption_keys( + self, resource_group_name: str, account_name: str, database_name: str, **kwargs: Any + ) -> Iterable["_models.ClientEncryptionKeyGetResults"]: + """Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. Required. + :type account_name: str + :param database_name: Cosmos DB database name. Required. + :type database_name: str + :return: An iterator like instance of either ClientEncryptionKeyGetResults or the result of + cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ClientEncryptionKeysListResult] = kwargs.pop("cls", None) + + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + def prepare_request(next_link=None): + if not next_link: + + _request = build_list_client_encryption_keys_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + else: + # make call to next link with the client's api-version + _parsed_next_link = urllib.parse.urlparse(next_link) + _next_request_params = case_insensitive_dict( + { + key: [urllib.parse.quote(v) for v in value] + for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() + } + ) + _next_request_params["api-version"] = self._config.api_version + _request = HttpRequest( + "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params + ) + _request.url = self._client.format_url(_request.url) + _request.method = "GET" + return _request + + def extract_data(pipeline_response): + deserialized = self._deserialize("ClientEncryptionKeysListResult", pipeline_response) + list_of_elem = deserialized.value + if cls: + list_of_elem = cls(list_of_elem) # type: ignore + return None, iter(list_of_elem) + + def get_next(next_link=None): + _request = prepare_request(next_link) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + return pipeline_response + + return ItemPaged(get_next, extract_data) + + @distributed_trace + def get_client_encryption_key( self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], + client_encryption_key_name: str, + **kwargs: Any + ) -> _models.ClientEncryptionKeyGetResults: + """Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + Required. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. Required. + :type account_name: str + :param database_name: Cosmos DB database name. Required. + :type database_name: str + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :return: ClientEncryptionKeyGetResults or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults + :raises ~azure.core.exceptions.HttpResponseError: + """ + error_map: MutableMapping[int, Type[HttpResponseError]] = { + 401: ClientAuthenticationError, + 404: ResourceNotFoundError, + 409: ResourceExistsError, + 304: ResourceNotModifiedError, + } + error_map.update(kwargs.pop("error_map", {}) or {}) + + _headers = kwargs.pop("headers", {}) or {} + _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) + + api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) + + _request = build_get_client_encryption_key_request( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + client_encryption_key_name=client_encryption_key_name, + subscription_id=self._config.subscription_id, + api_version=api_version, + headers=_headers, + params=_params, + ) + _request.url = self._client.format_url(_request.url) + + _stream = False + pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access + _request, stream=_stream, **kwargs + ) + + response = pipeline_response.http_response + + if response.status_code not in [200]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) + + if cls: + return cls(pipeline_response, deserialized, {}) # type: ignore + + return deserialized # type: ignore + + def _create_update_client_encryption_key_initial( # pylint: disable=name-too-long + self, + resource_group_name: str, + account_name: str, + database_name: str, + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: Union[ + _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] + ], **kwargs: Any ) -> Iterator[bytes]: error_map: MutableMapping[int, Type[HttpResponseError]] = { @@ -5478,16 +3871,18 @@ def _sql_container_redistribute_throughput_initial( # pylint: disable=name-too- content_type = content_type or "application/json" _json = None _content = None - if isinstance(redistribute_throughput_parameters, (IOBase, bytes)): - _content = redistribute_throughput_parameters + if isinstance(create_update_client_encryption_key_parameters, (IOBase, bytes)): + _content = create_update_client_encryption_key_parameters else: - _json = self._serialize.body(redistribute_throughput_parameters, "RedistributeThroughputParameters") + _json = self._serialize.body( + create_update_client_encryption_key_parameters, "ClientEncryptionKeyCreateUpdateParameters" + ) - _request = build_sql_container_redistribute_throughput_request( + _request = build_create_update_client_encryption_key_request( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - container_name=container_name, + client_encryption_key_name=client_encryption_key_name, subscription_id=self._config.subscription_id, api_version=api_version, content_type=content_type, @@ -5529,18 +3924,19 @@ def _sql_container_redistribute_throughput_initial( # pylint: disable=name-too- return deserialized # type: ignore @overload - def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: _models.RedistributeThroughputParameters, + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: _models.ClientEncryptionKeyCreateUpdateParameters, *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5549,35 +3945,36 @@ def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-lon :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Required. + :type create_update_client_encryption_key_parameters: + ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) + :return: An instance of LROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @overload - def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: IO[bytes], + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: IO[bytes], *, content_type: str = "application/json", **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5586,32 +3983,35 @@ def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-lon :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Required. - :type redistribute_throughput_parameters: IO[bytes] + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Required. + :type create_update_client_encryption_key_parameters: IO[bytes] :keyword content_type: Body Parameter content-type. Content type parameter for binary body. Default value is "application/json". :paramtype content_type: str - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) + :return: An instance of LROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ @distributed_trace - def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-long + def begin_create_update_client_encryption_key( # pylint: disable=name-too-long self, resource_group_name: str, account_name: str, database_name: str, - container_name: str, - redistribute_throughput_parameters: Union[_models.RedistributeThroughputParameters, IO[bytes]], + client_encryption_key_name: str, + create_update_client_encryption_key_parameters: Union[ + _models.ClientEncryptionKeyCreateUpdateParameters, IO[bytes] + ], **kwargs: Any - ) -> LROPoller[_models.PhysicalPartitionThroughputInfoResult]: - """Redistribute throughput for an Azure Cosmos DB SQL container. + ) -> LROPoller[_models.ClientEncryptionKeyGetResults]: + """Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the + Azure Powershell (instead of directly). :param resource_group_name: The name of the resource group. The name is case insensitive. Required. @@ -5620,17 +4020,17 @@ def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-lon :type account_name: str :param database_name: Cosmos DB database name. Required. :type database_name: str - :param container_name: Cosmos DB container name. Required. - :type container_name: str - :param redistribute_throughput_parameters: The parameters to provide for redistributing - throughput for the current SQL container. Is either a RedistributeThroughputParameters type or - a IO[bytes] type. Required. - :type redistribute_throughput_parameters: - ~azure.mgmt.cosmosdb.models.RedistributeThroughputParameters or IO[bytes] - :return: An instance of LROPoller that returns either PhysicalPartitionThroughputInfoResult or - the result of cls(response) + :param client_encryption_key_name: Cosmos DB ClientEncryptionKey name. Required. + :type client_encryption_key_name: str + :param create_update_client_encryption_key_parameters: The parameters to provide for the client + encryption key. Is either a ClientEncryptionKeyCreateUpdateParameters type or a IO[bytes] type. + Required. + :type create_update_client_encryption_key_parameters: + ~azure.mgmt.cosmosdb.models.ClientEncryptionKeyCreateUpdateParameters or IO[bytes] + :return: An instance of LROPoller that returns either ClientEncryptionKeyGetResults or the + result of cls(response) :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.PhysicalPartitionThroughputInfoResult] + ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ClientEncryptionKeyGetResults] :raises ~azure.core.exceptions.HttpResponseError: """ _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) @@ -5638,17 +4038,17 @@ def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-lon api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.PhysicalPartitionThroughputInfoResult] = kwargs.pop("cls", None) + cls: ClsType[_models.ClientEncryptionKeyGetResults] = kwargs.pop("cls", None) polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) cont_token: Optional[str] = kwargs.pop("continuation_token", None) if cont_token is None: - raw_result = self._sql_container_redistribute_throughput_initial( + raw_result = self._create_update_client_encryption_key_initial( resource_group_name=resource_group_name, account_name=account_name, database_name=database_name, - container_name=container_name, - redistribute_throughput_parameters=redistribute_throughput_parameters, + client_encryption_key_name=client_encryption_key_name, + create_update_client_encryption_key_parameters=create_update_client_encryption_key_parameters, api_version=api_version, content_type=content_type, cls=lambda x, y, z: x, @@ -5660,27 +4060,25 @@ def begin_sql_container_redistribute_throughput( # pylint: disable=name-too-lon kwargs.pop("error_map", None) def get_long_running_output(pipeline_response): - deserialized = self._deserialize("PhysicalPartitionThroughputInfoResult", pipeline_response.http_response) + deserialized = self._deserialize("ClientEncryptionKeyGetResults", pipeline_response.http_response) if cls: return cls(pipeline_response, deserialized, {}) # type: ignore return deserialized if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "location"}, **kwargs) - ) + polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) elif polling is False: polling_method = cast(PollingMethod, NoPolling()) else: polling_method = polling if cont_token: - return LROPoller[_models.PhysicalPartitionThroughputInfoResult].from_continuation_token( + return LROPoller[_models.ClientEncryptionKeyGetResults].from_continuation_token( polling_method=polling_method, continuation_token=cont_token, client=self._client, deserialization_callback=get_long_running_output, ) - return LROPoller[_models.PhysicalPartitionThroughputInfoResult]( + return LROPoller[_models.ClientEncryptionKeyGetResults]( self._client, raw_result, get_long_running_output, polling_method # type: ignore ) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py index 230857cc8e4e..3f2c40f5ff9e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_table_resources_operations.py @@ -50,7 +50,7 @@ def build_list_tables_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -85,7 +85,7 @@ def build_get_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -121,7 +121,7 @@ def build_create_update_table_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -159,7 +159,7 @@ def build_delete_table_request( ) -> HttpRequest: _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) # Construct URL _url = kwargs.pop( "template_url", @@ -190,7 +190,7 @@ def build_get_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -226,7 +226,7 @@ def build_update_table_throughput_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") @@ -265,7 +265,7 @@ def build_migrate_table_to_autoscale_request( _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -301,7 +301,7 @@ def build_migrate_table_to_manual_throughput_request( # pylint: disable=name-to _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) accept = _headers.pop("Accept", "application/json") # Construct URL @@ -337,7 +337,7 @@ def build_retrieve_continuous_backup_information_request( # pylint: disable=nam _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) + api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-11-15")) content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) accept = _headers.pop("Accept", "application/json") diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_account_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_account_operations.py deleted file mode 100644 index 336043f5cd56..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_account_operations.py +++ /dev/null @@ -1,617 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterator, Optional, Type, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - "throughputPoolAccountName": _SERIALIZER.url( - "throughput_pool_account_name", - throughput_pool_account_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_request( - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - "throughputPoolAccountName": _SERIALIZER.url( - "throughput_pool_account_name", - throughput_pool_account_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - subscription_id: str, - **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - "throughputPoolAccountName": _SERIALIZER.url( - "throughput_pool_account_name", - throughput_pool_account_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ThroughputPoolAccountOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`throughput_pool_account` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get( - self, resource_group_name: str, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> _models.ThroughputPoolAccountResource: - """Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :return: ThroughputPoolAccountResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolAccountResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputPoolAccountResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_initial( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: Union[_models.ThroughputPoolAccountResource, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ThroughputPoolAccountResource") - - _request = build_create_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: _models.ThroughputPoolAccountResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create( - self, - resource_group_name: str, - throughput_pool_name: str, - throughput_pool_account_name: str, - body: Union[_models.ThroughputPoolAccountResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolAccountResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :param body: The parameters to provide for the current ThroughputPoolAccount. Is either a - ThroughputPoolAccountResource type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource or IO[bytes] - :return: An instance of LROPoller that returns either ThroughputPoolAccountResource or the - result of cls(response) - :rtype: - ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ThroughputPoolAccountResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_initial( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolAccountResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputPoolAccountResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputPoolAccountResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial( - self, resource_group_name: str, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete( - self, resource_group_name: str, throughput_pool_name: str, throughput_pool_account_name: str, **kwargs: Any - ) -> LROPoller[None]: - """Removes an existing Azure Cosmos DB database account from a throughput pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param throughput_pool_account_name: Cosmos DB global database account in a Throughput Pool. - Required. - :type throughput_pool_account_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - throughput_pool_account_name=throughput_pool_account_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_accounts_operations.py deleted file mode 100644 index d81dbef7b827..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_accounts_operations.py +++ /dev/null @@ -1,184 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request( - resource_group_name: str, throughput_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ThroughputPoolAccountsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`throughput_pool_accounts` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list( - self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any - ) -> Iterable["_models.ThroughputPoolAccountResource"]: - """Lists all the Azure Cosmos DB accounts available under the subscription. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: An iterator like instance of either ThroughputPoolAccountResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolAccountResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolAccountsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolAccountsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_operations.py deleted file mode 100644 index fb5bca6d53bf..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pool_operations.py +++ /dev/null @@ -1,796 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -from io import IOBase -import sys -from typing import Any, Callable, Dict, IO, Iterator, Optional, Type, TypeVar, Union, cast, overload - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - StreamClosedError, - StreamConsumedError, - map_error, -) -from azure.core.pipeline import PipelineResponse -from azure.core.polling import LROPoller, NoPolling, PollingMethod -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat -from azure.mgmt.core.polling.arm_polling import ARMPolling - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_get_request( - resource_group_name: str, throughput_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_create_or_update_request( - resource_group_name: str, throughput_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PUT", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_update_request( - resource_group_name: str, throughput_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - if content_type is not None: - _headers["Content-Type"] = _SERIALIZER.header("content_type", content_type, "str") - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="PATCH", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_delete_request( - resource_group_name: str, throughput_pool_name: str, subscription_id: str, **kwargs: Any -) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - "throughputPoolName": _SERIALIZER.url( - "throughput_pool_name", - throughput_pool_name, - "str", - max_length=50, - min_length=3, - pattern=r"^[a-z0-9]+(-[a-z0-9]+)*", - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="DELETE", url=_url, params=_params, headers=_headers, **kwargs) - - -class ThroughputPoolOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`throughput_pool` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def get(self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any) -> _models.ThroughputPoolResource: - """Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: ThroughputPoolResource or the result of cls(response) - :rtype: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource - :raises ~azure.core.exceptions.HttpResponseError: - """ - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolResource] = kwargs.pop("cls", None) - - _request = build_get_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_response) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - def _create_or_update_initial( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Union[_models.ThroughputPoolResource, IO[bytes]], - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - _json = self._serialize.body(body, "ThroughputPoolResource") - - _request = build_create_or_update_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 201]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: _models.ThroughputPoolResource, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: IO[bytes], - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. Required. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_create_or_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Union[_models.ThroughputPoolResource, IO[bytes]], - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred - when performing updates on an account. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current ThroughputPool. Is either a - ThroughputPoolResource type or a IO[bytes] type. Required. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolResource or IO[bytes] - :return: An instance of LROPoller that returns either ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ThroughputPoolResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._create_or_update_initial( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputPoolResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputPoolResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _update_initial( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[Union[_models.ThroughputPoolUpdate, IO[bytes]]] = None, - **kwargs: Any - ) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - content_type = content_type or "application/json" - _json = None - _content = None - if isinstance(body, (IOBase, bytes)): - _content = body - else: - if body is not None: - _json = self._serialize.body(body, "ThroughputPoolUpdate") - else: - _json = None - - _request = build_update_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - content_type=content_type, - json=_json, - content=_content, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [200, 202]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @overload - def begin_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[_models.ThroughputPoolUpdate] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Default value is None. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolUpdate - :keyword content_type: Body Parameter content-type. Content type parameter for JSON body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @overload - def begin_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[IO[bytes]] = None, - *, - content_type: str = "application/json", - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Default value is None. - :type body: IO[bytes] - :keyword content_type: Body Parameter content-type. Content type parameter for binary body. - Default value is "application/json". - :paramtype content_type: str - :return: An instance of LROPoller that returns either ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - - @distributed_trace - def begin_update( - self, - resource_group_name: str, - throughput_pool_name: str, - body: Optional[Union[_models.ThroughputPoolUpdate, IO[bytes]]] = None, - **kwargs: Any - ) -> LROPoller[_models.ThroughputPoolResource]: - """Updates the properties of an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :param body: The parameters to provide for the current Throughput Pool. Is either a - ThroughputPoolUpdate type or a IO[bytes] type. Default value is None. - :type body: ~azure.mgmt.cosmosdb.models.ThroughputPoolUpdate or IO[bytes] - :return: An instance of LROPoller that returns either ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - content_type: Optional[str] = kwargs.pop("content_type", _headers.pop("Content-Type", None)) - cls: ClsType[_models.ThroughputPoolResource] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._update_initial( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - body=body, - api_version=api_version, - content_type=content_type, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): - deserialized = self._deserialize("ThroughputPoolResource", pipeline_response.http_response) - if cls: - return cls(pipeline_response, deserialized, {}) # type: ignore - return deserialized - - if polling is True: - polling_method: PollingMethod = cast( - PollingMethod, ARMPolling(lro_delay, lro_options={"final-state-via": "azure-async-operation"}, **kwargs) - ) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[_models.ThroughputPoolResource].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[_models.ThroughputPoolResource]( - self._client, raw_result, get_long_running_output, polling_method # type: ignore - ) - - def _delete_initial(self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any) -> Iterator[bytes]: - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[Iterator[bytes]] = kwargs.pop("cls", None) - - _request = build_delete_request( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - _decompress = kwargs.pop("decompress", True) - _stream = True - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - - response = pipeline_response.http_response - - if response.status_code not in [202, 204]: - try: - response.read() # Load the body in memory and close the socket - except (StreamConsumedError, StreamClosedError): - pass - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - response_headers = {} - if response.status_code == 202: - response_headers["azure-AsyncOperation"] = self._deserialize( - "str", response.headers.get("azure-AsyncOperation") - ) - response_headers["location"] = self._deserialize("str", response.headers.get("location")) - - deserialized = response.stream_download(self._client._pipeline, decompress=_decompress) - - if cls: - return cls(pipeline_response, deserialized, response_headers) # type: ignore - - return deserialized # type: ignore - - @distributed_trace - def begin_delete(self, resource_group_name: str, throughput_pool_name: str, **kwargs: Any) -> LROPoller[None]: - """Deletes an existing Azure Cosmos DB Throughput Pool. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :param throughput_pool_name: Cosmos DB Throughput Pool name. Required. - :type throughput_pool_name: str - :return: An instance of LROPoller that returns either None or the result of cls(response) - :rtype: ~azure.core.polling.LROPoller[None] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[None] = kwargs.pop("cls", None) - polling: Union[bool, PollingMethod] = kwargs.pop("polling", True) - lro_delay = kwargs.pop("polling_interval", self._config.polling_interval) - cont_token: Optional[str] = kwargs.pop("continuation_token", None) - if cont_token is None: - raw_result = self._delete_initial( - resource_group_name=resource_group_name, - throughput_pool_name=throughput_pool_name, - api_version=api_version, - cls=lambda x, y, z: x, - headers=_headers, - params=_params, - **kwargs - ) - raw_result.http_response.read() # type: ignore - kwargs.pop("error_map", None) - - def get_long_running_output(pipeline_response): # pylint: disable=inconsistent-return-statements - if cls: - return cls(pipeline_response, None, {}) # type: ignore - - if polling is True: - polling_method: PollingMethod = cast(PollingMethod, ARMPolling(lro_delay, **kwargs)) - elif polling is False: - polling_method = cast(PollingMethod, NoPolling()) - else: - polling_method = polling - if cont_token: - return LROPoller[None].from_continuation_token( - polling_method=polling_method, - continuation_token=cont_token, - client=self._client, - deserialization_callback=get_long_running_output, - ) - return LROPoller[None](self._client, raw_result, get_long_running_output, polling_method) # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pools_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pools_operations.py deleted file mode 100644 index 1d8c75844ef3..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_throughput_pools_operations.py +++ /dev/null @@ -1,271 +0,0 @@ -# pylint: disable=too-many-lines,too-many-statements -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- -import sys -from typing import Any, Callable, Dict, Iterable, Optional, Type, TypeVar -import urllib.parse - -from azure.core.exceptions import ( - ClientAuthenticationError, - HttpResponseError, - ResourceExistsError, - ResourceNotFoundError, - ResourceNotModifiedError, - map_error, -) -from azure.core.paging import ItemPaged -from azure.core.pipeline import PipelineResponse -from azure.core.rest import HttpRequest, HttpResponse -from azure.core.tracing.decorator import distributed_trace -from azure.core.utils import case_insensitive_dict -from azure.mgmt.core.exceptions import ARMErrorFormat - -from .. import models as _models -from .._serialization import Serializer - -if sys.version_info >= (3, 9): - from collections.abc import MutableMapping -else: - from typing import MutableMapping # type: ignore # pylint: disable=ungrouped-imports -T = TypeVar("T") -ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] - -_SERIALIZER = Serializer() -_SERIALIZER.client_side_validation = False - - -def build_list_request(subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop("template_url", "/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools") - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -def build_list_by_resource_group_request(resource_group_name: str, subscription_id: str, **kwargs: Any) -> HttpRequest: - _headers = case_insensitive_dict(kwargs.pop("headers", {}) or {}) - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", "2024-09-01-preview")) - accept = _headers.pop("Accept", "application/json") - - # Construct URL - _url = kwargs.pop( - "template_url", - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools", - ) # pylint: disable=line-too-long - path_format_arguments = { - "subscriptionId": _SERIALIZER.url("subscription_id", subscription_id, "str", min_length=1), - "resourceGroupName": _SERIALIZER.url( - "resource_group_name", resource_group_name, "str", max_length=90, min_length=1 - ), - } - - _url: str = _url.format(**path_format_arguments) # type: ignore - - # Construct parameters - _params["api-version"] = _SERIALIZER.query("api_version", api_version, "str") - - # Construct headers - _headers["Accept"] = _SERIALIZER.header("accept", accept, "str") - - return HttpRequest(method="GET", url=_url, params=_params, headers=_headers, **kwargs) - - -class ThroughputPoolsOperations: - """ - .. warning:: - **DO NOT** instantiate this class directly. - - Instead, you should access the following operations through - :class:`~azure.mgmt.cosmosdb.CosmosDBManagementClient`'s - :attr:`throughput_pools` attribute. - """ - - models = _models - - def __init__(self, *args, **kwargs): - input_args = list(args) - self._client = input_args.pop(0) if input_args else kwargs.pop("client") - self._config = input_args.pop(0) if input_args else kwargs.pop("config") - self._serialize = input_args.pop(0) if input_args else kwargs.pop("serializer") - self._deserialize = input_args.pop(0) if input_args else kwargs.pop("deserializer") - - @distributed_trace - def list(self, **kwargs: Any) -> Iterable["_models.ThroughputPoolResource"]: - """Lists all the Azure Cosmos DB Throughput Pools available under the subscription. - - :return: An iterator like instance of either ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_request( - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) - - @distributed_trace - def list_by_resource_group( - self, resource_group_name: str, **kwargs: Any - ) -> Iterable["_models.ThroughputPoolResource"]: - """List all the ThroughputPools in a given resource group. - - :param resource_group_name: The name of the resource group. The name is case insensitive. - Required. - :type resource_group_name: str - :return: An iterator like instance of either ThroughputPoolResource or the result of - cls(response) - :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.ThroughputPoolResource] - :raises ~azure.core.exceptions.HttpResponseError: - """ - _headers = kwargs.pop("headers", {}) or {} - _params = case_insensitive_dict(kwargs.pop("params", {}) or {}) - - api_version: str = kwargs.pop("api_version", _params.pop("api-version", self._config.api_version)) - cls: ClsType[_models.ThroughputPoolsListResult] = kwargs.pop("cls", None) - - error_map: MutableMapping[int, Type[HttpResponseError]] = { - 401: ClientAuthenticationError, - 404: ResourceNotFoundError, - 409: ResourceExistsError, - 304: ResourceNotModifiedError, - } - error_map.update(kwargs.pop("error_map", {}) or {}) - - def prepare_request(next_link=None): - if not next_link: - - _request = build_list_by_resource_group_request( - resource_group_name=resource_group_name, - subscription_id=self._config.subscription_id, - api_version=api_version, - headers=_headers, - params=_params, - ) - _request.url = self._client.format_url(_request.url) - - else: - # make call to next link with the client's api-version - _parsed_next_link = urllib.parse.urlparse(next_link) - _next_request_params = case_insensitive_dict( - { - key: [urllib.parse.quote(v) for v in value] - for key, value in urllib.parse.parse_qs(_parsed_next_link.query).items() - } - ) - _next_request_params["api-version"] = self._config.api_version - _request = HttpRequest( - "GET", urllib.parse.urljoin(next_link, _parsed_next_link.path), params=_next_request_params - ) - _request.url = self._client.format_url(_request.url) - _request.method = "GET" - return _request - - def extract_data(pipeline_response): - deserialized = self._deserialize("ThroughputPoolsListResult", pipeline_response) - list_of_elem = deserialized.value - if cls: - list_of_elem = cls(list_of_elem) # type: ignore - return deserialized.next_link or None, iter(list_of_elem) - - def get_next(next_link=None): - _request = prepare_request(next_link) - - _stream = False - pipeline_response: PipelineResponse = self._client._pipeline.run( # pylint: disable=protected-access - _request, stream=_stream, **kwargs - ) - response = pipeline_response.http_response - - if response.status_code not in [200]: - map_error(status_code=response.status_code, response=response, error_map=error_map) - error = self._deserialize.failsafe_deserialize(_models.ErrorResponseAutoGenerated, pipeline_response) - raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat) - - return pipeline_response - - return ItemPaged(get_next, extract_data) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_enable_disable.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_enable_disable.py deleted file mode 100644 index 21db08675ba4..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_enable_disable.py +++ /dev/null @@ -1,51 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python chaos_fault_enable_disable.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.chaos_fault.begin_enable_disable( - resource_group_name="myResourceGroupName", - account_name="myAccountName", - chaos_fault="ServiceUnavailability", - chaos_fault_request={ - "properties": { - "action": "Enable", - "containerName": "testCollection", - "databaseName": "testDatabase", - "region": "EastUS", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/ChaosFaultEnableDisable.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_get.py deleted file mode 100644 index 8ab4d2772354..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python chaos_fault_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.chaos_fault.get( - resource_group_name="rg1", - account_name="ddb1", - chaos_fault="ServiceUnavailability", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/ChaosFaultGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_list.py deleted file mode 100644 index 7e58b7714e36..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/chaos_fault_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python chaos_fault_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.chaos_fault.list( - resource_group_name="rg1", - account_name="ddb1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/ChaosFaultList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_create_update.py index c98e32927b30..e6dfd7c2f5ff 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_delete.py index 921e6e30834a..03729a959053 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_get.py index 8152f1f9032c..7fa874e02f86 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_list.py index e64321fc7d62..5368140864ec 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_autoscale.py index 647c8f6c6865..6878f9ed72f8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_autoscale.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_manual_throughput.py index b64250e7595b..56374369ddc8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_migrate_to_manual_throughput.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_get.py index 9e707c164f7a..4286ee7e49b2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_update.py index a31d51c71bff..6e36534c0ca4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_keyspace_throughput_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraKeyspaceThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_create_update.py index de94f195156d..c9965ca41e7a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_create_update.py @@ -40,7 +40,6 @@ def main(): "properties": { "options": {}, "resource": { - "analyticalStorageTtl": 500, "defaultTtl": 100, "id": "tableName", "schema": { @@ -56,6 +55,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_delete.py index 50e0393dcd9d..d63f8b95107d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_get.py index a14052b9737a..3766b7a3cae1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_list.py index ef3f92082b93..96d2b18cb6cb 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_autoscale.py index 372230dc24ab..f637f5a0afaf 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_autoscale.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_manual_throughput.py index 9aab34e0e587..0df0d3c587c3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_migrate_to_manual_throughput.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_get.py index f9fe5848a2d0..dcc10a624658 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_update.py index b7ba8eb80838..a55e1fb6b4d8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_table_throughput_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraTableThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCassandraTableThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_create_update.py deleted file mode 100644 index 3064b7690a16..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_create_update.py +++ /dev/null @@ -1,54 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_create_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.begin_create_update_cassandra_view( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - create_update_cassandra_view_parameters={ - "properties": { - "options": {}, - "resource": { - "id": "viewname", - "viewDefinition": "SELECT columna, columnb, columnc FROM keyspacename.srctablename WHERE columna IS NOT NULL AND columnc IS NOT NULL PRIMARY (columnc, columna)", - }, - }, - "tags": {}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewCreateUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_delete.py deleted file mode 100644 index 8d179be7135d..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_delete.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - client.cassandra_resources.begin_delete_cassandra_view( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_get.py deleted file mode 100644 index c9f9526c1a53..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_get.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.get_cassandra_view( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_list.py deleted file mode 100644 index 58700fd707d5..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_list.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.list_cassandra_views( - resource_group_name="rgName", - account_name="ddb1", - keyspace_name="keyspacename", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_autoscale.py deleted file mode 100644 index d61a981f9bbf..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_autoscale.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_migrate_to_autoscale.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.begin_migrate_cassandra_view_to_autoscale( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewMigrateToAutoscale.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_manual_throughput.py deleted file mode 100644 index baa89f6d7ad5..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_migrate_to_manual_throughput.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_migrate_to_manual_throughput.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.begin_migrate_cassandra_view_to_manual_throughput( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewMigrateToManualThroughput.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_get.py deleted file mode 100644 index 8d2d321dfd57..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_get.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_throughput_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.get_cassandra_view_throughput( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewThroughputGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_update.py deleted file mode 100644 index 1f84aa10794d..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_cassandra_view_throughput_update.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_cassandra_view_throughput_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.cassandra_resources.begin_update_cassandra_view_throughput( - resource_group_name="rg1", - account_name="ddb1", - keyspace_name="keyspacename", - view_name="viewname", - update_throughput_parameters={"properties": {"resource": {"throughput": 400}}, "tags": {}}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCassandraViewThroughputUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metric_definitions.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metric_definitions.py index 55ab6a34179e..d7b7aa3041a5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metric_definitions.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metric_definitions.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionGetMetricDefinitions.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetricDefinitions.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metrics.py index 1b656fcb776f..d15a6b8071fb 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_metrics.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_usages.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_usages.py index 09e4d5a9f4f2..19248aeba582 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_usages.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_get_usages.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionGetUsages.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionGetUsages.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py index db9d7a0359bd..5839ae545e4f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_metrics.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionPartitionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py index 68808942293f..aa4354fb6675 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_get_usages.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionPartitionGetUsages.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionGetUsages.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py index 61aad718fdb3..a56d5304f59a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_collection_partition_region_get_metrics.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBCollectionPartitionRegionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBCollectionPartitionRegionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py index 7aea7131ae4f..5e1c9ab690ed 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDataTransferServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py index 9aa293719fad..42134b8b1fa5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDataTransferServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py index a57721fc73a1..d16cdb26da0f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_data_transfer_service_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDataTransferServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDataTransferServiceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_check_name_exists.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_check_name_exists.py index de9997050986..3ca0f18a1a04 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_check_name_exists.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_check_name_exists.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountCheckNameExists.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCheckNameExists.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_max.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_max.py index 79411c2fa9fc..7a39c3c2a36c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_max.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_max.py @@ -54,7 +54,6 @@ def main(): "type": "Periodic", }, "capacity": {"totalThroughputLimit": 2000}, - "capacityMode": "Provisioned", "consistencyPolicy": { "defaultConsistencyLevel": "BoundedStaleness", "maxIntervalInSeconds": 10, @@ -64,13 +63,10 @@ def main(): "createMode": "Default", "databaseAccountOfferType": "Standard", "defaultIdentity": "FirstPartyIdentity", - "defaultPriorityLevel": "Low", "enableAnalyticalStorage": True, "enableBurstCapacity": True, "enableFreeTier": False, - "enableMaterializedViews": False, "enablePerRegionPerPartitionAutoscale": True, - "enablePriorityBasedExecution": True, "ipRules": [{"ipAddressOrRange": "23.43.230.120"}, {"ipAddressOrRange": "110.12.240.0/12"}], "isVirtualNetworkFilterEnabled": True, "keyVaultKeyUri": "https://myKeyVault.vault.azure.net", @@ -97,6 +93,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountCreateMax.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMax.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_min.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_min.py index da4c335f97e8..6c0fd5f57481 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_min.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_create_min.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountCreateMin.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountCreateMin.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_delete.py index 20cd0da90610..7c7c61efa36b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_failover_priority_change.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_failover_priority_change.py index 34fdfd7d3c5a..c6c266fa2d4f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_failover_priority_change.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_failover_priority_change.py @@ -42,6 +42,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountFailoverPriorityChange.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get.py index 8a55a0a49dcb..6b37823fc5d6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metric_definitions.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metric_definitions.py index b0293f4f6848..918fa68e84e8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metric_definitions.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metric_definitions.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetricDefinitions.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metrics.py index 4d99f5234309..58f97505d9f5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_metrics.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_usages.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_usages.py index ef3fa9013cd2..9ddf3c760fe1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_usages.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_get_usages.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountGetUsages.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountGetUsages.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list.py index b89e26a5a327..2df3a49e4fda 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_by_resource_group.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_by_resource_group.py index 77456a56e90b..7427a6272e6b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_by_resource_group.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountListByResourceGroup.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings.py index 4fc70dc88103..b669f4d868c5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountListConnectionStrings.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStrings.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings_mongo.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings_mongo.py index 7b0a9e9d9a36..9f3ad0c79aee 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings_mongo.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_connection_strings_mongo.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListConnectionStringsMongo.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_keys.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_keys.py index 3fc9381285f6..4bf0f05387f0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_keys.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_keys.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountListKeys.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListKeys.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_read_only_keys.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_read_only_keys.py index 35f32bc4684d..6d49c8996e59 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_read_only_keys.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_list_read_only_keys.py @@ -30,13 +30,13 @@ def main(): subscription_id="subid", ) - response = client.database_accounts.list_read_only_keys( + response = client.database_accounts.get_read_only_keys( resource_group_name="rg1", account_name="ddb1", ) print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountListReadOnlyKeys.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_offline_region.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_offline_region.py index d90808c95e69..7218a99914ec 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_offline_region.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_offline_region.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountOfflineRegion.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOfflineRegion.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_online_region.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_online_region.py index 44d36c574c3c..bcde503fcbb3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_online_region.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_online_region.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountOnlineRegion.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountOnlineRegion.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_patch.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_patch.py index 51c03cb72ff0..c631cdce46f7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_patch.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_patch.py @@ -47,26 +47,22 @@ def main(): "periodicModeProperties": { "backupIntervalInMinutes": 240, "backupRetentionIntervalInHours": 720, - "backupStorageRedundancy": "Geo", + "backupStorageRedundancy": "Local", }, "type": "Periodic", }, "capacity": {"totalThroughputLimit": 2000}, - "capacityMode": "Provisioned", "consistencyPolicy": { "defaultConsistencyLevel": "BoundedStaleness", "maxIntervalInSeconds": 10, "maxStalenessPrefix": 200, }, "defaultIdentity": "FirstPartyIdentity", - "defaultPriorityLevel": "Low", - "diagnosticLogSettings": {"enableFullTextQuery": "True"}, "enableAnalyticalStorage": True, "enableBurstCapacity": True, "enableFreeTier": False, "enablePartitionMerge": True, "enablePerRegionPerPartitionAutoscale": True, - "enablePriorityBasedExecution": True, "ipRules": [{"ipAddressOrRange": "23.43.230.120"}, {"ipAddressOrRange": "110.12.240.0/12"}], "isVirtualNetworkFilterEnabled": True, "minimalTlsVersion": "Tls", @@ -87,6 +83,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountPatch.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountPatch.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_regenerate_key.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_regenerate_key.py index d64be491afc7..c94a7339d944 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_regenerate_key.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_regenerate_key.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountRegenerateKey.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegenerateKey.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_region_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_region_get_metrics.py index 74c6c26bcc8c..8298be4ba2a8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_region_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_account_region_get_metrics.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseAccountRegionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseAccountRegionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metric_definitions.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metric_definitions.py index eb1ffcb3a41c..8c03092fdbd4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metric_definitions.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metric_definitions.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseGetMetricDefinitions.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetricDefinitions.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metrics.py index d280c4fc168e..78a70e43f68f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_metrics.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_usages.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_usages.py index bd6e7a46f735..60c922653395 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_usages.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_database_get_usages.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBDatabaseGetUsages.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBDatabaseGetUsages.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py index 6a5ea477ed03..7d0abdfbeaca 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphAPIComputeServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py index a8eefd941b62..0b6d60a517b5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphAPIComputeServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py index 5bd47ceb6623..ed3e38cbb2a6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_api_compute_service_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphAPIComputeServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGraphAPIComputeServiceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py deleted file mode 100644 index 0a52885179f1..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_create_update.py +++ /dev/null @@ -1,48 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_graph_resource_create_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.graph_resources.begin_create_update_graph( - resource_group_name="rg1", - account_name="ddb1", - graph_name="graphName", - create_update_graph_parameters={ - "location": "West US", - "properties": {"options": {}, "resource": {"id": "graphName"}}, - "tags": {}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceCreateUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_delete.py deleted file mode 100644 index 326ba63b1841..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_graph_resource_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - client.graph_resources.begin_delete_graph_resource( - resource_group_name="rg1", - account_name="ddb1", - graph_name="graphName", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_get.py deleted file mode 100644 index 407cdb9eb5df..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_graph_resource_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.graph_resources.get_graph( - resource_group_name="rg1", - account_name="ddb1", - graph_name="graphName", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_list.py deleted file mode 100644 index 4975dcd0fb89..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_graph_resource_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_graph_resource_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.graph_resources.list_graphs( - resource_group_name="rgName", - account_name="ddb1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGraphResourceList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_create_update.py index 3a9e3c74a4be..9f283c19f19c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_delete.py index 059e30de8909..c2698f2b87d7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_get.py index 68e0c3fb9ac4..d79fac01fa06 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_list.py index 13309b343d6e..2293e69cf344 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_autoscale.py index 5edd7ab6a076..c76714a06f4d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_autoscale.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_manual_throughput.py index 5e92a9ebc312..96d130a78264 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_migrate_to_manual_throughput.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_get.py index c7db626353dd..25590f927210 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_update.py index 4d189413c92c..df18868a623d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_database_throughput_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinDatabaseThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinDatabaseThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_backup_information.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_backup_information.py index 8a1ba4e2ddb3..099af6b0689d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_backup_information.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_backup_information.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphBackupInformation.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_create_update.py index b6b03da4147e..d16373c68da1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_create_update.py @@ -67,6 +67,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_delete.py index 226efc89714c..3e60a9d0efa6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_get.py index ad810bceba6c..4b054650c213 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_list.py index 5757e5e4be51..88f340af36e2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_autoscale.py index 6f87820a9077..5250f4a53f2a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_autoscale.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_manual_throughput.py index bc3c146b421a..6c47ad20805d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_migrate_to_manual_throughput.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_get.py index 9067a2c76323..47c90f55d0ca 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_update.py index 160dc05921d4..44aac77ceb0e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_gremlin_graph_throughput_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBGremlinGraphThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBGremlinGraphThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_get.py index dd0f80f2280f..a564b0bdf3f7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_get.py @@ -36,6 +36,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBLocationGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_list.py index 70f1f943e325..21293ebe05e2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_location_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBLocationList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBLocationList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backup.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backup.py deleted file mode 100644 index 78564af41eab..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backup.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_managed_cassandra_backup.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cassandra_clusters.get_backup( - resource_group_name="cassandra-prod-rg", - cluster_name="cassandra-prod", - backup_id="1611250348", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraBackup.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backups_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backups_list.py deleted file mode 100644 index 7bcdd5904a38..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_backups_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_managed_cassandra_backups_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cassandra_clusters.list_backups( - resource_group_name="cassandra-prod-rg", - cluster_name="cassandra-prod", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraBackupsList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_create.py index dd638da66f46..a093657ded1c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_create.py @@ -27,7 +27,7 @@ def main(): client = CosmosDBManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.cassandra_clusters.begin_create_update( @@ -60,6 +60,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_deallocate.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_deallocate.py index 27bf16da9dc7..930c84ce5a27 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_deallocate.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_deallocate.py @@ -27,7 +27,7 @@ def main(): client = CosmosDBManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) client.cassandra_clusters.begin_deallocate( @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterDeallocate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDeallocate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_delete.py index 3132fb04faed..97300164bd04 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_delete.py @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_get.py index 1e3c1e2d5aaf..e8b7274c8d49 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_resource_group.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_resource_group.py index 637131903e6a..853cb2b64827 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_resource_group.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_resource_group.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListByResourceGroup.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_subscription.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_subscription.py index 70eee969c04e..4d2c7316f23e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_subscription.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_list_by_subscription.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterListBySubscription.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterListBySubscription.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_patch.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_patch.py index 6c3d5856a362..15d0bd3f83f3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_patch.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_patch.py @@ -52,6 +52,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterPatch.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterPatch.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_start.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_start.py index 2729662eeae3..958f10cfe602 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_start.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_cluster_start.py @@ -27,7 +27,7 @@ def main(): client = CosmosDBManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) client.cassandra_clusters.begin_start( @@ -36,6 +36,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraClusterStart.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraClusterStart.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command.py index 0606f4d442ce..2450ea697b17 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command.py @@ -27,17 +27,17 @@ def main(): client = CosmosDBManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.cassandra_clusters.begin_invoke_command( resource_group_name="cassandra-prod-rg", cluster_name="cassandra-prod", - body={"arguments": {"status": ""}, "command": "nodetool", "host": "10.0.1.12"}, + body={"command": "nodetool status", "host": "10.0.1.12"}, ).result() print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraCommand.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraCommand.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_async.py deleted file mode 100644 index 366ed0fcbec1..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_async.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_managed_cassandra_command_async.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cassandra_clusters.begin_invoke_command_async( - resource_group_name="cassandra-prod-rg", - cluster_name="cassandra-prod", - body={"arguments": {"status": ""}, "command": "nodetool", "host": "10.0.1.12"}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraCommandAsync.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_result.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_result.py deleted file mode 100644 index a9631c2b57c7..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_command_result.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_managed_cassandra_command_result.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cassandra_clusters.get_command_async( - resource_group_name="cassandra-prod-rg", - cluster_name="cassandra-prod", - command_id="318653d0-3da5-4814-b8f6-429f2af0b2a4", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraCommandResult.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_create.py index fc46036dc5a0..03a1342f89e7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_create.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_delete.py index 74aab8d54fb3..a09453311e90 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_get.py index 4c013c60e9c2..8469a43bca84 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_list.py index 8804ca584d9d..5095926c9fad 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py index 88343cba540e..2ad973d6f4b7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_data_center_patch.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraDataCenterPatch.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraDataCenterPatch.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_list_command.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_list_command.py deleted file mode 100644 index 1ce69822d602..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_list_command.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_managed_cassandra_list_command.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", - ) - - response = client.cassandra_clusters.list_command( - resource_group_name="cassandra-prod-rg", - cluster_name="cassandra-prod", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraListCommand.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_status.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_status.py index 27c15ad5f835..6c6c7ed4760d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_status.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_managed_cassandra_status.py @@ -27,7 +27,7 @@ def main(): client = CosmosDBManagementClient( credential=DefaultAzureCredential(), - subscription_id="00000000-0000-0000-0000-000000000000", + subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", ) response = client.cassandra_clusters.status( @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBManagedCassandraStatus.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBManagedCassandraStatus.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py index 51eb6d0643ec..9b464a716869 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_create.py @@ -41,6 +41,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py index 47e4fef892af..3f74e7036e5d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py index d0ef5cccad89..1da932f1505f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_materialized_views_builder_service_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMaterializedViewsBuilderServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMaterializedViewsBuilderServiceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_backup_information.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_backup_information.py index da7e8fb7a93c..d7a395bc6f28 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_backup_information.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_backup_information.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionBackupInformation.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_delete.py index 0d9268ad3918..b0b47e971976 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_get.py index 88d9e2c4e86d..2473601909c4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_list.py index 1036ee42c113..b881da8df86b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_autoscale.py index 14d8adbd6c98..b43853050153 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_autoscale.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_manual_throughput.py index 94807927a9fc..ad96dbfb4b08 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_migrate_to_manual_throughput.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_partition_merge.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_partition_merge.py deleted file mode 100644 index 309257ffcf55..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_partition_merge.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_collection_partition_merge.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_list_mongo_db_collection_partition_merge( - resource_group_name="rgName", - account_name="ddb1", - database_name="databaseName", - collection_name="collectionName", - merge_parameters={"isDryRun": False}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionPartitionMerge.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_redistribute_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_redistribute_throughput.py deleted file mode 100644 index 7532b16ccdd2..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_redistribute_throughput.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_collection_redistribute_throughput.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_mongo_db_container_redistribute_throughput( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - collection_name="collectionName", - redistribute_throughput_parameters={ - "properties": { - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "2", "throughput": 5000}, {"id": "3"}], - "targetPhysicalPartitionThroughputInfo": [ - {"id": "0", "throughput": 5000}, - {"id": "1", "throughput": 5000}, - ], - "throughputPolicy": "custom", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionRedistributeThroughput.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_retrieve_throughput_distribution.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_retrieve_throughput_distribution.py deleted file mode 100644 index 494822a9bee8..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_retrieve_throughput_distribution.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_collection_retrieve_throughput_distribution.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_mongo_db_container_retrieve_throughput_distribution( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - collection_name="collectionName", - retrieve_throughput_parameters={ - "properties": {"resource": {"physicalPartitionIds": [{"id": "0"}, {"id": "1"}]}} - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionRetrieveThroughputDistribution.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_get.py index c2eaf16a98e3..66ccadb8a9f8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_update.py index b7ca2060826d..e5b01728014c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_collection_throughput_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBCollectionThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBCollectionThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_delete.py index df3c48f33f9e..795d56fde772 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_get.py index 4a7864ba2268..c42c48319082 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_list.py index c02597d1068e..c43611480eec 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_autoscale.py index c0288bd43be6..c9c6825ca13c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_autoscale.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_manual_throughput.py index 3b9645879032..621982d8359c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_migrate_to_manual_throughput.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_partition_merge.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_partition_merge.py deleted file mode 100644 index 95e6b73ff3c8..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_partition_merge.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_database_partition_merge.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_mongo_db_database_partition_merge( - resource_group_name="rgName", - account_name="ddb1", - database_name="databaseName", - merge_parameters={"isDryRun": False}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabasePartitionMerge.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_redistribute_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_redistribute_throughput.py deleted file mode 100644 index b302c62ac1bb..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_redistribute_throughput.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_database_redistribute_throughput.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_mongo_db_database_redistribute_throughput( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - redistribute_throughput_parameters={ - "properties": { - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "2", "throughput": 5000}, {"id": "3"}], - "targetPhysicalPartitionThroughputInfo": [ - {"id": "0", "throughput": 5000}, - {"id": "1", "throughput": 5000}, - ], - "throughputPolicy": "custom", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseRedistributeThroughput.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_retrieve_throughput_distribution.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_retrieve_throughput_distribution.py deleted file mode 100644 index 3693023c703a..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_retrieve_throughput_distribution.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_mongo_db_database_retrieve_throughput_distribution.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.mongo_db_resources.begin_mongo_db_database_retrieve_throughput_distribution( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - retrieve_throughput_parameters={ - "properties": {"resource": {"physicalPartitionIds": [{"id": "0"}, {"id": "1"}]}} - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseRetrieveThroughputDistribution.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_get.py index 3d11c0ea4bae..2dde45ba0509 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_update.py index aefa9c0799b5..7875cb7c01e7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_database_throughput_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBDatabaseThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_create_update.py index 8d1586633de9..c6cf08544014 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_create_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_delete.py index 4f610531e581..4a806e9541df 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py index 4673699d1241..a41aa725f6f2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_list.py index 55d7effbd37e..06cca352b290 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_role_definition_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBRoleDefinitionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBRoleDefinitionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_create_update.py index b451b7bfb678..432a58e88f61 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_create_update.py @@ -48,6 +48,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_delete.py index 5e51f24a66c3..654d869b9ece 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_get.py index 2b1e0e02f3cc..47b233af1a91 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_list.py index 337bb6b0a6b9..8afdcf082269 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_mongo_db_user_definition_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBMongoDBUserDefinitionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBMongoDBUserDefinitionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_delete.py index e61cac0388bd..5761fbfc1d82 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBNotebookWorkspaceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_get.py index 7adc4c78e5ba..85f878d4dec2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBNotebookWorkspaceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list.py index 97873576b56b..a9b1addb8326 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBNotebookWorkspaceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list_connection_info.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list_connection_info.py index bd04326bda73..0e0641bcb4e4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list_connection_info.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_list_connection_info.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceListConnectionInfo.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_regenerate_auth_token.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_regenerate_auth_token.py index e43969f94b83..fa24401017d2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_regenerate_auth_token.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_regenerate_auth_token.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceRegenerateAuthToken.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_start.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_start.py index 3ebc7cb0e8f9..7c0bb9453ca9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_start.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_notebook_workspace_start.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBNotebookWorkspaceStart.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBNotebookWorkspaceStart.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_operations_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_operations_list.py index 6067e1b4795f..97e065dfd7dc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_operations_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_operations_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBOperationsList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBOperationsList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py index 8a46c23daa82..8db72d6ea5f6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_get_metrics.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPercentileGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py index 372fec0df32f..7dba75a72b27 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_source_target_get_metrics.py @@ -41,6 +41,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPercentileSourceTargetGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileSourceTargetGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py index 130647c84092..7e218af6b04e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_percentile_target_get_metrics.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPercentileTargetGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPercentileTargetGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py index 41080b048db3..45370205c7d4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py index d5eb288279ca..2a80f6462a0a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py index 40cadccb4a4d..5d6254a91f13 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_list_get.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionListGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionListGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py index d0ea039a4bf1..a0d4ec5bb7f2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_endpoint_connection_update.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateEndpointConnectionUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateEndpointConnectionUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py index 93f90e47bd38..b68932b437ab 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateLinkResourceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py index 9705b1dde97c..11ea0b004700 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_private_link_resource_list_get.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPrivateLinkResourceListGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPrivateLinkResourceListGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_region_collection_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_region_collection_get_metrics.py index 674ebb50d01d..f8da6d195b2c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_region_collection_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_region_collection_get_metrics.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRegionCollectionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRegionCollectionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_get.py index 11c7d30de936..e1a27b5ef54c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_get.py @@ -37,6 +37,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableDatabaseAccountGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_list.py index fe47eb52b7c9..f68e15a24052 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_list.py @@ -37,6 +37,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableDatabaseAccountList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_no_location_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_no_location_list.py index 98b012a8e411..db024bd07355 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_no_location_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_database_account_no_location_list.py @@ -35,6 +35,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableDatabaseAccountNoLocationList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_database_list.py index 2b38cb8ec64a..2be31618da52 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableGremlinDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_graph_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_graph_list.py index 4365465ab280..aa6c269834a6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_graph_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_graph_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableGremlinGraphList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinGraphList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_resource_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_resource_list.py index bd9e932c1e4c..41356d433473 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_resource_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_gremlin_resource_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableGremlinResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableGremlinResourceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_collection_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_collection_list.py index 71cdac8cc930..41fa6db63ca0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_collection_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_collection_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableMongodbCollectionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbCollectionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_database_list.py index 189f1cb487a8..e174656bc863 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableMongodbDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_resource_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_resource_list.py index d33d78217a17..56c11d475561 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_resource_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_mongodb_resource_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableMongodbResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableMongodbResourceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_container_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_container_list.py index 6fc9582b85d8..8522f58e6732 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_container_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_container_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableSqlContainerList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlContainerList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_database_list.py index b9591bc4e1b8..32b9b15afb2f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableSqlDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_resource_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_resource_list.py index 4b60fb4d1eae..d80af15b065c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_resource_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_sql_resource_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableSqlResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableSqlResourceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_list.py index 34e8b098dd60..c74ea017cc4d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableTableList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_resource_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_resource_list.py index 7b3830f9cf8e..2021959e163a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_resource_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restorable_table_resource_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestorableTableResourceList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestorableTableResourceList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py index b67ac021106e..ecbd5eac5bb2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_restore_database_account_create_update.py @@ -48,7 +48,6 @@ def main(): "databaseAccountOfferType": "Standard", "enableAnalyticalStorage": True, "enableFreeTier": False, - "enableMaterializedViews": False, "keyVaultKeyUri": "https://myKeyVault.vault.azure.net", "locations": [{"failoverPriority": 0, "isZoneRedundant": False, "locationName": "southcentralus"}], "minimalTlsVersion": "Tls", @@ -61,7 +60,6 @@ def main(): "restoreSource": "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/westus/restorableDatabaseAccounts/1a97b4bb-f6a0-430e-ade1-638d781830cc", "restoreTimestampInUtc": "2021-03-11T22:05:09Z", "restoreWithTtlDisabled": False, - "sourceBackupLocation": "westus", }, }, "tags": {}, @@ -70,6 +68,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBRestoreDatabaseAccountCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_services_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_services_list.py index 0653c37abb2c..ba081c1a2a97 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_services_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_services_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBServicesList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBServicesList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py index 869d4945da1c..4b37010d6995 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_create_update.py @@ -46,7 +46,7 @@ def main(): "type": "AzureKeyVault", "value": "AzureKeyVault Key URL", }, - "wrappedDataEncryptionKey": "VGhpcyBpcyBhY3R1YWxseSBhbiBhcnJheSBvZiBieXRlcy4gVGhpcyByZXF1ZXN0L3Jlc3BvbnNlIGlzIGJlaW5nIHByZXNlbnRlZCBhcyBhIHN0cmluZyBmb3IgcmVhZGFiaWxpdHkgaW4gdGhlIGV4YW1wbGU=", + "wrappedDataEncryptionKey": "U3dhZ2dlciByb2Nrcw==", } } }, @@ -54,6 +54,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py index 508f2a2e4a11..4d1d151e7b74 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_key_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlClientEncryptionKeyGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeyGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py index cf50255f3963..538d8e60cdbd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_client_encryption_keys_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlClientEncryptionKeysList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlClientEncryptionKeysList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_backup_information.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_backup_information.py index d1ace5fd2be6..731cb270b558 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_backup_information.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_backup_information.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerBackupInformation.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_create_update.py index 28f8c003e88b..1fe38e15824a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_create_update.py @@ -68,9 +68,36 @@ def main(): } ], "indexingMode": "consistent", + "vectorIndexes": [ + {"path": "/vectorPath1", "type": "flat"}, + {"path": "/vectorPath2", "type": "quantizedFlat"}, + {"path": "/vectorPath3", "type": "diskANN"}, + ], }, "partitionKey": {"kind": "Hash", "paths": ["/AccountNumber"]}, "uniqueKeyPolicy": {"uniqueKeys": [{"paths": ["/testPath"]}]}, + "vectorEmbeddingPolicy": { + "vectorEmbeddings": [ + { + "dataType": "float32", + "dimensions": 400, + "distanceFunction": "euclidean", + "path": "/vectorPath1", + }, + { + "dataType": "uint8", + "dimensions": 512, + "distanceFunction": "cosine", + "path": "/vectorPath2", + }, + { + "dataType": "int8", + "dimensions": 512, + "distanceFunction": "dotproduct", + "path": "/vectorPath3", + }, + ] + }, }, }, "tags": {}, @@ -79,6 +106,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_delete.py index 2638fd4d47e3..5dc4ef80bcfc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_delete.py @@ -38,6 +38,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_get.py index b0079349913e..e24d550a4b00 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_list.py index 21f351930f43..66343b556226 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_list.py @@ -39,6 +39,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_autoscale.py index 9f8b7360a756..408e679f6850 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_autoscale.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_manual_throughput.py index 20502aeef7cf..9768c3f11b34 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_migrate_to_manual_throughput.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_partition_merge.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_partition_merge.py deleted file mode 100644 index 069641d2b91e..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_partition_merge.py +++ /dev/null @@ -1,45 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_container_partition_merge.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_list_sql_container_partition_merge( - resource_group_name="rgName", - account_name="ddb1", - database_name="databaseName", - container_name="containerName", - merge_parameters={"isDryRun": False}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerPartitionMerge.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_redistribute_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_redistribute_throughput.py deleted file mode 100644 index 368379b4dfae..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_redistribute_throughput.py +++ /dev/null @@ -1,56 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_container_redistribute_throughput.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_sql_container_redistribute_throughput( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - container_name="containerName", - redistribute_throughput_parameters={ - "properties": { - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "2", "throughput": 5000}, {"id": "3"}], - "targetPhysicalPartitionThroughputInfo": [ - {"id": "0", "throughput": 5000}, - {"id": "1", "throughput": 5000}, - ], - "throughputPolicy": "custom", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerRedistributeThroughput.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_restore.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_restore.py deleted file mode 100644 index 7ffb7beb15c3..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_restore.py +++ /dev/null @@ -1,60 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_container_restore.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_create_update_sql_container( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - container_name="containerName", - create_update_sql_container_parameters={ - "location": "West US", - "properties": { - "options": {}, - "resource": { - "createMode": "Restore", - "id": "containerName", - "restoreParameters": { - "restoreSource": "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - "restoreTimestampInUtc": "2022-07-20T18:28:00Z", - "restoreWithTtlDisabled": True, - }, - }, - }, - "tags": {}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerRestore.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_retrieve_throughput_distribution.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_retrieve_throughput_distribution.py deleted file mode 100644 index 5112d4259412..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_retrieve_throughput_distribution.py +++ /dev/null @@ -1,47 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_container_retrieve_throughput_distribution.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_sql_container_retrieve_throughput_distribution( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - container_name="containerName", - retrieve_throughput_parameters={ - "properties": {"resource": {"physicalPartitionIds": [{"id": "0"}, {"id": "1"}]}} - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerRetrieveThroughputDistribution.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_get.py index 4a195183f805..aaab187c6a56 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_get.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_update.py index ce6466d3cb6c..53044473def4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_container_throughput_update.py @@ -44,6 +44,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlContainerThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlContainerThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_create_update.py index 023bb0f65807..e2ee6118b612 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py index d424fa717d0e..b56a73310ed9 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py index 94be3a9bfc16..93b1712974c2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py index 23f96456fdf0..7e993df9d70e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_autoscale.py index d3240e30cdc2..2830c1a09640 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_autoscale.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_manual_throughput.py index 007d55296346..ad69ed9ee607 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_migrate_to_manual_throughput.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_partition_merge.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_partition_merge.py deleted file mode 100644 index 657d7a1b0f2a..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_partition_merge.py +++ /dev/null @@ -1,44 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_database_partition_merge.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_sql_database_partition_merge( - resource_group_name="rgName", - account_name="ddb1", - database_name="databaseName", - merge_parameters={"isDryRun": False}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabasePartitionMerge.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_redistribute_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_redistribute_throughput.py deleted file mode 100644 index 61a1bc15f47e..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_redistribute_throughput.py +++ /dev/null @@ -1,55 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_database_redistribute_throughput.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_sql_database_redistribute_throughput( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - redistribute_throughput_parameters={ - "properties": { - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "2", "throughput": 5000}, {"id": "3"}], - "targetPhysicalPartitionThroughputInfo": [ - {"id": "0", "throughput": 5000}, - {"id": "1", "throughput": 5000}, - ], - "throughputPolicy": "custom", - } - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseRedistributeThroughput.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_restore.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_restore.py deleted file mode 100644 index de989e3eccf2..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_restore.py +++ /dev/null @@ -1,59 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_database_restore.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_create_update_sql_database( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - create_update_sql_database_parameters={ - "location": "West US", - "properties": { - "options": {}, - "resource": { - "createMode": "Restore", - "id": "databaseName", - "restoreParameters": { - "restoreSource": "/subscriptions/subid/providers/Microsoft.DocumentDB/locations/WestUS/restorableDatabaseAccounts/restorableDatabaseAccountId", - "restoreTimestampInUtc": "2022-07-20T18:28:00Z", - "restoreWithTtlDisabled": True, - }, - }, - }, - "tags": {}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseRestore.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_retrieve_throughput_distribution.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_retrieve_throughput_distribution.py deleted file mode 100644 index d6f3b2d2ae68..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_retrieve_throughput_distribution.py +++ /dev/null @@ -1,46 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_database_retrieve_throughput_distribution.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_sql_database_retrieve_throughput_distribution( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - retrieve_throughput_parameters={ - "properties": {"resource": {"physicalPartitionIds": [{"id": "0"}, {"id": "1"}]}} - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseRetrieveThroughputDistribution.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_get.py index db656352d35a..a529ed26bf06 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_update.py index 894f11afa7a2..e0f3a1d79a27 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_database_throughput_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlDatabaseThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlDatabaseThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_materialized_view_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_materialized_view_create_update.py deleted file mode 100644 index d901f918c47a..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_materialized_view_create_update.py +++ /dev/null @@ -1,73 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_sql_materialized_view_create_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.sql_resources.begin_create_update_sql_container( - resource_group_name="rg1", - account_name="ddb1", - database_name="databaseName", - container_name="mvContainerName", - create_update_sql_container_parameters={ - "location": "West US", - "properties": { - "options": {}, - "resource": { - "id": "mvContainerName", - "indexingPolicy": { - "automatic": True, - "excludedPaths": [], - "includedPaths": [ - { - "indexes": [ - {"dataType": "String", "kind": "Range", "precision": -1}, - {"dataType": "Number", "kind": "Range", "precision": -1}, - ], - "path": "/*", - } - ], - "indexingMode": "consistent", - }, - "materializedViewDefinition": { - "definition": "select * from ROOT", - "sourceCollectionId": "sourceContainerName", - }, - "partitionKey": {"kind": "Hash", "paths": ["/mvpk"]}, - }, - }, - "tags": {}, - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlMaterializedViewCreateUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_create_update.py index 94d3cd015103..fc67f17a7708 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_create_update.py @@ -45,6 +45,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_delete.py index d2c96c953125..271f3c35612c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_get.py index 76cd77b62d12..603acdfa04fe 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_list.py index ab8fec5e02a7..da61f9455563 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_assignment_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleAssignmentList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleAssignmentList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_create_update.py index fd020cd543b6..6eff1f619bbb 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_create_update.py @@ -57,6 +57,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_delete.py index f5d9c19d0944..37d17e2dd96b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_get.py index 78fc5852d4a5..1d5a33f34de3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_list.py index 822c03900bba..2e1a7693d3d1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_role_definition_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlRoleDefinitionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlRoleDefinitionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_create_update.py index 4820fb1b1422..b19af635bb67 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_delete.py index 758b4e28a2c0..0d99777c9f55 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_get.py index c574375879b8..4ff024c4dd52 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_list.py index ba86c213653d..8b06695dfb8c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_stored_procedure_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlStoredProcedureList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlStoredProcedureList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_create_update.py index a2b6d948d842..9b4226afba0a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_create_update.py @@ -51,6 +51,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_delete.py index 38b12e6604d8..d4f5a1669c87 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_get.py index 2423fb46114f..37319ad7bc66 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_list.py index b92022633b18..154288961b61 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_trigger_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlTriggerList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlTriggerList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_create_update.py index 7db97a88a772..338e991572a6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_delete.py index 63ec990568b6..31e53eaa6edb 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_delete.py @@ -39,6 +39,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_get.py index deca52636847..a71cef9b1918 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_get.py @@ -40,6 +40,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_list.py index 2d9e927eb2a0..3a8f6bb80161 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_sql_user_defined_function_list.py @@ -40,6 +40,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBSqlUserDefinedFunctionList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBSqlUserDefinedFunctionList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py index f43170b7862b..eff1864af543 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_backup_information.py @@ -39,6 +39,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableBackupInformation.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableBackupInformation.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py index 97053a60f9d0..3d11430228e8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_create_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableCreateUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableCreateUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_delete.py index 312d9e1bfd2b..c7f24055f705 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_get.py index 7249f9254989..b1d00c7b3fe7 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_list.py index fd673465424f..98adb679ab7c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_list.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_list.py @@ -38,6 +38,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableList.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableList.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_autoscale.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_autoscale.py index 2eb0b74252f7..97b4abc85a3a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_autoscale.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_autoscale.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableMigrateToAutoscale.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToAutoscale.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_manual_throughput.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_manual_throughput.py index d34ad7641c9d..6571ddaa2bdc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_manual_throughput.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_migrate_to_manual_throughput.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableMigrateToManualThroughput.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableMigrateToManualThroughput.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_get.py index faf03641538b..072decdd7b8f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableThroughputGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_update.py index 4f0e56204215..b896542d4362 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_update.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_db_table_throughput_update.py @@ -43,6 +43,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBTableThroughputUpdate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBTableThroughputUpdate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py index 599bdfee28fd..2adf8987466a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_get_metrics.py @@ -42,6 +42,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPKeyRangeIdGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py index 77d02b3cfece..0ef22666dcca 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/cosmos_dbp_key_range_id_region_get_metrics.py @@ -43,6 +43,6 @@ def main(): print(item) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/CosmosDBPKeyRangeIdRegionGetMetrics.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_cancel.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_cancel.py deleted file mode 100644 index d7438d090209..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_cancel.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_cancel.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.cancel( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCancel.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_complete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_complete.py deleted file mode 100644 index 9804e6207595..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_complete.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_complete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="e35cc6eb-c8e3-447b-8de6-b83328cd0098", - ) - - response = client.data_transfer_jobs.complete( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobComplete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_create.py deleted file mode 100644 index 07e43e0118a0..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_create.py +++ /dev/null @@ -1,53 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.create( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - job_create_parameters={ - "properties": { - "destination": { - "component": "AzureBlobStorage", - "containerName": "blob_container", - "endpointUrl": "https://blob.windows.net", - }, - "source": {"component": "CosmosDBCassandra", "keyspaceName": "keyspace", "tableName": "table"}, - } - }, - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_feed.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_feed.py deleted file mode 100644 index 43b0c3826ef6..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_feed.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_feed.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.list_by_database_account( - resource_group_name="rg1", - account_name="ddb1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobFeed.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_get.py deleted file mode 100644 index 88d2a7d9efd0..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.get( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_pause.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_pause.py deleted file mode 100644 index 9c6ae52d10e2..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_pause.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_pause.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.pause( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobPause.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_resume.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_resume.py deleted file mode 100644 index 2540c5826a41..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/datatransferservice/cosmos_db_data_transfer_job_resume.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_data_transfer_job_resume.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="subid", - ) - - response = client.data_transfer_jobs.resume( - resource_group_name="rg1", - account_name="ddb1", - job_name="j1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/data-transfer-service/CosmosDBDataTransferJobResume.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_get.py deleted file mode 100644 index 23a0509dc457..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python network_security_perimeter_configuration_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.network_security_perimeter_configurations.get( - resource_group_name="res4410", - account_name="cosmosTest", - network_security_perimeter_configuration_name="dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/NetworkSecurityPerimeterConfigurationGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_list.py deleted file mode 100644 index 362f7382d00a..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python network_security_perimeter_configuration_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.network_security_perimeter_configurations.list( - resource_group_name="res4410", - account_name="cosmosTest", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/NetworkSecurityPerimeterConfigurationList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_reconcile.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_reconcile.py deleted file mode 100644 index 0d2d1f64950d..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/network_security_perimeter_configuration_reconcile.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python network_security_perimeter_configuration_reconcile.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.network_security_perimeter_configurations.begin_reconcile( - resource_group_name="res4410", - account_name="sto8607", - network_security_perimeter_configuration_name="dbedb4e0-40e6-4145-81f3-f1314c150774.resourceAssociation1", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/NetworkSecurityPerimeterConfigurationReconcile.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_create.py index 47a33023eca3..2f9752511f3c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_create.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_create.py @@ -46,6 +46,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceCreate.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_delete.py index f773df921d1e..f33aba441c6e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_delete.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_delete.py @@ -37,6 +37,6 @@ def main(): ).result() -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceDelete.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_get.py index f488f09cdc5a..1252e0a98db3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_get.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/services/sqldedicatedgateway/cosmos_db_sql_dedicated_gateway_service_get.py @@ -38,6 +38,6 @@ def main(): print(response) -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json +# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2024-11-15/examples/services/sqldedicatedgateway/CosmosDBSqlDedicatedGatewayServiceGet.json if __name__ == "__main__": main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_create.py deleted file mode 100644 index 1b10d0731acb..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_create.py +++ /dev/null @@ -1,49 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_account_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool_account.begin_create( - resource_group_name="rg1", - throughput_pool_name="tp1", - throughput_pool_account_name="db1", - body={ - "properties": { - "accountLocation": "West US", - "accountResourceIdentifier": "/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/providers/Microsoft.DocumentDB/resourceGroup/rg1/databaseAccounts/db1/", - } - }, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_delete.py deleted file mode 100644 index 3447a5bef3c9..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_delete.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_account_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.throughput_pool_account.begin_delete( - resource_group_name="rgName", - throughput_pool_name="tp1", - throughput_pool_account_name="db1", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_get.py deleted file mode 100644 index 41b443ec03a6..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_account_get.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_account_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool_account.get( - resource_group_name="rgName", - throughput_pool_name="tp1", - throughput_pool_account_name="db1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_accounts_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_accounts_list.py deleted file mode 100644 index 3fc2ba41a6f8..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_accounts_list.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_accounts_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool_accounts.list( - resource_group_name="rgName", - throughput_pool_name="tp1", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolAccountsList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_create.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_create.py deleted file mode 100644 index 3e04c5f35130..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_create.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_create.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool.begin_create_or_update( - resource_group_name="rg1", - throughput_pool_name="tp1", - body={"location": "westus2", "properties": {"maxThroughput": 10000}, "tags": {}}, - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolCreate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_delete.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_delete.py deleted file mode 100644 index 1997cf89c770..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_delete.py +++ /dev/null @@ -1,41 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_delete.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - client.throughput_pool.begin_delete( - resource_group_name="rgName", - throughput_pool_name="tp1", - ).result() - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolDelete.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_get.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_get.py deleted file mode 100644 index cd44591c05de..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_get.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_get.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool.get( - resource_group_name="rgName", - throughput_pool_name="tp1", - ) - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolGet.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_list.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_list.py deleted file mode 100644 index d43470615083..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_list.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_list.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pools.list_by_resource_group( - resource_group_name="rgName", - ) - for item in response: - print(item) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolList.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_update.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_update.py deleted file mode 100644 index a0efbeddef99..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_samples/throughput_pool/cosmos_db_throughput_pool_update.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for license information. -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is regenerated. -# -------------------------------------------------------------------------- - -from azure.identity import DefaultAzureCredential - -from azure.mgmt.cosmosdb import CosmosDBManagementClient - -""" -# PREREQUISITES - pip install azure-identity - pip install azure-mgmt-cosmosdb -# USAGE - python cosmos_db_throughput_pool_update.py - - Before run the sample, please set the values of the client ID, tenant ID and client secret - of the AAD application as environment variables: AZURE_CLIENT_ID, AZURE_TENANT_ID, - AZURE_CLIENT_SECRET. For more info about how to get the value, please see: - https://docs.microsoft.com/azure/active-directory/develop/howto-create-service-principal-portal -""" - - -def main(): - client = CosmosDBManagementClient( - credential=DefaultAzureCredential(), - subscription_id="ffffffff-ffff-ffff-ffff-ffffffffffff", - ) - - response = client.throughput_pool.begin_update( - resource_group_name="rg1", - throughput_pool_name="tp1", - ).result() - print(response) - - -# x-ms-original-file: specification/cosmos-db/resource-manager/Microsoft.DocumentDB/preview/2024-09-01-preview/examples/throughputPool/CosmosDBThroughputPoolUpdate.json -if __name__ == "__main__": - main() diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations.py index a1f3d557a9bd..9577a7745fd8 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_list_by_subscription(self, resource_group): response = self.client.cassandra_clusters.list_by_subscription( - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_list_by_subscription(self, resource_group): def test_list_by_resource_group(self, resource_group): response = self.client.cassandra_clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get(self, resource_group): response = self.client.cassandra_clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -57,7 +57,7 @@ def test_begin_delete(self, resource_group): response = self.client.cassandra_clusters.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -76,18 +76,13 @@ def test_begin_create_update(self, resource_group): "name": "str", "properties": { "authenticationMethod": "str", - "autoReplicate": "str", "azureConnectionMethod": "str", - "backupSchedules": [{"cronExpression": "str", "retentionInHours": 0, "scheduleName": "str"}], "cassandraAuditLoggingEnabled": bool, "cassandraVersion": "str", "clientCertificates": [{"pem": "str"}], "clusterNameOverride": "str", - "clusterType": "str", "deallocated": bool, "delegatedManagementSubnetId": "str", - "extensions": ["str"], - "externalDataCenters": ["str"], "externalGossipCertificates": [{"pem": "str"}], "externalSeedNodes": [{"ipAddress": "str"}], "gossipCertificates": [{"pem": "str"}], @@ -99,13 +94,12 @@ def test_begin_create_update(self, resource_group): "provisioningState": "str", "repairEnabled": bool, "restoreFromBackupId": "str", - "scheduledEventStrategy": "str", "seedNodes": [{"ipAddress": "str"}], }, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -124,18 +118,13 @@ def test_begin_update(self, resource_group): "name": "str", "properties": { "authenticationMethod": "str", - "autoReplicate": "str", "azureConnectionMethod": "str", - "backupSchedules": [{"cronExpression": "str", "retentionInHours": 0, "scheduleName": "str"}], "cassandraAuditLoggingEnabled": bool, "cassandraVersion": "str", "clientCertificates": [{"pem": "str"}], "clusterNameOverride": "str", - "clusterType": "str", "deallocated": bool, "delegatedManagementSubnetId": "str", - "extensions": ["str"], - "externalDataCenters": ["str"], "externalGossipCertificates": [{"pem": "str"}], "externalSeedNodes": [{"ipAddress": "str"}], "gossipCertificates": [{"pem": "str"}], @@ -147,13 +136,12 @@ def test_begin_update(self, resource_group): "provisioningState": "str", "repairEnabled": bool, "restoreFromBackupId": "str", - "scheduledEventStrategy": "str", "seedNodes": [{"ipAddress": "str"}], }, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -165,83 +153,26 @@ def test_begin_invoke_command(self, resource_group): response = self.client.cassandra_clusters.begin_invoke_command( resource_group_name=resource_group.name, cluster_name="str", - body={"command": "str", "host": "str", "arguments": {}, "cassandra-stop-start": bool, "readWrite": bool}, - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_invoke_command_async(self, resource_group): - response = self.client.cassandra_clusters.begin_invoke_command_async( - resource_group_name=resource_group.name, - cluster_name="str", - body={"command": "str", "host": "str", "arguments": {}, "cassandra-stop-start": bool, "readWrite": bool}, - api_version="2024-09-01-preview", + body={ + "command": "str", + "host": "str", + "arguments": {"str": "str"}, + "cassandra-stop-start": bool, + "readwrite": bool, + }, + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_command(self, resource_group): - response = self.client.cassandra_clusters.list_command( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-09-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get_command_async(self, resource_group): - response = self.client.cassandra_clusters.get_command_async( - resource_group_name=resource_group.name, - cluster_name="str", - command_id="str", - api_version="2024-09-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_backups(self, resource_group): - response = self.client.cassandra_clusters.list_backups( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-09-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get_backup(self, resource_group): - response = self.client.cassandra_clusters.get_backup( - resource_group_name=resource_group.name, - cluster_name="str", - backup_id="str", - api_version="2024-09-01-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy def test_begin_deallocate(self, resource_group): response = self.client.cassandra_clusters.begin_deallocate( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -253,7 +184,7 @@ def test_begin_start(self, resource_group): response = self.client.cassandra_clusters.begin_start( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -265,7 +196,7 @@ def test_status(self, resource_group): response = self.client.cassandra_clusters.status( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations_async.py index 9b62e08071ec..c40607b62ef6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_clusters_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_list_by_subscription(self, resource_group): response = self.client.cassandra_clusters.list_by_subscription( - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_list_by_subscription(self, resource_group): async def test_list_by_resource_group(self, resource_group): response = self.client.cassandra_clusters.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get(self, resource_group): response = await self.client.cassandra_clusters.get( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -59,7 +59,7 @@ async def test_begin_delete(self, resource_group): await self.client.cassandra_clusters.begin_delete( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -80,18 +80,13 @@ async def test_begin_create_update(self, resource_group): "name": "str", "properties": { "authenticationMethod": "str", - "autoReplicate": "str", "azureConnectionMethod": "str", - "backupSchedules": [{"cronExpression": "str", "retentionInHours": 0, "scheduleName": "str"}], "cassandraAuditLoggingEnabled": bool, "cassandraVersion": "str", "clientCertificates": [{"pem": "str"}], "clusterNameOverride": "str", - "clusterType": "str", "deallocated": bool, "delegatedManagementSubnetId": "str", - "extensions": ["str"], - "externalDataCenters": ["str"], "externalGossipCertificates": [{"pem": "str"}], "externalSeedNodes": [{"ipAddress": "str"}], "gossipCertificates": [{"pem": "str"}], @@ -108,13 +103,12 @@ async def test_begin_create_update(self, resource_group): "provisioningState": "str", "repairEnabled": bool, "restoreFromBackupId": "str", - "scheduledEventStrategy": "str", "seedNodes": [{"ipAddress": "str"}], }, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -135,18 +129,13 @@ async def test_begin_update(self, resource_group): "name": "str", "properties": { "authenticationMethod": "str", - "autoReplicate": "str", "azureConnectionMethod": "str", - "backupSchedules": [{"cronExpression": "str", "retentionInHours": 0, "scheduleName": "str"}], "cassandraAuditLoggingEnabled": bool, "cassandraVersion": "str", "clientCertificates": [{"pem": "str"}], "clusterNameOverride": "str", - "clusterType": "str", "deallocated": bool, "delegatedManagementSubnetId": "str", - "extensions": ["str"], - "externalDataCenters": ["str"], "externalGossipCertificates": [{"pem": "str"}], "externalSeedNodes": [{"ipAddress": "str"}], "gossipCertificates": [{"pem": "str"}], @@ -163,13 +152,12 @@ async def test_begin_update(self, resource_group): "provisioningState": "str", "repairEnabled": bool, "restoreFromBackupId": "str", - "scheduledEventStrategy": "str", "seedNodes": [{"ipAddress": "str"}], }, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -186,88 +174,17 @@ async def test_begin_invoke_command(self, resource_group): body={ "command": "str", "host": "str", - "arguments": {}, + "arguments": {"str": "str"}, "cassandra-stop-start": bool, - "readWrite": bool, + "readwrite": bool, }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_invoke_command_async(self, resource_group): - response = await ( - await self.client.cassandra_clusters.begin_invoke_command_async( - resource_group_name=resource_group.name, - cluster_name="str", - body={ - "command": "str", - "host": "str", - "arguments": {}, - "cassandra-stop-start": bool, - "readWrite": bool, - }, - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_command(self, resource_group): - response = self.client.cassandra_clusters.list_command( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-09-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get_command_async(self, resource_group): - response = await self.client.cassandra_clusters.get_command_async( - resource_group_name=resource_group.name, - cluster_name="str", - command_id="str", - api_version="2024-09-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_backups(self, resource_group): - response = self.client.cassandra_clusters.list_backups( - resource_group_name=resource_group.name, - cluster_name="str", - api_version="2024-09-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get_backup(self, resource_group): - response = await self.client.cassandra_clusters.get_backup( - resource_group_name=resource_group.name, - cluster_name="str", - backup_id="str", - api_version="2024-09-01-preview", - ) - - # please add some check logic here by yourself - # ... - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async async def test_begin_deallocate(self, resource_group): @@ -275,7 +192,7 @@ async def test_begin_deallocate(self, resource_group): await self.client.cassandra_clusters.begin_deallocate( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -289,7 +206,7 @@ async def test_begin_start(self, resource_group): await self.client.cassandra_clusters.begin_start( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -302,7 +219,7 @@ async def test_status(self, resource_group): response = await self.client.cassandra_clusters.status( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations.py index f638d39505d5..bd525063a0bd 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.cassandra_data_centers.list( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", data_center_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -50,7 +50,7 @@ def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", data_center_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -95,7 +95,7 @@ def test_begin_create_update(self, resource_group): }, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -140,7 +140,7 @@ def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations_async.py index 2067440d6c62..f1148a933b48 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_data_centers_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.cassandra_data_centers.list( resource_group_name=resource_group.name, cluster_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", data_center_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -52,7 +52,7 @@ async def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, cluster_name="str", data_center_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +104,7 @@ async def test_begin_create_update(self, resource_group): }, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -156,7 +156,7 @@ async def test_begin_update(self, resource_group): }, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations.py index 37ba4872fba2..e651851e0ebe 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations.py @@ -24,7 +24,7 @@ def test_list_cassandra_keyspaces(self, resource_group): response = self.client.cassandra_resources.list_cassandra_keyspaces( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get_cassandra_keyspace(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -53,19 +53,13 @@ def test_begin_create_update_cassandra_keyspace(self, resource_group): create_update_cassandra_keyspace_parameters={ "resource": {"id": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -78,7 +72,7 @@ def test_begin_delete_cassandra_keyspace(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -91,7 +85,7 @@ def test_get_cassandra_keyspace_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -118,18 +112,12 @@ def test_begin_update_cassandra_keyspace_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -142,7 +130,7 @@ def test_begin_migrate_cassandra_keyspace_to_autoscale(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -155,7 +143,7 @@ def test_begin_migrate_cassandra_keyspace_to_manual_throughput(self, resource_gr resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -168,7 +156,7 @@ def test_list_cassandra_tables(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -182,7 +170,7 @@ def test_get_cassandra_table(self, resource_group): account_name="str", keyspace_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -208,19 +196,13 @@ def test_begin_create_update_cassandra_table(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -234,7 +216,7 @@ def test_begin_delete_cassandra_table(self, resource_group): account_name="str", keyspace_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -248,7 +230,7 @@ def test_get_cassandra_table_throughput(self, resource_group): account_name="str", keyspace_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -276,18 +258,12 @@ def test_begin_update_cassandra_table_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -301,7 +277,7 @@ def test_begin_migrate_cassandra_table_to_autoscale(self, resource_group): account_name="str", keyspace_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -315,158 +291,7 @@ def test_begin_migrate_cassandra_table_to_manual_throughput(self, resource_group account_name="str", keyspace_name="str", table_name="str", - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_cassandra_views(self, resource_group): - response = self.client.cassandra_resources.list_cassandra_views( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - api_version="2024-09-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get_cassandra_view(self, resource_group): - response = self.client.cassandra_resources.get_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-09-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_create_update_cassandra_view(self, resource_group): - response = self.client.cassandra_resources.begin_create_update_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - create_update_cassandra_view_parameters={ - "resource": {"id": "str", "viewDefinition": "str"}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_delete_cassandra_view(self, resource_group): - response = self.client.cassandra_resources.begin_delete_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get_cassandra_view_throughput(self, resource_group): - response = self.client.cassandra_resources.get_cassandra_view_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-09-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_update_cassandra_view_throughput(self, resource_group): - response = self.client.cassandra_resources.begin_update_cassandra_view_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - update_throughput_parameters={ - "resource": { - "autoscaleSettings": { - "maxThroughput": 0, - "autoUpgradePolicy": {"throughputPolicy": {"incrementPercent": 0, "isEnabled": bool}}, - "targetMaxThroughput": 0, - }, - "instantMaximumThroughput": "str", - "minimumThroughput": "str", - "offerReplacePending": "str", - "softAllowedMaximumThroughput": "str", - "throughput": 0, - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_migrate_cassandra_view_to_autoscale(self, resource_group): - response = self.client.cassandra_resources.begin_migrate_cassandra_view_to_autoscale( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_migrate_cassandra_view_to_manual_throughput(self, resource_group): - response = self.client.cassandra_resources.begin_migrate_cassandra_view_to_manual_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations_async.py index 2701ec4e98d4..b9b5b5ff4797 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_cassandra_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_list_cassandra_keyspaces(self, resource_group): response = self.client.cassandra_resources.list_cassandra_keyspaces( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get_cassandra_keyspace(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -55,19 +55,13 @@ async def test_begin_create_update_cassandra_keyspace(self, resource_group): create_update_cassandra_keyspace_parameters={ "resource": {"id": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -82,7 +76,7 @@ async def test_begin_delete_cassandra_keyspace(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -96,7 +90,7 @@ async def test_get_cassandra_keyspace_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -124,18 +118,12 @@ async def test_begin_update_cassandra_keyspace_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -150,7 +138,7 @@ async def test_begin_migrate_cassandra_keyspace_to_autoscale(self, resource_grou resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -165,7 +153,7 @@ async def test_begin_migrate_cassandra_keyspace_to_manual_throughput(self, resou resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -179,7 +167,7 @@ async def test_list_cassandra_tables(self, resource_group): resource_group_name=resource_group.name, account_name="str", keyspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -193,7 +181,7 @@ async def test_get_cassandra_table(self, resource_group): account_name="str", keyspace_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -220,19 +208,13 @@ async def test_begin_create_update_cassandra_table(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -248,7 +230,7 @@ async def test_begin_delete_cassandra_table(self, resource_group): account_name="str", keyspace_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -263,7 +245,7 @@ async def test_get_cassandra_table_throughput(self, resource_group): account_name="str", keyspace_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -292,18 +274,12 @@ async def test_begin_update_cassandra_table_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -319,7 +295,7 @@ async def test_begin_migrate_cassandra_table_to_autoscale(self, resource_group): account_name="str", keyspace_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -335,168 +311,7 @@ async def test_begin_migrate_cassandra_table_to_manual_throughput(self, resource account_name="str", keyspace_name="str", table_name="str", - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_cassandra_views(self, resource_group): - response = self.client.cassandra_resources.list_cassandra_views( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - api_version="2024-09-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get_cassandra_view(self, resource_group): - response = await self.client.cassandra_resources.get_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-09-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_create_update_cassandra_view(self, resource_group): - response = await ( - await self.client.cassandra_resources.begin_create_update_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - create_update_cassandra_view_parameters={ - "resource": {"id": "str", "viewDefinition": "str"}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_delete_cassandra_view(self, resource_group): - response = await ( - await self.client.cassandra_resources.begin_delete_cassandra_view( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get_cassandra_view_throughput(self, resource_group): - response = await self.client.cassandra_resources.get_cassandra_view_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-09-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_update_cassandra_view_throughput(self, resource_group): - response = await ( - await self.client.cassandra_resources.begin_update_cassandra_view_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - update_throughput_parameters={ - "resource": { - "autoscaleSettings": { - "maxThroughput": 0, - "autoUpgradePolicy": {"throughputPolicy": {"incrementPercent": 0, "isEnabled": bool}}, - "targetMaxThroughput": 0, - }, - "instantMaximumThroughput": "str", - "minimumThroughput": "str", - "offerReplacePending": "str", - "softAllowedMaximumThroughput": "str", - "throughput": 0, - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_migrate_cassandra_view_to_autoscale(self, resource_group): - response = await ( - await self.client.cassandra_resources.begin_migrate_cassandra_view_to_autoscale( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_migrate_cassandra_view_to_manual_throughput(self, resource_group): - response = await ( - await self.client.cassandra_resources.begin_migrate_cassandra_view_to_manual_throughput( - resource_group_name=resource_group.name, - account_name="str", - keyspace_name="str", - view_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations.py index bd7a5388cb85..ecddb5614de4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations.py @@ -27,7 +27,7 @@ def test_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_list_usages(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -55,7 +55,7 @@ def test_list_metric_definitions(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations_async.py index 3fef19f1dc02..3ab453887d27 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_operations_async.py @@ -28,7 +28,7 @@ async def test_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_list_usages(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -56,7 +56,7 @@ async def test_list_metric_definitions(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations.py index 67ffdf2d6af7..780c065f2179 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations.py @@ -27,7 +27,7 @@ def test_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -41,7 +41,7 @@ def test_list_usages(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations_async.py index b33fc54dd35f..8fe82dbac138 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_operations_async.py @@ -28,7 +28,7 @@ async def test_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -42,7 +42,7 @@ async def test_list_usages(self, resource_group): account_name="str", database_rid="str", collection_rid="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations.py index 3e430200ba31..1b0b98c9f206 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations.py @@ -28,7 +28,7 @@ def test_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations_async.py index 500524cd0717..2f7000829714 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_partition_region_operations_async.py @@ -29,7 +29,7 @@ async def test_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations.py index 998473b7e24f..7cff405abe14 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations.py @@ -28,7 +28,7 @@ def test_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations_async.py index 30c4bb1533ac..03543c18fd8a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_collection_region_operations_async.py @@ -29,7 +29,7 @@ async def test_list_metrics(self, resource_group): database_rid="str", collection_rid="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations.py index 503a8b95d63c..8050b645be38 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations.py @@ -26,7 +26,7 @@ def test_list_metrics(self, resource_group): account_name="str", region="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations_async.py index 65daf72505d4..05040120b7bf 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_account_region_operations_async.py @@ -27,7 +27,7 @@ async def test_list_metrics(self, resource_group): account_name="str", region="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations.py index 4c5d80181c99..8fdcdbf231cf 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations.py @@ -24,7 +24,7 @@ def test_get(self, resource_group): response = self.client.database_accounts.get( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -42,7 +42,6 @@ def test_begin_update(self, resource_group): "backupPolicy": "backup_policy", "capabilities": [{"name": "str"}], "capacity": {"totalThroughputLimit": 0}, - "capacityMode": "str", "connectorOffer": "str", "consistencyPolicy": { "defaultConsistencyLevel": "str", @@ -60,8 +59,6 @@ def test_begin_update(self, resource_group): ], "customerManagedKeyStatus": "str", "defaultIdentity": "str", - "defaultPriorityLevel": "str", - "diagnosticLogSettings": {"enableFullTextQuery": "str"}, "disableKeyBasedMetadataWriteAccess": bool, "disableLocalAuth": bool, "enableAnalyticalStorage": bool, @@ -69,11 +66,9 @@ def test_begin_update(self, resource_group): "enableBurstCapacity": bool, "enableCassandraConnector": bool, "enableFreeTier": bool, - "enableMaterializedViews": bool, "enableMultipleWriteLocations": bool, "enablePartitionMerge": bool, "enablePerRegionPerPartitionAutoscale": bool, - "enablePriorityBasedExecution": bool, "identity": { "principalId": "str", "tenantId": "str", @@ -107,7 +102,7 @@ def test_begin_update(self, resource_group): "tags": {"str": "str"}, "virtualNetworkRules": [{"id": "str", "ignoreMissingVNetServiceEndpoint": bool}], }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -136,7 +131,6 @@ def test_begin_create_or_update(self, resource_group): "backupPolicy": "backup_policy", "capabilities": [{"name": "str"}], "capacity": {"totalThroughputLimit": 0}, - "capacityMode": "str", "connectorOffer": "str", "consistencyPolicy": { "defaultConsistencyLevel": "str", @@ -155,8 +149,6 @@ def test_begin_create_or_update(self, resource_group): "createMode": "Default", "customerManagedKeyStatus": "str", "defaultIdentity": "str", - "defaultPriorityLevel": "str", - "diagnosticLogSettings": {"enableFullTextQuery": "str"}, "disableKeyBasedMetadataWriteAccess": bool, "disableLocalAuth": bool, "enableAnalyticalStorage": bool, @@ -164,11 +156,9 @@ def test_begin_create_or_update(self, resource_group): "enableBurstCapacity": bool, "enableCassandraConnector": bool, "enableFreeTier": bool, - "enableMaterializedViews": bool, "enableMultipleWriteLocations": bool, "enablePartitionMerge": bool, "enablePerRegionPerPartitionAutoscale": bool, - "enablePriorityBasedExecution": bool, "id": "str", "identity": { "principalId": "str", @@ -199,14 +189,13 @@ def test_begin_create_or_update(self, resource_group): "restoreSource": "str", "restoreTimestampInUtc": "2020-02-20 00:00:00", "restoreWithTtlDisabled": bool, - "sourceBackupLocation": "str", "tablesToRestore": ["str"], }, "tags": {"str": "str"}, "type": "str", "virtualNetworkRules": [{"id": "str", "ignoreMissingVNetServiceEndpoint": bool}], }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -218,7 +207,7 @@ def test_begin_delete(self, resource_group): response = self.client.database_accounts.begin_delete( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -231,7 +220,7 @@ def test_begin_failover_priority_change(self, resource_group): resource_group_name=resource_group.name, account_name="str", failover_parameters={"failoverPolicies": [{"failoverPriority": 0, "id": "str", "locationName": "str"}]}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -241,7 +230,7 @@ def test_begin_failover_priority_change(self, resource_group): @recorded_by_proxy def test_list(self, resource_group): response = self.client.database_accounts.list( - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -252,7 +241,7 @@ def test_list(self, resource_group): def test_list_by_resource_group(self, resource_group): response = self.client.database_accounts.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -264,7 +253,7 @@ def test_list_keys(self, resource_group): response = self.client.database_accounts.list_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -276,7 +265,7 @@ def test_list_connection_strings(self, resource_group): response = self.client.database_accounts.list_connection_strings( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -289,7 +278,7 @@ def test_begin_offline_region(self, resource_group): resource_group_name=resource_group.name, account_name="str", region_parameter_for_offline={"region": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -302,7 +291,7 @@ def test_begin_online_region(self, resource_group): resource_group_name=resource_group.name, account_name="str", region_parameter_for_online={"region": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -314,7 +303,7 @@ def test_get_read_only_keys(self, resource_group): response = self.client.database_accounts.get_read_only_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -326,7 +315,7 @@ def test_list_read_only_keys(self, resource_group): response = self.client.database_accounts.list_read_only_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -339,7 +328,7 @@ def test_begin_regenerate_key(self, resource_group): resource_group_name=resource_group.name, account_name="str", key_to_regenerate={"keyKind": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -350,7 +339,7 @@ def test_begin_regenerate_key(self, resource_group): def test_check_name_exists(self, resource_group): response = self.client.database_accounts.check_name_exists( account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -363,7 +352,7 @@ def test_list_metrics(self, resource_group): resource_group_name=resource_group.name, account_name="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -375,7 +364,7 @@ def test_list_usages(self, resource_group): response = self.client.database_accounts.list_usages( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -387,7 +376,7 @@ def test_list_metric_definitions(self, resource_group): response = self.client.database_accounts.list_metric_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations_async.py index dc90e9ef34f5..7327e450c8d0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_accounts_operations_async.py @@ -25,7 +25,7 @@ async def test_get(self, resource_group): response = await self.client.database_accounts.get( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -44,7 +44,6 @@ async def test_begin_update(self, resource_group): "backupPolicy": "backup_policy", "capabilities": [{"name": "str"}], "capacity": {"totalThroughputLimit": 0}, - "capacityMode": "str", "connectorOffer": "str", "consistencyPolicy": { "defaultConsistencyLevel": "str", @@ -62,8 +61,6 @@ async def test_begin_update(self, resource_group): ], "customerManagedKeyStatus": "str", "defaultIdentity": "str", - "defaultPriorityLevel": "str", - "diagnosticLogSettings": {"enableFullTextQuery": "str"}, "disableKeyBasedMetadataWriteAccess": bool, "disableLocalAuth": bool, "enableAnalyticalStorage": bool, @@ -71,11 +68,9 @@ async def test_begin_update(self, resource_group): "enableBurstCapacity": bool, "enableCassandraConnector": bool, "enableFreeTier": bool, - "enableMaterializedViews": bool, "enableMultipleWriteLocations": bool, "enablePartitionMerge": bool, "enablePerRegionPerPartitionAutoscale": bool, - "enablePriorityBasedExecution": bool, "identity": { "principalId": "str", "tenantId": "str", @@ -109,7 +104,7 @@ async def test_begin_update(self, resource_group): "tags": {"str": "str"}, "virtualNetworkRules": [{"id": "str", "ignoreMissingVNetServiceEndpoint": bool}], }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -140,7 +135,6 @@ async def test_begin_create_or_update(self, resource_group): "backupPolicy": "backup_policy", "capabilities": [{"name": "str"}], "capacity": {"totalThroughputLimit": 0}, - "capacityMode": "str", "connectorOffer": "str", "consistencyPolicy": { "defaultConsistencyLevel": "str", @@ -159,8 +153,6 @@ async def test_begin_create_or_update(self, resource_group): "createMode": "Default", "customerManagedKeyStatus": "str", "defaultIdentity": "str", - "defaultPriorityLevel": "str", - "diagnosticLogSettings": {"enableFullTextQuery": "str"}, "disableKeyBasedMetadataWriteAccess": bool, "disableLocalAuth": bool, "enableAnalyticalStorage": bool, @@ -168,11 +160,9 @@ async def test_begin_create_or_update(self, resource_group): "enableBurstCapacity": bool, "enableCassandraConnector": bool, "enableFreeTier": bool, - "enableMaterializedViews": bool, "enableMultipleWriteLocations": bool, "enablePartitionMerge": bool, "enablePerRegionPerPartitionAutoscale": bool, - "enablePriorityBasedExecution": bool, "id": "str", "identity": { "principalId": "str", @@ -203,14 +193,13 @@ async def test_begin_create_or_update(self, resource_group): "restoreSource": "str", "restoreTimestampInUtc": "2020-02-20 00:00:00", "restoreWithTtlDisabled": bool, - "sourceBackupLocation": "str", "tablesToRestore": ["str"], }, "tags": {"str": "str"}, "type": "str", "virtualNetworkRules": [{"id": "str", "ignoreMissingVNetServiceEndpoint": bool}], }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -224,7 +213,7 @@ async def test_begin_delete(self, resource_group): await self.client.database_accounts.begin_delete( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -239,7 +228,7 @@ async def test_begin_failover_priority_change(self, resource_group): resource_group_name=resource_group.name, account_name="str", failover_parameters={"failoverPolicies": [{"failoverPriority": 0, "id": "str", "locationName": "str"}]}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -250,7 +239,7 @@ async def test_begin_failover_priority_change(self, resource_group): @recorded_by_proxy_async async def test_list(self, resource_group): response = self.client.database_accounts.list( - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -261,7 +250,7 @@ async def test_list(self, resource_group): async def test_list_by_resource_group(self, resource_group): response = self.client.database_accounts.list_by_resource_group( resource_group_name=resource_group.name, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -273,7 +262,7 @@ async def test_list_keys(self, resource_group): response = await self.client.database_accounts.list_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -285,7 +274,7 @@ async def test_list_connection_strings(self, resource_group): response = await self.client.database_accounts.list_connection_strings( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -299,7 +288,7 @@ async def test_begin_offline_region(self, resource_group): resource_group_name=resource_group.name, account_name="str", region_parameter_for_offline={"region": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -314,7 +303,7 @@ async def test_begin_online_region(self, resource_group): resource_group_name=resource_group.name, account_name="str", region_parameter_for_online={"region": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -327,7 +316,7 @@ async def test_get_read_only_keys(self, resource_group): response = await self.client.database_accounts.get_read_only_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -339,7 +328,7 @@ async def test_list_read_only_keys(self, resource_group): response = await self.client.database_accounts.list_read_only_keys( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -353,7 +342,7 @@ async def test_begin_regenerate_key(self, resource_group): resource_group_name=resource_group.name, account_name="str", key_to_regenerate={"keyKind": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -365,7 +354,7 @@ async def test_begin_regenerate_key(self, resource_group): async def test_check_name_exists(self, resource_group): response = await self.client.database_accounts.check_name_exists( account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -378,7 +367,7 @@ async def test_list_metrics(self, resource_group): resource_group_name=resource_group.name, account_name="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -390,7 +379,7 @@ async def test_list_usages(self, resource_group): response = self.client.database_accounts.list_usages( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -402,7 +391,7 @@ async def test_list_metric_definitions(self, resource_group): response = self.client.database_accounts.list_metric_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations.py index ec4b54321aca..1161d2c8e0be 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations.py @@ -26,7 +26,7 @@ def test_list_metrics(self, resource_group): account_name="str", database_rid="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -39,7 +39,7 @@ def test_list_usages(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_rid="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -52,7 +52,7 @@ def test_list_metric_definitions(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_rid="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations_async.py index b1d9fbad6baa..629f47b1cd8b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_database_operations_async.py @@ -27,7 +27,7 @@ async def test_list_metrics(self, resource_group): account_name="str", database_rid="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_list_usages(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_rid="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -53,7 +53,7 @@ async def test_list_metric_definitions(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_rid="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations.py index 11b90cdd3e9c..f5c44c5b6c1d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations.py @@ -24,7 +24,7 @@ def test_list_gremlin_databases(self, resource_group): response = self.client.gremlin_resources.list_gremlin_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get_gremlin_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -61,19 +61,13 @@ def test_begin_create_update_gremlin_database(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,7 +80,7 @@ def test_begin_delete_gremlin_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,7 +93,7 @@ def test_get_gremlin_database_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -126,18 +120,12 @@ def test_begin_update_gremlin_database_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -150,7 +138,7 @@ def test_begin_migrate_gremlin_database_to_autoscale(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -163,7 +151,7 @@ def test_begin_migrate_gremlin_database_to_manual_throughput(self, resource_grou resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -176,7 +164,7 @@ def test_list_gremlin_graphs(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -190,7 +178,7 @@ def test_get_gremlin_graph(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -224,6 +212,7 @@ def test_begin_create_update_gremlin_graph(self, resource_group): ], "indexingMode": "consistent", "spatialIndexes": [{"path": "str", "types": ["str"]}], + "vectorIndexes": [{"path": "str", "type": "str"}], }, "partitionKey": {"kind": "Hash", "paths": ["str"], "systemKey": bool, "version": 0}, "restoreParameters": { @@ -234,19 +223,13 @@ def test_begin_create_update_gremlin_graph(self, resource_group): "uniqueKeyPolicy": {"uniqueKeys": [{"paths": ["str"]}]}, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -260,7 +243,7 @@ def test_begin_delete_gremlin_graph(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -274,7 +257,7 @@ def test_get_gremlin_graph_throughput(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -302,18 +285,12 @@ def test_begin_update_gremlin_graph_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -327,7 +304,7 @@ def test_begin_migrate_gremlin_graph_to_autoscale(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -341,7 +318,7 @@ def test_begin_migrate_gremlin_graph_to_manual_throughput(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -356,7 +333,7 @@ def test_begin_retrieve_continuous_backup_information(self, resource_group): database_name="str", graph_name="str", location={"location": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations_async.py index c0b765db8723..701b31f914ff 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_gremlin_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_list_gremlin_databases(self, resource_group): response = self.client.gremlin_resources.list_gremlin_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get_gremlin_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -63,19 +63,13 @@ async def test_begin_create_update_gremlin_database(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -90,7 +84,7 @@ async def test_begin_delete_gremlin_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +98,7 @@ async def test_get_gremlin_database_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -132,18 +126,12 @@ async def test_begin_update_gremlin_database_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -158,7 +146,7 @@ async def test_begin_migrate_gremlin_database_to_autoscale(self, resource_group) resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -173,7 +161,7 @@ async def test_begin_migrate_gremlin_database_to_manual_throughput(self, resourc resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -187,7 +175,7 @@ async def test_list_gremlin_graphs(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -201,7 +189,7 @@ async def test_get_gremlin_graph(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -236,6 +224,7 @@ async def test_begin_create_update_gremlin_graph(self, resource_group): ], "indexingMode": "consistent", "spatialIndexes": [{"path": "str", "types": ["str"]}], + "vectorIndexes": [{"path": "str", "type": "str"}], }, "partitionKey": {"kind": "Hash", "paths": ["str"], "systemKey": bool, "version": 0}, "restoreParameters": { @@ -246,19 +235,13 @@ async def test_begin_create_update_gremlin_graph(self, resource_group): "uniqueKeyPolicy": {"uniqueKeys": [{"paths": ["str"]}]}, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -274,7 +257,7 @@ async def test_begin_delete_gremlin_graph(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -289,7 +272,7 @@ async def test_get_gremlin_graph_throughput(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -318,18 +301,12 @@ async def test_begin_update_gremlin_graph_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -345,7 +322,7 @@ async def test_begin_migrate_gremlin_graph_to_autoscale(self, resource_group): account_name="str", database_name="str", graph_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -361,7 +338,7 @@ async def test_begin_migrate_gremlin_graph_to_manual_throughput(self, resource_g account_name="str", database_name="str", graph_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -378,7 +355,7 @@ async def test_begin_retrieve_continuous_backup_information(self, resource_group database_name="str", graph_name="str", location={"location": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations.py index a20c208494be..b55eb24f8584 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_list(self, resource_group): response = self.client.locations.list( - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_list(self, resource_group): def test_get(self, resource_group): response = self.client.locations.get( location="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations_async.py index 2238feb6e288..8a2eafbe4643 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_locations_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_list(self, resource_group): response = self.client.locations.list( - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_list(self, resource_group): async def test_get(self, resource_group): response = await self.client.locations.get( location="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations.py index bd1295d1addf..2a00d53d47e1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations.py @@ -24,7 +24,7 @@ def test_list_mongo_db_databases(self, resource_group): response = self.client.mongo_db_resources.list_mongo_db_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get_mongo_db_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -61,19 +61,13 @@ def test_begin_create_update_mongo_db_database(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,7 +80,7 @@ def test_begin_delete_mongo_db_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,7 +93,7 @@ def test_get_mongo_db_database_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -126,18 +120,12 @@ def test_begin_update_mongo_db_database_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -150,7 +138,7 @@ def test_begin_migrate_mongo_db_database_to_autoscale(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -163,125 +151,7 @@ def test_begin_migrate_mongo_db_database_to_manual_throughput(self, resource_gro resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_mongo_db_database_retrieve_throughput_distribution(self, resource_group): - response = self.client.mongo_db_resources.begin_mongo_db_database_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_mongo_db_database_redistribute_throughput(self, resource_group): - response = self.client.mongo_db_resources.begin_mongo_db_database_redistribute_throughput( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_mongo_db_container_retrieve_throughput_distribution(self, resource_group): - response = self.client.mongo_db_resources.begin_mongo_db_container_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_mongo_db_container_redistribute_throughput(self, resource_group): - response = self.client.mongo_db_resources.begin_mongo_db_container_redistribute_throughput( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -294,7 +164,7 @@ def test_list_mongo_db_collections(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -308,7 +178,7 @@ def test_get_mongo_db_collection(self, resource_group): account_name="str", database_name="str", collection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -336,19 +206,13 @@ def test_begin_create_update_mongo_db_collection(self, resource_group): "shardKey": {"str": "str"}, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -362,36 +226,7 @@ def test_begin_delete_mongo_db_collection(self, resource_group): account_name="str", database_name="str", collection_name="str", - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_mongo_db_database_partition_merge(self, resource_group): - response = self.client.mongo_db_resources.begin_mongo_db_database_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_list_mongo_db_collection_partition_merge(self, resource_group): - response = self.client.mongo_db_resources.begin_list_mongo_db_collection_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -405,7 +240,7 @@ def test_get_mongo_db_collection_throughput(self, resource_group): account_name="str", database_name="str", collection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -433,18 +268,12 @@ def test_begin_update_mongo_db_collection_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -458,7 +287,7 @@ def test_begin_migrate_mongo_db_collection_to_autoscale(self, resource_group): account_name="str", database_name="str", collection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -472,7 +301,7 @@ def test_begin_migrate_mongo_db_collection_to_manual_throughput(self, resource_g account_name="str", database_name="str", collection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -485,7 +314,7 @@ def test_get_mongo_role_definition(self, resource_group): mongo_role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -505,7 +334,7 @@ def test_begin_create_update_mongo_role_definition(self, resource_group): "roles": [{"db": "str", "role": "str"}], "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -518,7 +347,7 @@ def test_begin_delete_mongo_role_definition(self, resource_group): mongo_role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -530,7 +359,7 @@ def test_list_mongo_role_definitions(self, resource_group): response = self.client.mongo_db_resources.list_mongo_role_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -543,7 +372,7 @@ def test_get_mongo_user_definition(self, resource_group): mongo_user_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -564,7 +393,7 @@ def test_begin_create_update_mongo_user_definition(self, resource_group): "roles": [{"db": "str", "role": "str"}], "userName": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -577,7 +406,7 @@ def test_begin_delete_mongo_user_definition(self, resource_group): mongo_user_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -589,7 +418,7 @@ def test_list_mongo_user_definitions(self, resource_group): response = self.client.mongo_db_resources.list_mongo_user_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -604,7 +433,7 @@ def test_begin_retrieve_continuous_backup_information(self, resource_group): database_name="str", collection_name="str", location={"location": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations_async.py index 8bf8599820a0..e48b72f9119b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_mongo_db_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_list_mongo_db_databases(self, resource_group): response = self.client.mongo_db_resources.list_mongo_db_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get_mongo_db_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -63,19 +63,13 @@ async def test_begin_create_update_mongo_db_database(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -90,7 +84,7 @@ async def test_begin_delete_mongo_db_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +98,7 @@ async def test_get_mongo_db_database_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -132,18 +126,12 @@ async def test_begin_update_mongo_db_database_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -158,7 +146,7 @@ async def test_begin_migrate_mongo_db_database_to_autoscale(self, resource_group resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -173,133 +161,7 @@ async def test_begin_migrate_mongo_db_database_to_manual_throughput(self, resour resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_mongo_db_database_retrieve_throughput_distribution(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_mongo_db_database_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_mongo_db_database_redistribute_throughput(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_mongo_db_database_redistribute_throughput( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_mongo_db_container_retrieve_throughput_distribution(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_mongo_db_container_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_mongo_db_container_redistribute_throughput(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_mongo_db_container_redistribute_throughput( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -313,7 +175,7 @@ async def test_list_mongo_db_collections(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -327,7 +189,7 @@ async def test_get_mongo_db_collection(self, resource_group): account_name="str", database_name="str", collection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -356,19 +218,13 @@ async def test_begin_create_update_mongo_db_collection(self, resource_group): "shardKey": {"str": "str"}, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -384,40 +240,7 @@ async def test_begin_delete_mongo_db_collection(self, resource_group): account_name="str", database_name="str", collection_name="str", - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_mongo_db_database_partition_merge(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_mongo_db_database_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_list_mongo_db_collection_partition_merge(self, resource_group): - response = await ( - await self.client.mongo_db_resources.begin_list_mongo_db_collection_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - collection_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -432,7 +255,7 @@ async def test_get_mongo_db_collection_throughput(self, resource_group): account_name="str", database_name="str", collection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -461,18 +284,12 @@ async def test_begin_update_mongo_db_collection_throughput(self, resource_group) "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -488,7 +305,7 @@ async def test_begin_migrate_mongo_db_collection_to_autoscale(self, resource_gro account_name="str", database_name="str", collection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -504,7 +321,7 @@ async def test_begin_migrate_mongo_db_collection_to_manual_throughput(self, reso account_name="str", database_name="str", collection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -518,7 +335,7 @@ async def test_get_mongo_role_definition(self, resource_group): mongo_role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -539,7 +356,7 @@ async def test_begin_create_update_mongo_role_definition(self, resource_group): "roles": [{"db": "str", "role": "str"}], "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -554,7 +371,7 @@ async def test_begin_delete_mongo_role_definition(self, resource_group): mongo_role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -567,7 +384,7 @@ async def test_list_mongo_role_definitions(self, resource_group): response = self.client.mongo_db_resources.list_mongo_role_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -580,7 +397,7 @@ async def test_get_mongo_user_definition(self, resource_group): mongo_user_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -602,7 +419,7 @@ async def test_begin_create_update_mongo_user_definition(self, resource_group): "roles": [{"db": "str", "role": "str"}], "userName": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -617,7 +434,7 @@ async def test_begin_delete_mongo_user_definition(self, resource_group): mongo_user_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -630,7 +447,7 @@ async def test_list_mongo_user_definitions(self, resource_group): response = self.client.mongo_db_resources.list_mongo_user_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -646,7 +463,7 @@ async def test_begin_retrieve_continuous_backup_information(self, resource_group database_name="str", collection_name="str", location={"location": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations.py index 1837c02381b2..3c76bb33a6f1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations.py @@ -24,7 +24,7 @@ def test_list_by_database_account(self, resource_group): response = self.client.notebook_workspaces.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -51,7 +51,7 @@ def test_begin_create_or_update(self, resource_group): account_name="str", notebook_workspace_name="str", notebook_create_update_parameters={"id": "str", "name": "str", "type": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -64,7 +64,7 @@ def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -77,7 +77,7 @@ def test_list_connection_info(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -90,7 +90,7 @@ def test_begin_regenerate_auth_token(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -103,7 +103,7 @@ def test_begin_start(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations_async.py index b59a74b2b3d9..3e8c9b6ad402 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_notebook_workspaces_operations_async.py @@ -25,7 +25,7 @@ async def test_list_by_database_account(self, resource_group): response = self.client.notebook_workspaces.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -53,7 +53,7 @@ async def test_begin_create_or_update(self, resource_group): account_name="str", notebook_workspace_name="str", notebook_create_update_parameters={"id": "str", "name": "str", "type": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -68,7 +68,7 @@ async def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -82,7 +82,7 @@ async def test_list_connection_info(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -96,7 +96,7 @@ async def test_begin_regenerate_auth_token(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -111,7 +111,7 @@ async def test_begin_start(self, resource_group): resource_group_name=resource_group.name, account_name="str", notebook_workspace_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations.py index 52a1d715bc84..11ffdf2a2eca 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations.py @@ -22,7 +22,7 @@ def setup_method(self, method): @recorded_by_proxy def test_list(self, resource_group): response = self.client.operations.list( - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations_async.py index 934e97d7da39..4b3dbe3ab389 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_operations_async.py @@ -23,7 +23,7 @@ def setup_method(self, method): @recorded_by_proxy_async async def test_list(self, resource_group): response = self.client.operations.list( - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations.py index 89445dcbf627..a036f2c39db4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations.py @@ -28,7 +28,7 @@ def test_list_metrics(self, resource_group): collection_rid="str", partition_key_range_id="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations_async.py index 015b017de8e0..73b0c8afc3f0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_operations_async.py @@ -29,7 +29,7 @@ async def test_list_metrics(self, resource_group): collection_rid="str", partition_key_range_id="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations.py index 47bca4110dc6..63b2934382fa 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations.py @@ -29,7 +29,7 @@ def test_list_metrics(self, resource_group): collection_rid="str", partition_key_range_id="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations_async.py index 27e67c19e55e..3a4d4deaf297 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_partition_key_range_id_region_operations_async.py @@ -30,7 +30,7 @@ async def test_list_metrics(self, resource_group): collection_rid="str", partition_key_range_id="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations.py index 793aa3ec0b18..16c4a1d1b701 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations.py @@ -25,7 +25,7 @@ def test_list_metrics(self, resource_group): resource_group_name=resource_group.name, account_name="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations_async.py index 385f435009d9..2663deaaa330 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_operations_async.py @@ -26,7 +26,7 @@ async def test_list_metrics(self, resource_group): resource_group_name=resource_group.name, account_name="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations.py index 2d334d93d6db..5c9d5b53c552 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations.py @@ -27,7 +27,7 @@ def test_list_metrics(self, resource_group): source_region="str", target_region="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations_async.py index b94484b5089f..4004d022e1ae 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_source_target_operations_async.py @@ -28,7 +28,7 @@ async def test_list_metrics(self, resource_group): source_region="str", target_region="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations.py index 974e5bc6e783..b3554e6871f4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations.py @@ -26,7 +26,7 @@ def test_list_metrics(self, resource_group): account_name="str", target_region="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations_async.py index 7d66b9b9b369..f63b873d27af 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_percentile_target_operations_async.py @@ -27,7 +27,7 @@ async def test_list_metrics(self, resource_group): account_name="str", target_region="str", filter="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations.py index a4f73f0eca05..01c984f96853 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations.py @@ -24,7 +24,7 @@ def test_list_by_database_account(self, resource_group): response = self.client.private_endpoint_connections.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", private_endpoint_connection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -57,17 +57,9 @@ def test_begin_create_or_update(self, resource_group): "privateEndpoint": {"id": "str"}, "privateLinkServiceConnectionState": {"actionsRequired": "str", "description": "str", "status": "str"}, "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -80,7 +72,7 @@ def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", private_endpoint_connection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations_async.py index 066e034b4049..5b0e9088436b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_endpoint_connections_operations_async.py @@ -25,7 +25,7 @@ async def test_list_by_database_account(self, resource_group): response = self.client.private_endpoint_connections.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", private_endpoint_connection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -63,17 +63,9 @@ async def test_begin_create_or_update(self, resource_group): "status": "str", }, "provisioningState": "str", - "systemData": { - "createdAt": "2020-02-20 00:00:00", - "createdBy": "str", - "createdByType": "str", - "lastModifiedAt": "2020-02-20 00:00:00", - "lastModifiedBy": "str", - "lastModifiedByType": "str", - }, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -88,7 +80,7 @@ async def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", private_endpoint_connection_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations.py index 83dfb74b457d..b7250620192e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations.py @@ -24,7 +24,7 @@ def test_list_by_database_account(self, resource_group): response = self.client.private_link_resources.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", group_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations_async.py index 56084b842b7c..8c3e4183ef0c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_private_link_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_list_by_database_account(self, resource_group): response = self.client.private_link_resources.list_by_database_account( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", group_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations.py index d3f4770fedbd..4697175f8814 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations.py @@ -23,7 +23,7 @@ def setup_method(self, method): def test_list_by_location(self, resource_group): response = self.client.restorable_database_accounts.list_by_location( location="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -33,7 +33,7 @@ def test_list_by_location(self, resource_group): @recorded_by_proxy def test_list(self, resource_group): response = self.client.restorable_database_accounts.list( - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -45,7 +45,7 @@ def test_get_by_location(self, resource_group): response = self.client.restorable_database_accounts.get_by_location( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations_async.py index 777ab7ebf16d..eb81bbca5a26 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_database_accounts_operations_async.py @@ -24,7 +24,7 @@ def setup_method(self, method): async def test_list_by_location(self, resource_group): response = self.client.restorable_database_accounts.list_by_location( location="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -34,7 +34,7 @@ async def test_list_by_location(self, resource_group): @recorded_by_proxy_async async def test_list(self, resource_group): response = self.client.restorable_database_accounts.list( - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -46,7 +46,7 @@ async def test_get_by_location(self, resource_group): response = await self.client.restorable_database_accounts.get_by_location( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations.py index b9391ace2753..bad0d3c132a4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.restorable_gremlin_databases.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations_async.py index eb9c3f2a35dc..71eafe6719ca 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_databases_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.restorable_gremlin_databases.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations.py index 1f5208783b81..db3577a189ae 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.restorable_gremlin_graphs.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations_async.py index 349e08acd361..cea6220e264a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_graphs_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.restorable_gremlin_graphs.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations.py index 757df6b33b25..03d19c158871 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.restorable_gremlin_resources.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations_async.py index bdb461a2691f..2faf49792fd1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_gremlin_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.restorable_gremlin_resources.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations.py index 46d45a3e9803..0d6441113d65 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.restorable_mongodb_collections.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations_async.py index 1f3f1700dfdb..ecf5c87f97ef 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_collections_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.restorable_mongodb_collections.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations.py index f28d1fe8ebe2..0c48acddd267 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.restorable_mongodb_databases.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations_async.py index 5da5471ce17d..0b79da67be65 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_databases_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.restorable_mongodb_databases.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations.py index 231e288f73a2..6bd94df31f13 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.restorable_mongodb_resources.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations_async.py index b0ef4d482ca0..326c6a56fed1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_mongodb_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.restorable_mongodb_resources.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations.py index 695beae5166d..9928046a0aae 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.restorable_sql_containers.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations_async.py index 457881ed86ad..aea8602846bb 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_containers_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.restorable_sql_containers.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations.py index 1202a26a9455..d360464ff79c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.restorable_sql_databases.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations_async.py index 4af4dbb90c88..efcc1bacc266 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_databases_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.restorable_sql_databases.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations.py index e2f73b44d80f..9fef660d2fe1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.restorable_sql_resources.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations_async.py index 712e66dac4ed..7d1222a60f7a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_sql_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.restorable_sql_resources.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations.py index ab25d9a363de..3fb0866e2b2f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.restorable_table_resources.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations_async.py index 196d0ebbc3d8..7f8e18b26ff1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_table_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.restorable_table_resources.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations.py index d94c25874840..afb637790e23 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.restorable_tables.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations_async.py index 4ee49ac6e0cb..cf6a44cb4489 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_restorable_tables_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.restorable_tables.list( location="str", instance_id="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations.py index fb618129da78..147c295357f3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations.py @@ -24,7 +24,7 @@ def test_list(self, resource_group): response = self.client.service.list( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ def test_begin_create(self, resource_group): account_name="str", service_name="str", create_update_parameters={"properties": "service_resource_create_update_properties"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -51,7 +51,7 @@ def test_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", service_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -64,7 +64,7 @@ def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", service_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations_async.py index 94bbed96c537..1ac03fa8b352 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_service_operations_async.py @@ -25,7 +25,7 @@ async def test_list(self, resource_group): response = self.client.service.list( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -40,7 +40,7 @@ async def test_begin_create(self, resource_group): account_name="str", service_name="str", create_update_parameters={"properties": "service_resource_create_update_properties"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -54,7 +54,7 @@ async def test_get(self, resource_group): resource_group_name=resource_group.name, account_name="str", service_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -68,7 +68,7 @@ async def test_begin_delete(self, resource_group): resource_group_name=resource_group.name, account_name="str", service_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations.py index fefdf7558bf9..da9f7f63ae05 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations.py @@ -24,7 +24,7 @@ def test_list_sql_databases(self, resource_group): response = self.client.sql_resources.list_sql_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get_sql_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -61,19 +61,13 @@ def test_begin_create_update_sql_database(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,7 +80,7 @@ def test_begin_delete_sql_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,7 +93,7 @@ def test_get_sql_database_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -126,18 +120,12 @@ def test_begin_update_sql_database_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -150,7 +138,7 @@ def test_begin_migrate_sql_database_to_autoscale(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -163,56 +151,7 @@ def test_begin_migrate_sql_database_to_manual_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_list_client_encryption_keys(self, resource_group): - response = self.client.sql_resources.list_client_encryption_keys( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - api_version="2024-09-01-preview", - ) - result = [r for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_get_client_encryption_key(self, resource_group): - response = self.client.sql_resources.get_client_encryption_key( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - client_encryption_key_name="str", - api_version="2024-09-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_create_update_client_encryption_key(self, resource_group): - response = self.client.sql_resources.begin_create_update_client_encryption_key( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - client_encryption_key_name="str", - create_update_client_encryption_key_parameters={ - "resource": { - "encryptionAlgorithm": "str", - "id": "str", - "keyWrapMetadata": {"algorithm": "str", "name": "str", "type": "str", "value": "str"}, - "wrappedDataEncryptionKey": bytes("bytes", encoding="utf-8"), - } - }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -225,7 +164,7 @@ def test_list_sql_containers(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -239,7 +178,7 @@ def test_get_sql_container(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -285,11 +224,7 @@ def test_begin_create_update_sql_container(self, resource_group): ], "indexingMode": "consistent", "spatialIndexes": [{"path": "str", "types": ["str"]}], - }, - "materializedViewDefinition": { - "definition": "str", - "sourceCollectionId": "str", - "sourceCollectionRid": "str", + "vectorIndexes": [{"path": "str", "type": "str"}], }, "partitionKey": {"kind": "Hash", "paths": ["str"], "systemKey": bool, "version": 0}, "restoreParameters": { @@ -298,21 +233,20 @@ def test_begin_create_update_sql_container(self, resource_group): "restoreWithTtlDisabled": bool, }, "uniqueKeyPolicy": {"uniqueKeys": [{"paths": ["str"]}]}, + "vectorEmbeddingPolicy": { + "vectorEmbeddings": [ + {"dataType": "str", "dimensions": 0, "distanceFunction": "str", "path": "str"} + ] + }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -326,36 +260,7 @@ def test_begin_delete_sql_container(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_sql_database_partition_merge(self, resource_group): - response = self.client.sql_resources.begin_sql_database_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_list_sql_container_partition_merge(self, resource_group): - response = self.client.sql_resources.begin_list_sql_container_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - container_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -369,7 +274,7 @@ def test_get_sql_container_throughput(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -397,18 +302,12 @@ def test_begin_update_sql_container_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -422,7 +321,7 @@ def test_begin_migrate_sql_container_to_autoscale(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -436,7 +335,7 @@ def test_begin_migrate_sql_container_to_manual_throughput(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -444,117 +343,48 @@ def test_begin_migrate_sql_container_to_manual_throughput(self, resource_group): @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_sql_database_retrieve_throughput_distribution(self, resource_group): - response = self.client.sql_resources.begin_sql_database_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy - def test_begin_sql_database_redistribute_throughput(self, resource_group): - response = self.client.sql_resources.begin_sql_database_redistribute_throughput( + def test_list_client_encryption_keys(self, resource_group): + response = self.client.sql_resources.list_client_encryption_keys( resource_group_name=resource_group.name, account_name="str", database_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result - + api_version="2024-11-15", + ) + result = [r for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_sql_container_retrieve_throughput_distribution(self, resource_group): - response = self.client.sql_resources.begin_sql_container_retrieve_throughput_distribution( + def test_get_client_encryption_key(self, resource_group): + response = self.client.sql_resources.get_client_encryption_key( resource_group_name=resource_group.name, account_name="str", database_name="str", - container_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ).result() # call '.result()' to poll until service return final result + client_encryption_key_name="str", + api_version="2024-11-15", + ) # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy - def test_begin_sql_container_redistribute_throughput(self, resource_group): - response = self.client.sql_resources.begin_sql_container_redistribute_throughput( + def test_begin_create_update_client_encryption_key(self, resource_group): + response = self.client.sql_resources.begin_create_update_client_encryption_key( resource_group_name=resource_group.name, account_name="str", database_name="str", - container_name="str", - redistribute_throughput_parameters={ + client_encryption_key_name="str", + create_update_client_encryption_key_parameters={ "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", + "encryptionAlgorithm": "str", + "id": "str", + "keyWrapMetadata": {"algorithm": "str", "name": "str", "type": "str", "value": "str"}, + "wrappedDataEncryptionKey": bytes("bytes", encoding="utf-8"), + } }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -568,7 +398,7 @@ def test_list_sql_stored_procedures(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -583,7 +413,7 @@ def test_get_sql_stored_procedure(self, resource_group): database_name="str", container_name="str", stored_procedure_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -601,19 +431,13 @@ def test_begin_create_update_sql_stored_procedure(self, resource_group): create_update_sql_stored_procedure_parameters={ "resource": {"id": "str", "body": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -628,7 +452,7 @@ def test_begin_delete_sql_stored_procedure(self, resource_group): database_name="str", container_name="str", stored_procedure_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -642,7 +466,7 @@ def test_list_sql_user_defined_functions(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -657,7 +481,7 @@ def test_get_sql_user_defined_function(self, resource_group): database_name="str", container_name="str", user_defined_function_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -675,19 +499,13 @@ def test_begin_create_update_sql_user_defined_function(self, resource_group): create_update_sql_user_defined_function_parameters={ "resource": {"id": "str", "body": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -702,7 +520,7 @@ def test_begin_delete_sql_user_defined_function(self, resource_group): database_name="str", container_name="str", user_defined_function_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -716,7 +534,7 @@ def test_list_sql_triggers(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -731,7 +549,7 @@ def test_get_sql_trigger(self, resource_group): database_name="str", container_name="str", trigger_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -749,19 +567,13 @@ def test_begin_create_update_sql_trigger(self, resource_group): create_update_sql_trigger_parameters={ "resource": {"id": "str", "body": "str", "triggerOperation": "str", "triggerType": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -776,7 +588,7 @@ def test_begin_delete_sql_trigger(self, resource_group): database_name="str", container_name="str", trigger_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -789,7 +601,7 @@ def test_get_sql_role_definition(self, resource_group): role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -808,7 +620,7 @@ def test_begin_create_update_sql_role_definition(self, resource_group): "roleName": "str", "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -821,7 +633,7 @@ def test_begin_delete_sql_role_definition(self, resource_group): role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -833,7 +645,7 @@ def test_list_sql_role_definitions(self, resource_group): response = self.client.sql_resources.list_sql_role_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -846,7 +658,7 @@ def test_get_sql_role_assignment(self, resource_group): role_assignment_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -864,7 +676,7 @@ def test_begin_create_update_sql_role_assignment(self, resource_group): "roleDefinitionId": "str", "scope": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -877,7 +689,7 @@ def test_begin_delete_sql_role_assignment(self, resource_group): role_assignment_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -889,7 +701,7 @@ def test_list_sql_role_assignments(self, resource_group): response = self.client.sql_resources.list_sql_role_assignments( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -904,7 +716,7 @@ def test_begin_retrieve_continuous_backup_information(self, resource_group): database_name="str", container_name="str", location={"location": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations_async.py index 0c7b666c86e8..3e809eba654a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_sql_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_list_sql_databases(self, resource_group): response = self.client.sql_resources.list_sql_databases( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get_sql_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -63,19 +63,13 @@ async def test_begin_create_update_sql_database(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -90,7 +84,7 @@ async def test_begin_delete_sql_database(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +98,7 @@ async def test_get_sql_database_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -132,18 +126,12 @@ async def test_begin_update_sql_database_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -158,7 +146,7 @@ async def test_begin_migrate_sql_database_to_autoscale(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -173,58 +161,7 @@ async def test_begin_migrate_sql_database_to_manual_throughput(self, resource_gr resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_list_client_encryption_keys(self, resource_group): - response = self.client.sql_resources.list_client_encryption_keys( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - api_version="2024-09-01-preview", - ) - result = [r async for r in response] - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_get_client_encryption_key(self, resource_group): - response = await self.client.sql_resources.get_client_encryption_key( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - client_encryption_key_name="str", - api_version="2024-09-01-preview", - ) - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_create_update_client_encryption_key(self, resource_group): - response = await ( - await self.client.sql_resources.begin_create_update_client_encryption_key( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - client_encryption_key_name="str", - create_update_client_encryption_key_parameters={ - "resource": { - "encryptionAlgorithm": "str", - "id": "str", - "keyWrapMetadata": {"algorithm": "str", "name": "str", "type": "str", "value": "str"}, - "wrappedDataEncryptionKey": bytes("bytes", encoding="utf-8"), - } - }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -238,7 +175,7 @@ async def test_list_sql_containers(self, resource_group): resource_group_name=resource_group.name, account_name="str", database_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -252,7 +189,7 @@ async def test_get_sql_container(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -299,11 +236,7 @@ async def test_begin_create_update_sql_container(self, resource_group): ], "indexingMode": "consistent", "spatialIndexes": [{"path": "str", "types": ["str"]}], - }, - "materializedViewDefinition": { - "definition": "str", - "sourceCollectionId": "str", - "sourceCollectionRid": "str", + "vectorIndexes": [{"path": "str", "type": "str"}], }, "partitionKey": {"kind": "Hash", "paths": ["str"], "systemKey": bool, "version": 0}, "restoreParameters": { @@ -312,21 +245,20 @@ async def test_begin_create_update_sql_container(self, resource_group): "restoreWithTtlDisabled": bool, }, "uniqueKeyPolicy": {"uniqueKeys": [{"paths": ["str"]}]}, + "vectorEmbeddingPolicy": { + "vectorEmbeddings": [ + {"dataType": "str", "dimensions": 0, "distanceFunction": "str", "path": "str"} + ] + }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -342,40 +274,7 @@ async def test_begin_delete_sql_container(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_sql_database_partition_merge(self, resource_group): - response = await ( - await self.client.sql_resources.begin_sql_database_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_list_sql_container_partition_merge(self, resource_group): - response = await ( - await self.client.sql_resources.begin_list_sql_container_partition_merge( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - container_name="str", - merge_parameters={"isDryRun": bool}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -390,7 +289,7 @@ async def test_get_sql_container_throughput(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -419,18 +318,12 @@ async def test_begin_update_sql_container_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -446,7 +339,7 @@ async def test_begin_migrate_sql_container_to_autoscale(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -462,36 +355,7 @@ async def test_begin_migrate_sql_container_to_manual_throughput(self, resource_g account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - - # please add some check logic here by yourself - # ... - - @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) - @recorded_by_proxy_async - async def test_begin_sql_database_retrieve_throughput_distribution(self, resource_group): - response = await ( - await self.client.sql_resources.begin_sql_database_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -500,95 +364,49 @@ async def test_begin_sql_database_retrieve_throughput_distribution(self, resourc @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_sql_database_redistribute_throughput(self, resource_group): - response = await ( - await self.client.sql_resources.begin_sql_database_redistribute_throughput( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - redistribute_throughput_parameters={ - "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result - + async def test_list_client_encryption_keys(self, resource_group): + response = self.client.sql_resources.list_client_encryption_keys( + resource_group_name=resource_group.name, + account_name="str", + database_name="str", + api_version="2024-11-15", + ) + result = [r async for r in response] # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_sql_container_retrieve_throughput_distribution(self, resource_group): - response = await ( - await self.client.sql_resources.begin_sql_container_retrieve_throughput_distribution( - resource_group_name=resource_group.name, - account_name="str", - database_name="str", - container_name="str", - retrieve_throughput_parameters={ - "resource": {"physicalPartitionIds": [{"id": "str"}]}, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", - }, - api_version="2024-09-01-preview", - ) - ).result() # call '.result()' to poll until service return final result + async def test_get_client_encryption_key(self, resource_group): + response = await self.client.sql_resources.get_client_encryption_key( + resource_group_name=resource_group.name, + account_name="str", + database_name="str", + client_encryption_key_name="str", + api_version="2024-11-15", + ) # please add some check logic here by yourself # ... @RandomNameResourceGroupPreparer(location=AZURE_LOCATION) @recorded_by_proxy_async - async def test_begin_sql_container_redistribute_throughput(self, resource_group): + async def test_begin_create_update_client_encryption_key(self, resource_group): response = await ( - await self.client.sql_resources.begin_sql_container_redistribute_throughput( + await self.client.sql_resources.begin_create_update_client_encryption_key( resource_group_name=resource_group.name, account_name="str", database_name="str", - container_name="str", - redistribute_throughput_parameters={ + client_encryption_key_name="str", + create_update_client_encryption_key_parameters={ "resource": { - "sourcePhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "targetPhysicalPartitionThroughputInfo": [{"id": "str", "throughput": 0.0}], - "throughputPolicy": "str", - }, - "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, - "location": "str", - "name": "str", - "tags": {"str": "str"}, - "type": "str", + "encryptionAlgorithm": "str", + "id": "str", + "keyWrapMetadata": {"algorithm": "str", "name": "str", "type": "str", "value": "str"}, + "wrappedDataEncryptionKey": bytes("bytes", encoding="utf-8"), + } }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -603,7 +421,7 @@ async def test_list_sql_stored_procedures(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -618,7 +436,7 @@ async def test_get_sql_stored_procedure(self, resource_group): database_name="str", container_name="str", stored_procedure_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -637,19 +455,13 @@ async def test_begin_create_update_sql_stored_procedure(self, resource_group): create_update_sql_stored_procedure_parameters={ "resource": {"id": "str", "body": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -666,7 +478,7 @@ async def test_begin_delete_sql_stored_procedure(self, resource_group): database_name="str", container_name="str", stored_procedure_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -681,7 +493,7 @@ async def test_list_sql_user_defined_functions(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -696,7 +508,7 @@ async def test_get_sql_user_defined_function(self, resource_group): database_name="str", container_name="str", user_defined_function_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -715,19 +527,13 @@ async def test_begin_create_update_sql_user_defined_function(self, resource_grou create_update_sql_user_defined_function_parameters={ "resource": {"id": "str", "body": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -744,7 +550,7 @@ async def test_begin_delete_sql_user_defined_function(self, resource_group): database_name="str", container_name="str", user_defined_function_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -759,7 +565,7 @@ async def test_list_sql_triggers(self, resource_group): account_name="str", database_name="str", container_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -774,7 +580,7 @@ async def test_get_sql_trigger(self, resource_group): database_name="str", container_name="str", trigger_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -793,19 +599,13 @@ async def test_begin_create_update_sql_trigger(self, resource_group): create_update_sql_trigger_parameters={ "resource": {"id": "str", "body": "str", "triggerOperation": "str", "triggerType": "str"}, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -822,7 +622,7 @@ async def test_begin_delete_sql_trigger(self, resource_group): database_name="str", container_name="str", trigger_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -836,7 +636,7 @@ async def test_get_sql_role_definition(self, resource_group): role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -856,7 +656,7 @@ async def test_begin_create_update_sql_role_definition(self, resource_group): "roleName": "str", "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -871,7 +671,7 @@ async def test_begin_delete_sql_role_definition(self, resource_group): role_definition_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -884,7 +684,7 @@ async def test_list_sql_role_definitions(self, resource_group): response = self.client.sql_resources.list_sql_role_definitions( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -897,7 +697,7 @@ async def test_get_sql_role_assignment(self, resource_group): role_assignment_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -916,7 +716,7 @@ async def test_begin_create_update_sql_role_assignment(self, resource_group): "roleDefinitionId": "str", "scope": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -931,7 +731,7 @@ async def test_begin_delete_sql_role_assignment(self, resource_group): role_assignment_id="str", resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -944,7 +744,7 @@ async def test_list_sql_role_assignments(self, resource_group): response = self.client.sql_resources.list_sql_role_assignments( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -960,7 +760,7 @@ async def test_begin_retrieve_continuous_backup_information(self, resource_group database_name="str", container_name="str", location={"location": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations.py index 12824c4d0fcc..ca16471d9ad3 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations.py @@ -24,7 +24,7 @@ def test_list_tables(self, resource_group): response = self.client.table_resources.list_tables( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r for r in response] # please add some check logic here by yourself @@ -37,7 +37,7 @@ def test_get_table(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -61,19 +61,13 @@ def test_begin_create_update_table(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -86,7 +80,7 @@ def test_begin_delete_table(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -99,7 +93,7 @@ def test_get_table_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -126,18 +120,12 @@ def test_begin_update_table_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -150,7 +138,7 @@ def test_begin_migrate_table_to_autoscale(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -163,7 +151,7 @@ def test_begin_migrate_table_to_manual_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself @@ -177,7 +165,7 @@ def test_begin_retrieve_continuous_backup_information(self, resource_group): account_name="str", table_name="str", location={"location": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ).result() # call '.result()' to poll until service return final result # please add some check logic here by yourself diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations_async.py b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations_async.py index 83e53700d125..04678872661b 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations_async.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/generated_tests/test_cosmos_db_management_table_resources_operations_async.py @@ -25,7 +25,7 @@ async def test_list_tables(self, resource_group): response = self.client.table_resources.list_tables( resource_group_name=resource_group.name, account_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) result = [r async for r in response] # please add some check logic here by yourself @@ -38,7 +38,7 @@ async def test_get_table(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -63,19 +63,13 @@ async def test_begin_create_update_table(self, resource_group): }, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "options": {"autoscaleSettings": {"maxThroughput": 0}, "throughput": 0}, "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -90,7 +84,7 @@ async def test_begin_delete_table(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -104,7 +98,7 @@ async def test_get_table_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) # please add some check logic here by yourself @@ -132,18 +126,12 @@ async def test_begin_update_table_throughput(self, resource_group): "throughput": 0, }, "id": "str", - "identity": { - "principalId": "str", - "tenantId": "str", - "type": "str", - "userAssignedIdentities": {"str": {"clientId": "str", "principalId": "str"}}, - }, "location": "str", "name": "str", "tags": {"str": "str"}, "type": "str", }, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -158,7 +146,7 @@ async def test_begin_migrate_table_to_autoscale(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -173,7 +161,7 @@ async def test_begin_migrate_table_to_manual_throughput(self, resource_group): resource_group_name=resource_group.name, account_name="str", table_name="str", - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result @@ -189,7 +177,7 @@ async def test_begin_retrieve_continuous_backup_information(self, resource_group account_name="str", table_name="str", location={"location": "str"}, - api_version="2024-09-01-preview", + api_version="2024-11-15", ) ).result() # call '.result()' to poll until service return final result