From 91abc49b4fa897c6a7bdbfb69097e7f5f132f038 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Tue, 14 Sep 2021 09:32:36 +0000 Subject: [PATCH 1/2] CodeGen from PR 15971 in Azure/azure-rest-api-specs [CosmosDB] Fixing bugs in Services APIs (#15971) * test * try1 * fixing services discriminator * prettier and readme * revert additional changes * fixing model validation errors * model validation fix * nit Co-authored-by: Meha Kaushik --- sdk/cosmos/azure-mgmt-cosmosdb/_meta.json | 8 +- .../azure/mgmt/cosmosdb/_configuration.py | 2 +- .../cosmosdb/_cosmos_db_management_client.py | 23 +- .../azure/mgmt/cosmosdb/_metadata.json | 44 +- .../azure/mgmt/cosmosdb/_version.py | 2 +- .../azure/mgmt/cosmosdb/aio/_configuration.py | 2 +- .../aio/_cosmos_db_management_client.py | 23 +- .../mgmt/cosmosdb/aio/operations/__init__.py | 10 + .../_cassandra_clusters_operations.py | 124 +- .../_cassandra_data_centers_operations.py | 84 +- .../_cassandra_resources_operations.py | 905 +++- .../aio/operations/_collection_operations.py | 6 +- .../_collection_partition_operations.py | 4 +- ..._collection_partition_region_operations.py | 2 +- .../_collection_region_operations.py | 2 +- ..._cosmos_db_management_client_operations.py | 8 +- .../_database_account_region_operations.py | 2 +- .../_database_accounts_operations.py | 36 +- .../aio/operations/_database_operations.py | 6 +- .../operations/_graph_resources_operations.py | 427 ++ .../_gremlin_resources_operations.py | 32 +- .../_mongo_db_resources_operations.py | 32 +- .../_notebook_workspaces_operations.py | 14 +- .../cosmosdb/aio/operations/_operations.py | 2 +- .../_partition_key_range_id_operations.py | 2 +- ...artition_key_range_id_region_operations.py | 2 +- .../aio/operations/_percentile_operations.py | 2 +- .../_percentile_source_target_operations.py | 2 +- .../_percentile_target_operations.py | 2 +- ...private_endpoint_connections_operations.py | 8 +- .../_private_link_resources_operations.py | 4 +- ...restorable_database_accounts_operations.py | 6 +- ...storable_mongodb_collections_operations.py | 2 +- ...restorable_mongodb_databases_operations.py | 2 +- ...restorable_mongodb_resources_operations.py | 2 +- .../_restorable_sql_containers_operations.py | 2 +- .../_restorable_sql_databases_operations.py | 2 +- .../_restorable_sql_resources_operations.py | 2 +- .../aio/operations/_service_operations.py | 48 +- .../operations/_sql_resources_operations.py | 74 +- .../operations/_table_resources_operations.py | 16 +- .../azure/mgmt/cosmosdb/models/__init__.py | 156 + .../_cosmos_db_management_client_enums.py | 80 + .../azure/mgmt/cosmosdb/models/_models.py | 3437 +++++++++++--- .../azure/mgmt/cosmosdb/models/_models_py3.py | 4125 +++++++++++++---- .../mgmt/cosmosdb/operations/__init__.py | 10 + .../_cassandra_clusters_operations.py | 94 +- .../_cassandra_data_centers_operations.py | 68 +- .../_cassandra_resources_operations.py | 918 +++- .../operations/_collection_operations.py | 6 +- .../_collection_partition_operations.py | 4 +- ..._collection_partition_region_operations.py | 2 +- .../_collection_region_operations.py | 2 +- ..._cosmos_db_management_client_operations.py | 4 +- .../_database_account_region_operations.py | 2 +- .../_database_accounts_operations.py | 36 +- .../operations/_database_operations.py | 6 +- .../operations/_graph_resources_operations.py | 437 ++ .../_gremlin_resources_operations.py | 32 +- .../_mongo_db_resources_operations.py | 32 +- .../_notebook_workspaces_operations.py | 14 +- .../mgmt/cosmosdb/operations/_operations.py | 2 +- .../_partition_key_range_id_operations.py | 2 +- ...artition_key_range_id_region_operations.py | 2 +- .../operations/_percentile_operations.py | 2 +- .../_percentile_source_target_operations.py | 2 +- .../_percentile_target_operations.py | 2 +- ...private_endpoint_connections_operations.py | 8 +- .../_private_link_resources_operations.py | 4 +- ...restorable_database_accounts_operations.py | 6 +- ...storable_mongodb_collections_operations.py | 2 +- ...restorable_mongodb_databases_operations.py | 2 +- ...restorable_mongodb_resources_operations.py | 2 +- .../_restorable_sql_containers_operations.py | 2 +- .../_restorable_sql_databases_operations.py | 2 +- .../_restorable_sql_resources_operations.py | 2 +- .../operations/_service_operations.py | 36 +- .../operations/_sql_resources_operations.py | 74 +- .../operations/_table_resources_operations.py | 16 +- 79 files changed, 9410 insertions(+), 2201 deletions(-) create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py create mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json index 847fc8ff8a25..a725e2f1fa20 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json +++ b/sdk/cosmos/azure-mgmt-cosmosdb/_meta.json @@ -1,11 +1,11 @@ { - "autorest": "3.4.2", + "autorest": "3.4.5", "use": [ - "@autorest/python@5.8.0", + "@autorest/python@5.8.4", "@autorest/modelerfour@4.19.2" ], - "commit": "f780b571abddf2fc99233212a00510d3bef6878d", + "commit": "6223e02c7f87d0bd5878a0f79835860cb695c0c3", "repository_url": "https://github.com/Azure/azure-rest-api-specs", - "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.0 --use=@autorest/modelerfour@4.19.2 --version=3.4.2", + "autorest_command": "autorest specification/cosmos-db/resource-manager/readme.md --multiapi --python --python-mode=update --python-sdks-folder=/home/vsts/work/1/s/azure-sdk-for-python/sdk --track2 --use=@autorest/python@5.8.4 --use=@autorest/modelerfour@4.19.2 --version=3.4.5", "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 6139eba8b244..6ff3e742876e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_configuration.py @@ -48,7 +48,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-06-15" + self.api_version = "2021-07-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-cosmosdb/{}'.format(VERSION)) self._configure(**kwargs) 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 b3d7828522b4..c5abb79574e1 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 @@ -32,11 +32,13 @@ from .operations import CollectionPartitionOperations from .operations import PartitionKeyRangeIdOperations from .operations import PartitionKeyRangeIdRegionOperations +from .operations import GraphResourcesOperations from .operations import SqlResourcesOperations from .operations import MongoDBResourcesOperations from .operations import TableResourcesOperations from .operations import CassandraResourcesOperations from .operations import GremlinResourcesOperations +from .operations import CosmosDBManagementClientOperationsMixin from .operations import NotebookWorkspacesOperations from .operations import PrivateEndpointConnectionsOperations from .operations import PrivateLinkResourcesOperations @@ -47,10 +49,13 @@ from .operations import RestorableMongodbDatabasesOperations from .operations import RestorableMongodbCollectionsOperations from .operations import RestorableMongodbResourcesOperations +from .operations import CassandraClustersOperations +from .operations import CassandraDataCentersOperations +from .operations import ServiceOperations from . import models -class CosmosDBManagementClient(object): +class CosmosDBManagementClient(CosmosDBManagementClientOperationsMixin): """Azure Cosmos DB Database Service Resource Provider REST API. :ivar database_accounts: DatabaseAccountsOperations operations @@ -79,6 +84,8 @@ class CosmosDBManagementClient(object): :vartype partition_key_range_id: azure.mgmt.cosmosdb.operations.PartitionKeyRangeIdOperations :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 @@ -109,6 +116,12 @@ class CosmosDBManagementClient(object): :vartype restorable_mongodb_collections: azure.mgmt.cosmosdb.operations.RestorableMongodbCollectionsOperations :ivar restorable_mongodb_resources: RestorableMongodbResourcesOperations operations :vartype restorable_mongodb_resources: azure.mgmt.cosmosdb.operations.RestorableMongodbResourcesOperations + :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 service: ServiceOperations operations + :vartype service: azure.mgmt.cosmosdb.operations.ServiceOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials.TokenCredential :param subscription_id: The ID of the target subscription. @@ -161,6 +174,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) 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( @@ -191,6 +206,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.restorable_mongodb_resources = RestorableMongodbResourcesOperations( 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.service = ServiceOperations( + self._client, self._config, self._serialize, self._deserialize) def _send_request(self, http_request, **kwargs): # type: (HttpRequest, Any) -> HttpResponse diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_metadata.json b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_metadata.json index 5768fa11a66c..8024166e0557 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_metadata.json +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/_metadata.json @@ -1,6 +1,6 @@ { - "chosen_version": "2021-06-15", - "total_api_version_list": ["2021-06-15"], + "chosen_version": "2021-07-01-preview", + "total_api_version_list": ["2021-07-01-preview"], "client": { "name": "CosmosDBManagementClient", "filename": "_cosmos_db_management_client", @@ -10,8 +10,8 @@ "azure_arm": true, "has_lro_operations": true, "client_side_validation": false, - "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CosmosDBManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", - "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CosmosDBManagementClientConfiguration\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" + "sync_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials\": [\"TokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"ARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CosmosDBManagementClientConfiguration\"], \"._operations_mixin\": [\"CosmosDBManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"]}}}", + "async_imports": "{\"typing\": {\"azurecore\": {\"azure.core.credentials_async\": [\"AsyncTokenCredential\"]}}, \"regular\": {\"azurecore\": {\"azure.profiles\": [\"KnownProfiles\", \"ProfileDefinition\"], \"azure.profiles.multiapiclient\": [\"MultiApiClientMixin\"], \"msrest\": [\"Deserializer\", \"Serializer\"], \"azure.mgmt.core\": [\"AsyncARMPipelineClient\"]}, \"local\": {\"._configuration\": [\"CosmosDBManagementClientConfiguration\"], \"._operations_mixin\": [\"CosmosDBManagementClientOperationsMixin\"]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Optional\"]}, \"azurecore\": {\"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"]}}}" }, "global_parameters": { "sync": { @@ -111,6 +111,7 @@ "collection_partition": "CollectionPartitionOperations", "partition_key_range_id": "PartitionKeyRangeIdOperations", "partition_key_range_id_region": "PartitionKeyRangeIdRegionOperations", + "graph_resources": "GraphResourcesOperations", "sql_resources": "SqlResourcesOperations", "mongo_db_resources": "MongoDBResourcesOperations", "table_resources": "TableResourcesOperations", @@ -125,6 +126,39 @@ "restorable_sql_resources": "RestorableSqlResourcesOperations", "restorable_mongodb_databases": "RestorableMongodbDatabasesOperations", "restorable_mongodb_collections": "RestorableMongodbCollectionsOperations", - "restorable_mongodb_resources": "RestorableMongodbResourcesOperations" + "restorable_mongodb_resources": "RestorableMongodbResourcesOperations", + "cassandra_clusters": "CassandraClustersOperations", + "cassandra_data_centers": "CassandraDataCentersOperations", + "service": "ServiceOperations" + }, + "operation_mixins": { + "sync_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"HttpRequest\", \"HttpResponse\"], \"azure.core.paging\": [\"ItemPaged\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"Callable\", \"Dict\", \"Generic\", \"Iterable\", \"Optional\", \"TypeVar\"]}}}", + "async_imports": "{\"regular\": {\"azurecore\": {\"azure.core.exceptions\": [\"ClientAuthenticationError\", \"HttpResponseError\", \"ResourceExistsError\", \"ResourceNotFoundError\", \"map_error\"], \"azure.mgmt.core.exceptions\": [\"ARMErrorFormat\"], \"azure.core.pipeline\": [\"PipelineResponse\"], \"azure.core.pipeline.transport\": [\"AsyncHttpResponse\", \"HttpRequest\"], \"azure.core.async_paging\": [\"AsyncItemPaged\", \"AsyncList\"]}, \"stdlib\": {\"warnings\": [null]}}, \"conditional\": {\"stdlib\": {\"typing\": [\"Any\", \"AsyncIterable\", \"Callable\", \"Dict\", \"Generic\", \"Optional\", \"TypeVar\"]}}}", + "operations": { + "location_list" : { + "sync": { + "signature": "def location_list(\n self,\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"List Cosmos DB locations and their properties.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either LocationListResult or the result of cls(response)\n:rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.LocationListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": false, + "signature": "def location_list(\n self,\n **kwargs: Any\n) -\u003e AsyncItemPaged[\"_models.LocationListResult\"]:\n", + "doc": "\"\"\"List Cosmos DB locations and their properties.\n\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: An iterator like instance of either LocationListResult or the result of cls(response)\n:rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.LocationListResult]\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "" + }, + "location_get" : { + "sync": { + "signature": "def location_get(\n self,\n location, # type: str\n **kwargs # type: Any\n):\n", + "doc": "\"\"\"Get the properties of an existing Cosmos DB location.\n\n:param location: Cosmos DB region, with spaces between words and each word capitalized.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: LocationGetResult, or the result of cls(response)\n:rtype: ~azure.mgmt.cosmosdb.models.LocationGetResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "async": { + "coroutine": true, + "signature": "async def location_get(\n self,\n location: str,\n **kwargs: Any\n) -\u003e \"_models.LocationGetResult\":\n", + "doc": "\"\"\"Get the properties of an existing Cosmos DB location.\n\n:param location: Cosmos DB region, with spaces between words and each word capitalized.\n:type location: str\n:keyword callable cls: A custom type or function that will be passed the direct response\n:return: LocationGetResult, or the result of cls(response)\n:rtype: ~azure.mgmt.cosmosdb.models.LocationGetResult\n:raises: ~azure.core.exceptions.HttpResponseError\n\"\"\"" + }, + "call": "location" + } + } } } \ No newline at end of file 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 fba0344fbc7b..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 = "6.4.0" +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 89ca29f296f9..60bb9254b97f 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 @@ -45,7 +45,7 @@ def __init__( self.credential = credential self.subscription_id = subscription_id - self.api_version = "2021-06-15" + self.api_version = "2021-07-01-preview" self.credential_scopes = kwargs.pop('credential_scopes', ['https://management.azure.com/.default']) kwargs.setdefault('sdk_moniker', 'mgmt-cosmosdb/{}'.format(VERSION)) self._configure(**kwargs) 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 c38011978b58..4de01d4be8a7 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 @@ -30,11 +30,13 @@ from .operations import CollectionPartitionOperations from .operations import PartitionKeyRangeIdOperations from .operations import PartitionKeyRangeIdRegionOperations +from .operations import GraphResourcesOperations from .operations import SqlResourcesOperations from .operations import MongoDBResourcesOperations from .operations import TableResourcesOperations from .operations import CassandraResourcesOperations from .operations import GremlinResourcesOperations +from .operations import CosmosDBManagementClientOperationsMixin from .operations import NotebookWorkspacesOperations from .operations import PrivateEndpointConnectionsOperations from .operations import PrivateLinkResourcesOperations @@ -45,10 +47,13 @@ from .operations import RestorableMongodbDatabasesOperations from .operations import RestorableMongodbCollectionsOperations from .operations import RestorableMongodbResourcesOperations +from .operations import CassandraClustersOperations +from .operations import CassandraDataCentersOperations +from .operations import ServiceOperations from .. import models -class CosmosDBManagementClient(object): +class CosmosDBManagementClient(CosmosDBManagementClientOperationsMixin): """Azure Cosmos DB Database Service Resource Provider REST API. :ivar database_accounts: DatabaseAccountsOperations operations @@ -77,6 +82,8 @@ class CosmosDBManagementClient(object): :vartype partition_key_range_id: azure.mgmt.cosmosdb.aio.operations.PartitionKeyRangeIdOperations :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 @@ -107,6 +114,12 @@ class CosmosDBManagementClient(object): :vartype restorable_mongodb_collections: azure.mgmt.cosmosdb.aio.operations.RestorableMongodbCollectionsOperations :ivar restorable_mongodb_resources: RestorableMongodbResourcesOperations operations :vartype restorable_mongodb_resources: azure.mgmt.cosmosdb.aio.operations.RestorableMongodbResourcesOperations + :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 service: ServiceOperations operations + :vartype service: azure.mgmt.cosmosdb.aio.operations.ServiceOperations :param credential: Credential needed for the client to connect to Azure. :type credential: ~azure.core.credentials_async.AsyncTokenCredential :param subscription_id: The ID of the target subscription. @@ -158,6 +171,8 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) 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( @@ -188,6 +203,12 @@ def __init__( self._client, self._config, self._serialize, self._deserialize) self.restorable_mongodb_resources = RestorableMongodbResourcesOperations( 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.service = ServiceOperations( + self._client, self._config, self._serialize, self._deserialize) async def _send_request(self, http_request: HttpRequest, **kwargs: Any) -> AsyncHttpResponse: """Runs the network request through the client's chained policies. 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 a265f7a8b397..a7c7808a801a 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,11 +19,13 @@ 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 ._cosmos_db_management_client_operations import CosmosDBManagementClientOperationsMixin from ._notebook_workspaces_operations import NotebookWorkspacesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations @@ -34,6 +36,9 @@ from ._restorable_mongodb_databases_operations import RestorableMongodbDatabasesOperations from ._restorable_mongodb_collections_operations import RestorableMongodbCollectionsOperations from ._restorable_mongodb_resources_operations import RestorableMongodbResourcesOperations +from ._cassandra_clusters_operations import CassandraClustersOperations +from ._cassandra_data_centers_operations import CassandraDataCentersOperations +from ._service_operations import ServiceOperations __all__ = [ 'DatabaseAccountsOperations', @@ -49,11 +54,13 @@ 'CollectionPartitionOperations', 'PartitionKeyRangeIdOperations', 'PartitionKeyRangeIdRegionOperations', + 'GraphResourcesOperations', 'SqlResourcesOperations', 'MongoDBResourcesOperations', 'TableResourcesOperations', 'CassandraResourcesOperations', 'GremlinResourcesOperations', + 'CosmosDBManagementClientOperationsMixin', 'NotebookWorkspacesOperations', 'PrivateEndpointConnectionsOperations', 'PrivateLinkResourcesOperations', @@ -64,4 +71,7 @@ 'RestorableMongodbDatabasesOperations', 'RestorableMongodbCollectionsOperations', 'RestorableMongodbResourcesOperations', + 'CassandraClustersOperations', + 'CassandraDataCentersOperations', + 'ServiceOperations', ] 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 1003e3d55054..1d4def896931 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 @@ -45,7 +45,7 @@ def __init__(self, client, config, serializer, deserializer) -> None: def list_by_subscription( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListClusters"]: """List all managed Cassandra clusters in this subscription. @@ -59,7 +59,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -112,7 +112,7 @@ async def get_next(next_link=None): def list_by_resource_group( self, resource_group_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListClusters"]: """List all managed Cassandra clusters in this resource group. @@ -128,7 +128,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -141,7 +141,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -183,7 +183,7 @@ async def get( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> "_models.ClusterResource": """Get the properties of a managed Cassandra cluster. @@ -201,15 +201,15 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -241,22 +241,22 @@ async def _delete_initial( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -285,7 +285,7 @@ async def begin_delete( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes a managed Cassandra cluster. @@ -295,8 +295,8 @@ async def begin_delete( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -327,8 +327,8 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -350,14 +350,14 @@ async def _create_update_initial( resource_group_name: str, cluster_name: str, body: "_models.ClusterResource", - **kwargs + **kwargs: Any ) -> "_models.ClusterResource": cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -365,8 +365,8 @@ async def _create_update_initial( url = self._create_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -407,7 +407,7 @@ async def begin_create_update( resource_group_name: str, cluster_name: str, body: "_models.ClusterResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.ClusterResource"]: """Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update only some properties, use PATCH. @@ -420,8 +420,8 @@ async def begin_create_update( :type body: ~azure.mgmt.cosmosdb.models.ClusterResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either ClusterResource or the result of cls(response) @@ -456,8 +456,8 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -479,14 +479,14 @@ async def _update_initial( resource_group_name: str, cluster_name: str, body: "_models.ClusterResource", - **kwargs + **kwargs: Any ) -> "_models.ClusterResource": cls = kwargs.pop('cls', None) # type: ClsType["_models.ClusterResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -494,8 +494,8 @@ async def _update_initial( url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -536,7 +536,7 @@ async def begin_update( resource_group_name: str, cluster_name: str, body: "_models.ClusterResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.ClusterResource"]: """Updates some of the properties of a managed Cassandra cluster. @@ -548,8 +548,8 @@ async def begin_update( :type body: ~azure.mgmt.cosmosdb.models.ClusterResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either ClusterResource or the result of cls(response) @@ -584,8 +584,8 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -607,14 +607,14 @@ async def _request_repair_initial( resource_group_name: str, cluster_name: str, body: "_models.RepairPostBody", - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -622,8 +622,8 @@ async def _request_repair_initial( url = self._request_repair_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -657,7 +657,7 @@ async def begin_request_repair( resource_group_name: str, cluster_name: str, body: "_models.RepairPostBody", - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Request that repair begin on this cluster as soon as possible. @@ -669,8 +669,8 @@ async def begin_request_repair( :type body: ~azure.mgmt.cosmosdb.models.RepairPostBody :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -702,8 +702,8 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -724,22 +724,22 @@ async def _fetch_node_status_initial( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> Optional["_models.ClusterNodeStatus"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ClusterNodeStatus"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self._fetch_node_status_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -773,7 +773,7 @@ async def begin_fetch_node_status( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.ClusterNodeStatus"]: """Request the status of all nodes in the cluster (as returned by 'nodetool status'). @@ -783,8 +783,8 @@ async def begin_fetch_node_status( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either ClusterNodeStatus or the result of cls(response) @@ -818,8 +818,8 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -840,7 +840,7 @@ def list_backups( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListBackups"]: """List the backups of this cluster that are available to restore. @@ -858,7 +858,7 @@ def list_backups( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -871,8 +871,8 @@ def prepare_request(next_link=None): url = self.list_backups.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -915,7 +915,7 @@ async def get_backup( resource_group_name: str, cluster_name: str, backup_id: str, - **kwargs + **kwargs: Any ) -> "_models.BackupResource": """Get the properties of an individual backup of this cluster that is available to restore. @@ -935,15 +935,15 @@ async def get_backup( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self.get_backup.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), 'backupId': self._serialize.url("backup_id", backup_id, 'str', max_length=15, min_length=1, pattern=r'^[0-9]+$'), } url = self._client.format_url(url, **path_format_arguments) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py index 1968aa6dbd10..0e07a7e4289c 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cassandra_data_centers_operations.py @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, cluster_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ListDataCenters"]: """List all data centers in a particular managed Cassandra cluster. @@ -65,7 +65,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -78,8 +78,8 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -122,7 +122,7 @@ async def get( resource_group_name: str, cluster_name: str, data_center_name: str, - **kwargs + **kwargs: Any ) -> "_models.DataCenterResource": """Get the properties of a managed Cassandra data center. @@ -142,16 +142,16 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -184,23 +184,23 @@ async def _delete_initial( resource_group_name: str, cluster_name: str, data_center_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -230,7 +230,7 @@ async def begin_delete( resource_group_name: str, cluster_name: str, data_center_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Delete a managed Cassandra data center. @@ -242,8 +242,8 @@ async def begin_delete( :type data_center_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -275,9 +275,9 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -300,14 +300,14 @@ async def _create_update_initial( cluster_name: str, data_center_name: str, body: "_models.DataCenterResource", - **kwargs + **kwargs: Any ) -> "_models.DataCenterResource": cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCenterResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -315,9 +315,9 @@ async def _create_update_initial( url = self._create_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -359,7 +359,7 @@ async def begin_create_update( cluster_name: str, data_center_name: str, body: "_models.DataCenterResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.DataCenterResource"]: """Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some properties, use PATCH. @@ -374,8 +374,8 @@ async def begin_create_update( :type body: ~azure.mgmt.cosmosdb.models.DataCenterResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DataCenterResource or the result of cls(response) @@ -411,9 +411,9 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -436,14 +436,14 @@ async def _update_initial( cluster_name: str, data_center_name: str, body: "_models.DataCenterResource", - **kwargs + **kwargs: Any ) -> "_models.DataCenterResource": cls = kwargs.pop('cls', None) # type: ClsType["_models.DataCenterResource"] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -451,9 +451,9 @@ async def _update_initial( url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -495,7 +495,7 @@ async def begin_update( cluster_name: str, data_center_name: str, body: "_models.DataCenterResource", - **kwargs + **kwargs: Any ) -> AsyncLROPoller["_models.DataCenterResource"]: """Update some of the properties of a managed Cassandra data center. @@ -509,8 +509,8 @@ async def begin_update( :type body: ~azure.mgmt.cosmosdb.models.DataCenterResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either DataCenterResource or the result of cls(response) @@ -546,9 +546,9 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) 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 c1351f65cd00..058af5373e55 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 @@ -65,7 +65,7 @@ def list_cassandra_keyspaces( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -143,7 +143,7 @@ async def get_cassandra_keyspace( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -193,7 +193,7 @@ async def _create_update_cassandra_keyspace_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -326,7 +326,7 @@ async def _delete_cassandra_keyspace_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_cassandra_keyspace_initial.metadata['url'] # type: ignore @@ -453,7 +453,7 @@ async def get_cassandra_keyspace_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -503,7 +503,7 @@ async def _update_cassandra_keyspace_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -636,7 +636,7 @@ async def _migrate_cassandra_keyspace_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -759,7 +759,7 @@ async def _migrate_cassandra_keyspace_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -895,7 +895,7 @@ def list_cassandra_tables( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -976,7 +976,7 @@ async def get_cassandra_table( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1028,7 +1028,7 @@ async def _create_update_cassandra_table_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1168,7 +1168,7 @@ async def _delete_cassandra_table_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_cassandra_table_initial.metadata['url'] # type: ignore @@ -1304,7 +1304,7 @@ async def get_cassandra_table_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1356,7 +1356,7 @@ async def _update_cassandra_table_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1496,7 +1496,7 @@ async def _migrate_cassandra_table_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1626,7 +1626,7 @@ async def _migrate_cassandra_table_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1742,3 +1742,876 @@ def get_long_running_output(pipeline_response): else: return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_migrate_cassandra_table_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput'} # type: ignore + + def list_cassandra_views( + self, + resource_group_name: str, + account_name: str, + keyspace_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.CassandraViewListResult"]: + """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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CassandraViewListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.CassandraViewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CassandraViewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_cassandra_views.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + 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) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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 + ) + list_cassandra_views.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views'} # type: ignore + + 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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CassandraViewGetResults, or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.CassandraViewGetResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CassandraViewGetResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_cassandra_view.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_cassandra_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}'} # 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: "_models.CassandraViewCreateUpdateParameters", + **kwargs: Any + ) -> Optional["_models.CassandraViewGetResults"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CassandraViewGetResults"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_update_cassandra_view_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(create_update_cassandra_view_parameters, 'CassandraViewCreateUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CassandraViewGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_update_cassandra_view_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}'} # type: ignore + + 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", + **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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :param create_update_cassandra_view_parameters: The parameters to provide for the current + Cassandra View. + :type create_update_cassandra_view_parameters: ~azure.mgmt.cosmosdb.models.CassandraViewCreateUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either CassandraViewGetResults or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CassandraViewGetResults"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CassandraViewGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_update_cassandra_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}'} # type: ignore + + async def _delete_cassandra_view_initial( + self, + resource_group_name: str, + account_name: str, + keyspace_name: str, + view_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + + # Construct URL + url = self._delete_cassandra_view_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_cassandra_view_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}'} # type: ignore + + 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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_cassandra_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}'} # type: ignore + + 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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ThroughputSettingsGetResults, or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ThroughputSettingsGetResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_cassandra_view_throughput.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_cassandra_view_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default'} # type: ignore + + async def _update_cassandra_view_throughput_initial( + self, + resource_group_name: str, + account_name: str, + keyspace_name: str, + view_name: str, + update_throughput_parameters: "_models.ThroughputSettingsUpdateParameters", + **kwargs: Any + ) -> Optional["_models.ThroughputSettingsGetResults"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ThroughputSettingsGetResults"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_cassandra_view_throughput_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(update_throughput_parameters, 'ThroughputSettingsUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_cassandra_view_throughput_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default'} # type: ignore + + 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", + **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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :param update_throughput_parameters: The RUs per second of the parameters to provide for the + current Cassandra view. + :type update_throughput_parameters: ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ThroughputSettingsGetResults"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_cassandra_view_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default'} # type: ignore + + async def _migrate_cassandra_view_to_autoscale_initial( + self, + resource_group_name: str, + account_name: str, + keyspace_name: str, + view_name: str, + **kwargs: Any + ) -> Optional["_models.ThroughputSettingsGetResults"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ThroughputSettingsGetResults"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + # Construct URL + url = self._migrate_cassandra_view_to_autoscale_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_cassandra_view_to_autoscale_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale'} # type: ignore + + async def begin_migrate_cassandra_view_to_autoscale( + 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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ThroughputSettingsGetResults"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_cassandra_view_to_autoscale.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale'} # type: ignore + + async def _migrate_cassandra_view_to_manual_throughput_initial( + self, + resource_group_name: str, + account_name: str, + keyspace_name: str, + view_name: str, + **kwargs: Any + ) -> Optional["_models.ThroughputSettingsGetResults"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ThroughputSettingsGetResults"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + # Construct URL + url = self._migrate_cassandra_view_to_manual_throughput_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_cassandra_view_to_manual_throughput_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput'} # type: ignore + + async def begin_migrate_cassandra_view_to_manual_throughput( + 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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either ThroughputSettingsGetResults or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ThroughputSettingsGetResults"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_cassandra_view_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput'} # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py index 11fe1e8d61e3..d6e7d2667ae0 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_operations.py @@ -75,7 +75,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -162,7 +162,7 @@ def list_usages( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -246,7 +246,7 @@ def list_metric_definitions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py index 2c22d7db0441..c8346c18f1a4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_operations.py @@ -75,7 +75,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -162,7 +162,7 @@ def list_usages( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py index e5153e7a51d1..8e255eec67d1 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_partition_region_operations.py @@ -78,7 +78,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py index 13a8495c8e0b..3f5b718e1a36 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_collection_region_operations.py @@ -78,7 +78,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cosmos_db_management_client_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cosmos_db_management_client_operations.py index 83ce509b8424..e37d86df189e 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cosmos_db_management_client_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_cosmos_db_management_client_operations.py @@ -23,7 +23,7 @@ class CosmosDBManagementClientOperationsMixin: def location_list( self, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.LocationListResult"]: """List Cosmos DB locations and their properties. @@ -37,7 +37,7 @@ def location_list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -90,7 +90,7 @@ async def get_next(next_link=None): async def location_get( self, location: str, - **kwargs + **kwargs: Any ) -> "_models.LocationGetResult": """Get the properties of an existing Cosmos DB location. @@ -106,7 +106,7 @@ async def location_get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py index 41b34c27dd1b..16cef787b1de 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_account_region_operations.py @@ -71,7 +71,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py index 958c07c4e169..be33c45d9367 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_accounts_operations.py @@ -65,7 +65,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -113,7 +113,7 @@ async def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -237,7 +237,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -361,7 +361,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -468,7 +468,7 @@ async def _failover_priority_change_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -591,7 +591,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -660,7 +660,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -733,7 +733,7 @@ async def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -791,7 +791,7 @@ async def list_connection_strings( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -839,7 +839,7 @@ async def _offline_region_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -958,7 +958,7 @@ async def _online_region_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1087,7 +1087,7 @@ async def get_read_only_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1145,7 +1145,7 @@ async def list_read_only_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1193,7 +1193,7 @@ async def _regenerate_key_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -1318,7 +1318,7 @@ async def check_name_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self.check_name_exists.metadata['url'] # type: ignore @@ -1375,7 +1375,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1454,7 +1454,7 @@ def list_usages( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1530,7 +1530,7 @@ def list_metric_definitions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py index 921bc9c48d40..d9ae67a82759 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_database_operations.py @@ -72,7 +72,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -155,7 +155,7 @@ def list_usages( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -235,7 +235,7 @@ def list_metric_definitions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 new file mode 100644 index 000000000000..f65ec3e0bee4 --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_graph_resources_operations.py @@ -0,0 +1,427 @@ +# 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 typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union +import warnings + +from azure.core.async_paging import AsyncItemPaged, AsyncList +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import AsyncHttpResponse, HttpRequest +from azure.core.polling import AsyncLROPoller, AsyncNoPolling, AsyncPollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.async_arm_polling import AsyncARMPolling + +from ... import models as _models + +T = TypeVar('T') +ClsType = Optional[Callable[[PipelineResponse[HttpRequest, AsyncHttpResponse], T, Dict[str, Any]], Any]] + +class GraphResourcesOperations: + """GraphResourcesOperations async operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cosmosdb.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer) -> None: + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_graphs( + self, + resource_group_name: str, + account_name: str, + **kwargs: Any + ) -> AsyncIterable["_models.GraphResourcesListResult"]: + """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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GraphResourcesListResult or the result of cls(response) + :rtype: ~azure.core.async_paging.AsyncItemPaged[~azure.mgmt.cosmosdb.models.GraphResourcesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GraphResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_graphs.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + 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) + return None, AsyncList(list_of_elem) + + async def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = await self._client._pipeline.run(request, stream=False, **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 + ) + list_graphs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs'} # type: ignore + + 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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param graph_name: Cosmos DB graph resource name. + :type graph_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GraphResourceGetResults, or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.GraphResourceGetResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GraphResourceGetResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_graph.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **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) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_graph.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}'} # type: ignore + + async def _create_update_graph_initial( + self, + resource_group_name: str, + account_name: str, + graph_name: str, + create_update_graph_parameters: "_models.GraphResourceCreateUpdateParameters", + **kwargs: Any + ) -> Optional["_models.GraphResourceGetResults"]: + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GraphResourceGetResults"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_update_graph_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(create_update_graph_parameters, 'GraphResourceCreateUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GraphResourceGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_update_graph_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}'} # type: ignore + + async def begin_create_update_graph( + self, + resource_group_name: str, + account_name: str, + graph_name: str, + create_update_graph_parameters: "_models.GraphResourceCreateUpdateParameters", + **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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param graph_name: Cosmos DB graph resource name. + :type graph_name: str + :param create_update_graph_parameters: The parameters to provide for the current graph. + :type create_update_graph_parameters: ~azure.mgmt.cosmosdb.models.GraphResourceCreateUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either GraphResourceGetResults or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GraphResourceGetResults"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('GraphResourceGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_update_graph.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}'} # type: ignore + + async def _delete_graph_resource_initial( + self, + resource_group_name: str, + account_name: str, + graph_name: str, + **kwargs: Any + ) -> None: + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + + # Construct URL + url = self._delete_graph_resource_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_graph_resource_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}'} # type: ignore + + 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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param graph_name: Cosmos DB graph resource name. + :type graph_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) + :rtype: ~azure.core.polling.AsyncLROPoller[None] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, AsyncPollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str'), + } + + if polling is True: polling_method = AsyncARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = AsyncNoPolling() + else: polling_method = polling + if cont_token: + return AsyncLROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return AsyncLROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_graph_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}'} # type: ignore diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py index ae81a5d0de38..0b2dbd845006 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_gremlin_resources_operations.py @@ -65,7 +65,7 @@ def list_gremlin_databases( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -143,7 +143,7 @@ async def get_gremlin_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -193,7 +193,7 @@ async def _create_update_gremlin_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -326,7 +326,7 @@ async def _delete_gremlin_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_gremlin_database_initial.metadata['url'] # type: ignore @@ -453,7 +453,7 @@ async def get_gremlin_database_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -503,7 +503,7 @@ async def _update_gremlin_database_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -636,7 +636,7 @@ async def _migrate_gremlin_database_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -759,7 +759,7 @@ async def _migrate_gremlin_database_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -895,7 +895,7 @@ def list_gremlin_graphs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -976,7 +976,7 @@ async def get_gremlin_graph( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1028,7 +1028,7 @@ async def _create_update_gremlin_graph_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1168,7 +1168,7 @@ async def _delete_gremlin_graph_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_gremlin_graph_initial.metadata['url'] # type: ignore @@ -1304,7 +1304,7 @@ async def get_gremlin_graph_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1356,7 +1356,7 @@ async def _update_gremlin_graph_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1496,7 +1496,7 @@ async def _migrate_gremlin_graph_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1626,7 +1626,7 @@ async def _migrate_gremlin_graph_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL 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 47db3e19bf09..8e75deeb3117 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 @@ -65,7 +65,7 @@ def list_mongo_db_databases( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -143,7 +143,7 @@ async def get_mongo_db_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -193,7 +193,7 @@ async def _create_update_mongo_db_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -326,7 +326,7 @@ async def _delete_mongo_db_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_mongo_db_database_initial.metadata['url'] # type: ignore @@ -453,7 +453,7 @@ async def get_mongo_db_database_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -503,7 +503,7 @@ async def _update_mongo_db_database_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -636,7 +636,7 @@ async def _migrate_mongo_db_database_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -759,7 +759,7 @@ async def _migrate_mongo_db_database_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -895,7 +895,7 @@ def list_mongo_db_collections( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -976,7 +976,7 @@ async def get_mongo_db_collection( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1028,7 +1028,7 @@ async def _create_update_mongo_db_collection_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1168,7 +1168,7 @@ async def _delete_mongo_db_collection_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_mongo_db_collection_initial.metadata['url'] # type: ignore @@ -1304,7 +1304,7 @@ async def get_mongo_db_collection_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1356,7 +1356,7 @@ async def _update_mongo_db_collection_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1496,7 +1496,7 @@ async def _migrate_mongo_db_collection_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1626,7 +1626,7 @@ async def _migrate_mongo_db_collection_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py index 6a0b3006502b..5488f88866d4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_notebook_workspaces_operations.py @@ -65,7 +65,7 @@ def list_by_database_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -143,7 +143,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -194,7 +194,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -326,7 +326,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -455,7 +455,7 @@ async def list_connection_info( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -505,7 +505,7 @@ async def _regenerate_auth_token_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -621,7 +621,7 @@ async def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py index e4aadaace2c5..bfeb2f139a3d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_operations.py @@ -57,7 +57,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py index 5def2e0ec326..af7028cef78f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_operations.py @@ -77,7 +77,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py index e4b774017a31..1b0d6bcfcdc6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_partition_key_range_id_region_operations.py @@ -81,7 +81,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py index e9dba82c91b2..2507cadc3b24 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_operations.py @@ -69,7 +69,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py index 001d2a56448c..c7befa09b341 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_source_target_operations.py @@ -77,7 +77,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py index df320847d40c..58c388ca36e4 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_percentile_target_operations.py @@ -73,7 +73,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py index 2b98290e7cff..62954af56d4a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_endpoint_connections_operations.py @@ -65,7 +65,7 @@ def list_by_database_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -142,7 +142,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -192,7 +192,7 @@ async def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -325,7 +325,7 @@ async def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py index 0b31dc67112e..816102320c23 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_private_link_resources_operations.py @@ -63,7 +63,7 @@ def list_by_database_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -140,7 +140,7 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py index e5e5ad7878af..fde3489c5f50 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_database_accounts_operations.py @@ -62,7 +62,7 @@ def list_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -130,7 +130,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -203,7 +203,7 @@ async def get_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py index 23541cb530a7..6a33eadd6b05 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_collections_operations.py @@ -68,7 +68,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py index ab508651d938..7ae4d775bcd2 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_databases_operations.py @@ -66,7 +66,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py index ebde30f4a35c..7d252b39ff8a 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_mongodb_resources_operations.py @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py index a27192ecd511..6a7094a952ef 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_containers_operations.py @@ -74,7 +74,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py index 9b7fcd6d8d48..d38d7ac721c6 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_databases_operations.py @@ -66,7 +66,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py index c22c9b508f1c..437c5c96c68d 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_restorable_sql_resources_operations.py @@ -72,7 +72,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 9ccd210519b6..d046ec679f4a 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 @@ -47,7 +47,7 @@ def list( self, resource_group_name: str, account_name: str, - **kwargs + **kwargs: Any ) -> AsyncIterable["_models.ServiceResourceListResult"]: """Gets the status of service. @@ -65,7 +65,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -78,7 +78,7 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), } url = self._client.format_url(url, **path_format_arguments) @@ -122,15 +122,15 @@ async def _create_initial( resource_group_name: str, account_name: str, service_name: str, - create_update_parameters: "_models.ServiceResource", - **kwargs + create_update_parameters: "_models.ServiceResourceCreateUpdateParameters", + **kwargs: Any ) -> Optional["_models.ServiceResource"]: cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ServiceResource"]] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -138,7 +138,7 @@ async def _create_initial( url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=3), } @@ -154,7 +154,7 @@ async def _create_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(create_update_parameters, 'ServiceResource') + body_content = self._serialize.body(create_update_parameters, 'ServiceResourceCreateUpdateParameters') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = await self._client._pipeline.run(request, stream=False, **kwargs) @@ -179,8 +179,8 @@ async def begin_create( resource_group_name: str, account_name: str, service_name: str, - create_update_parameters: "_models.ServiceResource", - **kwargs + create_update_parameters: "_models.ServiceResourceCreateUpdateParameters", + **kwargs: Any ) -> AsyncLROPoller["_models.ServiceResource"]: """Creates a service. @@ -191,11 +191,11 @@ async def begin_create( :param service_name: Cosmos DB service name. :type service_name: str :param create_update_parameters: The Service resource parameters. - :type create_update_parameters: ~azure.mgmt.cosmosdb.models.ServiceResource + :type create_update_parameters: ~azure.mgmt.cosmosdb.models.ServiceResourceCreateUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either ServiceResource or the result of cls(response) @@ -231,7 +231,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=3), } @@ -255,7 +255,7 @@ async def get( resource_group_name: str, account_name: str, service_name: str, - **kwargs + **kwargs: Any ) -> "_models.ServiceResource": """Gets the status of service. @@ -275,14 +275,14 @@ async def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=3), } @@ -317,21 +317,21 @@ async def _delete_initial( resource_group_name: str, account_name: str, service_name: str, - **kwargs + **kwargs: Any ) -> None: cls = kwargs.pop('cls', None) # type: ClsType[None] error_map = { 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=3), } @@ -363,7 +363,7 @@ async def begin_delete( resource_group_name: str, account_name: str, service_name: str, - **kwargs + **kwargs: Any ) -> AsyncLROPoller[None]: """Deletes service with the given serviceName. @@ -375,8 +375,8 @@ async def begin_delete( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the AsyncARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be AsyncARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.AsyncPollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of AsyncLROPoller that returns either None or the result of cls(response) @@ -408,7 +408,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=3), } 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 619b655cc42b..aa7430cf409e 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 @@ -65,7 +65,7 @@ def list_sql_databases( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -143,7 +143,7 @@ async def get_sql_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -193,7 +193,7 @@ async def _create_update_sql_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -326,7 +326,7 @@ async def _delete_sql_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_sql_database_initial.metadata['url'] # type: ignore @@ -453,7 +453,7 @@ async def get_sql_database_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -503,7 +503,7 @@ async def _update_sql_database_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -636,7 +636,7 @@ async def _migrate_sql_database_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -759,7 +759,7 @@ async def _migrate_sql_database_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -895,7 +895,7 @@ def list_sql_containers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -976,7 +976,7 @@ async def get_sql_container( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1028,7 +1028,7 @@ async def _create_update_sql_container_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1168,7 +1168,7 @@ async def _delete_sql_container_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_sql_container_initial.metadata['url'] # type: ignore @@ -1304,7 +1304,7 @@ async def get_sql_container_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1356,7 +1356,7 @@ async def _update_sql_container_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1496,7 +1496,7 @@ async def _migrate_sql_container_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1626,7 +1626,7 @@ async def _migrate_sql_container_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1771,7 +1771,7 @@ def list_sql_stored_procedures( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1856,7 +1856,7 @@ async def get_sql_stored_procedure( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1910,7 +1910,7 @@ async def _create_update_sql_stored_procedure_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2057,7 +2057,7 @@ async def _delete_sql_stored_procedure_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_sql_stored_procedure_initial.metadata['url'] # type: ignore @@ -2198,7 +2198,7 @@ def list_sql_user_defined_functions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -2283,7 +2283,7 @@ async def get_sql_user_defined_function( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -2337,7 +2337,7 @@ async def _create_update_sql_user_defined_function_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2484,7 +2484,7 @@ async def _delete_sql_user_defined_function_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_sql_user_defined_function_initial.metadata['url'] # type: ignore @@ -2625,7 +2625,7 @@ def list_sql_triggers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -2710,7 +2710,7 @@ async def get_sql_trigger( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -2764,7 +2764,7 @@ async def _create_update_sql_trigger_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2911,7 +2911,7 @@ async def _delete_sql_trigger_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_sql_trigger_initial.metadata['url'] # type: ignore @@ -3049,7 +3049,7 @@ async def get_sql_role_definition( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -3099,7 +3099,7 @@ async def _create_update_sql_role_definition_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -3232,7 +3232,7 @@ async def _delete_sql_role_definition_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -3357,7 +3357,7 @@ def list_sql_role_definitions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -3434,7 +3434,7 @@ async def get_sql_role_assignment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -3484,7 +3484,7 @@ async def _create_update_sql_role_assignment_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -3617,7 +3617,7 @@ async def _delete_sql_role_assignment_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -3742,7 +3742,7 @@ def list_sql_role_assignments( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -3808,7 +3808,7 @@ async def _retrieve_continuous_backup_information_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py index efc8e556fb62..2e1b0d56c979 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/aio/operations/_table_resources_operations.py @@ -65,7 +65,7 @@ def list_tables( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -142,7 +142,7 @@ async def get_table( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -192,7 +192,7 @@ async def _create_update_table_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -324,7 +324,7 @@ async def _delete_table_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_table_initial.metadata['url'] # type: ignore @@ -451,7 +451,7 @@ async def get_table_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -501,7 +501,7 @@ async def _update_table_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -634,7 +634,7 @@ async def _migrate_table_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -757,7 +757,7 @@ async def _migrate_table_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL 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 a80dd0ef7bb1..d64473d6369b 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 @@ -17,6 +17,8 @@ from ._models_py3 import BackupInformation from ._models_py3 import BackupPolicy from ._models_py3 import BackupPolicyMigrationState + from ._models_py3 import BackupResource + from ._models_py3 import BackupResourceProperties from ._models_py3 import Capability from ._models_py3 import CassandraKeyspaceCreateUpdateParameters from ._models_py3 import CassandraKeyspaceGetPropertiesOptions @@ -32,7 +34,18 @@ 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 ClusterKey + from ._models_py3 import ClusterNodeStatus + from ._models_py3 import ClusterNodeStatusNodesItem + from ._models_py3 import ClusterResource + from ._models_py3 import ClusterResourceProperties from ._models_py3 import Column from ._models_py3 import Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties from ._models_py3 import CompositePath @@ -44,8 +57,14 @@ from ._models_py3 import ContinuousModeBackupPolicy from ._models_py3 import CorsPolicy from ._models_py3 import CreateUpdateOptions + from ._models_py3 import DataCenterResource + from ._models_py3 import DataCenterResourceProperties + from ._models_py3 import DataTransferRegionalServiceResource + from ._models_py3 import DataTransferServiceResource + from ._models_py3 import DataTransferServiceResourceProperties from ._models_py3 import DatabaseAccountConnectionString from ._models_py3 import DatabaseAccountCreateUpdateParameters + from ._models_py3 import DatabaseAccountCreateUpdateProperties from ._models_py3 import DatabaseAccountGetResults from ._models_py3 import DatabaseAccountListConnectionStringsResult from ._models_py3 import DatabaseAccountListKeysResult @@ -54,11 +73,22 @@ from ._models_py3 import DatabaseAccountUpdateParameters from ._models_py3 import DatabaseAccountsListResult from ._models_py3 import DatabaseRestoreResource + from ._models_py3 import DefaultRequestDatabaseAccountCreateUpdateProperties + from ._models_py3 import DiagnosticLogSettings from ._models_py3 import ErrorResponse from ._models_py3 import ExcludedPath from ._models_py3 import ExtendedResourceProperties from ._models_py3 import FailoverPolicies from ._models_py3 import FailoverPolicy + from ._models_py3 import GraphAPIComputeRegionalServiceResource + from ._models_py3 import GraphAPIComputeServiceResource + 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 @@ -75,7 +105,13 @@ from ._models_py3 import Indexes from ._models_py3 import IndexingPolicy from ._models_py3 import IpAddressOrRange + from ._models_py3 import ListBackups + from ._models_py3 import ListClusters + from ._models_py3 import ListDataCenters from ._models_py3 import Location + from ._models_py3 import LocationGetResult + from ._models_py3 import LocationListResult + from ._models_py3 import LocationProperties from ._models_py3 import ManagedServiceIdentity from ._models_py3 import Metric from ._models_py3 import MetricAvailability @@ -125,6 +161,8 @@ from ._models_py3 import PrivateLinkServiceConnectionStateProperty from ._models_py3 import ProxyResource from ._models_py3 import RegionForOnlineOffline + from ._models_py3 import RegionalServiceResource + from ._models_py3 import RepairPostBody from ._models_py3 import Resource from ._models_py3 import RestorableDatabaseAccountGetResult from ._models_py3 import RestorableDatabaseAccountsListResult @@ -146,6 +184,11 @@ from ._models_py3 import RestorableSqlDatabasesListResult from ._models_py3 import RestorableSqlResourcesListResult from ._models_py3 import RestoreParameters + from ._models_py3 import SeedNode + from ._models_py3 import ServiceResource + from ._models_py3 import ServiceResourceCreateUpdateParameters + from ._models_py3 import ServiceResourceListResult + from ._models_py3 import ServiceResourceProperties from ._models_py3 import SpatialSpec from ._models_py3 import SqlContainerCreateUpdateParameters from ._models_py3 import SqlContainerGetPropertiesOptions @@ -159,6 +202,9 @@ from ._models_py3 import SqlDatabaseGetResults from ._models_py3 import SqlDatabaseListResult from ._models_py3 import SqlDatabaseResource + from ._models_py3 import SqlDedicatedGatewayRegionalServiceResource + from ._models_py3 import SqlDedicatedGatewayServiceResource + from ._models_py3 import SqlDedicatedGatewayServiceResourceProperties from ._models_py3 import SqlRoleAssignmentCreateUpdateParameters from ._models_py3 import SqlRoleAssignmentGetResults from ._models_py3 import SqlRoleAssignmentListResult @@ -208,6 +254,8 @@ from ._models import BackupInformation # type: ignore from ._models import BackupPolicy # type: ignore from ._models import BackupPolicyMigrationState # type: ignore + from ._models import BackupResource # type: ignore + from ._models import BackupResourceProperties # type: ignore from ._models import Capability # type: ignore from ._models import CassandraKeyspaceCreateUpdateParameters # type: ignore from ._models import CassandraKeyspaceGetPropertiesOptions # type: ignore @@ -223,7 +271,18 @@ from ._models import CassandraTableGetResults # type: ignore from ._models import CassandraTableListResult # type: ignore from ._models import CassandraTableResource # type: ignore + from ._models import CassandraViewCreateUpdateParameters # type: ignore + from ._models import CassandraViewGetPropertiesOptions # type: ignore + from ._models import CassandraViewGetPropertiesResource # type: ignore + from ._models import CassandraViewGetResults # type: ignore + from ._models import CassandraViewListResult # type: ignore + from ._models import CassandraViewResource # type: ignore + from ._models import Certificate # type: ignore from ._models import ClusterKey # type: ignore + from ._models import ClusterNodeStatus # type: ignore + from ._models import ClusterNodeStatusNodesItem # type: ignore + from ._models import ClusterResource # type: ignore + from ._models import ClusterResourceProperties # type: ignore from ._models import Column # type: ignore from ._models import Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties # type: ignore from ._models import CompositePath # type: ignore @@ -235,8 +294,14 @@ from ._models import ContinuousModeBackupPolicy # type: ignore from ._models import CorsPolicy # type: ignore from ._models import CreateUpdateOptions # type: ignore + from ._models import DataCenterResource # type: ignore + from ._models import DataCenterResourceProperties # type: ignore + from ._models import DataTransferRegionalServiceResource # type: ignore + from ._models import DataTransferServiceResource # type: ignore + from ._models import DataTransferServiceResourceProperties # type: ignore from ._models import DatabaseAccountConnectionString # type: ignore from ._models import DatabaseAccountCreateUpdateParameters # type: ignore + from ._models import DatabaseAccountCreateUpdateProperties # type: ignore from ._models import DatabaseAccountGetResults # type: ignore from ._models import DatabaseAccountListConnectionStringsResult # type: ignore from ._models import DatabaseAccountListKeysResult # type: ignore @@ -245,11 +310,22 @@ from ._models import DatabaseAccountUpdateParameters # type: ignore from ._models import DatabaseAccountsListResult # type: ignore from ._models import DatabaseRestoreResource # type: ignore + from ._models import DefaultRequestDatabaseAccountCreateUpdateProperties # type: ignore + from ._models import DiagnosticLogSettings # type: ignore from ._models import ErrorResponse # type: ignore from ._models import ExcludedPath # type: ignore from ._models import ExtendedResourceProperties # type: ignore from ._models import FailoverPolicies # type: ignore from ._models import FailoverPolicy # type: ignore + from ._models import GraphAPIComputeRegionalServiceResource # type: ignore + from ._models import GraphAPIComputeServiceResource # type: ignore + from ._models import GraphAPIComputeServiceResourceProperties # type: ignore + from ._models import GraphResource # type: ignore + from ._models import GraphResourceCreateUpdateParameters # type: ignore + from ._models import GraphResourceGetPropertiesOptions # type: ignore + from ._models import GraphResourceGetPropertiesResource # type: ignore + from ._models import GraphResourceGetResults # type: ignore + from ._models import GraphResourcesListResult # type: ignore from ._models import GremlinDatabaseCreateUpdateParameters # type: ignore from ._models import GremlinDatabaseGetPropertiesOptions # type: ignore from ._models import GremlinDatabaseGetPropertiesResource # type: ignore @@ -266,7 +342,13 @@ from ._models import Indexes # type: ignore from ._models import IndexingPolicy # type: ignore from ._models import IpAddressOrRange # type: ignore + from ._models import ListBackups # type: ignore + from ._models import ListClusters # type: ignore + from ._models import ListDataCenters # type: ignore from ._models import Location # type: ignore + from ._models import LocationGetResult # type: ignore + from ._models import LocationListResult # type: ignore + from ._models import LocationProperties # type: ignore from ._models import ManagedServiceIdentity # type: ignore from ._models import Metric # type: ignore from ._models import MetricAvailability # type: ignore @@ -316,6 +398,8 @@ from ._models import PrivateLinkServiceConnectionStateProperty # type: ignore from ._models import ProxyResource # type: ignore from ._models import RegionForOnlineOffline # type: ignore + from ._models import RegionalServiceResource # type: ignore + from ._models import RepairPostBody # type: ignore from ._models import Resource # type: ignore from ._models import RestorableDatabaseAccountGetResult # type: ignore from ._models import RestorableDatabaseAccountsListResult # type: ignore @@ -337,6 +421,11 @@ from ._models import RestorableSqlDatabasesListResult # type: ignore from ._models import RestorableSqlResourcesListResult # type: ignore from ._models import RestoreParameters # type: ignore + from ._models import SeedNode # type: ignore + from ._models import ServiceResource # type: ignore + from ._models import ServiceResourceCreateUpdateParameters # type: ignore + from ._models import ServiceResourceListResult # type: ignore + from ._models import ServiceResourceProperties # type: ignore from ._models import SpatialSpec # type: ignore from ._models import SqlContainerCreateUpdateParameters # type: ignore from ._models import SqlContainerGetPropertiesOptions # type: ignore @@ -350,6 +439,9 @@ from ._models import SqlDatabaseGetResults # type: ignore from ._models import SqlDatabaseListResult # type: ignore from ._models import SqlDatabaseResource # type: ignore + from ._models import SqlDedicatedGatewayRegionalServiceResource # type: ignore + from ._models import SqlDedicatedGatewayServiceResource # type: ignore + from ._models import SqlDedicatedGatewayServiceResourceProperties # type: ignore from ._models import SqlRoleAssignmentCreateUpdateParameters # type: ignore from ._models import SqlRoleAssignmentGetResults # type: ignore from ._models import SqlRoleAssignmentListResult # type: ignore @@ -392,8 +484,10 @@ from ._cosmos_db_management_client_enums import ( AnalyticalStorageSchemaType, ApiType, + AuthenticationMethod, BackupPolicyMigrationStatus, BackupPolicyType, + BackupStorageRedundancy, CompositePathSortOrder, ConflictResolutionMode, ConnectorOffer, @@ -402,10 +496,14 @@ DataType, DatabaseAccountKind, DefaultConsistencyLevel, + EnableFullTextQuery, IndexKind, IndexingMode, KeyKind, + ManagedCassandraProvisioningState, NetworkAclBypass, + NodeState, + NodeStatus, NotebookWorkspaceName, OperationType, PartitionKind, @@ -415,6 +513,9 @@ RestoreMode, RoleDefinitionType, ServerVersion, + ServiceSize, + ServiceStatus, + ServiceType, SpatialType, TriggerOperation, TriggerType, @@ -432,6 +533,8 @@ 'BackupInformation', 'BackupPolicy', 'BackupPolicyMigrationState', + 'BackupResource', + 'BackupResourceProperties', 'Capability', 'CassandraKeyspaceCreateUpdateParameters', 'CassandraKeyspaceGetPropertiesOptions', @@ -447,7 +550,18 @@ 'CassandraTableGetResults', 'CassandraTableListResult', 'CassandraTableResource', + 'CassandraViewCreateUpdateParameters', + 'CassandraViewGetPropertiesOptions', + 'CassandraViewGetPropertiesResource', + 'CassandraViewGetResults', + 'CassandraViewListResult', + 'CassandraViewResource', + 'Certificate', 'ClusterKey', + 'ClusterNodeStatus', + 'ClusterNodeStatusNodesItem', + 'ClusterResource', + 'ClusterResourceProperties', 'Column', 'Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties', 'CompositePath', @@ -459,8 +573,14 @@ 'ContinuousModeBackupPolicy', 'CorsPolicy', 'CreateUpdateOptions', + 'DataCenterResource', + 'DataCenterResourceProperties', + 'DataTransferRegionalServiceResource', + 'DataTransferServiceResource', + 'DataTransferServiceResourceProperties', 'DatabaseAccountConnectionString', 'DatabaseAccountCreateUpdateParameters', + 'DatabaseAccountCreateUpdateProperties', 'DatabaseAccountGetResults', 'DatabaseAccountListConnectionStringsResult', 'DatabaseAccountListKeysResult', @@ -469,11 +589,22 @@ 'DatabaseAccountUpdateParameters', 'DatabaseAccountsListResult', 'DatabaseRestoreResource', + 'DefaultRequestDatabaseAccountCreateUpdateProperties', + 'DiagnosticLogSettings', 'ErrorResponse', 'ExcludedPath', 'ExtendedResourceProperties', 'FailoverPolicies', 'FailoverPolicy', + 'GraphAPIComputeRegionalServiceResource', + 'GraphAPIComputeServiceResource', + 'GraphAPIComputeServiceResourceProperties', + 'GraphResource', + 'GraphResourceCreateUpdateParameters', + 'GraphResourceGetPropertiesOptions', + 'GraphResourceGetPropertiesResource', + 'GraphResourceGetResults', + 'GraphResourcesListResult', 'GremlinDatabaseCreateUpdateParameters', 'GremlinDatabaseGetPropertiesOptions', 'GremlinDatabaseGetPropertiesResource', @@ -490,7 +621,13 @@ 'Indexes', 'IndexingPolicy', 'IpAddressOrRange', + 'ListBackups', + 'ListClusters', + 'ListDataCenters', 'Location', + 'LocationGetResult', + 'LocationListResult', + 'LocationProperties', 'ManagedServiceIdentity', 'Metric', 'MetricAvailability', @@ -540,6 +677,8 @@ 'PrivateLinkServiceConnectionStateProperty', 'ProxyResource', 'RegionForOnlineOffline', + 'RegionalServiceResource', + 'RepairPostBody', 'Resource', 'RestorableDatabaseAccountGetResult', 'RestorableDatabaseAccountsListResult', @@ -561,6 +700,11 @@ 'RestorableSqlDatabasesListResult', 'RestorableSqlResourcesListResult', 'RestoreParameters', + 'SeedNode', + 'ServiceResource', + 'ServiceResourceCreateUpdateParameters', + 'ServiceResourceListResult', + 'ServiceResourceProperties', 'SpatialSpec', 'SqlContainerCreateUpdateParameters', 'SqlContainerGetPropertiesOptions', @@ -574,6 +718,9 @@ 'SqlDatabaseGetResults', 'SqlDatabaseListResult', 'SqlDatabaseResource', + 'SqlDedicatedGatewayRegionalServiceResource', + 'SqlDedicatedGatewayServiceResource', + 'SqlDedicatedGatewayServiceResourceProperties', 'SqlRoleAssignmentCreateUpdateParameters', 'SqlRoleAssignmentGetResults', 'SqlRoleAssignmentListResult', @@ -614,8 +761,10 @@ 'VirtualNetworkRule', 'AnalyticalStorageSchemaType', 'ApiType', + 'AuthenticationMethod', 'BackupPolicyMigrationStatus', 'BackupPolicyType', + 'BackupStorageRedundancy', 'CompositePathSortOrder', 'ConflictResolutionMode', 'ConnectorOffer', @@ -624,10 +773,14 @@ 'DataType', 'DatabaseAccountKind', 'DefaultConsistencyLevel', + 'EnableFullTextQuery', 'IndexKind', 'IndexingMode', 'KeyKind', + 'ManagedCassandraProvisioningState', 'NetworkAclBypass', + 'NodeState', + 'NodeStatus', 'NotebookWorkspaceName', 'OperationType', 'PartitionKind', @@ -637,6 +790,9 @@ 'RestoreMode', 'RoleDefinitionType', 'ServerVersion', + 'ServiceSize', + 'ServiceStatus', + 'ServiceType', 'SpatialType', 'TriggerOperation', 'TriggerType', 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 2762ab2e169a..ec0159dc473f 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 @@ -44,6 +44,15 @@ class ApiType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): SQL = "Sql" GREMLIN_V2 = "GremlinV2" +class AuthenticationMethod(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Which authentication method Cassandra should use to authenticate clients. 'None' turns off + authentication, so should not be used except in emergencies. 'Cassandra' is the default + password based authentication. The default is 'Cassandra'. + """ + + NONE = "None" + CASSANDRA = "Cassandra" + class BackupPolicyMigrationStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Describes the status of migration between backup policy types. """ @@ -60,6 +69,14 @@ class BackupPolicyType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PERIODIC = "Periodic" CONTINUOUS = "Continuous" +class BackupStorageRedundancy(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Enum to indicate type of backup storage redundancy. + """ + + GEO = "Geo" + LOCAL = "Local" + ZONE = "Zone" + class CompositePathSortOrder(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Sort order for composite paths. """ @@ -125,6 +142,14 @@ class DefaultConsistencyLevel(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum STRONG = "Strong" CONSISTENT_PREFIX = "ConsistentPrefix" +class EnableFullTextQuery(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Describe the level of detail with which queries are to be logged. + """ + + NONE = "None" + TRUE = "True" + FALSE = "False" + class IndexingMode(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates the indexing mode. """ @@ -150,6 +175,17 @@ class KeyKind(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): PRIMARY_READONLY = "primaryReadonly" SECONDARY_READONLY = "secondaryReadonly" +class ManagedCassandraProvisioningState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The status of the resource at the time the operation was called. + """ + + CREATING = "Creating" + UPDATING = "Updating" + DELETING = "Deleting" + SUCCEEDED = "Succeeded" + FAILED = "Failed" + CANCELED = "Canceled" + class NetworkAclBypass(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates what services are allowed to bypass firewall checks. """ @@ -157,6 +193,23 @@ class NetworkAclBypass(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): NONE = "None" AZURE_SERVICES = "AzureServices" +class NodeState(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """The state of the node in relation to the cluster. + """ + + NORMAL = "Normal" + LEAVING = "Leaving" + JOINING = "Joining" + MOVING = "Moving" + STOPPED = "Stopped" + +class NodeStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Indicates whether the node is functioning or not. + """ + + UP = "Up" + DOWN = "Down" + class NotebookWorkspaceName(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): DEFAULT = "default" @@ -229,6 +282,33 @@ class ServerVersion(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): THREE6 = "3.6" FOUR0 = "4.0" +class ServiceSize(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Instance type for the service. + """ + + COSMOS_D4_S = "Cosmos.D4s" + COSMOS_D8_S = "Cosmos.D8s" + COSMOS_D16_S = "Cosmos.D16s" + +class ServiceStatus(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """Describes the status of a service. + """ + + CREATING = "Creating" + RUNNING = "Running" + UPDATING = "Updating" + DELETING = "Deleting" + ERROR = "Error" + STOPPED = "Stopped" + +class ServiceType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): + """ServiceType for the service. + """ + + SQL_DEDICATED_GATEWAY = "SqlDedicatedGateway" + DATA_TRANSFER = "DataTransfer" + GRAPH_API_COMPUTE = "GraphAPICompute" + class SpatialType(with_metaclass(_CaseInsensitiveEnumMeta, str, Enum)): """Indicates the spatial type of index. """ diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models.py index 59ff2806aa5e..7adbdec9cbd5 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_models.py @@ -105,6 +105,8 @@ class ARMResourceProperties(msrest.serialization.Model): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity """ _validation = { @@ -119,6 +121,7 @@ class ARMResourceProperties(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, } def __init__( @@ -131,6 +134,7 @@ def __init__( self.type = None self.location = kwargs.get('location', None) self.tags = kwargs.get('tags', None) + self.identity = kwargs.get('identity', None) class AutoscaleSettings(msrest.serialization.Model): @@ -301,6 +305,61 @@ def __init__( self.start_time = kwargs.get('start_time', None) +class BackupResource(ARMProxyResource): + """A restorable backup of a 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 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 + :param properties: + :type properties: ~azure.mgmt.cosmosdb.models.BackupResourceProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'BackupResourceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class BackupResourceProperties(msrest.serialization.Model): + """BackupResourceProperties. + + :param timestamp: The time this backup was taken, formatted like 2021-01-21T17:35:21. + :type timestamp: ~datetime.datetime + """ + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + **kwargs + ): + super(BackupResourceProperties, self).__init__(**kwargs) + self.timestamp = kwargs.get('timestamp', None) + + class Capability(msrest.serialization.Model): """Cosmos DB capability object. @@ -343,6 +402,8 @@ class CassandraKeyspaceCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a Cassandra keyspace. :type resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -363,6 +424,7 @@ 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'}, } @@ -546,6 +608,8 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesResource :param options: @@ -564,6 +628,7 @@ 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'}, } @@ -670,6 +735,8 @@ class CassandraTableCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a Cassandra table. :type resource: ~azure.mgmt.cosmosdb.models.CassandraTableResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -690,6 +757,7 @@ 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'}, } @@ -837,6 +905,8 @@ class CassandraTableGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesResource :param options: @@ -855,6 +925,7 @@ 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'}, } @@ -893,436 +964,1622 @@ def __init__( self.value = None -class ClusterKey(msrest.serialization.Model): - """Cosmos DB Cassandra table cluster key. +class CassandraViewCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB Cassandra view. - :param name: Name of the Cosmos DB Cassandra table cluster key. - :type name: str - :param order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and - "Desc". - :type order_by: str + 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 Azure. + + :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 + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param resource: Required. The standard JSON format of a Cassandra view. + :type resource: ~azure.mgmt.cosmosdb.models.CassandraViewResource + :param options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :type 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'}, - 'order_by': {'key': 'orderBy', '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'}, } def __init__( self, **kwargs ): - super(ClusterKey, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.order_by = kwargs.get('order_by', None) + super(CassandraViewCreateUpdateParameters, self).__init__(**kwargs) + self.resource = kwargs['resource'] + self.options = kwargs.get('options', None) -class Column(msrest.serialization.Model): - """Cosmos DB Cassandra table column. +class CassandraViewGetPropertiesOptions(OptionsResource): + """CassandraViewGetPropertiesOptions. - :param name: Name of the Cosmos DB Cassandra table column. - :type name: str - :param type: Type of the Cosmos DB Cassandra table column. - :type type: str + :param throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :type throughput: int + :param autoscale_settings: Specifies the Autoscale settings. + :type autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'throughput': {'key': 'throughput', 'type': 'int'}, + 'autoscale_settings': {'key': 'autoscaleSettings', 'type': 'AutoscaleSettings'}, } def __init__( self, **kwargs ): - super(Column, self).__init__(**kwargs) - self.name = kwargs.get('name', None) - self.type = kwargs.get('type', None) + super(CassandraViewGetPropertiesOptions, self).__init__(**kwargs) -class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. +class CassandraViewResource(msrest.serialization.Model): + """Cosmos DB Cassandra view 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 Azure. - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str + :param id: Required. Name of the Cosmos DB Cassandra view. + :type id: str + :param view_definition: View Definition of the Cosmos DB Cassandra view. + :type view_definition: str """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'view_definition': {'key': 'viewDefinition', 'type': 'str'}, } def __init__( self, **kwargs ): - super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None + super(CassandraViewResource, self).__init__(**kwargs) + self.id = kwargs['id'] + self.view_definition = kwargs.get('view_definition', None) -class CompositePath(msrest.serialization.Model): - """CompositePath. +class CassandraViewGetPropertiesResource(ExtendedResourceProperties, CassandraViewResource): + """CassandraViewGetPropertiesResource. - :param path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :type path: str - :param order: Sort order for composite paths. Possible values include: "ascending", - "descending". - :type order: str or ~azure.mgmt.cosmosdb.models.CompositePathSortOrder + 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 Azure. + + :param id: Required. Name of the Cosmos DB Cassandra view. + :type id: str + :param view_definition: View Definition of the Cosmos DB Cassandra view. + :type view_definition: str + :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 """ + _validation = { + 'id': {'required': True}, + 'rid': {'readonly': True}, + 'ts': {'readonly': True}, + 'etag': {'readonly': True}, + } + _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'view_definition': {'key': 'viewDefinition', 'type': 'str'}, + 'rid': {'key': '_rid', 'type': 'str'}, + 'ts': {'key': '_ts', 'type': 'float'}, + 'etag': {'key': '_etag', 'type': 'str'}, } def __init__( self, **kwargs ): - super(CompositePath, self).__init__(**kwargs) - self.path = kwargs.get('path', None) - self.order = kwargs.get('order', None) + super(CassandraViewGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs['id'] + self.view_definition = kwargs.get('view_definition', None) + self.rid = None + self.ts = None + self.etag = None -class ConflictResolutionPolicy(msrest.serialization.Model): - """The conflict resolution policy for the container. +class CassandraViewGetResults(ARMResourceProperties): + """An Azure Cosmos DB Cassandra view. - :param mode: Indicates the conflict resolution mode. Possible values include: "LastWriterWins", - "Custom". Default value: "LastWriterWins". - :type mode: str or ~azure.mgmt.cosmosdb.models.ConflictResolutionMode - :param conflict_resolution_path: The conflict resolution path in the case of LastWriterWins - mode. - :type conflict_resolution_path: str - :param conflict_resolution_procedure: The procedure to resolve conflicts in the case of custom - mode. - :type conflict_resolution_procedure: str + 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 + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param resource: + :type resource: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesResource + :param options: + :type options: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesOptions """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'conflict_resolution_path': {'key': 'conflictResolutionPath', 'type': 'str'}, - 'conflict_resolution_procedure': {'key': 'conflictResolutionProcedure', 'type': 'str'}, + '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'}, } def __init__( self, **kwargs ): - super(ConflictResolutionPolicy, self).__init__(**kwargs) - self.mode = kwargs.get('mode', "LastWriterWins") - self.conflict_resolution_path = kwargs.get('conflict_resolution_path', None) - self.conflict_resolution_procedure = kwargs.get('conflict_resolution_procedure', None) + super(CassandraViewGetResults, self).__init__(**kwargs) + self.resource = kwargs.get('resource', None) + self.options = kwargs.get('options', None) -class ConsistencyPolicy(msrest.serialization.Model): - """The consistency policy for the Cosmos DB database account. +class CassandraViewListResult(msrest.serialization.Model): + """The List operation response, that contains the Cassandra views and their properties. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param default_consistency_level: Required. The default consistency level and configuration - settings of the Cosmos DB account. Possible values include: "Eventual", "Session", - "BoundedStaleness", "Strong", "ConsistentPrefix". - :type default_consistency_level: str or ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel - :param max_staleness_prefix: When used with the Bounded Staleness consistency level, this value - represents the number of stale requests tolerated. Accepted range for this value is 1 – - 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. - :type max_staleness_prefix: long - :param max_interval_in_seconds: When used with the Bounded Staleness consistency level, this - value represents the time amount of staleness (in seconds) tolerated. Accepted range for this - value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. - :type max_interval_in_seconds: int + :ivar value: List of Cassandra views and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] """ _validation = { - 'default_consistency_level': {'required': True}, - 'max_staleness_prefix': {'maximum': 2147483647, 'minimum': 1}, - 'max_interval_in_seconds': {'maximum': 86400, 'minimum': 5}, + 'value': {'readonly': True}, } _attribute_map = { - 'default_consistency_level': {'key': 'defaultConsistencyLevel', 'type': 'str'}, - 'max_staleness_prefix': {'key': 'maxStalenessPrefix', 'type': 'long'}, - 'max_interval_in_seconds': {'key': 'maxIntervalInSeconds', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[CassandraViewGetResults]'}, } def __init__( self, **kwargs ): - super(ConsistencyPolicy, self).__init__(**kwargs) - self.default_consistency_level = kwargs['default_consistency_level'] - self.max_staleness_prefix = kwargs.get('max_staleness_prefix', None) - self.max_interval_in_seconds = kwargs.get('max_interval_in_seconds', None) - + super(CassandraViewListResult, self).__init__(**kwargs) + self.value = None -class ContainerPartitionKey(msrest.serialization.Model): - """The configuration of the partition key to be used for partitioning data into multiple partitions. - Variables are only populated by the server, and will be ignored when sending a request. +class Certificate(msrest.serialization.Model): + """Certificate. - :param paths: List of paths using which data within the container can be partitioned. - :type paths: list[str] - :param kind: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple - partition keys (upto three maximum) are supported for container create. Possible values - include: "Hash", "Range", "MultiHash". Default value: "Hash". - :type kind: str or ~azure.mgmt.cosmosdb.models.PartitionKind - :param version: Indicates the version of the partition key definition. - :type version: int - :ivar system_key: Indicates if the container is using a system generated partition key. - :vartype system_key: bool + :param pem: PEM formatted public key. + :type pem: str """ - _validation = { - 'version': {'maximum': 2, 'minimum': 1}, - 'system_key': {'readonly': True}, + _attribute_map = { + 'pem': {'key': 'pem', 'type': 'str'}, } + def __init__( + self, + **kwargs + ): + super(Certificate, self).__init__(**kwargs) + self.pem = kwargs.get('pem', None) + + +class ClusterKey(msrest.serialization.Model): + """Cosmos DB Cassandra table cluster key. + + :param name: Name of the Cosmos DB Cassandra table cluster key. + :type name: str + :param order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and + "Desc". + :type order_by: str + """ + _attribute_map = { - 'paths': {'key': 'paths', 'type': '[str]'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - 'system_key': {'key': 'systemKey', 'type': 'bool'}, + 'name': {'key': 'name', 'type': 'str'}, + 'order_by': {'key': 'orderBy', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ContainerPartitionKey, self).__init__(**kwargs) - self.paths = kwargs.get('paths', None) - self.kind = kwargs.get('kind', "Hash") - self.version = kwargs.get('version', None) - self.system_key = None + super(ClusterKey, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.order_by = kwargs.get('order_by', None) -class ContinuousBackupInformation(msrest.serialization.Model): - """Information about the status of continuous backups. +class ClusterNodeStatus(msrest.serialization.Model): + """The status of all nodes in the cluster (as returned by 'nodetool status'). - :param latest_restorable_timestamp: The latest restorable timestamp for a resource. - :type latest_restorable_timestamp: str + :param nodes: Information about nodes in the cluster (corresponds to what is returned from + nodetool info). + :type nodes: list[~azure.mgmt.cosmosdb.models.ClusterNodeStatusNodesItem] """ _attribute_map = { - 'latest_restorable_timestamp': {'key': 'latestRestorableTimestamp', 'type': 'str'}, + 'nodes': {'key': 'nodes', 'type': '[ClusterNodeStatusNodesItem]'}, } def __init__( self, **kwargs ): - super(ContinuousBackupInformation, self).__init__(**kwargs) - self.latest_restorable_timestamp = kwargs.get('latest_restorable_timestamp', None) + super(ClusterNodeStatus, self).__init__(**kwargs) + self.nodes = kwargs.get('nodes', None) -class ContinuousBackupRestoreLocation(msrest.serialization.Model): - """Properties of the regional restorable account. +class ClusterNodeStatusNodesItem(msrest.serialization.Model): + """ClusterNodeStatusNodesItem. - :param location: The name of the continuous backup restore location. - :type location: str + :param datacenter: The Cassandra data center this node resides in. + :type datacenter: str + :param status: Indicates whether the node is functioning or not. Possible values include: "Up", + "Down". + :type status: str or ~azure.mgmt.cosmosdb.models.NodeStatus + :param state: The state of the node in relation to the cluster. Possible values include: + "Normal", "Leaving", "Joining", "Moving", "Stopped". + :type state: str or ~azure.mgmt.cosmosdb.models.NodeState + :param address: The node's URL. + :type address: str + :param load: The amount of file system data in the data directory (e.g., 47.66 KB), excluding + all content in the snapshots subdirectories. Because all SSTable data files are included, any + data that is not cleaned up (such as TTL-expired cell or tombstoned data) is counted. + :type load: str + :param tokens: List of tokens. + :type tokens: list[str] + :param owns: The percentage of the data owned by the node per datacenter times the replication + factor (e.g., 33.3, or null if the data is not available). For example, a node can own 33% of + the ring, but shows 100% if the replication factor is 3. For non-system keyspaces, the endpoint + percentage ownership information is shown. + :type owns: float + :param host_id: The network ID of the node. + :type host_id: str + :param rack: The rack this node is part of. + :type rack: str """ _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, + 'datacenter': {'key': 'datacenter', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'load': {'key': 'load', 'type': 'str'}, + 'tokens': {'key': 'tokens', 'type': '[str]'}, + 'owns': {'key': 'owns', 'type': 'float'}, + 'host_id': {'key': 'hostId', 'type': 'str'}, + 'rack': {'key': 'rack', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ContinuousBackupRestoreLocation, self).__init__(**kwargs) - self.location = kwargs.get('location', None) + super(ClusterNodeStatusNodesItem, self).__init__(**kwargs) + self.datacenter = kwargs.get('datacenter', None) + self.status = kwargs.get('status', None) + self.state = kwargs.get('state', None) + self.address = kwargs.get('address', None) + self.load = kwargs.get('load', None) + self.tokens = kwargs.get('tokens', None) + self.owns = kwargs.get('owns', None) + self.host_id = kwargs.get('host_id', None) + self.rack = kwargs.get('rack', None) -class ContinuousModeBackupPolicy(BackupPolicy): - """The object representing continuous mode backup policy. +class ClusterResource(ARMResourceProperties): + """Representation of a managed Cassandra cluster. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param type: Required. Describes the mode of backups.Constant filled by server. Possible - values include: "Periodic", "Continuous". - :type type: str or ~azure.mgmt.cosmosdb.models.BackupPolicyType - :param migration_state: The object representing the state of the migration between the backup - policies. - :type migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState + :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 + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param properties: Properties of a managed Cassandra cluster. + :type properties: ~azure.mgmt.cosmosdb.models.ClusterResourceProperties """ _validation = { - 'type': {'required': True}, + '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'}, - 'migration_state': {'key': 'migrationState', 'type': 'BackupPolicyMigrationState'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'properties': {'key': 'properties', 'type': 'ClusterResourceProperties'}, } def __init__( self, **kwargs ): - super(ContinuousModeBackupPolicy, self).__init__(**kwargs) - self.type = 'Continuous' # type: str - + super(ClusterResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) -class CorsPolicy(msrest.serialization.Model): - """The CORS policy for the Cosmos DB database account. - All required parameters must be populated in order to send to Azure. +class ClusterResourceProperties(msrest.serialization.Model): + """Properties of a managed Cassandra cluster. - :param allowed_origins: Required. The origin domains that are permitted to make a request - against the service via CORS. - :type allowed_origins: str - :param allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a - CORS request. - :type allowed_methods: str - :param allowed_headers: The request headers that the origin domain may specify on the CORS - request. - :type allowed_headers: str - :param 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. - :type exposed_headers: str - :param max_age_in_seconds: The maximum amount time that a browser should cache the preflight - OPTIONS request. - :type max_age_in_seconds: long - """ + Variables are only populated by the server, and will be ignored when sending a request. - _validation = { - 'allowed_origins': {'required': True}, - 'max_age_in_seconds': {'maximum': 2147483647, 'minimum': 1}, + :param provisioning_state: The status of the resource at the time the operation was called. + Possible values include: "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :type provisioning_state: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState + :param restore_from_backup_id: To create an empty cluster, omit this field or set it to null. + To restore a backup into a new cluster, set this field to the resource id of the backup. + :type restore_from_backup_id: str + :param delegated_management_subnet_id: Resource id of a subnet that this cluster's management + service should have its network interface attached to. The subnet must be routable to all + subnets that will be delegated to data centers. The resource id must be of the form + '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. + :type delegated_management_subnet_id: str + :param cassandra_version: Which version of Cassandra should this cluster converge to running + (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. + :type cassandra_version: str + :param cluster_name_override: If you need to set the clusterName property in cassandra.yaml to + something besides the resource name of the cluster, set the value to use on this property. + :type cluster_name_override: str + :param authentication_method: Which authentication method Cassandra should use to authenticate + clients. 'None' turns off authentication, so should not be used except in emergencies. + 'Cassandra' is the default password based authentication. The default is 'Cassandra'. Possible + values include: "None", "Cassandra". + :type authentication_method: str or ~azure.mgmt.cosmosdb.models.AuthenticationMethod + :param initial_cassandra_admin_password: Initial password for clients connecting as admin to + the cluster. Should be changed after cluster creation. Returns null on GET. This field only + applies when the authenticationMethod field is 'Cassandra'. + :type initial_cassandra_admin_password: str + :param hours_between_backups: Number of hours to wait between taking a backup of the cluster. + To disable backups, set this property to 0. + :type hours_between_backups: int + :param prometheus_endpoint: Hostname or IP address where the Prometheus endpoint containing + data about the managed Cassandra nodes can be reached. + :type prometheus_endpoint: ~azure.mgmt.cosmosdb.models.SeedNode + :param repair_enabled: Should automatic repairs run on this cluster? If omitted, this is true, + and should stay true unless you are running a hybrid cluster where you are already doing your + own repairs. + :type repair_enabled: bool + :param 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 + bearing a TLS client certificate that can be validated from one or more of the public + certificates in this property. + :type client_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] + :param external_gossip_certificates: List of TLS certificates used to authorize gossip from + unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be + verifiable using one of the certificates provided in this property. + :type external_gossip_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] + :ivar gossip_certificates: List of TLS certificates that unmanaged nodes must trust for gossip + with managed nodes. All managed nodes will present TLS client certificates that are verifiable + using one of the certificates provided in this property. + :vartype gossip_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] + :param 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. + :type external_seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] + :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] + """ + + _validation = { + 'gossip_certificates': {'readonly': True}, + 'seed_nodes': {'readonly': True}, } _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': 'long'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'restore_from_backup_id': {'key': 'restoreFromBackupId', 'type': 'str'}, + 'delegated_management_subnet_id': {'key': 'delegatedManagementSubnetId', 'type': 'str'}, + 'cassandra_version': {'key': 'cassandraVersion', 'type': 'str'}, + 'cluster_name_override': {'key': 'clusterNameOverride', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'initial_cassandra_admin_password': {'key': 'initialCassandraAdminPassword', 'type': 'str'}, + 'hours_between_backups': {'key': 'hoursBetweenBackups', 'type': 'int'}, + 'prometheus_endpoint': {'key': 'prometheusEndpoint', 'type': 'SeedNode'}, + 'repair_enabled': {'key': 'repairEnabled', 'type': 'bool'}, + '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]'}, } def __init__( self, **kwargs ): - super(CorsPolicy, self).__init__(**kwargs) - self.allowed_origins = kwargs['allowed_origins'] - self.allowed_methods = kwargs.get('allowed_methods', None) - self.allowed_headers = kwargs.get('allowed_headers', None) - self.exposed_headers = kwargs.get('exposed_headers', None) - self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) + super(ClusterResourceProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.restore_from_backup_id = kwargs.get('restore_from_backup_id', None) + self.delegated_management_subnet_id = kwargs.get('delegated_management_subnet_id', None) + self.cassandra_version = kwargs.get('cassandra_version', None) + self.cluster_name_override = kwargs.get('cluster_name_override', None) + self.authentication_method = kwargs.get('authentication_method', None) + self.initial_cassandra_admin_password = kwargs.get('initial_cassandra_admin_password', None) + self.hours_between_backups = kwargs.get('hours_between_backups', None) + self.prometheus_endpoint = kwargs.get('prometheus_endpoint', None) + self.repair_enabled = kwargs.get('repair_enabled', None) + self.client_certificates = kwargs.get('client_certificates', None) + self.external_gossip_certificates = kwargs.get('external_gossip_certificates', None) + self.gossip_certificates = None + self.external_seed_nodes = kwargs.get('external_seed_nodes', None) + self.seed_nodes = None -class CreateUpdateOptions(msrest.serialization.Model): - """CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput". +class Column(msrest.serialization.Model): + """Cosmos DB Cassandra table column. - :param throughput: Request Units per second. For example, "throughput": 10000. - :type throughput: int - :param autoscale_settings: Specifies the Autoscale settings. - :type autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + :param name: Name of the Cosmos DB Cassandra table column. + :type name: str + :param type: Type of the Cosmos DB Cassandra table column. + :type type: str """ _attribute_map = { - 'throughput': {'key': 'throughput', 'type': 'int'}, - 'autoscale_settings': {'key': 'autoscaleSettings', 'type': 'AutoscaleSettings'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, **kwargs ): - super(CreateUpdateOptions, self).__init__(**kwargs) - self.throughput = kwargs.get('throughput', None) - self.autoscale_settings = kwargs.get('autoscale_settings', None) + super(Column, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.type = kwargs.get('type', None) -class DatabaseAccountConnectionString(msrest.serialization.Model): - """Connection string for the Cosmos DB account. +class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar connection_string: Value of the connection string. - :vartype connection_string: str - :ivar description: Description of the connection string. - :vartype description: str + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str """ _validation = { - 'connection_string': {'readonly': True}, - 'description': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, } _attribute_map = { - 'connection_string': {'key': 'connectionString', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DatabaseAccountConnectionString, self).__init__(**kwargs) - self.connection_string = None - self.description = None + super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None -class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB database accounts. +class CompositePath(msrest.serialization.Model): + """CompositePath. - Variables are only populated by the server, and will be ignored when sending a request. + :param path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :type path: str + :param order: Sort order for composite paths. Possible values include: "ascending", + "descending". + :type order: str or ~azure.mgmt.cosmosdb.models.CompositePathSortOrder + """ - All required parameters must be populated in order to send to Azure. + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'str'}, + } - :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 - :param location: The location of the resource group to which the resource belongs. - :type location: str - :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). A - maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 - characters and value no greater than 256 characters. For example, the default experience for a - template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values - also include "Table", "Graph", "DocumentDB", and "MongoDB". - :type tags: dict[str, str] - :param kind: Indicates the type of database account. This can only be set at database account - creation. Possible values include: "GlobalDocumentDB", "MongoDB", "Parse". - :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :param consistency_policy: The consistency policy for the Cosmos DB account. - :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :param locations: Required. An array that contains the georeplication locations enabled for the - Cosmos DB account. - :type locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar database_account_offer_type: Required. The offer type for the database. Default value: - "Standard". - :vartype database_account_offer_type: str - :param ip_rules: List of IpRules. - :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] - :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual - Network ACL rules. - :type is_virtual_network_filter_enabled: bool - :param enable_automatic_failover: Enables automatic failover of the write region in the rare - event that the region is unavailable due to an outage. Automatic failover will result in a new - write region for the account and is chosen based on the failover priorities configured for the - account. - :type enable_automatic_failover: bool - :param capabilities: List of Cosmos DB capabilities for the account. - :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB - account. + def __init__( + self, + **kwargs + ): + super(CompositePath, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + self.order = kwargs.get('order', None) + + +class ConflictResolutionPolicy(msrest.serialization.Model): + """The conflict resolution policy for the container. + + :param mode: Indicates the conflict resolution mode. Possible values include: "LastWriterWins", + "Custom". Default value: "LastWriterWins". + :type mode: str or ~azure.mgmt.cosmosdb.models.ConflictResolutionMode + :param conflict_resolution_path: The conflict resolution path in the case of LastWriterWins + mode. + :type conflict_resolution_path: str + :param conflict_resolution_procedure: The procedure to resolve conflicts in the case of custom + mode. + :type conflict_resolution_procedure: str + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'conflict_resolution_path': {'key': 'conflictResolutionPath', 'type': 'str'}, + 'conflict_resolution_procedure': {'key': 'conflictResolutionProcedure', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ConflictResolutionPolicy, self).__init__(**kwargs) + self.mode = kwargs.get('mode', "LastWriterWins") + self.conflict_resolution_path = kwargs.get('conflict_resolution_path', None) + self.conflict_resolution_procedure = kwargs.get('conflict_resolution_procedure', None) + + +class ConsistencyPolicy(msrest.serialization.Model): + """The consistency policy for the Cosmos DB database account. + + All required parameters must be populated in order to send to Azure. + + :param default_consistency_level: Required. The default consistency level and configuration + settings of the Cosmos DB account. Possible values include: "Eventual", "Session", + "BoundedStaleness", "Strong", "ConsistentPrefix". + :type default_consistency_level: str or ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel + :param max_staleness_prefix: When used with the Bounded Staleness consistency level, this value + represents the number of stale requests tolerated. Accepted range for this value is 1 – + 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :type max_staleness_prefix: long + :param max_interval_in_seconds: When used with the Bounded Staleness consistency level, this + value represents the time amount of staleness (in seconds) tolerated. Accepted range for this + value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :type max_interval_in_seconds: int + """ + + _validation = { + 'default_consistency_level': {'required': True}, + 'max_staleness_prefix': {'maximum': 2147483647, 'minimum': 1}, + 'max_interval_in_seconds': {'maximum': 86400, 'minimum': 5}, + } + + _attribute_map = { + 'default_consistency_level': {'key': 'defaultConsistencyLevel', 'type': 'str'}, + 'max_staleness_prefix': {'key': 'maxStalenessPrefix', 'type': 'long'}, + 'max_interval_in_seconds': {'key': 'maxIntervalInSeconds', 'type': 'int'}, + } + + def __init__( + self, + **kwargs + ): + super(ConsistencyPolicy, self).__init__(**kwargs) + self.default_consistency_level = kwargs['default_consistency_level'] + self.max_staleness_prefix = kwargs.get('max_staleness_prefix', None) + self.max_interval_in_seconds = kwargs.get('max_interval_in_seconds', None) + + +class ContainerPartitionKey(msrest.serialization.Model): + """The configuration of the partition key to be used for partitioning data into multiple partitions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param paths: List of paths using which data within the container can be partitioned. + :type paths: list[str] + :param kind: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple + partition keys (upto three maximum) are supported for container create. Possible values + include: "Hash", "Range", "MultiHash". Default value: "Hash". + :type kind: str or ~azure.mgmt.cosmosdb.models.PartitionKind + :param version: Indicates the version of the partition key definition. + :type version: int + :ivar system_key: Indicates if the container is using a system generated partition key. + :vartype system_key: bool + """ + + _validation = { + 'version': {'maximum': 2, 'minimum': 1}, + 'system_key': {'readonly': True}, + } + + _attribute_map = { + 'paths': {'key': 'paths', 'type': '[str]'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + 'system_key': {'key': 'systemKey', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(ContainerPartitionKey, self).__init__(**kwargs) + self.paths = kwargs.get('paths', None) + self.kind = kwargs.get('kind', "Hash") + self.version = kwargs.get('version', None) + self.system_key = None + + +class ContinuousBackupInformation(msrest.serialization.Model): + """Information about the status of continuous backups. + + :param latest_restorable_timestamp: The latest restorable timestamp for a resource. + :type latest_restorable_timestamp: str + """ + + _attribute_map = { + 'latest_restorable_timestamp': {'key': 'latestRestorableTimestamp', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContinuousBackupInformation, self).__init__(**kwargs) + self.latest_restorable_timestamp = kwargs.get('latest_restorable_timestamp', None) + + +class ContinuousBackupRestoreLocation(msrest.serialization.Model): + """Properties of the regional restorable account. + + :param location: The name of the continuous backup restore location. + :type location: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ContinuousBackupRestoreLocation, self).__init__(**kwargs) + self.location = kwargs.get('location', None) + + +class ContinuousModeBackupPolicy(BackupPolicy): + """The object representing continuous mode backup policy. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Describes the mode of backups.Constant filled by server. Possible + values include: "Periodic", "Continuous". + :type type: str or ~azure.mgmt.cosmosdb.models.BackupPolicyType + :param migration_state: The object representing the state of the migration between the backup + policies. + :type migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'migration_state': {'key': 'migrationState', 'type': 'BackupPolicyMigrationState'}, + } + + def __init__( + self, + **kwargs + ): + super(ContinuousModeBackupPolicy, self).__init__(**kwargs) + self.type = 'Continuous' # type: str + + +class CorsPolicy(msrest.serialization.Model): + """The CORS policy for the Cosmos DB database account. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. The origin domains that are permitted to make a request + against the service via CORS. + :type allowed_origins: str + :param allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a + CORS request. + :type allowed_methods: str + :param allowed_headers: The request headers that the origin domain may specify on the CORS + request. + :type allowed_headers: str + :param 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. + :type exposed_headers: str + :param max_age_in_seconds: The maximum amount time that a browser should cache the preflight + OPTIONS request. + :type max_age_in_seconds: long + """ + + _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': 'long'}, + } + + def __init__( + self, + **kwargs + ): + super(CorsPolicy, self).__init__(**kwargs) + self.allowed_origins = kwargs['allowed_origins'] + self.allowed_methods = kwargs.get('allowed_methods', None) + self.allowed_headers = kwargs.get('allowed_headers', None) + self.exposed_headers = kwargs.get('exposed_headers', None) + self.max_age_in_seconds = kwargs.get('max_age_in_seconds', None) + + +class CreateUpdateOptions(msrest.serialization.Model): + """CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput". + + :param throughput: Request Units per second. For example, "throughput": 10000. + :type throughput: int + :param autoscale_settings: Specifies the Autoscale settings. + :type autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + """ + + _attribute_map = { + 'throughput': {'key': 'throughput', 'type': 'int'}, + 'autoscale_settings': {'key': 'autoscaleSettings', 'type': 'AutoscaleSettings'}, + } + + def __init__( + self, + **kwargs + ): + super(CreateUpdateOptions, self).__init__(**kwargs) + self.throughput = kwargs.get('throughput', None) + self.autoscale_settings = kwargs.get('autoscale_settings', None) + + +class DatabaseAccountConnectionString(msrest.serialization.Model): + """Connection string for the Cosmos DB account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar connection_string: Value of the connection string. + :vartype connection_string: str + :ivar description: Description of the connection string. + :vartype description: str + """ + + _validation = { + 'connection_string': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountConnectionString, self).__init__(**kwargs) + self.connection_string = None + self.description = None + + +class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB database accounts. + + 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 Azure. + + :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 + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param kind: Indicates the type of database account. This can only be set at database account + creation. Possible values include: "GlobalDocumentDB", "MongoDB", "Parse". + :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :param consistency_policy: The consistency policy for the Cosmos DB account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param locations: Required. An array that contains the georeplication locations enabled for the + Cosmos DB account. + :type locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar database_account_offer_type: The offer type for the database. Has constant value: + "Standard". + :vartype database_account_offer_type: str + :param ip_rules: List of IpRules. + :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :type is_virtual_network_filter_enabled: bool + :param enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :type enable_automatic_failover: bool + :param capabilities: List of Cosmos DB capabilities for the account. + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :param enable_multiple_write_locations: Enables the account to write in multiple locations. + :type enable_multiple_write_locations: bool + :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. + :type enable_cassandra_connector: bool + :param connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. Possible values include: "Small". + :type connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :param disable_key_based_metadata_write_access: Disable write operations on metadata resources + (databases, containers, throughput) via account keys. + :type disable_key_based_metadata_write_access: bool + :param key_vault_key_uri: The URI of the key vault. + :type key_vault_key_uri: str + :param default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :type default_identity: str + :param public_network_access: Whether requests from Public Network are allowed. Possible values + include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :param enable_free_tier: Flag to indicate whether Free Tier is enabled. + :type enable_free_tier: bool + :param api_properties: API specific properties. Currently, supported only for MongoDB API. + :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :type enable_analytical_storage: bool + :param analytical_storage_configuration: Analytical storage specific properties. + :type analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :param create_mode: Required. Enum to indicate the mode of account creation.Constant filled by + server. Possible values include: "Default", "Restore". Default value: "Default". + :type create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :param backup_policy: The object representing the policy for taking backups on an account. + :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :param cors: The CORS policy for the Cosmos DB database account. + :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. + Possible values include: "None", "AzureServices". + :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl + Bypass for the Cosmos DB account. + :type network_acl_bypass_resource_ids: list[str] + :param diagnostic_log_settings: The Object representing the different Diagnostic log settings + for the Cosmos DB Account. + :type diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings + :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :type disable_local_auth: bool + :param restore_parameters: Parameters to indicate the information about the restore. + :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'locations': {'required': True}, + 'database_account_offer_type': {'required': True, 'constant': True}, + 'create_mode': {'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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'locations': {'key': 'properties.locations', 'type': '[Location]'}, + 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, + 'ip_rules': {'key': 'properties.ipRules', 'type': '[IpAddressOrRange]'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, + 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'}, + 'enable_cassandra_connector': {'key': 'properties.enableCassandraConnector', 'type': 'bool'}, + 'connector_offer': {'key': 'properties.connectorOffer', 'type': 'str'}, + 'disable_key_based_metadata_write_access': {'key': 'properties.disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, + 'key_vault_key_uri': {'key': 'properties.keyVaultKeyUri', 'type': 'str'}, + 'default_identity': {'key': 'properties.defaultIdentity', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, + 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, + 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, + 'analytical_storage_configuration': {'key': 'properties.analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, + 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, + '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'}, + } + + database_account_offer_type = "Standard" + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountCreateUpdateParameters, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.consistency_policy = kwargs.get('consistency_policy', None) + self.locations = kwargs['locations'] + self.ip_rules = kwargs.get('ip_rules', None) + self.is_virtual_network_filter_enabled = kwargs.get('is_virtual_network_filter_enabled', None) + self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None) + self.capabilities = kwargs.get('capabilities', None) + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.enable_multiple_write_locations = kwargs.get('enable_multiple_write_locations', None) + self.enable_cassandra_connector = kwargs.get('enable_cassandra_connector', None) + self.connector_offer = kwargs.get('connector_offer', None) + self.disable_key_based_metadata_write_access = kwargs.get('disable_key_based_metadata_write_access', None) + self.key_vault_key_uri = kwargs.get('key_vault_key_uri', None) + self.default_identity = kwargs.get('default_identity', None) + self.public_network_access = kwargs.get('public_network_access', None) + self.enable_free_tier = kwargs.get('enable_free_tier', None) + self.api_properties = kwargs.get('api_properties', None) + self.enable_analytical_storage = kwargs.get('enable_analytical_storage', None) + self.analytical_storage_configuration = kwargs.get('analytical_storage_configuration', None) + self.create_mode = None # type: Optional[str] + self.backup_policy = kwargs.get('backup_policy', None) + self.cors = kwargs.get('cors', None) + self.network_acl_bypass = kwargs.get('network_acl_bypass', None) + self.network_acl_bypass_resource_ids = kwargs.get('network_acl_bypass_resource_ids', None) + self.diagnostic_log_settings = kwargs.get('diagnostic_log_settings', None) + self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.restore_parameters = kwargs.get('restore_parameters', None) + + +class DatabaseAccountCreateUpdateProperties(msrest.serialization.Model): + """Properties to create and update Azure Cosmos DB database accounts. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DefaultRequestDatabaseAccountCreateUpdateProperties. + + 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 Azure. + + :param consistency_policy: The consistency policy for the Cosmos DB account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param locations: Required. An array that contains the georeplication locations enabled for the + Cosmos DB account. + :type locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar database_account_offer_type: The offer type for the database. Has constant value: + "Standard". + :vartype database_account_offer_type: str + :param ip_rules: List of IpRules. + :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :type is_virtual_network_filter_enabled: bool + :param enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :type enable_automatic_failover: bool + :param capabilities: List of Cosmos DB capabilities for the account. + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :param enable_multiple_write_locations: Enables the account to write in multiple locations. + :type enable_multiple_write_locations: bool + :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. + :type enable_cassandra_connector: bool + :param connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. Possible values include: "Small". + :type connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :param disable_key_based_metadata_write_access: Disable write operations on metadata resources + (databases, containers, throughput) via account keys. + :type disable_key_based_metadata_write_access: bool + :param key_vault_key_uri: The URI of the key vault. + :type key_vault_key_uri: str + :param default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :type default_identity: str + :param public_network_access: Whether requests from Public Network are allowed. Possible values + include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :param enable_free_tier: Flag to indicate whether Free Tier is enabled. + :type enable_free_tier: bool + :param api_properties: API specific properties. Currently, supported only for MongoDB API. + :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :type enable_analytical_storage: bool + :param analytical_storage_configuration: Analytical storage specific properties. + :type analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :param create_mode: Required. Enum to indicate the mode of account creation.Constant filled by + server. Possible values include: "Default", "Restore". Default value: "Default". + :type create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :param backup_policy: The object representing the policy for taking backups on an account. + :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :param cors: The CORS policy for the Cosmos DB database account. + :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. + Possible values include: "None", "AzureServices". + :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl + Bypass for the Cosmos DB account. + :type network_acl_bypass_resource_ids: list[str] + :param diagnostic_log_settings: The Object representing the different Diagnostic log settings + for the Cosmos DB Account. + :type diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings + :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :type disable_local_auth: bool + :param restore_parameters: Parameters to indicate the information about the restore. + :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + """ + + _validation = { + 'locations': {'required': True}, + 'database_account_offer_type': {'required': True, 'constant': True}, + 'create_mode': {'required': True}, + } + + _attribute_map = { + 'consistency_policy': {'key': 'consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'locations': {'key': 'locations', 'type': '[Location]'}, + 'database_account_offer_type': {'key': 'databaseAccountOfferType', 'type': 'str'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IpAddressOrRange]'}, + 'is_virtual_network_filter_enabled': {'key': 'isVirtualNetworkFilterEnabled', 'type': 'bool'}, + 'enable_automatic_failover': {'key': 'enableAutomaticFailover', 'type': 'bool'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'enable_multiple_write_locations': {'key': 'enableMultipleWriteLocations', 'type': 'bool'}, + 'enable_cassandra_connector': {'key': 'enableCassandraConnector', 'type': 'bool'}, + 'connector_offer': {'key': 'connectorOffer', 'type': 'str'}, + 'disable_key_based_metadata_write_access': {'key': 'disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, + 'key_vault_key_uri': {'key': 'keyVaultKeyUri', 'type': 'str'}, + 'default_identity': {'key': 'defaultIdentity', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'enable_free_tier': {'key': 'enableFreeTier', 'type': 'bool'}, + 'api_properties': {'key': 'apiProperties', 'type': 'ApiProperties'}, + 'enable_analytical_storage': {'key': 'enableAnalyticalStorage', 'type': 'bool'}, + 'analytical_storage_configuration': {'key': 'analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'backup_policy': {'key': 'backupPolicy', 'type': 'BackupPolicy'}, + 'cors': {'key': 'cors', 'type': '[CorsPolicy]'}, + 'network_acl_bypass': {'key': 'networkAclBypass', 'type': 'str'}, + 'network_acl_bypass_resource_ids': {'key': 'networkAclBypassResourceIds', 'type': '[str]'}, + 'diagnostic_log_settings': {'key': 'diagnosticLogSettings', 'type': 'DiagnosticLogSettings'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + 'restore_parameters': {'key': 'restoreParameters', 'type': 'RestoreParameters'}, + } + + _subtype_map = { + 'create_mode': {'Default': 'DefaultRequestDatabaseAccountCreateUpdateProperties'} + } + + database_account_offer_type = "Standard" + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountCreateUpdateProperties, self).__init__(**kwargs) + self.consistency_policy = kwargs.get('consistency_policy', None) + self.locations = kwargs['locations'] + self.ip_rules = kwargs.get('ip_rules', None) + self.is_virtual_network_filter_enabled = kwargs.get('is_virtual_network_filter_enabled', None) + self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None) + self.capabilities = kwargs.get('capabilities', None) + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.enable_multiple_write_locations = kwargs.get('enable_multiple_write_locations', None) + self.enable_cassandra_connector = kwargs.get('enable_cassandra_connector', None) + self.connector_offer = kwargs.get('connector_offer', None) + self.disable_key_based_metadata_write_access = kwargs.get('disable_key_based_metadata_write_access', None) + self.key_vault_key_uri = kwargs.get('key_vault_key_uri', None) + self.default_identity = kwargs.get('default_identity', None) + self.public_network_access = kwargs.get('public_network_access', None) + self.enable_free_tier = kwargs.get('enable_free_tier', None) + self.api_properties = kwargs.get('api_properties', None) + self.enable_analytical_storage = kwargs.get('enable_analytical_storage', None) + self.analytical_storage_configuration = kwargs.get('analytical_storage_configuration', None) + self.create_mode = None # type: Optional[str] + self.backup_policy = kwargs.get('backup_policy', None) + self.cors = kwargs.get('cors', None) + self.network_acl_bypass = kwargs.get('network_acl_bypass', None) + self.network_acl_bypass_resource_ids = kwargs.get('network_acl_bypass_resource_ids', None) + self.diagnostic_log_settings = kwargs.get('diagnostic_log_settings', None) + self.disable_local_auth = kwargs.get('disable_local_auth', None) + self.restore_parameters = kwargs.get('restore_parameters', None) + + +class DatabaseAccountGetResults(ARMResourceProperties): + """An Azure Cosmos DB database account. + + 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 + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param kind: Indicates the type of database account. This can only be set at database account + creation. Possible values include: "GlobalDocumentDB", "MongoDB", "Parse". + :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :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 + called. The status can be one of following. 'Creating' – the Cosmos DB account is being + created. When an account is in Creating state, only properties that are specified as input for + the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is + active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB + account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – + the Cosmos DB account deletion failed. + :vartype provisioning_state: str + :ivar document_endpoint: The connection endpoint for the Cosmos DB database account. + :vartype document_endpoint: str + :ivar database_account_offer_type: The offer type for the Cosmos DB database account. Default + value: Standard. The only acceptable values to pass in are None and "Standard". The default + value is None. + :vartype database_account_offer_type: str + :param ip_rules: List of IpRules. + :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :type is_virtual_network_filter_enabled: bool + :param enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :type enable_automatic_failover: bool + :param consistency_policy: The consistency policy for the Cosmos DB database account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param capabilities: List of Cosmos DB capabilities for the account. + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :ivar write_locations: An array that contains the write location for the Cosmos DB account. + :vartype write_locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar read_locations: An array that contains of the read locations enabled for the Cosmos DB + account. + :vartype read_locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar locations: An array that contains all of the locations enabled for the Cosmos DB account. + :vartype locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar failover_policies: An array that contains the regions ordered by their failover + priorities. + :vartype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :ivar private_endpoint_connections: List of Private Endpoint Connections configured for the + Cosmos DB account. + :vartype private_endpoint_connections: + list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection] + :param enable_multiple_write_locations: Enables the account to write in multiple locations. + :type enable_multiple_write_locations: bool + :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. + :type enable_cassandra_connector: bool + :param connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. Possible values include: "Small". + :type connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :param disable_key_based_metadata_write_access: Disable write operations on metadata resources + (databases, containers, throughput) via account keys. + :type disable_key_based_metadata_write_access: bool + :param key_vault_key_uri: The URI of the key vault. + :type key_vault_key_uri: str + :param default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :type default_identity: str + :param public_network_access: Whether requests from Public Network are allowed. Possible values + include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :param enable_free_tier: Flag to indicate whether Free Tier is enabled. + :type enable_free_tier: bool + :param api_properties: API specific properties. + :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :type enable_analytical_storage: bool + :param analytical_storage_configuration: Analytical storage specific properties. + :type analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :ivar instance_id: A unique identifier assigned to the database account. + :vartype instance_id: str + :param create_mode: Enum to indicate the mode of account creation. Possible values include: + "Default", "Restore". Default value: "Default". + :type create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :param restore_parameters: Parameters to indicate the information about the restore. + :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + :param backup_policy: The object representing the policy for taking backups on an account. + :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :param cors: The CORS policy for the Cosmos DB database account. + :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. + Possible values include: "None", "AzureServices". + :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl + Bypass for the Cosmos DB account. + :type network_acl_bypass_resource_ids: list[str] + :param diagnostic_log_settings: The Object representing the different Diagnostic log settings + for the Cosmos DB Account. + :type diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings + :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :type disable_local_auth: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'document_endpoint': {'readonly': True}, + 'database_account_offer_type': {'readonly': True}, + 'write_locations': {'readonly': True}, + 'read_locations': {'readonly': True}, + 'locations': {'readonly': True}, + 'failover_policies': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'instance_id': {'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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'document_endpoint': {'key': 'properties.documentEndpoint', 'type': 'str'}, + 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, + 'ip_rules': {'key': 'properties.ipRules', 'type': '[IpAddressOrRange]'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, + 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, + 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + 'write_locations': {'key': 'properties.writeLocations', 'type': '[Location]'}, + 'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'}, + 'locations': {'key': 'properties.locations', 'type': '[Location]'}, + 'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'}, + 'enable_cassandra_connector': {'key': 'properties.enableCassandraConnector', 'type': 'bool'}, + 'connector_offer': {'key': 'properties.connectorOffer', 'type': 'str'}, + 'disable_key_based_metadata_write_access': {'key': 'properties.disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, + 'key_vault_key_uri': {'key': 'properties.keyVaultKeyUri', 'type': 'str'}, + 'default_identity': {'key': 'properties.defaultIdentity', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, + 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, + 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, + 'analytical_storage_configuration': {'key': 'properties.analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, + 'restore_parameters': {'key': 'properties.restoreParameters', 'type': 'RestoreParameters'}, + 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, + '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'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountGetResults, self).__init__(**kwargs) + self.kind = kwargs.get('kind', None) + self.system_data = None + self.provisioning_state = None + self.document_endpoint = None + self.database_account_offer_type = None + self.ip_rules = kwargs.get('ip_rules', None) + self.is_virtual_network_filter_enabled = kwargs.get('is_virtual_network_filter_enabled', None) + self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None) + self.consistency_policy = kwargs.get('consistency_policy', None) + self.capabilities = kwargs.get('capabilities', None) + self.write_locations = None + self.read_locations = None + self.locations = None + self.failover_policies = None + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) + self.private_endpoint_connections = None + self.enable_multiple_write_locations = kwargs.get('enable_multiple_write_locations', None) + self.enable_cassandra_connector = kwargs.get('enable_cassandra_connector', None) + self.connector_offer = kwargs.get('connector_offer', None) + self.disable_key_based_metadata_write_access = kwargs.get('disable_key_based_metadata_write_access', None) + self.key_vault_key_uri = kwargs.get('key_vault_key_uri', None) + self.default_identity = kwargs.get('default_identity', None) + self.public_network_access = kwargs.get('public_network_access', None) + self.enable_free_tier = kwargs.get('enable_free_tier', None) + self.api_properties = kwargs.get('api_properties', None) + self.enable_analytical_storage = kwargs.get('enable_analytical_storage', None) + self.analytical_storage_configuration = kwargs.get('analytical_storage_configuration', None) + self.instance_id = None + self.create_mode = kwargs.get('create_mode', "Default") + self.restore_parameters = kwargs.get('restore_parameters', None) + self.backup_policy = kwargs.get('backup_policy', None) + self.cors = kwargs.get('cors', None) + self.network_acl_bypass = kwargs.get('network_acl_bypass', None) + self.network_acl_bypass_resource_ids = kwargs.get('network_acl_bypass_resource_ids', None) + self.diagnostic_log_settings = kwargs.get('diagnostic_log_settings', None) + self.disable_local_auth = kwargs.get('disable_local_auth', None) + + +class DatabaseAccountListConnectionStringsResult(msrest.serialization.Model): + """The connection strings for the given database account. + + :param connection_strings: An array that contains the connection strings for the Cosmos DB + account. + :type connection_strings: list[~azure.mgmt.cosmosdb.models.DatabaseAccountConnectionString] + """ + + _attribute_map = { + 'connection_strings': {'key': 'connectionStrings', 'type': '[DatabaseAccountConnectionString]'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountListConnectionStringsResult, self).__init__(**kwargs) + self.connection_strings = kwargs.get('connection_strings', None) + + +class DatabaseAccountListReadOnlyKeysResult(msrest.serialization.Model): + """The read-only access keys for the given database account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. + :vartype primary_readonly_master_key: str + :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. + :vartype secondary_readonly_master_key: str + """ + + _validation = { + 'primary_readonly_master_key': {'readonly': True}, + 'secondary_readonly_master_key': {'readonly': True}, + } + + _attribute_map = { + 'primary_readonly_master_key': {'key': 'primaryReadonlyMasterKey', 'type': 'str'}, + 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountListReadOnlyKeysResult, self).__init__(**kwargs) + self.primary_readonly_master_key = None + self.secondary_readonly_master_key = None + + +class DatabaseAccountListKeysResult(DatabaseAccountListReadOnlyKeysResult): + """The access keys for the given database account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. + :vartype primary_readonly_master_key: str + :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. + :vartype secondary_readonly_master_key: str + :ivar primary_master_key: Base 64 encoded value of the primary read-write key. + :vartype primary_master_key: str + :ivar secondary_master_key: Base 64 encoded value of the secondary read-write key. + :vartype secondary_master_key: str + """ + + _validation = { + 'primary_readonly_master_key': {'readonly': True}, + 'secondary_readonly_master_key': {'readonly': True}, + 'primary_master_key': {'readonly': True}, + 'secondary_master_key': {'readonly': True}, + } + + _attribute_map = { + 'primary_readonly_master_key': {'key': 'primaryReadonlyMasterKey', 'type': 'str'}, + 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, + 'primary_master_key': {'key': 'primaryMasterKey', 'type': 'str'}, + 'secondary_master_key': {'key': 'secondaryMasterKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountListKeysResult, self).__init__(**kwargs) + self.primary_master_key = None + self.secondary_master_key = None + + +class DatabaseAccountRegenerateKeyParameters(msrest.serialization.Model): + """Parameters to regenerate the keys within the database account. + + All required parameters must be populated in order to send to Azure. + + :param key_kind: Required. The access key to regenerate. Possible values include: "primary", + "secondary", "primaryReadonly", "secondaryReadonly". + :type key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind + """ + + _validation = { + 'key_kind': {'required': True}, + } + + _attribute_map = { + 'key_kind': {'key': 'keyKind', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_kind = kwargs['key_kind'] + + +class DatabaseAccountsListResult(msrest.serialization.Model): + """The List operation response, that contains the database accounts and their properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of database account and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.DatabaseAccountGetResults] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabaseAccountGetResults]'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountsListResult, self).__init__(**kwargs) + self.value = None + + +class DatabaseAccountUpdateParameters(msrest.serialization.Model): + """Parameters for patching Azure Cosmos DB database account properties. + + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param consistency_policy: The consistency policy for the Cosmos DB account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param locations: An array that contains the georeplication locations enabled for the Cosmos DB + account. + :type locations: list[~azure.mgmt.cosmosdb.models.Location] + :param ip_rules: List of IpRules. + :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :type is_virtual_network_filter_enabled: bool + :param enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :type enable_automatic_failover: bool + :param capabilities: List of Cosmos DB capabilities for the account. + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] :param enable_multiple_write_locations: Enables the account to write in multiple locations. :type enable_multiple_write_locations: bool @@ -1352,9 +2609,6 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): :param analytical_storage_configuration: Analytical storage specific properties. :type analytical_storage_configuration: ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :param create_mode: Enum to indicate the mode of account creation. Possible values include: - "Default", "Restore". Default value: "Default". - :type create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode :param backup_policy: The object representing the policy for taking backups on an account. :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy :param cors: The CORS policy for the Cosmos DB database account. @@ -1365,32 +2619,20 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. :type network_acl_bypass_resource_ids: list[str] + :param diagnostic_log_settings: The Object representing the different Diagnostic log settings + for the Cosmos DB Account. + :type diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. :type disable_local_auth: bool - :param restore_parameters: Parameters to indicate the information about the restore. - :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters """ - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'locations': {'required': True}, - 'database_account_offer_type': {'required': True, 'constant': 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}'}, - 'kind': {'key': 'kind', 'type': 'str'}, + 'location': {'key': 'location', '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'}, 'ip_rules': {'key': 'properties.ipRules', 'type': '[IpAddressOrRange]'}, 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, @@ -1407,26 +2649,24 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, 'analytical_storage_configuration': {'key': 'properties.analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, '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'}, } - database_account_offer_type = "Standard" - def __init__( self, **kwargs ): - super(DatabaseAccountCreateUpdateParameters, self).__init__(**kwargs) - self.kind = kwargs.get('kind', None) + super(DatabaseAccountUpdateParameters, self).__init__(**kwargs) + self.tags = kwargs.get('tags', None) + self.location = kwargs.get('location', None) self.identity = kwargs.get('identity', None) self.consistency_policy = kwargs.get('consistency_policy', None) - self.locations = kwargs['locations'] + self.locations = kwargs.get('locations', None) self.ip_rules = kwargs.get('ip_rules', None) self.is_virtual_network_filter_enabled = kwargs.get('is_virtual_network_filter_enabled', None) self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None) @@ -1443,54 +2683,348 @@ def __init__( self.api_properties = kwargs.get('api_properties', None) self.enable_analytical_storage = kwargs.get('enable_analytical_storage', None) self.analytical_storage_configuration = kwargs.get('analytical_storage_configuration', None) - self.create_mode = kwargs.get('create_mode', "Default") self.backup_policy = kwargs.get('backup_policy', None) self.cors = kwargs.get('cors', None) self.network_acl_bypass = kwargs.get('network_acl_bypass', None) self.network_acl_bypass_resource_ids = kwargs.get('network_acl_bypass_resource_ids', None) + self.diagnostic_log_settings = kwargs.get('diagnostic_log_settings', None) self.disable_local_auth = kwargs.get('disable_local_auth', None) - self.restore_parameters = kwargs.get('restore_parameters', None) -class DatabaseAccountGetResults(ARMResourceProperties): - """An Azure Cosmos DB database account. +class DatabaseRestoreResource(msrest.serialization.Model): + """Specific Databases to restore. + + :param database_name: The name of the database available for restore. + :type database_name: str + :param collection_names: The names of the collections available for restore. + :type collection_names: list[str] + """ + + _attribute_map = { + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'collection_names': {'key': 'collectionNames', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseRestoreResource, self).__init__(**kwargs) + self.database_name = kwargs.get('database_name', None) + self.collection_names = kwargs.get('collection_names', None) + + +class DataCenterResource(ARMProxyResource): + """A managed Cassandra data center. 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 - :param location: The location of the resource group to which the resource belongs. - :type location: str - :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). A - maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 - characters and value no greater than 256 characters. For example, the default experience for a - template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values - also include "Table", "Graph", "DocumentDB", and "MongoDB". - :type tags: dict[str, str] - :param kind: Indicates the type of database account. This can only be set at database account - creation. Possible values include: "GlobalDocumentDB", "MongoDB", "Parse". - :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind - :param identity: Identity for the resource. - :type 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 - called. The status can be one of following. 'Creating' – the Cosmos DB account is being - created. When an account is in Creating state, only properties that are specified as input for - the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is - active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB - account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – - the Cosmos DB account deletion failed. - :vartype provisioning_state: str - :ivar document_endpoint: The connection endpoint for the Cosmos DB database account. - :vartype document_endpoint: str - :ivar database_account_offer_type: The offer type for the Cosmos DB database account. Default - value: Standard. Default value: "Standard". + :param properties: Properties of a managed Cassandra data center. + :type properties: ~azure.mgmt.cosmosdb.models.DataCenterResourceProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'DataCenterResourceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCenterResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class DataCenterResourceProperties(msrest.serialization.Model): + """Properties of a managed Cassandra data center. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param provisioning_state: The status of the resource at the time the operation was called. + Possible values include: "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :type provisioning_state: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState + :param data_center_location: The region this data center should be created in. + :type data_center_location: str + :param delegated_subnet_id: Resource id of a subnet the nodes in this data center should have + their network interfaces connected to. The subnet must be in the same region specified in + 'dataCenterLocation' and must be able to route to the subnet specified in the cluster's + 'delegatedManagementSubnetId' property. This resource id will be of the form + '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. + :type delegated_subnet_id: str + :param node_count: The number of nodes the data center should have. This is the desired number. + After it is set, it may take some time for the data center to be scaled to match. To monitor + the number of nodes and their status, use the fetchNodeStatus method on the cluster. + :type node_count: int + :ivar seed_nodes: IP addresses for seed nodes in this data center. This is for reference. + Generally you will want to use the seedNodes property on the cluster, which aggregates the seed + nodes from all data centers in the cluster. + :vartype seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] + :param 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. + :type base64_encoded_cassandra_yaml_fragment: str + """ + + _validation = { + 'seed_nodes': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'data_center_location': {'key': 'dataCenterLocation', 'type': 'str'}, + 'delegated_subnet_id': {'key': 'delegatedSubnetId', 'type': 'str'}, + 'node_count': {'key': 'nodeCount', 'type': 'int'}, + 'seed_nodes': {'key': 'seedNodes', 'type': '[SeedNode]'}, + 'base64_encoded_cassandra_yaml_fragment': {'key': 'base64EncodedCassandraYamlFragment', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataCenterResourceProperties, self).__init__(**kwargs) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.data_center_location = kwargs.get('data_center_location', None) + self.delegated_subnet_id = kwargs.get('delegated_subnet_id', None) + self.node_count = kwargs.get('node_count', None) + self.seed_nodes = None + self.base64_encoded_cassandra_yaml_fragment = kwargs.get('base64_encoded_cassandra_yaml_fragment', None) + + +class RegionalServiceResource(msrest.serialization.Model): + """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. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RegionalServiceResource, self).__init__(**kwargs) + self.name = None + self.location = None + self.status = None + + +class DataTransferRegionalServiceResource(RegionalServiceResource): + """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. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTransferRegionalServiceResource, self).__init__(**kwargs) + + +class DataTransferServiceResource(msrest.serialization.Model): + """Describes the service response property. + + :param properties: Properties for DataTransferServiceResource. + :type properties: ~azure.mgmt.cosmosdb.models.DataTransferServiceResourceProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'DataTransferServiceResourceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTransferServiceResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ServiceResourceProperties(msrest.serialization.Model): + """Services response resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DataTransferServiceResourceProperties, GraphAPIComputeServiceResourceProperties, SqlDedicatedGatewayServiceResourceProperties. + + 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 Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :param instance_size: Instance type for the service. Possible values include: "Cosmos.D4s", + "Cosmos.D8s", "Cosmos.D16s". + :type instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :param instance_count: Instance count for the service. + :type instance_count: int + :param service_type: Required. ServiceType for the service.Constant filled by server. Possible + values include: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute". + :type service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'instance_count': {'minimum': 0}, + 'service_type': {'required': True}, + 'status': {'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'}, + } + + _subtype_map = { + 'service_type': {'DataTransfer': 'DataTransferServiceResourceProperties', 'GraphAPICompute': 'GraphAPIComputeServiceResourceProperties', 'SqlDedicatedGateway': 'SqlDedicatedGatewayServiceResourceProperties'} + } + + def __init__( + self, + **kwargs + ): + super(ServiceResourceProperties, self).__init__(**kwargs) + self.additional_properties = kwargs.get('additional_properties', None) + self.creation_time = None + self.instance_size = kwargs.get('instance_size', None) + self.instance_count = kwargs.get('instance_count', None) + self.service_type = 'ServiceResourceProperties' # type: str + self.status = None + + +class DataTransferServiceResourceProperties(ServiceResourceProperties): + """Properties for DataTransferServiceResource. + + 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 Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :param instance_size: Instance type for the service. Possible values include: "Cosmos.D4s", + "Cosmos.D8s", "Cosmos.D16s". + :type instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :param instance_count: Instance count for the service. + :type instance_count: int + :param service_type: Required. ServiceType for the service.Constant filled by server. Possible + values include: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute". + :type service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar locations: An array that contains all of the locations for the service. + :vartype locations: list[~azure.mgmt.cosmosdb.models.DataTransferRegionalServiceResource] + """ + + _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'}, + 'locations': {'key': 'locations', 'type': '[DataTransferRegionalServiceResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTransferServiceResourceProperties, self).__init__(**kwargs) + self.service_type = 'DataTransfer' # type: str + self.locations = None + + +class DefaultRequestDatabaseAccountCreateUpdateProperties(DatabaseAccountCreateUpdateProperties): + """Properties for non-restore Azure Cosmos DB database account requests. + + 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 Azure. + + :param consistency_policy: The consistency policy for the Cosmos DB account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param locations: Required. An array that contains the georeplication locations enabled for the + Cosmos DB account. + :type locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar database_account_offer_type: The offer type for the database. Has constant value: + "Standard". :vartype database_account_offer_type: str :param ip_rules: List of IpRules. :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] @@ -1502,27 +3036,11 @@ class DatabaseAccountGetResults(ARMResourceProperties): write region for the account and is chosen based on the failover priorities configured for the account. :type enable_automatic_failover: bool - :param consistency_policy: The consistency policy for the Cosmos DB database account. - :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy :param capabilities: List of Cosmos DB capabilities for the account. :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :ivar write_locations: An array that contains the write location for the Cosmos DB account. - :vartype write_locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar read_locations: An array that contains of the read locations enabled for the Cosmos DB - account. - :vartype read_locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar locations: An array that contains all of the locations enabled for the Cosmos DB account. - :vartype locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar failover_policies: An array that contains the regions ordered by their failover - priorities. - :vartype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB account. :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] - :ivar private_endpoint_connections: List of Private Endpoint Connections configured for the - Cosmos DB account. - :vartype private_endpoint_connections: - list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection] :param enable_multiple_write_locations: Enables the account to write in multiple locations. :type enable_multiple_write_locations: bool :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. @@ -1544,20 +3062,16 @@ class DatabaseAccountGetResults(ARMResourceProperties): :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess :param enable_free_tier: Flag to indicate whether Free Tier is enabled. :type enable_free_tier: bool - :param api_properties: API specific properties. + :param api_properties: API specific properties. Currently, supported only for MongoDB API. :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. :type enable_analytical_storage: bool :param analytical_storage_configuration: Analytical storage specific properties. :type analytical_storage_configuration: ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :ivar instance_id: A unique identifier assigned to the database account. - :vartype instance_id: str - :param create_mode: Enum to indicate the mode of account creation. Possible values include: - "Default", "Restore". Default value: "Default". + :param create_mode: Required. Enum to indicate the mode of account creation.Constant filled by + server. Possible values include: "Default", "Restore". Default value: "Default". :type create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :param restore_parameters: Parameters to indicate the information about the restore. - :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters :param backup_policy: The object representing the policy for taking backups on an account. :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy :param cors: The CORS policy for the Cosmos DB database account. @@ -1568,258 +3082,343 @@ class DatabaseAccountGetResults(ARMResourceProperties): :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl Bypass for the Cosmos DB account. :type network_acl_bypass_resource_ids: list[str] + :param diagnostic_log_settings: The Object representing the different Diagnostic log settings + for the Cosmos DB Account. + :type diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. :type disable_local_auth: bool + :param restore_parameters: Parameters to indicate the information about the restore. + :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters """ _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'document_endpoint': {'readonly': True}, - 'database_account_offer_type': {'readonly': True, 'constant': True}, - 'write_locations': {'readonly': True}, - 'read_locations': {'readonly': True}, - 'locations': {'readonly': True}, - 'failover_policies': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'instance_id': {'readonly': True}, + 'locations': {'required': True}, + 'database_account_offer_type': {'required': True, 'constant': True}, + 'create_mode': {'required': True}, + } + + _attribute_map = { + 'consistency_policy': {'key': 'consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'locations': {'key': 'locations', 'type': '[Location]'}, + 'database_account_offer_type': {'key': 'databaseAccountOfferType', 'type': 'str'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IpAddressOrRange]'}, + 'is_virtual_network_filter_enabled': {'key': 'isVirtualNetworkFilterEnabled', 'type': 'bool'}, + 'enable_automatic_failover': {'key': 'enableAutomaticFailover', 'type': 'bool'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'enable_multiple_write_locations': {'key': 'enableMultipleWriteLocations', 'type': 'bool'}, + 'enable_cassandra_connector': {'key': 'enableCassandraConnector', 'type': 'bool'}, + 'connector_offer': {'key': 'connectorOffer', 'type': 'str'}, + 'disable_key_based_metadata_write_access': {'key': 'disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, + 'key_vault_key_uri': {'key': 'keyVaultKeyUri', 'type': 'str'}, + 'default_identity': {'key': 'defaultIdentity', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'enable_free_tier': {'key': 'enableFreeTier', 'type': 'bool'}, + 'api_properties': {'key': 'apiProperties', 'type': 'ApiProperties'}, + 'enable_analytical_storage': {'key': 'enableAnalyticalStorage', 'type': 'bool'}, + 'analytical_storage_configuration': {'key': 'analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'backup_policy': {'key': 'backupPolicy', 'type': 'BackupPolicy'}, + 'cors': {'key': 'cors', 'type': '[CorsPolicy]'}, + 'network_acl_bypass': {'key': 'networkAclBypass', 'type': 'str'}, + 'network_acl_bypass_resource_ids': {'key': 'networkAclBypassResourceIds', 'type': '[str]'}, + 'diagnostic_log_settings': {'key': 'diagnosticLogSettings', 'type': 'DiagnosticLogSettings'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + 'restore_parameters': {'key': 'restoreParameters', 'type': 'RestoreParameters'}, } + database_account_offer_type = "Standard" + + def __init__( + self, + **kwargs + ): + super(DefaultRequestDatabaseAccountCreateUpdateProperties, self).__init__(**kwargs) + self.create_mode = 'Default' # type: str + + +class DiagnosticLogSettings(msrest.serialization.Model): + """Indicates what diagnostic log settings are to be enabled. + + :param enable_full_text_query: Describe the level of detail with which queries are to be + logged. Possible values include: "None", "True", "False". + :type enable_full_text_query: str or ~azure.mgmt.cosmosdb.models.EnableFullTextQuery + """ + _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}'}, - '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'}, - 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, - 'ip_rules': {'key': 'properties.ipRules', 'type': '[IpAddressOrRange]'}, - 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, - 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, - 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, - 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, - 'write_locations': {'key': 'properties.writeLocations', 'type': '[Location]'}, - 'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'}, - 'locations': {'key': 'properties.locations', 'type': '[Location]'}, - 'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'}, - 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'}, - 'enable_cassandra_connector': {'key': 'properties.enableCassandraConnector', 'type': 'bool'}, - 'connector_offer': {'key': 'properties.connectorOffer', 'type': 'str'}, - 'disable_key_based_metadata_write_access': {'key': 'properties.disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, - 'key_vault_key_uri': {'key': 'properties.keyVaultKeyUri', 'type': 'str'}, - 'default_identity': {'key': 'properties.defaultIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, - 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, - 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, - 'analytical_storage_configuration': {'key': 'properties.analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, - 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, - 'restore_parameters': {'key': 'properties.restoreParameters', 'type': 'RestoreParameters'}, - 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, - 'cors': {'key': 'properties.cors', 'type': '[CorsPolicy]'}, - 'network_acl_bypass': {'key': 'properties.networkAclBypass', 'type': 'str'}, - 'network_acl_bypass_resource_ids': {'key': 'properties.networkAclBypassResourceIds', 'type': '[str]'}, - 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, + 'enable_full_text_query': {'key': 'enableFullTextQuery', 'type': 'str'}, } - database_account_offer_type = "Standard" + def __init__( + self, + **kwargs + ): + super(DiagnosticLogSettings, self).__init__(**kwargs) + self.enable_full_text_query = kwargs.get('enable_full_text_query', None) + + +class ErrorResponse(msrest.serialization.Model): + """Error Response. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } def __init__( self, **kwargs ): - super(DatabaseAccountGetResults, self).__init__(**kwargs) - self.kind = kwargs.get('kind', None) - self.identity = kwargs.get('identity', None) - self.system_data = None - self.provisioning_state = None - self.document_endpoint = None - self.database_account_offer_type = None - self.ip_rules = kwargs.get('ip_rules', None) - self.is_virtual_network_filter_enabled = kwargs.get('is_virtual_network_filter_enabled', None) - self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None) - self.consistency_policy = kwargs.get('consistency_policy', None) - self.capabilities = kwargs.get('capabilities', None) - self.write_locations = None - self.read_locations = None - self.locations = None - self.failover_policies = None - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.private_endpoint_connections = None - self.enable_multiple_write_locations = kwargs.get('enable_multiple_write_locations', None) - self.enable_cassandra_connector = kwargs.get('enable_cassandra_connector', None) - self.connector_offer = kwargs.get('connector_offer', None) - self.disable_key_based_metadata_write_access = kwargs.get('disable_key_based_metadata_write_access', None) - self.key_vault_key_uri = kwargs.get('key_vault_key_uri', None) - self.default_identity = kwargs.get('default_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.enable_free_tier = kwargs.get('enable_free_tier', None) - self.api_properties = kwargs.get('api_properties', None) - self.enable_analytical_storage = kwargs.get('enable_analytical_storage', None) - self.analytical_storage_configuration = kwargs.get('analytical_storage_configuration', None) - self.instance_id = None - self.create_mode = kwargs.get('create_mode', "Default") - self.restore_parameters = kwargs.get('restore_parameters', None) - self.backup_policy = kwargs.get('backup_policy', None) - self.cors = kwargs.get('cors', None) - self.network_acl_bypass = kwargs.get('network_acl_bypass', None) - self.network_acl_bypass_resource_ids = kwargs.get('network_acl_bypass_resource_ids', None) - self.disable_local_auth = kwargs.get('disable_local_auth', None) + super(ErrorResponse, self).__init__(**kwargs) + self.code = kwargs.get('code', None) + self.message = kwargs.get('message', None) -class DatabaseAccountListConnectionStringsResult(msrest.serialization.Model): - """The connection strings for the given database account. +class ExcludedPath(msrest.serialization.Model): + """ExcludedPath. - :param connection_strings: An array that contains the connection strings for the Cosmos DB - account. - :type connection_strings: list[~azure.mgmt.cosmosdb.models.DatabaseAccountConnectionString] + :param path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :type path: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ExcludedPath, self).__init__(**kwargs) + self.path = kwargs.get('path', None) + + +class FailoverPolicies(msrest.serialization.Model): + """The list of new failover policies for the failover priority change. + + All required parameters must be populated in order to send to Azure. + + :param failover_policies: Required. List of failover policies. + :type failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + """ + + _validation = { + 'failover_policies': {'required': True}, + } + + _attribute_map = { + 'failover_policies': {'key': 'failoverPolicies', 'type': '[FailoverPolicy]'}, + } + + def __init__( + self, + **kwargs + ): + super(FailoverPolicies, self).__init__(**kwargs) + self.failover_policies = kwargs['failover_policies'] + + +class FailoverPolicy(msrest.serialization.Model): + """The failover policy for a given region of a database account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar id: The unique identifier of the region in which the database account replicates to. + Example: <accountName>-<locationName>. + :vartype id: str + :param location_name: The name of the region in which the database account exists. + :type location_name: str + :param failover_priority: The failover priority of the region. A failover priority of 0 + indicates a write region. The maximum value for a failover priority = (total number of regions + - 1). Failover priority values must be unique for each of the regions in which the database + account exists. + :type failover_priority: int """ + _validation = { + 'id': {'readonly': True}, + 'failover_priority': {'minimum': 0}, + } + _attribute_map = { - 'connection_strings': {'key': 'connectionStrings', 'type': '[DatabaseAccountConnectionString]'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location_name': {'key': 'locationName', 'type': 'str'}, + 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, } def __init__( self, **kwargs ): - super(DatabaseAccountListConnectionStringsResult, self).__init__(**kwargs) - self.connection_strings = kwargs.get('connection_strings', None) + super(FailoverPolicy, self).__init__(**kwargs) + self.id = None + self.location_name = kwargs.get('location_name', None) + self.failover_priority = kwargs.get('failover_priority', None) -class DatabaseAccountListReadOnlyKeysResult(msrest.serialization.Model): - """The read-only access keys for the given database account. +class GraphAPIComputeRegionalServiceResource(RegionalServiceResource): + """Resource for a regional service location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. - :vartype primary_readonly_master_key: str - :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. - :vartype secondary_readonly_master_key: str + :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. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar graph_api_compute_endpoint: The regional endpoint for GraphAPICompute. + :vartype graph_api_compute_endpoint: str """ _validation = { - 'primary_readonly_master_key': {'readonly': True}, - 'secondary_readonly_master_key': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'status': {'readonly': True}, + 'graph_api_compute_endpoint': {'readonly': True}, } _attribute_map = { - 'primary_readonly_master_key': {'key': 'primaryReadonlyMasterKey', 'type': 'str'}, - 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'graph_api_compute_endpoint': {'key': 'graphApiComputeEndpoint', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DatabaseAccountListReadOnlyKeysResult, self).__init__(**kwargs) - self.primary_readonly_master_key = None - self.secondary_readonly_master_key = None - + super(GraphAPIComputeRegionalServiceResource, self).__init__(**kwargs) + self.graph_api_compute_endpoint = None -class DatabaseAccountListKeysResult(DatabaseAccountListReadOnlyKeysResult): - """The access keys for the given database account. - Variables are only populated by the server, and will be ignored when sending a request. +class GraphAPIComputeServiceResource(msrest.serialization.Model): + """Describes the service response property for GraphAPICompute. - :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. - :vartype primary_readonly_master_key: str - :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. - :vartype secondary_readonly_master_key: str - :ivar primary_master_key: Base 64 encoded value of the primary read-write key. - :vartype primary_master_key: str - :ivar secondary_master_key: Base 64 encoded value of the secondary read-write key. - :vartype secondary_master_key: str + :param properties: Properties for GraphAPIComputeServiceResource. + :type properties: ~azure.mgmt.cosmosdb.models.GraphAPIComputeServiceResourceProperties """ - _validation = { - 'primary_readonly_master_key': {'readonly': True}, - 'secondary_readonly_master_key': {'readonly': True}, - 'primary_master_key': {'readonly': True}, - 'secondary_master_key': {'readonly': True}, - } - _attribute_map = { - 'primary_readonly_master_key': {'key': 'primaryReadonlyMasterKey', 'type': 'str'}, - 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, - 'primary_master_key': {'key': 'primaryMasterKey', 'type': 'str'}, - 'secondary_master_key': {'key': 'secondaryMasterKey', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'GraphAPIComputeServiceResourceProperties'}, } def __init__( self, **kwargs ): - super(DatabaseAccountListKeysResult, self).__init__(**kwargs) - self.primary_master_key = None - self.secondary_master_key = None + super(GraphAPIComputeServiceResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) -class DatabaseAccountRegenerateKeyParameters(msrest.serialization.Model): - """Parameters to regenerate the keys within the database account. +class GraphAPIComputeServiceResourceProperties(ServiceResourceProperties): + """Properties for GraphAPIComputeServiceResource. + + 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 Azure. - :param key_kind: Required. The access key to regenerate. Possible values include: "primary", - "secondary", "primaryReadonly", "secondaryReadonly". - :type key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :param instance_size: Instance type for the service. Possible values include: "Cosmos.D4s", + "Cosmos.D8s", "Cosmos.D16s". + :type instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :param instance_count: Instance count for the service. + :type instance_count: int + :param service_type: Required. ServiceType for the service.Constant filled by server. Possible + values include: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute". + :type service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :param graph_api_compute_endpoint: GraphAPICompute endpoint for the service. + :type graph_api_compute_endpoint: str + :ivar locations: An array that contains all of the locations for the service. + :vartype locations: list[~azure.mgmt.cosmosdb.models.GraphAPIComputeRegionalServiceResource] """ _validation = { - 'key_kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'instance_count': {'minimum': 0}, + 'service_type': {'required': True}, + 'status': {'readonly': True}, + 'locations': {'readonly': True}, } _attribute_map = { - 'key_kind': {'key': 'keyKind', 'type': 'str'}, + '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'}, + 'graph_api_compute_endpoint': {'key': 'graphApiComputeEndpoint', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[GraphAPIComputeRegionalServiceResource]'}, } def __init__( self, **kwargs ): - super(DatabaseAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_kind = kwargs['key_kind'] + super(GraphAPIComputeServiceResourceProperties, self).__init__(**kwargs) + self.service_type = 'GraphAPICompute' # type: str + self.graph_api_compute_endpoint = kwargs.get('graph_api_compute_endpoint', None) + self.locations = None -class DatabaseAccountsListResult(msrest.serialization.Model): - """The List operation response, that contains the database accounts and their properties. +class GraphResource(msrest.serialization.Model): + """Cosmos DB Graph 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 Azure. - :ivar value: List of database account and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.DatabaseAccountGetResults] + :param id: Required. Name of the Cosmos DB Graph. + :type id: str """ _validation = { - 'value': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[DatabaseAccountGetResults]'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DatabaseAccountsListResult, self).__init__(**kwargs) - self.value = None + super(GraphResource, self).__init__(**kwargs) + self.id = kwargs['id'] -class DatabaseAccountUpdateParameters(msrest.serialization.Model): - """Parameters for patching Azure Cosmos DB database account properties. +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 Azure. + :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 + :param location: The location of the resource group to which the resource belongs. + :type location: str :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 @@ -1827,262 +3426,184 @@ class DatabaseAccountUpdateParameters(msrest.serialization.Model): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] - :param location: The location of the resource group to which the resource belongs. - :type location: str :param identity: Identity for the resource. :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :param consistency_policy: The consistency policy for the Cosmos DB account. - :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :param locations: An array that contains the georeplication locations enabled for the Cosmos DB - account. - :type locations: list[~azure.mgmt.cosmosdb.models.Location] - :param ip_rules: List of IpRules. - :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] - :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual - Network ACL rules. - :type is_virtual_network_filter_enabled: bool - :param enable_automatic_failover: Enables automatic failover of the write region in the rare - event that the region is unavailable due to an outage. Automatic failover will result in a new - write region for the account and is chosen based on the failover priorities configured for the - account. - :type enable_automatic_failover: bool - :param capabilities: List of Cosmos DB capabilities for the account. - :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB - account. - :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] - :param enable_multiple_write_locations: Enables the account to write in multiple locations. - :type enable_multiple_write_locations: bool - :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. - :type enable_cassandra_connector: bool - :param connector_offer: The cassandra connector offer type for the Cosmos DB database C* - account. Possible values include: "Small". - :type connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer - :param disable_key_based_metadata_write_access: Disable write operations on metadata resources - (databases, containers, throughput) via account keys. - :type disable_key_based_metadata_write_access: bool - :param key_vault_key_uri: The URI of the key vault. - :type key_vault_key_uri: str - :param default_identity: The default identity for accessing key vault used in features like - customer managed keys. The default identity needs to be explicitly set by the users. It can be - "FirstPartyIdentity", "SystemAssignedIdentity" and more. - :type default_identity: str - :param public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess - :param enable_free_tier: Flag to indicate whether Free Tier is enabled. - :type enable_free_tier: bool - :param api_properties: API specific properties. Currently, supported only for MongoDB API. - :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties - :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. - :type enable_analytical_storage: bool - :param analytical_storage_configuration: Analytical storage specific properties. - :type analytical_storage_configuration: - ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :param backup_policy: The object representing the policy for taking backups on an account. - :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy - :param cors: The CORS policy for the Cosmos DB database account. - :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] - :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. - Possible values include: "None", "AzureServices". - :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass - :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl - Bypass for the Cosmos DB account. - :type network_acl_bypass_resource_ids: list[str] - :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be - used exclusively for authentication. - :type disable_local_auth: bool + :param resource: Required. The standard JSON format of a Graph resource. + :type resource: ~azure.mgmt.cosmosdb.models.GraphResource + :param options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :type options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ - _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, - 'location': {'key': 'location', 'type': 'str'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, - 'locations': {'key': 'properties.locations', 'type': '[Location]'}, - 'ip_rules': {'key': 'properties.ipRules', 'type': '[IpAddressOrRange]'}, - 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, - 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, - 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, - 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'}, - 'enable_cassandra_connector': {'key': 'properties.enableCassandraConnector', 'type': 'bool'}, - 'connector_offer': {'key': 'properties.connectorOffer', 'type': 'str'}, - 'disable_key_based_metadata_write_access': {'key': 'properties.disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, - 'key_vault_key_uri': {'key': 'properties.keyVaultKeyUri', 'type': 'str'}, - 'default_identity': {'key': 'properties.defaultIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, - 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, - 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, - 'analytical_storage_configuration': {'key': 'properties.analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, - 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, - 'cors': {'key': 'properties.cors', 'type': '[CorsPolicy]'}, - 'network_acl_bypass': {'key': 'properties.networkAclBypass', 'type': 'str'}, - 'network_acl_bypass_resource_ids': {'key': 'properties.networkAclBypassResourceIds', 'type': '[str]'}, - 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource': {'required': True}, } - def __init__( - self, - **kwargs - ): - super(DatabaseAccountUpdateParameters, self).__init__(**kwargs) - self.tags = kwargs.get('tags', None) - self.location = kwargs.get('location', None) - self.identity = kwargs.get('identity', None) - self.consistency_policy = kwargs.get('consistency_policy', None) - self.locations = kwargs.get('locations', None) - self.ip_rules = kwargs.get('ip_rules', None) - self.is_virtual_network_filter_enabled = kwargs.get('is_virtual_network_filter_enabled', None) - self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None) - self.capabilities = kwargs.get('capabilities', None) - self.virtual_network_rules = kwargs.get('virtual_network_rules', None) - self.enable_multiple_write_locations = kwargs.get('enable_multiple_write_locations', None) - self.enable_cassandra_connector = kwargs.get('enable_cassandra_connector', None) - self.connector_offer = kwargs.get('connector_offer', None) - self.disable_key_based_metadata_write_access = kwargs.get('disable_key_based_metadata_write_access', None) - self.key_vault_key_uri = kwargs.get('key_vault_key_uri', None) - self.default_identity = kwargs.get('default_identity', None) - self.public_network_access = kwargs.get('public_network_access', None) - self.enable_free_tier = kwargs.get('enable_free_tier', None) - self.api_properties = kwargs.get('api_properties', None) - self.enable_analytical_storage = kwargs.get('enable_analytical_storage', None) - self.analytical_storage_configuration = kwargs.get('analytical_storage_configuration', None) - self.backup_policy = kwargs.get('backup_policy', None) - self.cors = kwargs.get('cors', None) - self.network_acl_bypass = kwargs.get('network_acl_bypass', None) - self.network_acl_bypass_resource_ids = kwargs.get('network_acl_bypass_resource_ids', None) - self.disable_local_auth = kwargs.get('disable_local_auth', None) - - -class DatabaseRestoreResource(msrest.serialization.Model): - """Specific Databases to restore. - - :param database_name: The name of the database available for restore. - :type database_name: str - :param collection_names: The names of the collections available for restore. - :type collection_names: list[str] - """ - _attribute_map = { - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'collection_names': {'key': 'collectionNames', 'type': '[str]'}, + '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, **kwargs ): - super(DatabaseRestoreResource, self).__init__(**kwargs) - self.database_name = kwargs.get('database_name', None) - self.collection_names = kwargs.get('collection_names', None) + super(GraphResourceCreateUpdateParameters, self).__init__(**kwargs) + self.resource = kwargs['resource'] + self.options = kwargs.get('options', None) -class ErrorResponse(msrest.serialization.Model): - """Error Response. +class GraphResourceGetPropertiesOptions(OptionsResource): + """GraphResourceGetPropertiesOptions. - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str + :param throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :type throughput: int + :param autoscale_settings: Specifies the Autoscale settings. + :type autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings """ _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, + 'throughput': {'key': 'throughput', 'type': 'int'}, + 'autoscale_settings': {'key': 'autoscaleSettings', 'type': 'AutoscaleSettings'}, } def __init__( self, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.code = kwargs.get('code', None) - self.message = kwargs.get('message', None) + super(GraphResourceGetPropertiesOptions, self).__init__(**kwargs) -class ExcludedPath(msrest.serialization.Model): - """ExcludedPath. +class GraphResourceGetPropertiesResource(GraphResource, ExtendedResourceProperties): + """GraphResourceGetPropertiesResource. - :param path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :type path: str + 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 Azure. + + :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 + :param id: Required. Name of the Cosmos DB Graph. + :type id: str """ + _validation = { + 'rid': {'readonly': True}, + 'ts': {'readonly': True}, + 'etag': {'readonly': True}, + 'id': {'required': True}, + } + _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, + 'rid': {'key': '_rid', 'type': 'str'}, + 'ts': {'key': '_ts', 'type': 'float'}, + 'etag': {'key': '_etag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, **kwargs ): - super(ExcludedPath, self).__init__(**kwargs) - self.path = kwargs.get('path', None) + super(GraphResourceGetPropertiesResource, self).__init__(**kwargs) + self.rid = None + self.ts = None + self.etag = None + self.id = kwargs['id'] -class FailoverPolicies(msrest.serialization.Model): - """The list of new failover policies for the failover priority change. +class GraphResourceGetResults(ARMResourceProperties): + """An Azure Cosmos DB Graph resource. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param failover_policies: Required. List of failover policies. - :type failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :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 + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param resource: + :type resource: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesResource + :param options: + :type options: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesOptions """ _validation = { - 'failover_policies': {'required': True}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { - 'failover_policies': {'key': 'failoverPolicies', 'type': '[FailoverPolicy]'}, + '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, **kwargs ): - super(FailoverPolicies, self).__init__(**kwargs) - self.failover_policies = kwargs['failover_policies'] + super(GraphResourceGetResults, self).__init__(**kwargs) + self.resource = kwargs.get('resource', None) + self.options = kwargs.get('options', None) -class FailoverPolicy(msrest.serialization.Model): - """The failover policy for a given region of a database account. +class GraphResourcesListResult(msrest.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 id: The unique identifier of the region in which the database account replicates to. - Example: <accountName>-<locationName>. - :vartype id: str - :param location_name: The name of the region in which the database account exists. - :type location_name: str - :param failover_priority: The failover priority of the region. A failover priority of 0 - indicates a write region. The maximum value for a failover priority = (total number of regions - - 1). Failover priority values must be unique for each of the regions in which the database - account exists. - :type failover_priority: int + :ivar value: List of Graph resource and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.GraphResourceGetResults] """ _validation = { - 'id': {'readonly': True}, - 'failover_priority': {'minimum': 0}, + 'value': {'readonly': True}, } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location_name': {'key': 'locationName', 'type': 'str'}, - 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[GraphResourceGetResults]'}, } def __init__( self, **kwargs ): - super(FailoverPolicy, self).__init__(**kwargs) - self.id = None - self.location_name = kwargs.get('location_name', None) - self.failover_priority = kwargs.get('failover_priority', None) + super(GraphResourcesListResult, self).__init__(**kwargs) + self.value = None class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): @@ -2107,6 +3628,8 @@ class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a Gremlin database. :type resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -2127,6 +3650,7 @@ 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'}, } @@ -2250,6 +3774,8 @@ class GremlinDatabaseGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource :param options: @@ -2268,6 +3794,7 @@ 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'}, } @@ -2328,6 +3855,8 @@ class GremlinGraphCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a Gremlin graph. :type resource: ~azure.mgmt.cosmosdb.models.GremlinGraphResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -2348,6 +3877,7 @@ 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'}, } @@ -2517,6 +4047,8 @@ class GremlinGraphGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource :param options: @@ -2535,6 +4067,7 @@ 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'}, } @@ -2690,6 +4223,75 @@ def __init__( self.ip_address_or_range = kwargs.get('ip_address_or_range', None) +class ListBackups(msrest.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 + ): + super(ListBackups, self).__init__(**kwargs) + self.value = None + + +class ListClusters(msrest.serialization.Model): + """List of managed Cassandra clusters. + + :param value: Container for the array of clusters. + :type value: list[~azure.mgmt.cosmosdb.models.ClusterResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ClusterResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListClusters, self).__init__(**kwargs) + self.value = kwargs.get('value', None) + + +class ListDataCenters(msrest.serialization.Model): + """List of managed Cassandra data centers and their properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Container for array of data centers. + :vartype value: list[~azure.mgmt.cosmosdb.models.DataCenterResource] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataCenterResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListDataCenters, self).__init__(**kwargs) + self.value = None + + class Location(msrest.serialization.Model): """A region in which the Azure Cosmos DB database account is deployed. @@ -2729,25 +4331,128 @@ class Location(msrest.serialization.Model): } _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'location_name': {'key': 'locationName', 'type': 'str'}, - 'document_endpoint': {'key': 'documentEndpoint', 'type': 'str'}, - 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, - 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, - 'is_zone_redundant': {'key': 'isZoneRedundant', 'type': 'bool'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location_name': {'key': 'locationName', 'type': 'str'}, + 'document_endpoint': {'key': 'documentEndpoint', 'type': 'str'}, + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, + 'is_zone_redundant': {'key': 'isZoneRedundant', 'type': 'bool'}, + } + + def __init__( + self, + **kwargs + ): + super(Location, self).__init__(**kwargs) + self.id = None + self.location_name = kwargs.get('location_name', None) + self.document_endpoint = None + self.provisioning_state = None + self.failover_priority = kwargs.get('failover_priority', None) + self.is_zone_redundant = kwargs.get('is_zone_redundant', None) + + +class LocationGetResult(ARMProxyResource): + """Cosmos DB location get result. + + 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 + :param properties: Cosmos DB location metadata. + :type properties: ~azure.mgmt.cosmosdb.models.LocationProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'LocationProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(LocationGetResult, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class LocationListResult(msrest.serialization.Model): + """The List operation response, that contains Cosmos DB locations and their properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Cosmos DB locations and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.LocationGetResult] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LocationGetResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(LocationListResult, self).__init__(**kwargs) + self.value = None + + +class LocationProperties(msrest.serialization.Model): + """Cosmos DB location metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The current status of location in Azure. + :vartype status: str + :ivar supports_availability_zone: Flag indicating whether the location supports availability + zones or not. + :vartype supports_availability_zone: bool + :ivar is_residency_restricted: Flag indicating whether the location is residency sensitive. + :vartype is_residency_restricted: bool + :ivar backup_storage_redundancies: The properties of available backup storage redundancies. + :vartype backup_storage_redundancies: list[str or + ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy] + """ + + _validation = { + 'status': {'readonly': True}, + 'supports_availability_zone': {'readonly': True}, + 'is_residency_restricted': {'readonly': True}, + 'backup_storage_redundancies': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'supports_availability_zone': {'key': 'supportsAvailabilityZone', 'type': 'bool'}, + 'is_residency_restricted': {'key': 'isResidencyRestricted', 'type': 'bool'}, + 'backup_storage_redundancies': {'key': 'backupStorageRedundancies', 'type': '[str]'}, } def __init__( self, **kwargs ): - super(Location, self).__init__(**kwargs) - self.id = None - self.location_name = kwargs.get('location_name', None) - self.document_endpoint = None - self.provisioning_state = None - self.failover_priority = kwargs.get('failover_priority', None) - self.is_zone_redundant = kwargs.get('is_zone_redundant', None) + super(LocationProperties, self).__init__(**kwargs) + self.status = None + self.supports_availability_zone = None + self.is_residency_restricted = None + self.backup_storage_redundancies = None class ManagedServiceIdentity(msrest.serialization.Model): @@ -3076,6 +4781,8 @@ class MongoDBCollectionCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a MongoDB collection. :type resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -3096,6 +4803,7 @@ 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'}, } @@ -3243,6 +4951,8 @@ class MongoDBCollectionGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource :param options: @@ -3261,6 +4971,7 @@ 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'}, } @@ -3321,6 +5032,8 @@ class MongoDBDatabaseCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a MongoDB database. :type resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -3341,6 +5054,7 @@ 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'}, } @@ -3464,6 +5178,8 @@ class MongoDBDatabaseGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource :param options: @@ -3482,6 +5198,7 @@ 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'}, } @@ -4189,6 +5906,9 @@ class PeriodicModeProperties(msrest.serialization.Model): :param backup_retention_interval_in_hours: An integer representing the time (in hours) that each backup is retained. :type backup_retention_interval_in_hours: int + :param backup_storage_redundancy: Enum to indicate type of backup residency. Possible values + include: "Geo", "Local", "Zone". + :type backup_storage_redundancy: str or ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy """ _validation = { @@ -4199,6 +5919,7 @@ class PeriodicModeProperties(msrest.serialization.Model): _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__( @@ -4208,6 +5929,7 @@ def __init__( super(PeriodicModeProperties, self).__init__(**kwargs) self.backup_interval_in_minutes = kwargs.get('backup_interval_in_minutes', None) self.backup_retention_interval_in_hours = kwargs.get('backup_retention_interval_in_hours', None) + self.backup_storage_redundancy = kwargs.get('backup_storage_redundancy', None) class Permission(msrest.serialization.Model): @@ -4519,6 +6241,36 @@ def __init__( self.region = kwargs['region'] +class RepairPostBody(msrest.serialization.Model): + """Specification of the keyspaces and tables to run repair on. + + All required parameters must be populated in order to send to Azure. + + :param keyspace: Required. The name of the keyspace that repair should be run on. + :type keyspace: str + :param tables: List of tables in the keyspace to repair. If omitted, repair all tables in the + keyspace. + :type tables: list[str] + """ + + _validation = { + 'keyspace': {'required': True}, + } + + _attribute_map = { + 'keyspace': {'key': 'keyspace', 'type': 'str'}, + 'tables': {'key': 'tables', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(RepairPostBody, self).__init__(**kwargs) + self.keyspace = kwargs['keyspace'] + self.tables = kwargs.get('tables', None) + + class RestorableDatabaseAccountGetResult(msrest.serialization.Model): """A Azure Cosmos DB restorable database account. @@ -5253,13 +7005,15 @@ def __init__( self.id = kwargs['id'] -class RestorableSqlDatabasePropertiesResourceDatabase(SqlDatabaseResource, ExtendedResourceProperties): +class RestorableSqlDatabasePropertiesResourceDatabase(ExtendedResourceProperties, SqlDatabaseResource): """Cosmos DB SQL database 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 Azure. + :param id: Required. Name of the Cosmos DB SQL database. + :type id: str :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. @@ -5267,8 +7021,6 @@ class RestorableSqlDatabasePropertiesResourceDatabase(SqlDatabaseResource, Exten :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :param id: Required. Name of the Cosmos DB SQL database. - :type id: str :ivar colls: A system generated property that specified the addressable path of the collections resource. :vartype colls: str @@ -5281,20 +7033,20 @@ class RestorableSqlDatabasePropertiesResourceDatabase(SqlDatabaseResource, Exten """ _validation = { + 'id': {'required': True}, 'rid': {'readonly': True}, 'ts': {'readonly': True}, 'etag': {'readonly': True}, - 'id': {'required': True}, 'colls': {'readonly': True}, 'users': {'readonly': True}, 'self_property': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'rid': {'key': '_rid', 'type': 'str'}, 'ts': {'key': '_ts', 'type': 'float'}, 'etag': {'key': '_etag', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, 'colls': {'key': '_colls', 'type': 'str'}, 'users': {'key': '_users', 'type': 'str'}, 'self_property': {'key': '_self', 'type': 'str'}, @@ -5305,13 +7057,13 @@ def __init__( **kwargs ): super(RestorableSqlDatabasePropertiesResourceDatabase, self).__init__(**kwargs) - self.rid = None - self.ts = None - self.etag = None + self.id = kwargs['id'] self.colls = None self.users = None self.self_property = None - self.id = kwargs['id'] + self.rid = None + self.ts = None + self.etag = None self.colls = None self.users = None self.self_property = None @@ -5401,6 +7153,119 @@ def __init__( self.databases_to_restore = kwargs.get('databases_to_restore', None) +class SeedNode(msrest.serialization.Model): + """SeedNode. + + :param ip_address: IP address of this seed node. + :type ip_address: str + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(SeedNode, self).__init__(**kwargs) + self.ip_address = kwargs.get('ip_address', None) + + +class ServiceResource(ARMProxyResource): + """Properties for the database account. + + 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 + :param properties: Services response resource. + :type properties: ~azure.mgmt.cosmosdb.models.ServiceResourceProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'ServiceResourceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class ServiceResourceCreateUpdateParameters(msrest.serialization.Model): + """Parameters for Create or Update Request for ServiceResource. + + :param instance_size: Instance type for the service. Possible values include: "Cosmos.D4s", + "Cosmos.D8s", "Cosmos.D16s". + :type instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :param instance_count: Instance count for the service. + :type instance_count: int + :param service_type: ServiceType for the service. Possible values include: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute". + :type service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + """ + + _validation = { + 'instance_count': {'minimum': 0}, + } + + _attribute_map = { + 'instance_size': {'key': 'properties.instanceSize', 'type': 'str'}, + 'instance_count': {'key': 'properties.instanceCount', 'type': 'int'}, + 'service_type': {'key': 'properties.serviceType', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceResourceCreateUpdateParameters, self).__init__(**kwargs) + self.instance_size = kwargs.get('instance_size', None) + self.instance_count = kwargs.get('instance_count', None) + self.service_type = kwargs.get('service_type', None) + + +class ServiceResourceListResult(msrest.serialization.Model): + """The List operation response, that contains the Service Resource and their properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Service Resource and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.ServiceResource] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServiceResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceResourceListResult, self).__init__(**kwargs) + self.value = None + + class SpatialSpec(msrest.serialization.Model): """SpatialSpec. @@ -5447,6 +7312,8 @@ class SqlContainerCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a container. :type resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -5467,6 +7334,7 @@ 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'}, } @@ -5592,6 +7460,8 @@ class SqlContainerGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource :param options: @@ -5610,6 +7480,7 @@ 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'}, } @@ -5670,6 +7541,8 @@ class SqlDatabaseCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a SQL database. :type resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -5690,6 +7563,7 @@ 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'}, } @@ -5725,13 +7599,15 @@ def __init__( super(SqlDatabaseGetPropertiesOptions, self).__init__(**kwargs) -class SqlDatabaseGetPropertiesResource(SqlDatabaseResource, ExtendedResourceProperties): +class SqlDatabaseGetPropertiesResource(ExtendedResourceProperties, SqlDatabaseResource): """SqlDatabaseGetPropertiesResource. 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 Azure. + :param id: Required. Name of the Cosmos DB SQL database. + :type id: str :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. @@ -5739,8 +7615,6 @@ class SqlDatabaseGetPropertiesResource(SqlDatabaseResource, ExtendedResourceProp :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :param id: Required. Name of the Cosmos DB SQL database. - :type id: str :param colls: A system generated property that specified the addressable path of the collections resource. :type colls: str @@ -5750,17 +7624,17 @@ class SqlDatabaseGetPropertiesResource(SqlDatabaseResource, ExtendedResourceProp """ _validation = { + 'id': {'required': True}, 'rid': {'readonly': True}, 'ts': {'readonly': True}, 'etag': {'readonly': True}, - 'id': {'required': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'rid': {'key': '_rid', 'type': 'str'}, 'ts': {'key': '_ts', 'type': 'float'}, 'etag': {'key': '_etag', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, 'colls': {'key': '_colls', 'type': 'str'}, 'users': {'key': '_users', 'type': 'str'}, } @@ -5770,14 +7644,14 @@ def __init__( **kwargs ): super(SqlDatabaseGetPropertiesResource, self).__init__(**kwargs) + self.id = kwargs['id'] + self.colls = kwargs.get('colls', None) + self.users = kwargs.get('users', None) self.rid = None self.ts = None self.etag = None self.colls = kwargs.get('colls', None) self.users = kwargs.get('users', None) - self.id = kwargs['id'] - self.colls = kwargs.get('colls', None) - self.users = kwargs.get('users', None) class SqlDatabaseGetResults(ARMResourceProperties): @@ -5800,6 +7674,8 @@ class SqlDatabaseGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource :param options: @@ -5818,6 +7694,7 @@ 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'}, } @@ -5856,6 +7733,122 @@ def __init__( self.value = None +class SqlDedicatedGatewayRegionalServiceResource(RegionalServiceResource): + """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. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "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 + ): + super(SqlDedicatedGatewayRegionalServiceResource, self).__init__(**kwargs) + self.sql_dedicated_gateway_endpoint = None + + +class SqlDedicatedGatewayServiceResource(msrest.serialization.Model): + """Describes the service response property for SqlDedicatedGateway. + + :param properties: Properties for SqlDedicatedGatewayServiceResource. + :type properties: ~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayServiceResourceProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'SqlDedicatedGatewayServiceResourceProperties'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlDedicatedGatewayServiceResource, self).__init__(**kwargs) + self.properties = kwargs.get('properties', None) + + +class SqlDedicatedGatewayServiceResourceProperties(ServiceResourceProperties): + """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 Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :param instance_size: Instance type for the service. Possible values include: "Cosmos.D4s", + "Cosmos.D8s", "Cosmos.D16s". + :type instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :param instance_count: Instance count for the service. + :type instance_count: int + :param service_type: Required. ServiceType for the service.Constant filled by server. Possible + values include: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute". + :type service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :param sql_dedicated_gateway_endpoint: SqlDedicatedGateway endpoint for the service. + :type sql_dedicated_gateway_endpoint: str + :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'}, + 'locations': {'key': 'locations', 'type': '[SqlDedicatedGatewayRegionalServiceResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(SqlDedicatedGatewayServiceResourceProperties, self).__init__(**kwargs) + self.service_type = 'SqlDedicatedGateway' # type: str + self.sql_dedicated_gateway_endpoint = kwargs.get('sql_dedicated_gateway_endpoint', None) + self.locations = None + + class SqlRoleAssignmentCreateUpdateParameters(msrest.serialization.Model): """Parameters to create and update an Azure Cosmos DB SQL Role Assignment. @@ -6096,6 +8089,8 @@ class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a storedProcedure. :type resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -6116,6 +8111,7 @@ class SqlStoredProcedureCreateUpdateParameters(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': 'SqlStoredProcedureResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -6225,6 +8221,8 @@ class SqlStoredProcedureGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource """ @@ -6241,6 +8239,7 @@ class SqlStoredProcedureGetResults(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': 'SqlStoredProcedureGetPropertiesResource'}, } @@ -6299,6 +8298,8 @@ class SqlTriggerCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a trigger. :type resource: ~azure.mgmt.cosmosdb.models.SqlTriggerResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -6319,6 +8320,7 @@ 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'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -6446,6 +8448,8 @@ class SqlTriggerGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource """ @@ -6462,6 +8466,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'}, } @@ -6520,6 +8525,8 @@ class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a userDefinedFunction. :type resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -6540,6 +8547,7 @@ class SqlUserDefinedFunctionCreateUpdateParameters(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': 'SqlUserDefinedFunctionResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -6649,6 +8657,8 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource """ @@ -6665,6 +8675,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'}, } @@ -6764,6 +8775,8 @@ class TableCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a Table. :type resource: ~azure.mgmt.cosmosdb.models.TableResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -6784,6 +8797,7 @@ 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'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -6907,6 +8921,8 @@ class TableGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource :param options: @@ -6925,6 +8941,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'}, } @@ -7103,6 +9120,8 @@ class ThroughputSettingsGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetPropertiesResource """ @@ -7119,6 +9138,7 @@ 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'}, } @@ -7152,6 +9172,8 @@ class ThroughputSettingsUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a resource throughput. :type resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsResource """ @@ -7169,6 +9191,7 @@ 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'}, } 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 3d33e0d4e0bd..191c20663de1 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 @@ -7,7 +7,7 @@ # -------------------------------------------------------------------------- import datetime -from typing import Dict, List, Optional, Union +from typing import Any, Dict, List, Optional, Union from azure.core.exceptions import HttpResponseError import msrest.serialization @@ -114,6 +114,8 @@ class ARMResourceProperties(msrest.serialization.Model): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity """ _validation = { @@ -128,6 +130,7 @@ class ARMResourceProperties(msrest.serialization.Model): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, } def __init__( @@ -135,6 +138,7 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, **kwargs ): super(ARMResourceProperties, self).__init__(**kwargs) @@ -143,6 +147,7 @@ def __init__( self.type = None self.location = location self.tags = tags + self.identity = identity class AutoscaleSettings(msrest.serialization.Model): @@ -326,6 +331,65 @@ def __init__( self.start_time = start_time +class BackupResource(ARMProxyResource): + """A restorable backup of a 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 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 + :param properties: + :type properties: ~azure.mgmt.cosmosdb.models.BackupResourceProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'BackupResourceProperties'}, + } + + def __init__( + self, + *, + properties: Optional["BackupResourceProperties"] = None, + **kwargs + ): + super(BackupResource, self).__init__(**kwargs) + self.properties = properties + + +class BackupResourceProperties(msrest.serialization.Model): + """BackupResourceProperties. + + :param timestamp: The time this backup was taken, formatted like 2021-01-21T17:35:21. + :type timestamp: ~datetime.datetime + """ + + _attribute_map = { + 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, + } + + def __init__( + self, + *, + timestamp: Optional[datetime.datetime] = None, + **kwargs + ): + super(BackupResourceProperties, self).__init__(**kwargs) + self.timestamp = timestamp + + class Capability(msrest.serialization.Model): """Cosmos DB capability object. @@ -370,6 +434,8 @@ class CassandraKeyspaceCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a Cassandra keyspace. :type resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -390,6 +456,7 @@ 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'}, } @@ -400,10 +467,11 @@ def __init__( resource: "CassandraKeyspaceResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(CassandraKeyspaceCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(CassandraKeyspaceCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -588,6 +656,8 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesResource :param options: @@ -606,6 +676,7 @@ 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'}, } @@ -615,11 +686,12 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["CassandraKeyspaceGetPropertiesResource"] = None, options: Optional["CassandraKeyspaceGetPropertiesOptions"] = None, **kwargs ): - super(CassandraKeyspaceGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(CassandraKeyspaceGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -723,6 +795,8 @@ class CassandraTableCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a Cassandra table. :type resource: ~azure.mgmt.cosmosdb.models.CassandraTableResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -743,6 +817,7 @@ 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'}, } @@ -753,10 +828,11 @@ def __init__( resource: "CassandraTableResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(CassandraTableCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(CassandraTableCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -908,6 +984,8 @@ class CassandraTableGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesResource :param options: @@ -926,6 +1004,7 @@ 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'}, } @@ -935,11 +1014,12 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["CassandraTableGetPropertiesResource"] = None, options: Optional["CassandraTableGetPropertiesOptions"] = None, **kwargs ): - super(CassandraTableGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(CassandraTableGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -969,670 +1049,2296 @@ def __init__( self.value = None -class ClusterKey(msrest.serialization.Model): - """Cosmos DB Cassandra table cluster key. +class CassandraViewCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB Cassandra view. - :param name: Name of the Cosmos DB Cassandra table cluster key. - :type name: str - :param order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and - "Desc". - :type order_by: str + 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 Azure. + + :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 + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param resource: Required. The standard JSON format of a Cassandra view. + :type resource: ~azure.mgmt.cosmosdb.models.CassandraViewResource + :param options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :type 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'}, - 'order_by': {'key': 'orderBy', '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'}, } def __init__( self, *, - name: Optional[str] = None, - order_by: Optional[str] = None, + resource: "CassandraViewResource", + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(ClusterKey, self).__init__(**kwargs) - self.name = name - self.order_by = order_by + super(CassandraViewCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + self.resource = resource + self.options = options -class Column(msrest.serialization.Model): - """Cosmos DB Cassandra table column. +class CassandraViewGetPropertiesOptions(OptionsResource): + """CassandraViewGetPropertiesOptions. - :param name: Name of the Cosmos DB Cassandra table column. - :type name: str - :param type: Type of the Cosmos DB Cassandra table column. - :type type: str + :param throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :type throughput: int + :param autoscale_settings: Specifies the Autoscale settings. + :type autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings """ _attribute_map = { - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, + 'throughput': {'key': 'throughput', 'type': 'int'}, + 'autoscale_settings': {'key': 'autoscaleSettings', 'type': 'AutoscaleSettings'}, } def __init__( self, *, - name: Optional[str] = None, - type: Optional[str] = None, + throughput: Optional[int] = None, + autoscale_settings: Optional["AutoscaleSettings"] = None, **kwargs ): - super(Column, self).__init__(**kwargs) - self.name = name - self.type = type + super(CassandraViewGetPropertiesOptions, self).__init__(throughput=throughput, autoscale_settings=autoscale_settings, **kwargs) -class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): - """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. +class CassandraViewResource(msrest.serialization.Model): + """Cosmos DB Cassandra view 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 Azure. - :ivar principal_id: The principal id of user assigned identity. - :vartype principal_id: str - :ivar client_id: The client id of user assigned identity. - :vartype client_id: str + :param id: Required. Name of the Cosmos DB Cassandra view. + :type id: str + :param view_definition: View Definition of the Cosmos DB Cassandra view. + :type view_definition: str """ _validation = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'view_definition': {'key': 'viewDefinition', 'type': 'str'}, } def __init__( self, + *, + id: str, + view_definition: Optional[str] = None, **kwargs ): - super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None + super(CassandraViewResource, self).__init__(**kwargs) + self.id = id + self.view_definition = view_definition -class CompositePath(msrest.serialization.Model): - """CompositePath. +class CassandraViewGetPropertiesResource(ExtendedResourceProperties, CassandraViewResource): + """CassandraViewGetPropertiesResource. - :param path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :type path: str - :param order: Sort order for composite paths. Possible values include: "ascending", - "descending". - :type order: str or ~azure.mgmt.cosmosdb.models.CompositePathSortOrder + 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 Azure. + + :param id: Required. Name of the Cosmos DB Cassandra view. + :type id: str + :param view_definition: View Definition of the Cosmos DB Cassandra view. + :type view_definition: str + :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 """ + _validation = { + 'id': {'required': True}, + 'rid': {'readonly': True}, + 'ts': {'readonly': True}, + 'etag': {'readonly': True}, + } + _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, - 'order': {'key': 'order', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'view_definition': {'key': 'viewDefinition', 'type': 'str'}, + 'rid': {'key': '_rid', 'type': 'str'}, + 'ts': {'key': '_ts', 'type': 'float'}, + 'etag': {'key': '_etag', 'type': 'str'}, } def __init__( self, *, - path: Optional[str] = None, - order: Optional[Union[str, "CompositePathSortOrder"]] = None, + id: str, + view_definition: Optional[str] = None, **kwargs ): - super(CompositePath, self).__init__(**kwargs) - self.path = path - self.order = order + super(CassandraViewGetPropertiesResource, self).__init__(id=id, view_definition=view_definition, **kwargs) + self.id = id + self.view_definition = view_definition + self.rid = None + self.ts = None + self.etag = None -class ConflictResolutionPolicy(msrest.serialization.Model): - """The conflict resolution policy for the container. +class CassandraViewGetResults(ARMResourceProperties): + """An Azure Cosmos DB Cassandra view. - :param mode: Indicates the conflict resolution mode. Possible values include: "LastWriterWins", - "Custom". Default value: "LastWriterWins". - :type mode: str or ~azure.mgmt.cosmosdb.models.ConflictResolutionMode - :param conflict_resolution_path: The conflict resolution path in the case of LastWriterWins - mode. - :type conflict_resolution_path: str - :param conflict_resolution_procedure: The procedure to resolve conflicts in the case of custom - mode. - :type conflict_resolution_procedure: str + 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 + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param resource: + :type resource: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesResource + :param options: + :type options: ~azure.mgmt.cosmosdb.models.CassandraViewGetPropertiesOptions """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + } + _attribute_map = { - 'mode': {'key': 'mode', 'type': 'str'}, - 'conflict_resolution_path': {'key': 'conflictResolutionPath', 'type': 'str'}, - 'conflict_resolution_procedure': {'key': 'conflictResolutionProcedure', 'type': 'str'}, + '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'}, } def __init__( self, *, - mode: Optional[Union[str, "ConflictResolutionMode"]] = "LastWriterWins", - conflict_resolution_path: Optional[str] = None, - conflict_resolution_procedure: Optional[str] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + resource: Optional["CassandraViewGetPropertiesResource"] = None, + options: Optional["CassandraViewGetPropertiesOptions"] = None, **kwargs ): - super(ConflictResolutionPolicy, self).__init__(**kwargs) - self.mode = mode - self.conflict_resolution_path = conflict_resolution_path - self.conflict_resolution_procedure = conflict_resolution_procedure + super(CassandraViewGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + self.resource = resource + self.options = options -class ConsistencyPolicy(msrest.serialization.Model): - """The consistency policy for the Cosmos DB database account. +class CassandraViewListResult(msrest.serialization.Model): + """The List operation response, that contains the Cassandra views and their properties. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param default_consistency_level: Required. The default consistency level and configuration - settings of the Cosmos DB account. Possible values include: "Eventual", "Session", - "BoundedStaleness", "Strong", "ConsistentPrefix". - :type default_consistency_level: str or ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel - :param max_staleness_prefix: When used with the Bounded Staleness consistency level, this value - represents the number of stale requests tolerated. Accepted range for this value is 1 – - 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. - :type max_staleness_prefix: long - :param max_interval_in_seconds: When used with the Bounded Staleness consistency level, this - value represents the time amount of staleness (in seconds) tolerated. Accepted range for this - value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. - :type max_interval_in_seconds: int + :ivar value: List of Cassandra views and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] """ _validation = { - 'default_consistency_level': {'required': True}, - 'max_staleness_prefix': {'maximum': 2147483647, 'minimum': 1}, - 'max_interval_in_seconds': {'maximum': 86400, 'minimum': 5}, + 'value': {'readonly': True}, } _attribute_map = { - 'default_consistency_level': {'key': 'defaultConsistencyLevel', 'type': 'str'}, - 'max_staleness_prefix': {'key': 'maxStalenessPrefix', 'type': 'long'}, - 'max_interval_in_seconds': {'key': 'maxIntervalInSeconds', 'type': 'int'}, + 'value': {'key': 'value', 'type': '[CassandraViewGetResults]'}, } def __init__( self, - *, - default_consistency_level: Union[str, "DefaultConsistencyLevel"], - max_staleness_prefix: Optional[int] = None, - max_interval_in_seconds: Optional[int] = None, **kwargs ): - super(ConsistencyPolicy, self).__init__(**kwargs) - self.default_consistency_level = default_consistency_level - self.max_staleness_prefix = max_staleness_prefix - self.max_interval_in_seconds = max_interval_in_seconds - + super(CassandraViewListResult, self).__init__(**kwargs) + self.value = None -class ContainerPartitionKey(msrest.serialization.Model): - """The configuration of the partition key to be used for partitioning data into multiple partitions. - Variables are only populated by the server, and will be ignored when sending a request. +class Certificate(msrest.serialization.Model): + """Certificate. - :param paths: List of paths using which data within the container can be partitioned. - :type paths: list[str] - :param kind: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple - partition keys (upto three maximum) are supported for container create. Possible values - include: "Hash", "Range", "MultiHash". Default value: "Hash". - :type kind: str or ~azure.mgmt.cosmosdb.models.PartitionKind - :param version: Indicates the version of the partition key definition. - :type version: int - :ivar system_key: Indicates if the container is using a system generated partition key. - :vartype system_key: bool + :param pem: PEM formatted public key. + :type pem: str """ - _validation = { - 'version': {'maximum': 2, 'minimum': 1}, - 'system_key': {'readonly': True}, - } - _attribute_map = { - 'paths': {'key': 'paths', 'type': '[str]'}, - 'kind': {'key': 'kind', 'type': 'str'}, - 'version': {'key': 'version', 'type': 'int'}, - 'system_key': {'key': 'systemKey', 'type': 'bool'}, + 'pem': {'key': 'pem', 'type': 'str'}, } def __init__( self, *, - paths: Optional[List[str]] = None, - kind: Optional[Union[str, "PartitionKind"]] = "Hash", - version: Optional[int] = None, + pem: Optional[str] = None, **kwargs ): - super(ContainerPartitionKey, self).__init__(**kwargs) - self.paths = paths - self.kind = kind - self.version = version - self.system_key = None + super(Certificate, self).__init__(**kwargs) + self.pem = pem -class ContinuousBackupInformation(msrest.serialization.Model): - """Information about the status of continuous backups. +class ClusterKey(msrest.serialization.Model): + """Cosmos DB Cassandra table cluster key. - :param latest_restorable_timestamp: The latest restorable timestamp for a resource. - :type latest_restorable_timestamp: str + :param name: Name of the Cosmos DB Cassandra table cluster key. + :type name: str + :param order_by: Order of the Cosmos DB Cassandra table cluster key, only support "Asc" and + "Desc". + :type order_by: str """ _attribute_map = { - 'latest_restorable_timestamp': {'key': 'latestRestorableTimestamp', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'order_by': {'key': 'orderBy', 'type': 'str'}, } def __init__( self, *, - latest_restorable_timestamp: Optional[str] = None, + name: Optional[str] = None, + order_by: Optional[str] = None, **kwargs ): - super(ContinuousBackupInformation, self).__init__(**kwargs) - self.latest_restorable_timestamp = latest_restorable_timestamp + super(ClusterKey, self).__init__(**kwargs) + self.name = name + self.order_by = order_by -class ContinuousBackupRestoreLocation(msrest.serialization.Model): - """Properties of the regional restorable account. +class ClusterNodeStatus(msrest.serialization.Model): + """The status of all nodes in the cluster (as returned by 'nodetool status'). - :param location: The name of the continuous backup restore location. - :type location: str + :param nodes: Information about nodes in the cluster (corresponds to what is returned from + nodetool info). + :type nodes: list[~azure.mgmt.cosmosdb.models.ClusterNodeStatusNodesItem] """ _attribute_map = { - 'location': {'key': 'location', 'type': 'str'}, + 'nodes': {'key': 'nodes', 'type': '[ClusterNodeStatusNodesItem]'}, } def __init__( self, *, - location: Optional[str] = None, + nodes: Optional[List["ClusterNodeStatusNodesItem"]] = None, **kwargs ): - super(ContinuousBackupRestoreLocation, self).__init__(**kwargs) - self.location = location - + super(ClusterNodeStatus, self).__init__(**kwargs) + self.nodes = nodes -class ContinuousModeBackupPolicy(BackupPolicy): - """The object representing continuous mode backup policy. - All required parameters must be populated in order to send to Azure. +class ClusterNodeStatusNodesItem(msrest.serialization.Model): + """ClusterNodeStatusNodesItem. - :param type: Required. Describes the mode of backups.Constant filled by server. Possible - values include: "Periodic", "Continuous". - :type type: str or ~azure.mgmt.cosmosdb.models.BackupPolicyType - :param migration_state: The object representing the state of the migration between the backup - policies. - :type migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState + :param datacenter: The Cassandra data center this node resides in. + :type datacenter: str + :param status: Indicates whether the node is functioning or not. Possible values include: "Up", + "Down". + :type status: str or ~azure.mgmt.cosmosdb.models.NodeStatus + :param state: The state of the node in relation to the cluster. Possible values include: + "Normal", "Leaving", "Joining", "Moving", "Stopped". + :type state: str or ~azure.mgmt.cosmosdb.models.NodeState + :param address: The node's URL. + :type address: str + :param load: The amount of file system data in the data directory (e.g., 47.66 KB), excluding + all content in the snapshots subdirectories. Because all SSTable data files are included, any + data that is not cleaned up (such as TTL-expired cell or tombstoned data) is counted. + :type load: str + :param tokens: List of tokens. + :type tokens: list[str] + :param owns: The percentage of the data owned by the node per datacenter times the replication + factor (e.g., 33.3, or null if the data is not available). For example, a node can own 33% of + the ring, but shows 100% if the replication factor is 3. For non-system keyspaces, the endpoint + percentage ownership information is shown. + :type owns: float + :param host_id: The network ID of the node. + :type host_id: str + :param rack: The rack this node is part of. + :type rack: str """ - _validation = { - 'type': {'required': True}, - } - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'migration_state': {'key': 'migrationState', 'type': 'BackupPolicyMigrationState'}, + 'datacenter': {'key': 'datacenter', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'state': {'key': 'state', 'type': 'str'}, + 'address': {'key': 'address', 'type': 'str'}, + 'load': {'key': 'load', 'type': 'str'}, + 'tokens': {'key': 'tokens', 'type': '[str]'}, + 'owns': {'key': 'owns', 'type': 'float'}, + 'host_id': {'key': 'hostId', 'type': 'str'}, + 'rack': {'key': 'rack', 'type': 'str'}, } def __init__( self, *, - migration_state: Optional["BackupPolicyMigrationState"] = None, + datacenter: Optional[str] = None, + status: Optional[Union[str, "NodeStatus"]] = None, + state: Optional[Union[str, "NodeState"]] = None, + address: Optional[str] = None, + load: Optional[str] = None, + tokens: Optional[List[str]] = None, + owns: Optional[float] = None, + host_id: Optional[str] = None, + rack: Optional[str] = None, **kwargs ): - super(ContinuousModeBackupPolicy, self).__init__(migration_state=migration_state, **kwargs) - self.type = 'Continuous' # type: str + super(ClusterNodeStatusNodesItem, self).__init__(**kwargs) + self.datacenter = datacenter + self.status = status + self.state = state + self.address = address + self.load = load + self.tokens = tokens + self.owns = owns + self.host_id = host_id + self.rack = rack -class CorsPolicy(msrest.serialization.Model): - """The CORS policy for the Cosmos DB database account. +class ClusterResource(ARMResourceProperties): + """Representation of a managed Cassandra cluster. - All required parameters must be populated in order to send to Azure. + Variables are only populated by the server, and will be ignored when sending a request. - :param allowed_origins: Required. The origin domains that are permitted to make a request - against the service via CORS. - :type allowed_origins: str - :param allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a - CORS request. - :type allowed_methods: str - :param allowed_headers: The request headers that the origin domain may specify on the CORS - request. - :type allowed_headers: str - :param 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. - :type exposed_headers: str - :param max_age_in_seconds: The maximum amount time that a browser should cache the preflight - OPTIONS request. - :type max_age_in_seconds: long + :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 + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param properties: Properties of a managed Cassandra cluster. + :type properties: ~azure.mgmt.cosmosdb.models.ClusterResourceProperties """ _validation = { - 'allowed_origins': {'required': True}, - 'max_age_in_seconds': {'maximum': 2147483647, 'minimum': 1}, + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _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': 'long'}, + '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'}, + 'properties': {'key': 'properties', 'type': 'ClusterResourceProperties'}, } 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, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + properties: Optional["ClusterResourceProperties"] = None, **kwargs ): - super(CorsPolicy, self).__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 + super(ClusterResource, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + self.properties = properties -class CreateUpdateOptions(msrest.serialization.Model): - """CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput". +class ClusterResourceProperties(msrest.serialization.Model): + """Properties of a managed Cassandra cluster. - :param throughput: Request Units per second. For example, "throughput": 10000. - :type throughput: int - :param autoscale_settings: Specifies the Autoscale settings. - :type autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + Variables are only populated by the server, and will be ignored when sending a request. + + :param provisioning_state: The status of the resource at the time the operation was called. + Possible values include: "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :type provisioning_state: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState + :param restore_from_backup_id: To create an empty cluster, omit this field or set it to null. + To restore a backup into a new cluster, set this field to the resource id of the backup. + :type restore_from_backup_id: str + :param delegated_management_subnet_id: Resource id of a subnet that this cluster's management + service should have its network interface attached to. The subnet must be routable to all + subnets that will be delegated to data centers. The resource id must be of the form + '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. + :type delegated_management_subnet_id: str + :param cassandra_version: Which version of Cassandra should this cluster converge to running + (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. + :type cassandra_version: str + :param cluster_name_override: If you need to set the clusterName property in cassandra.yaml to + something besides the resource name of the cluster, set the value to use on this property. + :type cluster_name_override: str + :param authentication_method: Which authentication method Cassandra should use to authenticate + clients. 'None' turns off authentication, so should not be used except in emergencies. + 'Cassandra' is the default password based authentication. The default is 'Cassandra'. Possible + values include: "None", "Cassandra". + :type authentication_method: str or ~azure.mgmt.cosmosdb.models.AuthenticationMethod + :param initial_cassandra_admin_password: Initial password for clients connecting as admin to + the cluster. Should be changed after cluster creation. Returns null on GET. This field only + applies when the authenticationMethod field is 'Cassandra'. + :type initial_cassandra_admin_password: str + :param hours_between_backups: Number of hours to wait between taking a backup of the cluster. + To disable backups, set this property to 0. + :type hours_between_backups: int + :param prometheus_endpoint: Hostname or IP address where the Prometheus endpoint containing + data about the managed Cassandra nodes can be reached. + :type prometheus_endpoint: ~azure.mgmt.cosmosdb.models.SeedNode + :param repair_enabled: Should automatic repairs run on this cluster? If omitted, this is true, + and should stay true unless you are running a hybrid cluster where you are already doing your + own repairs. + :type repair_enabled: bool + :param 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 + bearing a TLS client certificate that can be validated from one or more of the public + certificates in this property. + :type client_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] + :param external_gossip_certificates: List of TLS certificates used to authorize gossip from + unmanaged data centers. The TLS certificates of all nodes in unmanaged data centers must be + verifiable using one of the certificates provided in this property. + :type external_gossip_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] + :ivar gossip_certificates: List of TLS certificates that unmanaged nodes must trust for gossip + with managed nodes. All managed nodes will present TLS client certificates that are verifiable + using one of the certificates provided in this property. + :vartype gossip_certificates: list[~azure.mgmt.cosmosdb.models.Certificate] + :param 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. + :type external_seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] + :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] + """ + + _validation = { + 'gossip_certificates': {'readonly': True}, + 'seed_nodes': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'restore_from_backup_id': {'key': 'restoreFromBackupId', 'type': 'str'}, + 'delegated_management_subnet_id': {'key': 'delegatedManagementSubnetId', 'type': 'str'}, + 'cassandra_version': {'key': 'cassandraVersion', 'type': 'str'}, + 'cluster_name_override': {'key': 'clusterNameOverride', 'type': 'str'}, + 'authentication_method': {'key': 'authenticationMethod', 'type': 'str'}, + 'initial_cassandra_admin_password': {'key': 'initialCassandraAdminPassword', 'type': 'str'}, + 'hours_between_backups': {'key': 'hoursBetweenBackups', 'type': 'int'}, + 'prometheus_endpoint': {'key': 'prometheusEndpoint', 'type': 'SeedNode'}, + 'repair_enabled': {'key': 'repairEnabled', 'type': 'bool'}, + '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]'}, + } + + def __init__( + self, + *, + provisioning_state: Optional[Union[str, "ManagedCassandraProvisioningState"]] = None, + restore_from_backup_id: Optional[str] = None, + delegated_management_subnet_id: Optional[str] = None, + cassandra_version: Optional[str] = None, + cluster_name_override: Optional[str] = None, + authentication_method: Optional[Union[str, "AuthenticationMethod"]] = None, + initial_cassandra_admin_password: Optional[str] = None, + hours_between_backups: Optional[int] = None, + prometheus_endpoint: Optional["SeedNode"] = None, + repair_enabled: Optional[bool] = None, + client_certificates: Optional[List["Certificate"]] = None, + external_gossip_certificates: Optional[List["Certificate"]] = None, + external_seed_nodes: Optional[List["SeedNode"]] = None, + **kwargs + ): + super(ClusterResourceProperties, self).__init__(**kwargs) + self.provisioning_state = provisioning_state + self.restore_from_backup_id = restore_from_backup_id + self.delegated_management_subnet_id = delegated_management_subnet_id + self.cassandra_version = cassandra_version + self.cluster_name_override = cluster_name_override + self.authentication_method = authentication_method + self.initial_cassandra_admin_password = initial_cassandra_admin_password + self.hours_between_backups = hours_between_backups + self.prometheus_endpoint = prometheus_endpoint + self.repair_enabled = repair_enabled + 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 + + +class Column(msrest.serialization.Model): + """Cosmos DB Cassandra table column. + + :param name: Name of the Cosmos DB Cassandra table column. + :type name: str + :param type: Type of the Cosmos DB Cassandra table column. + :type type: str """ _attribute_map = { - 'throughput': {'key': 'throughput', 'type': 'int'}, - 'autoscale_settings': {'key': 'autoscaleSettings', 'type': 'AutoscaleSettings'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, } def __init__( self, *, - throughput: Optional[int] = None, - autoscale_settings: Optional["AutoscaleSettings"] = None, + name: Optional[str] = None, + type: Optional[str] = None, **kwargs ): - super(CreateUpdateOptions, self).__init__(**kwargs) - self.throughput = throughput - self.autoscale_settings = autoscale_settings + super(Column, self).__init__(**kwargs) + self.name = name + self.type = type -class DatabaseAccountConnectionString(msrest.serialization.Model): - """Connection string for the Cosmos DB account. +class Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties(msrest.serialization.Model): + """Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties. Variables are only populated by the server, and will be ignored when sending a request. - :ivar connection_string: Value of the connection string. - :vartype connection_string: str - :ivar description: Description of the connection string. - :vartype description: str + :ivar principal_id: The principal id of user assigned identity. + :vartype principal_id: str + :ivar client_id: The client id of user assigned identity. + :vartype client_id: str """ _validation = { - 'connection_string': {'readonly': True}, - 'description': {'readonly': True}, + 'principal_id': {'readonly': True}, + 'client_id': {'readonly': True}, } _attribute_map = { - 'connection_string': {'key': 'connectionString', 'type': 'str'}, - 'description': {'key': 'description', 'type': 'str'}, + 'principal_id': {'key': 'principalId', 'type': 'str'}, + 'client_id': {'key': 'clientId', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DatabaseAccountConnectionString, self).__init__(**kwargs) - self.connection_string = None - self.description = None + super(Components1Jq1T4ISchemasManagedserviceidentityPropertiesUserassignedidentitiesAdditionalproperties, self).__init__(**kwargs) + self.principal_id = None + self.client_id = None -class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): - """Parameters to create and update Cosmos DB database accounts. +class CompositePath(msrest.serialization.Model): + """CompositePath. + + :param path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :type path: str + :param order: Sort order for composite paths. Possible values include: "ascending", + "descending". + :type order: str or ~azure.mgmt.cosmosdb.models.CompositePathSortOrder + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + 'order': {'key': 'order', 'type': 'str'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + order: Optional[Union[str, "CompositePathSortOrder"]] = None, + **kwargs + ): + super(CompositePath, self).__init__(**kwargs) + self.path = path + self.order = order + + +class ConflictResolutionPolicy(msrest.serialization.Model): + """The conflict resolution policy for the container. + + :param mode: Indicates the conflict resolution mode. Possible values include: "LastWriterWins", + "Custom". Default value: "LastWriterWins". + :type mode: str or ~azure.mgmt.cosmosdb.models.ConflictResolutionMode + :param conflict_resolution_path: The conflict resolution path in the case of LastWriterWins + mode. + :type conflict_resolution_path: str + :param conflict_resolution_procedure: The procedure to resolve conflicts in the case of custom + mode. + :type conflict_resolution_procedure: str + """ + + _attribute_map = { + 'mode': {'key': 'mode', 'type': 'str'}, + 'conflict_resolution_path': {'key': 'conflictResolutionPath', 'type': 'str'}, + 'conflict_resolution_procedure': {'key': 'conflictResolutionProcedure', 'type': 'str'}, + } + + def __init__( + self, + *, + mode: Optional[Union[str, "ConflictResolutionMode"]] = "LastWriterWins", + conflict_resolution_path: Optional[str] = None, + conflict_resolution_procedure: Optional[str] = None, + **kwargs + ): + super(ConflictResolutionPolicy, self).__init__(**kwargs) + self.mode = mode + self.conflict_resolution_path = conflict_resolution_path + self.conflict_resolution_procedure = conflict_resolution_procedure + + +class ConsistencyPolicy(msrest.serialization.Model): + """The consistency policy for the Cosmos DB database account. + + All required parameters must be populated in order to send to Azure. + + :param default_consistency_level: Required. The default consistency level and configuration + settings of the Cosmos DB account. Possible values include: "Eventual", "Session", + "BoundedStaleness", "Strong", "ConsistentPrefix". + :type default_consistency_level: str or ~azure.mgmt.cosmosdb.models.DefaultConsistencyLevel + :param max_staleness_prefix: When used with the Bounded Staleness consistency level, this value + represents the number of stale requests tolerated. Accepted range for this value is 1 – + 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :type max_staleness_prefix: long + :param max_interval_in_seconds: When used with the Bounded Staleness consistency level, this + value represents the time amount of staleness (in seconds) tolerated. Accepted range for this + value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'. + :type max_interval_in_seconds: int + """ + + _validation = { + 'default_consistency_level': {'required': True}, + 'max_staleness_prefix': {'maximum': 2147483647, 'minimum': 1}, + 'max_interval_in_seconds': {'maximum': 86400, 'minimum': 5}, + } + + _attribute_map = { + 'default_consistency_level': {'key': 'defaultConsistencyLevel', 'type': 'str'}, + 'max_staleness_prefix': {'key': 'maxStalenessPrefix', 'type': 'long'}, + 'max_interval_in_seconds': {'key': 'maxIntervalInSeconds', 'type': 'int'}, + } + + def __init__( + self, + *, + default_consistency_level: Union[str, "DefaultConsistencyLevel"], + max_staleness_prefix: Optional[int] = None, + max_interval_in_seconds: Optional[int] = None, + **kwargs + ): + super(ConsistencyPolicy, self).__init__(**kwargs) + self.default_consistency_level = default_consistency_level + self.max_staleness_prefix = max_staleness_prefix + self.max_interval_in_seconds = max_interval_in_seconds + + +class ContainerPartitionKey(msrest.serialization.Model): + """The configuration of the partition key to be used for partitioning data into multiple partitions. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param paths: List of paths using which data within the container can be partitioned. + :type paths: list[str] + :param kind: Indicates the kind of algorithm used for partitioning. For MultiHash, multiple + partition keys (upto three maximum) are supported for container create. Possible values + include: "Hash", "Range", "MultiHash". Default value: "Hash". + :type kind: str or ~azure.mgmt.cosmosdb.models.PartitionKind + :param version: Indicates the version of the partition key definition. + :type version: int + :ivar system_key: Indicates if the container is using a system generated partition key. + :vartype system_key: bool + """ + + _validation = { + 'version': {'maximum': 2, 'minimum': 1}, + 'system_key': {'readonly': True}, + } + + _attribute_map = { + 'paths': {'key': 'paths', 'type': '[str]'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'version': {'key': 'version', 'type': 'int'}, + 'system_key': {'key': 'systemKey', 'type': 'bool'}, + } + + def __init__( + self, + *, + paths: Optional[List[str]] = None, + kind: Optional[Union[str, "PartitionKind"]] = "Hash", + version: Optional[int] = None, + **kwargs + ): + super(ContainerPartitionKey, self).__init__(**kwargs) + self.paths = paths + self.kind = kind + self.version = version + self.system_key = None + + +class ContinuousBackupInformation(msrest.serialization.Model): + """Information about the status of continuous backups. + + :param latest_restorable_timestamp: The latest restorable timestamp for a resource. + :type latest_restorable_timestamp: str + """ + + _attribute_map = { + 'latest_restorable_timestamp': {'key': 'latestRestorableTimestamp', 'type': 'str'}, + } + + def __init__( + self, + *, + latest_restorable_timestamp: Optional[str] = None, + **kwargs + ): + super(ContinuousBackupInformation, self).__init__(**kwargs) + self.latest_restorable_timestamp = latest_restorable_timestamp + + +class ContinuousBackupRestoreLocation(msrest.serialization.Model): + """Properties of the regional restorable account. + + :param location: The name of the continuous backup restore location. + :type location: str + """ + + _attribute_map = { + 'location': {'key': 'location', 'type': 'str'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + **kwargs + ): + super(ContinuousBackupRestoreLocation, self).__init__(**kwargs) + self.location = location + + +class ContinuousModeBackupPolicy(BackupPolicy): + """The object representing continuous mode backup policy. + + All required parameters must be populated in order to send to Azure. + + :param type: Required. Describes the mode of backups.Constant filled by server. Possible + values include: "Periodic", "Continuous". + :type type: str or ~azure.mgmt.cosmosdb.models.BackupPolicyType + :param migration_state: The object representing the state of the migration between the backup + policies. + :type migration_state: ~azure.mgmt.cosmosdb.models.BackupPolicyMigrationState + """ + + _validation = { + 'type': {'required': True}, + } + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + 'migration_state': {'key': 'migrationState', 'type': 'BackupPolicyMigrationState'}, + } + + def __init__( + self, + *, + migration_state: Optional["BackupPolicyMigrationState"] = None, + **kwargs + ): + super(ContinuousModeBackupPolicy, self).__init__(migration_state=migration_state, **kwargs) + self.type = 'Continuous' # type: str + + +class CorsPolicy(msrest.serialization.Model): + """The CORS policy for the Cosmos DB database account. + + All required parameters must be populated in order to send to Azure. + + :param allowed_origins: Required. The origin domains that are permitted to make a request + against the service via CORS. + :type allowed_origins: str + :param allowed_methods: The methods (HTTP request verbs) that the origin domain may use for a + CORS request. + :type allowed_methods: str + :param allowed_headers: The request headers that the origin domain may specify on the CORS + request. + :type allowed_headers: str + :param 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. + :type exposed_headers: str + :param max_age_in_seconds: The maximum amount time that a browser should cache the preflight + OPTIONS request. + :type max_age_in_seconds: long + """ + + _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': 'long'}, + } + + 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 + ): + super(CorsPolicy, self).__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 CreateUpdateOptions(msrest.serialization.Model): + """CreateUpdateOptions are a list of key-value pairs that describe the resource. Supported keys are "If-Match", "If-None-Match", "Session-Token" and "Throughput". + + :param throughput: Request Units per second. For example, "throughput": 10000. + :type throughput: int + :param autoscale_settings: Specifies the Autoscale settings. + :type autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings + """ + + _attribute_map = { + 'throughput': {'key': 'throughput', 'type': 'int'}, + 'autoscale_settings': {'key': 'autoscaleSettings', 'type': 'AutoscaleSettings'}, + } + + def __init__( + self, + *, + throughput: Optional[int] = None, + autoscale_settings: Optional["AutoscaleSettings"] = None, + **kwargs + ): + super(CreateUpdateOptions, self).__init__(**kwargs) + self.throughput = throughput + self.autoscale_settings = autoscale_settings + + +class DatabaseAccountConnectionString(msrest.serialization.Model): + """Connection string for the Cosmos DB account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar connection_string: Value of the connection string. + :vartype connection_string: str + :ivar description: Description of the connection string. + :vartype description: str + """ + + _validation = { + 'connection_string': {'readonly': True}, + 'description': {'readonly': True}, + } + + _attribute_map = { + 'connection_string': {'key': 'connectionString', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountConnectionString, self).__init__(**kwargs) + self.connection_string = None + self.description = None + + +class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): + """Parameters to create and update Cosmos DB database accounts. + + 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 Azure. + + :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 + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param kind: Indicates the type of database account. This can only be set at database account + creation. Possible values include: "GlobalDocumentDB", "MongoDB", "Parse". + :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :param consistency_policy: The consistency policy for the Cosmos DB account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param locations: Required. An array that contains the georeplication locations enabled for the + Cosmos DB account. + :type locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar database_account_offer_type: The offer type for the database. Has constant value: + "Standard". + :vartype database_account_offer_type: str + :param ip_rules: List of IpRules. + :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :type is_virtual_network_filter_enabled: bool + :param enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :type enable_automatic_failover: bool + :param capabilities: List of Cosmos DB capabilities for the account. + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :param enable_multiple_write_locations: Enables the account to write in multiple locations. + :type enable_multiple_write_locations: bool + :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. + :type enable_cassandra_connector: bool + :param connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. Possible values include: "Small". + :type connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :param disable_key_based_metadata_write_access: Disable write operations on metadata resources + (databases, containers, throughput) via account keys. + :type disable_key_based_metadata_write_access: bool + :param key_vault_key_uri: The URI of the key vault. + :type key_vault_key_uri: str + :param default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :type default_identity: str + :param public_network_access: Whether requests from Public Network are allowed. Possible values + include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :param enable_free_tier: Flag to indicate whether Free Tier is enabled. + :type enable_free_tier: bool + :param api_properties: API specific properties. Currently, supported only for MongoDB API. + :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :type enable_analytical_storage: bool + :param analytical_storage_configuration: Analytical storage specific properties. + :type analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :param create_mode: Required. Enum to indicate the mode of account creation.Constant filled by + server. Possible values include: "Default", "Restore". Default value: "Default". + :type create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :param backup_policy: The object representing the policy for taking backups on an account. + :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :param cors: The CORS policy for the Cosmos DB database account. + :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. + Possible values include: "None", "AzureServices". + :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl + Bypass for the Cosmos DB account. + :type network_acl_bypass_resource_ids: list[str] + :param diagnostic_log_settings: The Object representing the different Diagnostic log settings + for the Cosmos DB Account. + :type diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings + :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :type disable_local_auth: bool + :param restore_parameters: Parameters to indicate the information about the restore. + :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'locations': {'required': True}, + 'database_account_offer_type': {'required': True, 'constant': True}, + 'create_mode': {'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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'locations': {'key': 'properties.locations', 'type': '[Location]'}, + 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, + 'ip_rules': {'key': 'properties.ipRules', 'type': '[IpAddressOrRange]'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, + 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'}, + 'enable_cassandra_connector': {'key': 'properties.enableCassandraConnector', 'type': 'bool'}, + 'connector_offer': {'key': 'properties.connectorOffer', 'type': 'str'}, + 'disable_key_based_metadata_write_access': {'key': 'properties.disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, + 'key_vault_key_uri': {'key': 'properties.keyVaultKeyUri', 'type': 'str'}, + 'default_identity': {'key': 'properties.defaultIdentity', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, + 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, + 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, + 'analytical_storage_configuration': {'key': 'properties.analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, + 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, + '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'}, + } + + database_account_offer_type = "Standard" + + def __init__( + self, + *, + locations: List["Location"], + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + kind: Optional[Union[str, "DatabaseAccountKind"]] = None, + consistency_policy: Optional["ConsistencyPolicy"] = None, + ip_rules: Optional[List["IpAddressOrRange"]] = None, + is_virtual_network_filter_enabled: Optional[bool] = None, + enable_automatic_failover: Optional[bool] = None, + capabilities: Optional[List["Capability"]] = None, + virtual_network_rules: Optional[List["VirtualNetworkRule"]] = None, + enable_multiple_write_locations: Optional[bool] = None, + enable_cassandra_connector: Optional[bool] = None, + connector_offer: Optional[Union[str, "ConnectorOffer"]] = None, + disable_key_based_metadata_write_access: Optional[bool] = None, + key_vault_key_uri: Optional[str] = None, + default_identity: Optional[str] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + enable_free_tier: Optional[bool] = None, + api_properties: Optional["ApiProperties"] = None, + enable_analytical_storage: Optional[bool] = None, + analytical_storage_configuration: Optional["AnalyticalStorageConfiguration"] = None, + backup_policy: Optional["BackupPolicy"] = None, + cors: Optional[List["CorsPolicy"]] = None, + network_acl_bypass: Optional[Union[str, "NetworkAclBypass"]] = None, + network_acl_bypass_resource_ids: Optional[List[str]] = None, + diagnostic_log_settings: Optional["DiagnosticLogSettings"] = None, + disable_local_auth: Optional[bool] = None, + restore_parameters: Optional["RestoreParameters"] = None, + **kwargs + ): + super(DatabaseAccountCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + self.kind = kind + self.consistency_policy = consistency_policy + self.locations = locations + self.ip_rules = ip_rules + self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled + self.enable_automatic_failover = enable_automatic_failover + self.capabilities = capabilities + self.virtual_network_rules = virtual_network_rules + self.enable_multiple_write_locations = enable_multiple_write_locations + self.enable_cassandra_connector = enable_cassandra_connector + self.connector_offer = connector_offer + self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access + self.key_vault_key_uri = key_vault_key_uri + self.default_identity = default_identity + self.public_network_access = public_network_access + self.enable_free_tier = enable_free_tier + self.api_properties = api_properties + self.enable_analytical_storage = enable_analytical_storage + self.analytical_storage_configuration = analytical_storage_configuration + self.create_mode = None # type: Optional[str] + self.backup_policy = backup_policy + 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 + + +class DatabaseAccountCreateUpdateProperties(msrest.serialization.Model): + """Properties to create and update Azure Cosmos DB database accounts. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DefaultRequestDatabaseAccountCreateUpdateProperties. + + 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 Azure. + + :param consistency_policy: The consistency policy for the Cosmos DB account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param locations: Required. An array that contains the georeplication locations enabled for the + Cosmos DB account. + :type locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar database_account_offer_type: The offer type for the database. Has constant value: + "Standard". + :vartype database_account_offer_type: str + :param ip_rules: List of IpRules. + :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :type is_virtual_network_filter_enabled: bool + :param enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :type enable_automatic_failover: bool + :param capabilities: List of Cosmos DB capabilities for the account. + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :param enable_multiple_write_locations: Enables the account to write in multiple locations. + :type enable_multiple_write_locations: bool + :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. + :type enable_cassandra_connector: bool + :param connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. Possible values include: "Small". + :type connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :param disable_key_based_metadata_write_access: Disable write operations on metadata resources + (databases, containers, throughput) via account keys. + :type disable_key_based_metadata_write_access: bool + :param key_vault_key_uri: The URI of the key vault. + :type key_vault_key_uri: str + :param default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :type default_identity: str + :param public_network_access: Whether requests from Public Network are allowed. Possible values + include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :param enable_free_tier: Flag to indicate whether Free Tier is enabled. + :type enable_free_tier: bool + :param api_properties: API specific properties. Currently, supported only for MongoDB API. + :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :type enable_analytical_storage: bool + :param analytical_storage_configuration: Analytical storage specific properties. + :type analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :param create_mode: Required. Enum to indicate the mode of account creation.Constant filled by + server. Possible values include: "Default", "Restore". Default value: "Default". + :type create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :param backup_policy: The object representing the policy for taking backups on an account. + :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :param cors: The CORS policy for the Cosmos DB database account. + :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. + Possible values include: "None", "AzureServices". + :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl + Bypass for the Cosmos DB account. + :type network_acl_bypass_resource_ids: list[str] + :param diagnostic_log_settings: The Object representing the different Diagnostic log settings + for the Cosmos DB Account. + :type diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings + :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :type disable_local_auth: bool + :param restore_parameters: Parameters to indicate the information about the restore. + :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + """ + + _validation = { + 'locations': {'required': True}, + 'database_account_offer_type': {'required': True, 'constant': True}, + 'create_mode': {'required': True}, + } + + _attribute_map = { + 'consistency_policy': {'key': 'consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'locations': {'key': 'locations', 'type': '[Location]'}, + 'database_account_offer_type': {'key': 'databaseAccountOfferType', 'type': 'str'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IpAddressOrRange]'}, + 'is_virtual_network_filter_enabled': {'key': 'isVirtualNetworkFilterEnabled', 'type': 'bool'}, + 'enable_automatic_failover': {'key': 'enableAutomaticFailover', 'type': 'bool'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'enable_multiple_write_locations': {'key': 'enableMultipleWriteLocations', 'type': 'bool'}, + 'enable_cassandra_connector': {'key': 'enableCassandraConnector', 'type': 'bool'}, + 'connector_offer': {'key': 'connectorOffer', 'type': 'str'}, + 'disable_key_based_metadata_write_access': {'key': 'disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, + 'key_vault_key_uri': {'key': 'keyVaultKeyUri', 'type': 'str'}, + 'default_identity': {'key': 'defaultIdentity', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'enable_free_tier': {'key': 'enableFreeTier', 'type': 'bool'}, + 'api_properties': {'key': 'apiProperties', 'type': 'ApiProperties'}, + 'enable_analytical_storage': {'key': 'enableAnalyticalStorage', 'type': 'bool'}, + 'analytical_storage_configuration': {'key': 'analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'backup_policy': {'key': 'backupPolicy', 'type': 'BackupPolicy'}, + 'cors': {'key': 'cors', 'type': '[CorsPolicy]'}, + 'network_acl_bypass': {'key': 'networkAclBypass', 'type': 'str'}, + 'network_acl_bypass_resource_ids': {'key': 'networkAclBypassResourceIds', 'type': '[str]'}, + 'diagnostic_log_settings': {'key': 'diagnosticLogSettings', 'type': 'DiagnosticLogSettings'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + 'restore_parameters': {'key': 'restoreParameters', 'type': 'RestoreParameters'}, + } + + _subtype_map = { + 'create_mode': {'Default': 'DefaultRequestDatabaseAccountCreateUpdateProperties'} + } + + database_account_offer_type = "Standard" + + def __init__( + self, + *, + locations: List["Location"], + consistency_policy: Optional["ConsistencyPolicy"] = None, + ip_rules: Optional[List["IpAddressOrRange"]] = None, + is_virtual_network_filter_enabled: Optional[bool] = None, + enable_automatic_failover: Optional[bool] = None, + capabilities: Optional[List["Capability"]] = None, + virtual_network_rules: Optional[List["VirtualNetworkRule"]] = None, + enable_multiple_write_locations: Optional[bool] = None, + enable_cassandra_connector: Optional[bool] = None, + connector_offer: Optional[Union[str, "ConnectorOffer"]] = None, + disable_key_based_metadata_write_access: Optional[bool] = None, + key_vault_key_uri: Optional[str] = None, + default_identity: Optional[str] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + enable_free_tier: Optional[bool] = None, + api_properties: Optional["ApiProperties"] = None, + enable_analytical_storage: Optional[bool] = None, + analytical_storage_configuration: Optional["AnalyticalStorageConfiguration"] = None, + backup_policy: Optional["BackupPolicy"] = None, + cors: Optional[List["CorsPolicy"]] = None, + network_acl_bypass: Optional[Union[str, "NetworkAclBypass"]] = None, + network_acl_bypass_resource_ids: Optional[List[str]] = None, + diagnostic_log_settings: Optional["DiagnosticLogSettings"] = None, + disable_local_auth: Optional[bool] = None, + restore_parameters: Optional["RestoreParameters"] = None, + **kwargs + ): + super(DatabaseAccountCreateUpdateProperties, self).__init__(**kwargs) + self.consistency_policy = consistency_policy + self.locations = locations + self.ip_rules = ip_rules + self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled + self.enable_automatic_failover = enable_automatic_failover + self.capabilities = capabilities + self.virtual_network_rules = virtual_network_rules + self.enable_multiple_write_locations = enable_multiple_write_locations + self.enable_cassandra_connector = enable_cassandra_connector + self.connector_offer = connector_offer + self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access + self.key_vault_key_uri = key_vault_key_uri + self.default_identity = default_identity + self.public_network_access = public_network_access + self.enable_free_tier = enable_free_tier + self.api_properties = api_properties + self.enable_analytical_storage = enable_analytical_storage + self.analytical_storage_configuration = analytical_storage_configuration + self.create_mode = None # type: Optional[str] + self.backup_policy = backup_policy + 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 + + +class DatabaseAccountGetResults(ARMResourceProperties): + """An Azure Cosmos DB database account. + + 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 + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param kind: Indicates the type of database account. This can only be set at database account + creation. Possible values include: "GlobalDocumentDB", "MongoDB", "Parse". + :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind + :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 + called. The status can be one of following. 'Creating' – the Cosmos DB account is being + created. When an account is in Creating state, only properties that are specified as input for + the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is + active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB + account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – + the Cosmos DB account deletion failed. + :vartype provisioning_state: str + :ivar document_endpoint: The connection endpoint for the Cosmos DB database account. + :vartype document_endpoint: str + :ivar database_account_offer_type: The offer type for the Cosmos DB database account. Default + value: Standard. The only acceptable values to pass in are None and "Standard". The default + value is None. + :vartype database_account_offer_type: str + :param ip_rules: List of IpRules. + :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :type is_virtual_network_filter_enabled: bool + :param enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :type enable_automatic_failover: bool + :param consistency_policy: The consistency policy for the Cosmos DB database account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param capabilities: List of Cosmos DB capabilities for the account. + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :ivar write_locations: An array that contains the write location for the Cosmos DB account. + :vartype write_locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar read_locations: An array that contains of the read locations enabled for the Cosmos DB + account. + :vartype read_locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar locations: An array that contains all of the locations enabled for the Cosmos DB account. + :vartype locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar failover_policies: An array that contains the regions ordered by their failover + priorities. + :vartype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :ivar private_endpoint_connections: List of Private Endpoint Connections configured for the + Cosmos DB account. + :vartype private_endpoint_connections: + list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection] + :param enable_multiple_write_locations: Enables the account to write in multiple locations. + :type enable_multiple_write_locations: bool + :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. + :type enable_cassandra_connector: bool + :param connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. Possible values include: "Small". + :type connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :param disable_key_based_metadata_write_access: Disable write operations on metadata resources + (databases, containers, throughput) via account keys. + :type disable_key_based_metadata_write_access: bool + :param key_vault_key_uri: The URI of the key vault. + :type key_vault_key_uri: str + :param default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :type default_identity: str + :param public_network_access: Whether requests from Public Network are allowed. Possible values + include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :param enable_free_tier: Flag to indicate whether Free Tier is enabled. + :type enable_free_tier: bool + :param api_properties: API specific properties. + :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :type enable_analytical_storage: bool + :param analytical_storage_configuration: Analytical storage specific properties. + :type analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :ivar instance_id: A unique identifier assigned to the database account. + :vartype instance_id: str + :param create_mode: Enum to indicate the mode of account creation. Possible values include: + "Default", "Restore". Default value: "Default". + :type create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :param restore_parameters: Parameters to indicate the information about the restore. + :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + :param backup_policy: The object representing the policy for taking backups on an account. + :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :param cors: The CORS policy for the Cosmos DB database account. + :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. + Possible values include: "None", "AzureServices". + :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl + Bypass for the Cosmos DB account. + :type network_acl_bypass_resource_ids: list[str] + :param diagnostic_log_settings: The Object representing the different Diagnostic log settings + for the Cosmos DB Account. + :type diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings + :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :type disable_local_auth: bool + """ + + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'system_data': {'readonly': True}, + 'provisioning_state': {'readonly': True}, + 'document_endpoint': {'readonly': True}, + 'database_account_offer_type': {'readonly': True}, + 'write_locations': {'readonly': True}, + 'read_locations': {'readonly': True}, + 'locations': {'readonly': True}, + 'failover_policies': {'readonly': True}, + 'private_endpoint_connections': {'readonly': True}, + 'instance_id': {'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'}, + 'kind': {'key': 'kind', 'type': 'str'}, + 'system_data': {'key': 'systemData', 'type': 'SystemData'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'document_endpoint': {'key': 'properties.documentEndpoint', 'type': 'str'}, + 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, + 'ip_rules': {'key': 'properties.ipRules', 'type': '[IpAddressOrRange]'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, + 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, + 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + 'write_locations': {'key': 'properties.writeLocations', 'type': '[Location]'}, + 'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'}, + 'locations': {'key': 'properties.locations', 'type': '[Location]'}, + 'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, + 'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'}, + 'enable_cassandra_connector': {'key': 'properties.enableCassandraConnector', 'type': 'bool'}, + 'connector_offer': {'key': 'properties.connectorOffer', 'type': 'str'}, + 'disable_key_based_metadata_write_access': {'key': 'properties.disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, + 'key_vault_key_uri': {'key': 'properties.keyVaultKeyUri', 'type': 'str'}, + 'default_identity': {'key': 'properties.defaultIdentity', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, + 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, + 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, + 'analytical_storage_configuration': {'key': 'properties.analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, + 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, + 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, + 'restore_parameters': {'key': 'properties.restoreParameters', 'type': 'RestoreParameters'}, + 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, + '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'}, + } + + def __init__( + self, + *, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + kind: Optional[Union[str, "DatabaseAccountKind"]] = None, + ip_rules: Optional[List["IpAddressOrRange"]] = None, + is_virtual_network_filter_enabled: Optional[bool] = None, + enable_automatic_failover: Optional[bool] = None, + consistency_policy: Optional["ConsistencyPolicy"] = None, + capabilities: Optional[List["Capability"]] = None, + virtual_network_rules: Optional[List["VirtualNetworkRule"]] = None, + enable_multiple_write_locations: Optional[bool] = None, + enable_cassandra_connector: Optional[bool] = None, + connector_offer: Optional[Union[str, "ConnectorOffer"]] = None, + disable_key_based_metadata_write_access: Optional[bool] = None, + key_vault_key_uri: Optional[str] = None, + default_identity: Optional[str] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + enable_free_tier: Optional[bool] = None, + api_properties: Optional["ApiProperties"] = None, + enable_analytical_storage: Optional[bool] = None, + analytical_storage_configuration: Optional["AnalyticalStorageConfiguration"] = None, + create_mode: Optional[Union[str, "CreateMode"]] = "Default", + restore_parameters: Optional["RestoreParameters"] = None, + backup_policy: Optional["BackupPolicy"] = None, + cors: Optional[List["CorsPolicy"]] = None, + network_acl_bypass: Optional[Union[str, "NetworkAclBypass"]] = None, + network_acl_bypass_resource_ids: Optional[List[str]] = None, + diagnostic_log_settings: Optional["DiagnosticLogSettings"] = None, + disable_local_auth: Optional[bool] = None, + **kwargs + ): + super(DatabaseAccountGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + self.kind = kind + self.system_data = None + self.provisioning_state = None + self.document_endpoint = None + self.database_account_offer_type = None + self.ip_rules = ip_rules + self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled + self.enable_automatic_failover = enable_automatic_failover + self.consistency_policy = consistency_policy + self.capabilities = capabilities + self.write_locations = None + self.read_locations = None + self.locations = None + self.failover_policies = None + self.virtual_network_rules = virtual_network_rules + self.private_endpoint_connections = None + self.enable_multiple_write_locations = enable_multiple_write_locations + self.enable_cassandra_connector = enable_cassandra_connector + self.connector_offer = connector_offer + self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access + self.key_vault_key_uri = key_vault_key_uri + self.default_identity = default_identity + self.public_network_access = public_network_access + self.enable_free_tier = enable_free_tier + self.api_properties = api_properties + self.enable_analytical_storage = enable_analytical_storage + self.analytical_storage_configuration = analytical_storage_configuration + self.instance_id = None + self.create_mode = create_mode + self.restore_parameters = restore_parameters + self.backup_policy = backup_policy + 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 + + +class DatabaseAccountListConnectionStringsResult(msrest.serialization.Model): + """The connection strings for the given database account. + + :param connection_strings: An array that contains the connection strings for the Cosmos DB + account. + :type connection_strings: list[~azure.mgmt.cosmosdb.models.DatabaseAccountConnectionString] + """ + + _attribute_map = { + 'connection_strings': {'key': 'connectionStrings', 'type': '[DatabaseAccountConnectionString]'}, + } + + def __init__( + self, + *, + connection_strings: Optional[List["DatabaseAccountConnectionString"]] = None, + **kwargs + ): + super(DatabaseAccountListConnectionStringsResult, self).__init__(**kwargs) + self.connection_strings = connection_strings + + +class DatabaseAccountListReadOnlyKeysResult(msrest.serialization.Model): + """The read-only access keys for the given database account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. + :vartype primary_readonly_master_key: str + :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. + :vartype secondary_readonly_master_key: str + """ + + _validation = { + 'primary_readonly_master_key': {'readonly': True}, + 'secondary_readonly_master_key': {'readonly': True}, + } + + _attribute_map = { + 'primary_readonly_master_key': {'key': 'primaryReadonlyMasterKey', 'type': 'str'}, + 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountListReadOnlyKeysResult, self).__init__(**kwargs) + self.primary_readonly_master_key = None + self.secondary_readonly_master_key = None + + +class DatabaseAccountListKeysResult(DatabaseAccountListReadOnlyKeysResult): + """The access keys for the given database account. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. + :vartype primary_readonly_master_key: str + :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. + :vartype secondary_readonly_master_key: str + :ivar primary_master_key: Base 64 encoded value of the primary read-write key. + :vartype primary_master_key: str + :ivar secondary_master_key: Base 64 encoded value of the secondary read-write key. + :vartype secondary_master_key: str + """ + + _validation = { + 'primary_readonly_master_key': {'readonly': True}, + 'secondary_readonly_master_key': {'readonly': True}, + 'primary_master_key': {'readonly': True}, + 'secondary_master_key': {'readonly': True}, + } + + _attribute_map = { + 'primary_readonly_master_key': {'key': 'primaryReadonlyMasterKey', 'type': 'str'}, + 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, + 'primary_master_key': {'key': 'primaryMasterKey', 'type': 'str'}, + 'secondary_master_key': {'key': 'secondaryMasterKey', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountListKeysResult, self).__init__(**kwargs) + self.primary_master_key = None + self.secondary_master_key = None + + +class DatabaseAccountRegenerateKeyParameters(msrest.serialization.Model): + """Parameters to regenerate the keys within the database account. + + All required parameters must be populated in order to send to Azure. + + :param key_kind: Required. The access key to regenerate. Possible values include: "primary", + "secondary", "primaryReadonly", "secondaryReadonly". + :type key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind + """ + + _validation = { + 'key_kind': {'required': True}, + } + + _attribute_map = { + 'key_kind': {'key': 'keyKind', 'type': 'str'}, + } + + def __init__( + self, + *, + key_kind: Union[str, "KeyKind"], + **kwargs + ): + super(DatabaseAccountRegenerateKeyParameters, self).__init__(**kwargs) + self.key_kind = key_kind + + +class DatabaseAccountsListResult(msrest.serialization.Model): + """The List operation response, that contains the database accounts and their properties. 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 Azure. + :ivar value: List of database account and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.DatabaseAccountGetResults] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DatabaseAccountGetResults]'}, + } + + def __init__( + self, + **kwargs + ): + super(DatabaseAccountsListResult, self).__init__(**kwargs) + self.value = None + + +class DatabaseAccountUpdateParameters(msrest.serialization.Model): + """Parameters for patching Azure Cosmos DB database account properties. + + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param consistency_policy: The consistency policy for the Cosmos DB account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param locations: An array that contains the georeplication locations enabled for the Cosmos DB + account. + :type locations: list[~azure.mgmt.cosmosdb.models.Location] + :param ip_rules: List of IpRules. + :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] + :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual + Network ACL rules. + :type is_virtual_network_filter_enabled: bool + :param enable_automatic_failover: Enables automatic failover of the write region in the rare + event that the region is unavailable due to an outage. Automatic failover will result in a new + write region for the account and is chosen based on the failover priorities configured for the + account. + :type enable_automatic_failover: bool + :param capabilities: List of Cosmos DB capabilities for the account. + :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB + account. + :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] + :param enable_multiple_write_locations: Enables the account to write in multiple locations. + :type enable_multiple_write_locations: bool + :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. + :type enable_cassandra_connector: bool + :param connector_offer: The cassandra connector offer type for the Cosmos DB database C* + account. Possible values include: "Small". + :type connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer + :param disable_key_based_metadata_write_access: Disable write operations on metadata resources + (databases, containers, throughput) via account keys. + :type disable_key_based_metadata_write_access: bool + :param key_vault_key_uri: The URI of the key vault. + :type key_vault_key_uri: str + :param default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :type default_identity: str + :param public_network_access: Whether requests from Public Network are allowed. Possible values + include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :param enable_free_tier: Flag to indicate whether Free Tier is enabled. + :type enable_free_tier: bool + :param api_properties: API specific properties. Currently, supported only for MongoDB API. + :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :type enable_analytical_storage: bool + :param analytical_storage_configuration: Analytical storage specific properties. + :type analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :param backup_policy: The object representing the policy for taking backups on an account. + :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :param cors: The CORS policy for the Cosmos DB database account. + :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. + Possible values include: "None", "AzureServices". + :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl + Bypass for the Cosmos DB account. + :type network_acl_bypass_resource_ids: list[str] + :param diagnostic_log_settings: The Object representing the different Diagnostic log settings + for the Cosmos DB Account. + :type diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings + :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :type disable_local_auth: bool + """ + + _attribute_map = { + 'tags': {'key': 'tags', 'type': '{str}'}, + 'location': {'key': 'location', 'type': 'str'}, + 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, + 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'locations': {'key': 'properties.locations', 'type': '[Location]'}, + 'ip_rules': {'key': 'properties.ipRules', 'type': '[IpAddressOrRange]'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, + 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, + 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'}, + 'enable_cassandra_connector': {'key': 'properties.enableCassandraConnector', 'type': 'bool'}, + 'connector_offer': {'key': 'properties.connectorOffer', 'type': 'str'}, + 'disable_key_based_metadata_write_access': {'key': 'properties.disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, + 'key_vault_key_uri': {'key': 'properties.keyVaultKeyUri', 'type': 'str'}, + 'default_identity': {'key': 'properties.defaultIdentity', 'type': 'str'}, + 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, + 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, + 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, + 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, + 'analytical_storage_configuration': {'key': 'properties.analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, + 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, + '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'}, + } + + def __init__( + self, + *, + tags: Optional[Dict[str, str]] = None, + location: Optional[str] = None, + identity: Optional["ManagedServiceIdentity"] = None, + consistency_policy: Optional["ConsistencyPolicy"] = None, + locations: Optional[List["Location"]] = None, + ip_rules: Optional[List["IpAddressOrRange"]] = None, + is_virtual_network_filter_enabled: Optional[bool] = None, + enable_automatic_failover: Optional[bool] = None, + capabilities: Optional[List["Capability"]] = None, + virtual_network_rules: Optional[List["VirtualNetworkRule"]] = None, + enable_multiple_write_locations: Optional[bool] = None, + enable_cassandra_connector: Optional[bool] = None, + connector_offer: Optional[Union[str, "ConnectorOffer"]] = None, + disable_key_based_metadata_write_access: Optional[bool] = None, + key_vault_key_uri: Optional[str] = None, + default_identity: Optional[str] = None, + public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, + enable_free_tier: Optional[bool] = None, + api_properties: Optional["ApiProperties"] = None, + enable_analytical_storage: Optional[bool] = None, + analytical_storage_configuration: Optional["AnalyticalStorageConfiguration"] = None, + backup_policy: Optional["BackupPolicy"] = None, + cors: Optional[List["CorsPolicy"]] = None, + network_acl_bypass: Optional[Union[str, "NetworkAclBypass"]] = None, + network_acl_bypass_resource_ids: Optional[List[str]] = None, + diagnostic_log_settings: Optional["DiagnosticLogSettings"] = None, + disable_local_auth: Optional[bool] = None, + **kwargs + ): + super(DatabaseAccountUpdateParameters, self).__init__(**kwargs) + self.tags = tags + self.location = location + self.identity = identity + self.consistency_policy = consistency_policy + self.locations = locations + self.ip_rules = ip_rules + self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled + self.enable_automatic_failover = enable_automatic_failover + self.capabilities = capabilities + self.virtual_network_rules = virtual_network_rules + self.enable_multiple_write_locations = enable_multiple_write_locations + self.enable_cassandra_connector = enable_cassandra_connector + self.connector_offer = connector_offer + self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access + self.key_vault_key_uri = key_vault_key_uri + self.default_identity = default_identity + self.public_network_access = public_network_access + self.enable_free_tier = enable_free_tier + self.api_properties = api_properties + self.enable_analytical_storage = enable_analytical_storage + self.analytical_storage_configuration = analytical_storage_configuration + self.backup_policy = backup_policy + 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 + - :ivar id: The unique resource identifier of the ARM resource. +class DatabaseRestoreResource(msrest.serialization.Model): + """Specific Databases to restore. + + :param database_name: The name of the database available for restore. + :type database_name: str + :param collection_names: The names of the collections available for restore. + :type collection_names: list[str] + """ + + _attribute_map = { + 'database_name': {'key': 'databaseName', 'type': 'str'}, + 'collection_names': {'key': 'collectionNames', 'type': '[str]'}, + } + + def __init__( + self, + *, + database_name: Optional[str] = None, + collection_names: Optional[List[str]] = None, + **kwargs + ): + super(DatabaseRestoreResource, self).__init__(**kwargs) + self.database_name = database_name + self.collection_names = collection_names + + +class DataCenterResource(ARMProxyResource): + """A managed Cassandra data center. + + 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 ARM resource. + :ivar name: The name of the database account. :vartype name: str :ivar type: The type of Azure resource. :vartype type: str - :param location: The location of the resource group to which the resource belongs. - :type location: str - :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). A - maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 - characters and value no greater than 256 characters. For example, the default experience for a - template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values - also include "Table", "Graph", "DocumentDB", and "MongoDB". - :type tags: dict[str, str] - :param kind: Indicates the type of database account. This can only be set at database account - creation. Possible values include: "GlobalDocumentDB", "MongoDB", "Parse". - :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind - :param identity: Identity for the resource. - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :param consistency_policy: The consistency policy for the Cosmos DB account. - :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :param locations: Required. An array that contains the georeplication locations enabled for the - Cosmos DB account. - :type locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar database_account_offer_type: Required. The offer type for the database. Default value: - "Standard". - :vartype database_account_offer_type: str - :param ip_rules: List of IpRules. - :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] - :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual - Network ACL rules. - :type is_virtual_network_filter_enabled: bool - :param enable_automatic_failover: Enables automatic failover of the write region in the rare - event that the region is unavailable due to an outage. Automatic failover will result in a new - write region for the account and is chosen based on the failover priorities configured for the - account. - :type enable_automatic_failover: bool - :param capabilities: List of Cosmos DB capabilities for the account. - :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB - account. - :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] - :param enable_multiple_write_locations: Enables the account to write in multiple locations. - :type enable_multiple_write_locations: bool - :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. - :type enable_cassandra_connector: bool - :param connector_offer: The cassandra connector offer type for the Cosmos DB database C* - account. Possible values include: "Small". - :type connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer - :param disable_key_based_metadata_write_access: Disable write operations on metadata resources - (databases, containers, throughput) via account keys. - :type disable_key_based_metadata_write_access: bool - :param key_vault_key_uri: The URI of the key vault. - :type key_vault_key_uri: str - :param default_identity: The default identity for accessing key vault used in features like - customer managed keys. The default identity needs to be explicitly set by the users. It can be - "FirstPartyIdentity", "SystemAssignedIdentity" and more. - :type default_identity: str - :param public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess - :param enable_free_tier: Flag to indicate whether Free Tier is enabled. - :type enable_free_tier: bool - :param api_properties: API specific properties. Currently, supported only for MongoDB API. - :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties - :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. - :type enable_analytical_storage: bool - :param analytical_storage_configuration: Analytical storage specific properties. - :type analytical_storage_configuration: - ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :param create_mode: Enum to indicate the mode of account creation. Possible values include: - "Default", "Restore". Default value: "Default". - :type create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :param backup_policy: The object representing the policy for taking backups on an account. - :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy - :param cors: The CORS policy for the Cosmos DB database account. - :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] - :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. - Possible values include: "None", "AzureServices". - :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass - :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl - Bypass for the Cosmos DB account. - :type network_acl_bypass_resource_ids: list[str] - :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be - used exclusively for authentication. - :type disable_local_auth: bool - :param restore_parameters: Parameters to indicate the information about the restore. - :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + :param properties: Properties of a managed Cassandra data center. + :type properties: ~azure.mgmt.cosmosdb.models.DataCenterResourceProperties """ _validation = { 'id': {'readonly': True}, 'name': {'readonly': True}, 'type': {'readonly': True}, - 'locations': {'required': True}, - 'database_account_offer_type': {'required': True, 'constant': 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}'}, - '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'}, - 'ip_rules': {'key': 'properties.ipRules', 'type': '[IpAddressOrRange]'}, - 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, - 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, - 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, - 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'}, - 'enable_cassandra_connector': {'key': 'properties.enableCassandraConnector', 'type': 'bool'}, - 'connector_offer': {'key': 'properties.connectorOffer', 'type': 'str'}, - 'disable_key_based_metadata_write_access': {'key': 'properties.disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, - 'key_vault_key_uri': {'key': 'properties.keyVaultKeyUri', 'type': 'str'}, - 'default_identity': {'key': 'properties.defaultIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, - 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, - 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, - 'analytical_storage_configuration': {'key': 'properties.analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, - 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, - 'cors': {'key': 'properties.cors', 'type': '[CorsPolicy]'}, - 'network_acl_bypass': {'key': 'properties.networkAclBypass', 'type': 'str'}, - 'network_acl_bypass_resource_ids': {'key': 'properties.networkAclBypassResourceIds', 'type': '[str]'}, - 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, - 'restore_parameters': {'key': 'properties.restoreParameters', 'type': 'RestoreParameters'}, + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'properties': {'key': 'properties', 'type': 'DataCenterResourceProperties'}, + } + + def __init__( + self, + *, + properties: Optional["DataCenterResourceProperties"] = None, + **kwargs + ): + super(DataCenterResource, self).__init__(**kwargs) + self.properties = properties + + +class DataCenterResourceProperties(msrest.serialization.Model): + """Properties of a managed Cassandra data center. + + Variables are only populated by the server, and will be ignored when sending a request. + + :param provisioning_state: The status of the resource at the time the operation was called. + Possible values include: "Creating", "Updating", "Deleting", "Succeeded", "Failed", "Canceled". + :type provisioning_state: str or ~azure.mgmt.cosmosdb.models.ManagedCassandraProvisioningState + :param data_center_location: The region this data center should be created in. + :type data_center_location: str + :param delegated_subnet_id: Resource id of a subnet the nodes in this data center should have + their network interfaces connected to. The subnet must be in the same region specified in + 'dataCenterLocation' and must be able to route to the subnet specified in the cluster's + 'delegatedManagementSubnetId' property. This resource id will be of the form + '/subscriptions/:code:``/resourceGroups/:code:``/providers/Microsoft.Network/virtualNetworks/:code:``/subnets/:code:``'. + :type delegated_subnet_id: str + :param node_count: The number of nodes the data center should have. This is the desired number. + After it is set, it may take some time for the data center to be scaled to match. To monitor + the number of nodes and their status, use the fetchNodeStatus method on the cluster. + :type node_count: int + :ivar seed_nodes: IP addresses for seed nodes in this data center. This is for reference. + Generally you will want to use the seedNodes property on the cluster, which aggregates the seed + nodes from all data centers in the cluster. + :vartype seed_nodes: list[~azure.mgmt.cosmosdb.models.SeedNode] + :param 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. + :type base64_encoded_cassandra_yaml_fragment: str + """ + + _validation = { + 'seed_nodes': {'readonly': True}, + } + + _attribute_map = { + 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, + 'data_center_location': {'key': 'dataCenterLocation', 'type': 'str'}, + 'delegated_subnet_id': {'key': 'delegatedSubnetId', 'type': 'str'}, + 'node_count': {'key': 'nodeCount', 'type': 'int'}, + 'seed_nodes': {'key': 'seedNodes', 'type': '[SeedNode]'}, + 'base64_encoded_cassandra_yaml_fragment': {'key': 'base64EncodedCassandraYamlFragment', 'type': 'str'}, + } + + def __init__( + self, + *, + provisioning_state: Optional[Union[str, "ManagedCassandraProvisioningState"]] = None, + data_center_location: Optional[str] = None, + delegated_subnet_id: Optional[str] = None, + node_count: Optional[int] = None, + base64_encoded_cassandra_yaml_fragment: Optional[str] = None, + **kwargs + ): + super(DataCenterResourceProperties, self).__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 + + +class RegionalServiceResource(msrest.serialization.Model): + """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. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(RegionalServiceResource, self).__init__(**kwargs) + self.name = None + self.location = None + self.status = None + + +class DataTransferRegionalServiceResource(RegionalServiceResource): + """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. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + """ + + _validation = { + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'status': {'readonly': True}, + } + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + } + + def __init__( + self, + **kwargs + ): + super(DataTransferRegionalServiceResource, self).__init__(**kwargs) + + +class DataTransferServiceResource(msrest.serialization.Model): + """Describes the service response property. + + :param properties: Properties for DataTransferServiceResource. + :type properties: ~azure.mgmt.cosmosdb.models.DataTransferServiceResourceProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'DataTransferServiceResourceProperties'}, + } + + def __init__( + self, + *, + properties: Optional["DataTransferServiceResourceProperties"] = None, + **kwargs + ): + super(DataTransferServiceResource, self).__init__(**kwargs) + self.properties = properties + + +class ServiceResourceProperties(msrest.serialization.Model): + """Services response resource. + + You probably want to use the sub-classes and not this class directly. Known + sub-classes are: DataTransferServiceResourceProperties, GraphAPIComputeServiceResourceProperties, SqlDedicatedGatewayServiceResourceProperties. + + 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 Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :param instance_size: Instance type for the service. Possible values include: "Cosmos.D4s", + "Cosmos.D8s", "Cosmos.D16s". + :type instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :param instance_count: Instance count for the service. + :type instance_count: int + :param service_type: Required. ServiceType for the service.Constant filled by server. Possible + values include: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute". + :type service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + """ + + _validation = { + 'creation_time': {'readonly': True}, + 'instance_count': {'minimum': 0}, + 'service_type': {'required': True}, + 'status': {'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'}, + } + + _subtype_map = { + 'service_type': {'DataTransfer': 'DataTransferServiceResourceProperties', 'GraphAPICompute': 'GraphAPIComputeServiceResourceProperties', 'SqlDedicatedGateway': 'SqlDedicatedGatewayServiceResourceProperties'} + } + + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + instance_size: Optional[Union[str, "ServiceSize"]] = None, + instance_count: Optional[int] = None, + **kwargs + ): + super(ServiceResourceProperties, self).__init__(**kwargs) + self.additional_properties = additional_properties + self.creation_time = None + self.instance_size = instance_size + self.instance_count = instance_count + self.service_type = 'ServiceResourceProperties' # type: str + self.status = None + + +class DataTransferServiceResourceProperties(ServiceResourceProperties): + """Properties for DataTransferServiceResource. + + 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 Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :param instance_size: Instance type for the service. Possible values include: "Cosmos.D4s", + "Cosmos.D8s", "Cosmos.D16s". + :type instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :param instance_count: Instance count for the service. + :type instance_count: int + :param service_type: Required. ServiceType for the service.Constant filled by server. Possible + values include: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute". + :type service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar locations: An array that contains all of the locations for the service. + :vartype locations: list[~azure.mgmt.cosmosdb.models.DataTransferRegionalServiceResource] + """ + + _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'}, + 'locations': {'key': 'locations', 'type': '[DataTransferRegionalServiceResource]'}, } - database_account_offer_type = "Standard" - def __init__( self, *, - locations: List["Location"], - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - kind: Optional[Union[str, "DatabaseAccountKind"]] = None, - identity: Optional["ManagedServiceIdentity"] = None, - consistency_policy: Optional["ConsistencyPolicy"] = None, - ip_rules: Optional[List["IpAddressOrRange"]] = None, - is_virtual_network_filter_enabled: Optional[bool] = None, - enable_automatic_failover: Optional[bool] = None, - capabilities: Optional[List["Capability"]] = None, - virtual_network_rules: Optional[List["VirtualNetworkRule"]] = None, - enable_multiple_write_locations: Optional[bool] = None, - enable_cassandra_connector: Optional[bool] = None, - connector_offer: Optional[Union[str, "ConnectorOffer"]] = None, - disable_key_based_metadata_write_access: Optional[bool] = None, - key_vault_key_uri: Optional[str] = None, - default_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - enable_free_tier: Optional[bool] = None, - api_properties: Optional["ApiProperties"] = None, - enable_analytical_storage: Optional[bool] = None, - analytical_storage_configuration: Optional["AnalyticalStorageConfiguration"] = None, - create_mode: Optional[Union[str, "CreateMode"]] = "Default", - backup_policy: Optional["BackupPolicy"] = None, - cors: Optional[List["CorsPolicy"]] = None, - network_acl_bypass: Optional[Union[str, "NetworkAclBypass"]] = None, - network_acl_bypass_resource_ids: Optional[List[str]] = None, - disable_local_auth: Optional[bool] = None, - restore_parameters: Optional["RestoreParameters"] = None, + additional_properties: Optional[Dict[str, Any]] = None, + instance_size: Optional[Union[str, "ServiceSize"]] = None, + instance_count: Optional[int] = None, **kwargs ): - super(DatabaseAccountCreateUpdateParameters, self).__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 - self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled - self.enable_automatic_failover = enable_automatic_failover - self.capabilities = capabilities - self.virtual_network_rules = virtual_network_rules - self.enable_multiple_write_locations = enable_multiple_write_locations - self.enable_cassandra_connector = enable_cassandra_connector - self.connector_offer = connector_offer - self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access - self.key_vault_key_uri = key_vault_key_uri - self.default_identity = default_identity - self.public_network_access = public_network_access - self.enable_free_tier = enable_free_tier - self.api_properties = api_properties - self.enable_analytical_storage = enable_analytical_storage - self.analytical_storage_configuration = analytical_storage_configuration - self.create_mode = create_mode - self.backup_policy = backup_policy - self.cors = cors - self.network_acl_bypass = network_acl_bypass - self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids - self.disable_local_auth = disable_local_auth - self.restore_parameters = restore_parameters + super(DataTransferServiceResourceProperties, self).__init__(additional_properties=additional_properties, instance_size=instance_size, instance_count=instance_count, **kwargs) + self.service_type = 'DataTransfer' # type: str + self.locations = None -class DatabaseAccountGetResults(ARMResourceProperties): - """An Azure Cosmos DB database account. +class DefaultRequestDatabaseAccountCreateUpdateProperties(DatabaseAccountCreateUpdateProperties): + """Properties for non-restore Azure Cosmos DB database account requests. 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 - :param location: The location of the resource group to which the resource belongs. - :type location: str - :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. - These tags can be used in viewing and grouping this resource (across resource groups). A - maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 - characters and value no greater than 256 characters. For example, the default experience for a - template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values - also include "Table", "Graph", "DocumentDB", and "MongoDB". - :type tags: dict[str, str] - :param kind: Indicates the type of database account. This can only be set at database account - creation. Possible values include: "GlobalDocumentDB", "MongoDB", "Parse". - :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind - :param identity: Identity for the resource. - :type 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 - called. The status can be one of following. 'Creating' – the Cosmos DB account is being - created. When an account is in Creating state, only properties that are specified as input for - the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB account is - active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB - account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – - the Cosmos DB account deletion failed. - :vartype provisioning_state: str - :ivar document_endpoint: The connection endpoint for the Cosmos DB database account. - :vartype document_endpoint: str - :ivar database_account_offer_type: The offer type for the Cosmos DB database account. Default - value: Standard. Default value: "Standard". + All required parameters must be populated in order to send to Azure. + + :param consistency_policy: The consistency policy for the Cosmos DB account. + :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy + :param locations: Required. An array that contains the georeplication locations enabled for the + Cosmos DB account. + :type locations: list[~azure.mgmt.cosmosdb.models.Location] + :ivar database_account_offer_type: The offer type for the database. Has constant value: + "Standard". :vartype database_account_offer_type: str :param ip_rules: List of IpRules. :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] @@ -1644,27 +3350,11 @@ class DatabaseAccountGetResults(ARMResourceProperties): write region for the account and is chosen based on the failover priorities configured for the account. :type enable_automatic_failover: bool - :param consistency_policy: The consistency policy for the Cosmos DB database account. - :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy :param capabilities: List of Cosmos DB capabilities for the account. :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :ivar write_locations: An array that contains the write location for the Cosmos DB account. - :vartype write_locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar read_locations: An array that contains of the read locations enabled for the Cosmos DB - account. - :vartype read_locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar locations: An array that contains all of the locations enabled for the Cosmos DB account. - :vartype locations: list[~azure.mgmt.cosmosdb.models.Location] - :ivar failover_policies: An array that contains the regions ordered by their failover - priorities. - :vartype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB account. :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] - :ivar private_endpoint_connections: List of Private Endpoint Connections configured for the - Cosmos DB account. - :vartype private_endpoint_connections: - list[~azure.mgmt.cosmosdb.models.PrivateEndpointConnection] :param enable_multiple_write_locations: Enables the account to write in multiple locations. :type enable_multiple_write_locations: bool :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. @@ -1673,106 +3363,83 @@ class DatabaseAccountGetResults(ARMResourceProperties): account. Possible values include: "Small". :type connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer :param disable_key_based_metadata_write_access: Disable write operations on metadata resources - (databases, containers, throughput) via account keys. - :type disable_key_based_metadata_write_access: bool - :param key_vault_key_uri: The URI of the key vault. - :type key_vault_key_uri: str - :param default_identity: The default identity for accessing key vault used in features like - customer managed keys. The default identity needs to be explicitly set by the users. It can be - "FirstPartyIdentity", "SystemAssignedIdentity" and more. - :type default_identity: str - :param public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess - :param enable_free_tier: Flag to indicate whether Free Tier is enabled. - :type enable_free_tier: bool - :param api_properties: API specific properties. - :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties - :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. - :type enable_analytical_storage: bool - :param analytical_storage_configuration: Analytical storage specific properties. - :type analytical_storage_configuration: - ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :ivar instance_id: A unique identifier assigned to the database account. - :vartype instance_id: str - :param create_mode: Enum to indicate the mode of account creation. Possible values include: - "Default", "Restore". Default value: "Default". - :type create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode - :param restore_parameters: Parameters to indicate the information about the restore. - :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters - :param backup_policy: The object representing the policy for taking backups on an account. - :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy - :param cors: The CORS policy for the Cosmos DB database account. - :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] - :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. - Possible values include: "None", "AzureServices". - :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass - :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl - Bypass for the Cosmos DB account. - :type network_acl_bypass_resource_ids: list[str] - :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be - used exclusively for authentication. - :type disable_local_auth: bool - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'system_data': {'readonly': True}, - 'provisioning_state': {'readonly': True}, - 'document_endpoint': {'readonly': True}, - 'database_account_offer_type': {'readonly': True, 'constant': True}, - 'write_locations': {'readonly': True}, - 'read_locations': {'readonly': True}, - 'locations': {'readonly': True}, - 'failover_policies': {'readonly': True}, - 'private_endpoint_connections': {'readonly': True}, - 'instance_id': {'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}'}, - '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'}, - 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, - 'ip_rules': {'key': 'properties.ipRules', 'type': '[IpAddressOrRange]'}, - 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, - 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, - 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, - 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, - 'write_locations': {'key': 'properties.writeLocations', 'type': '[Location]'}, - 'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'}, - 'locations': {'key': 'properties.locations', 'type': '[Location]'}, - 'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'}, - 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'private_endpoint_connections': {'key': 'properties.privateEndpointConnections', 'type': '[PrivateEndpointConnection]'}, - 'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'}, - 'enable_cassandra_connector': {'key': 'properties.enableCassandraConnector', 'type': 'bool'}, - 'connector_offer': {'key': 'properties.connectorOffer', 'type': 'str'}, - 'disable_key_based_metadata_write_access': {'key': 'properties.disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, - 'key_vault_key_uri': {'key': 'properties.keyVaultKeyUri', 'type': 'str'}, - 'default_identity': {'key': 'properties.defaultIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, - 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, - 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, - 'analytical_storage_configuration': {'key': 'properties.analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, - 'instance_id': {'key': 'properties.instanceId', 'type': 'str'}, - 'create_mode': {'key': 'properties.createMode', 'type': 'str'}, - 'restore_parameters': {'key': 'properties.restoreParameters', 'type': 'RestoreParameters'}, - 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, - 'cors': {'key': 'properties.cors', 'type': '[CorsPolicy]'}, - 'network_acl_bypass': {'key': 'properties.networkAclBypass', 'type': 'str'}, - 'network_acl_bypass_resource_ids': {'key': 'properties.networkAclBypassResourceIds', 'type': '[str]'}, - 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, + (databases, containers, throughput) via account keys. + :type disable_key_based_metadata_write_access: bool + :param key_vault_key_uri: The URI of the key vault. + :type key_vault_key_uri: str + :param default_identity: The default identity for accessing key vault used in features like + customer managed keys. The default identity needs to be explicitly set by the users. It can be + "FirstPartyIdentity", "SystemAssignedIdentity" and more. + :type default_identity: str + :param public_network_access: Whether requests from Public Network are allowed. Possible values + include: "Enabled", "Disabled". + :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess + :param enable_free_tier: Flag to indicate whether Free Tier is enabled. + :type enable_free_tier: bool + :param api_properties: API specific properties. Currently, supported only for MongoDB API. + :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties + :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. + :type enable_analytical_storage: bool + :param analytical_storage_configuration: Analytical storage specific properties. + :type analytical_storage_configuration: + ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration + :param create_mode: Required. Enum to indicate the mode of account creation.Constant filled by + server. Possible values include: "Default", "Restore". Default value: "Default". + :type create_mode: str or ~azure.mgmt.cosmosdb.models.CreateMode + :param backup_policy: The object representing the policy for taking backups on an account. + :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy + :param cors: The CORS policy for the Cosmos DB database account. + :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] + :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. + Possible values include: "None", "AzureServices". + :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass + :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl + Bypass for the Cosmos DB account. + :type network_acl_bypass_resource_ids: list[str] + :param diagnostic_log_settings: The Object representing the different Diagnostic log settings + for the Cosmos DB Account. + :type diagnostic_log_settings: ~azure.mgmt.cosmosdb.models.DiagnosticLogSettings + :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be + used exclusively for authentication. + :type disable_local_auth: bool + :param restore_parameters: Parameters to indicate the information about the restore. + :type restore_parameters: ~azure.mgmt.cosmosdb.models.RestoreParameters + """ + + _validation = { + 'locations': {'required': True}, + 'database_account_offer_type': {'required': True, 'constant': True}, + 'create_mode': {'required': True}, + } + + _attribute_map = { + 'consistency_policy': {'key': 'consistencyPolicy', 'type': 'ConsistencyPolicy'}, + 'locations': {'key': 'locations', 'type': '[Location]'}, + 'database_account_offer_type': {'key': 'databaseAccountOfferType', 'type': 'str'}, + 'ip_rules': {'key': 'ipRules', 'type': '[IpAddressOrRange]'}, + 'is_virtual_network_filter_enabled': {'key': 'isVirtualNetworkFilterEnabled', 'type': 'bool'}, + 'enable_automatic_failover': {'key': 'enableAutomaticFailover', 'type': 'bool'}, + 'capabilities': {'key': 'capabilities', 'type': '[Capability]'}, + 'virtual_network_rules': {'key': 'virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, + 'enable_multiple_write_locations': {'key': 'enableMultipleWriteLocations', 'type': 'bool'}, + 'enable_cassandra_connector': {'key': 'enableCassandraConnector', 'type': 'bool'}, + 'connector_offer': {'key': 'connectorOffer', 'type': 'str'}, + 'disable_key_based_metadata_write_access': {'key': 'disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, + 'key_vault_key_uri': {'key': 'keyVaultKeyUri', 'type': 'str'}, + 'default_identity': {'key': 'defaultIdentity', 'type': 'str'}, + 'public_network_access': {'key': 'publicNetworkAccess', 'type': 'str'}, + 'enable_free_tier': {'key': 'enableFreeTier', 'type': 'bool'}, + 'api_properties': {'key': 'apiProperties', 'type': 'ApiProperties'}, + 'enable_analytical_storage': {'key': 'enableAnalyticalStorage', 'type': 'bool'}, + 'analytical_storage_configuration': {'key': 'analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, + 'create_mode': {'key': 'createMode', 'type': 'str'}, + 'backup_policy': {'key': 'backupPolicy', 'type': 'BackupPolicy'}, + 'cors': {'key': 'cors', 'type': '[CorsPolicy]'}, + 'network_acl_bypass': {'key': 'networkAclBypass', 'type': 'str'}, + 'network_acl_bypass_resource_ids': {'key': 'networkAclBypassResourceIds', 'type': '[str]'}, + 'diagnostic_log_settings': {'key': 'diagnosticLogSettings', 'type': 'DiagnosticLogSettings'}, + 'disable_local_auth': {'key': 'disableLocalAuth', 'type': 'bool'}, + 'restore_parameters': {'key': 'restoreParameters', 'type': 'RestoreParameters'}, } database_account_offer_type = "Standard" @@ -1780,14 +3447,11 @@ class DatabaseAccountGetResults(ARMResourceProperties): def __init__( self, *, - location: Optional[str] = None, - tags: Optional[Dict[str, str]] = None, - kind: Optional[Union[str, "DatabaseAccountKind"]] = None, - identity: Optional["ManagedServiceIdentity"] = None, + locations: List["Location"], + consistency_policy: Optional["ConsistencyPolicy"] = None, ip_rules: Optional[List["IpAddressOrRange"]] = None, is_virtual_network_filter_enabled: Optional[bool] = None, enable_automatic_failover: Optional[bool] = None, - consistency_policy: Optional["ConsistencyPolicy"] = None, capabilities: Optional[List["Capability"]] = None, virtual_network_rules: Optional[List["VirtualNetworkRule"]] = None, enable_multiple_write_locations: Optional[bool] = None, @@ -1801,200 +3465,321 @@ def __init__( api_properties: Optional["ApiProperties"] = None, enable_analytical_storage: Optional[bool] = None, analytical_storage_configuration: Optional["AnalyticalStorageConfiguration"] = None, - create_mode: Optional[Union[str, "CreateMode"]] = "Default", - restore_parameters: Optional["RestoreParameters"] = None, backup_policy: Optional["BackupPolicy"] = None, cors: Optional[List["CorsPolicy"]] = None, network_acl_bypass: Optional[Union[str, "NetworkAclBypass"]] = None, network_acl_bypass_resource_ids: Optional[List[str]] = None, + diagnostic_log_settings: Optional["DiagnosticLogSettings"] = None, disable_local_auth: Optional[bool] = None, + restore_parameters: Optional["RestoreParameters"] = None, **kwargs ): - super(DatabaseAccountGetResults, self).__init__(location=location, tags=tags, **kwargs) - self.kind = kind - self.identity = identity - self.system_data = None - self.provisioning_state = None - self.document_endpoint = None - self.database_account_offer_type = None - self.ip_rules = ip_rules - self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled - self.enable_automatic_failover = enable_automatic_failover - self.consistency_policy = consistency_policy - self.capabilities = capabilities - self.write_locations = None - self.read_locations = None - self.locations = None - self.failover_policies = None - self.virtual_network_rules = virtual_network_rules - self.private_endpoint_connections = None - self.enable_multiple_write_locations = enable_multiple_write_locations - self.enable_cassandra_connector = enable_cassandra_connector - self.connector_offer = connector_offer - self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access - self.key_vault_key_uri = key_vault_key_uri - self.default_identity = default_identity - self.public_network_access = public_network_access - self.enable_free_tier = enable_free_tier - self.api_properties = api_properties - self.enable_analytical_storage = enable_analytical_storage - self.analytical_storage_configuration = analytical_storage_configuration - self.instance_id = None - self.create_mode = create_mode - self.restore_parameters = restore_parameters - self.backup_policy = backup_policy - self.cors = cors - self.network_acl_bypass = network_acl_bypass - self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids - self.disable_local_auth = disable_local_auth + super(DefaultRequestDatabaseAccountCreateUpdateProperties, self).__init__(consistency_policy=consistency_policy, locations=locations, ip_rules=ip_rules, is_virtual_network_filter_enabled=is_virtual_network_filter_enabled, enable_automatic_failover=enable_automatic_failover, capabilities=capabilities, virtual_network_rules=virtual_network_rules, enable_multiple_write_locations=enable_multiple_write_locations, enable_cassandra_connector=enable_cassandra_connector, connector_offer=connector_offer, disable_key_based_metadata_write_access=disable_key_based_metadata_write_access, key_vault_key_uri=key_vault_key_uri, default_identity=default_identity, public_network_access=public_network_access, enable_free_tier=enable_free_tier, api_properties=api_properties, enable_analytical_storage=enable_analytical_storage, analytical_storage_configuration=analytical_storage_configuration, backup_policy=backup_policy, cors=cors, network_acl_bypass=network_acl_bypass, network_acl_bypass_resource_ids=network_acl_bypass_resource_ids, diagnostic_log_settings=diagnostic_log_settings, disable_local_auth=disable_local_auth, restore_parameters=restore_parameters, **kwargs) + self.create_mode = 'Default' # type: str -class DatabaseAccountListConnectionStringsResult(msrest.serialization.Model): - """The connection strings for the given database account. +class DiagnosticLogSettings(msrest.serialization.Model): + """Indicates what diagnostic log settings are to be enabled. - :param connection_strings: An array that contains the connection strings for the Cosmos DB - account. - :type connection_strings: list[~azure.mgmt.cosmosdb.models.DatabaseAccountConnectionString] + :param enable_full_text_query: Describe the level of detail with which queries are to be + logged. Possible values include: "None", "True", "False". + :type enable_full_text_query: str or ~azure.mgmt.cosmosdb.models.EnableFullTextQuery """ _attribute_map = { - 'connection_strings': {'key': 'connectionStrings', 'type': '[DatabaseAccountConnectionString]'}, + 'enable_full_text_query': {'key': 'enableFullTextQuery', 'type': 'str'}, } def __init__( self, *, - connection_strings: Optional[List["DatabaseAccountConnectionString"]] = None, + enable_full_text_query: Optional[Union[str, "EnableFullTextQuery"]] = None, **kwargs ): - super(DatabaseAccountListConnectionStringsResult, self).__init__(**kwargs) - self.connection_strings = connection_strings + super(DiagnosticLogSettings, self).__init__(**kwargs) + self.enable_full_text_query = enable_full_text_query -class DatabaseAccountListReadOnlyKeysResult(msrest.serialization.Model): - """The read-only access keys for the given database account. +class ErrorResponse(msrest.serialization.Model): + """Error Response. + + :param code: Error code. + :type code: str + :param message: Error message indicating why the operation failed. + :type message: str + """ + + _attribute_map = { + 'code': {'key': 'code', 'type': 'str'}, + 'message': {'key': 'message', 'type': 'str'}, + } + + def __init__( + self, + *, + code: Optional[str] = None, + message: Optional[str] = None, + **kwargs + ): + super(ErrorResponse, self).__init__(**kwargs) + self.code = code + self.message = message + + +class ExcludedPath(msrest.serialization.Model): + """ExcludedPath. + + :param path: The path for which the indexing behavior applies to. Index paths typically start + with root and end with wildcard (/path/*). + :type path: str + """ + + _attribute_map = { + 'path': {'key': 'path', 'type': 'str'}, + } + + def __init__( + self, + *, + path: Optional[str] = None, + **kwargs + ): + super(ExcludedPath, self).__init__(**kwargs) + self.path = path + + +class FailoverPolicies(msrest.serialization.Model): + """The list of new failover policies for the failover priority change. + + All required parameters must be populated in order to send to Azure. + + :param failover_policies: Required. List of failover policies. + :type failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + """ + + _validation = { + 'failover_policies': {'required': True}, + } + + _attribute_map = { + 'failover_policies': {'key': 'failoverPolicies', 'type': '[FailoverPolicy]'}, + } + + def __init__( + self, + *, + failover_policies: List["FailoverPolicy"], + **kwargs + ): + super(FailoverPolicies, self).__init__(**kwargs) + self.failover_policies = failover_policies + + +class FailoverPolicy(msrest.serialization.Model): + """The failover policy for a given region of a database account. Variables are only populated by the server, and will be ignored when sending a request. - :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. - :vartype primary_readonly_master_key: str - :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. - :vartype secondary_readonly_master_key: str + :ivar id: The unique identifier of the region in which the database account replicates to. + Example: <accountName>-<locationName>. + :vartype id: str + :param location_name: The name of the region in which the database account exists. + :type location_name: str + :param failover_priority: The failover priority of the region. A failover priority of 0 + indicates a write region. The maximum value for a failover priority = (total number of regions + - 1). Failover priority values must be unique for each of the regions in which the database + account exists. + :type failover_priority: int """ _validation = { - 'primary_readonly_master_key': {'readonly': True}, - 'secondary_readonly_master_key': {'readonly': True}, + 'id': {'readonly': True}, + 'failover_priority': {'minimum': 0}, } _attribute_map = { - 'primary_readonly_master_key': {'key': 'primaryReadonlyMasterKey', 'type': 'str'}, - 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, + 'location_name': {'key': 'locationName', 'type': 'str'}, + 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, } def __init__( self, + *, + location_name: Optional[str] = None, + failover_priority: Optional[int] = None, **kwargs ): - super(DatabaseAccountListReadOnlyKeysResult, self).__init__(**kwargs) - self.primary_readonly_master_key = None - self.secondary_readonly_master_key = None + super(FailoverPolicy, self).__init__(**kwargs) + self.id = None + self.location_name = location_name + self.failover_priority = failover_priority -class DatabaseAccountListKeysResult(DatabaseAccountListReadOnlyKeysResult): - """The access keys for the given database account. +class GraphAPIComputeRegionalServiceResource(RegionalServiceResource): + """Resource for a regional service location. Variables are only populated by the server, and will be ignored when sending a request. - :ivar primary_readonly_master_key: Base 64 encoded value of the primary read-only key. - :vartype primary_readonly_master_key: str - :ivar secondary_readonly_master_key: Base 64 encoded value of the secondary read-only key. - :vartype secondary_readonly_master_key: str - :ivar primary_master_key: Base 64 encoded value of the primary read-write key. - :vartype primary_master_key: str - :ivar secondary_master_key: Base 64 encoded value of the secondary read-write key. - :vartype secondary_master_key: str + :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. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :ivar graph_api_compute_endpoint: The regional endpoint for GraphAPICompute. + :vartype graph_api_compute_endpoint: str """ _validation = { - 'primary_readonly_master_key': {'readonly': True}, - 'secondary_readonly_master_key': {'readonly': True}, - 'primary_master_key': {'readonly': True}, - 'secondary_master_key': {'readonly': True}, + 'name': {'readonly': True}, + 'location': {'readonly': True}, + 'status': {'readonly': True}, + 'graph_api_compute_endpoint': {'readonly': True}, } _attribute_map = { - 'primary_readonly_master_key': {'key': 'primaryReadonlyMasterKey', 'type': 'str'}, - 'secondary_readonly_master_key': {'key': 'secondaryReadonlyMasterKey', 'type': 'str'}, - 'primary_master_key': {'key': 'primaryMasterKey', 'type': 'str'}, - 'secondary_master_key': {'key': 'secondaryMasterKey', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'status': {'key': 'status', 'type': 'str'}, + 'graph_api_compute_endpoint': {'key': 'graphApiComputeEndpoint', 'type': 'str'}, } def __init__( self, **kwargs ): - super(DatabaseAccountListKeysResult, self).__init__(**kwargs) - self.primary_master_key = None - self.secondary_master_key = None + super(GraphAPIComputeRegionalServiceResource, self).__init__(**kwargs) + self.graph_api_compute_endpoint = None -class DatabaseAccountRegenerateKeyParameters(msrest.serialization.Model): - """Parameters to regenerate the keys within the database account. +class GraphAPIComputeServiceResource(msrest.serialization.Model): + """Describes the service response property for GraphAPICompute. + + :param properties: Properties for GraphAPIComputeServiceResource. + :type properties: ~azure.mgmt.cosmosdb.models.GraphAPIComputeServiceResourceProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'GraphAPIComputeServiceResourceProperties'}, + } + + def __init__( + self, + *, + properties: Optional["GraphAPIComputeServiceResourceProperties"] = None, + **kwargs + ): + super(GraphAPIComputeServiceResource, self).__init__(**kwargs) + self.properties = properties + + +class GraphAPIComputeServiceResourceProperties(ServiceResourceProperties): + """Properties for GraphAPIComputeServiceResource. + + 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 Azure. - :param key_kind: Required. The access key to regenerate. Possible values include: "primary", - "secondary", "primaryReadonly", "secondaryReadonly". - :type key_kind: str or ~azure.mgmt.cosmosdb.models.KeyKind + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :param instance_size: Instance type for the service. Possible values include: "Cosmos.D4s", + "Cosmos.D8s", "Cosmos.D16s". + :type instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :param instance_count: Instance count for the service. + :type instance_count: int + :param service_type: Required. ServiceType for the service.Constant filled by server. Possible + values include: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute". + :type service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :param graph_api_compute_endpoint: GraphAPICompute endpoint for the service. + :type graph_api_compute_endpoint: str + :ivar locations: An array that contains all of the locations for the service. + :vartype locations: list[~azure.mgmt.cosmosdb.models.GraphAPIComputeRegionalServiceResource] """ _validation = { - 'key_kind': {'required': True}, + 'creation_time': {'readonly': True}, + 'instance_count': {'minimum': 0}, + 'service_type': {'required': True}, + 'status': {'readonly': True}, + 'locations': {'readonly': True}, } _attribute_map = { - 'key_kind': {'key': 'keyKind', 'type': 'str'}, + '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'}, + 'graph_api_compute_endpoint': {'key': 'graphApiComputeEndpoint', 'type': 'str'}, + 'locations': {'key': 'locations', 'type': '[GraphAPIComputeRegionalServiceResource]'}, } def __init__( self, *, - key_kind: Union[str, "KeyKind"], + additional_properties: Optional[Dict[str, Any]] = None, + instance_size: Optional[Union[str, "ServiceSize"]] = None, + instance_count: Optional[int] = None, + graph_api_compute_endpoint: Optional[str] = None, **kwargs ): - super(DatabaseAccountRegenerateKeyParameters, self).__init__(**kwargs) - self.key_kind = key_kind + super(GraphAPIComputeServiceResourceProperties, self).__init__(additional_properties=additional_properties, instance_size=instance_size, instance_count=instance_count, **kwargs) + self.service_type = 'GraphAPICompute' # type: str + self.graph_api_compute_endpoint = graph_api_compute_endpoint + self.locations = None -class DatabaseAccountsListResult(msrest.serialization.Model): - """The List operation response, that contains the database accounts and their properties. +class GraphResource(msrest.serialization.Model): + """Cosmos DB Graph 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 Azure. - :ivar value: List of database account and their properties. - :vartype value: list[~azure.mgmt.cosmosdb.models.DatabaseAccountGetResults] + :param id: Required. Name of the Cosmos DB Graph. + :type id: str """ _validation = { - 'value': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { - 'value': {'key': 'value', 'type': '[DatabaseAccountGetResults]'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, + *, + id: str, **kwargs ): - super(DatabaseAccountsListResult, self).__init__(**kwargs) - self.value = None + super(GraphResource, self).__init__(**kwargs) + self.id = id -class DatabaseAccountUpdateParameters(msrest.serialization.Model): - """Parameters for patching Azure Cosmos DB database account properties. +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 Azure. + :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 + :param location: The location of the resource group to which the resource belongs. + :type location: str :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 @@ -2002,302 +3787,201 @@ class DatabaseAccountUpdateParameters(msrest.serialization.Model): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] - :param location: The location of the resource group to which the resource belongs. - :type location: str :param identity: Identity for the resource. :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :param consistency_policy: The consistency policy for the Cosmos DB account. - :type consistency_policy: ~azure.mgmt.cosmosdb.models.ConsistencyPolicy - :param locations: An array that contains the georeplication locations enabled for the Cosmos DB - account. - :type locations: list[~azure.mgmt.cosmosdb.models.Location] - :param ip_rules: List of IpRules. - :type ip_rules: list[~azure.mgmt.cosmosdb.models.IpAddressOrRange] - :param is_virtual_network_filter_enabled: Flag to indicate whether to enable/disable Virtual - Network ACL rules. - :type is_virtual_network_filter_enabled: bool - :param enable_automatic_failover: Enables automatic failover of the write region in the rare - event that the region is unavailable due to an outage. Automatic failover will result in a new - write region for the account and is chosen based on the failover priorities configured for the - account. - :type enable_automatic_failover: bool - :param capabilities: List of Cosmos DB capabilities for the account. - :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] - :param virtual_network_rules: List of Virtual Network ACL rules configured for the Cosmos DB - account. - :type virtual_network_rules: list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] - :param enable_multiple_write_locations: Enables the account to write in multiple locations. - :type enable_multiple_write_locations: bool - :param enable_cassandra_connector: Enables the cassandra connector on the Cosmos DB C* account. - :type enable_cassandra_connector: bool - :param connector_offer: The cassandra connector offer type for the Cosmos DB database C* - account. Possible values include: "Small". - :type connector_offer: str or ~azure.mgmt.cosmosdb.models.ConnectorOffer - :param disable_key_based_metadata_write_access: Disable write operations on metadata resources - (databases, containers, throughput) via account keys. - :type disable_key_based_metadata_write_access: bool - :param key_vault_key_uri: The URI of the key vault. - :type key_vault_key_uri: str - :param default_identity: The default identity for accessing key vault used in features like - customer managed keys. The default identity needs to be explicitly set by the users. It can be - "FirstPartyIdentity", "SystemAssignedIdentity" and more. - :type default_identity: str - :param public_network_access: Whether requests from Public Network are allowed. Possible values - include: "Enabled", "Disabled". - :type public_network_access: str or ~azure.mgmt.cosmosdb.models.PublicNetworkAccess - :param enable_free_tier: Flag to indicate whether Free Tier is enabled. - :type enable_free_tier: bool - :param api_properties: API specific properties. Currently, supported only for MongoDB API. - :type api_properties: ~azure.mgmt.cosmosdb.models.ApiProperties - :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. - :type enable_analytical_storage: bool - :param analytical_storage_configuration: Analytical storage specific properties. - :type analytical_storage_configuration: - ~azure.mgmt.cosmosdb.models.AnalyticalStorageConfiguration - :param backup_policy: The object representing the policy for taking backups on an account. - :type backup_policy: ~azure.mgmt.cosmosdb.models.BackupPolicy - :param cors: The CORS policy for the Cosmos DB database account. - :type cors: list[~azure.mgmt.cosmosdb.models.CorsPolicy] - :param network_acl_bypass: Indicates what services are allowed to bypass firewall checks. - Possible values include: "None", "AzureServices". - :type network_acl_bypass: str or ~azure.mgmt.cosmosdb.models.NetworkAclBypass - :param network_acl_bypass_resource_ids: An array that contains the Resource Ids for Network Acl - Bypass for the Cosmos DB account. - :type network_acl_bypass_resource_ids: list[str] - :param disable_local_auth: Opt-out of local authentication and ensure only MSI and AAD can be - used exclusively for authentication. - :type disable_local_auth: bool + :param resource: Required. The standard JSON format of a Graph resource. + :type resource: ~azure.mgmt.cosmosdb.models.GraphResource + :param options: A key-value pair of options to be applied for the request. This corresponds to + the headers sent with the request. + :type options: ~azure.mgmt.cosmosdb.models.CreateUpdateOptions """ + _validation = { + 'id': {'readonly': True}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'resource': {'required': True}, + } + _attribute_map = { - 'tags': {'key': 'tags', 'type': '{str}'}, + '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'}, - 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, - 'locations': {'key': 'properties.locations', 'type': '[Location]'}, - 'ip_rules': {'key': 'properties.ipRules', 'type': '[IpAddressOrRange]'}, - 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, - 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, - 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, - 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, - 'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'}, - 'enable_cassandra_connector': {'key': 'properties.enableCassandraConnector', 'type': 'bool'}, - 'connector_offer': {'key': 'properties.connectorOffer', 'type': 'str'}, - 'disable_key_based_metadata_write_access': {'key': 'properties.disableKeyBasedMetadataWriteAccess', 'type': 'bool'}, - 'key_vault_key_uri': {'key': 'properties.keyVaultKeyUri', 'type': 'str'}, - 'default_identity': {'key': 'properties.defaultIdentity', 'type': 'str'}, - 'public_network_access': {'key': 'properties.publicNetworkAccess', 'type': 'str'}, - 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, - 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, - 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, - 'analytical_storage_configuration': {'key': 'properties.analyticalStorageConfiguration', 'type': 'AnalyticalStorageConfiguration'}, - 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, - 'cors': {'key': 'properties.cors', 'type': '[CorsPolicy]'}, - 'network_acl_bypass': {'key': 'properties.networkAclBypass', 'type': 'str'}, - 'network_acl_bypass_resource_ids': {'key': 'properties.networkAclBypassResourceIds', 'type': '[str]'}, - 'disable_local_auth': {'key': 'properties.disableLocalAuth', 'type': 'bool'}, + 'resource': {'key': 'properties.resource', 'type': 'GraphResource'}, + 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } def __init__( self, *, - tags: Optional[Dict[str, str]] = None, + resource: "GraphResource", location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, identity: Optional["ManagedServiceIdentity"] = None, - consistency_policy: Optional["ConsistencyPolicy"] = None, - locations: Optional[List["Location"]] = None, - ip_rules: Optional[List["IpAddressOrRange"]] = None, - is_virtual_network_filter_enabled: Optional[bool] = None, - enable_automatic_failover: Optional[bool] = None, - capabilities: Optional[List["Capability"]] = None, - virtual_network_rules: Optional[List["VirtualNetworkRule"]] = None, - enable_multiple_write_locations: Optional[bool] = None, - enable_cassandra_connector: Optional[bool] = None, - connector_offer: Optional[Union[str, "ConnectorOffer"]] = None, - disable_key_based_metadata_write_access: Optional[bool] = None, - key_vault_key_uri: Optional[str] = None, - default_identity: Optional[str] = None, - public_network_access: Optional[Union[str, "PublicNetworkAccess"]] = None, - enable_free_tier: Optional[bool] = None, - api_properties: Optional["ApiProperties"] = None, - enable_analytical_storage: Optional[bool] = None, - analytical_storage_configuration: Optional["AnalyticalStorageConfiguration"] = None, - backup_policy: Optional["BackupPolicy"] = None, - cors: Optional[List["CorsPolicy"]] = None, - network_acl_bypass: Optional[Union[str, "NetworkAclBypass"]] = None, - network_acl_bypass_resource_ids: Optional[List[str]] = None, - disable_local_auth: Optional[bool] = None, - **kwargs - ): - super(DatabaseAccountUpdateParameters, self).__init__(**kwargs) - self.tags = tags - self.location = location - self.identity = identity - self.consistency_policy = consistency_policy - self.locations = locations - self.ip_rules = ip_rules - self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled - self.enable_automatic_failover = enable_automatic_failover - self.capabilities = capabilities - self.virtual_network_rules = virtual_network_rules - self.enable_multiple_write_locations = enable_multiple_write_locations - self.enable_cassandra_connector = enable_cassandra_connector - self.connector_offer = connector_offer - self.disable_key_based_metadata_write_access = disable_key_based_metadata_write_access - self.key_vault_key_uri = key_vault_key_uri - self.default_identity = default_identity - self.public_network_access = public_network_access - self.enable_free_tier = enable_free_tier - self.api_properties = api_properties - self.enable_analytical_storage = enable_analytical_storage - self.analytical_storage_configuration = analytical_storage_configuration - self.backup_policy = backup_policy - self.cors = cors - self.network_acl_bypass = network_acl_bypass - self.network_acl_bypass_resource_ids = network_acl_bypass_resource_ids - self.disable_local_auth = disable_local_auth - - -class DatabaseRestoreResource(msrest.serialization.Model): - """Specific Databases to restore. - - :param database_name: The name of the database available for restore. - :type database_name: str - :param collection_names: The names of the collections available for restore. - :type collection_names: list[str] - """ - - _attribute_map = { - 'database_name': {'key': 'databaseName', 'type': 'str'}, - 'collection_names': {'key': 'collectionNames', 'type': '[str]'}, - } - - def __init__( - self, - *, - database_name: Optional[str] = None, - collection_names: Optional[List[str]] = None, - **kwargs - ): - super(DatabaseRestoreResource, self).__init__(**kwargs) - self.database_name = database_name - self.collection_names = collection_names - - -class ErrorResponse(msrest.serialization.Model): - """Error Response. - - :param code: Error code. - :type code: str - :param message: Error message indicating why the operation failed. - :type message: str - """ - - _attribute_map = { - 'code': {'key': 'code', 'type': 'str'}, - 'message': {'key': 'message', 'type': 'str'}, - } - - def __init__( - self, - *, - code: Optional[str] = None, - message: Optional[str] = None, + options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(ErrorResponse, self).__init__(**kwargs) - self.code = code - self.message = message + super(GraphResourceCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + self.resource = resource + self.options = options -class ExcludedPath(msrest.serialization.Model): - """ExcludedPath. +class GraphResourceGetPropertiesOptions(OptionsResource): + """GraphResourceGetPropertiesOptions. - :param path: The path for which the indexing behavior applies to. Index paths typically start - with root and end with wildcard (/path/*). - :type path: str + :param throughput: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + ThroughputSetting resource when retrieving offer details. + :type throughput: int + :param autoscale_settings: Specifies the Autoscale settings. + :type autoscale_settings: ~azure.mgmt.cosmosdb.models.AutoscaleSettings """ _attribute_map = { - 'path': {'key': 'path', 'type': 'str'}, + 'throughput': {'key': 'throughput', 'type': 'int'}, + 'autoscale_settings': {'key': 'autoscaleSettings', 'type': 'AutoscaleSettings'}, } def __init__( self, *, - path: Optional[str] = None, + throughput: Optional[int] = None, + autoscale_settings: Optional["AutoscaleSettings"] = None, **kwargs ): - super(ExcludedPath, self).__init__(**kwargs) - self.path = path + super(GraphResourceGetPropertiesOptions, self).__init__(throughput=throughput, autoscale_settings=autoscale_settings, **kwargs) -class FailoverPolicies(msrest.serialization.Model): - """The list of new failover policies for the failover priority change. +class GraphResourceGetPropertiesResource(GraphResource, ExtendedResourceProperties): + """GraphResourceGetPropertiesResource. + + 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 Azure. - :param failover_policies: Required. List of failover policies. - :type failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :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 + :param id: Required. Name of the Cosmos DB Graph. + :type id: str """ _validation = { - 'failover_policies': {'required': True}, + 'rid': {'readonly': True}, + 'ts': {'readonly': True}, + 'etag': {'readonly': True}, + 'id': {'required': True}, } _attribute_map = { - 'failover_policies': {'key': 'failoverPolicies', 'type': '[FailoverPolicy]'}, + 'rid': {'key': '_rid', 'type': 'str'}, + 'ts': {'key': '_ts', 'type': 'float'}, + 'etag': {'key': '_etag', 'type': 'str'}, + 'id': {'key': 'id', 'type': 'str'}, } def __init__( self, *, - failover_policies: List["FailoverPolicy"], + id: str, **kwargs ): - super(FailoverPolicies, self).__init__(**kwargs) - self.failover_policies = failover_policies + super(GraphResourceGetPropertiesResource, self).__init__(id=id, **kwargs) + self.rid = None + self.ts = None + self.etag = None + self.id = id -class FailoverPolicy(msrest.serialization.Model): - """The failover policy for a given region of a database account. +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 identifier of the region in which the database account replicates to. - Example: <accountName>-<locationName>. + :ivar id: The unique resource identifier of the ARM resource. :vartype id: str - :param location_name: The name of the region in which the database account exists. - :type location_name: str - :param failover_priority: The failover priority of the region. A failover priority of 0 - indicates a write region. The maximum value for a failover priority = (total number of regions - - 1). Failover priority values must be unique for each of the regions in which the database - account exists. - :type failover_priority: int + :ivar name: The name of the ARM resource. + :vartype name: str + :ivar type: The type of Azure resource. + :vartype type: str + :param location: The location of the resource group to which the resource belongs. + :type location: str + :param tags: A set of tags. Tags are a list of key-value pairs that describe the resource. + These tags can be used in viewing and grouping this resource (across resource groups). A + maximum of 15 tags can be provided for a resource. Each tag must have a key no greater than 128 + characters and value no greater than 256 characters. For example, the default experience for a + template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values + also include "Table", "Graph", "DocumentDB", and "MongoDB". + :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity + :param resource: + :type resource: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesResource + :param options: + :type options: ~azure.mgmt.cosmosdb.models.GraphResourceGetPropertiesOptions """ _validation = { 'id': {'readonly': True}, - 'failover_priority': {'minimum': 0}, + 'name': {'readonly': True}, + 'type': {'readonly': True}, } _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, - 'location_name': {'key': 'locationName', 'type': 'str'}, - 'failover_priority': {'key': 'failoverPriority', 'type': 'int'}, + '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_name: Optional[str] = None, - failover_priority: Optional[int] = None, + location: Optional[str] = None, + tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, + resource: Optional["GraphResourceGetPropertiesResource"] = None, + options: Optional["GraphResourceGetPropertiesOptions"] = None, **kwargs ): - super(FailoverPolicy, self).__init__(**kwargs) - self.id = None - self.location_name = location_name - self.failover_priority = failover_priority + super(GraphResourceGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + self.resource = resource + self.options = options + + +class GraphResourcesListResult(msrest.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 + ): + super(GraphResourcesListResult, self).__init__(**kwargs) + self.value = None class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): @@ -2322,6 +4006,8 @@ class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a Gremlin database. :type resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -2342,6 +4028,7 @@ 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'}, } @@ -2352,10 +4039,11 @@ def __init__( resource: "GremlinDatabaseResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(GremlinDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(GremlinDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -2477,6 +4165,8 @@ class GremlinDatabaseGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource :param options: @@ -2495,6 +4185,7 @@ 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'}, } @@ -2504,11 +4195,12 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["GremlinDatabaseGetPropertiesResource"] = None, options: Optional["GremlinDatabaseGetPropertiesOptions"] = None, **kwargs ): - super(GremlinDatabaseGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(GremlinDatabaseGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -2560,6 +4252,8 @@ class GremlinGraphCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a Gremlin graph. :type resource: ~azure.mgmt.cosmosdb.models.GremlinGraphResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -2580,6 +4274,7 @@ 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'}, } @@ -2590,10 +4285,11 @@ def __init__( resource: "GremlinGraphResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(GremlinGraphCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(GremlinGraphCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -2771,6 +4467,8 @@ class GremlinGraphGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource :param options: @@ -2789,6 +4487,7 @@ 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'}, } @@ -2798,11 +4497,12 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["GremlinGraphGetPropertiesResource"] = None, options: Optional["GremlinGraphGetPropertiesOptions"] = None, **kwargs ): - super(GremlinGraphGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(GremlinGraphGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -2965,6 +4665,77 @@ def __init__( self.ip_address_or_range = ip_address_or_range +class ListBackups(msrest.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 + ): + super(ListBackups, self).__init__(**kwargs) + self.value = None + + +class ListClusters(msrest.serialization.Model): + """List of managed Cassandra clusters. + + :param value: Container for the array of clusters. + :type value: list[~azure.mgmt.cosmosdb.models.ClusterResource] + """ + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ClusterResource]'}, + } + + def __init__( + self, + *, + value: Optional[List["ClusterResource"]] = None, + **kwargs + ): + super(ListClusters, self).__init__(**kwargs) + self.value = value + + +class ListDataCenters(msrest.serialization.Model): + """List of managed Cassandra data centers and their properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: Container for array of data centers. + :vartype value: list[~azure.mgmt.cosmosdb.models.DataCenterResource] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[DataCenterResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ListDataCenters, self).__init__(**kwargs) + self.value = None + + class Location(msrest.serialization.Model): """A region in which the Azure Cosmos DB database account is deployed. @@ -3029,6 +4800,111 @@ def __init__( self.is_zone_redundant = is_zone_redundant +class LocationGetResult(ARMProxyResource): + """Cosmos DB location get result. + + 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 + :param properties: Cosmos DB location metadata. + :type properties: ~azure.mgmt.cosmosdb.models.LocationProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'LocationProperties'}, + } + + def __init__( + self, + *, + properties: Optional["LocationProperties"] = None, + **kwargs + ): + super(LocationGetResult, self).__init__(**kwargs) + self.properties = properties + + +class LocationListResult(msrest.serialization.Model): + """The List operation response, that contains Cosmos DB locations and their properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Cosmos DB locations and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.LocationGetResult] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[LocationGetResult]'}, + } + + def __init__( + self, + **kwargs + ): + super(LocationListResult, self).__init__(**kwargs) + self.value = None + + +class LocationProperties(msrest.serialization.Model): + """Cosmos DB location metadata. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar status: The current status of location in Azure. + :vartype status: str + :ivar supports_availability_zone: Flag indicating whether the location supports availability + zones or not. + :vartype supports_availability_zone: bool + :ivar is_residency_restricted: Flag indicating whether the location is residency sensitive. + :vartype is_residency_restricted: bool + :ivar backup_storage_redundancies: The properties of available backup storage redundancies. + :vartype backup_storage_redundancies: list[str or + ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy] + """ + + _validation = { + 'status': {'readonly': True}, + 'supports_availability_zone': {'readonly': True}, + 'is_residency_restricted': {'readonly': True}, + 'backup_storage_redundancies': {'readonly': True}, + } + + _attribute_map = { + 'status': {'key': 'status', 'type': 'str'}, + 'supports_availability_zone': {'key': 'supportsAvailabilityZone', 'type': 'bool'}, + 'is_residency_restricted': {'key': 'isResidencyRestricted', 'type': 'bool'}, + 'backup_storage_redundancies': {'key': 'backupStorageRedundancies', 'type': '[str]'}, + } + + def __init__( + self, + **kwargs + ): + super(LocationProperties, self).__init__(**kwargs) + self.status = None + self.supports_availability_zone = None + self.is_residency_restricted = None + self.backup_storage_redundancies = None + + class ManagedServiceIdentity(msrest.serialization.Model): """Identity for the resource. @@ -3358,6 +5234,8 @@ class MongoDBCollectionCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a MongoDB collection. :type resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -3378,6 +5256,7 @@ 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'}, } @@ -3388,10 +5267,11 @@ def __init__( resource: "MongoDBCollectionResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(MongoDBCollectionCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(MongoDBCollectionCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -3543,6 +5423,8 @@ class MongoDBCollectionGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource :param options: @@ -3561,6 +5443,7 @@ 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'}, } @@ -3570,11 +5453,12 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["MongoDBCollectionGetPropertiesResource"] = None, options: Optional["MongoDBCollectionGetPropertiesOptions"] = None, **kwargs ): - super(MongoDBCollectionGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(MongoDBCollectionGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -3626,6 +5510,8 @@ class MongoDBDatabaseCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a MongoDB database. :type resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -3646,6 +5532,7 @@ 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'}, } @@ -3656,10 +5543,11 @@ def __init__( resource: "MongoDBDatabaseResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(MongoDBDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(MongoDBDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -3781,6 +5669,8 @@ class MongoDBDatabaseGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource :param options: @@ -3799,6 +5689,7 @@ 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'}, } @@ -3808,11 +5699,12 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["MongoDBDatabaseGetPropertiesResource"] = None, options: Optional["MongoDBDatabaseGetPropertiesOptions"] = None, **kwargs ): - super(MongoDBDatabaseGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(MongoDBDatabaseGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -4535,6 +6427,9 @@ class PeriodicModeProperties(msrest.serialization.Model): :param backup_retention_interval_in_hours: An integer representing the time (in hours) that each backup is retained. :type backup_retention_interval_in_hours: int + :param backup_storage_redundancy: Enum to indicate type of backup residency. Possible values + include: "Geo", "Local", "Zone". + :type backup_storage_redundancy: str or ~azure.mgmt.cosmosdb.models.BackupStorageRedundancy """ _validation = { @@ -4545,6 +6440,7 @@ class PeriodicModeProperties(msrest.serialization.Model): _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__( @@ -4552,11 +6448,13 @@ def __init__( *, backup_interval_in_minutes: Optional[int] = None, backup_retention_interval_in_hours: Optional[int] = None, + backup_storage_redundancy: Optional[Union[str, "BackupStorageRedundancy"]] = None, **kwargs ): super(PeriodicModeProperties, self).__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(msrest.serialization.Model): @@ -4887,6 +6785,39 @@ def __init__( self.region = region +class RepairPostBody(msrest.serialization.Model): + """Specification of the keyspaces and tables to run repair on. + + All required parameters must be populated in order to send to Azure. + + :param keyspace: Required. The name of the keyspace that repair should be run on. + :type keyspace: str + :param tables: List of tables in the keyspace to repair. If omitted, repair all tables in the + keyspace. + :type tables: list[str] + """ + + _validation = { + 'keyspace': {'required': True}, + } + + _attribute_map = { + 'keyspace': {'key': 'keyspace', 'type': 'str'}, + 'tables': {'key': 'tables', 'type': '[str]'}, + } + + def __init__( + self, + *, + keyspace: str, + tables: Optional[List[str]] = None, + **kwargs + ): + super(RepairPostBody, self).__init__(**kwargs) + self.keyspace = keyspace + self.tables = tables + + class RestorableDatabaseAccountGetResult(msrest.serialization.Model): """A Azure Cosmos DB restorable database account. @@ -5656,13 +7587,15 @@ def __init__( self.id = id -class RestorableSqlDatabasePropertiesResourceDatabase(SqlDatabaseResource, ExtendedResourceProperties): +class RestorableSqlDatabasePropertiesResourceDatabase(ExtendedResourceProperties, SqlDatabaseResource): """Cosmos DB SQL database 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 Azure. + :param id: Required. Name of the Cosmos DB SQL database. + :type id: str :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. @@ -5670,8 +7603,6 @@ class RestorableSqlDatabasePropertiesResourceDatabase(SqlDatabaseResource, Exten :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :param id: Required. Name of the Cosmos DB SQL database. - :type id: str :ivar colls: A system generated property that specified the addressable path of the collections resource. :vartype colls: str @@ -5684,20 +7615,20 @@ class RestorableSqlDatabasePropertiesResourceDatabase(SqlDatabaseResource, Exten """ _validation = { + 'id': {'required': True}, 'rid': {'readonly': True}, 'ts': {'readonly': True}, 'etag': {'readonly': True}, - 'id': {'required': True}, 'colls': {'readonly': True}, 'users': {'readonly': True}, 'self_property': {'readonly': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'rid': {'key': '_rid', 'type': 'str'}, 'ts': {'key': '_ts', 'type': 'float'}, 'etag': {'key': '_etag', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, 'colls': {'key': '_colls', 'type': 'str'}, 'users': {'key': '_users', 'type': 'str'}, 'self_property': {'key': '_self', 'type': 'str'}, @@ -5710,13 +7641,13 @@ def __init__( **kwargs ): super(RestorableSqlDatabasePropertiesResourceDatabase, self).__init__(id=id, **kwargs) - self.rid = None - self.ts = None - self.etag = None + self.id = id self.colls = None self.users = None self.self_property = None - self.id = id + self.rid = None + self.ts = None + self.etag = None self.colls = None self.users = None self.self_property = None @@ -5811,6 +7742,127 @@ def __init__( self.databases_to_restore = databases_to_restore +class SeedNode(msrest.serialization.Model): + """SeedNode. + + :param ip_address: IP address of this seed node. + :type ip_address: str + """ + + _attribute_map = { + 'ip_address': {'key': 'ipAddress', 'type': 'str'}, + } + + def __init__( + self, + *, + ip_address: Optional[str] = None, + **kwargs + ): + super(SeedNode, self).__init__(**kwargs) + self.ip_address = ip_address + + +class ServiceResource(ARMProxyResource): + """Properties for the database account. + + 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 + :param properties: Services response resource. + :type properties: ~azure.mgmt.cosmosdb.models.ServiceResourceProperties + """ + + _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'}, + 'properties': {'key': 'properties', 'type': 'ServiceResourceProperties'}, + } + + def __init__( + self, + *, + properties: Optional["ServiceResourceProperties"] = None, + **kwargs + ): + super(ServiceResource, self).__init__(**kwargs) + self.properties = properties + + +class ServiceResourceCreateUpdateParameters(msrest.serialization.Model): + """Parameters for Create or Update Request for ServiceResource. + + :param instance_size: Instance type for the service. Possible values include: "Cosmos.D4s", + "Cosmos.D8s", "Cosmos.D16s". + :type instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :param instance_count: Instance count for the service. + :type instance_count: int + :param service_type: ServiceType for the service. Possible values include: + "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute". + :type service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + """ + + _validation = { + 'instance_count': {'minimum': 0}, + } + + _attribute_map = { + 'instance_size': {'key': 'properties.instanceSize', 'type': 'str'}, + 'instance_count': {'key': 'properties.instanceCount', 'type': 'int'}, + 'service_type': {'key': 'properties.serviceType', 'type': 'str'}, + } + + def __init__( + self, + *, + instance_size: Optional[Union[str, "ServiceSize"]] = None, + instance_count: Optional[int] = None, + service_type: Optional[Union[str, "ServiceType"]] = None, + **kwargs + ): + super(ServiceResourceCreateUpdateParameters, self).__init__(**kwargs) + self.instance_size = instance_size + self.instance_count = instance_count + self.service_type = service_type + + +class ServiceResourceListResult(msrest.serialization.Model): + """The List operation response, that contains the Service Resource and their properties. + + Variables are only populated by the server, and will be ignored when sending a request. + + :ivar value: List of Service Resource and their properties. + :vartype value: list[~azure.mgmt.cosmosdb.models.ServiceResource] + """ + + _validation = { + 'value': {'readonly': True}, + } + + _attribute_map = { + 'value': {'key': 'value', 'type': '[ServiceResource]'}, + } + + def __init__( + self, + **kwargs + ): + super(ServiceResourceListResult, self).__init__(**kwargs) + self.value = None + + class SpatialSpec(msrest.serialization.Model): """SpatialSpec. @@ -5860,6 +7912,8 @@ class SqlContainerCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a container. :type resource: ~azure.mgmt.cosmosdb.models.SqlContainerResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -5880,6 +7934,7 @@ 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'}, } @@ -5890,10 +7945,11 @@ def __init__( resource: "SqlContainerResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(SqlContainerCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(SqlContainerCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -6021,6 +8077,8 @@ class SqlContainerGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource :param options: @@ -6039,6 +8097,7 @@ 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'}, } @@ -6048,11 +8107,12 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["SqlContainerGetPropertiesResource"] = None, options: Optional["SqlContainerGetPropertiesOptions"] = None, **kwargs ): - super(SqlContainerGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(SqlContainerGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -6104,6 +8164,8 @@ class SqlDatabaseCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a SQL database. :type resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -6124,6 +8186,7 @@ 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'}, } @@ -6134,10 +8197,11 @@ def __init__( resource: "SqlDatabaseResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(SqlDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(SqlDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -6167,13 +8231,15 @@ def __init__( super(SqlDatabaseGetPropertiesOptions, self).__init__(throughput=throughput, autoscale_settings=autoscale_settings, **kwargs) -class SqlDatabaseGetPropertiesResource(SqlDatabaseResource, ExtendedResourceProperties): +class SqlDatabaseGetPropertiesResource(ExtendedResourceProperties, SqlDatabaseResource): """SqlDatabaseGetPropertiesResource. 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 Azure. + :param id: Required. Name of the Cosmos DB SQL database. + :type id: str :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. @@ -6181,8 +8247,6 @@ class SqlDatabaseGetPropertiesResource(SqlDatabaseResource, ExtendedResourceProp :ivar etag: A system generated property representing the resource etag required for optimistic concurrency control. :vartype etag: str - :param id: Required. Name of the Cosmos DB SQL database. - :type id: str :param colls: A system generated property that specified the addressable path of the collections resource. :type colls: str @@ -6192,17 +8256,17 @@ class SqlDatabaseGetPropertiesResource(SqlDatabaseResource, ExtendedResourceProp """ _validation = { + 'id': {'required': True}, 'rid': {'readonly': True}, 'ts': {'readonly': True}, 'etag': {'readonly': True}, - 'id': {'required': True}, } _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, 'rid': {'key': '_rid', 'type': 'str'}, 'ts': {'key': '_ts', 'type': 'float'}, 'etag': {'key': '_etag', 'type': 'str'}, - 'id': {'key': 'id', 'type': 'str'}, 'colls': {'key': '_colls', 'type': 'str'}, 'users': {'key': '_users', 'type': 'str'}, } @@ -6216,14 +8280,14 @@ def __init__( **kwargs ): super(SqlDatabaseGetPropertiesResource, self).__init__(id=id, **kwargs) + self.id = id + self.colls = colls + self.users = users self.rid = None self.ts = None self.etag = None self.colls = colls self.users = users - self.id = id - self.colls = colls - self.users = users class SqlDatabaseGetResults(ARMResourceProperties): @@ -6246,6 +8310,8 @@ class SqlDatabaseGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource :param options: @@ -6264,6 +8330,7 @@ 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'}, } @@ -6273,11 +8340,12 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["SqlDatabaseGetPropertiesResource"] = None, options: Optional["SqlDatabaseGetPropertiesOptions"] = None, **kwargs ): - super(SqlDatabaseGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(SqlDatabaseGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -6307,6 +8375,129 @@ def __init__( self.value = None +class SqlDedicatedGatewayRegionalServiceResource(RegionalServiceResource): + """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. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "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 + ): + super(SqlDedicatedGatewayRegionalServiceResource, self).__init__(**kwargs) + self.sql_dedicated_gateway_endpoint = None + + +class SqlDedicatedGatewayServiceResource(msrest.serialization.Model): + """Describes the service response property for SqlDedicatedGateway. + + :param properties: Properties for SqlDedicatedGatewayServiceResource. + :type properties: ~azure.mgmt.cosmosdb.models.SqlDedicatedGatewayServiceResourceProperties + """ + + _attribute_map = { + 'properties': {'key': 'properties', 'type': 'SqlDedicatedGatewayServiceResourceProperties'}, + } + + def __init__( + self, + *, + properties: Optional["SqlDedicatedGatewayServiceResourceProperties"] = None, + **kwargs + ): + super(SqlDedicatedGatewayServiceResource, self).__init__(**kwargs) + self.properties = properties + + +class SqlDedicatedGatewayServiceResourceProperties(ServiceResourceProperties): + """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 Azure. + + :param additional_properties: Unmatched properties from the message are deserialized to this + collection. + :type additional_properties: dict[str, any] + :ivar creation_time: Time of the last state change (ISO-8601 format). + :vartype creation_time: ~datetime.datetime + :param instance_size: Instance type for the service. Possible values include: "Cosmos.D4s", + "Cosmos.D8s", "Cosmos.D16s". + :type instance_size: str or ~azure.mgmt.cosmosdb.models.ServiceSize + :param instance_count: Instance count for the service. + :type instance_count: int + :param service_type: Required. ServiceType for the service.Constant filled by server. Possible + values include: "SqlDedicatedGateway", "DataTransfer", "GraphAPICompute". + :type service_type: str or ~azure.mgmt.cosmosdb.models.ServiceType + :ivar status: Describes the status of a service. Possible values include: "Creating", + "Running", "Updating", "Deleting", "Error", "Stopped". + :vartype status: str or ~azure.mgmt.cosmosdb.models.ServiceStatus + :param sql_dedicated_gateway_endpoint: SqlDedicatedGateway endpoint for the service. + :type sql_dedicated_gateway_endpoint: str + :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'}, + 'locations': {'key': 'locations', 'type': '[SqlDedicatedGatewayRegionalServiceResource]'}, + } + + def __init__( + self, + *, + additional_properties: Optional[Dict[str, Any]] = None, + instance_size: Optional[Union[str, "ServiceSize"]] = None, + instance_count: Optional[int] = None, + sql_dedicated_gateway_endpoint: Optional[str] = None, + **kwargs + ): + super(SqlDedicatedGatewayServiceResourceProperties, self).__init__(additional_properties=additional_properties, instance_size=instance_size, instance_count=instance_count, **kwargs) + self.service_type = 'SqlDedicatedGateway' # type: str + self.sql_dedicated_gateway_endpoint = sql_dedicated_gateway_endpoint + self.locations = None + + class SqlRoleAssignmentCreateUpdateParameters(msrest.serialization.Model): """Parameters to create and update an Azure Cosmos DB SQL Role Assignment. @@ -6565,6 +8756,8 @@ class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a storedProcedure. :type resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -6585,6 +8778,7 @@ class SqlStoredProcedureCreateUpdateParameters(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': 'SqlStoredProcedureResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -6595,10 +8789,11 @@ def __init__( resource: "SqlStoredProcedureResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(SqlStoredProcedureCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(SqlStoredProcedureCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -6705,6 +8900,8 @@ class SqlStoredProcedureGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource """ @@ -6721,6 +8918,7 @@ class SqlStoredProcedureGetResults(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': 'SqlStoredProcedureGetPropertiesResource'}, } @@ -6729,10 +8927,11 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["SqlStoredProcedureGetPropertiesResource"] = None, **kwargs ): - super(SqlStoredProcedureGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(SqlStoredProcedureGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource @@ -6783,6 +8982,8 @@ class SqlTriggerCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a trigger. :type resource: ~azure.mgmt.cosmosdb.models.SqlTriggerResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -6803,6 +9004,7 @@ 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'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -6813,10 +9015,11 @@ def __init__( resource: "SqlTriggerResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(SqlTriggerCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(SqlTriggerCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -6945,6 +9148,8 @@ class SqlTriggerGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource """ @@ -6961,6 +9166,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'}, } @@ -6969,10 +9175,11 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["SqlTriggerGetPropertiesResource"] = None, **kwargs ): - super(SqlTriggerGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(SqlTriggerGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource @@ -7023,6 +9230,8 @@ class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a userDefinedFunction. :type resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -7043,6 +9252,7 @@ class SqlUserDefinedFunctionCreateUpdateParameters(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': 'SqlUserDefinedFunctionResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -7053,10 +9263,11 @@ def __init__( resource: "SqlUserDefinedFunctionResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(SqlUserDefinedFunctionCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(SqlUserDefinedFunctionCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -7163,6 +9374,8 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource """ @@ -7179,6 +9392,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'}, } @@ -7187,10 +9401,11 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["SqlUserDefinedFunctionGetPropertiesResource"] = None, **kwargs ): - super(SqlUserDefinedFunctionGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(SqlUserDefinedFunctionGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource @@ -7289,6 +9504,8 @@ class TableCreateUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a Table. :type resource: ~azure.mgmt.cosmosdb.models.TableResource :param options: A key-value pair of options to be applied for the request. This corresponds to @@ -7309,6 +9526,7 @@ 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'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -7319,10 +9537,11 @@ def __init__( resource: "TableResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, options: Optional["CreateUpdateOptions"] = None, **kwargs ): - super(TableCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(TableCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -7444,6 +9663,8 @@ class TableGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource :param options: @@ -7462,6 +9683,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'}, } @@ -7471,11 +9693,12 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["TableGetPropertiesResource"] = None, options: Optional["TableGetPropertiesOptions"] = None, **kwargs ): - super(TableGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(TableGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource self.options = options @@ -7654,6 +9877,8 @@ class ThroughputSettingsGetResults(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetPropertiesResource """ @@ -7670,6 +9895,7 @@ 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'}, } @@ -7678,10 +9904,11 @@ def __init__( *, location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, resource: Optional["ThroughputSettingsGetPropertiesResource"] = None, **kwargs ): - super(ThroughputSettingsGetResults, self).__init__(location=location, tags=tags, **kwargs) + super(ThroughputSettingsGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource @@ -7707,6 +9934,8 @@ class ThroughputSettingsUpdateParameters(ARMResourceProperties): template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". :type tags: dict[str, str] + :param identity: Identity for the resource. + :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a resource throughput. :type resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsResource """ @@ -7724,6 +9953,7 @@ 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'}, } @@ -7733,9 +9963,10 @@ def __init__( resource: "ThroughputSettingsResource", location: Optional[str] = None, tags: Optional[Dict[str, str]] = None, + identity: Optional["ManagedServiceIdentity"] = None, **kwargs ): - super(ThroughputSettingsUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + super(ThroughputSettingsUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) self.resource = resource 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 a265f7a8b397..a7c7808a801a 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,11 +19,13 @@ 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 ._cosmos_db_management_client_operations import CosmosDBManagementClientOperationsMixin from ._notebook_workspaces_operations import NotebookWorkspacesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations @@ -34,6 +36,9 @@ from ._restorable_mongodb_databases_operations import RestorableMongodbDatabasesOperations from ._restorable_mongodb_collections_operations import RestorableMongodbCollectionsOperations from ._restorable_mongodb_resources_operations import RestorableMongodbResourcesOperations +from ._cassandra_clusters_operations import CassandraClustersOperations +from ._cassandra_data_centers_operations import CassandraDataCentersOperations +from ._service_operations import ServiceOperations __all__ = [ 'DatabaseAccountsOperations', @@ -49,11 +54,13 @@ 'CollectionPartitionOperations', 'PartitionKeyRangeIdOperations', 'PartitionKeyRangeIdRegionOperations', + 'GraphResourcesOperations', 'SqlResourcesOperations', 'MongoDBResourcesOperations', 'TableResourcesOperations', 'CassandraResourcesOperations', 'GremlinResourcesOperations', + 'CosmosDBManagementClientOperationsMixin', 'NotebookWorkspacesOperations', 'PrivateEndpointConnectionsOperations', 'PrivateLinkResourcesOperations', @@ -64,4 +71,7 @@ 'RestorableMongodbDatabasesOperations', 'RestorableMongodbCollectionsOperations', 'RestorableMongodbResourcesOperations', + 'CassandraClustersOperations', + 'CassandraDataCentersOperations', + 'ServiceOperations', ] 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 2a3f408d8a13..a0e0f51b58da 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 @@ -64,7 +64,7 @@ def list_by_subscription( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -134,7 +134,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -147,7 +147,7 @@ def prepare_request(next_link=None): url = self.list_by_resource_group.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -208,15 +208,15 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -256,15 +256,15 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -304,8 +304,8 @@ def begin_delete( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -336,8 +336,8 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -367,7 +367,7 @@ def _create_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -375,8 +375,8 @@ def _create_update_initial( url = self._create_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -431,8 +431,8 @@ def begin_create_update( :type body: ~azure.mgmt.cosmosdb.models.ClusterResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either ClusterResource or the result of cls(response) @@ -467,8 +467,8 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -498,7 +498,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -506,8 +506,8 @@ def _update_initial( url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -561,8 +561,8 @@ def begin_update( :type body: ~azure.mgmt.cosmosdb.models.ClusterResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either ClusterResource or the result of cls(response) @@ -597,8 +597,8 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -628,7 +628,7 @@ def _request_repair_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -636,8 +636,8 @@ def _request_repair_initial( url = self._request_repair_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -684,8 +684,8 @@ def begin_request_repair( :type body: ~azure.mgmt.cosmosdb.models.RepairPostBody :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -717,8 +717,8 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -747,15 +747,15 @@ def _fetch_node_status_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self._fetch_node_status_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -800,8 +800,8 @@ def begin_fetch_node_status( :type cluster_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either ClusterNodeStatus or the result of cls(response) @@ -835,8 +835,8 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -876,7 +876,7 @@ def list_backups( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -889,8 +889,8 @@ def prepare_request(next_link=None): url = self.list_backups.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -954,15 +954,15 @@ def get_backup( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self.get_backup.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), 'backupId': self._serialize.url("backup_id", backup_id, 'str', max_length=15, min_length=1, pattern=r'^[0-9]+$'), } url = self._client.format_url(url, **path_format_arguments) 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 4896dd2ee4ac..2de44375e68a 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 @@ -70,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -83,8 +83,8 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) # Construct parameters @@ -148,16 +148,16 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -198,16 +198,16 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -250,8 +250,8 @@ def begin_delete( :type data_center_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -283,9 +283,9 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -316,7 +316,7 @@ def _create_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -324,9 +324,9 @@ def _create_update_initial( url = self._create_update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -384,8 +384,8 @@ def begin_create_update( :type body: ~azure.mgmt.cosmosdb.models.DataCenterResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DataCenterResource or the result of cls(response) @@ -421,9 +421,9 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) @@ -454,7 +454,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -462,9 +462,9 @@ def _update_initial( url = self._update_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } url = self._client.format_url(url, **path_format_arguments) @@ -521,8 +521,8 @@ def begin_update( :type body: ~azure.mgmt.cosmosdb.models.DataCenterResource :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either DataCenterResource or the result of cls(response) @@ -558,9 +558,9 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), - 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), - 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'clusterName': self._serialize.url("cluster_name", cluster_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), + 'dataCenterName': self._serialize.url("data_center_name", data_center_name, 'str', max_length=100, min_length=1, pattern=r'^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*$'), } if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) 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 49a461b5be8f..55ec864e163a 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 @@ -70,7 +70,7 @@ def list_cassandra_keyspaces( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -149,7 +149,7 @@ def get_cassandra_keyspace( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -200,7 +200,7 @@ def _create_update_cassandra_keyspace_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -335,7 +335,7 @@ def _delete_cassandra_keyspace_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_cassandra_keyspace_initial.metadata['url'] # type: ignore @@ -464,7 +464,7 @@ def get_cassandra_keyspace_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -515,7 +515,7 @@ def _update_cassandra_keyspace_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -650,7 +650,7 @@ def _migrate_cassandra_keyspace_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -775,7 +775,7 @@ def _migrate_cassandra_keyspace_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -913,7 +913,7 @@ def list_cassandra_tables( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -995,7 +995,7 @@ def get_cassandra_table( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1048,7 +1048,7 @@ def _create_update_cassandra_table_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1190,7 +1190,7 @@ def _delete_cassandra_table_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_cassandra_table_initial.metadata['url'] # type: ignore @@ -1328,7 +1328,7 @@ def get_cassandra_table_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1381,7 +1381,7 @@ def _update_cassandra_table_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1523,7 +1523,7 @@ def _migrate_cassandra_table_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1655,7 +1655,7 @@ def _migrate_cassandra_table_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1772,3 +1772,889 @@ def get_long_running_output(pipeline_response): else: return LROPoller(self._client, raw_result, get_long_running_output, polling_method) begin_migrate_cassandra_table_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput'} # type: ignore + + def list_cassandra_views( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.CassandraViewListResult"] + """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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either CassandraViewListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.CassandraViewListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CassandraViewListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_cassandra_views.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + return request + + 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) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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 + ) + list_cassandra_views.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views'} # type: ignore + + def get_cassandra_view( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: CassandraViewGetResults, or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.CassandraViewGetResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.CassandraViewGetResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_cassandra_view.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_cassandra_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}'} # type: ignore + + def _create_update_cassandra_view_initial( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + create_update_cassandra_view_parameters, # type: "_models.CassandraViewCreateUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.CassandraViewGetResults"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.CassandraViewGetResults"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_update_cassandra_view_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(create_update_cassandra_view_parameters, 'CassandraViewCreateUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('CassandraViewGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_update_cassandra_view_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}'} # type: ignore + + def begin_create_update_cassandra_view( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + create_update_cassandra_view_parameters, # type: "_models.CassandraViewCreateUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :param create_update_cassandra_view_parameters: The parameters to provide for the current + Cassandra View. + :type create_update_cassandra_view_parameters: ~azure.mgmt.cosmosdb.models.CassandraViewCreateUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :return: An instance of LROPoller that returns either CassandraViewGetResults or the result of cls(response) + :rtype: ~azure.core.polling.LROPoller[~azure.mgmt.cosmosdb.models.CassandraViewGetResults] + :raises ~azure.core.exceptions.HttpResponseError: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.CassandraViewGetResults"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('CassandraViewGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_update_cassandra_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}'} # type: ignore + + def _delete_cassandra_view_initial( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + + # Construct URL + url = self._delete_cassandra_view_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_cassandra_view_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}'} # type: ignore + + def begin_delete_cassandra_view( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller[None] + """Deletes an existing Azure Cosmos DB Cassandra view. + + :param resource_group_name: The name of the resource group. The name is case insensitive. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = self._delete_cassandra_view_initial( + resource_group_name=resource_group_name, + account_name=account_name, + keyspace_name=keyspace_name, + view_name=view_name, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_cassandra_view.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}'} # type: ignore + + def get_cassandra_view_throughput( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: ThroughputSettingsGetResults, or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.ThroughputSettingsGetResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_cassandra_view_throughput.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_cassandra_view_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default'} # type: ignore + + def _update_cassandra_view_throughput_initial( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + update_throughput_parameters, # type: "_models.ThroughputSettingsUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ThroughputSettingsGetResults"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ThroughputSettingsGetResults"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._update_cassandra_view_throughput_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(update_throughput_parameters, 'ThroughputSettingsUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _update_cassandra_view_throughput_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default'} # type: ignore + + def begin_update_cassandra_view_throughput( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + update_throughput_parameters, # type: "_models.ThroughputSettingsUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :param update_throughput_parameters: The RUs per second of the parameters to provide for the + current Cassandra view. + :type update_throughput_parameters: ~azure.mgmt.cosmosdb.models.ThroughputSettingsUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ThroughputSettingsGetResults"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_update_cassandra_view_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default'} # type: ignore + + def _migrate_cassandra_view_to_autoscale_initial( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ThroughputSettingsGetResults"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ThroughputSettingsGetResults"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + # Construct URL + url = self._migrate_cassandra_view_to_autoscale_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_cassandra_view_to_autoscale_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale'} # type: ignore + + def begin_migrate_cassandra_view_to_autoscale( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ThroughputSettingsGetResults"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_cassandra_view_to_autoscale.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale'} # type: ignore + + def _migrate_cassandra_view_to_manual_throughput_initial( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.ThroughputSettingsGetResults"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.ThroughputSettingsGetResults"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + # Construct URL + url = self._migrate_cassandra_view_to_manual_throughput_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.post(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _migrate_cassandra_view_to_manual_throughput_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput'} # type: ignore + + def begin_migrate_cassandra_view_to_manual_throughput( + self, + resource_group_name, # type: str + account_name, # type: str + keyspace_name, # type: str + view_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> LROPoller["_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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param keyspace_name: Cosmos DB keyspace name. + :type keyspace_name: str + :param view_name: Cosmos DB view name. + :type view_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.ThroughputSettingsGetResults"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + if cont_token is None: + raw_result = 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('ThroughputSettingsGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'keyspaceName': self._serialize.url("keyspace_name", keyspace_name, 'str'), + 'viewName': self._serialize.url("view_name", view_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_migrate_cassandra_view_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput'} # 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 5a01bcf883c4..5ae1c3224216 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 @@ -80,7 +80,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -168,7 +168,7 @@ def list_usages( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -253,7 +253,7 @@ def list_metric_definitions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 400a1ecc55b8..c63a2588d1dd 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 @@ -80,7 +80,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -168,7 +168,7 @@ def list_usages( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 6e5c6d657227..33d2f61a1c3d 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 @@ -83,7 +83,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 cf7289d24510..a9adf327fecd 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 @@ -83,7 +83,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cosmos_db_management_client_operations.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cosmos_db_management_client_operations.py index 3d245251db00..9666cad8e3fc 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cosmos_db_management_client_operations.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_cosmos_db_management_client_operations.py @@ -42,7 +42,7 @@ def location_list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -112,7 +112,7 @@ def location_get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL 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 d42a97e399a9..5a70940cff00 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 @@ -76,7 +76,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 eff67f3dd187..1d5e50ab25e6 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 @@ -70,7 +70,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -119,7 +119,7 @@ def _update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -245,7 +245,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -371,7 +371,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore @@ -480,7 +480,7 @@ def _failover_priority_change_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -605,7 +605,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -675,7 +675,7 @@ def list_by_resource_group( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -749,7 +749,7 @@ def list_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -808,7 +808,7 @@ def list_connection_strings( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -857,7 +857,7 @@ def _offline_region_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -978,7 +978,7 @@ def _online_region_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1109,7 +1109,7 @@ def get_read_only_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1168,7 +1168,7 @@ def list_read_only_keys( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1217,7 +1217,7 @@ def _regenerate_key_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") # Construct URL @@ -1344,7 +1344,7 @@ def check_name_exists( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self.check_name_exists.metadata['url'] # type: ignore @@ -1402,7 +1402,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1482,7 +1482,7 @@ def list_usages( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1559,7 +1559,7 @@ def list_metric_definitions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 4b4b3c74a152..6551e716d1c1 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 @@ -77,7 +77,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -161,7 +161,7 @@ def list_usages( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -242,7 +242,7 @@ def list_metric_definitions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 new file mode 100644 index 000000000000..f682ecb4c21f --- /dev/null +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_graph_resources_operations.py @@ -0,0 +1,437 @@ +# 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 typing import TYPE_CHECKING +import warnings + +from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error +from azure.core.paging import ItemPaged +from azure.core.pipeline import PipelineResponse +from azure.core.pipeline.transport import HttpRequest, HttpResponse +from azure.core.polling import LROPoller, NoPolling, PollingMethod +from azure.mgmt.core.exceptions import ARMErrorFormat +from azure.mgmt.core.polling.arm_polling import ARMPolling + +from .. import models as _models + +if TYPE_CHECKING: + # pylint: disable=unused-import,ungrouped-imports + from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar, Union + + T = TypeVar('T') + ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]] + +class GraphResourcesOperations(object): + """GraphResourcesOperations operations. + + You should not instantiate this class directly. Instead, you should create a Client instance that + instantiates it for you and attaches it as an attribute. + + :ivar models: Alias to model classes used in this operation group. + :type models: ~azure.mgmt.cosmosdb.models + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + """ + + models = _models + + def __init__(self, client, config, serializer, deserializer): + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self._config = config + + def list_graphs( + self, + resource_group_name, # type: str + account_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> Iterable["_models.GraphResourcesListResult"] + """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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: An iterator like instance of either GraphResourcesListResult or the result of cls(response) + :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.cosmosdb.models.GraphResourcesListResult] + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GraphResourcesListResult"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + def prepare_request(next_link=None): + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + if not next_link: + # Construct URL + url = self.list_graphs.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + } + url = self._client.format_url(url, **path_format_arguments) + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + else: + url = next_link + query_parameters = {} # type: Dict[str, Any] + request = self._client.get(url, query_parameters, header_parameters) + 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) + return None, iter(list_of_elem) + + def get_next(next_link=None): + request = prepare_request(next_link) + + pipeline_response = self._client._pipeline.run(request, stream=False, **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 + ) + list_graphs.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs'} # type: ignore + + def get_graph( + self, + resource_group_name, # type: str + account_name, # type: str + graph_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> "_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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param graph_name: Cosmos DB graph resource name. + :type graph_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :return: GraphResourceGetResults, or the result of cls(response) + :rtype: ~azure.mgmt.cosmosdb.models.GraphResourceGetResults + :raises: ~azure.core.exceptions.HttpResponseError + """ + cls = kwargs.pop('cls', None) # type: ClsType["_models.GraphResourceGetResults"] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + accept = "application/json" + + # Construct URL + url = self.get_graph.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + request = self._client.get(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **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) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + get_graph.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}'} # type: ignore + + def _create_update_graph_initial( + self, + resource_group_name, # type: str + account_name, # type: str + graph_name, # type: str + create_update_graph_parameters, # type: "_models.GraphResourceCreateUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> Optional["_models.GraphResourceGetResults"] + cls = kwargs.pop('cls', None) # type: ClsType[Optional["_models.GraphResourceGetResults"]] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + content_type = kwargs.pop("content_type", "application/json") + accept = "application/json" + + # Construct URL + url = self._create_update_graph_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + header_parameters['Content-Type'] = self._serialize.header("content_type", content_type, 'str') + header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') + + body_content_kwargs = {} # type: Dict[str, Any] + body_content = self._serialize.body(create_update_graph_parameters, 'GraphResourceCreateUpdateParameters') + body_content_kwargs['content'] = body_content + request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + deserialized = None + if response.status_code == 200: + deserialized = self._deserialize('GraphResourceGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + + return deserialized + _create_update_graph_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}'} # type: ignore + + def begin_create_update_graph( + self, + resource_group_name, # type: str + account_name, # type: str + graph_name, # type: str + create_update_graph_parameters, # type: "_models.GraphResourceCreateUpdateParameters" + **kwargs # type: Any + ): + # type: (...) -> 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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param graph_name: Cosmos DB graph resource name. + :type graph_name: str + :param create_update_graph_parameters: The parameters to provide for the current graph. + :type create_update_graph_parameters: ~azure.mgmt.cosmosdb.models.GraphResourceCreateUpdateParameters + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType["_models.GraphResourceGetResults"] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + deserialized = self._deserialize('GraphResourceGetResults', pipeline_response) + + if cls: + return cls(pipeline_response, deserialized, {}) + return deserialized + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_create_update_graph.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}'} # type: ignore + + def _delete_graph_resource_initial( + self, + resource_group_name, # type: str + account_name, # type: str + graph_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> None + cls = kwargs.pop('cls', None) # type: ClsType[None] + error_map = { + 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError + } + error_map.update(kwargs.pop('error_map', {})) + api_version = "2021-07-01-preview" + + # Construct URL + url = self._delete_graph_resource_initial.metadata['url'] # type: ignore + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str'), + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} # type: Dict[str, Any] + query_parameters['api-version'] = self._serialize.query("api_version", api_version, 'str') + + # Construct headers + header_parameters = {} # type: Dict[str, Any] + + request = self._client.delete(url, query_parameters, header_parameters) + pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) + response = pipeline_response.http_response + + if response.status_code not in [200, 202, 204]: + map_error(status_code=response.status_code, response=response, error_map=error_map) + raise HttpResponseError(response=response, error_format=ARMErrorFormat) + + if cls: + return cls(pipeline_response, None, {}) + + _delete_graph_resource_initial.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}'} # type: ignore + + def begin_delete_graph_resource( + self, + resource_group_name, # type: str + account_name, # type: str + graph_name, # type: str + **kwargs # type: Any + ): + # type: (...) -> 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. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param graph_name: Cosmos DB graph resource name. + :type graph_name: str + :keyword callable cls: A custom type or function that will be passed the direct response + :keyword str continuation_token: A continuation token to restart a poller from a saved state. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. + :paramtype polling: bool or ~azure.core.polling.PollingMethod + :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. + :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: + """ + polling = kwargs.pop('polling', True) # type: Union[bool, PollingMethod] + cls = kwargs.pop('cls', None) # type: ClsType[None] + lro_delay = kwargs.pop( + 'polling_interval', + self._config.polling_interval + ) + cont_token = kwargs.pop('continuation_token', None) # type: Optional[str] + 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, + cls=lambda x,y,z: x, + **kwargs + ) + + kwargs.pop('error_map', None) + kwargs.pop('content_type', None) + + def get_long_running_output(pipeline_response): + if cls: + return cls(pipeline_response, None, {}) + + path_format_arguments = { + 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str'), + } + + if polling is True: polling_method = ARMPolling(lro_delay, path_format_arguments=path_format_arguments, **kwargs) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + if cont_token: + return LROPoller.from_continuation_token( + polling_method=polling_method, + continuation_token=cont_token, + client=self._client, + deserialization_callback=get_long_running_output + ) + else: + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + begin_delete_graph_resource.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}'} # 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 f16c7e147257..b125f94738bd 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 @@ -70,7 +70,7 @@ def list_gremlin_databases( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -149,7 +149,7 @@ def get_gremlin_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -200,7 +200,7 @@ def _create_update_gremlin_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -335,7 +335,7 @@ def _delete_gremlin_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_gremlin_database_initial.metadata['url'] # type: ignore @@ -464,7 +464,7 @@ def get_gremlin_database_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -515,7 +515,7 @@ def _update_gremlin_database_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -650,7 +650,7 @@ def _migrate_gremlin_database_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -775,7 +775,7 @@ def _migrate_gremlin_database_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -913,7 +913,7 @@ def list_gremlin_graphs( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -995,7 +995,7 @@ def get_gremlin_graph( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1048,7 +1048,7 @@ def _create_update_gremlin_graph_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1190,7 +1190,7 @@ def _delete_gremlin_graph_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_gremlin_graph_initial.metadata['url'] # type: ignore @@ -1328,7 +1328,7 @@ def get_gremlin_graph_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1381,7 +1381,7 @@ def _update_gremlin_graph_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1523,7 +1523,7 @@ def _migrate_gremlin_graph_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1655,7 +1655,7 @@ def _migrate_gremlin_graph_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" 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 aecf843cc629..a465650c737b 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 @@ -70,7 +70,7 @@ def list_mongo_db_databases( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -149,7 +149,7 @@ def get_mongo_db_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -200,7 +200,7 @@ def _create_update_mongo_db_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -335,7 +335,7 @@ def _delete_mongo_db_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_mongo_db_database_initial.metadata['url'] # type: ignore @@ -464,7 +464,7 @@ def get_mongo_db_database_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -515,7 +515,7 @@ def _update_mongo_db_database_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -650,7 +650,7 @@ def _migrate_mongo_db_database_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -775,7 +775,7 @@ def _migrate_mongo_db_database_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -913,7 +913,7 @@ def list_mongo_db_collections( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -995,7 +995,7 @@ def get_mongo_db_collection( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1048,7 +1048,7 @@ def _create_update_mongo_db_collection_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1190,7 +1190,7 @@ def _delete_mongo_db_collection_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_mongo_db_collection_initial.metadata['url'] # type: ignore @@ -1328,7 +1328,7 @@ def get_mongo_db_collection_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1381,7 +1381,7 @@ def _update_mongo_db_collection_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1523,7 +1523,7 @@ def _migrate_mongo_db_collection_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1655,7 +1655,7 @@ def _migrate_mongo_db_collection_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL 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 77c309c44ca5..bfb8a73234ec 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 @@ -70,7 +70,7 @@ def list_by_database_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -149,7 +149,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -201,7 +201,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -335,7 +335,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -466,7 +466,7 @@ def list_connection_info( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -517,7 +517,7 @@ def _regenerate_auth_token_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -635,7 +635,7 @@ def _start_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" 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 5f7d69c8c492..78de171309d0 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 @@ -62,7 +62,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 8b5c1bdcccf9..549d6e3e572b 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 @@ -82,7 +82,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 b218afcbbf73..8e68bea8329d 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 @@ -86,7 +86,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 4aeaf0a009fc..263110f8bf1a 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 @@ -74,7 +74,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 7e984a4c19f5..8ab15c2a94dd 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 @@ -82,7 +82,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 2c450517b58d..c45180203875 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 @@ -78,7 +78,7 @@ def list_metrics( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 80318ba30195..c63412113ba5 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 @@ -70,7 +70,7 @@ def list_by_database_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -148,7 +148,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -199,7 +199,7 @@ def _create_or_update_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -334,7 +334,7 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" 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 96c65ede0cbd..1fae2104d1dd 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 @@ -68,7 +68,7 @@ def list_by_database_account( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -146,7 +146,7 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" 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 372dca34ed20..b6183ae2e725 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 @@ -67,7 +67,7 @@ def list_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -136,7 +136,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -210,7 +210,7 @@ def get_by_location( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" 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 5feddbcd2eef..cd45b4c6d995 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 @@ -73,7 +73,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 d7c44f03d998..d3d5ff7c8318 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 @@ -71,7 +71,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 e5508726fd5b..5ffec558d4b4 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 @@ -77,7 +77,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 d9ae58d98a49..3ea7156988ec 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 @@ -79,7 +79,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 aba38b6a839c..3985c7192cdd 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 @@ -71,7 +71,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 637345e55a82..c2ba469ba3e9 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 @@ -77,7 +77,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): 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 b4c8fb352696..075ad4a32aca 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 @@ -70,7 +70,7 @@ def list( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -83,7 +83,7 @@ def prepare_request(next_link=None): url = self.list.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), } url = self._client.format_url(url, **path_format_arguments) @@ -127,7 +127,7 @@ def _create_initial( resource_group_name, # type: str account_name, # type: str service_name, # type: str - create_update_parameters, # type: "_models.ServiceResource" + create_update_parameters, # type: "_models.ServiceResourceCreateUpdateParameters" **kwargs # type: Any ): # type: (...) -> Optional["_models.ServiceResource"] @@ -136,7 +136,7 @@ def _create_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -144,7 +144,7 @@ def _create_initial( url = self._create_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=3), } @@ -160,7 +160,7 @@ def _create_initial( header_parameters['Accept'] = self._serialize.header("accept", accept, 'str') body_content_kwargs = {} # type: Dict[str, Any] - body_content = self._serialize.body(create_update_parameters, 'ServiceResource') + body_content = self._serialize.body(create_update_parameters, 'ServiceResourceCreateUpdateParameters') body_content_kwargs['content'] = body_content request = self._client.put(url, query_parameters, header_parameters, **body_content_kwargs) pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs) @@ -185,7 +185,7 @@ def begin_create( resource_group_name, # type: str account_name, # type: str service_name, # type: str - create_update_parameters, # type: "_models.ServiceResource" + create_update_parameters, # type: "_models.ServiceResourceCreateUpdateParameters" **kwargs # type: Any ): # type: (...) -> LROPoller["_models.ServiceResource"] @@ -198,11 +198,11 @@ def begin_create( :param service_name: Cosmos DB service name. :type service_name: str :param create_update_parameters: The Service resource parameters. - :type create_update_parameters: ~azure.mgmt.cosmosdb.models.ServiceResource + :type create_update_parameters: ~azure.mgmt.cosmosdb.models.ServiceResourceCreateUpdateParameters :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either ServiceResource or the result of cls(response) @@ -238,7 +238,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=3), } @@ -283,14 +283,14 @@ def get( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self.get.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=3), } @@ -333,14 +333,14 @@ def _delete_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-04-01-preview" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL url = self._delete_initial.metadata['url'] # type: ignore path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=3), } @@ -385,8 +385,8 @@ def begin_delete( :type service_name: str :keyword callable cls: A custom type or function that will be passed the direct response :keyword str continuation_token: A continuation token to restart a poller from a saved state. - :keyword polling: Pass in True if you'd like the ARMPolling polling method, - False for no polling, or your own initialized polling object for a personal polling strategy. + :keyword polling: By default, your polling method will be ARMPolling. + Pass in False for this operation to not poll, or pass in your own initialized polling object for a personal polling strategy. :paramtype polling: bool or ~azure.core.polling.PollingMethod :keyword int polling_interval: Default waiting time between two polls for LRO operations if no Retry-After header is present. :return: An instance of LROPoller that returns either None or the result of cls(response) @@ -418,7 +418,7 @@ def get_long_running_output(pipeline_response): path_format_arguments = { 'subscriptionId': self._serialize.url("self._config.subscription_id", self._config.subscription_id, 'str', min_length=1), - 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1, pattern=r'^[-\w\._\(\)]+$'), + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str', max_length=90, min_length=1), 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), 'serviceName': self._serialize.url("service_name", service_name, 'str', max_length=50, min_length=3), } 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 81914374caa6..b8bd592dbeba 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 @@ -70,7 +70,7 @@ def list_sql_databases( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -149,7 +149,7 @@ def get_sql_database( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -200,7 +200,7 @@ def _create_update_sql_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -335,7 +335,7 @@ def _delete_sql_database_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_sql_database_initial.metadata['url'] # type: ignore @@ -464,7 +464,7 @@ def get_sql_database_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -515,7 +515,7 @@ def _update_sql_database_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -650,7 +650,7 @@ def _migrate_sql_database_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -775,7 +775,7 @@ def _migrate_sql_database_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -913,7 +913,7 @@ def list_sql_containers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -995,7 +995,7 @@ def get_sql_container( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1048,7 +1048,7 @@ def _create_update_sql_container_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1190,7 +1190,7 @@ def _delete_sql_container_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_sql_container_initial.metadata['url'] # type: ignore @@ -1328,7 +1328,7 @@ def get_sql_container_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1381,7 +1381,7 @@ def _update_sql_container_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -1523,7 +1523,7 @@ def _migrate_sql_container_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1655,7 +1655,7 @@ def _migrate_sql_container_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1802,7 +1802,7 @@ def list_sql_stored_procedures( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -1888,7 +1888,7 @@ def get_sql_stored_procedure( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -1943,7 +1943,7 @@ def _create_update_sql_stored_procedure_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2092,7 +2092,7 @@ def _delete_sql_stored_procedure_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_sql_stored_procedure_initial.metadata['url'] # type: ignore @@ -2235,7 +2235,7 @@ def list_sql_user_defined_functions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -2321,7 +2321,7 @@ def get_sql_user_defined_function( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -2376,7 +2376,7 @@ def _create_update_sql_user_defined_function_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2525,7 +2525,7 @@ def _delete_sql_user_defined_function_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_sql_user_defined_function_initial.metadata['url'] # type: ignore @@ -2668,7 +2668,7 @@ def list_sql_triggers( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -2754,7 +2754,7 @@ def get_sql_trigger( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -2809,7 +2809,7 @@ def _create_update_sql_trigger_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -2958,7 +2958,7 @@ def _delete_sql_trigger_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_sql_trigger_initial.metadata['url'] # type: ignore @@ -3098,7 +3098,7 @@ def get_sql_role_definition( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -3149,7 +3149,7 @@ def _create_update_sql_role_definition_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -3284,7 +3284,7 @@ def _delete_sql_role_definition_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -3411,7 +3411,7 @@ def list_sql_role_definitions( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -3489,7 +3489,7 @@ def get_sql_role_assignment( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -3540,7 +3540,7 @@ def _create_update_sql_role_assignment_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -3675,7 +3675,7 @@ def _delete_sql_role_assignment_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -3802,7 +3802,7 @@ def list_sql_role_assignments( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -3869,7 +3869,7 @@ def _retrieve_continuous_backup_information_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" 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 435b25096ff4..062611e12a0e 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 @@ -70,7 +70,7 @@ def list_tables( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" def prepare_request(next_link=None): @@ -148,7 +148,7 @@ def get_table( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -199,7 +199,7 @@ def _create_update_table_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -333,7 +333,7 @@ def _delete_table_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" # Construct URL url = self._delete_table_initial.metadata['url'] # type: ignore @@ -462,7 +462,7 @@ def get_table_throughput( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -513,7 +513,7 @@ def _update_table_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" content_type = kwargs.pop("content_type", "application/json") accept = "application/json" @@ -648,7 +648,7 @@ def _migrate_table_to_autoscale_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL @@ -773,7 +773,7 @@ def _migrate_table_to_manual_throughput_initial( 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError } error_map.update(kwargs.pop('error_map', {})) - api_version = "2021-06-15" + api_version = "2021-07-01-preview" accept = "application/json" # Construct URL From 17638a46bf20d3585c069f97b582a07274f7a0e4 Mon Sep 17 00:00:00 2001 From: PythonSdkPipelines Date: Tue, 14 Sep 2021 09:46:03 +0000 Subject: [PATCH 2/2] version,CHANGELOG --- sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md | 53 +++++++++++++++++++ .../azure/mgmt/cosmosdb/_version.py | 2 +- 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md b/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md index 1bff7fa11bb0..ded23a26a53f 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md +++ b/sdk/cosmos/azure-mgmt-cosmosdb/CHANGELOG.md @@ -1,5 +1,58 @@ # Release History +## 7.0.0b1 (2021-09-14) + +**Features** + + - Model GremlinGraphGetResults has a new parameter identity + - Model GremlinGraphCreateUpdateParameters has a new parameter identity + - Model SqlDatabaseGetResults has a new parameter identity + - Model MongoDBDatabaseCreateUpdateParameters has a new parameter identity + - Model SqlTriggerCreateUpdateParameters has a new parameter identity + - Model DatabaseAccountCreateUpdateParameters has a new parameter diagnostic_log_settings + - Model ThroughputSettingsGetResults has a new parameter identity + - Model ARMResourceProperties has a new parameter identity + - Model GremlinDatabaseGetResults has a new parameter identity + - Model GremlinDatabaseCreateUpdateParameters has a new parameter identity + - Model DatabaseAccountGetResults has a new parameter diagnostic_log_settings + - Model PeriodicModeProperties has a new parameter backup_storage_redundancy + - Model SqlDatabaseCreateUpdateParameters has a new parameter identity + - Model SqlStoredProcedureCreateUpdateParameters has a new parameter identity + - Model SqlStoredProcedureGetResults has a new parameter identity + - Model MongoDBDatabaseGetResults has a new parameter identity + - Model SqlUserDefinedFunctionCreateUpdateParameters has a new parameter identity + - Model SqlUserDefinedFunctionGetResults has a new parameter identity + - Model SqlContainerGetResults has a new parameter identity + - Model DatabaseAccountUpdateParameters has a new parameter diagnostic_log_settings + - Model CassandraKeyspaceGetResults has a new parameter identity + - Model TableGetResults has a new parameter identity + - Model SqlTriggerGetResults has a new parameter identity + - Model MongoDBCollectionGetResults has a new parameter identity + - Model ThroughputSettingsUpdateParameters has a new parameter identity + - Model TableCreateUpdateParameters has a new parameter identity + - Model CassandraKeyspaceCreateUpdateParameters has a new parameter identity + - Model CassandraTableGetResults has a new parameter identity + - Model MongoDBCollectionCreateUpdateParameters has a new parameter identity + - Model SqlContainerCreateUpdateParameters has a new parameter identity + - Model CassandraTableCreateUpdateParameters has a new parameter identity + - Added operation CassandraResourcesOperations.get_cassandra_view_throughput + - Added operation CassandraResourcesOperations.list_cassandra_views + - Added operation CassandraResourcesOperations.begin_migrate_cassandra_view_to_manual_throughput + - Added operation CassandraResourcesOperations.begin_create_update_cassandra_view + - Added operation CassandraResourcesOperations.begin_migrate_cassandra_view_to_autoscale + - Added operation CassandraResourcesOperations.begin_delete_cassandra_view + - Added operation CassandraResourcesOperations.begin_update_cassandra_view_throughput + - Added operation CassandraResourcesOperations.get_cassandra_view + - Added operation group CassandraDataCentersOperations + - Added operation group CosmosDBManagementClientOperationsMixin + - Added operation group CassandraClustersOperations + - Added operation group GraphResourcesOperations + - Added operation group ServiceOperations + +**Breaking changes** + + - Parameter create_mode of model DatabaseAccountCreateUpdateParameters is now required + ## 6.4.0 (2021-06-22) **Features** 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 a712687790e5..efe7276fe05f 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 = "0.7.0" +VERSION = "7.0.0b1"