From 1b95131edd706a9da0522062164ea99f19ebfd5b Mon Sep 17 00:00:00 2001 From: SDK Automation Date: Thu, 15 Oct 2020 04:37:38 +0000 Subject: [PATCH] Generated from 187b24673d8b7d19359b7b1f9c30dcbbd0076bee --- .../cosmosdb/_cosmos_db_management_client.py | 7 +- .../azure/mgmt/cosmosdb/models/__init__.py | 73 -- .../_cosmos_db_management_client_enums.py | 33 - .../azure/mgmt/cosmosdb/models/_models.py | 986 +-------------- .../azure/mgmt/cosmosdb/models/_models_py3.py | 1104 ++--------------- .../mgmt/cosmosdb/models/_paged_models.py | 39 - .../mgmt/cosmosdb/operations/__init__.py | 2 - .../_cassandra_resources_operations.py | 412 +++++- .../operations/_collection_operations.py | 4 +- .../_collection_partition_operations.py | 4 +- ..._collection_partition_region_operations.py | 4 +- .../_collection_region_operations.py | 4 +- .../_database_account_region_operations.py | 4 +- .../_database_accounts_operations.py | 4 +- .../operations/_database_operations.py | 4 +- .../_gremlin_resources_operations.py | 412 +++++- .../_mongo_db_resources_operations.py | 412 +++++- .../_notebook_workspaces_operations.py | 4 +- .../mgmt/cosmosdb/operations/_operations.py | 4 +- .../_partition_key_range_id_operations.py | 4 +- ...artition_key_range_id_region_operations.py | 4 +- .../operations/_percentile_operations.py | 4 +- .../_percentile_source_target_operations.py | 4 +- .../_percentile_target_operations.py | 4 +- ...restorable_database_accounts_operations.py | 241 ---- .../operations/_sql_resources_operations.py | 1100 +++++++--------- .../operations/_table_resources_operations.py | 202 ++- 27 files changed, 2019 insertions(+), 3060 deletions(-) delete mode 100644 sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py 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 75bb26911eb2..849e1abf7788 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 @@ -31,7 +31,6 @@ from .operations import TableResourcesOperations from .operations import CassandraResourcesOperations from .operations import GremlinResourcesOperations -from .operations import RestorableDatabaseAccountsOperations from .operations import NotebookWorkspacesOperations from .operations import PrivateLinkResourcesOperations from .operations import PrivateEndpointConnectionsOperations @@ -39,7 +38,7 @@ class CosmosDBManagementClient(SDKClient): - """CosmosDBManagementClient + """Azure Cosmos DB Database Service Resource Provider REST API :ivar config: Configuration for client. :vartype config: CosmosDBManagementClientConfiguration @@ -80,8 +79,6 @@ class CosmosDBManagementClient(SDKClient): :vartype cassandra_resources: azure.mgmt.cosmosdb.operations.CassandraResourcesOperations :ivar gremlin_resources: GremlinResources operations :vartype gremlin_resources: azure.mgmt.cosmosdb.operations.GremlinResourcesOperations - :ivar restorable_database_accounts: RestorableDatabaseAccounts operations - :vartype restorable_database_accounts: azure.mgmt.cosmosdb.operations.RestorableDatabaseAccountsOperations :ivar notebook_workspaces: NotebookWorkspaces operations :vartype notebook_workspaces: azure.mgmt.cosmosdb.operations.NotebookWorkspacesOperations :ivar private_link_resources: PrivateLinkResources operations @@ -143,8 +140,6 @@ def __init__( self._client, self.config, self._serialize, self._deserialize) self.gremlin_resources = GremlinResourcesOperations( self._client, self.config, self._serialize, self._deserialize) - self.restorable_database_accounts = RestorableDatabaseAccountsOperations( - self._client, self.config, self._serialize, self._deserialize) self.notebook_workspaces = NotebookWorkspacesOperations( self._client, self.config, self._serialize, self._deserialize) self.private_link_resources = PrivateLinkResourcesOperations( 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 9b0823c4697b..8785ba5760db 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,7 +17,6 @@ from ._models_py3 import AutoscaleSettingsResource from ._models_py3 import AutoUpgradePolicyResource from ._models_py3 import AzureEntityResource - from ._models_py3 import BackupPolicy from ._models_py3 import Capability from ._models_py3 import CassandraKeyspaceCreateUpdateParameters from ._models_py3 import CassandraKeyspaceGetPropertiesOptions @@ -37,21 +36,16 @@ from ._models_py3 import ConflictResolutionPolicy from ._models_py3 import ConsistencyPolicy from ._models_py3 import ContainerPartitionKey - from ._models_py3 import ContinuousModeBackupPolicy from ._models_py3 import CorsPolicy from ._models_py3 import CreateUpdateOptions 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 from ._models_py3 import DatabaseAccountListReadOnlyKeysResult from ._models_py3 import DatabaseAccountRegenerateKeyParameters from ._models_py3 import DatabaseAccountUpdateParameters - from ._models_py3 import DatabaseRestoreResource - from ._models_py3 import DefaultErrorResponse, DefaultErrorResponseException - from ._models_py3 import DefaultRequestDatabaseAccountCreateUpdateProperties from ._models_py3 import ErrorResponse, ErrorResponseException from ._models_py3 import ExcludedPath from ._models_py3 import ExtendedResourceProperties @@ -72,8 +66,6 @@ from ._models_py3 import IndexingPolicy from ._models_py3 import IpAddressOrRange from ._models_py3 import Location - from ._models_py3 import ManagedServiceIdentity - from ._models_py3 import ManagedServiceIdentityUserAssignedIdentitiesValue from ._models_py3 import Metric from ._models_py3 import MetricAvailability from ._models_py3 import MetricDefinition @@ -102,9 +94,6 @@ from ._models_py3 import PartitionUsage from ._models_py3 import PercentileMetric from ._models_py3 import PercentileMetricValue - from ._models_py3 import PeriodicModeBackupPolicy - from ._models_py3 import PeriodicModeProperties - from ._models_py3 import Permission from ._models_py3 import PrivateEndpointConnection from ._models_py3 import PrivateEndpointProperty from ._models_py3 import PrivateLinkResource @@ -112,9 +101,6 @@ from ._models_py3 import ProxyResource from ._models_py3 import RegionForOnlineOffline from ._models_py3 import Resource - from ._models_py3 import RestorableDatabaseAccountGetResult - from ._models_py3 import RestoreParameters - from ._models_py3 import RestoreReqeustDatabaseAccountCreateUpdateProperties from ._models_py3 import SpatialSpec from ._models_py3 import SqlContainerCreateUpdateParameters from ._models_py3 import SqlContainerGetPropertiesOptions @@ -126,10 +112,6 @@ from ._models_py3 import SqlDatabaseGetPropertiesResource from ._models_py3 import SqlDatabaseGetResults from ._models_py3 import SqlDatabaseResource - from ._models_py3 import SqlRoleAssignmentCreateUpdateParameters - from ._models_py3 import SqlRoleAssignmentGetResults - from ._models_py3 import SqlRoleDefinitionCreateUpdateParameters - from ._models_py3 import SqlRoleDefinitionGetResults from ._models_py3 import SqlStoredProcedureCreateUpdateParameters from ._models_py3 import SqlStoredProcedureGetPropertiesResource from ._models_py3 import SqlStoredProcedureGetResults @@ -142,7 +124,6 @@ from ._models_py3 import SqlUserDefinedFunctionGetPropertiesResource from ._models_py3 import SqlUserDefinedFunctionGetResults from ._models_py3 import SqlUserDefinedFunctionResource - from ._models_py3 import SystemData from ._models_py3 import TableCreateUpdateParameters from ._models_py3 import TableGetPropertiesOptions from ._models_py3 import TableGetPropertiesResource @@ -166,7 +147,6 @@ from ._models import AutoscaleSettingsResource from ._models import AutoUpgradePolicyResource from ._models import AzureEntityResource - from ._models import BackupPolicy from ._models import Capability from ._models import CassandraKeyspaceCreateUpdateParameters from ._models import CassandraKeyspaceGetPropertiesOptions @@ -186,21 +166,16 @@ from ._models import ConflictResolutionPolicy from ._models import ConsistencyPolicy from ._models import ContainerPartitionKey - from ._models import ContinuousModeBackupPolicy from ._models import CorsPolicy from ._models import CreateUpdateOptions from ._models import DatabaseAccountConnectionString from ._models import DatabaseAccountCreateUpdateParameters - from ._models import DatabaseAccountCreateUpdateProperties from ._models import DatabaseAccountGetResults from ._models import DatabaseAccountListConnectionStringsResult from ._models import DatabaseAccountListKeysResult from ._models import DatabaseAccountListReadOnlyKeysResult from ._models import DatabaseAccountRegenerateKeyParameters from ._models import DatabaseAccountUpdateParameters - from ._models import DatabaseRestoreResource - from ._models import DefaultErrorResponse, DefaultErrorResponseException - from ._models import DefaultRequestDatabaseAccountCreateUpdateProperties from ._models import ErrorResponse, ErrorResponseException from ._models import ExcludedPath from ._models import ExtendedResourceProperties @@ -221,8 +196,6 @@ from ._models import IndexingPolicy from ._models import IpAddressOrRange from ._models import Location - from ._models import ManagedServiceIdentity - from ._models import ManagedServiceIdentityUserAssignedIdentitiesValue from ._models import Metric from ._models import MetricAvailability from ._models import MetricDefinition @@ -251,9 +224,6 @@ from ._models import PartitionUsage from ._models import PercentileMetric from ._models import PercentileMetricValue - from ._models import PeriodicModeBackupPolicy - from ._models import PeriodicModeProperties - from ._models import Permission from ._models import PrivateEndpointConnection from ._models import PrivateEndpointProperty from ._models import PrivateLinkResource @@ -261,9 +231,6 @@ from ._models import ProxyResource from ._models import RegionForOnlineOffline from ._models import Resource - from ._models import RestorableDatabaseAccountGetResult - from ._models import RestoreParameters - from ._models import RestoreReqeustDatabaseAccountCreateUpdateProperties from ._models import SpatialSpec from ._models import SqlContainerCreateUpdateParameters from ._models import SqlContainerGetPropertiesOptions @@ -275,10 +242,6 @@ from ._models import SqlDatabaseGetPropertiesResource from ._models import SqlDatabaseGetResults from ._models import SqlDatabaseResource - from ._models import SqlRoleAssignmentCreateUpdateParameters - from ._models import SqlRoleAssignmentGetResults - from ._models import SqlRoleDefinitionCreateUpdateParameters - from ._models import SqlRoleDefinitionGetResults from ._models import SqlStoredProcedureCreateUpdateParameters from ._models import SqlStoredProcedureGetPropertiesResource from ._models import SqlStoredProcedureGetResults @@ -291,7 +254,6 @@ from ._models import SqlUserDefinedFunctionGetPropertiesResource from ._models import SqlUserDefinedFunctionGetResults from ._models import SqlUserDefinedFunctionResource - from ._models import SystemData from ._models import TableCreateUpdateParameters from ._models import TableGetPropertiesOptions from ._models import TableGetPropertiesResource @@ -323,11 +285,8 @@ from ._paged_models import PercentileMetricPaged from ._paged_models import PrivateEndpointConnectionPaged from ._paged_models import PrivateLinkResourcePaged -from ._paged_models import RestorableDatabaseAccountGetResultPaged from ._paged_models import SqlContainerGetResultsPaged from ._paged_models import SqlDatabaseGetResultsPaged -from ._paged_models import SqlRoleAssignmentGetResultsPaged -from ._paged_models import SqlRoleDefinitionGetResultsPaged from ._paged_models import SqlStoredProcedureGetResultsPaged from ._paged_models import SqlTriggerGetResultsPaged from ._paged_models import SqlUserDefinedFunctionGetResultsPaged @@ -340,9 +299,6 @@ ConnectorOffer, PublicNetworkAccess, ServerVersion, - CreateMode, - RestoreMode, - CreatedByType, IndexingMode, DataType, IndexKind, @@ -352,11 +308,9 @@ ConflictResolutionMode, TriggerType, TriggerOperation, - ResourceIdentityType, KeyKind, UnitType, PrimaryAggregationType, - RoleDefinitionType, ) __all__ = [ @@ -367,7 +321,6 @@ 'AutoscaleSettingsResource', 'AutoUpgradePolicyResource', 'AzureEntityResource', - 'BackupPolicy', 'Capability', 'CassandraKeyspaceCreateUpdateParameters', 'CassandraKeyspaceGetPropertiesOptions', @@ -387,21 +340,16 @@ 'ConflictResolutionPolicy', 'ConsistencyPolicy', 'ContainerPartitionKey', - 'ContinuousModeBackupPolicy', 'CorsPolicy', 'CreateUpdateOptions', 'DatabaseAccountConnectionString', 'DatabaseAccountCreateUpdateParameters', - 'DatabaseAccountCreateUpdateProperties', 'DatabaseAccountGetResults', 'DatabaseAccountListConnectionStringsResult', 'DatabaseAccountListKeysResult', 'DatabaseAccountListReadOnlyKeysResult', 'DatabaseAccountRegenerateKeyParameters', 'DatabaseAccountUpdateParameters', - 'DatabaseRestoreResource', - 'DefaultErrorResponse', 'DefaultErrorResponseException', - 'DefaultRequestDatabaseAccountCreateUpdateProperties', 'ErrorResponse', 'ErrorResponseException', 'ExcludedPath', 'ExtendedResourceProperties', @@ -422,8 +370,6 @@ 'IndexingPolicy', 'IpAddressOrRange', 'Location', - 'ManagedServiceIdentity', - 'ManagedServiceIdentityUserAssignedIdentitiesValue', 'Metric', 'MetricAvailability', 'MetricDefinition', @@ -452,9 +398,6 @@ 'PartitionUsage', 'PercentileMetric', 'PercentileMetricValue', - 'PeriodicModeBackupPolicy', - 'PeriodicModeProperties', - 'Permission', 'PrivateEndpointConnection', 'PrivateEndpointProperty', 'PrivateLinkResource', @@ -462,9 +405,6 @@ 'ProxyResource', 'RegionForOnlineOffline', 'Resource', - 'RestorableDatabaseAccountGetResult', - 'RestoreParameters', - 'RestoreReqeustDatabaseAccountCreateUpdateProperties', 'SpatialSpec', 'SqlContainerCreateUpdateParameters', 'SqlContainerGetPropertiesOptions', @@ -476,10 +416,6 @@ 'SqlDatabaseGetPropertiesResource', 'SqlDatabaseGetResults', 'SqlDatabaseResource', - 'SqlRoleAssignmentCreateUpdateParameters', - 'SqlRoleAssignmentGetResults', - 'SqlRoleDefinitionCreateUpdateParameters', - 'SqlRoleDefinitionGetResults', 'SqlStoredProcedureCreateUpdateParameters', 'SqlStoredProcedureGetPropertiesResource', 'SqlStoredProcedureGetResults', @@ -492,7 +428,6 @@ 'SqlUserDefinedFunctionGetPropertiesResource', 'SqlUserDefinedFunctionGetResults', 'SqlUserDefinedFunctionResource', - 'SystemData', 'TableCreateUpdateParameters', 'TableGetPropertiesOptions', 'TableGetPropertiesResource', @@ -521,8 +456,6 @@ 'SqlStoredProcedureGetResultsPaged', 'SqlUserDefinedFunctionGetResultsPaged', 'SqlTriggerGetResultsPaged', - 'SqlRoleDefinitionGetResultsPaged', - 'SqlRoleAssignmentGetResultsPaged', 'MongoDBDatabaseGetResultsPaged', 'MongoDBCollectionGetResultsPaged', 'TableGetResultsPaged', @@ -530,7 +463,6 @@ 'CassandraTableGetResultsPaged', 'GremlinDatabaseGetResultsPaged', 'GremlinGraphGetResultsPaged', - 'RestorableDatabaseAccountGetResultPaged', 'NotebookWorkspacePaged', 'PrivateLinkResourcePaged', 'PrivateEndpointConnectionPaged', @@ -540,9 +472,6 @@ 'ConnectorOffer', 'PublicNetworkAccess', 'ServerVersion', - 'CreateMode', - 'RestoreMode', - 'CreatedByType', 'IndexingMode', 'DataType', 'IndexKind', @@ -552,9 +481,7 @@ 'ConflictResolutionMode', 'TriggerType', 'TriggerOperation', - 'ResourceIdentityType', 'KeyKind', 'UnitType', 'PrimaryAggregationType', - 'RoleDefinitionType', ] 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 40acab0beaf9..03f302a4a3ff 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 @@ -50,25 +50,6 @@ class ServerVersion(str, Enum): three_full_stop_six = "3.6" -class CreateMode(str, Enum): - - default = "Default" - restore = "Restore" - - -class RestoreMode(str, Enum): - - point_in_time = "PointInTime" - - -class CreatedByType(str, Enum): - - user = "User" - application = "Application" - managed_identity = "ManagedIdentity" - key = "Key" - - class IndexingMode(str, Enum): consistent = "Consistent" @@ -134,14 +115,6 @@ class TriggerOperation(str, Enum): replace = "Replace" -class ResourceIdentityType(str, Enum): - - system_assigned = "SystemAssigned" - user_assigned = "UserAssigned" - system_assigned_user_assigned = "SystemAssigned,UserAssigned" - none = "None" - - class KeyKind(str, Enum): primary = "primary" @@ -169,9 +142,3 @@ class PrimaryAggregationType(str, Enum): minimum = "Minimum" maximum = "Maximum" last = "Last" - - -class RoleDefinitionType(str, Enum): - - built_in_role = "BuiltInRole" - custom_role = "CustomRole" 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 e2f3cdb29d9b..23990ab44f8e 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 @@ -81,8 +81,6 @@ class ARMResourceProperties(Model): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity """ _validation = { @@ -97,7 +95,6 @@ class ARMResourceProperties(Model): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, } def __init__(self, **kwargs): @@ -107,7 +104,6 @@ def __init__(self, **kwargs): self.type = None self.location = kwargs.get('location', None) self.tags = kwargs.get('tags', None) - self.identity = kwargs.get('identity', None) class AutoscaleSettings(Model): @@ -255,35 +251,6 @@ def __init__(self, **kwargs): self.etag = None -class BackupPolicy(Model): - """The object representing the policy for taking backups on an account. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PeriodicModeBackupPolicy, ContinuousModeBackupPolicy - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Periodic': 'PeriodicModeBackupPolicy', 'Continuous': 'ContinuousModeBackupPolicy'} - } - - def __init__(self, **kwargs): - super(BackupPolicy, self).__init__(**kwargs) - self.type = None - - class Capability(Model): """Cosmos DB capability object. @@ -321,8 +288,6 @@ class CassandraKeyspaceCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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 @@ -345,7 +310,6 @@ class CassandraKeyspaceCreateUpdateParameters(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'CassandraKeyspaceResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -457,8 +421,6 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesResource @@ -479,7 +441,6 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'CassandraKeyspaceGetPropertiesResource'}, 'options': {'key': 'properties.options', 'type': 'CassandraKeyspaceGetPropertiesOptions'}, } @@ -572,8 +533,6 @@ class CassandraTableCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -595,7 +554,6 @@ class CassandraTableCreateUpdateParameters(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'CassandraTableResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -697,8 +655,6 @@ class CassandraTableGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesResource @@ -719,7 +675,6 @@ class CassandraTableGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'CassandraTableGetPropertiesResource'}, 'options': {'key': 'properties.options', 'type': 'CassandraTableGetPropertiesOptions'}, } @@ -935,28 +890,6 @@ def __init__(self, **kwargs): self.version = kwargs.get('version', 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. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ContinuousModeBackupPolicy, self).__init__(**kwargs) - self.type = 'Continuous' - - class CorsPolicy(Model): """The CORS policy for the Cosmos DB database account. @@ -1072,53 +1005,10 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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'. Default value: "GlobalDocumentDB" . :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind - :param properties: Required. - :type properties: - ~azure.mgmt.cosmosdb.models.DatabaseAccountCreateUpdateProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'properties': {'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'}, - 'properties': {'key': 'properties', 'type': 'DatabaseAccountCreateUpdateProperties'}, - } - - def __init__(self, **kwargs): - super(DatabaseAccountCreateUpdateParameters, self).__init__(**kwargs) - self.kind = kwargs.get('kind', "GlobalDocumentDB") - self.properties = kwargs.get('properties', None) - - -class DatabaseAccountCreateUpdateProperties(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, - RestoreReqeustDatabaseAccountCreateUpdateProperties - - 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 @@ -1170,52 +1060,50 @@ class DatabaseAccountCreateUpdateProperties(Model): :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. :type enable_analytical_storage: bool - :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 create_mode: Required. Constant filled by server. - :type create_mode: str """ _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 = { - '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'}, - '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'}, - 'backup_policy': {'key': 'backupPolicy', 'type': 'BackupPolicy'}, - 'cors': {'key': 'cors', 'type': '[CorsPolicy]'}, - 'create_mode': {'key': 'createMode', 'type': 'str'}, - } - - _subtype_map = { - 'create_mode': {'Default': 'DefaultRequestDatabaseAccountCreateUpdateProperties', 'Restore': 'RestoreReqeustDatabaseAccountCreateUpdateProperties'} + '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'}, + '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'}, + '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'}, + 'cors': {'key': 'properties.cors', 'type': '[CorsPolicy]'}, } database_account_offer_type = "Standard" def __init__(self, **kwargs): - super(DatabaseAccountCreateUpdateProperties, self).__init__(**kwargs) + super(DatabaseAccountCreateUpdateParameters, self).__init__(**kwargs) + self.kind = kwargs.get('kind', "GlobalDocumentDB") self.consistency_policy = kwargs.get('consistency_policy', None) self.locations = kwargs.get('locations', None) self.ip_rules = kwargs.get('ip_rules', None) @@ -1232,9 +1120,7 @@ def __init__(self, **kwargs): 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.backup_policy = kwargs.get('backup_policy', None) self.cors = kwargs.get('cors', None) - self.create_mode = None class DatabaseAccountGetResults(ARMResourceProperties): @@ -1254,8 +1140,6 @@ class DatabaseAccountGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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'. Default value: "GlobalDocumentDB" . @@ -1331,21 +1215,8 @@ class DatabaseAccountGetResults(ARMResourceProperties): :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. :type enable_analytical_storage: bool - :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] - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData """ _validation = { @@ -1359,8 +1230,6 @@ class DatabaseAccountGetResults(ARMResourceProperties): 'locations': {'readonly': True}, 'failover_policies': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, - 'instance_id': {'readonly': True}, - 'system_data': {'readonly': True}, } _attribute_map = { @@ -1369,7 +1238,6 @@ class DatabaseAccountGetResults(ARMResourceProperties): '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'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'document_endpoint': {'key': 'properties.documentEndpoint', 'type': 'str'}, @@ -1394,12 +1262,7 @@ class DatabaseAccountGetResults(ARMResourceProperties): 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, - '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]'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } def __init__(self, **kwargs): @@ -1428,12 +1291,7 @@ def __init__(self, **kwargs): 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.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.system_data = None class DatabaseAccountListConnectionStringsResult(Model): @@ -1603,13 +1461,8 @@ class DatabaseAccountUpdateParameters(Model): :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. :type enable_analytical_storage: bool - :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 identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity """ _attribute_map = { @@ -1631,9 +1484,7 @@ class DatabaseAccountUpdateParameters(Model): 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, - 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, 'cors': {'key': 'properties.cors', 'type': '[CorsPolicy]'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, } def __init__(self, **kwargs): @@ -1656,159 +1507,7 @@ def __init__(self, **kwargs): 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.backup_policy = kwargs.get('backup_policy', None) self.cors = kwargs.get('cors', None) - self.identity = kwargs.get('identity', None) - - -class DatabaseRestoreResource(Model): - """Specific Databases to restore. - - :param database_name: The name of the database to restore. - :type database_name: str - :param collection_names: The names of the collections to 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 DefaultErrorResponse(Model): - """An error response from the service. - - :param error: - :type error: ~azure.mgmt.cosmosdb.models.ErrorResponse - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - } - - def __init__(self, **kwargs): - super(DefaultErrorResponse, self).__init__(**kwargs) - self.error = kwargs.get('error', None) - - -class DefaultErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'DefaultErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(DefaultErrorResponseException, self).__init__(deserialize, response, 'DefaultErrorResponse', *args) - - -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: 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 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 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 create_mode: Required. Constant filled by server. - :type create_mode: str - """ - - _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'}, - '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'}, - 'backup_policy': {'key': 'backupPolicy', 'type': 'BackupPolicy'}, - 'cors': {'key': 'cors', 'type': '[CorsPolicy]'}, - 'create_mode': {'key': 'createMode', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(DefaultRequestDatabaseAccountCreateUpdateProperties, self).__init__(**kwargs) - self.create_mode = 'Default' class ErrorResponse(Model): @@ -1974,8 +1673,6 @@ class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -1997,7 +1694,6 @@ class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'GremlinDatabaseResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -2087,8 +1783,6 @@ class GremlinDatabaseGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource @@ -2109,7 +1803,6 @@ class GremlinDatabaseGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'GremlinDatabaseGetPropertiesResource'}, 'options': {'key': 'properties.options', 'type': 'GremlinDatabaseGetPropertiesOptions'}, } @@ -2161,8 +1854,6 @@ class GremlinGraphCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -2184,7 +1875,6 @@ class GremlinGraphCreateUpdateParameters(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'GremlinGraphResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -2300,8 +1990,6 @@ class GremlinGraphGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource @@ -2322,7 +2010,6 @@ class GremlinGraphGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'GremlinGraphGetPropertiesResource'}, 'options': {'key': 'properties.options', 'type': 'GremlinGraphGetPropertiesOptions'}, } @@ -2540,80 +2227,6 @@ def __init__(self, **kwargs): self.is_zone_redundant = kwargs.get('is_zone_redundant', None) -class ManagedServiceIdentity(Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar principal_id: The principal id of the system assigned identity. This - property will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity. This - property will only be provided for a system assigned identity. - :vartype tenant_id: str - :param type: The type of identity used for the resource. The type - 'SystemAssigned,UserAssigned' includes both an implicitly created identity - and a set of user assigned identities. The type 'None' will remove any - identities from the service. Possible values include: 'SystemAssigned', - 'UserAssigned', 'SystemAssigned,UserAssigned', 'None' - :type type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType - :param user_assigned_identities: The list of user identities associated - with resource. The user identity dictionary key references will be ARM - resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentitiesValue] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, - } - - def __init__(self, **kwargs): - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = kwargs.get('type', None) - self.user_assigned_identities = kwargs.get('user_assigned_identities', None) - - -class ManagedServiceIdentityUserAssignedIdentitiesValue(Model): - """ManagedServiceIdentityUserAssignedIdentitiesValue. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :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 = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class Metric(Model): """Metric data. @@ -2838,8 +2451,6 @@ class MongoDBCollectionCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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 @@ -2862,7 +2473,6 @@ class MongoDBCollectionCreateUpdateParameters(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'MongoDBCollectionResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -2965,8 +2575,6 @@ class MongoDBCollectionGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource @@ -2987,7 +2595,6 @@ class MongoDBCollectionGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'MongoDBCollectionGetPropertiesResource'}, 'options': {'key': 'properties.options', 'type': 'MongoDBCollectionGetPropertiesOptions'}, } @@ -3052,8 +2659,6 @@ class MongoDBDatabaseCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -3075,7 +2680,6 @@ class MongoDBDatabaseCreateUpdateParameters(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'MongoDBDatabaseResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -3165,8 +2769,6 @@ class MongoDBDatabaseGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource @@ -3187,7 +2789,6 @@ class MongoDBDatabaseGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'MongoDBDatabaseGetPropertiesResource'}, 'options': {'key': 'properties.options', 'type': 'MongoDBDatabaseGetPropertiesOptions'}, } @@ -3706,81 +3307,6 @@ def __init__(self, **kwargs): self.p99 = None -class PeriodicModeBackupPolicy(BackupPolicy): - """The object representing periodic mode backup policy. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Constant filled by server. - :type type: str - :param periodic_mode_properties: Configuration values for periodic mode - backup - :type periodic_mode_properties: - ~azure.mgmt.cosmosdb.models.PeriodicModeProperties - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'periodic_mode_properties': {'key': 'periodicModeProperties', 'type': 'PeriodicModeProperties'}, - } - - def __init__(self, **kwargs): - super(PeriodicModeBackupPolicy, self).__init__(**kwargs) - self.periodic_mode_properties = kwargs.get('periodic_mode_properties', None) - self.type = 'Periodic' - - -class PeriodicModeProperties(Model): - """Configuration values for periodic mode backup. - - :param backup_interval_in_minutes: An integer representing the interval in - minutes between two backups - :type backup_interval_in_minutes: int - :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 - """ - - _validation = { - 'backup_interval_in_minutes': {'minimum': 0}, - 'backup_retention_interval_in_hours': {'minimum': 0}, - } - - _attribute_map = { - 'backup_interval_in_minutes': {'key': 'backupIntervalInMinutes', 'type': 'int'}, - 'backup_retention_interval_in_hours': {'key': 'backupRetentionIntervalInHours', 'type': 'int'}, - } - - def __init__(self, **kwargs): - 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) - - -class Permission(Model): - """The set of data plane operations permitted through this Role Definition. - - :param data_actions: An array of data actions that are allowed. - :type data_actions: list[str] - :param not_data_actions: An array of data actions that are denied. - :type not_data_actions: list[str] - """ - - _attribute_map = { - 'data_actions': {'key': 'dataActions', 'type': '[str]'}, - 'not_data_actions': {'key': 'notDataActions', 'type': '[str]'}, - } - - def __init__(self, **kwargs): - super(Permission, self).__init__(**kwargs) - self.data_actions = kwargs.get('data_actions', None) - self.not_data_actions = kwargs.get('not_data_actions', None) - - class ProxyResource(Resource): """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. @@ -3981,199 +3507,6 @@ def __init__(self, **kwargs): self.region = kwargs.get('region', None) -class RestorableDatabaseAccountGetResult(ARMResourceProperties): - """A Azure Cosmos DB restorable 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: - :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :param account_name: The name of the global database account - :type account_name: str - :param creation_time: The creation time of the restorable database account - (ISO-8601 format). - :type creation_time: datetime - :param deletion_time: The time at which the restorable database account - has been deleted (ISO-8601 format). - :type deletion_time: datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'account_name': {'key': 'properties.accountName', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'deletion_time': {'key': 'properties.deletionTime', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(RestorableDatabaseAccountGetResult, self).__init__(**kwargs) - self.account_name = kwargs.get('account_name', None) - self.creation_time = kwargs.get('creation_time', None) - self.deletion_time = kwargs.get('deletion_time', None) - - -class RestoreParameters(Model): - """Parameters to indicate the information about the restore. - - :param restore_mode: Describes the mode of the restore. Possible values - include: 'PointInTime' - :type restore_mode: str or ~azure.mgmt.cosmosdb.models.RestoreMode - :param restore_source: Path of the source account from which the restore - has to be initiated - :type restore_source: str - :param restore_timestamp_in_utc: Time to which the account has to be - restored (ISO-8601 format). - :type restore_timestamp_in_utc: datetime - :param databases_to_restore: List of specific databases to restore. - :type databases_to_restore: - list[~azure.mgmt.cosmosdb.models.DatabaseRestoreResource] - """ - - _attribute_map = { - 'restore_mode': {'key': 'restoreMode', 'type': 'str'}, - 'restore_source': {'key': 'restoreSource', 'type': 'str'}, - 'restore_timestamp_in_utc': {'key': 'restoreTimestampInUtc', 'type': 'iso-8601'}, - 'databases_to_restore': {'key': 'databasesToRestore', 'type': '[DatabaseRestoreResource]'}, - } - - def __init__(self, **kwargs): - super(RestoreParameters, self).__init__(**kwargs) - self.restore_mode = kwargs.get('restore_mode', None) - self.restore_source = kwargs.get('restore_source', None) - self.restore_timestamp_in_utc = kwargs.get('restore_timestamp_in_utc', None) - self.databases_to_restore = kwargs.get('databases_to_restore', None) - - -class RestoreReqeustDatabaseAccountCreateUpdateProperties(DatabaseAccountCreateUpdateProperties): - """Properties to restore Azure Cosmos DB database account. - - 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: 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 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 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 create_mode: Required. Constant filled by server. - :type create_mode: str - :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'}, - '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'}, - 'backup_policy': {'key': 'backupPolicy', 'type': 'BackupPolicy'}, - 'cors': {'key': 'cors', 'type': '[CorsPolicy]'}, - 'create_mode': {'key': 'createMode', 'type': 'str'}, - 'restore_parameters': {'key': 'restoreParameters', 'type': 'RestoreParameters'}, - } - - def __init__(self, **kwargs): - super(RestoreReqeustDatabaseAccountCreateUpdateProperties, self).__init__(**kwargs) - self.restore_parameters = kwargs.get('restore_parameters', None) - self.create_mode = 'Restore' - - class SpatialSpec(Model): """SpatialSpec. @@ -4214,8 +3547,6 @@ class SqlContainerCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -4237,7 +3568,6 @@ class SqlContainerCreateUpdateParameters(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'SqlContainerResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -4295,6 +3625,8 @@ class SqlContainerGetPropertiesResource(Model): container. :type conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :param analytical_storage_ttl: Analytical TTL. + :type analytical_storage_ttl: long :ivar _rid: A system generated property. A unique identifier. :vartype _rid: str :ivar _ts: A system generated property that denotes the last updated @@ -4319,6 +3651,7 @@ class SqlContainerGetPropertiesResource(Model): 'default_ttl': {'key': 'defaultTtl', 'type': 'int'}, 'unique_key_policy': {'key': 'uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, 'conflict_resolution_policy': {'key': 'conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, + 'analytical_storage_ttl': {'key': 'analyticalStorageTtl', 'type': 'long'}, '_rid': {'key': '_rid', 'type': 'str'}, '_ts': {'key': '_ts', 'type': 'object'}, '_etag': {'key': '_etag', 'type': 'str'}, @@ -4332,6 +3665,7 @@ def __init__(self, **kwargs): self.default_ttl = kwargs.get('default_ttl', None) self.unique_key_policy = kwargs.get('unique_key_policy', None) self.conflict_resolution_policy = kwargs.get('conflict_resolution_policy', None) + self.analytical_storage_ttl = kwargs.get('analytical_storage_ttl', None) self._rid = None self._ts = None self._etag = None @@ -4354,8 +3688,6 @@ class SqlContainerGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource @@ -4376,7 +3708,6 @@ class SqlContainerGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'SqlContainerGetPropertiesResource'}, 'options': {'key': 'properties.options', 'type': 'SqlContainerGetPropertiesOptions'}, } @@ -4411,6 +3742,8 @@ class SqlContainerResource(Model): container. :type conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :param analytical_storage_ttl: Analytical TTL. + :type analytical_storage_ttl: long """ _validation = { @@ -4424,6 +3757,7 @@ class SqlContainerResource(Model): 'default_ttl': {'key': 'defaultTtl', 'type': 'int'}, 'unique_key_policy': {'key': 'uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, 'conflict_resolution_policy': {'key': 'conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, + 'analytical_storage_ttl': {'key': 'analyticalStorageTtl', 'type': 'long'}, } def __init__(self, **kwargs): @@ -4434,6 +3768,7 @@ def __init__(self, **kwargs): self.default_ttl = kwargs.get('default_ttl', None) self.unique_key_policy = kwargs.get('unique_key_policy', None) self.conflict_resolution_policy = kwargs.get('conflict_resolution_policy', None) + self.analytical_storage_ttl = kwargs.get('analytical_storage_ttl', None) class SqlDatabaseCreateUpdateParameters(ARMResourceProperties): @@ -4455,8 +3790,6 @@ class SqlDatabaseCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -4478,7 +3811,6 @@ class SqlDatabaseCreateUpdateParameters(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'SqlDatabaseResource'}, 'options': {'key': 'properties.options', 'type': 'CreateUpdateOptions'}, } @@ -4578,8 +3910,6 @@ class SqlDatabaseGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource @@ -4599,7 +3929,6 @@ class SqlDatabaseGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'SqlDatabaseGetPropertiesResource'}, 'options': {'key': 'properties.options', 'type': 'SqlDatabaseGetPropertiesOptions'}, } @@ -4632,176 +3961,6 @@ def __init__(self, **kwargs): self.id = kwargs.get('id', None) -class SqlRoleAssignmentCreateUpdateParameters(Model): - """Parameters to create and update an Azure Cosmos DB SQL Role Assignment. - - :param role_definition_id: The unique identifier for the associated Role - Definition. - :type role_definition_id: str - :param scope: The data plane resource path for which access is being - granted through this Role Assignment. - :type scope: str - :param principal_id: The unique identifier for the associated AAD - principal in the AAD graph to which access is being granted through this - Role Assignment. Tenant ID for the principal is inferred using the tenant - associated with the subscription. - :type principal_id: str - """ - - _attribute_map = { - 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SqlRoleAssignmentCreateUpdateParameters, self).__init__(**kwargs) - self.role_definition_id = kwargs.get('role_definition_id', None) - self.scope = kwargs.get('scope', None) - self.principal_id = kwargs.get('principal_id', None) - - -class SqlRoleAssignmentGetResults(ARMProxyResource): - """An Azure Cosmos DB Role Assignment. - - 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 role_definition_id: The unique identifier for the associated Role - Definition. - :type role_definition_id: str - :param scope: The data plane resource path for which access is being - granted through this Role Assignment. - :type scope: str - :param principal_id: The unique identifier for the associated AAD - principal in the AAD graph to which access is being granted through this - Role Assignment. Tenant ID for the principal is inferred using the tenant - associated with the subscription. - :type principal_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, - } - - def __init__(self, **kwargs): - super(SqlRoleAssignmentGetResults, self).__init__(**kwargs) - self.role_definition_id = kwargs.get('role_definition_id', None) - self.scope = kwargs.get('scope', None) - self.principal_id = kwargs.get('principal_id', None) - - -class SqlRoleDefinitionCreateUpdateParameters(Model): - """Parameters to create and update an Azure Cosmos DB SQL Role Definition. - - :param role_name: A user-friendly name for the Role Definition. Must be - unique for the database account. - :type role_name: str - :param type: Indicates whether the Role Definition was built-in or user - created. Possible values include: 'BuiltInRole', 'CustomRole' - :type type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :param assignable_scopes: A set of fully qualified Scopes at or below - which Role Assignments may be created using this Role Definition. This - will allow application of this Role Definition on the entire database - account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as - assignable Scopes. Note that resources referenced in assignable Scopes - need not exist. - :type assignable_scopes: list[str] - :param permissions: The set of operations allowed through this Role - Definition. - :type permissions: list[~azure.mgmt.cosmosdb.models.Permission] - """ - - _attribute_map = { - 'role_name': {'key': 'properties.roleName', 'type': 'str'}, - 'type': {'key': 'properties.type', 'type': 'RoleDefinitionType'}, - 'assignable_scopes': {'key': 'properties.assignableScopes', 'type': '[str]'}, - 'permissions': {'key': 'properties.permissions', 'type': '[Permission]'}, - } - - def __init__(self, **kwargs): - super(SqlRoleDefinitionCreateUpdateParameters, self).__init__(**kwargs) - self.role_name = kwargs.get('role_name', None) - self.type = kwargs.get('type', None) - self.assignable_scopes = kwargs.get('assignable_scopes', None) - self.permissions = kwargs.get('permissions', None) - - -class SqlRoleDefinitionGetResults(ARMProxyResource): - """An Azure Cosmos DB SQL Role Definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The unique resource identifier of the 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 role_name: A user-friendly name for the Role Definition. Must be - unique for the database account. - :type role_name: str - :param sql_role_definition_get_results_type: Indicates whether the Role - Definition was built-in or user created. Possible values include: - 'BuiltInRole', 'CustomRole' - :type sql_role_definition_get_results_type: str or - ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :param assignable_scopes: A set of fully qualified Scopes at or below - which Role Assignments may be created using this Role Definition. This - will allow application of this Role Definition on the entire database - account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as - assignable Scopes. Note that resources referenced in assignable Scopes - need not exist. - :type assignable_scopes: list[str] - :param permissions: The set of operations allowed through this Role - Definition. - :type permissions: list[~azure.mgmt.cosmosdb.models.Permission] - """ - - _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'}, - 'role_name': {'key': 'properties.roleName', 'type': 'str'}, - 'sql_role_definition_get_results_type': {'key': 'properties.type', 'type': 'RoleDefinitionType'}, - 'assignable_scopes': {'key': 'properties.assignableScopes', 'type': '[str]'}, - 'permissions': {'key': 'properties.permissions', 'type': '[Permission]'}, - } - - def __init__(self, **kwargs): - super(SqlRoleDefinitionGetResults, self).__init__(**kwargs) - self.role_name = kwargs.get('role_name', None) - self.sql_role_definition_get_results_type = kwargs.get('sql_role_definition_get_results_type', None) - self.assignable_scopes = kwargs.get('assignable_scopes', None) - self.permissions = kwargs.get('permissions', None) - - class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): """Parameters to create and update Cosmos DB storedProcedure. @@ -4821,8 +3980,6 @@ class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -4844,7 +4001,6 @@ 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'}, } @@ -4918,8 +4074,6 @@ class SqlStoredProcedureGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource @@ -4937,7 +4091,6 @@ 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'}, } @@ -4991,8 +4144,6 @@ class SqlTriggerCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -5014,7 +4165,6 @@ 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'}, } @@ -5099,8 +4249,6 @@ class SqlTriggerGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource @@ -5118,7 +4266,6 @@ 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'}, } @@ -5183,8 +4330,6 @@ class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a userDefinedFunction :type resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource @@ -5207,7 +4352,6 @@ 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'}, } @@ -5281,8 +4425,6 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource @@ -5300,7 +4442,6 @@ 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'}, } @@ -5335,47 +4476,6 @@ def __init__(self, **kwargs): self.body = kwargs.get('body', None) -class SystemData(Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. - Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' - :type created_by_type: str or ~azure.mgmt.cosmosdb.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the - resource. Possible values include: 'User', 'Application', - 'ManagedIdentity', 'Key' - :type last_modified_by_type: str or - ~azure.mgmt.cosmosdb.models.CreatedByType - :param last_modified_at: The type of identity that last modified the - resource. - :type last_modified_at: datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__(self, **kwargs): - super(SystemData, self).__init__(**kwargs) - self.created_by = kwargs.get('created_by', None) - self.created_by_type = kwargs.get('created_by_type', None) - self.created_at = kwargs.get('created_at', None) - self.last_modified_by = kwargs.get('last_modified_by', None) - self.last_modified_by_type = kwargs.get('last_modified_by_type', None) - self.last_modified_at = kwargs.get('last_modified_at', None) - - class TableCreateUpdateParameters(ARMResourceProperties): """Parameters to create and update Cosmos DB Table. @@ -5395,8 +4495,6 @@ class TableCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -5418,7 +4516,6 @@ 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'}, } @@ -5508,8 +4605,6 @@ class TableGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource :param options: @@ -5528,7 +4623,6 @@ 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'}, } @@ -5657,8 +4751,6 @@ class ThroughputSettingsGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetPropertiesResource @@ -5676,7 +4768,6 @@ class ThroughputSettingsGetResults(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'ThroughputSettingsGetPropertiesResource'}, } @@ -5745,8 +4836,6 @@ class ThroughputSettingsUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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 @@ -5765,7 +4854,6 @@ class ThroughputSettingsUpdateParameters(ARMResourceProperties): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, 'resource': {'key': 'properties.resource', 'type': 'ThroughputSettingsResource'}, } 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 919f8e39ae5d..4b8cbfa322e6 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 @@ -81,8 +81,6 @@ class ARMResourceProperties(Model): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity """ _validation = { @@ -97,17 +95,15 @@ class ARMResourceProperties(Model): 'type': {'key': 'type', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, **kwargs) -> None: + def __init__(self, *, location: str=None, tags=None, **kwargs) -> None: super(ARMResourceProperties, self).__init__(**kwargs) self.id = None self.name = None self.type = None self.location = location self.tags = tags - self.identity = identity class AutoscaleSettings(Model): @@ -255,35 +251,6 @@ def __init__(self, **kwargs) -> None: self.etag = None -class BackupPolicy(Model): - """The object representing the policy for taking backups on an account. - - You probably want to use the sub-classes and not this class directly. Known - sub-classes are: PeriodicModeBackupPolicy, ContinuousModeBackupPolicy - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - } - - _subtype_map = { - 'type': {'Periodic': 'PeriodicModeBackupPolicy', 'Continuous': 'ContinuousModeBackupPolicy'} - } - - def __init__(self, **kwargs) -> None: - super(BackupPolicy, self).__init__(**kwargs) - self.type = None - - class Capability(Model): """Cosmos DB capability object. @@ -321,8 +288,6 @@ class CassandraKeyspaceCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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 @@ -345,13 +310,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(CassandraKeyspaceCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(CassandraKeyspaceCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -457,8 +421,6 @@ class CassandraKeyspaceGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.CassandraKeyspaceGetPropertiesResource @@ -479,13 +441,12 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, options=None, **kwargs) -> None: - super(CassandraKeyspaceGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, options=None, **kwargs) -> None: + super(CassandraKeyspaceGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -572,8 +533,6 @@ class CassandraTableCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -595,13 +554,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(CassandraTableCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(CassandraTableCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -697,8 +655,6 @@ class CassandraTableGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.CassandraTableGetPropertiesResource @@ -719,13 +675,12 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, options=None, **kwargs) -> None: - super(CassandraTableGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, options=None, **kwargs) -> None: + super(CassandraTableGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -935,28 +890,6 @@ def __init__(self, *, paths=None, kind="Hash", version: int=None, **kwargs) -> N self.version = version -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. Constant filled by server. - :type type: str - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ContinuousModeBackupPolicy, self).__init__(**kwargs) - self.type = 'Continuous' - - class CorsPolicy(Model): """The CORS policy for the Cosmos DB database account. @@ -1072,53 +1005,10 @@ class DatabaseAccountCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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'. Default value: "GlobalDocumentDB" . :type kind: str or ~azure.mgmt.cosmosdb.models.DatabaseAccountKind - :param properties: Required. - :type properties: - ~azure.mgmt.cosmosdb.models.DatabaseAccountCreateUpdateProperties - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - 'properties': {'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'}, - 'properties': {'key': 'properties', 'type': 'DatabaseAccountCreateUpdateProperties'}, - } - - def __init__(self, *, properties, location: str=None, tags=None, identity=None, kind="GlobalDocumentDB", **kwargs) -> None: - super(DatabaseAccountCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) - self.kind = kind - self.properties = properties - - -class DatabaseAccountCreateUpdateProperties(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, - RestoreReqeustDatabaseAccountCreateUpdateProperties - - 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 @@ -1170,52 +1060,50 @@ class DatabaseAccountCreateUpdateProperties(Model): :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. :type enable_analytical_storage: bool - :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 create_mode: Required. Constant filled by server. - :type create_mode: str """ _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 = { - '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'}, - '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'}, - 'backup_policy': {'key': 'backupPolicy', 'type': 'BackupPolicy'}, - 'cors': {'key': 'cors', 'type': '[CorsPolicy]'}, - 'create_mode': {'key': 'createMode', 'type': 'str'}, - } - - _subtype_map = { - 'create_mode': {'Default': 'DefaultRequestDatabaseAccountCreateUpdateProperties', 'Restore': 'RestoreReqeustDatabaseAccountCreateUpdateProperties'} + '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'}, + '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'}, + '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'}, + 'cors': {'key': 'properties.cors', 'type': '[CorsPolicy]'}, } database_account_offer_type = "Standard" - def __init__(self, *, locations, consistency_policy=None, ip_rules=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, capabilities=None, virtual_network_rules=None, enable_multiple_write_locations: bool=None, enable_cassandra_connector: bool=None, connector_offer=None, disable_key_based_metadata_write_access: bool=None, key_vault_key_uri: str=None, public_network_access=None, enable_free_tier: bool=None, api_properties=None, enable_analytical_storage: bool=None, backup_policy=None, cors=None, **kwargs) -> None: - super(DatabaseAccountCreateUpdateProperties, self).__init__(**kwargs) + def __init__(self, *, locations, location: str=None, tags=None, kind="GlobalDocumentDB", consistency_policy=None, ip_rules=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, capabilities=None, virtual_network_rules=None, enable_multiple_write_locations: bool=None, enable_cassandra_connector: bool=None, connector_offer=None, disable_key_based_metadata_write_access: bool=None, key_vault_key_uri: str=None, public_network_access=None, enable_free_tier: bool=None, api_properties=None, enable_analytical_storage: bool=None, cors=None, **kwargs) -> None: + super(DatabaseAccountCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) + self.kind = kind self.consistency_policy = consistency_policy self.locations = locations self.ip_rules = ip_rules @@ -1232,9 +1120,7 @@ def __init__(self, *, locations, consistency_policy=None, ip_rules=None, is_virt self.enable_free_tier = enable_free_tier self.api_properties = api_properties self.enable_analytical_storage = enable_analytical_storage - self.backup_policy = backup_policy self.cors = cors - self.create_mode = None class DatabaseAccountGetResults(ARMResourceProperties): @@ -1254,8 +1140,6 @@ class DatabaseAccountGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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'. Default value: "GlobalDocumentDB" . @@ -1331,21 +1215,8 @@ class DatabaseAccountGetResults(ARMResourceProperties): :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. :type enable_analytical_storage: bool - :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] - :ivar system_data: The system meta data relating to this resource. - :vartype system_data: ~azure.mgmt.cosmosdb.models.SystemData """ _validation = { @@ -1359,8 +1230,6 @@ class DatabaseAccountGetResults(ARMResourceProperties): 'locations': {'readonly': True}, 'failover_policies': {'readonly': True}, 'private_endpoint_connections': {'readonly': True}, - 'instance_id': {'readonly': True}, - 'system_data': {'readonly': True}, } _attribute_map = { @@ -1369,7 +1238,6 @@ class DatabaseAccountGetResults(ARMResourceProperties): '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'}, 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, 'document_endpoint': {'key': 'properties.documentEndpoint', 'type': 'str'}, @@ -1394,16 +1262,11 @@ class DatabaseAccountGetResults(ARMResourceProperties): 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, - '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]'}, - 'system_data': {'key': 'systemData', 'type': 'SystemData'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, kind="GlobalDocumentDB", provisioning_state: str=None, ip_rules=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, consistency_policy=None, capabilities=None, virtual_network_rules=None, enable_multiple_write_locations: bool=None, enable_cassandra_connector: bool=None, connector_offer=None, disable_key_based_metadata_write_access: bool=None, key_vault_key_uri: str=None, public_network_access=None, enable_free_tier: bool=None, api_properties=None, enable_analytical_storage: bool=None, create_mode="Default", restore_parameters=None, backup_policy=None, cors=None, **kwargs) -> None: - super(DatabaseAccountGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, kind="GlobalDocumentDB", provisioning_state: str=None, ip_rules=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, consistency_policy=None, capabilities=None, virtual_network_rules=None, enable_multiple_write_locations: bool=None, enable_cassandra_connector: bool=None, connector_offer=None, disable_key_based_metadata_write_access: bool=None, key_vault_key_uri: str=None, public_network_access=None, enable_free_tier: bool=None, api_properties=None, enable_analytical_storage: bool=None, cors=None, **kwargs) -> None: + super(DatabaseAccountGetResults, self).__init__(location=location, tags=tags, **kwargs) self.kind = kind self.provisioning_state = provisioning_state self.document_endpoint = None @@ -1428,12 +1291,7 @@ def __init__(self, *, location: str=None, tags=None, identity=None, kind="Global self.enable_free_tier = enable_free_tier self.api_properties = api_properties self.enable_analytical_storage = enable_analytical_storage - self.instance_id = None - self.create_mode = create_mode - self.restore_parameters = restore_parameters - self.backup_policy = backup_policy self.cors = cors - self.system_data = None class DatabaseAccountListConnectionStringsResult(Model): @@ -1603,13 +1461,8 @@ class DatabaseAccountUpdateParameters(Model): :param enable_analytical_storage: Flag to indicate whether to enable storage analytics. :type enable_analytical_storage: bool - :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 identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity """ _attribute_map = { @@ -1631,12 +1484,10 @@ class DatabaseAccountUpdateParameters(Model): 'enable_free_tier': {'key': 'properties.enableFreeTier', 'type': 'bool'}, 'api_properties': {'key': 'properties.apiProperties', 'type': 'ApiProperties'}, 'enable_analytical_storage': {'key': 'properties.enableAnalyticalStorage', 'type': 'bool'}, - 'backup_policy': {'key': 'properties.backupPolicy', 'type': 'BackupPolicy'}, 'cors': {'key': 'properties.cors', 'type': '[CorsPolicy]'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, } - def __init__(self, *, tags=None, location: str=None, consistency_policy=None, locations=None, ip_rules=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, capabilities=None, virtual_network_rules=None, enable_multiple_write_locations: bool=None, enable_cassandra_connector: bool=None, connector_offer=None, disable_key_based_metadata_write_access: bool=None, key_vault_key_uri: str=None, public_network_access=None, enable_free_tier: bool=None, api_properties=None, enable_analytical_storage: bool=None, backup_policy=None, cors=None, identity=None, **kwargs) -> None: + def __init__(self, *, tags=None, location: str=None, consistency_policy=None, locations=None, ip_rules=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, capabilities=None, virtual_network_rules=None, enable_multiple_write_locations: bool=None, enable_cassandra_connector: bool=None, connector_offer=None, disable_key_based_metadata_write_access: bool=None, key_vault_key_uri: str=None, public_network_access=None, enable_free_tier: bool=None, api_properties=None, enable_analytical_storage: bool=None, cors=None, **kwargs) -> None: super(DatabaseAccountUpdateParameters, self).__init__(**kwargs) self.tags = tags self.location = location @@ -1656,159 +1507,7 @@ def __init__(self, *, tags=None, location: str=None, consistency_policy=None, lo self.enable_free_tier = enable_free_tier self.api_properties = api_properties self.enable_analytical_storage = enable_analytical_storage - self.backup_policy = backup_policy self.cors = cors - self.identity = identity - - -class DatabaseRestoreResource(Model): - """Specific Databases to restore. - - :param database_name: The name of the database to restore. - :type database_name: str - :param collection_names: The names of the collections to 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: str=None, collection_names=None, **kwargs) -> None: - super(DatabaseRestoreResource, self).__init__(**kwargs) - self.database_name = database_name - self.collection_names = collection_names - - -class DefaultErrorResponse(Model): - """An error response from the service. - - :param error: - :type error: ~azure.mgmt.cosmosdb.models.ErrorResponse - """ - - _attribute_map = { - 'error': {'key': 'error', 'type': 'ErrorResponse'}, - } - - def __init__(self, *, error=None, **kwargs) -> None: - super(DefaultErrorResponse, self).__init__(**kwargs) - self.error = error - - -class DefaultErrorResponseException(HttpOperationError): - """Server responsed with exception of type: 'DefaultErrorResponse'. - - :param deserialize: A deserializer - :param response: Server response to be deserialized. - """ - - def __init__(self, deserialize, response, *args): - - super(DefaultErrorResponseException, self).__init__(deserialize, response, 'DefaultErrorResponse', *args) - - -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: 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 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 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 create_mode: Required. Constant filled by server. - :type create_mode: str - """ - - _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'}, - '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'}, - 'backup_policy': {'key': 'backupPolicy', 'type': 'BackupPolicy'}, - 'cors': {'key': 'cors', 'type': '[CorsPolicy]'}, - 'create_mode': {'key': 'createMode', 'type': 'str'}, - } - - def __init__(self, *, locations, consistency_policy=None, ip_rules=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, capabilities=None, virtual_network_rules=None, enable_multiple_write_locations: bool=None, enable_cassandra_connector: bool=None, connector_offer=None, disable_key_based_metadata_write_access: bool=None, key_vault_key_uri: str=None, public_network_access=None, enable_free_tier: bool=None, api_properties=None, enable_analytical_storage: bool=None, backup_policy=None, cors=None, **kwargs) -> None: - 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, public_network_access=public_network_access, enable_free_tier=enable_free_tier, api_properties=api_properties, enable_analytical_storage=enable_analytical_storage, backup_policy=backup_policy, cors=cors, **kwargs) - self.create_mode = 'Default' class ErrorResponse(Model): @@ -1974,8 +1673,6 @@ class GremlinDatabaseCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -1997,13 +1694,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(GremlinDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(GremlinDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -2087,8 +1783,6 @@ class GremlinDatabaseGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.GremlinDatabaseGetPropertiesResource @@ -2109,13 +1803,12 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, options=None, **kwargs) -> None: - super(GremlinDatabaseGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, options=None, **kwargs) -> None: + super(GremlinDatabaseGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -2161,8 +1854,6 @@ class GremlinGraphCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -2184,13 +1875,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(GremlinGraphCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(GremlinGraphCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -2300,8 +1990,6 @@ class GremlinGraphGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.GremlinGraphGetPropertiesResource @@ -2322,13 +2010,12 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, options=None, **kwargs) -> None: - super(GremlinGraphGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, options=None, **kwargs) -> None: + super(GremlinGraphGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -2540,80 +2227,6 @@ def __init__(self, *, location_name: str=None, provisioning_state: str=None, fai self.is_zone_redundant = is_zone_redundant -class ManagedServiceIdentity(Model): - """Identity for the resource. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar principal_id: The principal id of the system assigned identity. This - property will only be provided for a system assigned identity. - :vartype principal_id: str - :ivar tenant_id: The tenant id of the system assigned identity. This - property will only be provided for a system assigned identity. - :vartype tenant_id: str - :param type: The type of identity used for the resource. The type - 'SystemAssigned,UserAssigned' includes both an implicitly created identity - and a set of user assigned identities. The type 'None' will remove any - identities from the service. Possible values include: 'SystemAssigned', - 'UserAssigned', 'SystemAssigned,UserAssigned', 'None' - :type type: str or ~azure.mgmt.cosmosdb.models.ResourceIdentityType - :param user_assigned_identities: The list of user identities associated - with resource. The user identity dictionary key references will be ARM - resource ids in the form: - '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. - :type user_assigned_identities: dict[str, - ~azure.mgmt.cosmosdb.models.ManagedServiceIdentityUserAssignedIdentitiesValue] - """ - - _validation = { - 'principal_id': {'readonly': True}, - 'tenant_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'tenant_id': {'key': 'tenantId', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'ResourceIdentityType'}, - 'user_assigned_identities': {'key': 'userAssignedIdentities', 'type': '{ManagedServiceIdentityUserAssignedIdentitiesValue}'}, - } - - def __init__(self, *, type=None, user_assigned_identities=None, **kwargs) -> None: - super(ManagedServiceIdentity, self).__init__(**kwargs) - self.principal_id = None - self.tenant_id = None - self.type = type - self.user_assigned_identities = user_assigned_identities - - -class ManagedServiceIdentityUserAssignedIdentitiesValue(Model): - """ManagedServiceIdentityUserAssignedIdentitiesValue. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :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 = { - 'principal_id': {'readonly': True}, - 'client_id': {'readonly': True}, - } - - _attribute_map = { - 'principal_id': {'key': 'principalId', 'type': 'str'}, - 'client_id': {'key': 'clientId', 'type': 'str'}, - } - - def __init__(self, **kwargs) -> None: - super(ManagedServiceIdentityUserAssignedIdentitiesValue, self).__init__(**kwargs) - self.principal_id = None - self.client_id = None - - class Metric(Model): """Metric data. @@ -2838,8 +2451,6 @@ class MongoDBCollectionCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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 @@ -2862,13 +2473,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(MongoDBCollectionCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(MongoDBCollectionCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -2965,8 +2575,6 @@ class MongoDBCollectionGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.MongoDBCollectionGetPropertiesResource @@ -2987,13 +2595,12 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, options=None, **kwargs) -> None: - super(MongoDBCollectionGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, options=None, **kwargs) -> None: + super(MongoDBCollectionGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -3052,8 +2659,6 @@ class MongoDBDatabaseCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -3075,13 +2680,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(MongoDBDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(MongoDBDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -3165,8 +2769,6 @@ class MongoDBDatabaseGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.MongoDBDatabaseGetPropertiesResource @@ -3187,13 +2789,12 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, options=None, **kwargs) -> None: - super(MongoDBDatabaseGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, options=None, **kwargs) -> None: + super(MongoDBDatabaseGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -3706,81 +3307,6 @@ def __init__(self, **kwargs) -> None: self.p99 = None -class PeriodicModeBackupPolicy(BackupPolicy): - """The object representing periodic mode backup policy. - - All required parameters must be populated in order to send to Azure. - - :param type: Required. Constant filled by server. - :type type: str - :param periodic_mode_properties: Configuration values for periodic mode - backup - :type periodic_mode_properties: - ~azure.mgmt.cosmosdb.models.PeriodicModeProperties - """ - - _validation = { - 'type': {'required': True}, - } - - _attribute_map = { - 'type': {'key': 'type', 'type': 'str'}, - 'periodic_mode_properties': {'key': 'periodicModeProperties', 'type': 'PeriodicModeProperties'}, - } - - def __init__(self, *, periodic_mode_properties=None, **kwargs) -> None: - super(PeriodicModeBackupPolicy, self).__init__(**kwargs) - self.periodic_mode_properties = periodic_mode_properties - self.type = 'Periodic' - - -class PeriodicModeProperties(Model): - """Configuration values for periodic mode backup. - - :param backup_interval_in_minutes: An integer representing the interval in - minutes between two backups - :type backup_interval_in_minutes: int - :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 - """ - - _validation = { - 'backup_interval_in_minutes': {'minimum': 0}, - 'backup_retention_interval_in_hours': {'minimum': 0}, - } - - _attribute_map = { - 'backup_interval_in_minutes': {'key': 'backupIntervalInMinutes', 'type': 'int'}, - 'backup_retention_interval_in_hours': {'key': 'backupRetentionIntervalInHours', 'type': 'int'}, - } - - def __init__(self, *, backup_interval_in_minutes: int=None, backup_retention_interval_in_hours: int=None, **kwargs) -> None: - 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 - - -class Permission(Model): - """The set of data plane operations permitted through this Role Definition. - - :param data_actions: An array of data actions that are allowed. - :type data_actions: list[str] - :param not_data_actions: An array of data actions that are denied. - :type not_data_actions: list[str] - """ - - _attribute_map = { - 'data_actions': {'key': 'dataActions', 'type': '[str]'}, - 'not_data_actions': {'key': 'notDataActions', 'type': '[str]'}, - } - - def __init__(self, *, data_actions=None, not_data_actions=None, **kwargs) -> None: - super(Permission, self).__init__(**kwargs) - self.data_actions = data_actions - self.not_data_actions = not_data_actions - - class ProxyResource(Resource): """The resource model definition for a ARM proxy resource. It will have everything other than required location and tags. @@ -3981,199 +3507,6 @@ def __init__(self, *, region: str, **kwargs) -> None: self.region = region -class RestorableDatabaseAccountGetResult(ARMResourceProperties): - """A Azure Cosmos DB restorable 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: - :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity - :param account_name: The name of the global database account - :type account_name: str - :param creation_time: The creation time of the restorable database account - (ISO-8601 format). - :type creation_time: datetime - :param deletion_time: The time at which the restorable database account - has been deleted (ISO-8601 format). - :type deletion_time: datetime - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'location': {'key': 'location', 'type': 'str'}, - 'tags': {'key': 'tags', 'type': '{str}'}, - 'identity': {'key': 'identity', 'type': 'ManagedServiceIdentity'}, - 'account_name': {'key': 'properties.accountName', 'type': 'str'}, - 'creation_time': {'key': 'properties.creationTime', 'type': 'iso-8601'}, - 'deletion_time': {'key': 'properties.deletionTime', 'type': 'iso-8601'}, - } - - def __init__(self, *, location: str=None, tags=None, identity=None, account_name: str=None, creation_time=None, deletion_time=None, **kwargs) -> None: - super(RestorableDatabaseAccountGetResult, self).__init__(location=location, tags=tags, identity=identity, **kwargs) - self.account_name = account_name - self.creation_time = creation_time - self.deletion_time = deletion_time - - -class RestoreParameters(Model): - """Parameters to indicate the information about the restore. - - :param restore_mode: Describes the mode of the restore. Possible values - include: 'PointInTime' - :type restore_mode: str or ~azure.mgmt.cosmosdb.models.RestoreMode - :param restore_source: Path of the source account from which the restore - has to be initiated - :type restore_source: str - :param restore_timestamp_in_utc: Time to which the account has to be - restored (ISO-8601 format). - :type restore_timestamp_in_utc: datetime - :param databases_to_restore: List of specific databases to restore. - :type databases_to_restore: - list[~azure.mgmt.cosmosdb.models.DatabaseRestoreResource] - """ - - _attribute_map = { - 'restore_mode': {'key': 'restoreMode', 'type': 'str'}, - 'restore_source': {'key': 'restoreSource', 'type': 'str'}, - 'restore_timestamp_in_utc': {'key': 'restoreTimestampInUtc', 'type': 'iso-8601'}, - 'databases_to_restore': {'key': 'databasesToRestore', 'type': '[DatabaseRestoreResource]'}, - } - - def __init__(self, *, restore_mode=None, restore_source: str=None, restore_timestamp_in_utc=None, databases_to_restore=None, **kwargs) -> None: - super(RestoreParameters, self).__init__(**kwargs) - self.restore_mode = restore_mode - self.restore_source = restore_source - self.restore_timestamp_in_utc = restore_timestamp_in_utc - self.databases_to_restore = databases_to_restore - - -class RestoreReqeustDatabaseAccountCreateUpdateProperties(DatabaseAccountCreateUpdateProperties): - """Properties to restore Azure Cosmos DB database account. - - 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: 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 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 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 create_mode: Required. Constant filled by server. - :type create_mode: str - :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'}, - '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'}, - 'backup_policy': {'key': 'backupPolicy', 'type': 'BackupPolicy'}, - 'cors': {'key': 'cors', 'type': '[CorsPolicy]'}, - 'create_mode': {'key': 'createMode', 'type': 'str'}, - 'restore_parameters': {'key': 'restoreParameters', 'type': 'RestoreParameters'}, - } - - def __init__(self, *, locations, consistency_policy=None, ip_rules=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, capabilities=None, virtual_network_rules=None, enable_multiple_write_locations: bool=None, enable_cassandra_connector: bool=None, connector_offer=None, disable_key_based_metadata_write_access: bool=None, key_vault_key_uri: str=None, public_network_access=None, enable_free_tier: bool=None, api_properties=None, enable_analytical_storage: bool=None, backup_policy=None, cors=None, restore_parameters=None, **kwargs) -> None: - super(RestoreReqeustDatabaseAccountCreateUpdateProperties, 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, public_network_access=public_network_access, enable_free_tier=enable_free_tier, api_properties=api_properties, enable_analytical_storage=enable_analytical_storage, backup_policy=backup_policy, cors=cors, **kwargs) - self.restore_parameters = restore_parameters - self.create_mode = 'Restore' - - class SpatialSpec(Model): """SpatialSpec. @@ -4214,8 +3547,6 @@ class SqlContainerCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -4237,13 +3568,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(SqlContainerCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(SqlContainerCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -4295,6 +3625,8 @@ class SqlContainerGetPropertiesResource(Model): container. :type conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :param analytical_storage_ttl: Analytical TTL. + :type analytical_storage_ttl: long :ivar _rid: A system generated property. A unique identifier. :vartype _rid: str :ivar _ts: A system generated property that denotes the last updated @@ -4319,12 +3651,13 @@ class SqlContainerGetPropertiesResource(Model): 'default_ttl': {'key': 'defaultTtl', 'type': 'int'}, 'unique_key_policy': {'key': 'uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, 'conflict_resolution_policy': {'key': 'conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, + 'analytical_storage_ttl': {'key': 'analyticalStorageTtl', 'type': 'long'}, '_rid': {'key': '_rid', 'type': 'str'}, '_ts': {'key': '_ts', 'type': 'object'}, '_etag': {'key': '_etag', 'type': 'str'}, } - def __init__(self, *, id: str, indexing_policy=None, partition_key=None, default_ttl: int=None, unique_key_policy=None, conflict_resolution_policy=None, **kwargs) -> None: + def __init__(self, *, id: str, indexing_policy=None, partition_key=None, default_ttl: int=None, unique_key_policy=None, conflict_resolution_policy=None, analytical_storage_ttl: int=None, **kwargs) -> None: super(SqlContainerGetPropertiesResource, self).__init__(**kwargs) self.id = id self.indexing_policy = indexing_policy @@ -4332,6 +3665,7 @@ def __init__(self, *, id: str, indexing_policy=None, partition_key=None, default self.default_ttl = default_ttl self.unique_key_policy = unique_key_policy self.conflict_resolution_policy = conflict_resolution_policy + self.analytical_storage_ttl = analytical_storage_ttl self._rid = None self._ts = None self._etag = None @@ -4354,8 +3688,6 @@ class SqlContainerGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlContainerGetPropertiesResource @@ -4376,13 +3708,12 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, options=None, **kwargs) -> None: - super(SqlContainerGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, options=None, **kwargs) -> None: + super(SqlContainerGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -4411,6 +3742,8 @@ class SqlContainerResource(Model): container. :type conflict_resolution_policy: ~azure.mgmt.cosmosdb.models.ConflictResolutionPolicy + :param analytical_storage_ttl: Analytical TTL. + :type analytical_storage_ttl: long """ _validation = { @@ -4424,9 +3757,10 @@ class SqlContainerResource(Model): 'default_ttl': {'key': 'defaultTtl', 'type': 'int'}, 'unique_key_policy': {'key': 'uniqueKeyPolicy', 'type': 'UniqueKeyPolicy'}, 'conflict_resolution_policy': {'key': 'conflictResolutionPolicy', 'type': 'ConflictResolutionPolicy'}, + 'analytical_storage_ttl': {'key': 'analyticalStorageTtl', 'type': 'long'}, } - def __init__(self, *, id: str, indexing_policy=None, partition_key=None, default_ttl: int=None, unique_key_policy=None, conflict_resolution_policy=None, **kwargs) -> None: + def __init__(self, *, id: str, indexing_policy=None, partition_key=None, default_ttl: int=None, unique_key_policy=None, conflict_resolution_policy=None, analytical_storage_ttl: int=None, **kwargs) -> None: super(SqlContainerResource, self).__init__(**kwargs) self.id = id self.indexing_policy = indexing_policy @@ -4434,6 +3768,7 @@ def __init__(self, *, id: str, indexing_policy=None, partition_key=None, default self.default_ttl = default_ttl self.unique_key_policy = unique_key_policy self.conflict_resolution_policy = conflict_resolution_policy + self.analytical_storage_ttl = analytical_storage_ttl class SqlDatabaseCreateUpdateParameters(ARMResourceProperties): @@ -4455,8 +3790,6 @@ class SqlDatabaseCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -4478,13 +3811,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(SqlDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(SqlDatabaseCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -4578,8 +3910,6 @@ class SqlDatabaseGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlDatabaseGetPropertiesResource @@ -4599,13 +3929,12 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, options=None, **kwargs) -> None: - super(SqlDatabaseGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, options=None, **kwargs) -> None: + super(SqlDatabaseGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -4632,176 +3961,6 @@ def __init__(self, *, id: str, **kwargs) -> None: self.id = id -class SqlRoleAssignmentCreateUpdateParameters(Model): - """Parameters to create and update an Azure Cosmos DB SQL Role Assignment. - - :param role_definition_id: The unique identifier for the associated Role - Definition. - :type role_definition_id: str - :param scope: The data plane resource path for which access is being - granted through this Role Assignment. - :type scope: str - :param principal_id: The unique identifier for the associated AAD - principal in the AAD graph to which access is being granted through this - Role Assignment. Tenant ID for the principal is inferred using the tenant - associated with the subscription. - :type principal_id: str - """ - - _attribute_map = { - 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, - } - - def __init__(self, *, role_definition_id: str=None, scope: str=None, principal_id: str=None, **kwargs) -> None: - super(SqlRoleAssignmentCreateUpdateParameters, self).__init__(**kwargs) - self.role_definition_id = role_definition_id - self.scope = scope - self.principal_id = principal_id - - -class SqlRoleAssignmentGetResults(ARMProxyResource): - """An Azure Cosmos DB Role Assignment. - - 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 role_definition_id: The unique identifier for the associated Role - Definition. - :type role_definition_id: str - :param scope: The data plane resource path for which access is being - granted through this Role Assignment. - :type scope: str - :param principal_id: The unique identifier for the associated AAD - principal in the AAD graph to which access is being granted through this - Role Assignment. Tenant ID for the principal is inferred using the tenant - associated with the subscription. - :type principal_id: str - """ - - _validation = { - 'id': {'readonly': True}, - 'name': {'readonly': True}, - 'type': {'readonly': True}, - } - - _attribute_map = { - 'id': {'key': 'id', 'type': 'str'}, - 'name': {'key': 'name', 'type': 'str'}, - 'type': {'key': 'type', 'type': 'str'}, - 'role_definition_id': {'key': 'properties.roleDefinitionId', 'type': 'str'}, - 'scope': {'key': 'properties.scope', 'type': 'str'}, - 'principal_id': {'key': 'properties.principalId', 'type': 'str'}, - } - - def __init__(self, *, role_definition_id: str=None, scope: str=None, principal_id: str=None, **kwargs) -> None: - super(SqlRoleAssignmentGetResults, self).__init__(**kwargs) - self.role_definition_id = role_definition_id - self.scope = scope - self.principal_id = principal_id - - -class SqlRoleDefinitionCreateUpdateParameters(Model): - """Parameters to create and update an Azure Cosmos DB SQL Role Definition. - - :param role_name: A user-friendly name for the Role Definition. Must be - unique for the database account. - :type role_name: str - :param type: Indicates whether the Role Definition was built-in or user - created. Possible values include: 'BuiltInRole', 'CustomRole' - :type type: str or ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :param assignable_scopes: A set of fully qualified Scopes at or below - which Role Assignments may be created using this Role Definition. This - will allow application of this Role Definition on the entire database - account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as - assignable Scopes. Note that resources referenced in assignable Scopes - need not exist. - :type assignable_scopes: list[str] - :param permissions: The set of operations allowed through this Role - Definition. - :type permissions: list[~azure.mgmt.cosmosdb.models.Permission] - """ - - _attribute_map = { - 'role_name': {'key': 'properties.roleName', 'type': 'str'}, - 'type': {'key': 'properties.type', 'type': 'RoleDefinitionType'}, - 'assignable_scopes': {'key': 'properties.assignableScopes', 'type': '[str]'}, - 'permissions': {'key': 'properties.permissions', 'type': '[Permission]'}, - } - - def __init__(self, *, role_name: str=None, type=None, assignable_scopes=None, permissions=None, **kwargs) -> None: - super(SqlRoleDefinitionCreateUpdateParameters, self).__init__(**kwargs) - self.role_name = role_name - self.type = type - self.assignable_scopes = assignable_scopes - self.permissions = permissions - - -class SqlRoleDefinitionGetResults(ARMProxyResource): - """An Azure Cosmos DB SQL Role Definition. - - Variables are only populated by the server, and will be ignored when - sending a request. - - :ivar id: The unique resource identifier of the 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 role_name: A user-friendly name for the Role Definition. Must be - unique for the database account. - :type role_name: str - :param sql_role_definition_get_results_type: Indicates whether the Role - Definition was built-in or user created. Possible values include: - 'BuiltInRole', 'CustomRole' - :type sql_role_definition_get_results_type: str or - ~azure.mgmt.cosmosdb.models.RoleDefinitionType - :param assignable_scopes: A set of fully qualified Scopes at or below - which Role Assignments may be created using this Role Definition. This - will allow application of this Role Definition on the entire database - account or any underlying Database / Collection. Must have at least one - element. Scopes higher than Database account are not enforceable as - assignable Scopes. Note that resources referenced in assignable Scopes - need not exist. - :type assignable_scopes: list[str] - :param permissions: The set of operations allowed through this Role - Definition. - :type permissions: list[~azure.mgmt.cosmosdb.models.Permission] - """ - - _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'}, - 'role_name': {'key': 'properties.roleName', 'type': 'str'}, - 'sql_role_definition_get_results_type': {'key': 'properties.type', 'type': 'RoleDefinitionType'}, - 'assignable_scopes': {'key': 'properties.assignableScopes', 'type': '[str]'}, - 'permissions': {'key': 'properties.permissions', 'type': '[Permission]'}, - } - - def __init__(self, *, role_name: str=None, sql_role_definition_get_results_type=None, assignable_scopes=None, permissions=None, **kwargs) -> None: - super(SqlRoleDefinitionGetResults, self).__init__(**kwargs) - self.role_name = role_name - self.sql_role_definition_get_results_type = sql_role_definition_get_results_type - self.assignable_scopes = assignable_scopes - self.permissions = permissions - - class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): """Parameters to create and update Cosmos DB storedProcedure. @@ -4821,8 +3980,6 @@ class SqlStoredProcedureCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -4844,13 +4001,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(SqlStoredProcedureCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(SqlStoredProcedureCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -4918,8 +4074,6 @@ class SqlStoredProcedureGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetPropertiesResource @@ -4937,12 +4091,11 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, **kwargs) -> None: - super(SqlStoredProcedureGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: + super(SqlStoredProcedureGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource @@ -4991,8 +4144,6 @@ class SqlTriggerCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -5014,13 +4165,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(SqlTriggerCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(SqlTriggerCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -5099,8 +4249,6 @@ class SqlTriggerGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlTriggerGetPropertiesResource @@ -5118,12 +4266,11 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, **kwargs) -> None: - super(SqlTriggerGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: + super(SqlTriggerGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource @@ -5183,8 +4330,6 @@ class SqlUserDefinedFunctionCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: Required. The standard JSON format of a userDefinedFunction :type resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionResource @@ -5207,13 +4352,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(SqlUserDefinedFunctionCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(SqlUserDefinedFunctionCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -5281,8 +4425,6 @@ class SqlUserDefinedFunctionGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.SqlUserDefinedFunctionGetPropertiesResource @@ -5300,12 +4442,11 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, **kwargs) -> None: - super(SqlUserDefinedFunctionGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: + super(SqlUserDefinedFunctionGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource @@ -5335,47 +4476,6 @@ def __init__(self, *, id: str, body: str=None, **kwargs) -> None: self.body = body -class SystemData(Model): - """Metadata pertaining to creation and last modification of the resource. - - :param created_by: The identity that created the resource. - :type created_by: str - :param created_by_type: The type of identity that created the resource. - Possible values include: 'User', 'Application', 'ManagedIdentity', 'Key' - :type created_by_type: str or ~azure.mgmt.cosmosdb.models.CreatedByType - :param created_at: The timestamp of resource creation (UTC). - :type created_at: datetime - :param last_modified_by: The identity that last modified the resource. - :type last_modified_by: str - :param last_modified_by_type: The type of identity that last modified the - resource. Possible values include: 'User', 'Application', - 'ManagedIdentity', 'Key' - :type last_modified_by_type: str or - ~azure.mgmt.cosmosdb.models.CreatedByType - :param last_modified_at: The type of identity that last modified the - resource. - :type last_modified_at: datetime - """ - - _attribute_map = { - 'created_by': {'key': 'createdBy', 'type': 'str'}, - 'created_by_type': {'key': 'createdByType', 'type': 'str'}, - 'created_at': {'key': 'createdAt', 'type': 'iso-8601'}, - 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, - 'last_modified_by_type': {'key': 'lastModifiedByType', 'type': 'str'}, - 'last_modified_at': {'key': 'lastModifiedAt', 'type': 'iso-8601'}, - } - - def __init__(self, *, created_by: str=None, created_by_type=None, created_at=None, last_modified_by: str=None, last_modified_by_type=None, last_modified_at=None, **kwargs) -> None: - super(SystemData, self).__init__(**kwargs) - self.created_by = created_by - self.created_by_type = created_by_type - self.created_at = created_at - self.last_modified_by = last_modified_by - self.last_modified_by_type = last_modified_by_type - self.last_modified_at = last_modified_at - - class TableCreateUpdateParameters(ARMResourceProperties): """Parameters to create and update Cosmos DB Table. @@ -5395,8 +4495,6 @@ class TableCreateUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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: Required. A key-value pair of options to be applied for @@ -5418,13 +4516,12 @@ 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'}, } - def __init__(self, *, resource, options, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(TableCreateUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, options, location: str=None, tags=None, **kwargs) -> None: + super(TableCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -5508,8 +4605,6 @@ class TableGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.TableGetPropertiesResource :param options: @@ -5528,13 +4623,12 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, options=None, **kwargs) -> None: - super(TableGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, options=None, **kwargs) -> None: + super(TableGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource self.options = options @@ -5657,8 +4751,6 @@ class ThroughputSettingsGetResults(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :type identity: ~azure.mgmt.cosmosdb.models.ManagedServiceIdentity :param resource: :type resource: ~azure.mgmt.cosmosdb.models.ThroughputSettingsGetPropertiesResource @@ -5676,12 +4768,11 @@ 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'}, } - def __init__(self, *, location: str=None, tags=None, identity=None, resource=None, **kwargs) -> None: - super(ThroughputSettingsGetResults, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, location: str=None, tags=None, resource=None, **kwargs) -> None: + super(ThroughputSettingsGetResults, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource @@ -5745,8 +4836,6 @@ class ThroughputSettingsUpdateParameters(ARMResourceProperties): :type location: str :param tags: :type tags: dict[str, str] - :param identity: - :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 @@ -5765,12 +4854,11 @@ 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'}, } - def __init__(self, *, resource, location: str=None, tags=None, identity=None, **kwargs) -> None: - super(ThroughputSettingsUpdateParameters, self).__init__(location=location, tags=tags, identity=identity, **kwargs) + def __init__(self, *, resource, location: str=None, tags=None, **kwargs) -> None: + super(ThroughputSettingsUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.resource = resource diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_paged_models.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_paged_models.py index 5b2d6f706cf1..3ea4f5d46a00 100644 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_paged_models.py +++ b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/_paged_models.py @@ -181,32 +181,6 @@ class SqlTriggerGetResultsPaged(Paged): def __init__(self, *args, **kwargs): super(SqlTriggerGetResultsPaged, self).__init__(*args, **kwargs) -class SqlRoleDefinitionGetResultsPaged(Paged): - """ - A paging container for iterating over a list of :class:`SqlRoleDefinitionGetResults ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SqlRoleDefinitionGetResults]'} - } - - def __init__(self, *args, **kwargs): - - super(SqlRoleDefinitionGetResultsPaged, self).__init__(*args, **kwargs) -class SqlRoleAssignmentGetResultsPaged(Paged): - """ - A paging container for iterating over a list of :class:`SqlRoleAssignmentGetResults ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[SqlRoleAssignmentGetResults]'} - } - - def __init__(self, *args, **kwargs): - - super(SqlRoleAssignmentGetResultsPaged, self).__init__(*args, **kwargs) class MongoDBDatabaseGetResultsPaged(Paged): """ A paging container for iterating over a list of :class:`MongoDBDatabaseGetResults ` object @@ -298,19 +272,6 @@ class GremlinGraphGetResultsPaged(Paged): def __init__(self, *args, **kwargs): super(GremlinGraphGetResultsPaged, self).__init__(*args, **kwargs) -class RestorableDatabaseAccountGetResultPaged(Paged): - """ - A paging container for iterating over a list of :class:`RestorableDatabaseAccountGetResult ` object - """ - - _attribute_map = { - 'next_link': {'key': 'nextLink', 'type': 'str'}, - 'current_page': {'key': 'value', 'type': '[RestorableDatabaseAccountGetResult]'} - } - - def __init__(self, *args, **kwargs): - - super(RestorableDatabaseAccountGetResultPaged, self).__init__(*args, **kwargs) class NotebookWorkspacePaged(Paged): """ A paging container for iterating over a list of :class:`NotebookWorkspace ` object diff --git a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py b/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/__init__.py index 528e91854497..bf6987802bed 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 @@ -27,7 +27,6 @@ from ._table_resources_operations import TableResourcesOperations from ._cassandra_resources_operations import CassandraResourcesOperations from ._gremlin_resources_operations import GremlinResourcesOperations -from ._restorable_database_accounts_operations import RestorableDatabaseAccountsOperations from ._notebook_workspaces_operations import NotebookWorkspacesOperations from ._private_link_resources_operations import PrivateLinkResourcesOperations from ._private_endpoint_connections_operations import PrivateEndpointConnectionsOperations @@ -51,7 +50,6 @@ 'TableResourcesOperations', 'CassandraResourcesOperations', 'GremlinResourcesOperations', - 'RestorableDatabaseAccountsOperations', 'NotebookWorkspacesOperations', 'PrivateLinkResourcesOperations', 'PrivateEndpointConnectionsOperations', 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 c8e3df94fe80..8b12e10c37cc 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 @@ -27,7 +27,7 @@ class CassandraResourcesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config @@ -547,6 +547,206 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_cassandra_keyspace_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default'} + + def _migrate_cassandra_keyspace_to_autoscale_initial( + self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_cassandra_keyspace_to_autoscale.metadata['url'] + 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\._\(\)]+$'), + '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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_cassandra_keyspace_to_autoscale( + self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to + autoscale. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :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 dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_cassandra_keyspace_to_autoscale_initial( + resource_group_name=resource_group_name, + account_name=account_name, + keyspace_name=keyspace_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_cassandra_keyspace_to_autoscale.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale'} + + + def _migrate_cassandra_keyspace_to_manual_throughput_initial( + self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_cassandra_keyspace_to_manual_throughput.metadata['url'] + 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\._\(\)]+$'), + '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 = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_cassandra_keyspace_to_manual_throughput( + self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual + throughput. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :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 dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_cassandra_keyspace_to_manual_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + keyspace_name=keyspace_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_cassandra_keyspace_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput'} + def list_cassandra_tables( self, resource_group_name, account_name, keyspace_name, custom_headers=None, raw=False, **operation_config): """Lists the Cassandra table under an existing Azure Cosmos DB database @@ -1073,3 +1273,211 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_cassandra_table_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default'} + + + def _migrate_cassandra_table_to_autoscale_initial( + self, resource_group_name, account_name, keyspace_name, table_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_cassandra_table_to_autoscale.metadata['url'] + 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\._\(\)]+$'), + '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'), + 'tableName': self._serialize.url("table_name", table_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_cassandra_table_to_autoscale( + self, resource_group_name, account_name, keyspace_name, table_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB Cassandra table from manual throughput to + autoscale. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :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 table_name: Cosmos DB table name. + :type table_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_cassandra_table_to_autoscale_initial( + resource_group_name=resource_group_name, + account_name=account_name, + keyspace_name=keyspace_name, + table_name=table_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_cassandra_table_to_autoscale.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale'} + + + def _migrate_cassandra_table_to_manual_throughput_initial( + self, resource_group_name, account_name, keyspace_name, table_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_cassandra_table_to_manual_throughput.metadata['url'] + 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\._\(\)]+$'), + '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'), + 'tableName': self._serialize.url("table_name", table_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_cassandra_table_to_manual_throughput( + self, resource_group_name, account_name, keyspace_name, table_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB Cassandra table from autoscale to manual + throughput. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :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 table_name: Cosmos DB table name. + :type table_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_cassandra_table_to_manual_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + keyspace_name=keyspace_name, + table_name=table_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_cassandra_table_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput'} 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 c0a833edb541..a6fea326ec30 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 @@ -25,7 +25,7 @@ class CollectionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 84140c36f5a4..c091e2d2d1f7 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 @@ -25,7 +25,7 @@ class CollectionPartitionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 31e2779e5ca6..3e655642bec0 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 @@ -25,7 +25,7 @@ class CollectionPartitionRegionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 c3908fdf516e..026b59f04dc7 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 @@ -25,7 +25,7 @@ class CollectionRegionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 bdec8d1e0783..62653e8f5197 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 @@ -25,7 +25,7 @@ class DatabaseAccountRegionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 4a05369a804d..8ca1d318c5df 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 @@ -27,7 +27,7 @@ class DatabaseAccountsOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 393de08f5f65..76863c6853f8 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 @@ -25,7 +25,7 @@ class DatabaseOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 fed29ba6955b..e0efdb667d63 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 @@ -27,7 +27,7 @@ class GremlinResourcesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config @@ -547,6 +547,206 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_gremlin_database_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default'} + + def _migrate_gremlin_database_to_autoscale_initial( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_gremlin_database_to_autoscale.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_gremlin_database_to_autoscale( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB Gremlin database 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 database_name: Cosmos DB database name. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_gremlin_database_to_autoscale_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_gremlin_database_to_autoscale.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale'} + + + def _migrate_gremlin_database_to_manual_throughput_initial( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_gremlin_database_to_manual_throughput.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_gremlin_database_to_manual_throughput( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB Gremlin database 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 database_name: Cosmos DB database name. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_gremlin_database_to_manual_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_gremlin_database_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput'} + def list_gremlin_graphs( self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): """Lists the Gremlin graph under an existing Azure Cosmos DB database @@ -1072,3 +1272,211 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_gremlin_graph_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default'} + + + def _migrate_gremlin_graph_to_autoscale_initial( + self, resource_group_name, account_name, database_name, graph_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_gremlin_graph_to_autoscale.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_gremlin_graph_to_autoscale( + self, resource_group_name, account_name, database_name, graph_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB Gremlin graph 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 database_name: Cosmos DB database name. + :type database_name: str + :param graph_name: Cosmos DB graph name. + :type graph_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_gremlin_graph_to_autoscale_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + graph_name=graph_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_gremlin_graph_to_autoscale.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale'} + + + def _migrate_gremlin_graph_to_manual_throughput_initial( + self, resource_group_name, account_name, database_name, graph_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_gremlin_graph_to_manual_throughput.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'graphName': self._serialize.url("graph_name", graph_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_gremlin_graph_to_manual_throughput( + self, resource_group_name, account_name, database_name, graph_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB Gremlin graph 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 database_name: Cosmos DB database name. + :type database_name: str + :param graph_name: Cosmos DB graph name. + :type graph_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_gremlin_graph_to_manual_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + graph_name=graph_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_gremlin_graph_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput'} 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 dfa0c17ee4e8..05327143a8a5 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 @@ -27,7 +27,7 @@ class MongoDBResourcesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config @@ -547,6 +547,206 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_mongo_db_database_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default'} + + def _migrate_mongo_db_database_to_autoscale_initial( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_mongo_db_database_to_autoscale.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_mongo_db_database_to_autoscale( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB MongoDB database 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 database_name: Cosmos DB database name. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_mongo_db_database_to_autoscale_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_mongo_db_database_to_autoscale.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale'} + + + def _migrate_mongo_db_database_to_manual_throughput_initial( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_mongo_db_database_to_manual_throughput.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_mongo_db_database_to_manual_throughput( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB MongoDB database 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 database_name: Cosmos DB database name. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_mongo_db_database_to_manual_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_mongo_db_database_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput'} + def list_mongo_db_collections( self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): """Lists the MongoDB collection under an existing Azure Cosmos DB database @@ -1073,3 +1273,211 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_mongo_db_collection_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default'} + + + def _migrate_mongo_db_collection_to_autoscale_initial( + self, resource_group_name, account_name, database_name, collection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_mongo_db_collection_to_autoscale.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'collectionName': self._serialize.url("collection_name", collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_mongo_db_collection_to_autoscale( + self, resource_group_name, account_name, database_name, collection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB MongoDB collection 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 database_name: Cosmos DB database name. + :type database_name: str + :param collection_name: Cosmos DB collection name. + :type collection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_mongo_db_collection_to_autoscale_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + collection_name=collection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_mongo_db_collection_to_autoscale.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale'} + + + def _migrate_mongo_db_collection_to_manual_throughput_initial( + self, resource_group_name, account_name, database_name, collection_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_mongo_db_collection_to_manual_throughput.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'collectionName': self._serialize.url("collection_name", collection_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_mongo_db_collection_to_manual_throughput( + self, resource_group_name, account_name, database_name, collection_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB MongoDB collection 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 database_name: Cosmos DB database name. + :type database_name: str + :param collection_name: Cosmos DB collection name. + :type collection_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_mongo_db_collection_to_manual_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + collection_name=collection_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_mongo_db_collection_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput'} 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 496f51a74548..a31e5f690c32 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 @@ -26,7 +26,7 @@ class NotebookWorkspacesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". :ivar notebook_workspace_name: The name of the notebook workspace resource. Constant value: "default". """ @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.notebook_workspace_name = "default" self.config = config 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 b8408dcb75f2..a1b09893c482 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 @@ -25,7 +25,7 @@ class Operations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 2155071a7a8d..6f7193191195 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 @@ -25,7 +25,7 @@ class PartitionKeyRangeIdOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 132a83bac9a0..3029821dc362 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 @@ -25,7 +25,7 @@ class PartitionKeyRangeIdRegionOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 88151b749d7f..040b0125a258 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 @@ -25,7 +25,7 @@ class PercentileOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 70bd2fca2431..f351b3e7c108 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 @@ -25,7 +25,7 @@ class PercentileSourceTargetOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 c588461519ec..480bdfa2c5f6 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 @@ -25,7 +25,7 @@ class PercentileTargetOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -35,7 +35,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config 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 deleted file mode 100644 index 4fd745a1376b..000000000000 --- a/sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/_restorable_database_accounts_operations.py +++ /dev/null @@ -1,241 +0,0 @@ -# coding=utf-8 -# -------------------------------------------------------------------------- -# Copyright (c) Microsoft Corporation. All rights reserved. -# Licensed under the MIT License. See License.txt in the project root for -# license information. -# -# Code generated by Microsoft (R) AutoRest Code Generator. -# Changes may cause incorrect behavior and will be lost if the code is -# regenerated. -# -------------------------------------------------------------------------- - -import uuid -from msrest.pipeline import ClientRawResponse - -from .. import models - - -class RestorableDatabaseAccountsOperations(object): - """RestorableDatabaseAccountsOperations operations. - - You should not instantiate directly this class, but create a Client instance that will create it for you and attach it as attribute. - - :param client: Client for service requests. - :param config: Configuration of service client. - :param serializer: An object model serializer. - :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". - """ - - models = models - - def __init__(self, client, config, serializer, deserializer): - - self._client = client - self._serialize = serializer - self._deserialize = deserializer - self.api_version = "2020-06-01-preview" - - self.config = config - - def list_by_location( - self, location, custom_headers=None, raw=False, **operation_config): - """Lists all the restorable Azure Cosmos DB database accounts available - under the subscription and in a region. - - :param location: Cosmos DB region, with spaces between words and each - word capitalized. - :type location: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of - RestorableDatabaseAccountGetResult - :rtype: - ~azure.mgmt.cosmosdb.models.RestorableDatabaseAccountGetResultPaged[~azure.mgmt.cosmosdb.models.RestorableDatabaseAccountGetResult] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_by_location.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.RestorableDatabaseAccountGetResultPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts'} - - def list( - self, custom_headers=None, raw=False, **operation_config): - """Lists all the restorable Azure Cosmos DB database accounts available - under the subscription. - - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of - RestorableDatabaseAccountGetResult - :rtype: - ~azure.mgmt.cosmosdb.models.RestorableDatabaseAccountGetResultPaged[~azure.mgmt.cosmosdb.models.RestorableDatabaseAccountGetResult] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1) - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.RestorableDatabaseAccountGetResultPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts'} - - def get_by_location( - self, location, instance_id, custom_headers=None, raw=False, **operation_config): - """Retrieves the properties of an existing Azure Cosmos DB restorable - database account. - - :param location: Cosmos DB region, with spaces between words and each - word capitalized. - :type location: str - :param instance_id: The instanceId GUID of a restorable database - account. - :type instance_id: str - :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: RestorableDatabaseAccountGetResult or ClientRawResponse if - raw=true - :rtype: ~azure.mgmt.cosmosdb.models.RestorableDatabaseAccountGetResult - or ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ - # Construct URL - url = self.get_by_location.metadata['url'] - path_format_arguments = { - 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str', min_length=1), - 'location': self._serialize.url("location", location, 'str'), - 'instanceId': self._serialize.url("instance_id", instance_id, 'str') - } - url = self._client.format_url(url, **path_format_arguments) - - # Construct parameters - query_parameters = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('RestorableDatabaseAccountGetResult', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_by_location.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}'} 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 7211509bb5e9..4287866268ce 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 @@ -27,7 +27,7 @@ class SqlResourcesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config @@ -546,6 +546,206 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_sql_database_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default'} + + def _migrate_sql_database_to_autoscale_initial( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_sql_database_to_autoscale.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_sql_database_to_autoscale( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB SQL database 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 database_name: Cosmos DB database name. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_sql_database_to_autoscale_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_sql_database_to_autoscale.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale'} + + + def _migrate_sql_database_to_manual_throughput_initial( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_sql_database_to_manual_throughput.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_sql_database_to_manual_throughput( + self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB SQL database 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 database_name: Cosmos DB database name. + :type database_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_sql_database_to_manual_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_sql_database_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput'} + def list_sql_containers( self, resource_group_name, account_name, database_name, custom_headers=None, raw=False, **operation_config): """Lists the SQL container under an existing Azure Cosmos DB database @@ -1072,10 +1272,58 @@ def get_long_running_output(response): return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_sql_container_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default'} - def list_sql_stored_procedures( + + def _migrate_sql_container_to_autoscale_initial( self, resource_group_name, account_name, database_name, container_name, custom_headers=None, raw=False, **operation_config): - """Lists the SQL storedProcedure under an existing Azure Cosmos DB - database account. + # Construct URL + url = self.migrate_sql_container_to_autoscale.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_sql_container_to_autoscale( + self, resource_group_name, account_name, database_name, container_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB SQL container from manual throughput to + autoscale. :param resource_group_name: The name of the resource group. The name is case insensitive. @@ -1087,23 +1335,183 @@ def list_sql_stored_procedures( :param container_name: Cosmos DB container name. :type container_name: str :param dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of SqlStoredProcedureGetResults + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True :rtype: - ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetResultsPaged[~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetResults] + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] :raises: :class:`CloudError` """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_sql_stored_procedures.metadata['url'] - 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\._\(\)]+$'), - 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + raw_result = self._migrate_sql_container_to_autoscale_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + container_name=container_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_sql_container_to_autoscale.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToAutoscale'} + + + def _migrate_sql_container_to_manual_throughput_initial( + self, resource_group_name, account_name, database_name, container_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_sql_container_to_manual_throughput.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'databaseName': self._serialize.url("database_name", database_name, 'str'), + 'containerName': self._serialize.url("container_name", container_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_sql_container_to_manual_throughput( + self, resource_group_name, account_name, database_name, container_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB SQL container from autoscale to manual + throughput. + + :param resource_group_name: The name of the resource group. The name + is case insensitive. + :type resource_group_name: str + :param account_name: Cosmos DB database account name. + :type account_name: str + :param database_name: Cosmos DB database name. + :type database_name: str + :param container_name: Cosmos DB container name. + :type container_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_sql_container_to_manual_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + database_name=database_name, + container_name=container_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_sql_container_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/migrateToManualThroughput'} + + def list_sql_stored_procedures( + self, resource_group_name, account_name, database_name, container_name, custom_headers=None, raw=False, **operation_config): + """Lists the SQL storedProcedure 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 database_name: Cosmos DB database name. + :type database_name: str + :param container_name: Cosmos DB container name. + :type container_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of SqlStoredProcedureGetResults + :rtype: + ~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetResultsPaged[~azure.mgmt.cosmosdb.models.SqlStoredProcedureGetResults] + :raises: :class:`CloudError` + """ + def prepare_request(next_link=None): + if not next_link: + # Construct URL + url = self.list_sql_stored_procedures.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), 'databaseName': self._serialize.url("database_name", database_name, 'str'), 'containerName': self._serialize.url("container_name", container_name, 'str') } @@ -2151,657 +2559,3 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) delete_sql_trigger.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers/{triggerName}'} - - def get_sql_role_definition( - self, role_definition_id, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Retrieves the properties of an existing Azure Cosmos DB SQL Role - Definition with the given Id. - - :param role_definition_id: The GUID for the Role Definition. - :type role_definition_id: str - :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: SqlRoleDefinitionGetResults or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cosmosdb.models.SqlRoleDefinitionGetResults or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ - # Construct URL - url = self.get_sql_role_definition.metadata['url'] - path_format_arguments = { - 'roleDefinitionId': self._serialize.url("role_definition_id", role_definition_id, 'str'), - '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\._\(\)]+$'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SqlRoleDefinitionGetResults', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_sql_role_definition.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}'} - - - def _create_update_sql_role_definition_initial( - self, role_definition_id, resource_group_name, account_name, create_update_sql_role_definition_parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_update_sql_role_definition.metadata['url'] - path_format_arguments = { - 'roleDefinitionId': self._serialize.url("role_definition_id", role_definition_id, 'str'), - '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\._\(\)]+$'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(create_update_sql_role_definition_parameters, 'SqlRoleDefinitionCreateUpdateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SqlRoleDefinitionGetResults', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_update_sql_role_definition( - self, role_definition_id, resource_group_name, account_name, create_update_sql_role_definition_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates or updates an Azure Cosmos DB SQL Role Definition. - - :param role_definition_id: The GUID for the Role Definition. - :type role_definition_id: str - :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 create_update_sql_role_definition_parameters: The properties - required to create or update a Role Definition. - :type create_update_sql_role_definition_parameters: - ~azure.mgmt.cosmosdb.models.SqlRoleDefinitionCreateUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns - SqlRoleDefinitionGetResults or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.SqlRoleDefinitionGetResults] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.SqlRoleDefinitionGetResults]] - :raises: - :class:`DefaultErrorResponseException` - """ - raw_result = self._create_update_sql_role_definition_initial( - role_definition_id=role_definition_id, - resource_group_name=resource_group_name, - account_name=account_name, - create_update_sql_role_definition_parameters=create_update_sql_role_definition_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('SqlRoleDefinitionGetResults', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_update_sql_role_definition.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}'} - - - def _delete_sql_role_definition_initial( - self, role_definition_id, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete_sql_role_definition.metadata['url'] - path_format_arguments = { - 'roleDefinitionId': self._serialize.url("role_definition_id", role_definition_id, 'str'), - '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\._\(\)]+$'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete_sql_role_definition( - self, role_definition_id, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes an existing Azure Cosmos DB SQL Role Definition. - - :param role_definition_id: The GUID for the Role Definition. - :type role_definition_id: str - :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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`DefaultErrorResponseException` - """ - raw_result = self._delete_sql_role_definition_initial( - role_definition_id=role_definition_id, - resource_group_name=resource_group_name, - account_name=account_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete_sql_role_definition.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}'} - - def list_sql_role_definitions( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Retrieves the list of all Azure Cosmos DB SQL Role Definitions. - - :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of SqlRoleDefinitionGetResults - :rtype: - ~azure.mgmt.cosmosdb.models.SqlRoleDefinitionGetResultsPaged[~azure.mgmt.cosmosdb.models.SqlRoleDefinitionGetResults] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_sql_role_definitions.metadata['url'] - 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\._\(\)]+$'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.SqlRoleDefinitionGetResultsPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_sql_role_definitions.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions'} - - def get_sql_role_assignment( - self, role_assignment_id, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Retrieves the properties of an existing Azure Cosmos DB SQL Role - Assignment with the given Id. - - :param role_assignment_id: The GUID for the Role Assignment. - :type role_assignment_id: str - :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: SqlRoleAssignmentGetResults or ClientRawResponse if raw=true - :rtype: ~azure.mgmt.cosmosdb.models.SqlRoleAssignmentGetResults or - ~msrest.pipeline.ClientRawResponse - :raises: - :class:`DefaultErrorResponseException` - """ - # Construct URL - url = self.get_sql_role_assignment.metadata['url'] - path_format_arguments = { - 'roleAssignmentId': self._serialize.url("role_assignment_id", role_assignment_id, 'str'), - '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\._\(\)]+$'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - deserialized = None - if response.status_code == 200: - deserialized = self._deserialize('SqlRoleAssignmentGetResults', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - get_sql_role_assignment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}'} - - - def _create_update_sql_role_assignment_initial( - self, role_assignment_id, resource_group_name, account_name, create_update_sql_role_assignment_parameters, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.create_update_sql_role_assignment.metadata['url'] - path_format_arguments = { - 'roleAssignmentId': self._serialize.url("role_assignment_id", role_assignment_id, 'str'), - '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\._\(\)]+$'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - header_parameters['Content-Type'] = 'application/json; charset=utf-8' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct body - body_content = self._serialize.body(create_update_sql_role_assignment_parameters, 'SqlRoleAssignmentCreateUpdateParameters') - - # Construct and send request - request = self._client.put(url, query_parameters, header_parameters, body_content) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - deserialized = None - - if response.status_code == 200: - deserialized = self._deserialize('SqlRoleAssignmentGetResults', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - def create_update_sql_role_assignment( - self, role_assignment_id, resource_group_name, account_name, create_update_sql_role_assignment_parameters, custom_headers=None, raw=False, polling=True, **operation_config): - """Creates or updates an Azure Cosmos DB SQL Role Assignment. - - :param role_assignment_id: The GUID for the Role Assignment. - :type role_assignment_id: str - :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 create_update_sql_role_assignment_parameters: The properties - required to create or update a Role Assignment. - :type create_update_sql_role_assignment_parameters: - ~azure.mgmt.cosmosdb.models.SqlRoleAssignmentCreateUpdateParameters - :param dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns - SqlRoleAssignmentGetResults or - ClientRawResponse if raw==True - :rtype: - ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.SqlRoleAssignmentGetResults] - or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.SqlRoleAssignmentGetResults]] - :raises: - :class:`DefaultErrorResponseException` - """ - raw_result = self._create_update_sql_role_assignment_initial( - role_assignment_id=role_assignment_id, - resource_group_name=resource_group_name, - account_name=account_name, - create_update_sql_role_assignment_parameters=create_update_sql_role_assignment_parameters, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - deserialized = self._deserialize('SqlRoleAssignmentGetResults', response) - - if raw: - client_raw_response = ClientRawResponse(deserialized, response) - return client_raw_response - - return deserialized - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - create_update_sql_role_assignment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}'} - - - def _delete_sql_role_assignment_initial( - self, role_assignment_id, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - # Construct URL - url = self.delete_sql_role_assignment.metadata['url'] - path_format_arguments = { - 'roleAssignmentId': self._serialize.url("role_assignment_id", role_assignment_id, 'str'), - '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\._\(\)]+$'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - # Construct headers - header_parameters = {} - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.delete(url, query_parameters, header_parameters) - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200, 202, 204]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - def delete_sql_role_assignment( - self, role_assignment_id, resource_group_name, account_name, custom_headers=None, raw=False, polling=True, **operation_config): - """Deletes an existing Azure Cosmos DB SQL Role Assignment. - - :param role_assignment_id: The GUID for the Role Assignment. - :type role_assignment_id: str - :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 dict custom_headers: headers that will be added to the request - :param bool raw: The poller return type is ClientRawResponse, the - direct response alongside the deserialized response - :param polling: True for ARMPolling, False for no polling, or a - polling object for personal polling strategy - :return: An instance of LROPoller that returns None or - ClientRawResponse if raw==True - :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or - ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] - :raises: - :class:`DefaultErrorResponseException` - """ - raw_result = self._delete_sql_role_assignment_initial( - role_assignment_id=role_assignment_id, - resource_group_name=resource_group_name, - account_name=account_name, - custom_headers=custom_headers, - raw=True, - **operation_config - ) - - def get_long_running_output(response): - if raw: - client_raw_response = ClientRawResponse(None, response) - return client_raw_response - - lro_delay = operation_config.get( - 'long_running_operation_timeout', - self.config.long_running_operation_timeout) - if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) - elif polling is False: polling_method = NoPolling() - else: polling_method = polling - return LROPoller(self._client, raw_result, get_long_running_output, polling_method) - delete_sql_role_assignment.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments/{roleAssignmentId}'} - - def list_sql_role_assignments( - self, resource_group_name, account_name, custom_headers=None, raw=False, **operation_config): - """Retrieves the list of all Azure Cosmos DB SQL Role Assignments. - - :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 dict custom_headers: headers that will be added to the request - :param bool raw: returns the direct response alongside the - deserialized response - :param operation_config: :ref:`Operation configuration - overrides`. - :return: An iterator like instance of SqlRoleAssignmentGetResults - :rtype: - ~azure.mgmt.cosmosdb.models.SqlRoleAssignmentGetResultsPaged[~azure.mgmt.cosmosdb.models.SqlRoleAssignmentGetResults] - :raises: - :class:`DefaultErrorResponseException` - """ - def prepare_request(next_link=None): - if not next_link: - # Construct URL - url = self.list_sql_role_assignments.metadata['url'] - 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\._\(\)]+$'), - '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 = {} - query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) - - else: - url = next_link - query_parameters = {} - - # Construct headers - header_parameters = {} - header_parameters['Accept'] = 'application/json' - if self.config.generate_client_request_id: - header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) - if custom_headers: - header_parameters.update(custom_headers) - if self.config.accept_language is not None: - header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') - - # Construct and send request - request = self._client.get(url, query_parameters, header_parameters) - return request - - def internal_paging(next_link=None): - request = prepare_request(next_link) - - response = self._client.send(request, stream=False, **operation_config) - - if response.status_code not in [200]: - raise models.DefaultErrorResponseException(self._deserialize, response) - - return response - - # Deserialize response - header_dict = None - if raw: - header_dict = {} - deserialized = models.SqlRoleAssignmentGetResultsPaged(internal_paging, self._deserialize.dependencies, header_dict) - - return deserialized - list_sql_role_assignments.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleAssignments'} 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 1c5862cd7dd5..a4a4151f8773 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 @@ -27,7 +27,7 @@ class TableResourcesOperations(object): :param config: Configuration of service client. :param serializer: An object model serializer. :param deserializer: An object model deserializer. - :ivar api_version: The API version to use for this operation. Constant value: "2020-06-01-preview". + :ivar api_version: The API version to use for this operation. Constant value: "2020-04-01". """ models = models @@ -37,7 +37,7 @@ def __init__(self, client, config, serializer, deserializer): self._client = client self._serialize = serializer self._deserialize = deserializer - self.api_version = "2020-06-01-preview" + self.api_version = "2020-04-01" self.config = config @@ -544,3 +544,201 @@ def get_long_running_output(response): else: polling_method = polling return LROPoller(self._client, raw_result, get_long_running_output, polling_method) update_table_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default'} + + + def _migrate_table_to_autoscale_initial( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_table_to_autoscale.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'tableName': self._serialize.url("table_name", table_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_table_to_autoscale( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB Table 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 table_name: Cosmos DB table name. + :type table_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_table_to_autoscale_initial( + resource_group_name=resource_group_name, + account_name=account_name, + table_name=table_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_table_to_autoscale.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale'} + + + def _migrate_table_to_manual_throughput_initial( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.migrate_table_to_manual_throughput.metadata['url'] + 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\._\(\)]+$'), + 'accountName': self._serialize.url("account_name", account_name, 'str', max_length=50, min_length=3, pattern=r'^[a-z0-9]+(-[a-z0-9]+)*'), + 'tableName': self._serialize.url("table_name", table_name, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str', min_length=1) + + # Construct headers + header_parameters = {} + header_parameters['Accept'] = 'application/json' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.post(url, query_parameters, header_parameters) + response = self._client.send(request, stream=False, **operation_config) + + if response.status_code not in [200, 202]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def migrate_table_to_manual_throughput( + self, resource_group_name, account_name, table_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Migrate an Azure Cosmos DB Table 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 table_name: Cosmos DB table name. + :type table_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns + ThroughputSettingsGetResults or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.cosmosdb.models.ThroughputSettingsGetResults]] + :raises: :class:`CloudError` + """ + raw_result = self._migrate_table_to_manual_throughput_initial( + resource_group_name=resource_group_name, + account_name=account_name, + table_name=table_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('ThroughputSettingsGetResults', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + migrate_table_to_manual_throughput.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput'}