From ad3279ac98f2852978d6563fabeb68b4e5a7b99d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 12 Apr 2018 13:41:11 -0700 Subject: [PATCH] Generated from f4de45b64671c46afe8ce792c163c2dcc92f9988 (#2353) Undo Test --- .../azure/mgmt/cosmosdb/models/__init__.py | 3 ++ .../mgmt/cosmosdb/models/database_account.py | 11 +++++++ ...tabase_account_create_update_parameters.py | 11 +++++++ ...se_account_create_update_parameters_py3.py | 13 ++++++++- .../cosmosdb/models/database_account_py3.py | 13 ++++++++- .../cosmosdb/models/virtual_network_rule.py | 29 +++++++++++++++++++ .../models/virtual_network_rule_py3.py | 29 +++++++++++++++++++ 7 files changed, 107 insertions(+), 2 deletions(-) create mode 100644 azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule.py create mode 100644 azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule_py3.py diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py index 072a567f3913..64279b132b39 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/__init__.py @@ -14,6 +14,7 @@ from .capability_py3 import Capability from .location_py3 import Location from .failover_policy_py3 import FailoverPolicy + from .virtual_network_rule_py3 import VirtualNetworkRule from .database_account_py3 import DatabaseAccount from .failover_policies_py3 import FailoverPolicies from .resource_py3 import Resource @@ -41,6 +42,7 @@ from .capability import Capability from .location import Location from .failover_policy import FailoverPolicy + from .virtual_network_rule import VirtualNetworkRule from .database_account import DatabaseAccount from .failover_policies import FailoverPolicies from .resource import Resource @@ -85,6 +87,7 @@ 'Capability', 'Location', 'FailoverPolicy', + 'VirtualNetworkRule', 'DatabaseAccount', 'FailoverPolicies', 'Resource', diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py index 99bd0e3d9401..f746e080e25f 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account.py @@ -50,6 +50,9 @@ class DatabaseAccount(Resource): as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. :type ip_range_filter: str + :param is_virtual_network_filter_enabled: Flag to indicate whether to + enable/disable Virtual Network ACL rules. + :type is_virtual_network_filter_enabled: bool :param enable_automatic_failover: Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and @@ -70,6 +73,10 @@ class DatabaseAccount(Resource): their failover priorities. :vartype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :param virtual_network_rules: List of Virtual Network ACL rules configured + for the Cosmos DB account. + :type virtual_network_rules: + list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] """ _validation = { @@ -95,12 +102,14 @@ class DatabaseAccount(Resource): 'document_endpoint': {'key': 'properties.documentEndpoint', 'type': 'str'}, 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'DatabaseAccountOfferType'}, 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, 'write_locations': {'key': 'properties.writeLocations', 'type': '[Location]'}, 'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'}, 'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, } def __init__(self, **kwargs): @@ -110,9 +119,11 @@ def __init__(self, **kwargs): self.document_endpoint = None self.database_account_offer_type = None self.ip_range_filter = kwargs.get('ip_range_filter', None) + self.is_virtual_network_filter_enabled = kwargs.get('is_virtual_network_filter_enabled', None) self.enable_automatic_failover = kwargs.get('enable_automatic_failover', None) self.consistency_policy = kwargs.get('consistency_policy', None) self.capabilities = kwargs.get('capabilities', None) self.write_locations = None self.read_locations = None self.failover_policies = None + self.virtual_network_rules = kwargs.get('virtual_network_rules', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py index bab009244c85..4cd363937f05 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters.py @@ -48,6 +48,9 @@ class DatabaseAccountCreateUpdateParameters(Resource): as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. :type ip_range_filter: str + :param is_virtual_network_filter_enabled: Flag to indicate whether to + enable/disable Virtual Network ACL rules. + :type is_virtual_network_filter_enabled: bool :param enable_automatic_failover: Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and @@ -55,6 +58,10 @@ class DatabaseAccountCreateUpdateParameters(Resource): :type enable_automatic_failover: bool :param capabilities: List of Cosmos DB capabilities for the account :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :param virtual_network_rules: List of Virtual Network ACL rules configured + for the Cosmos DB account. + :type virtual_network_rules: + list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] """ _validation = { @@ -77,8 +84,10 @@ class DatabaseAccountCreateUpdateParameters(Resource): 'locations': {'key': 'properties.locations', 'type': '[Location]'}, 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, } database_account_offer_type = "Standard" @@ -89,5 +98,7 @@ def __init__(self, **kwargs): self.consistency_policy = kwargs.get('consistency_policy', None) self.locations = kwargs.get('locations', None) self.ip_range_filter = kwargs.get('ip_range_filter', None) + self.is_virtual_network_filter_enabled = kwargs.get('is_virtual_network_filter_enabled', None) 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) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py index 51e13e4613a7..a370ca82c0f2 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_create_update_parameters_py3.py @@ -48,6 +48,9 @@ class DatabaseAccountCreateUpdateParameters(Resource): as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. :type ip_range_filter: str + :param is_virtual_network_filter_enabled: Flag to indicate whether to + enable/disable Virtual Network ACL rules. + :type is_virtual_network_filter_enabled: bool :param enable_automatic_failover: Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and @@ -55,6 +58,10 @@ class DatabaseAccountCreateUpdateParameters(Resource): :type enable_automatic_failover: bool :param capabilities: List of Cosmos DB capabilities for the account :type capabilities: list[~azure.mgmt.cosmosdb.models.Capability] + :param virtual_network_rules: List of Virtual Network ACL rules configured + for the Cosmos DB account. + :type virtual_network_rules: + list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] """ _validation = { @@ -77,17 +84,21 @@ class DatabaseAccountCreateUpdateParameters(Resource): 'locations': {'key': 'properties.locations', 'type': '[Location]'}, 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'str'}, 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, } database_account_offer_type = "Standard" - def __init__(self, *, location: str, locations, tags=None, kind="GlobalDocumentDB", consistency_policy=None, ip_range_filter: str=None, enable_automatic_failover: bool=None, capabilities=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, **kwargs) -> None: super(DatabaseAccountCreateUpdateParameters, self).__init__(location=location, tags=tags, **kwargs) self.kind = kind self.consistency_policy = consistency_policy self.locations = locations self.ip_range_filter = ip_range_filter + self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled self.enable_automatic_failover = enable_automatic_failover self.capabilities = capabilities + self.virtual_network_rules = virtual_network_rules diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_py3.py index 12bf4fc7b82e..eb8b56802aee 100644 --- a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_py3.py +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/database_account_py3.py @@ -50,6 +50,9 @@ class DatabaseAccount(Resource): as the allowed list of client IPs for a given database account. IP addresses/ranges must be comma separated and must not contain any spaces. :type ip_range_filter: str + :param is_virtual_network_filter_enabled: Flag to indicate whether to + enable/disable Virtual Network ACL rules. + :type is_virtual_network_filter_enabled: bool :param enable_automatic_failover: Enables automatic failover of the write region in the rare event that the region is unavailable due to an outage. Automatic failover will result in a new write region for the account and @@ -70,6 +73,10 @@ class DatabaseAccount(Resource): their failover priorities. :vartype failover_policies: list[~azure.mgmt.cosmosdb.models.FailoverPolicy] + :param virtual_network_rules: List of Virtual Network ACL rules configured + for the Cosmos DB account. + :type virtual_network_rules: + list[~azure.mgmt.cosmosdb.models.VirtualNetworkRule] """ _validation = { @@ -95,24 +102,28 @@ class DatabaseAccount(Resource): 'document_endpoint': {'key': 'properties.documentEndpoint', 'type': 'str'}, 'database_account_offer_type': {'key': 'properties.databaseAccountOfferType', 'type': 'DatabaseAccountOfferType'}, 'ip_range_filter': {'key': 'properties.ipRangeFilter', 'type': 'str'}, + 'is_virtual_network_filter_enabled': {'key': 'properties.isVirtualNetworkFilterEnabled', 'type': 'bool'}, 'enable_automatic_failover': {'key': 'properties.enableAutomaticFailover', 'type': 'bool'}, 'consistency_policy': {'key': 'properties.consistencyPolicy', 'type': 'ConsistencyPolicy'}, 'capabilities': {'key': 'properties.capabilities', 'type': '[Capability]'}, 'write_locations': {'key': 'properties.writeLocations', 'type': '[Location]'}, 'read_locations': {'key': 'properties.readLocations', 'type': '[Location]'}, 'failover_policies': {'key': 'properties.failoverPolicies', 'type': '[FailoverPolicy]'}, + 'virtual_network_rules': {'key': 'properties.virtualNetworkRules', 'type': '[VirtualNetworkRule]'}, } - def __init__(self, *, location: str, tags=None, kind="GlobalDocumentDB", provisioning_state: str=None, ip_range_filter: str=None, enable_automatic_failover: bool=None, consistency_policy=None, capabilities=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, **kwargs) -> None: super(DatabaseAccount, self).__init__(location=location, tags=tags, **kwargs) self.kind = kind self.provisioning_state = provisioning_state self.document_endpoint = None self.database_account_offer_type = None self.ip_range_filter = ip_range_filter + self.is_virtual_network_filter_enabled = is_virtual_network_filter_enabled self.enable_automatic_failover = enable_automatic_failover self.consistency_policy = consistency_policy self.capabilities = capabilities self.write_locations = None self.read_locations = None self.failover_policies = None + self.virtual_network_rules = virtual_network_rules diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule.py new file mode 100644 index 000000000000..6ea87e5236a0 --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """Virtual Network ACL Rule object. + + :param id: Resource ID of a subnet, for example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = kwargs.get('id', None) diff --git a/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule_py3.py b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule_py3.py new file mode 100644 index 000000000000..707c8a3f615c --- /dev/null +++ b/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/virtual_network_rule_py3.py @@ -0,0 +1,29 @@ +# coding=utf-8 +# -------------------------------------------------------------------------- +# Copyright (c) Microsoft Corporation. All rights reserved. +# Licensed under the MIT License. See License.txt in the project root for +# license information. +# +# Code generated by Microsoft (R) AutoRest Code Generator. +# Changes may cause incorrect behavior and will be lost if the code is +# regenerated. +# -------------------------------------------------------------------------- + +from msrest.serialization import Model + + +class VirtualNetworkRule(Model): + """Virtual Network ACL Rule object. + + :param id: Resource ID of a subnet, for example: + /subscriptions/{subscriptionId}/resourceGroups/{groupName}/providers/Microsoft.Network/virtualNetworks/{virtualNetworkName}/subnets/{subnetName}. + :type id: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, **kwargs) -> None: + super(VirtualNetworkRule, self).__init__(**kwargs) + self.id = id