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 network/resource-manager] Add new Nat Gateway resource #4815

Merged
merged 4 commits into from
Apr 24, 2019
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
13 changes: 13 additions & 0 deletions azure-mgmt-network/azure/mgmt/network/network_management_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -1807,6 +1807,19 @@ def local_network_gateways(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 nat_gateways(self):
"""Instance depends on the API version:

* 2019-02-01: :class:`NatGatewaysOperations<azure.mgmt.network.v2019_02_01.operations.NatGatewaysOperations>`
"""
api_version = self._get_api_version('nat_gateways')
if api_version == '2019-02-01':
from .v2019_02_01.operations import NatGatewaysOperations 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 network_interface_ip_configurations(self):
"""Instance depends on the API version:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@
from .inbound_nat_pool_py3 import InboundNatPool
from .outbound_rule_py3 import OutboundRule
from .load_balancer_py3 import LoadBalancer
from .nat_gateway_sku_py3 import NatGatewaySku
from .nat_gateway_py3 import NatGateway
from .azure_async_operation_result_py3 import AzureAsyncOperationResult
from .effective_network_security_group_association_py3 import EffectiveNetworkSecurityGroupAssociation
from .effective_network_security_rule_py3 import EffectiveNetworkSecurityRule
Expand Down Expand Up @@ -441,6 +443,8 @@
from .inbound_nat_pool import InboundNatPool
from .outbound_rule import OutboundRule
from .load_balancer import LoadBalancer
from .nat_gateway_sku import NatGatewaySku
from .nat_gateway import NatGateway
from .azure_async_operation_result import AzureAsyncOperationResult
from .effective_network_security_group_association import EffectiveNetworkSecurityGroupAssociation
from .effective_network_security_rule import EffectiveNetworkSecurityRule
Expand Down Expand Up @@ -623,6 +627,7 @@
from .outbound_rule_paged import OutboundRulePaged
from .network_interface_paged import NetworkInterfacePaged
from .probe_paged import ProbePaged
from .nat_gateway_paged import NatGatewayPaged
from .network_interface_ip_configuration_paged import NetworkInterfaceIPConfigurationPaged
from .network_interface_tap_configuration_paged import NetworkInterfaceTapConfigurationPaged
from .network_profile_paged import NetworkProfilePaged
Expand Down Expand Up @@ -710,6 +715,7 @@
LoadDistribution,
ProbeProtocol,
LoadBalancerOutboundRuleProtocol,
NatGatewaySkuName,
NetworkOperationStatus,
EffectiveSecurityRuleProtocol,
EffectiveRouteSource,
Expand Down Expand Up @@ -906,6 +912,8 @@
'InboundNatPool',
'OutboundRule',
'LoadBalancer',
'NatGatewaySku',
'NatGateway',
'AzureAsyncOperationResult',
'EffectiveNetworkSecurityGroupAssociation',
'EffectiveNetworkSecurityRule',
Expand Down Expand Up @@ -1088,6 +1096,7 @@
'OutboundRulePaged',
'NetworkInterfacePaged',
'ProbePaged',
'NatGatewayPaged',
'NetworkInterfaceIPConfigurationPaged',
'NetworkInterfaceTapConfigurationPaged',
'NetworkProfilePaged',
Expand Down Expand Up @@ -1174,6 +1183,7 @@
'LoadDistribution',
'ProbeProtocol',
'LoadBalancerOutboundRuleProtocol',
'NatGatewaySkuName',
'NetworkOperationStatus',
'EffectiveSecurityRuleProtocol',
'EffectiveRouteSource',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ class ApplicationGatewayRedirectConfiguration(SubResource):

:param id: Resource ID.
:type id: str
:param redirect_type: Supported http redirection types - Permanent,
Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found',
'SeeOther', 'Temporary'
:param redirect_type: HTTP redirection type. Possible values include:
'Permanent', 'Found', 'SeeOther', 'Temporary'
:type redirect_type: str or
~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayRedirectType
:param target_listener: Reference to a listener to redirect the request
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@ class ApplicationGatewayRedirectConfiguration(SubResource):

:param id: Resource ID.
:type id: str
:param redirect_type: Supported http redirection types - Permanent,
Temporary, Found, SeeOther. Possible values include: 'Permanent', 'Found',
'SeeOther', 'Temporary'
:param redirect_type: HTTP redirection type. Possible values include:
'Permanent', 'Found', 'SeeOther', 'Temporary'
:type redirect_type: str or
~azure.mgmt.network.v2019_02_01.models.ApplicationGatewayRedirectType
:param target_listener: Reference to a listener to redirect the request
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# 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 NatGateway(Resource):
"""Nat Gateway 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 sku: The nat gateway SKU.
:type sku: ~azure.mgmt.network.v2019_02_01.models.NatGatewaySku
:param idle_timeout_in_minutes: The idle timeout of the nat gateway.
:type idle_timeout_in_minutes: int
:param public_ip_addresses: An array of public ip addresses associated
with the nat gateway resource.
:type public_ip_addresses:
list[~azure.mgmt.network.v2019_02_01.models.SubResource]
:param public_ip_prefixes: An array of public ip prefixes associated with
the nat gateway resource.
:type public_ip_prefixes:
list[~azure.mgmt.network.v2019_02_01.models.SubResource]
:ivar subnets: An array of references to the subnets using this nat
gateway resource.
:vartype subnets: list[~azure.mgmt.network.v2019_02_01.models.SubResource]
:param resource_guid: The resource GUID property of the nat gateway
resource.
:type resource_guid: str
:param provisioning_state: The provisioning state of the NatGateway
resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
:type provisioning_state: str
:param etag: A unique read-only string that changes whenever the resource
is updated.
:type etag: str
"""

_validation = {
'name': {'readonly': True},
'type': {'readonly': True},
'subnets': {'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}'},
'sku': {'key': 'sku', 'type': 'NatGatewaySku'},
'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'},
'public_ip_addresses': {'key': 'properties.publicIpAddresses', 'type': '[SubResource]'},
'public_ip_prefixes': {'key': 'properties.publicIpPrefixes', 'type': '[SubResource]'},
'subnets': {'key': 'properties.subnets', 'type': '[SubResource]'},
'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'etag': {'key': 'etag', 'type': 'str'},
}

def __init__(self, **kwargs):
super(NatGateway, self).__init__(**kwargs)
self.sku = kwargs.get('sku', None)
self.idle_timeout_in_minutes = kwargs.get('idle_timeout_in_minutes', None)
self.public_ip_addresses = kwargs.get('public_ip_addresses', None)
self.public_ip_prefixes = kwargs.get('public_ip_prefixes', None)
self.subnets = None
self.resource_guid = kwargs.get('resource_guid', None)
self.provisioning_state = kwargs.get('provisioning_state', None)
self.etag = kwargs.get('etag', None)
Original file line number Diff line number Diff line change
@@ -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 NatGatewayPaged(Paged):
"""
A paging container for iterating over a list of :class:`NatGateway <azure.mgmt.network.v2019_02_01.models.NatGateway>` object
"""

_attribute_map = {
'next_link': {'key': 'nextLink', 'type': 'str'},
'current_page': {'key': 'value', 'type': '[NatGateway]'}
}

def __init__(self, *args, **kwargs):

super(NatGatewayPaged, self).__init__(*args, **kwargs)
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# 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 NatGateway(Resource):
"""Nat Gateway 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 sku: The nat gateway SKU.
:type sku: ~azure.mgmt.network.v2019_02_01.models.NatGatewaySku
:param idle_timeout_in_minutes: The idle timeout of the nat gateway.
:type idle_timeout_in_minutes: int
:param public_ip_addresses: An array of public ip addresses associated
with the nat gateway resource.
:type public_ip_addresses:
list[~azure.mgmt.network.v2019_02_01.models.SubResource]
:param public_ip_prefixes: An array of public ip prefixes associated with
the nat gateway resource.
:type public_ip_prefixes:
list[~azure.mgmt.network.v2019_02_01.models.SubResource]
:ivar subnets: An array of references to the subnets using this nat
gateway resource.
:vartype subnets: list[~azure.mgmt.network.v2019_02_01.models.SubResource]
:param resource_guid: The resource GUID property of the nat gateway
resource.
:type resource_guid: str
:param provisioning_state: The provisioning state of the NatGateway
resource. Possible values are: 'Updating', 'Deleting', and 'Failed'.
:type provisioning_state: str
:param etag: A unique read-only string that changes whenever the resource
is updated.
:type etag: str
"""

_validation = {
'name': {'readonly': True},
'type': {'readonly': True},
'subnets': {'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}'},
'sku': {'key': 'sku', 'type': 'NatGatewaySku'},
'idle_timeout_in_minutes': {'key': 'properties.idleTimeoutInMinutes', 'type': 'int'},
'public_ip_addresses': {'key': 'properties.publicIpAddresses', 'type': '[SubResource]'},
'public_ip_prefixes': {'key': 'properties.publicIpPrefixes', 'type': '[SubResource]'},
'subnets': {'key': 'properties.subnets', 'type': '[SubResource]'},
'resource_guid': {'key': 'properties.resourceGuid', 'type': 'str'},
'provisioning_state': {'key': 'properties.provisioningState', 'type': 'str'},
'etag': {'key': 'etag', 'type': 'str'},
}

def __init__(self, *, id: str=None, location: str=None, tags=None, sku=None, idle_timeout_in_minutes: int=None, public_ip_addresses=None, public_ip_prefixes=None, resource_guid: str=None, provisioning_state: str=None, etag: str=None, **kwargs) -> None:
super(NatGateway, self).__init__(id=id, location=location, tags=tags, **kwargs)
self.sku = sku
self.idle_timeout_in_minutes = idle_timeout_in_minutes
self.public_ip_addresses = public_ip_addresses
self.public_ip_prefixes = public_ip_prefixes
self.subnets = None
self.resource_guid = resource_guid
self.provisioning_state = provisioning_state
self.etag = etag
Original file line number Diff line number Diff line change
@@ -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 NatGatewaySku(Model):
"""SKU of nat gateway.

:param name: Name of Nat Gateway SKU. Possible values include: 'Standard'
:type name: str or
~azure.mgmt.network.v2019_02_01.models.NatGatewaySkuName
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
}

def __init__(self, **kwargs):
super(NatGatewaySku, self).__init__(**kwargs)
self.name = kwargs.get('name', None)
Original file line number Diff line number Diff line change
@@ -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 NatGatewaySku(Model):
"""SKU of nat gateway.

:param name: Name of Nat Gateway SKU. Possible values include: 'Standard'
:type name: str or
~azure.mgmt.network.v2019_02_01.models.NatGatewaySkuName
"""

_attribute_map = {
'name': {'key': 'name', 'type': 'str'},
}

def __init__(self, *, name=None, **kwargs) -> None:
super(NatGatewaySku, self).__init__(**kwargs)
self.name = name
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,11 @@ class LoadBalancerOutboundRuleProtocol(str, Enum):
all = "All"


class NatGatewaySkuName(str, Enum):

standard = "Standard"


class NetworkOperationStatus(str, Enum):

in_progress = "InProgress"
Expand Down
Loading