%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/states/azurearm_network.pyo

�
���^c@@s�dZddlmZddlZyddlmZWnek
rOeZnXdZej	e
�Zd�Ze
e
e
d�Ze
d�Ze
e
e
d	�Ze
d
�Ze
e
e
d�Ze
d�Ze
e
e
e
e
e
e
e
e
e
d
�
Ze
d�Ze
e
e
e
e
e
e
e
e
e
d�
Ze
d�Ze
e
e
e
e
e
e
d�Ze
d�Ze
e
e
e
e
e
e
e
e
d�	Ze
d�Ze
e
e
e
d�Ze
d�Ze
e
d�Ze
d�ZdS(s�
Azure (ARM) Network State Module

.. versionadded:: 2019.2.0

:maintainer: <devops@decisionlab.io>
:maturity: new
:depends:
    * `azure <https://pypi.python.org/pypi/azure>`_ >= 2.0.0
    * `azure-common <https://pypi.python.org/pypi/azure-common>`_ >= 1.1.8
    * `azure-mgmt <https://pypi.python.org/pypi/azure-mgmt>`_ >= 1.0.0
    * `azure-mgmt-compute <https://pypi.python.org/pypi/azure-mgmt-compute>`_ >= 1.0.0
    * `azure-mgmt-network <https://pypi.python.org/pypi/azure-mgmt-network>`_ >= 1.7.1
    * `azure-mgmt-resource <https://pypi.python.org/pypi/azure-mgmt-resource>`_ >= 1.1.0
    * `azure-mgmt-storage <https://pypi.python.org/pypi/azure-mgmt-storage>`_ >= 1.0.0
    * `azure-mgmt-web <https://pypi.python.org/pypi/azure-mgmt-web>`_ >= 0.32.0
    * `azure-storage <https://pypi.python.org/pypi/azure-storage>`_ >= 0.34.3
    * `msrestazure <https://pypi.python.org/pypi/msrestazure>`_ >= 0.4.21
:platform: linux

:configuration: This module requires Azure Resource Manager credentials to be passed as a dictionary of
    keyword arguments to the ``connection_auth`` parameter in order to work properly. Since the authentication
    parameters are sensitive, it's recommended to pass them to the states via pillar.

    Required provider parameters:

    if using username and password:
      * ``subscription_id``
      * ``username``
      * ``password``

    if using a service principal:
      * ``subscription_id``
      * ``tenant``
      * ``client_id``
      * ``secret``

    Optional provider parameters:

    **cloud_environment**: Used to point the cloud driver to different API endpoints, such as Azure GovCloud. Possible values:
      * ``AZURE_PUBLIC_CLOUD`` (default)
      * ``AZURE_CHINA_CLOUD``
      * ``AZURE_US_GOV_CLOUD``
      * ``AZURE_GERMAN_CLOUD``

    Example Pillar for Azure Resource Manager authentication:

    .. code-block:: yaml

        azurearm:
            user_pass_auth:
                subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617
                username: fletch
                password: 123pass
            mysubscription:
                subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617
                tenant: ABCDEFAB-1234-ABCD-1234-ABCDEFABCDEF
                client_id: ABCDEFAB-1234-ABCD-1234-ABCDEFABCDEF
                secret: XXXXXXXXXXXXXXXXXXXXXXXX
                cloud_environment: AZURE_PUBLIC_CLOUD

    Example states using Azure Resource Manager authentication:

    .. code-block:: jinja

        {% set profile = salt['pillar.get']('azurearm:mysubscription') %}
        Ensure virtual network exists:
            azurearm_network.virtual_network_present:
                - name: my_vnet
                - resource_group: my_rg
                - address_prefixes:
                    - '10.0.0.0/8'
                    - '192.168.0.0/16'
                - dns_servers:
                    - '8.8.8.8'
                - tags:
                    how_awesome: very
                    contact_name: Elmer Fudd Gantry
                - connection_auth: {{ profile }}

        Ensure virtual network is absent:
            azurearm_network.virtual_network_absent:
                - name: other_vnet
                - resource_group: my_rg
                - connection_auth: {{ profile }}

i(tabsolute_importN(trangetazurearm_networkcC@sdtkrtStS(sU
    Only make this state available if the azurearm_network module is available.
    s.azurearm_network.check_ip_address_availability(t__salt__t__virtualname__tFalse(((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pyt__virtual__isc
K@s�i|d6td6dd6id6}t|t�s?d|d<|Std||dd	|�}d
|kr�td|jdi�|p�i�}	|	r�|	|dd<nt|p�g�jt|jd
i�jdg���}
|
ri|jd
i�jdg�d6|d6|dd<nt|p%g�jt|jdi�jdg���}|r�ii|jdi�jdg�d6|d6d6|dd<n|jdt�|jd�kr�i|jd�d6|jd�d6|dd<n|jdt�|jd�kr:i|jd�d6|jd�d6|dd<n|dset|d<dj	|�|d<|St
drd|d<dj	|�|d<|Snoiid6i|d6|d6i|d6d6i|d6d
6|jdt�d6|jdt�d6|d6d6|d<t
dr-dj	|�|d<d|d<|S|j�}|j
|�tdd|d|d|d|d||�}d
|kr�t|d<dj	|�|d<|Sdj	||jd
��|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a virtual network exists.

    :param name:
        Name of the virtual network.

    :param resource_group:
        The resource group assigned to the virtual network.

    :param address_prefixes:
        A list of CIDR blocks which can be used by subnets within the virtual network.

    :param dns_servers:
        A list of DNS server addresses.

    :param tags:
        A dictionary of strings can be passed as tag metadata to the virtual network object.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.

    Example usage:

    .. code-block:: yaml

        Ensure virtual network exists:
            azurearm_network.virtual_network_present:
                - name: vnet1
                - resource_group: group1
                - address_prefixes:
                    - '10.0.0.0/8'
                    - '192.168.0.0/16'
                - dns_servers:
                    - '8.8.8.8'
                - tags:
                    contact_name: Elmer Fudd Gantry
                - connection_auth: {{ profile }}
                - require:
                  - azurearm_resource: Ensure resource group exists

    tnametresultttcommenttchangessHConnection information must be specified via connection_auth dictionary!s$azurearm_network.virtual_network_gettazurearm_log_leveltinfoterrorsdictdiffer.deep_diffttagstdhcp_optionstdns_serverstoldtnewt
address_spacetaddress_prefixestenable_ddos_protectiontenable_vm_protections'Virtual network {0} is already present.ttests%Virtual network {0} would be updated.tresource_groups%Virtual network {0} would be created.s1azurearm_network.virtual_network_create_or_updates%Virtual network {0} has been created.s+Failed to create virtual network {0}! ({1})N(Rt
isinstancetdictRt	__utils__tgettsettsymmetric_differencetTruetformatt__opts__tNonetcopytupdate(
RRRRRtconnection_authtkwargstrettvnetttag_changestdns_changestaddr_changestvnet_kwargs((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytvirtual_network_presentps�.

	%''!!







	
cC@s7i|d6td6dd6id6}t|t�s?d|d<|Std||dd	|�}d
|kr�t|d<dj|�|d<|Stdr�d
j|�|d<d|d<i|d6id6|d<|Std|||�}|r t|d<dj|�|d<i|d6id6|d<|Sdj|�|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a virtual network does not exist in the resource group.

    :param name:
        Name of the virtual network.

    :param resource_group:
        The resource group assigned to the virtual network.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.
    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s$azurearm_network.virtual_network_getRR
Rs"Virtual network {0} was not found.Rs%Virtual network {0} would be deleted.RRs'azurearm_network.virtual_network_deletes%Virtual network {0} has been deleted.s%Failed to delete virtual network {0}!N(RRRRR R!R"R#(RRR&R(R)tdeleted((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytvirtual_network_absentsD

	



c
K@s�i|d6td6dd6id6}t|t�s?d|d<|Std|||dd	|�}	d
|	kr�||	jd�kr�i|	jd�d6|d
6|dd<nd}
|	jd�r�|	ddjd�d}
n|r||
kri|
d6|d
6|dd<nd}|	jd�r>|	ddjd�d}n|ro||kroi|d6|d
6|dd<n|ds�t|d<dj|�|d<|St	dr�d|d<dj|�|d<|Sn4iid6i|d6|d6|d6|d6d
6|d<t	dr'dj|�|d<d|d<|S|j
�}|j|�tdd|d|d|d|d|d||�}	d
|	kr�t|d<dj|�|d<|Sdj||	jd
��|d<|S(s{
    .. versionadded:: 2019.2.0

    Ensure a subnet exists.

    :param name:
        Name of the subnet.

    :param address_prefix:
        A CIDR block used by the subnet within the virtual network.

    :param virtual_network:
        Name of the existing virtual network to contain the subnet.

    :param resource_group:
        The resource group assigned to the virtual network.

    :param security_group:
        The name of the existing network security group to assign to the subnet.

    :param route_table:
        The name of the existing route table to assign to the subnet.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.

    Example usage:

    .. code-block:: yaml

        Ensure subnet exists:
            azurearm_network.subnet_present:
                - name: vnet1_sn1
                - virtual_network: vnet1
                - resource_group: group1
                - address_prefix: '192.168.1.0/24'
                - security_group: nsg1
                - route_table: rt1
                - connection_auth: {{ profile }}
                - require:
                  - azurearm_network: Ensure virtual network exists
                  - azurearm_network: Ensure network security group exists
                  - azurearm_network: Ensure route table exists

    RRR	R
RsHConnection information must be specified via connection_auth dictionary!sazurearm_network.subnet_getRR
Rtaddress_prefixRRtnetwork_security_grouptidt/i����troute_tablesSubnet {0} is already present.RsSubnet {0} would be updated.sSubnet {0} would be created.s(azurearm_network.subnet_create_or_updatetvirtual_networkRsSubnet {0} has been created.s"Failed to create subnet {0}! ({1})N(RRRRRR#tsplitR R!R"R$R%(
RR1R6Rtsecurity_groupR5R&R'R(tsnettnsg_namet
rttbl_nametsnet_kwargs((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytsubnet_presentDs�0

	







	
cC@s=i|d6td6dd6id6}t|t�s?d|d<|Std|||dd	|�}d
|kr�t|d<dj|�|d<|Stdr�d
j|�|d<d|d<i|d6id6|d<|Std||||�}|r&t|d<dj|�|d<i|d6id6|d<|Sdj|�|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a virtual network does not exist in the virtual network.

    :param name:
        Name of the subnet.

    :param virtual_network:
        Name of the existing virtual network containing the subnet.

    :param resource_group:
        The resource group assigned to the virtual network.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.
    RRR	R
RsHConnection information must be specified via connection_auth dictionary!sazurearm_network.subnet_getRR
RsSubnet {0} was not found.RsSubnet {0} would be deleted.RRsazurearm_network.subnet_deletesSubnet {0} has been deleted.sFailed to delete subnet {0}!N(RRRRR R!R"R#(RR6RR&R(R9R/((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pyt
subnet_absent�sF

	



cK@sbi|d6td6dd6id6}t|t�s?d|d<|Std||dd	|�}d
|krrtd|jdi�|p�i�}|r�||dd<n|rtd
|jdg�|�}	|	jd�r�dj|	d�|d<|S|	jd�r|	d|dd<qn|dsDt|d<dj|�|d<|Stdr�d|d<dj|�|d<|Sn4iid6i|d6|d6|d6|d6d6|d<tdr�dj|�|d<d|d<|S|j
�}
|
j|�tdd|d|d|d||
�}d
|kr?t|d<dj|�|d<|Sdj||jd
��|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a network security group exists.

    :param name:
        Name of the network security group.

    :param resource_group:
        The resource group assigned to the network security group.

    :param tags:
        A dictionary of strings can be passed as tag metadata to the network security group object.

    :param security_rules: An optional list of dictionaries representing valid SecurityRule objects. See the
        documentation for the security_rule_present state or security_rule_create_or_update execution module
        for more information on required and optional parameters for security rules. The rules are only
        managed if this parameter is present. When this parameter is absent, implemented rules will not be removed,
        and will merely become unmanaged.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.

    Example usage:

    .. code-block:: yaml

        Ensure network security group exists:
            azurearm_network.network_security_group_present:
                - name: nsg1
                - resource_group: group1
                - security_rules:
                  - name: nsg1_rule1
                    priority: 100
                    protocol: tcp
                    access: allow
                    direction: outbound
                    source_address_prefix: virtualnetwork
                    destination_address_prefix: internet
                    source_port_range: '*'
                    destination_port_range: '*'
                  - name: nsg1_rule2
                    priority: 101
                    protocol: tcp
                    access: allow
                    direction: inbound
                    source_address_prefix: internet
                    destination_address_prefix: virtualnetwork
                    source_port_range: '*'
                    destination_port_ranges:
                      - '80'
                      - '443'
                - tags:
                    contact_name: Elmer Fudd Gantry
                - connection_auth: {{ profile }}
                - require:
                  - azurearm_resource: Ensure resource group exists

    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s+azurearm_network.network_security_group_getRR
