Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR cosmos-db/resource-manager] Adding parameter enableMultipleWriteLocations in Cosmos DB #3466

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion azure-mgmt-cosmosdb/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
include *.rst
include azure_bdist_wheel.py
8 changes: 4 additions & 4 deletions azure-mgmt-cosmosdb/README.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
Microsoft Azure SDK for Python
==============================

This is the Microsoft Azure Cosmos DB Management Client Library.
This is the Microsoft Azure MyService Management Client Library.

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

This package has been tested with Python 2.7, 3.4, 3.5 and 3.6.
This package has been tested with Python 2.7, 3.4, 3.5, 3.6 and 3.7.

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

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


Expand Down
2 changes: 1 addition & 1 deletion azure-mgmt-cosmosdb/azure/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
2 changes: 1 addition & 1 deletion azure-mgmt-cosmosdb/azure/mgmt/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class DatabaseAccount(Resource):
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
"""

_validation = {
Expand Down Expand Up @@ -110,6 +113,7 @@ class DatabaseAccount(Resource):
'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'},
'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'},
'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'},
}

def __init__(self, **kwargs):
Expand All @@ -127,3 +131,4 @@ def __init__(self, **kwargs):
self.read_locations = None
self.failover_policies = None
self.virtual_network_rules = kwargs.get('virtual_network_rules', None)
self.enable_multiple_write_locations = kwargs.get('enable_multiple_write_locations', None)
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class DatabaseAccountCreateUpdateParameters(Resource):
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
"""

_validation = {
Expand All @@ -88,6 +91,7 @@ class DatabaseAccountCreateUpdateParameters(Resource):
'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'},
}

database_account_offer_type = "Standard"
Expand All @@ -102,3 +106,4 @@ def __init__(self, **kwargs):
self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None)
self.capabilities = kwargs.get('capabilities', None)
self.virtual_network_rules = kwargs.get('virtual_network_rules', None)
self.enable_multiple_write_locations = kwargs.get('enable_multiple_write_locations', None)
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ class DatabaseAccountCreateUpdateParameters(Resource):
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
"""

_validation = {
Expand All @@ -88,11 +91,12 @@ class DatabaseAccountCreateUpdateParameters(Resource):
'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'},
}

database_account_offer_type = "Standard"

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:
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:
super(DatabaseAccountCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs)
self.kind = kind
self.consistency_policy = consistency_policy
Expand All @@ -102,3 +106,4 @@ def __init__(self, *, location: str, locations, tags=None, kind="GlobalDocumentD
self.enable_automatic_failover = enable_automatic_failover
self.capabilities = capabilities
self.virtual_network_rules = virtual_network_rules
self.enable_multiple_write_locations = enable_multiple_write_locations
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ class DatabaseAccount(Resource):
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
"""

_validation = {
Expand Down Expand Up @@ -110,9 +113,10 @@ class DatabaseAccount(Resource):
'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'},
'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'},
'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'},
'enable_multiple_write_locations': {'key': 'properties.enableMultipleWriteLocations', 'type': 'bool'},
}

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:
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:
super(DatabaseAccount, self).__init__(location=location, tags=tags, **kwargs)
self.kind = kind
self.provisioning_state = provisioning_state
Expand All @@ -127,3 +131,4 @@ def __init__(self, *, location: str, tags=None, kind="GlobalDocumentDB", provisi
self.read_locations = None
self.failover_policies = None
self.virtual_network_rules = virtual_network_rules
self.enable_multiple_write_locations = enable_multiple_write_locations
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
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:
Expand All @@ -99,9 +99,8 @@ def internal_paging(next_link=None, raw=False):
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)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
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]:
exp = CloudError(response)
Expand Down Expand Up @@ -174,7 +173,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
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:
Expand All @@ -183,9 +182,8 @@ def internal_paging(next_link=None, raw=False):
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)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
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]:
exp = CloudError(response)
Expand Down Expand Up @@ -251,7 +249,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
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:
Expand All @@ -260,9 +258,8 @@ def internal_paging(next_link=None, raw=False):
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)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
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]:
exp = CloudError(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
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:
Expand All @@ -99,9 +99,8 @@ def internal_paging(next_link=None, raw=False):
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)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
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]:
exp = CloudError(response)
Expand Down Expand Up @@ -174,7 +173,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
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:
Expand All @@ -183,9 +182,8 @@ def internal_paging(next_link=None, raw=False):
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)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
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]:
exp = CloudError(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
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:
Expand All @@ -103,9 +103,8 @@ def internal_paging(next_link=None, raw=False):
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)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
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]:
exp = CloudError(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
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:
Expand All @@ -103,9 +103,8 @@ def internal_paging(next_link=None, raw=False):
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)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
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]:
exp = CloudError(response)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def internal_paging(next_link=None, raw=False):

# Construct headers
header_parameters = {}
header_parameters['Content-Type'] = 'application/json; charset=utf-8'
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:
Expand All @@ -97,9 +97,8 @@ def internal_paging(next_link=None, raw=False):
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)
response = self._client.send(
request, header_parameters, stream=False, **operation_config)
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]:
exp = CloudError(response)
Expand Down
Loading