Skip to content

Commit 70041a3

Browse files
AutorestCIlmazuel
authored andcommitted
[AutoPR] cosmos-db/resource-manager (#2781)
* Generated from 6d9c73eb24e60d117da852b974504d93e47d1a3c (#2744) renaming older operation * [AutoPR cosmos-db/resource-manager] Adding parameter enableMultipleWriteLocations in Cosmos DB (#3466) * Generated from 6b73420d0a83a786389d2ef92484aa8df383c74a adding parameter enableMultipleWriteLocations when creating account to support multi-master * Packaging update of azure-mgmt-cosmosdb * Packaging update of azure-mgmt-cosmosdb * Re-record tests * Version 0.5.0
1 parent 3f636c3 commit 70041a3

20 files changed

+668
-337
lines changed

azure-mgmt-cosmosdb/HISTORY.rst

+14-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,19 @@
33
Release History
44
===============
55

6+
0.5.0 (2018-10-08)
7+
++++++++++++++++++
8+
9+
**Features**
10+
11+
- Add enable_multiple_write_locations support
12+
13+
**Note**
14+
15+
- `database_accounts.list_read_only_keys` is now doing a POST call, and not GET anymore. This should not impact anything.
16+
Old behavior be can found with the `database_accounts.get_read_only_keys` **deprecated** method.
17+
- azure-mgmt-nspkg is not installed anymore on Python 3 (PEP420-based namespace package)
18+
619
0.4.1 (2018-05-15)
720
++++++++++++++++++
821

@@ -33,7 +46,7 @@ This version uses a next-generation code generator that *might* introduce breaki
3346

3447
- Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same.
3548
- Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used.
36-
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
49+
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
3750
without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`.
3851
- New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`,
3952
the response of the initial call will be returned without polling.

azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py

+5
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ class DatabaseAccount(Resource):
7777
for the Cosmos DB account.
7878
:type virtual_network_rules:
7979
list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule]
80+
:param enable_multiple_write_locations: Enables the account to write in
81+
multiple locations
82+
:type enable_multiple_write_locations: bool
8083
"""
8184

8285
_validation = {
@@ -110,6 +113,7 @@ class DatabaseAccount(Resource):
110113
'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'},
111114
'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'},
112115
'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
116+
'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'},
113117
}
114118

115119
def __init__(self, **kwargs):
@@ -127,3 +131,4 @@ def __init__(self, **kwargs):
127131
self.read_locations = None
128132
self.failover_policies = None
129133
self.virtual_network_rules = kwargs.get('virtual_network_rules', None)
134+
self.enable_multiple_write_locations = kwargs.get('enable_multiple_write_locations', None)

azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py

+5
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class DatabaseAccountCreateUpdateParameters(Resource):
6262
for the Cosmos DB account.
6363
:type virtual_network_rules:
6464
list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule]
65+
:param enable_multiple_write_locations: Enables the account to write in
66+
multiple locations
67+
:type enable_multiple_write_locations: bool
6568
"""
6669

6770
_validation = {
@@ -88,6 +91,7 @@ class DatabaseAccountCreateUpdateParameters(Resource):
8891
'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'},
8992
'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'},
9093
'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
94+
'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'},
9195
}
9296

9397
database_account_offer_type = "Standard"
@@ -102,3 +106,4 @@ def __init__(self, **kwargs):
102106
self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None)
103107
self.capabilities = kwargs.get('capabilities', None)
104108
self.virtual_network_rules = kwargs.get('virtual_network_rules', None)
109+
self.enable_multiple_write_locations = kwargs.get('enable_multiple_write_locations', None)

azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ class DatabaseAccountCreateUpdateParameters(Resource):
6262
for the Cosmos DB account.
6363
:type virtual_network_rules:
6464
list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule]
65+
:param enable_multiple_write_locations: Enables the account to write in
66+
multiple locations
67+
:type enable_multiple_write_locations: bool
6568
"""
6669

6770
_validation = {
@@ -88,11 +91,12 @@ class DatabaseAccountCreateUpdateParameters(Resource):
8891
'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'},
8992
'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'},
9093
'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
94+
'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'},
9195
}
9296

9397
database_account_offer_type = "Standard"
9498

95-
def __init__(self, *, location: str, locations, tags=None, kind="GlobalDocumentDB", consistency_policy=None, ip_range_filter: str=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, capabilities=None, virtual_network_rules=None, **kwargs) -> None:
99+
def __init__(self, *, location: str, locations, tags=None, kind="GlobalDocumentDB", consistency_policy=None, ip_range_filter: str=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, **kwargs) -> None:
96100
super(DatabaseAccountCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs)
97101
self.kind = kind
98102
self.consistency_policy = consistency_policy
@@ -102,3 +106,4 @@ def __init__(self, *, location: str, locations, tags=None, kind="GlobalDocumentD
102106
self.enable_automatic_failover = enable_automatic_failover
103107
self.capabilities = capabilities
104108
self.virtual_network_rules = virtual_network_rules
109+
self.enable_multiple_write_locations = enable_multiple_write_locations

azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_py3.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ class DatabaseAccount(Resource):
7777
for the Cosmos DB account.
7878
:type virtual_network_rules:
7979
list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule]
80+
:param enable_multiple_write_locations: Enables the account to write in
81+
multiple locations
82+
:type enable_multiple_write_locations: bool
8083
"""
8184

8285
_validation = {
@@ -110,9 +113,10 @@ class DatabaseAccount(Resource):
110113
'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'},
111114
'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'},
112115
'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
116+
'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'},
113117
}
114118