Rsdictdiffer.deep_diffRsazurearm.compare_list_of_dictstsecurity_ruless"security_rules" {0}s.Network security group {0} is already present.Rs,Network security group {0} would be updated.RRRs,Network security group {0} would be created.s8azurearm_network.network_security_group_create_or_updates,Network security group {0} has been created.s2Failed to create network security group {0}! ({1})N(RRRRRRR!R R"R#R$R%(RRRR?R&R'R(tnsgR*tcomp_rett
nsg_kwargs((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytnetwork_security_group_presentsr>

	%







	
cC@s7i|d6td6dd6id6}t|t�s?d|d<|Std||dd	|�}d
|kr�t|d<dj|�|d<|Stdr�d
j|�|d<d|d<i|d6id6|d<|Std|||�}|r t|d<dj|�|d<i|d6id6|d<|Sdj|�|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a network security group does not exist in the resource group.

    :param name:
        Name of the network security group.

    :param resource_group:
        The resource group assigned to the network security group.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.
    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s+azurearm_network.network_security_group_getRR
Rs)Network security group {0} was not found.Rs,Network security group {0} would be deleted.RRs.azurearm_network.network_security_group_deletes,Network security group {0} has been deleted.s,Failed to delete network security group {0}!N(RRRRR R!R"R#(RRR&R(R@R/((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytnetwork_security_group_absent�sD

	



c*J@s,i|d6ed6dd6id6}e|e�s?d|d<|Sd)d*d+d,g}x�|D]�}e|d�r�e|d�r�dj|d|d�|d<|Se|d�rXee|d�e�s�dj|d�|d<|Sdj|d�dUqXqXWed|||dd|�}d|kr�|j�|jd�krpi|jd�d6|d6|dd<n||jd�kr�i|jd�d6|d6|dd<n|j�|jd�kr�i|jd�d6|d6|dd<ne	|�|jd�kr3i|jd�d6|d6|dd<n|j
�|jdd�j
�kri|jd�d6|d6|dd<n||jd�kr�i|jd�d6|d6|dd<n|
|jd�kr�i|jd�d6|
d6|dd<ne|
pg�e|jdg��krKi|jd�d6|
d6|dd<ne|pWg�e|jdg��kr�i|jd�d6|d6|dd<n|p�dj
�|jdd�j
�kr�i|jd�d6|d6|dd<n|	p�dj
�|jd
d�j
�krAi|jd
�d6|	d6|dd
<ne|pMg�e|jd
g��krKe|pwg�e|jd
g��kr�i|jd
�d6|d6|dd
<qKe|�e|jd
��}}xie
de|��D]O}||j
�||j
�kr�i|jd
�d6|d6|dd
<Pq�q�Wne|pWg�e|jd	g��krUe|p�g�e|jd	g��kr�i|jd	�d6|d6|dd	<qUe|�e|jd	��}}xie
de|��D]O}||j
�||j
�kr�i|jd	�d6|d6|dd	<Pq�q�Wn|ds�e|d<d j|�|d<|Sed!r(d|d<d"j|�|d<|Snziid6i|d6|d6|d6|d6|d6|d6|d6|d
6|d6|
d6|	d
6|d	6|
d6|d6d6|d<ed!rSd#j|�|d<d|d<|S|j�}|j|�ed$d|d|d|d|d|d|d%|d&|d|d
|d|d|
d
|	d	|d|
d||�}d|kr	e|d<d'j|�|d<|Sd(j||jd��|d<|S(-s

    .. versionadded:: 2019.2.0

    Ensure a security rule exists.

    :param name:
        Name of the security rule.

    :param access:
        'allow' or 'deny'

    :param direction:
        'inbound' or 'outbound'

    :param priority:
        Integer between 100 and 4096 used for ordering rule application.

    :param protocol:
        'tcp', 'udp', or '*'

    :param security_group:
        The name of the existing network security group to contain the security rule.

    :param resource_group:
        The resource group assigned to the network security group.

    :param description:
        Optional description of the security rule.

    :param destination_address_prefix:
        The CIDR or destination IP range. Asterix '*' can also be used to match all destination IPs.
        Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
        If this is an ingress rule, specifies where network traffic originates from.

    :param destination_port_range:
        The destination port or range. Integer or range between 0 and 65535. Asterix '*'
        can also be used to match all ports.

    :param source_address_prefix:
        The CIDR or source IP range. Asterix '*' can also be used to match all source IPs.
        Default tags such as 'VirtualNetwork', 'AzureLoadBalancer' and 'Internet' can also be used.
        If this is an ingress rule, specifies where network traffic originates from.

    :param source_port_range:
        The source port or range. Integer or range between 0 and 65535. Asterix '*'
        can also be used to match all ports.

    :param destination_address_prefixes:
        A list of destination_address_prefix values. This parameter overrides destination_address_prefix
        and will cause any value entered there to be ignored.

    :param destination_port_ranges:
        A list of destination_port_range values. This parameter overrides destination_port_range
        and will cause any value entered there to be ignored.

    :param source_address_prefixes:
        A list of source_address_prefix values. This parameter overrides source_address_prefix
        and will cause any value entered there to be ignored.

    :param source_port_ranges:
        A list of source_port_range values. This parameter overrides source_port_range
        and will cause any value entered there to be ignored.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.

    Example usage:

    .. code-block:: yaml

        Ensure security rule exists:
            azurearm_network.security_rule_present:
                - name: nsg1_rule2
                - security_group: nsg1
                - resource_group: group1
                - priority: 101
                - protocol: tcp
                - access: allow
                - direction: inbound
                - source_address_prefix: internet
                - destination_address_prefix: virtualnetwork
                - source_port_range: '*'
                - destination_port_ranges:
                  - '80'
                  - '443'
                - connection_auth: {{ profile }}
                - require:
                  - azurearm_network: Ensure network security group exists

    RRR	R
