Skip to content

Commit

Permalink
Adding parameter enableMultipleWriteLocations in Cosmos DB (#4041)
Browse files Browse the repository at this point in the history
* adding parameter enableMultipleWriteLocations when creating account to support multi-master

* Added required regionParameterForOnline to two examples
  • Loading branch information
shurd authored and hovsepm committed Oct 2, 2018
1 parent 6828c10 commit 69f9b36
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1643,6 +1643,10 @@
"items": {
"$ref": "#/definitions/VirtualNetworkRule"
}
},
"enableMultipleWriteLocations": {
"description": "Enables the account to write in multiple locations",
"type": "boolean"
}
}
},
Expand Down Expand Up @@ -1702,6 +1706,10 @@
"items": {
"$ref": "#/definitions/VirtualNetworkRule"
}
},
"enableMultipleWriteLocations": {
"description": "Enables the account to write in multiple locations",
"type": "boolean"
}
},
"required": [
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
{
"parameters": {
"accountName": "ddb1",
"resourceGroupName": "rg1",
"api-version": "2015-04-08",
"subscriptionId": "subid",
"createUpdateParameters": {
"location": "westus",
"tags": {},
"kind": "GlobalDocumentDB",
"properties": {
"databaseAccountOfferType": "Standard",
"ipRangeFilter": "10.10.10.10",
"isVirtualNetworkFilterEnabled": true,
"enableMultipleWriteLocations": true,
"virtualNetworkRules": [
{
"id": "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"
}
],
"locations": [
{
"failoverPriority": 0,
"locationName": "southcentralus"
},
{
"failoverPriority": 1,
"locationName": "eastus"
}
],
"consistencyPolicy": {
"defaultConsistencyLevel": "BoundedStaleness",
"maxIntervalInSeconds": 10,
"maxStalenessPrefix": 200
}
}
}
},
"responses": {
"200": {
"body": {
"id": "/subscriptions/subid/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/ddb1",
"name": "ddb1",
"location": "West US",
"type": "Microsoft.DocumentDB/databaseAccounts",
"kind": "GlobalDocumentDB",
"tags": {},
"properties": {
"provisioningState": "Initializing",
"ipRangeFilter": "10.10.10.10",
"isVirtualNetworkFilterEnabled": true,
"enableMultipleWriteLocations": true,
"databaseAccountOfferType": "Standard",
"consistencyPolicy": {
"defaultConsistencyLevel": "BoundedStaleness",
"maxIntervalInSeconds": 10,
"maxStalenessPrefix": 200
},
"writeLocations": [
{
"id": "ddb1-southcentralus",
"locationName": "South Central US",
"provisioningState": "Initializing",
"failoverPriority": 0
},
{
"id": "ddb1-eastus",
"locationName": "East US",
"provisioningState": "Initializing",
"failoverPriority": 1
}
],
"readLocations": [
{
"id": "ddb1-southcentralus",
"locationName": "South Central US",
"provisioningState": "Initializing",
"failoverPriority": 0
},
{
"id": "ddb1-eastus",
"locationName": "East US",
"provisioningState": "Initializing",
"failoverPriority": 1
}
],
"failoverPolicies": [
{
"id": "ddb1-southcentralus",
"locationName": "South Central US",
"failoverPriority": 0
},
{
"id": "ddb1-eastus",
"locationName": "East US",
"failoverPriority": 1
}
],
"virtualNetworkRules": [
{
"id": "/subscriptions/subId/resourceGroups/rg/providers/Microsoft.Network/virtualNetworks/vnet1/subnets/subnet1"
}
]
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
"resourceGroupName": "rg1",
"api-version": "2015-04-08",
"subscriptionId": "subid",
"region":"North Europe"
"region":"North Europe",
"regionParameterForOffline": [
{
"region": "North Europe"
}
]
},
"responses": {
"200": { },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@
"resourceGroupName": "rg1",
"api-version": "2015-04-08",
"subscriptionId": "subid",
"region":"North Europe"
"region":"North Europe",
"regionParameterForOnline": [
{
"region": "North Europe"
}
]
},
"responses": {
"200": { },
Expand Down

0 comments on commit 69f9b36

Please sign in to comment.