115-
def __init__(self, *, location: str, tags=None, kind="GlobalDocumentDB", provisioning_state: str=None, ip_range_filter: str=None, is_virtual_network_filter_enabled: bool=None, enable_automatic_failover: bool=None, consistency_policy=None, capabilities=None, virtual_network_rules=None, **kwargs) -> None:
119+
def __init__(self, *, location: str, tags=None, kind="GlobalDocumentDB", provisioning_state: str=None, ip_range_filter: str=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, **kwargs) -> None:
116120
super(DatabaseAccount, self).__init__(location=location, tags=tags, **kwargs)
117121
self.kind = kind
118122
self.provisioning_state = provisioning_state
@@ -127,3 +131,4 @@ def __init__(self, *, location: str, tags=None, kind="GlobalDocumentDB", provisi
127131
self.read_locations = None
128132
self.failover_policies = None
129133
self.virtual_network_rules = virtual_network_rules
134+
self.enable_multiple_write_locations = enable_multiple_write_locations

azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_operations.py

+9-12
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def internal_paging(next_link=None, raw=False):
9090

9191
# Construct headers
9292
header_parameters = {}
93-
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
93+
header_parameters['Accept'] = 'application/json'
9494
if self.config.generate_client_request_id:
9595
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
9696
if custom_headers:
@@ -99,9 +99,8 @@ def internal_paging(next_link=None, raw=False):
9999
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
100100

101101
# Construct and send request
102-
request = self._client.get(url, query_parameters)
103-
response = self._client.send(
104-
request, header_parameters, stream=False, **operation_config)
102+
request = self._client.get(url, query_parameters, header_parameters)
103+
response = self._client.send(request, stream=False, **operation_config)
105104

106105
if response.status_code not in [200]:
107106
exp = CloudError(response)
@@ -174,7 +173,7 @@ def internal_paging(next_link=None, raw=False):
174173

175174
# Construct headers
176175
header_parameters = {}
177-
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
176+
header_parameters['Accept'] = 'application/json'
178177
if self.config.generate_client_request_id:
179178
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
180179
if custom_headers:
@@ -183,9 +182,8 @@ def internal_paging(next_link=None, raw=False):
183182
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
184183

185184
# Construct and send request
186-
request = self._client.get(url, query_parameters)
187-
response = self._client.send(
188-
request, header_parameters, stream=False, **operation_config)
185+
request = self._client.get(url, query_parameters, header_parameters)
186+
response = self._client.send(request, stream=False, **operation_config)
189187

190188
if response.status_code not in [200]:
191189
exp = CloudError(response)
@@ -251,7 +249,7 @@ def internal_paging(next_link=None, raw=False):
251249

252250
# Construct headers
253251
header_parameters = {}
254-
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
252+
header_parameters['Accept'] = 'application/json'
255253
if self.config.generate_client_request_id:
256254
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
257255
if custom_headers:
@@ -260,9 +258,8 @@ def internal_paging(next_link=None, raw=False):
260258
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
261259

262260
# Construct and send request
263-
request = self._client.get(url, query_parameters)
264-
response = self._client.send(
265-
request, header_parameters, stream=False, **operation_config)
261+
request = self._client.get(url, query_parameters, header_parameters)
262+
response = self._client.send(request, stream=False, **operation_config)
266263

267264
if response.status_code not in [200]:
268265
exp = CloudError(response)

azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_operations.py

+6-8
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def internal_paging(next_link=None, raw=False):
9090

9191
# Construct headers
9292
header_parameters = {}
93-
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
93+
header_parameters['Accept'] = 'application/json'
9494
if self.config.generate_client_request_id:
9595
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
9696
if custom_headers:
@@ -99,9 +99,8 @@ def internal_paging(next_link=None, raw=False):
9999
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
100100

101101
# Construct and send request
102-
request = self._client.get(url, query_parameters)
103-
response = self._client.send(
104-
request, header_parameters, stream=False, **operation_config)
102+
request = self._client.get(url, query_parameters, header_parameters)
103+
response = self._client.send(request, stream=False, **operation_config)
105104

106105
if response.status_code not in [200]:
107106
exp = CloudError(response)
@@ -174,7 +173,7 @@ def internal_paging(next_link=None, raw=False):
174173

175174
# Construct headers
176175
header_parameters = {}
177-
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
176+
header_parameters['Accept'] = 'application/json'
178177
if self.config.generate_client_request_id:
179178
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
180179
if custom_headers:
@@ -183,9 +182,8 @@ def internal_paging(next_link=None, raw=False):
183182
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
184183

185184
# Construct and send request
186-
request = self._client.get(url, query_parameters)
187-
response = self._client.send(
188-
request, header_parameters, stream=False, **operation_config)
185+
request = self._client.get(url, query_parameters, header_parameters)
186+
response = self._client.send(request, stream=False, **operation_config)
189187

190188
if response.status_code not in [200]:
191189
exp = CloudError(response)

azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_partition_region_operations.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def internal_paging(next_link=None, raw=False):
9494

9595
# Construct headers
9696
header_parameters = {}
97-
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
97+
header_parameters['Accept'] = 'application/json'
9898
if self.config.generate_client_request_id:
9999
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
100100
if custom_headers:
@@ -103,9 +103,8 @@ def internal_paging(next_link=None, raw=False):
103103
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
104104

105105
# Construct and send request
106-
request = self._client.get(url, query_parameters)
107-
response = self._client.send(
108-
request, header_parameters, stream=False, **operation_config)
106+
request = self._client.get(url, query_parameters, header_parameters)
107+
response = self._client.send(request, stream=False, **operation_config)
109108

110109
if response.status_code not in [200]:
111110
exp = CloudError(response)

azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/collection_region_operations.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def internal_paging(next_link=None, raw=False):
9494

9595
# Construct headers
9696
header_parameters = {}
97-
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
97+
header_parameters['Accept'] = 'application/json'
9898
if self.config.generate_client_request_id:
9999
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
100100
if custom_headers:
@@ -103,9 +103,8 @@ def internal_paging(next_link=None, raw=False):
103103
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
104104

105105
# Construct and send request
106-
request = self._client.get(url, query_parameters)
107-
response = self._client.send(
108-
request, header_parameters, stream=False, **operation_config)
106+
request = self._client.get(url, query_parameters, header_parameters)
107+
response = self._client.send(request, stream=False, **operation_config)
109108

110109
if response.status_code not in [200]:
111110
exp = CloudError(response)

azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/operations/database_account_region_operations.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ def internal_paging(next_link=None, raw=False):
8888

8989
# Construct headers
9090
header_parameters = {}
91-
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
91+
header_parameters['Accept'] = 'application/json'
9292
if self.config.generate_client_request_id:
9393
header_parameters['x-ms-client-request-id'] = str(uuid.uuid1())
9494
if custom_headers:
@@ -97,9 +97,8 @@ def internal_paging(next_link=None, raw=False):
9797
header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str')
9898

9999
# Construct and send request
100-
request = self._client.get(url, query_parameters)
101-
response = self._client.send(
102-
request, header_parameters, stream=False, **operation_config)
100+
request = self._client.get(url, query_parameters, header_parameters)
101+
response = self._client.send(request, stream=False, **operation_config)
103102

104103
if response.status_code not in [200]:
105104
exp = CloudError(response)

0 commit comments

Comments
 (0)