RsHConnection information must be specified via connection_auth dictionary!tsource_port_rangestsource_port_rangetsource_address_prefixestsource_address_prefixtdestination_port_rangestdestination_port_rangetdestination_address_prefixestdestination_address_prefixiis1Either the {0} or {1} parameter must be provided!s!The {0} parameter must be a list!s
{0} = NoneNs"azurearm_network.security_rule_getRR
RtaccessRRtdescriptiont	directiontprioritytprotocols%Security rule {0} is already present.Rs#Security rule {0} would be updated.s#Security rule {0} would be created.s/azurearm_network.security_rule_create_or_updateR8Rs#Security rule {0} has been created.s)Failed to create security rule {0}! ({1})(ssource_port_rangesssource_port_range(ssource_address_prefixesssource_address_prefix(sdestination_port_rangessdestination_port_range(sdestination_address_prefixessdestination_address_prefix(RRRtevalR!tlistRt
capitalizeRtinttlowertsortedtlent	six_rangeR R"R#R$R%(RRMRORPRQR8RRLRJRHRFRNRKRIRGRER&R'R(texclusive_paramstparamstruletlocal_dst_addrstremote_dst_addrstidxtlocal_src_addrstremote_src_addrstrule_kwargs((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytsecurity_rule_present�s2`

	
"	$******	 **	 







	
cC@s=i|d6td6dd6id6}t|t�s?d|d<|Std|||dd	|�}d
|kr�t|d<dj|�|d<|Stdr�d
j|�|d<d|d<i|d6id6|d<|Std||||�}|r&t|d<dj|�|d<i|d6id6|d<|Sdj|�|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a security rule does not exist in the network security group.

    :param name:
        Name of the security rule.

    :param security_group:
        The network security group containing the security rule.

    :param resource_group:
        The resource group assigned to the network security group.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.
    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s"azurearm_network.security_rule_getRR
