Skip to content

Commit ca7eae4

Browse files
authored
[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
1 parent ce2cd5f commit ca7eae4

25 files changed

+147
-201
lines changed

azure-mgmt-cosmosdb/MANIFEST.in

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
include *.rst
2-
include azure_bdist_wheel.py

azure-mgmt-cosmosdb/README.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Microsoft Azure SDK for Python
22
==============================
33

4-
This is the Microsoft Azure Cosmos DB Management Client Library.
4+
This is the Microsoft Azure MyService Management Client Library.
55

66
Azure Resource Manager (ARM) is the next generation of management APIs that
77
replace the old Azure Service Management (ASM).
88

9-
This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.
9+
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.
1010

1111
For the older Azure Service Management (ASM) libraries, see
1212
`azure-servicemanagement-legacy <https://pypi.python.org/pypi/azure-servicemanagement-legacy>`__ library.
@@ -36,8 +36,8 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first:
3636
Usage
3737
=====
3838

39-
For code examples, see `CosmosDB Management
40-
<https://docs.microsoft.com/python/api/overview/azure/cosmosdb>`__
39+
For code examples, see `MyService Management
40+
<https://docs.microsoft.com/python/api/overview/azure/>`__
4141
on docs.microsoft.com.
4242

4343

azure-mgmt-cosmosdb/azure/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__import__('pkg_resources').declare_namespace(__name__)
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__import__('pkg_resources').declare_namespace(__name__)
1+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

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)