diff --git a/azure-mgmt-network/azure/mgmt/network/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/network_management_client.py index 59d4f2961487..1eb5dfcc87a4 100644 --- a/azure-mgmt-network/azure/mgmt/network/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/network_management_client.py @@ -327,6 +327,19 @@ def available_endpoint_services(self): raise NotImplementedError("APIVersion {} is not available".format(api_version)) return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property + def azure_firewalls(self): + """Instance depends on the API version: + + * 2018-04-01: :class:`AzureFirewallsOperations` + """ + api_version = self._get_api_version('azure_firewalls') + if api_version == '2018-04-01': + from .v2018_04_01.operations import AzureFirewallsOperations as OperationClass + else: + raise NotImplementedError("APIVersion {} is not available".format(api_version)) + return OperationClass(self._client, self.config, Serializer(self._models_dict(api_version)), Deserializer(self._models_dict(api_version))) + @property def bgp_service_communities(self): """Instance depends on the API version: diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/__init__.py index b1bf56d9cf46..5dbefcc0eb66 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/__init__.py @@ -11,6 +11,15 @@ try: from .sub_resource_py3 import SubResource + from .azure_firewall_ip_configuration_py3 import AzureFirewallIPConfiguration + from .azure_firewall_rc_action_py3 import AzureFirewallRCAction + from .azure_firewall_application_rule_protocol_py3 import AzureFirewallApplicationRuleProtocol + from .azure_firewall_application_rule_py3 import AzureFirewallApplicationRule + from .azure_firewall_application_rule_collection_py3 import AzureFirewallApplicationRuleCollection + from .azure_firewall_network_rule_py3 import AzureFirewallNetworkRule + from .azure_firewall_network_rule_collection_py3 import AzureFirewallNetworkRuleCollection + from .azure_firewall_py3 import AzureFirewall + from .resource_py3 import Resource from .backend_address_pool_py3 import BackendAddressPool from .inbound_nat_rule_py3 import InboundNatRule from .application_security_group_py3 import ApplicationSecurityGroup @@ -62,7 +71,6 @@ from .application_gateway_available_waf_rule_sets_result_py3 import ApplicationGatewayAvailableWafRuleSetsResult from .application_gateway_available_ssl_options_py3 import ApplicationGatewayAvailableSslOptions from .application_gateway_ssl_predefined_policy_py3 import ApplicationGatewaySslPredefinedPolicy - from .resource_py3 import Resource from .tags_object_py3 import TagsObject from .dns_name_availability_result_py3 import DnsNameAvailabilityResult from .ddos_protection_plan_py3 import DdosProtectionPlan @@ -218,6 +226,15 @@ from .vpn_site_id_py3 import VpnSiteId except (SyntaxError, ImportError): from .sub_resource import SubResource + from .azure_firewall_ip_configuration import AzureFirewallIPConfiguration + from .azure_firewall_rc_action import AzureFirewallRCAction + from .azure_firewall_application_rule_protocol import AzureFirewallApplicationRuleProtocol + from .azure_firewall_application_rule import AzureFirewallApplicationRule + from .azure_firewall_application_rule_collection import AzureFirewallApplicationRuleCollection + from .azure_firewall_network_rule import AzureFirewallNetworkRule + from .azure_firewall_network_rule_collection import AzureFirewallNetworkRuleCollection + from .azure_firewall import AzureFirewall + from .resource import Resource from .backend_address_pool import BackendAddressPool from .inbound_nat_rule import InboundNatRule from .application_security_group import ApplicationSecurityGroup @@ -269,7 +286,6 @@ from .application_gateway_available_waf_rule_sets_result import ApplicationGatewayAvailableWafRuleSetsResult from .application_gateway_available_ssl_options import ApplicationGatewayAvailableSslOptions from .application_gateway_ssl_predefined_policy import ApplicationGatewaySslPredefinedPolicy - from .resource import Resource from .tags_object import TagsObject from .dns_name_availability_result import DnsNameAvailabilityResult from .ddos_protection_plan import DdosProtectionPlan @@ -423,6 +439,7 @@ from .policies import Policies from .vpn_gateway import VpnGateway from .vpn_site_id import VpnSiteId +from .azure_firewall_paged import AzureFirewallPaged from .application_gateway_paged import ApplicationGatewayPaged from .application_gateway_ssl_predefined_policy_paged import ApplicationGatewaySslPredefinedPolicyPaged from .application_security_group_paged import ApplicationSecurityGroupPaged @@ -470,6 +487,10 @@ from .vpn_gateway_paged import VpnGatewayPaged from .vpn_connection_paged import VpnConnectionPaged from .network_management_client_enums import ( + ProvisioningState, + AzureFirewallRCActionType, + AzureFirewallApplicationRuleProtocolType, + AzureFirewallNetworkRuleProtocol, TransportProtocol, IPAllocationMethod, IPVersion, @@ -508,7 +529,6 @@ EffectiveSecurityRuleProtocol, EffectiveRouteSource, EffectiveRouteState, - ProvisioningState, AssociationType, Direction, IpFlowProtocol, @@ -549,6 +569,15 @@ __all__ = [ 'SubResource', + 'AzureFirewallIPConfiguration', + 'AzureFirewallRCAction', + 'AzureFirewallApplicationRuleProtocol', + 'AzureFirewallApplicationRule', + 'AzureFirewallApplicationRuleCollection', + 'AzureFirewallNetworkRule', + 'AzureFirewallNetworkRuleCollection', + 'AzureFirewall', + 'Resource', 'BackendAddressPool', 'InboundNatRule', 'ApplicationSecurityGroup', @@ -600,7 +629,6 @@ 'ApplicationGatewayAvailableWafRuleSetsResult', 'ApplicationGatewayAvailableSslOptions', 'ApplicationGatewaySslPredefinedPolicy', - 'Resource', 'TagsObject', 'DnsNameAvailabilityResult', 'DdosProtectionPlan', @@ -754,6 +782,7 @@ 'Policies', 'VpnGateway', 'VpnSiteId', + 'AzureFirewallPaged', 'ApplicationGatewayPaged', 'ApplicationGatewaySslPredefinedPolicyPaged', 'ApplicationSecurityGroupPaged', @@ -800,6 +829,10 @@ 'HubVirtualNetworkConnectionPaged', 'VpnGatewayPaged', 'VpnConnectionPaged', + 'ProvisioningState', + 'AzureFirewallRCActionType', + 'AzureFirewallApplicationRuleProtocolType', + 'AzureFirewallNetworkRuleProtocol', 'TransportProtocol', 'IPAllocationMethod', 'IPVersion', @@ -838,7 +871,6 @@ 'EffectiveSecurityRuleProtocol', 'EffectiveRouteSource', 'EffectiveRouteState', - 'ProvisioningState', 'AssociationType', 'Direction', 'IpFlowProtocol', diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall.py new file mode 100644 index 000000000000..d2edd16c810c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall.py @@ -0,0 +1,76 @@ +# 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 .resource import Resource + + +class AzureFirewall(Resource): + """Azure Firewall resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param application_rule_collections: Collection of application rule + collections used by a Azure Firewall. + :type application_rule_collections: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallApplicationRuleCollection] + :param network_rule_collections: Collection of network rule collections + used by a Azure Firewall. + :type network_rule_collections: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallNetworkRuleCollection] + :param ip_configurations: IP configuration of the Azure Firewall resource. + :type ip_configurations: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallIPConfiguration] + :param provisioning_state: The provisioning state of the resource. + Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_04_01.models.ProvisioningState + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'application_rule_collections': {'key': 'properties.applicationRuleCollections', 'type': '[AzureFirewallApplicationRuleCollection]'}, + 'network_rule_collections': {'key': 'properties.networkRuleCollections', 'type': '[AzureFirewallNetworkRuleCollection]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[AzureFirewallIPConfiguration]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureFirewall, self).__init__(**kwargs) + self.application_rule_collections = kwargs.get('application_rule_collections', None) + self.network_rule_collections = kwargs.get('network_rule_collections', None) + self.ip_configurations = kwargs.get('ip_configurations', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule.py new file mode 100644 index 000000000000..5cd5bfd06f95 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule.py @@ -0,0 +1,45 @@ +# 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 AzureFirewallApplicationRule(Model): + """Properties of an application rule. + + :param name: Name of the application rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param protocols: Array of ApplicationRuleProtocols. + :type protocols: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallApplicationRuleProtocol] + :param target_urls: List of URLs for this rule. + :type target_urls: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'protocols': {'key': 'protocols', 'type': '[AzureFirewallApplicationRuleProtocol]'}, + 'target_urls': {'key': 'targetUrls', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AzureFirewallApplicationRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.source_addresses = kwargs.get('source_addresses', None) + self.protocols = kwargs.get('protocols', None) + self.target_urls = kwargs.get('target_urls', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_collection.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_collection.py new file mode 100644 index 000000000000..18331e0b4c83 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_collection.py @@ -0,0 +1,64 @@ +# 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 .sub_resource import SubResource + + +class AzureFirewallApplicationRuleCollection(SubResource): + """Application rule collection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param priority: Priority of the application rule collection resource. + :type priority: int + :param action: The action type of a rule collection + :type action: ~azure.mgmt.network.v2018_04_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a application rule collection. + :type rules: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallApplicationRule] + :param provisioning_state: The provisioning state of the resource. + Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_04_01.models.ProvisioningState + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'priority': {'maximum': 65000, 'minimum': 100}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'action': {'key': 'properties.action', 'type': 'AzureFirewallRCAction'}, + 'rules': {'key': 'properties.rules', 'type': '[AzureFirewallApplicationRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureFirewallApplicationRuleCollection, self).__init__(**kwargs) + self.priority = kwargs.get('priority', None) + self.action = kwargs.get('action', None) + self.rules = kwargs.get('rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_collection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_collection_py3.py new file mode 100644 index 000000000000..e1bd04b48184 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_collection_py3.py @@ -0,0 +1,64 @@ +# 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 .sub_resource_py3 import SubResource + + +class AzureFirewallApplicationRuleCollection(SubResource): + """Application rule collection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param priority: Priority of the application rule collection resource. + :type priority: int + :param action: The action type of a rule collection + :type action: ~azure.mgmt.network.v2018_04_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a application rule collection. + :type rules: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallApplicationRule] + :param provisioning_state: The provisioning state of the resource. + Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_04_01.models.ProvisioningState + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'priority': {'maximum': 65000, 'minimum': 100}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'action': {'key': 'properties.action', 'type': 'AzureFirewallRCAction'}, + 'rules': {'key': 'properties.rules', 'type': '[AzureFirewallApplicationRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, priority: int=None, action=None, rules=None, provisioning_state=None, name: str=None, **kwargs) -> None: + super(AzureFirewallApplicationRuleCollection, self).__init__(id=id, **kwargs) + self.priority = priority + self.action = action + self.rules = rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_protocol.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_protocol.py new file mode 100644 index 000000000000..4a6c5cf456c0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_protocol.py @@ -0,0 +1,39 @@ +# 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 AzureFirewallApplicationRuleProtocol(Model): + """Properties of the application rule protocol. + + :param protocol_type: Protocol type. Possible values include: 'Http', + 'Https' + :type protocol_type: str or + ~azure.mgmt.network.v2018_04_01.models.AzureFirewallApplicationRuleProtocolType + :param port: Port number for the protocol, cannot be greater than 64000. + This field is optional. + :type port: int + """ + + _validation = { + 'port': {'maximum': 64000, 'minimum': 0}, + } + + _attribute_map = { + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, **kwargs): + super(AzureFirewallApplicationRuleProtocol, self).__init__(**kwargs) + self.protocol_type = kwargs.get('protocol_type', None) + self.port = kwargs.get('port', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_protocol_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_protocol_py3.py new file mode 100644 index 000000000000..635d6e0f3943 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_protocol_py3.py @@ -0,0 +1,39 @@ +# 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 AzureFirewallApplicationRuleProtocol(Model): + """Properties of the application rule protocol. + + :param protocol_type: Protocol type. Possible values include: 'Http', + 'Https' + :type protocol_type: str or + ~azure.mgmt.network.v2018_04_01.models.AzureFirewallApplicationRuleProtocolType + :param port: Port number for the protocol, cannot be greater than 64000. + This field is optional. + :type port: int + """ + + _validation = { + 'port': {'maximum': 64000, 'minimum': 0}, + } + + _attribute_map = { + 'protocol_type': {'key': 'protocolType', 'type': 'str'}, + 'port': {'key': 'port', 'type': 'int'}, + } + + def __init__(self, *, protocol_type=None, port: int=None, **kwargs) -> None: + super(AzureFirewallApplicationRuleProtocol, self).__init__(**kwargs) + self.protocol_type = protocol_type + self.port = port diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_py3.py new file mode 100644 index 000000000000..f8484cc9b43e --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_application_rule_py3.py @@ -0,0 +1,45 @@ +# 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 AzureFirewallApplicationRule(Model): + """Properties of an application rule. + + :param name: Name of the application rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param protocols: Array of ApplicationRuleProtocols. + :type protocols: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallApplicationRuleProtocol] + :param target_urls: List of URLs for this rule. + :type target_urls: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'protocols': {'key': 'protocols', 'type': '[AzureFirewallApplicationRuleProtocol]'}, + 'target_urls': {'key': 'targetUrls', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, description: str=None, source_addresses=None, protocols=None, target_urls=None, **kwargs) -> None: + super(AzureFirewallApplicationRule, self).__init__(**kwargs) + self.name = name + self.description = description + self.source_addresses = source_addresses + self.protocols = protocols + self.target_urls = target_urls diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_ip_configuration.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_ip_configuration.py new file mode 100644 index 000000000000..151603972d82 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_ip_configuration.py @@ -0,0 +1,65 @@ +# 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 .sub_resource import SubResource + + +class AzureFirewallIPConfiguration(SubResource): + """IP configuration of an Azure Firewall. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The Firewall Internal Load Balancer IP to be + used as the next hop in User Defined Routes. + :type private_ip_address: str + :param subnet: Reference of the subnet resource. This resource must be + named 'AzureFirewallSubnet'. + :type subnet: ~azure.mgmt.network.v2018_04_01.models.SubResource + :param internal_public_ip_address: Reference of the PublicIP resource. + This field is a mandatory input. + :type internal_public_ip_address: + ~azure.mgmt.network.v2018_04_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. This field + is populated in the output. + :type public_ip_address: + ~azure.mgmt.network.v2018_04_01.models.SubResource + :param provisioning_state: The provisioning state of the resource. + Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_04_01.models.ProvisioningState + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'internal_public_ip_address': {'key': 'properties.internalPublicIpAddress', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureFirewallIPConfiguration, self).__init__(**kwargs) + self.private_ip_address = kwargs.get('private_ip_address', None) + self.subnet = kwargs.get('subnet', None) + self.internal_public_ip_address = kwargs.get('internal_public_ip_address', None) + self.public_ip_address = kwargs.get('public_ip_address', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = kwargs.get('etag', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_ip_configuration_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_ip_configuration_py3.py new file mode 100644 index 000000000000..5a33ef194082 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_ip_configuration_py3.py @@ -0,0 +1,65 @@ +# 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 .sub_resource_py3 import SubResource + + +class AzureFirewallIPConfiguration(SubResource): + """IP configuration of an Azure Firewall. + + :param id: Resource ID. + :type id: str + :param private_ip_address: The Firewall Internal Load Balancer IP to be + used as the next hop in User Defined Routes. + :type private_ip_address: str + :param subnet: Reference of the subnet resource. This resource must be + named 'AzureFirewallSubnet'. + :type subnet: ~azure.mgmt.network.v2018_04_01.models.SubResource + :param internal_public_ip_address: Reference of the PublicIP resource. + This field is a mandatory input. + :type internal_public_ip_address: + ~azure.mgmt.network.v2018_04_01.models.SubResource + :param public_ip_address: Reference of the PublicIP resource. This field + is populated in the output. + :type public_ip_address: + ~azure.mgmt.network.v2018_04_01.models.SubResource + :param provisioning_state: The provisioning state of the resource. + Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_04_01.models.ProvisioningState + :param name: Name of the resource that is unique within a resource group. + This name can be used to access the resource. + :type name: str + :param etag: A unique read-only string that changes whenever the resource + is updated. + :type etag: str + """ + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'private_ip_address': {'key': 'properties.privateIPAddress', 'type': 'str'}, + 'subnet': {'key': 'properties.subnet', 'type': 'SubResource'}, + 'internal_public_ip_address': {'key': 'properties.internalPublicIpAddress', 'type': 'SubResource'}, + 'public_ip_address': {'key': 'properties.publicIPAddress', 'type': 'SubResource'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, private_ip_address: str=None, subnet=None, internal_public_ip_address=None, public_ip_address=None, provisioning_state=None, name: str=None, etag: str=None, **kwargs) -> None: + super(AzureFirewallIPConfiguration, self).__init__(id=id, **kwargs) + self.private_ip_address = private_ip_address + self.subnet = subnet + self.internal_public_ip_address = internal_public_ip_address + self.public_ip_address = public_ip_address + self.provisioning_state = provisioning_state + self.name = name + self.etag = etag diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule.py new file mode 100644 index 000000000000..da751fbfb8bb --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule.py @@ -0,0 +1,49 @@ +# 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 AzureFirewallNetworkRule(Model): + """Properties of the network rule. + + :param name: Name of the network rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param protocols: Array of AzureFirewallNetworkRuleProtocols. + :type protocols: list[str or + ~azure.mgmt.network.v2018_04_01.models.AzureFirewallNetworkRuleProtocol] + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports. + :type destination_ports: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'protocols': {'key': 'protocols', 'type': '[str]'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + } + + def __init__(self, **kwargs): + super(AzureFirewallNetworkRule, self).__init__(**kwargs) + self.name = kwargs.get('name', None) + self.description = kwargs.get('description', None) + self.protocols = kwargs.get('protocols', None) + self.source_addresses = kwargs.get('source_addresses', None) + self.destination_addresses = kwargs.get('destination_addresses', None) + self.destination_ports = kwargs.get('destination_ports', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule_collection.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule_collection.py new file mode 100644 index 000000000000..3b34385d686f --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule_collection.py @@ -0,0 +1,64 @@ +# 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 .sub_resource import SubResource + + +class AzureFirewallNetworkRuleCollection(SubResource): + """Network rule collection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param priority: Priority of the network rule collection resource. + :type priority: int + :param action: The action type of a rule collection + :type action: ~azure.mgmt.network.v2018_04_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a network rule collection. + :type rules: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallNetworkRule] + :param provisioning_state: The provisioning state of the resource. + Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_04_01.models.ProvisioningState + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'priority': {'maximum': 65000, 'minimum': 100}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'action': {'key': 'properties.action', 'type': 'AzureFirewallRCAction'}, + 'rules': {'key': 'properties.rules', 'type': '[AzureFirewallNetworkRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureFirewallNetworkRuleCollection, self).__init__(**kwargs) + self.priority = kwargs.get('priority', None) + self.action = kwargs.get('action', None) + self.rules = kwargs.get('rules', None) + self.provisioning_state = kwargs.get('provisioning_state', None) + self.name = kwargs.get('name', None) + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule_collection_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule_collection_py3.py new file mode 100644 index 000000000000..fbe18bfc02d3 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule_collection_py3.py @@ -0,0 +1,64 @@ +# 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 .sub_resource_py3 import SubResource + + +class AzureFirewallNetworkRuleCollection(SubResource): + """Network rule collection resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :param priority: Priority of the network rule collection resource. + :type priority: int + :param action: The action type of a rule collection + :type action: ~azure.mgmt.network.v2018_04_01.models.AzureFirewallRCAction + :param rules: Collection of rules used by a network rule collection. + :type rules: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallNetworkRule] + :param provisioning_state: The provisioning state of the resource. + Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_04_01.models.ProvisioningState + :param name: Gets name of the resource that is unique within a resource + group. This name can be used to access the resource. + :type name: str + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'priority': {'maximum': 65000, 'minimum': 100}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'priority': {'key': 'properties.priority', 'type': 'int'}, + 'action': {'key': 'properties.action', 'type': 'AzureFirewallRCAction'}, + 'rules': {'key': 'properties.rules', 'type': '[AzureFirewallNetworkRule]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, priority: int=None, action=None, rules=None, provisioning_state=None, name: str=None, **kwargs) -> None: + super(AzureFirewallNetworkRuleCollection, self).__init__(id=id, **kwargs) + self.priority = priority + self.action = action + self.rules = rules + self.provisioning_state = provisioning_state + self.name = name + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule_py3.py new file mode 100644 index 000000000000..47a246f6d1bc --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_network_rule_py3.py @@ -0,0 +1,49 @@ +# 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 AzureFirewallNetworkRule(Model): + """Properties of the network rule. + + :param name: Name of the network rule. + :type name: str + :param description: Description of the rule. + :type description: str + :param protocols: Array of AzureFirewallNetworkRuleProtocols. + :type protocols: list[str or + ~azure.mgmt.network.v2018_04_01.models.AzureFirewallNetworkRuleProtocol] + :param source_addresses: List of source IP addresses for this rule. + :type source_addresses: list[str] + :param destination_addresses: List of destination IP addresses. + :type destination_addresses: list[str] + :param destination_ports: List of destination ports. + :type destination_ports: list[str] + """ + + _attribute_map = { + 'name': {'key': 'name', 'type': 'str'}, + 'description': {'key': 'description', 'type': 'str'}, + 'protocols': {'key': 'protocols', 'type': '[str]'}, + 'source_addresses': {'key': 'sourceAddresses', 'type': '[str]'}, + 'destination_addresses': {'key': 'destinationAddresses', 'type': '[str]'}, + 'destination_ports': {'key': 'destinationPorts', 'type': '[str]'}, + } + + def __init__(self, *, name: str=None, description: str=None, protocols=None, source_addresses=None, destination_addresses=None, destination_ports=None, **kwargs) -> None: + super(AzureFirewallNetworkRule, self).__init__(**kwargs) + self.name = name + self.description = description + self.protocols = protocols + self.source_addresses = source_addresses + self.destination_addresses = destination_addresses + self.destination_ports = destination_ports diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_paged.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_paged.py new file mode 100644 index 000000000000..109d7f1f0553 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_paged.py @@ -0,0 +1,27 @@ +# 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.paging import Paged + + +class AzureFirewallPaged(Paged): + """ + A paging container for iterating over a list of :class:`AzureFirewall ` object + """ + + _attribute_map = { + 'next_link': {'key': 'nextLink', 'type': 'str'}, + 'current_page': {'key': 'value', 'type': '[AzureFirewall]'} + } + + def __init__(self, *args, **kwargs): + + super(AzureFirewallPaged, self).__init__(*args, **kwargs) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_py3.py new file mode 100644 index 000000000000..3e0a259e81d0 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_py3.py @@ -0,0 +1,76 @@ +# 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 .resource_py3 import Resource + + +class AzureFirewall(Resource): + """Azure Firewall resource. + + Variables are only populated by the server, and will be ignored when + sending a request. + + :param id: Resource ID. + :type id: str + :ivar name: Resource name. + :vartype name: str + :ivar type: Resource type. + :vartype type: str + :param location: Resource location. + :type location: str + :param tags: Resource tags. + :type tags: dict[str, str] + :param application_rule_collections: Collection of application rule + collections used by a Azure Firewall. + :type application_rule_collections: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallApplicationRuleCollection] + :param network_rule_collections: Collection of network rule collections + used by a Azure Firewall. + :type network_rule_collections: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallNetworkRuleCollection] + :param ip_configurations: IP configuration of the Azure Firewall resource. + :type ip_configurations: + list[~azure.mgmt.network.v2018_04_01.models.AzureFirewallIPConfiguration] + :param provisioning_state: The provisioning state of the resource. + Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + :type provisioning_state: str or + ~azure.mgmt.network.v2018_04_01.models.ProvisioningState + :ivar etag: Gets a unique read-only string that changes whenever the + resource is updated. + :vartype etag: str + """ + + _validation = { + 'name': {'readonly': True}, + 'type': {'readonly': True}, + 'etag': {'readonly': True}, + } + + _attribute_map = { + 'id': {'key': 'id', 'type': 'str'}, + 'name': {'key': 'name', 'type': 'str'}, + 'type': {'key': 'type', 'type': 'str'}, + 'location': {'key': 'location', 'type': 'str'}, + 'tags': {'key': 'tags', 'type': '{str}'}, + 'application_rule_collections': {'key': 'properties.applicationRuleCollections', 'type': '[AzureFirewallApplicationRuleCollection]'}, + 'network_rule_collections': {'key': 'properties.networkRuleCollections', 'type': '[AzureFirewallNetworkRuleCollection]'}, + 'ip_configurations': {'key': 'properties.ipConfigurations', 'type': '[AzureFirewallIPConfiguration]'}, + 'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'}, + 'etag': {'key': 'etag', 'type': 'str'}, + } + + def __init__(self, *, id: str=None, location: str=None, tags=None, application_rule_collections=None, network_rule_collections=None, ip_configurations=None, provisioning_state=None, **kwargs) -> None: + super(AzureFirewall, self).__init__(id=id, location=location, tags=tags, **kwargs) + self.application_rule_collections = application_rule_collections + self.network_rule_collections = network_rule_collections + self.ip_configurations = ip_configurations + self.provisioning_state = provisioning_state + self.etag = None diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_rc_action.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_rc_action.py new file mode 100644 index 000000000000..a94d88d5a9da --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_rc_action.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 AzureFirewallRCAction(Model): + """Properties of the AzureFirewallRCAction. + + :param type: The type of action. Possible values include: 'Allow', 'Deny' + :type type: str or + ~azure.mgmt.network.v2018_04_01.models.AzureFirewallRCActionType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, **kwargs): + super(AzureFirewallRCAction, self).__init__(**kwargs) + self.type = kwargs.get('type', None) diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_rc_action_py3.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_rc_action_py3.py new file mode 100644 index 000000000000..62c776457a0c --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/azure_firewall_rc_action_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 AzureFirewallRCAction(Model): + """Properties of the AzureFirewallRCAction. + + :param type: The type of action. Possible values include: 'Allow', 'Deny' + :type type: str or + ~azure.mgmt.network.v2018_04_01.models.AzureFirewallRCActionType + """ + + _attribute_map = { + 'type': {'key': 'type', 'type': 'str'}, + } + + def __init__(self, *, type=None, **kwargs) -> None: + super(AzureFirewallRCAction, self).__init__(**kwargs) + self.type = type diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/network_management_client_enums.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/network_management_client_enums.py index 583050c46b4f..4bcd75a97a07 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/network_management_client_enums.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/models/network_management_client_enums.py @@ -12,6 +12,34 @@ from enum import Enum +class ProvisioningState(str, Enum): + + succeeded = "Succeeded" + updating = "Updating" + deleting = "Deleting" + failed = "Failed" + + +class AzureFirewallRCActionType(str, Enum): + + allow = "Allow" + deny = "Deny" + + +class AzureFirewallApplicationRuleProtocolType(str, Enum): + + http = "Http" + https = "Https" + + +class AzureFirewallNetworkRuleProtocol(str, Enum): + + tcp = "TCP" + udp = "UDP" + any = "Any" + icmp = "ICMP" + + class TransportProtocol(str, Enum): udp = "Udp" @@ -296,14 +324,6 @@ class EffectiveRouteState(str, Enum): invalid = "Invalid" -class ProvisioningState(str, Enum): - - succeeded = "Succeeded" - updating = "Updating" - deleting = "Deleting" - failed = "Failed" - - class AssociationType(str, Enum): associated = "Associated" diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/network_management_client.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/network_management_client.py index 5f184c7d33a7..76d6126daca5 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/network_management_client.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/network_management_client.py @@ -18,6 +18,7 @@ from msrest.polling import LROPoller, NoPolling from msrestazure.polling.arm_polling import ARMPolling import uuid +from .operations.azure_firewalls_operations import AzureFirewallsOperations from .operations.application_gateways_operations import ApplicationGatewaysOperations from .operations.application_security_groups_operations import ApplicationSecurityGroupsOperations from .operations.ddos_protection_plans_operations import DdosProtectionPlansOperations @@ -109,6 +110,8 @@ class NetworkManagementClient(SDKClient): :ivar config: Configuration for client. :vartype config: NetworkManagementClientConfiguration + :ivar azure_firewalls: AzureFirewalls operations + :vartype azure_firewalls: azure.mgmt.network.v2018_04_01.operations.AzureFirewallsOperations :ivar application_gateways: ApplicationGateways operations :vartype application_gateways: azure.mgmt.network.v2018_04_01.operations.ApplicationGatewaysOperations :ivar application_security_groups: ApplicationSecurityGroups operations @@ -226,6 +229,8 @@ def __init__( self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) + self.azure_firewalls = AzureFirewallsOperations( + self._client, self.config, self._serialize, self._deserialize) self.application_gateways = ApplicationGatewaysOperations( self._client, self.config, self._serialize, self._deserialize) self.application_security_groups = ApplicationSecurityGroupsOperations( diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/__init__.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/__init__.py index da80b267fa64..7920434f1e6d 100644 --- a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/__init__.py +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/__init__.py @@ -9,6 +9,7 @@ # regenerated. # -------------------------------------------------------------------------- +from .azure_firewalls_operations import AzureFirewallsOperations from .application_gateways_operations import ApplicationGatewaysOperations from .application_security_groups_operations import ApplicationSecurityGroupsOperations from .ddos_protection_plans_operations import DdosProtectionPlansOperations @@ -59,6 +60,7 @@ from .vpn_connections_operations import VpnConnectionsOperations __all__ = [ + 'AzureFirewallsOperations', 'ApplicationGatewaysOperations', 'ApplicationSecurityGroupsOperations', 'DdosProtectionPlansOperations', diff --git a/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/azure_firewalls_operations.py b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/azure_firewalls_operations.py new file mode 100644 index 000000000000..b044c86fa4e7 --- /dev/null +++ b/azure-mgmt-network/azure/mgmt/network/v2018_04_01/operations/azure_firewalls_operations.py @@ -0,0 +1,418 @@ +# 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. +# -------------------------------------------------------------------------- + +import uuid +from msrest.pipeline import ClientRawResponse +from msrestazure.azure_exceptions import CloudError +from msrest.polling import LROPoller, NoPolling +from msrestazure.polling.arm_polling import ARMPolling + +from .. import models + + +class AzureFirewallsOperations(object): + """AzureFirewallsOperations operations. + + :param client: Client for service requests. + :param config: Configuration of service client. + :param serializer: An object model serializer. + :param deserializer: An object model deserializer. + :ivar api_version: Client API version. Constant value: "2018-04-01". + """ + + models = models + + def __init__(self, client, config, serializer, deserializer): + + self._client = client + self._serialize = serializer + self._deserialize = deserializer + self.api_version = "2018-04-01" + + self.config = config + + + def _delete_initial( + self, resource_group_name, azure_firewall_name, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.delete.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct and send request + request = self._client.delete(url, query_parameters) + response = self._client.send(request, header_parameters, stream=False, **operation_config) + + if response.status_code not in [200, 202, 204]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + def delete( + self, resource_group_name, azure_firewall_name, custom_headers=None, raw=False, polling=True, **operation_config): + """Deletes the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. + :type azure_firewall_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns None or + ClientRawResponse if raw==True + :rtype: ~msrestazure.azure_operation.AzureOperationPoller[None] or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[None]] + :raises: :class:`CloudError` + """ + raw_result = self._delete_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + if raw: + client_raw_response = ClientRawResponse(None, response) + return client_raw_response + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + delete.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} + + def get( + self, resource_group_name, azure_firewall_name, custom_headers=None, raw=False, **operation_config): + """Gets the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. + :type azure_firewall_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: AzureFirewall or ClientRawResponse if raw=true + :rtype: ~azure.mgmt.network.v2018_04_01.models.AzureFirewall or + ~msrest.pipeline.ClientRawResponse + :raises: :class:`CloudError` + """ + # Construct URL + url = self.get.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + 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) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AzureFirewall', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + get.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} + + + def _create_or_update_initial( + self, resource_group_name, azure_firewall_name, parameters, custom_headers=None, raw=False, **operation_config): + # Construct URL + url = self.create_or_update.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'azureFirewallName': self._serialize.url("azure_firewall_name", azure_firewall_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + header_parameters['accept-language'] = self._serialize.header("self.config.accept_language", self.config.accept_language, 'str') + + # Construct body + body_content = self._serialize.body(parameters, 'AzureFirewall') + + # Construct and send request + request = self._client.put(url, query_parameters) + response = self._client.send( + request, header_parameters, body_content, stream=False, **operation_config) + + if response.status_code not in [200, 201]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + deserialized = None + + if response.status_code == 200: + deserialized = self._deserialize('AzureFirewall', response) + if response.status_code == 201: + deserialized = self._deserialize('AzureFirewall', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + def create_or_update( + self, resource_group_name, azure_firewall_name, parameters, custom_headers=None, raw=False, polling=True, **operation_config): + """Creates or updates the specified Azure Firewall. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param azure_firewall_name: The name of the Azure Firewall. + :type azure_firewall_name: str + :param parameters: Parameters supplied to the create or update Azure + Firewall operation. + :type parameters: ~azure.mgmt.network.v2018_04_01.models.AzureFirewall + :param dict custom_headers: headers that will be added to the request + :param bool raw: The poller return type is ClientRawResponse, the + direct response alongside the deserialized response + :param polling: True for ARMPolling, False for no polling, or a + polling object for personal polling strategy + :return: An instance of LROPoller that returns AzureFirewall or + ClientRawResponse if raw==True + :rtype: + ~msrestazure.azure_operation.AzureOperationPoller[~azure.mgmt.network.v2018_04_01.models.AzureFirewall] + or + ~msrestazure.azure_operation.AzureOperationPoller[~msrest.pipeline.ClientRawResponse[~azure.mgmt.network.v2018_04_01.models.AzureFirewall]] + :raises: :class:`CloudError` + """ + raw_result = self._create_or_update_initial( + resource_group_name=resource_group_name, + azure_firewall_name=azure_firewall_name, + parameters=parameters, + custom_headers=custom_headers, + raw=True, + **operation_config + ) + + def get_long_running_output(response): + deserialized = self._deserialize('AzureFirewall', response) + + if raw: + client_raw_response = ClientRawResponse(deserialized, response) + return client_raw_response + + return deserialized + + lro_delay = operation_config.get( + 'long_running_operation_timeout', + self.config.long_running_operation_timeout) + if polling is True: polling_method = ARMPolling(lro_delay, **operation_config) + elif polling is False: polling_method = NoPolling() + else: polling_method = polling + return LROPoller(self._client, raw_result, get_long_running_output, polling_method) + create_or_update.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls/{azureFirewallName}'} + + def list( + self, resource_group_name, custom_headers=None, raw=False, **operation_config): + """Lists all Azure Firewalls in a resource group. + + :param resource_group_name: The name of the resource group. + :type resource_group_name: str + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AzureFirewall + :rtype: + ~azure.mgmt.network.v2018_04_01.models.AzureFirewallPaged[~azure.mgmt.network.v2018_04_01.models.AzureFirewall] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list.metadata['url'] + path_format_arguments = { + 'resourceGroupName': self._serialize.url("resource_group_name", resource_group_name, 'str'), + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + 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) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AzureFirewallPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AzureFirewallPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/azureFirewalls'} + + def list_all( + self, custom_headers=None, raw=False, **operation_config): + """Gets all the Azure Firewalls in a subscription. + + :param dict custom_headers: headers that will be added to the request + :param bool raw: returns the direct response alongside the + deserialized response + :param operation_config: :ref:`Operation configuration + overrides`. + :return: An iterator like instance of AzureFirewall + :rtype: + ~azure.mgmt.network.v2018_04_01.models.AzureFirewallPaged[~azure.mgmt.network.v2018_04_01.models.AzureFirewall] + :raises: :class:`CloudError` + """ + def internal_paging(next_link=None, raw=False): + + if not next_link: + # Construct URL + url = self.list_all.metadata['url'] + path_format_arguments = { + 'subscriptionId': self._serialize.url("self.config.subscription_id", self.config.subscription_id, 'str') + } + url = self._client.format_url(url, **path_format_arguments) + + # Construct parameters + query_parameters = {} + query_parameters['api-version'] = self._serialize.query("self.api_version", self.api_version, 'str') + + else: + url = next_link + query_parameters = {} + + # Construct headers + header_parameters = {} + header_parameters['Content-Type'] = 'application/json; charset=utf-8' + if self.config.generate_client_request_id: + header_parameters['x-ms-client-request-id'] = str(uuid.uuid1()) + if custom_headers: + header_parameters.update(custom_headers) + if self.config.accept_language is not None: + 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) + + if response.status_code not in [200]: + exp = CloudError(response) + exp.request_id = response.headers.get('x-ms-request-id') + raise exp + + return response + + # Deserialize response + deserialized = models.AzureFirewallPaged(internal_paging, self._deserialize.dependencies) + + if raw: + header_dict = {} + client_raw_response = models.AzureFirewallPaged(internal_paging, self._deserialize.dependencies, header_dict) + return client_raw_response + + return deserialized + list_all.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.Network/azureFirewalls'}