Rs Security rule {0} was not found.Rs#Security rule {0} would be deleted.RRs%azurearm_network.security_rule_deletes#Security rule {0} has been deleted.s#Failed to delete security rule {0}!N(RRRRR R!R"R#(RR8RR&R(R\R/((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytsecurity_rule_absentsF

	



cK@s�i|d6td6dd6id6}
t|t�s?d|
d<|
S|r[i|j�d6}ntd||dd	|�}d
|kr�td|jdi�|
p�i�}|r�||
dd<n|r�td|jd
i�|�}|r�||
dd
<q�n|r}td|jdg�|ddg�}|jd�rVdj|d�|
d<|
S|jd�r}|d|
dd<q}n|r�td|jdg�|�}|jd�r�dj|d�|
d<|
S|jd�r�|d|
dd<q�n|ritd|jdg�|�}|jd�rBdj|d�|
d<|
S|jd�ri|d|
dd<qin|r�td|jdg�|dddg�}|jd�r�dj|d�|
d<|
S|jd�r�|d|
dd<q�n|rgtd|jdg�|dg�}|jd�r@dj|d�|
d<|
S|jd�rg|d|
dd<qgn|r�td|jdg�|dg�}|jd�r�dj|d�|
d<|
S|jd�r�|d|
dd<q�n|	r_td|jd g�|	dg�}|jd�r8d!j|d�|
d<|
S|jd�r_|d|
dd <q_n|
ds�t|
d<d"j|�|
d<|
St	d#rd,|
d<d$j|�|
d<|
Sn^iid%6i
|d6|d
6|
d6|d6|d6|d6|d6|d6|d6|	d 6d&6|
d<t	d#rAd'j|�|
d<d,|
d<|
S|j�}|j|�td(d|d)|d
|d|
d|d|d|d|d|d|d |	|�}d
|kr�t|
d<d*j|�|
d<|
Sd+j||jd
��|
d<|
S(-s�(
    .. versionadded:: 2019.2.0

    Ensure a load balancer exists.

    :param name:
        Name of the load balancer.

    :param resource_group:
        The resource group assigned to the load balancer.

    :param sku:
        The load balancer SKU, which can be 'Basic' or 'Standard'.

    :param tags:
        A dictionary of strings can be passed as tag metadata to the load balancer object.

    :param frontend_ip_configurations:
        An optional list of dictionaries representing valid FrontendIPConfiguration objects. A frontend IP
        configuration can be either private (using private IP address and subnet parameters) or public (using a
        reference to a public IP address object). Valid parameters are:

        - ``name``: The name of the resource that is unique within a resource group.
        - ``private_ip_address``: The private IP address of the IP configuration. Required if
          'private_ip_allocation_method' is 'Static'.
        - ``private_ip_allocation_method``: The Private IP allocation method. Possible values are: 'Static' and
          'Dynamic'.
        - ``subnet``: Name of an existing subnet inside of which the frontend IP will reside.
        - ``public_ip_address``: Name of an existing public IP address which will be assigned to the frontend IP object.

    :param backend_address_pools:
        An optional list of dictionaries representing valid BackendAddressPool objects. Only the 'name' parameter is
        valid for a BackendAddressPool dictionary. All other parameters are read-only references from other objects
        linking to the backend address pool. Inbound traffic is randomly load balanced across IPs in the backend IPs.

    :param probes:
        An optional list of dictionaries representing valid Probe objects. Valid parameters are:

        - ``name``: The name of the resource that is unique within a resource group.
        - ``protocol``: The protocol of the endpoint. Possible values are 'Http' or 'Tcp'. If 'Tcp' is specified, a
          received ACK is required for the probe to be successful. If 'Http' is specified, a 200 OK response from the
          specified URI is required for the probe to be successful.
        - ``port``: The port for communicating the probe. Possible values range from 1 to 65535, inclusive.
        - ``interval_in_seconds``: The interval, in seconds, for how frequently to probe the endpoint for health status.
          Typically, the interval is slightly less than half the allocated timeout period (in seconds) which allows two
          full probes before taking the instance out of rotation. The default value is 15, the minimum value is 5.
        - ``number_of_probes``: The number of probes where if no response, will result in stopping further traffic from
          being delivered to the endpoint. This values allows endpoints to be taken out of rotation faster or slower
          than the typical times used in Azure.
        - ``request_path``: The URI used for requesting health status from the VM. Path is required if a protocol is
          set to 'Http'. Otherwise, it is not allowed. There is no default value.

    :param load_balancing_rules:
        An optional list of dictionaries representing valid LoadBalancingRule objects. Valid parameters are:

        - ``name``: The name of the resource that is unique within a resource group.
        - ``load_distribution``: The load distribution policy for this rule. Possible values are 'Default', 'SourceIP',
          and 'SourceIPProtocol'.
        - ``frontend_port``: The port for the external endpoint. Port numbers for each rule must be unique within the
          Load Balancer. Acceptable values are between 0 and 65534. Note that value 0 enables 'Any Port'.
        - ``backend_port``: The port used for internal connections on the endpoint. Acceptable values are between 0 and
          65535. Note that value 0 enables 'Any Port'.
        - ``idle_timeout_in_minutes``: The timeout for the TCP idle connection. The value can be set between 4 and 30
          minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.
        - ``enable_floating_ip``: Configures a virtual machine's endpoint for the floating IP capability required
          to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn
          Availability Groups in SQL server. This setting can't be changed after you create the endpoint.
        - ``disable_outbound_snat``: Configures SNAT for the VMs in the backend pool to use the public IP address
          specified in the frontend of the load balancing rule.
        - ``frontend_ip_configuration``: Name of the frontend IP configuration object used by the load balancing rule
          object.
        - ``backend_address_pool``: Name of the backend address pool object used by the load balancing rule object.
          Inbound traffic is randomly load balanced across IPs in the backend IPs.
        - ``probe``: Name of the probe object used by the load balancing rule object.

    :param inbound_nat_rules:
        An optional list of dictionaries representing valid InboundNatRule objects. Defining inbound NAT rules on your
        load balancer is mutually exclusive with defining an inbound NAT pool. Inbound NAT pools are referenced from
        virtual machine scale sets. NICs that are associated with individual virtual machines cannot reference an
        Inbound NAT pool. They have to reference individual inbound NAT rules. Valid parameters are:

        - ``name``: The name of the resource that is unique within a resource group.
        - ``frontend_ip_configuration``: Name of the frontend IP configuration object used by the inbound NAT rule
          object.
        - ``protocol``: Possible values include 'Udp', 'Tcp', or 'All'.
        - ``frontend_port``: The port for the external endpoint. Port numbers for each rule must be unique within the
          Load Balancer. Acceptable values range from 1 to 65534.
        - ``backend_port``: The port used for the internal endpoint. Acceptable values range from 1 to 65535.
        - ``idle_timeout_in_minutes``: The timeout for the TCP idle connection. The value can be set between 4 and 30
          minutes. The default value is 4 minutes. This element is only used when the protocol is set to TCP.
        - ``enable_floating_ip``: Configures a virtual machine's endpoint for the floating IP capability required
          to configure a SQL AlwaysOn Availability Group. This setting is required when using the SQL AlwaysOn
          Availability Groups in SQL server. This setting can't be changed after you create the endpoint.

    :param inbound_nat_pools:
        An optional list of dictionaries representing valid InboundNatPool objects. They define an external port range
        for inbound NAT to a single backend port on NICs associated with a load balancer. Inbound NAT rules are created
        automatically for each NIC associated with the Load Balancer using an external port from this range. Defining an
        Inbound NAT pool on your Load Balancer is mutually exclusive with defining inbound NAT rules. Inbound NAT pools
        are referenced from virtual machine scale sets. NICs that are associated with individual virtual machines cannot
        reference an inbound NAT pool. They have to reference individual inbound NAT rules. Valid parameters are:

        - ``name``: The name of the resource that is unique within a resource group.
        - ``frontend_ip_configuration``: Name of the frontend IP configuration object used by the inbound NAT pool
          object.
        - ``protocol``: Possible values include 'Udp', 'Tcp', or 'All'.
        - ``frontend_port_range_start``: The first port number in the range of external ports that will be used to
          provide Inbound NAT to NICs associated with a load balancer. Acceptable values range between 1 and 65534.
        - ``frontend_port_range_end``: The last port number in the range of external ports that will be used to
          provide Inbound NAT to NICs associated with a load balancer. Acceptable values range between 1 and 65535.
        - ``backend_port``: The port used for internal connections to the endpoint. Acceptable values are between 1 and
          65535.

    :param outbound_nat_rules:
        An optional list of dictionaries representing valid OutboundNatRule objects. Valid parameters are:

        - ``name``: The name of the resource that is unique within a resource group.
        - ``frontend_ip_configuration``: Name of the frontend IP configuration object used by the outbound NAT rule
          object.
        - ``backend_address_pool``: Name of the backend address pool object used by the outbound NAT rule object.
          Outbound traffic is randomly load balanced across IPs in the backend IPs.
        - ``allocated_outbound_ports``: The number of outbound ports to be used for NAT.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.

    Example usage:

    .. code-block:: yaml

        Ensure load balancer exists:
            azurearm_network.load_balancer_present:
                - name: lb1
                - resource_group: group1
                - location: eastus
                - frontend_ip_configurations:
                  - name: lb1_feip1
                    public_ip_address: pub_ip1
                - backend_address_pools:
                  - name: lb1_bepool1
                - probes:
                  - name: lb1_webprobe1
                    protocol: tcp
                    port: 80
                    interval_in_seconds: 5
                    number_of_probes: 2
                - load_balancing_rules:
                  - name: lb1_webprobe1
                    protocol: tcp
                    frontend_port: 80
                    backend_port: 80
                    idle_timeout_in_minutes: 4
                    frontend_ip_configuration: lb1_feip1
                    backend_address_pool: lb1_bepool1
                    probe: lb1_webprobe1
                - tags:
                    contact_name: Elmer Fudd Gantry
                - connection_auth: {{ profile }}
                - require:
                  - azurearm_resource: Ensure resource group exists
                  - azurearm_network: Ensure public IP exists

    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s"azurearm_network.load_balancer_getRR
Rsdictdiffer.deep_diffRtskusazurearm.compare_list_of_dictstfrontend_ip_configurationstpublic_ip_addresstsubnets "frontend_ip_configurations" {0}tbackend_address_poolss"backend_address_pools" {0}tprobess"probes" {0}tload_balancing_rulestfrontend_ip_configurationtbackend_address_pooltprobes"load_balancing_rules" {0}tinbound_nat_ruless"inbound_nat_rules" {0}tinbound_nat_poolss"inbound_nat_pools" {0}toutbound_nat_ruless"outbound_nat_rules" {0}s%Load balancer {0} is already present.Rs#Load balancer {0} would be updated.RRs#Load balancer {0} would be created.s/azurearm_network.load_balancer_create_or_updateRs#Load balancer {0} has been created.s)Failed to create load balancer {0}! ({1})N(
RRRRTRRRR!R R"R#R$R%(RRReRfRiRkRjRoRpRqRR&R'R(tload_balR*tsku_changesRAt	lb_kwargs((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytload_balancer_presentbs�

	%	







	
cC@s7i|d6td6dd6id6}t|t�s?d|d<|Std||dd	|�}d
|kr�t|d<dj|�|d<|Stdr�d
j|�|d<d|d<i|d6id6|d<|Std|||�}|r t|d<dj|�|d<i|d6id6|d<|Sdj|�|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a load balancer does not exist in the resource group.

    :param name:
        Name of the load balancer.

    :param resource_group:
        The resource group assigned to the load balancer.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.
    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s"azurearm_network.load_balancer_getRR
