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 #2781

Merged
merged 6 commits into from
Oct 8, 2018
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
15 changes: 14 additions & 1 deletion azure-mgmt-cosmosdb/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,19 @@
Release History
===============

0.5.0 (2018-10-08)
++++++++++++++++++

**Features**

- Add enable_multiple_write_locations support

**Note**

- `database_accounts.list_read_only_keys` is now doing a POST call, and not GET anymore. This should not impact anything.
Old behavior be can found with the `database_accounts.get_read_only_keys` **deprecated** method.
- azure-mgmt-nspkg is not installed anymore on Python 3 (PEP420-based namespace package)

0.4.1 (2018-05-15)
++++++++++++++++++

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

- Return type changes from `msrestazure.azure_operation.AzureOperationPoller` to `msrest.polling.LROPoller`. External API is the same.
- Return type is now **always** a `msrest.polling.LROPoller`, regardless of the optional parameters used.
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
- The behavior has changed when using `raw=True`. Instead of returning the initial call result as `ClientRawResponse`,
without polling, now this returns an LROPoller. After polling, the final resource will be returned as a `ClientRawResponse`.
- New `polling` parameter. The default behavior is `Polling=True` which will poll using ARM algorithm. When `Polling=False`,
the response of the initial call will be returned without polling.
Expand Down
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