diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/cosmos-db.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/cosmos-db.json index f64180f96abb..c077727e8d99 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/cosmos-db.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/cosmos-db.json @@ -67,13 +67,13 @@ } }, "patch": { - "operationId": "DatabaseAccounts_Patch", + "operationId": "DatabaseAccounts_Update", "x-ms-examples": { "CosmosDBDatabaseAccountPatch": { "$ref": "./examples/CosmosDBDatabaseAccountPatch.json" } }, - "description": "Patches the properties of an existing Azure Cosmos DB database account.", + "description": "Updates the properties of an existing Azure Cosmos DB database account.", "x-ms-long-running-operation": true, "parameters": [ { @@ -93,14 +93,14 @@ "in": "body", "required": true, "schema": { - "$ref": "#/definitions/DatabaseAccountPatchParameters" + "$ref": "#/definitions/DatabaseAccountUpdateParameters" }, - "description": "The tags parameter to patch for the current database account." + "description": "The parameters to provide for the current database account." } ], "responses": { "200": { - "description": "The properties of the database account were patched successfully.", + "description": "The database account update operation will complete asynchronously.", "schema": { "$ref": "#/definitions/DatabaseAccountGetResults" } @@ -117,7 +117,7 @@ "$ref": "./examples/CosmosDBDatabaseAccountCreateMax.json" } }, - "description": "Creates or updates an Azure Cosmos DB database account.", + "description": "Creates or updates an Azure Cosmos DB database account. The \"Update\" method is preferred when performing updates on an account.", "x-ms-long-running-operation": true, "parameters": [ { @@ -5012,6 +5012,14 @@ "$ref": "#/definitions/Location" } }, + "locations": { + "type": "array", + "readOnly": true, + "description": "An array that contains all of the locations enabled for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/Location" + } + }, "failoverPolicies": { "type": "array", "readOnly": true, @@ -5038,19 +5046,10 @@ "connectorOffer": { "description": "The cassandra connector offer type for the Cosmos DB database C* account.", "$ref": "#/definitions/ConnectorOffer" - } - } - }, - "DatabaseAccountPatchProperties": { - "description": "Properties to update Azure Cosmos DB database accounts.", - "type": "object", - "properties": { - "capabilities": { - "type": "array", - "description": "List of Cosmos DB capabilities for the account", - "items": { - "$ref": "#/definitions/Capability" - } + }, + "disableKeyBasedMetadataWriteAccess": { + "description": "Disable write operations on metadata resources (databases, containers, throughput) via account keys", + "type": "boolean" } } }, @@ -5110,6 +5109,10 @@ "connectorOffer": { "description": "The cassandra connector offer type for the Cosmos DB database C* account.", "$ref": "#/definitions/ConnectorOffer" + }, + "disableKeyBasedMetadataWriteAccess": { + "description": "Disable write operations on metadata resources (databases, containers, throughput) via account keys", + "type": "boolean" } }, "required": [ @@ -5149,16 +5152,79 @@ "properties" ] }, - "DatabaseAccountPatchParameters": { + "DatabaseAccountUpdateProperties": { + "description": "Properties to update Azure Cosmos DB database accounts.", + "type": "object", + "properties": { + "consistencyPolicy": { + "description": "The consistency policy for the Cosmos DB account.", + "$ref": "#/definitions/ConsistencyPolicy" + }, + "locations": { + "type": "array", + "description": "An array that contains the georeplication locations enabled for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/Location" + } + }, + "ipRangeFilter": { + "description": "Cosmos DB Firewall Support: This value specifies the set of IP addresses or IP address ranges in CIDR form to be included as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces.", + "$ref": "#/definitions/IPRangeFilter" + }, + "isVirtualNetworkFilterEnabled": { + "description": "Flag to indicate whether to enable/disable Virtual Network ACL rules.", + "type": "boolean" + }, + "enableAutomaticFailover": { + "description": "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": "boolean" + }, + "capabilities": { + "type": "array", + "description": "List of Cosmos DB capabilities for the account", + "items": { + "$ref": "#/definitions/Capability" + } + }, + "virtualNetworkRules": { + "type": "array", + "description": "List of Virtual Network ACL rules configured for the Cosmos DB account.", + "items": { + "$ref": "#/definitions/VirtualNetworkRule" + } + }, + "enableMultipleWriteLocations": { + "description": "Enables the account to write in multiple locations", + "type": "boolean" + }, + "enableCassandraConnector": { + "description": "Enables the cassandra connector on the Cosmos DB C* account", + "type": "boolean" + }, + "connectorOffer": { + "description": "The cassandra connector offer type for the Cosmos DB database C* account.", + "$ref": "#/definitions/ConnectorOffer" + }, + "disableKeyBasedMetadataWriteAccess": { + "description": "Disable write operations on metadata resources (databases, containers, throughput) via account keys", + "type": "boolean" + } + } + }, + "DatabaseAccountUpdateParameters": { "description": "Parameters for patching Azure Cosmos DB database account properties.", "type": "object", "properties": { "tags": { "$ref": "#/definitions/Tags" }, + "location": { + "type": "string", + "description": "The location of the resource group to which the resource belongs." + }, "properties": { "x-ms-client-flatten": true, - "$ref": "#/definitions/DatabaseAccountPatchProperties" + "$ref": "#/definitions/DatabaseAccountUpdateProperties" } } }, @@ -5931,6 +5997,13 @@ "name": "PartitionKind", "modelAsString": true } + }, + "version": { + "description": "Indicates the version of the partition key definition", + "type": "integer", + "minimum": 1, + "maximum": 2, + "format": "int32" } } }, diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountCreateMax.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountCreateMax.json index 40ce869a85cf..d769de814c01 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountCreateMax.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountCreateMax.json @@ -52,6 +52,7 @@ "ipRangeFilter": "10.10.10.10", "isVirtualNetworkFilterEnabled": true, "databaseAccountOfferType": "Standard", + "disableKeyBasedMetadataWriteAccess": false, "consistencyPolicy": { "defaultConsistencyLevel": "BoundedStaleness", "maxIntervalInSeconds": 10, @@ -82,6 +83,22 @@ "isZoneRedundant": false } ], + "locations": [ + { + "id": "ddb1-southcentralus", + "locationName": "South Central US", + "provisioningState": "Initializing", + "failoverPriority": 0, + "isZoneRedundant": false + }, + { + "id": "ddb1-eastus", + "locationName": "East US", + "provisioningState": "Initializing", + "failoverPriority": 1, + "isZoneRedundant": false + } + ], "failoverPolicies": [ { "id": "ddb1-southcentralus", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountCreateMin.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountCreateMin.json index 284059db0daa..5f9b237619aa 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountCreateMin.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountCreateMin.json @@ -31,6 +31,7 @@ "provisioningState": "Initializing", "ipRangeFilter": "", "databaseAccountOfferType": "Standard", + "disableKeyBasedMetadataWriteAccess": false, "consistencyPolicy": { "defaultConsistencyLevel": "Session", "maxIntervalInSeconds": 5, @@ -54,6 +55,15 @@ "isZoneRedundant": false } ], + "locations": [ + { + "id": "ddb1-southcentralus", + "locationName": "South Central US", + "provisioningState": "Initializing", + "failoverPriority": 0, + "isZoneRedundant": false + } + ], "failoverPolicies": [ { "id": "ddb1-southcentralus", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountGet.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountGet.json index fcea79dd152d..cebc2790fb41 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountGet.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountGet.json @@ -21,6 +21,7 @@ "isVirtualNetworkFilterEnabled": false, "virtualNetworkRules": [], "databaseAccountOfferType": "Standard", + "disableKeyBasedMetadataWriteAccess": false, "consistencyPolicy": { "defaultConsistencyLevel": "Session", "maxIntervalInSeconds": 5, @@ -44,6 +45,15 @@ "failoverPriority": 0 } ], + "locations": [ + { + "id": "ddb1-eastus", + "locationName": "East US", + "documentEndpoint": "https://ddb1-eastus.documents.azure.com:443/", + "provisioningState": "Succeeded", + "failoverPriority": 0 + } + ], "failoverPolicies": [ { "id": "ddb1-eastus", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountList.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountList.json index 596d8b9df880..ec521400f47e 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountList.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountList.json @@ -19,6 +19,7 @@ "documentEndpoint": "https://ddb1.documents.azure.com:443/", "ipRangeFilter": "", "databaseAccountOfferType": "Standard", + "disableKeyBasedMetadataWriteAccess": false, "consistencyPolicy": { "defaultConsistencyLevel": "Session", "maxIntervalInSeconds": 5, @@ -42,6 +43,15 @@ "failoverPriority": 0 } ], + "locations": [ + { + "id": "ddb1-eastus", + "locationName": "East US", + "documentEndpoint": "https://ddb1-eastus.documents.azure.com:443/", + "provisioningState": "Succeeded", + "failoverPriority": 0 + } + ], "failoverPolicies": [ { "id": "ddb1-eastus", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountListByResourceGroup.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountListByResourceGroup.json index 4947086025bc..9b1dd75a48ca 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountListByResourceGroup.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountListByResourceGroup.json @@ -20,6 +20,7 @@ "documentEndpoint": "https://ddb1.documents.azure.com:443/", "ipRangeFilter": "", "databaseAccountOfferType": "Standard", + "disableKeyBasedMetadataWriteAccess": false, "consistencyPolicy": { "defaultConsistencyLevel": "Session", "maxIntervalInSeconds": 5, @@ -43,6 +44,15 @@ "failoverPriority": 0 } ], + "locations": [ + { + "id": "ddb1-eastus", + "locationName": "East US", + "documentEndpoint": "https://ddb1-eastus.documents.azure.com:443/", + "provisioningState": "Succeeded", + "failoverPriority": 0 + } + ], "failoverPolicies": [ { "id": "ddb1-eastus", diff --git a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountPatch.json b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountPatch.json index b1e2102b6bc8..12a688594e63 100644 --- a/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountPatch.json +++ b/specification/cosmos-db/resource-manager/Microsoft.DocumentDB/stable/2019-08-01/examples/CosmosDBDatabaseAccountPatch.json @@ -5,8 +5,24 @@ "api-version": "2019-08-01", "subscriptionId": "subid", "updateParameters": { + "location": "westus", "tags": { "dept": "finance" + }, + "properties": { + "ipRangeFilter": "10.10.10.10", + "isVirtualNetworkFilterEnabled": true, + "virtualNetworkRules": [ + { + "id": "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", + "ignoreMissingVNetServiceEndpoint": false + } + ], + "consistencyPolicy": { + "defaultConsistencyLevel": "BoundedStaleness", + "maxIntervalInSeconds": 10, + "maxStalenessPrefix": 200 + } } } }, @@ -18,16 +34,20 @@ "location": "West US", "type": "Microsoft.DocumentDB/databaseAccounts", "kind": "GlobalDocumentDB", - "tags": {}, + "tags": { + "dept": "finance" + }, "properties": { "provisioningState": "Succeeded", "documentEndpoint": "https://ddb1.documents.azure.com:443/", - "ipRangeFilter": "", "databaseAccountOfferType": "Standard", + "ipRangeFilter": "10.10.10.10", + "isVirtualNetworkFilterEnabled": true, + "disableKeyBasedMetadataWriteAccess": false, "consistencyPolicy": { - "defaultConsistencyLevel": "Session", - "maxIntervalInSeconds": 5, - "maxStalenessPrefix": 100 + "defaultConsistencyLevel": "BoundedStaleness", + "maxIntervalInSeconds": 10, + "maxStalenessPrefix": 200 }, "writeLocations": [ { @@ -47,12 +67,27 @@ "failoverPriority": 0 } ], + "locations": [ + { + "id": "ddb1-eastus", + "locationName": "East US", + "documentEndpoint": "https://ddb1-eastus.documents.azure.com:443/", + "provisioningState": "Succeeded", + "failoverPriority": 0 + } + ], "failoverPolicies": [ { "id": "ddb1-eastus", "locationName": "East US", "failoverPriority": 0 } + ], + "virtualNetworkRules": [ + { + "id": "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1", + "ignoreMissingVNetServiceEndpoint": false + } ] } } diff --git a/specification/cosmos-db/resource-manager/readme.go.md b/specification/cosmos-db/resource-manager/readme.go.md index 91ccd4fa86fc..c0de78608413 100644 --- a/specification/cosmos-db/resource-manager/readme.go.md +++ b/specification/cosmos-db/resource-manager/readme.go.md @@ -13,9 +13,29 @@ go: ``` yaml $(go) && $(multiapi) batch: + - tag: package-2019-08 + - tag: package-2019-08-preview - tag: package-2015-04 ``` +### Tag: package-2019-08 and go + +These settings apply only when `--tag=package-2019-08 --go` is specified on the command line. +Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'package-2019-08' && $(go) +output-folder: $(go-sdk-folder)/services/cosmos-db/mgmt/2019-08-01/$(namespace) +``` + +### Tag: package-2019-08-preview and go + +These settings apply only when `--tag=package-2019-08-preview --go` is specified on the command line. +Please also specify `--go-sdk-folder=`. + +``` yaml $(tag) == 'package-2019-08-preview' && $(go) +output-folder: $(go-sdk-folder)/services/cosmos-db/mgmt/2019-08-01-preview/$(namespace) +``` + ### Tag: package-2015-04 and go These settings apply only when `--tag=package-2015-04 --go` is specified on the command line. diff --git a/specification/cosmos-db/resource-manager/readme.java.md b/specification/cosmos-db/resource-manager/readme.java.md index f1f569a270c2..0e4df3d1f245 100644 --- a/specification/cosmos-db/resource-manager/readme.java.md +++ b/specification/cosmos-db/resource-manager/readme.java.md @@ -17,9 +17,37 @@ service-name: CosmosDB ``` yaml $(java) && $(multiapi) batch: + - tag: package-2019-08 + - tag: package-2019-08-preview - tag: package-2015-04 ``` +### Tag: package-2019-08 and java + +These settings apply only when `--tag=package-2019-08 --java` is specified on the command line. +Please also specify `--azure-libraries-for-java=`. + +``` yaml $(tag) == 'package-2019-08' && $(java) && $(multiapi) +java: + namespace: com.microsoft.azure.management.cosmosdb.v2019_08_01 + output-folder: $(azure-libraries-for-java-folder)/cosmosdb/resource-manager/v2019_08_01 +regenerate-manager: true +generate-interface: true +``` + +### Tag: package-2019-08-preview and java + +These settings apply only when `--tag=package-2019-08-preview --java` is specified on the command line. +Please also specify `--azure-libraries-for-java=`. + +``` yaml $(tag) == 'package-2019-08-preview' && $(java) && $(multiapi) +java: + namespace: com.microsoft.azure.management.cosmosdb.v2019_08_01_preview + output-folder: $(azure-libraries-for-java-folder)/cosmosdb/resource-manager/v2019_08_01_preview +regenerate-manager: true +generate-interface: true +``` + ### Tag: package-2015-04 and java These settings apply only when `--tag=package-2015-04 --java` is specified on the command line. diff --git a/specification/cosmos-db/resource-manager/readme.md b/specification/cosmos-db/resource-manager/readme.md index ecef4cd32fe3..e823db2491e6 100644 --- a/specification/cosmos-db/resource-manager/readme.md +++ b/specification/cosmos-db/resource-manager/readme.md @@ -26,16 +26,9 @@ These are the global settings for the Cosmos-DB API. ``` yaml openapi-type: arm -``` - -``` yaml tag: package-2019-08 ``` -``` yaml -tag: package-2015-04 -``` - ### Tag: package-2019-08 These settings apply only when `--tag=package-2019-08` is specified on the command line. diff --git a/specification/cosmos-db/resource-manager/readme.python.md b/specification/cosmos-db/resource-manager/readme.python.md index 826db3c9f5c8..96b818779dd7 100644 --- a/specification/cosmos-db/resource-manager/readme.python.md +++ b/specification/cosmos-db/resource-manager/readme.python.md @@ -1,27 +1,57 @@ ## Python These settings apply only when `--python` is specified on the command line. -Please also specify `--python-sdks-folder=`. -Use `--python-mode=update` if you already have a setup.py and just want to update the code itself. ``` yaml $(python) -python-mode: create python: azure-arm: true license-header: MICROSOFT_MIT_NO_VERSION payload-flattening-threshold: 2 - namespace: azure.mgmt.cosmosdb package-name: azure-mgmt-cosmosdb - package-version: 0.7.0 clear-output-folder: true + no-namespace-folders: true +``` + +### Python multi-api + +Generate all API versions currently shipped for this package + +```yaml $(python) && $(multiapi) +batch: + - tag: package-2019-08 + - tag: package-2019-08-preview + - tag: package-2015-04 ``` -``` yaml $(python) && $(python-mode) == 'update' + +### Tag: package-2019-08 and python + +These settings apply only when `--tag=package-2019-08 --python` is specified on the command line. +Please also specify `--python-sdks-folder=`. + +``` yaml $(tag) == 'package-2019-08' && $(python) python: - no-namespace-folders: true - output-folder: $(python-sdks-folder)/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb + namespace: azure.mgmt.cosmosdb.v2019_08_01 + output-folder: $(python-sdks-folder)/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/v2019_08_01 ``` -``` yaml $(python) && $(python-mode) == 'create' + +### Tag: package-2019-08-preview and python + +These settings apply only when `--tag=package-2019-08-preview --python` is specified on the command line. +Please also specify `--python-sdks-folder=`. + +``` yaml $(tag) == 'package-2019-08-preview' && $(python) +python: + namespace: azure.mgmt.cosmosdb.v2019_08_01_preview + output-folder: $(python-sdks-folder)/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/v2019_08_01_preview +``` + +### Tag: package-2015-04 and python + +These settings apply only when `--tag=package-2015-04 --python` is specified on the command line. +Please also specify `--python-sdks-folder=`. + +``` yaml $(tag) == 'package-2015-04' && $(python) python: - basic-setup-py: true - output-folder: $(python-sdks-folder)/cosmos/azure-mgmt-cosmosdb + namespace: azure.mgmt.cosmosdb.v2015_04_01 + output-folder: $(python-sdks-folder)/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/v2015_04_01 ```