Rs Load balancer {0} was not found.Rs#Load balancer {0} would be deleted.RRs%azurearm_network.load_balancer_deletes#Load balancer {0} has been deleted.s#Failed to delete load balancer {0}!N(RRRRR R!R"R#(RRR&R(RrR/((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytload_balancer_absent�sD

	



c	K@s�i|d6td6dd6id6}
t|t�s?d|
d<|
S|r[i|j�d6}ntd||dd	|�}d
|kr�td|jdi�|p�i�}|r�||
dd<n|rDt|t�s�d
|
d<|
Sx_|D]T}
||
|jdi�j|
�kr�i|jd�d6|d6|
dd<Pq�q�Wn|r�td|jdi�|�}|r�||
dd<q�n|r�|j�|jd�kr�i|jd�d6|d6|
dd<q�n|r$|j�|jdd�j�kr$i|jd�d6|d6|
dd<q$n|rmt|�|jd�krmi|jd�d6|d6|
dd<n|
ds�t	|
d<dj
|�|
d<|
Stdrd|
d<dj
|�|
d<|
SnIiid6i|d6|d6|d6|d6|d6|d6|d6d6|
d<tdr:dj
|�|
d<d|
d<|
S|	j
�}|j|�tdd|d|d|d|d|d|d|d||�}d
|kr�t	|
d<dj
|�|
d<|
Sdj
||jd
��|
d<|
S(s{	
    .. versionadded:: 2019.2.0

    Ensure a public IP address exists.

    :param name:
        Name of the public IP address.

    :param resource_group:
        The resource group assigned to the public IP address.

    :param dns_settings:
        An optional dictionary representing a valid PublicIPAddressDnsSettings object. Parameters include
        'domain_name_label' and 'reverse_fqdn', which accept strings. The 'domain_name_label' parameter is concatenated
        with the regionalized DNS zone make up the fully qualified domain name associated with the public IP address.
        If a domain name label is specified, an A DNS record is created for the public IP in the Microsoft Azure DNS
        system. The 'reverse_fqdn' parameter is a user-visible, fully qualified domain name that resolves to this public
        IP address. If the reverse FQDN is specified, then a PTR DNS record is created pointing from the IP address in
        the in-addr.arpa domain to the reverse FQDN.

    :param sku:
        The public IP address SKU, which can be 'Basic' or 'Standard'.

    :param public_ip_allocation_method:
        The public IP allocation method. Possible values are: 'Static' and 'Dynamic'.

    :param public_ip_address_version:
        The public IP address version. Possible values are: 'IPv4' and 'IPv6'.

    :param idle_timeout_in_minutes:
        An integer representing the idle timeout of the public IP address.

    :param tags:
        A dictionary of strings can be passed as tag metadata to the public IP address object.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.

    Example usage:

    .. code-block:: yaml

        Ensure public IP exists:
            azurearm_network.public_ip_address_present:
                - name: pub_ip1
                - resource_group: group1
                - dns_settings:
                    domain_name_label: decisionlab-ext-test-label
                - sku: basic
                - public_ip_allocation_method: static
                - public_ip_address_version: ipv4
                - idle_timeout_in_minutes: 4
                - tags:
                    contact_name: Elmer Fudd Gantry
                - connection_auth: {{ profile }}
                - require:
                  - azurearm_resource: Ensure resource group exists

    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s&azurearm_network.public_ip_address_getRR
Rsdictdiffer.deep_diffRs.DNS settings must be provided as a dictionary!tdns_settingsRRRetpublic_ip_allocation_methodtpublic_ip_address_versiontidle_timeout_in_minutess)Public IP address {0} is already present.Rs'Public IP address {0} would be updated.s'Public IP address {0} would be created.s3azurearm_network.public_ip_address_create_or_updateRs'Public IP address {0} has been created.s-Failed to create public IP address {0}! ({1})N(RRRRTRRRRVRUR R!R"R#R$R%(RRRReRxRyRwRzR&R'R(tpub_ipR*tkeyRst
pub_ip_kwargs((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytpublic_ip_address_presents�?

	%

%$!







	
cC@s7i|d6td6dd6id6}t|t�s?d|d<|Std||dd	|�}d
|kr�t|d<dj|�|d<|Stdr�d
j|�|d<d|d<i|d6id6|d<|Std|||�}|r t|d<dj|�|d<i|d6id6|d<|Sdj|�|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a public IP address does not exist in the resource group.

    :param name:
        Name of the public IP address.

    :param resource_group:
        The resource group assigned to the public IP address.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.
    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s&azurearm_network.public_ip_address_getRR
Rs$Public IP address {0} was not found.Rs'Public IP address {0} would be deleted.RRs)azurearm_network.public_ip_address_deletes'Public IP address {0} has been deleted.s'Failed to delete public IP address {0}!N(RRRRR R!R"R#(RRR&R(R{R/((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytpublic_ip_address_absent�sD

	



c K@sHi|d6td6dd6id6}t|
t�s?d|d<|Std||dd	|
�}d
|kr�td|jdi�|p�i�}|r�||dd<n|	r�|	|jd
�kr�i|jd
�d6|	d6|dd
<n|
d(k	r5|
|jdt�kr5i|jd�d6|
d6|dd<q5n|d(k	r�||jd�kr�i|jd�d6|d6|dd<q�n|d(k	r�||jd�kr�i|jd�d6|d6|dd<q�nd(}|jd�r|ddjd�d}n|r1||kr1i|d6|d6|dd<nd(}|jd�rd|ddjd�d}n|r�||kr�i|d6|d6|dd<n|r)t|t�s�d|d<|Sxn|D]c}||j	�|jdi�j|d�j	�kr�i|jd�d6|d6|dd<Pq�q�Wntd|jdg�|ddg�}|jd�r{dj
|d�|d<|S|jd�r�|d|dd<n|ds�t|d<dj
|�|d<|Std rVd(|d<d!j
|�|d<|Sn^iid6i
|d6|d6|d6|d6|d6|d6|d6|	d
6|
d6|d6d6|d<td r�d"j
|�|d<d(|d<|S|j�}|j
|
�td#d|d|d$|d%|d|d|d|d|d
|	d|
d|d|d||�
}d
|kr%t|d<d&j
|�|d<|Sd'j
||jd
��|d<|S()s8
    .. versionadded:: 2019.2.0

    Ensure a network interface exists.

    :param name:
        Name of the network interface.

    :param ip_configurations:
        A list of dictionaries representing valid NetworkInterfaceIPConfiguration objects. The 'name' key is required at
        minimum. At least one IP Configuration must be present.

    :param subnet:
        Name of the existing subnet assigned to the network interface.

    :param virtual_network:
        Name of the existing virtual network containing the subnet.

    :param resource_group:
        The resource group assigned to the virtual network.

    :param tags:
        A dictionary of strings can be passed as tag metadata to the network interface object.

    :param network_security_group:
        The name of the existing network security group to assign to the network interface.

    :param virtual_machine:
        The name of the existing virtual machine to assign to the network interface.

    :param dns_settings:
        An optional dictionary representing a valid NetworkInterfaceDnsSettings object. Valid parameters are:

        - ``dns_servers``: List of DNS server IP addresses. Use 'AzureProvidedDNS' to switch to Azure provided DNS
          resolution. 'AzureProvidedDNS' value cannot be combined with other IPs, it must be the only value in
          dns_servers collection.
        - ``internal_dns_name_label``: Relative DNS name for this NIC used for internal communications between VMs in
          the same virtual network.
        - ``internal_fqdn``: Fully qualified DNS name supporting internal communications between VMs in the same virtual
          network.
        - ``internal_domain_name_suffix``: Even if internal_dns_name_label is not specified, a DNS entry is created for
          the primary NIC of the VM. This DNS name can be constructed by concatenating the VM name with the value of
          internal_domain_name_suffix.

    :param mac_address:
        Optional string containing the MAC address of the network interface.

    :param primary:
        Optional boolean allowing the interface to be set as the primary network interface on a virtual machine
        with multiple interfaces attached.

    :param enable_accelerated_networking:
        Optional boolean indicating whether accelerated networking should be enabled for the interface.

    :param enable_ip_forwarding:
        Optional boolean indicating whether IP forwarding should be enabled for the interface.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.

    Example usage:

    .. code-block:: yaml

        Ensure network interface exists:
            azurearm_network.network_interface_present:
                - name: iface1
                - subnet: vnet1_sn1
                - virtual_network: vnet1
                - resource_group: group1
                - ip_configurations:
                  - name: iface1_ipc1
                    public_ip_address: pub_ip2
                - dns_settings:
                    internal_dns_name_label: decisionlab-int-test-label
                - primary: True
                - enable_accelerated_networking: True
                - enable_ip_forwarding: False
                - network_security_group: nsg1
                - connection_auth: {{ profile }}
                - require:
                  - azurearm_network: Ensure subnet exists
                  - azurearm_network: Ensure network security group exists
                  - azurearm_network: Ensure another public IP exists

    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s&azurearm_network.network_interface_getRR
Rsdictdiffer.deep_diffRtmac_addressRRtprimarytenable_accelerated_networkingtenable_ip_forwardingR2R3R4i����tvirtual_machines.DNS settings must be provided as a dictionary!Rwsazurearm.compare_list_of_dictstip_configurationsRgRhs"ip_configurations" {0}s)Network interface {0} is already present.Rs'Network interface {0} would be updated.s'Network interface {0} would be created.s3azurearm_network.network_interface_create_or_updateR6Rs'Network interface {0} has been created.s-Failed to create network interface {0}! ({1})N(RRRRRRR#R R7RVR!R"R$R%(RR�RhR6RRR�R2RwR�R�R�R�R&R'R(tifaceR*R:tvm_nameR|RAtiface_kwargs((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytnetwork_interface_presents�[

	%

4







	
cC@s7i|d6td6dd6id6}t|t�s?d|d<|Std||dd	|�}d
|kr�t|d<dj|�|d<|Stdr�d
j|�|d<d|d<i|d6id6|d<|Std|||�}|r t|d<dj|�|d<i|d6id6|d<|Sdj|�|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a network interface does not exist in the resource group.

    :param name:
        Name of the network interface.

    :param resource_group:
        The resource group assigned to the network interface.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.
    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s&azurearm_network.network_interface_getRR
Rs$Network interface {0} was not found.Rs'Network interface {0} would be deleted.RRs)azurearm_network.network_interface_deletes'Network interface {0} has been deleted.s(Failed to delete network interface {0}!)N(RRRRR R!R"R#(RRR&R(R�R/((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytnetwork_interface_absentsD

	



cK@s�i|d6td6dd6id6}t|t�s?d|d<|Std||dd	|�}d
|kr�td|jdi�|p�i�}	|	r�|	|dd<n|r�||jd
�kr�i|jd
�d6|d6|dd
<n|r\td|jdg�|�}
|
jd�r5dj|
d�|d<|S|
jd�r\|
d|dd<q\n|ds�t|d<dj|�|d<|Stdr�d|d<dj|�|d<|Sn4iid6i|d6|d6|d6|d
6d6|d<tdrdj|�|d<d|d<|S|j
�}|j|�tdd|d|d
|d|d||�}d
|kr�t|d<dj|�|d<|Sdj||jd
��|d<|S(s
    .. versionadded:: 2019.2.0

    Ensure a route table exists.

    :param name:
        Name of the route table.

    :param resource_group:
        The resource group assigned to the route table.

    :param routes:
        An optional list of dictionaries representing valid Route objects contained within a route table. See the
        documentation for the route_present state or route_create_or_update execution module for more information on
        required and optional parameters for routes. The routes are only managed if this parameter is present. When this
        parameter is absent, implemented routes will not be removed, and will merely become unmanaged.

    :param disable_bgp_route_propagation:
        An optional boolean parameter setting whether to disable the routes learned by BGP on the route table.

    :param tags:
        A dictionary of strings can be passed as tag metadata to the route table object.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.

    Example usage:

    .. code-block:: yaml

        Ensure route table exists:
            azurearm_network.route_table_present:
                - name: rt1
                - resource_group: group1
                - routes:
                  - name: rt1_route1
                    address_prefix: '0.0.0.0/0'
                    next_hop_type: internet
                  - name: rt1_route2
                    address_prefix: '192.168.0.0/16'
                    next_hop_type: vnetlocal
                - tags:
                    contact_name: Elmer Fudd Gantry
                - connection_auth: {{ profile }}
                - require:
                  - azurearm_resource: Ensure resource group exists

    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s azurearm_network.route_table_getRR
Rsdictdiffer.deep_diffRtdisable_bgp_route_propagationRRsazurearm.compare_list_of_dictstroutess"routes" {0}s#Route table {0} is already present.Rs!Route table {0} would be updated.s!Route table {0} would be created.s-azurearm_network.route_table_create_or_updateRs!Route table {0} has been created.s'Failed to create route table {0}! ({1})N(RRRRRRR!R R"R#R$R%(RRRR�R�R&R'R(trt_tblR*RAt
rt_tbl_kwargs((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytroute_table_presentAs|3

	%







	
cC@s7i|d6td6dd6id6}t|t�s?d|d<|Std||dd	|�}d
|kr�t|d<dj|�|d<|Stdr�d
j|�|d<d|d<i|d6id6|d<|Std|||�}|r t|d<dj|�|d<i|d6id6|d<|Sdj|�|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a route table does not exist in the resource group.

    :param name:
        Name of the route table.

    :param resource_group:
        The resource group assigned to the route table.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.
    RRR	R
RsHConnection information must be specified via connection_auth dictionary!s azurearm_network.route_table_getRR
RsRoute table {0} was not found.Rs!Route table {0} would be deleted.RRs#azurearm_network.route_table_deletes!Route table {0} has been deleted.s!Failed to delete route table {0}!N(RRRRR R!R"R#(RRR&R(R�R/((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytroute_table_absent�sD

	



cK@s�i|d6td6dd6id6}t|t�s?d|d<|Std|||dd	|�}	d
|	kr�||	jd�kr�i|	jd�d6|d
6|dd<n|j�|	jdd�j�kr�i|	jd�d6|d
6|dd<n|j�dkrB||	jd�krBi|	jd�d6|d
6|dd<n|dsmt|d<dj|�|d<|Stdr�d|d<dj|�|d<|Sn4iid6i|d6|d6|d6|d6d
6|d<tdr�dj|�|d<d|d<|S|j
�}
|
j|�tdd|d|d|d|d|d||
�}	d
|	krtt|d<dj|�|d<|Sdj||	jd
��|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a route exists within a route table.

    :param name:
        Name of the route.

    :param address_prefix:
        The destination CIDR to which the route applies.

    :param next_hop_type:
        The type of Azure hop the packet should be sent to. Possible values are: 'VirtualNetworkGateway', 'VnetLocal',
        'Internet', 'VirtualAppliance', and 'None'.

    :param next_hop_ip_address:
        The IP address packets should be forwarded to. Next hop values are only allowed in routes where the next hop
        type is 'VirtualAppliance'.

    :param route_table:
        The name of the existing route table which will contain the route.

    :param resource_group:
        The resource group assigned to the route table.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.

    Example usage:

    .. code-block:: yaml

        Ensure route exists:
            azurearm_network.route_present:
                - name: rt1_route2
                - route_table: rt1
                - resource_group: group1
                - address_prefix: '192.168.0.0/16'
                - next_hop_type: vnetlocal
                - connection_auth: {{ profile }}
                - require:
                  - azurearm_network: Ensure route table exists

    RRR	R
RsHConnection information must be specified via connection_auth dictionary!sazurearm_network.route_getRR
RR1RRt
next_hop_typetvirtualappliancetnext_hop_ip_addresssRoute {0} is already present.RsRoute {0} would be updated.sRoute {0} would be created.s'azurearm_network.route_create_or_updateR5RsRoute {0} has been created.s!Failed to create route {0}! ({1})N(RRRRRRVR R!R"R#R$R%(RR1R�R5RR�R&R'R(troutetroute_kwargs((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pyt
route_present
	s|/

	$'







	
cC@s=i|d6td6dd6id6}t|t�s?d|d<|Std|||dd	|�}d
|kr�t|d<dj|�|d<|Stdr�d
j|�|d<d|d<i|d6id6|d<|Std||||�}|r&t|d<dj|�|d<i|d6id6|d<|Sdj|�|d<|S(s�
    .. versionadded:: 2019.2.0

    Ensure a route table does not exist in the resource group.

    :param name:
        Name of the route table.

    :param route_table:
        The name of the existing route table containing the route.

    :param resource_group:
        The resource group assigned to the route table.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.
    RRR	R
RsHConnection information must be specified via connection_auth dictionary!sazurearm_network.route_getRR
RsRoute {0} was not found.RsRoute {0} would be deleted.RRsazurearm_network.route_deletesRoute {0} has been deleted.sFailed to delete route {0}!N(RRRRR R!R"R#(RR5RR&R(R�R/((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pytroute_absent�	sF

	



( t__doc__t
__future__Rtloggingtsalt.ext.six.movesRRYtImportErrorRt	getLoggert__name__tlogRR#R.R0R=R>RCRDRcRdRuRvR~RR�R�R�R�R�R�(((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_network.pyt<module>XsT

	�@�C�@			�;C	�f?		�?	�?	�?�

Zerion Mini Shell 1.0