%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZddlmZmZddlZeZy6ddl	Z
ddlmZddl
mZeZWnek
r�nXdZeje�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zdd�Zd�Zd�Zddddddd�Z d�Z!d�Z"ddddddd�Z#d�Z$d�Z%dd�Z&dd�Z'd�Z(d�Z)d�Z*d �Z+d!�Z,d"�Z-d#�Z.d$�Z/d%�Z0d&�Z1ed'�Z2dS((sv
Azure (ARM) Resource Execution 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 keyword arguments
    to every function in order to work properly.

    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``

i(tabsolute_import(tloadstdumpsN(tSerializationError(t
CloudErrortazurearm_resourcecC@ststdfStS(Ns�The following dependencies are required to use the AzureARM modules: Microsoft Azure SDK for Python >= 2.0rc6, MS REST Azure (msrestazure) >= 0.4(tHAS_LIBStFalset__virtualname__(((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pyt__virtual__EscK@s�i}tdd|�}y<td|jj��}x|D]}|||d<q<WWn@tk
r�}tddt|�|�it|�d6}nX|S(s�
    .. versionadded:: 2019.2.0

    List all resource groups within a subscription.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.resource_groups_list

    sazurearm.get_clienttresourcesazurearm.paged_object_to_listtnamesazurearm.log_cloud_errorterror(t	__utils__tresource_groupstlistRtstr(tkwargstresulttresconntgroupstgrouptexc((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytresource_groups_listQs

cK@sct}tdd|�}y|jj|�}Wn-tk
r^}tddt|�|�nX|S(s'
    .. versionadded:: 2019.2.0

    Check for the existence of a named resource group in the current subscription.

    :param name: The resource group name to check.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.resource_group_check_existence testgroup

    sazurearm.get_clientR
sazurearm.log_cloud_error(RR
Rtcheck_existenceRR(RRRRR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytresource_group_check_existencelscK@s�i}tdd|�}y"|jj|�}|j�}Wn@tk
r}}tddt|�|�it|�d6}nX|S(s
    .. versionadded:: 2019.2.0

    Get a dictionary representing a resource group's properties.

    :param name: The resource group name to get.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.resource_group_get testgroup

    sazurearm.get_clientR
sazurearm.log_cloud_errorR(R
Rtgettas_dictRR(RRRRRR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytresource_group_get�scK@s�i}tdd|�}i|d6|jd�d6|jd�d6}y%|jj||�}|j�}Wn@tk
r�}tddt|�|�it|�d6}nX|S(s�
    .. versionadded:: 2019.2.0

    Create or update a resource group in a given location.

    :param name: The name of the resource group to create or update.

    :param location: The location of the resource group. This value
        is not able to be updated once the resource group is created.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.resource_group_create_or_update testgroup westus

    sazurearm.get_clientR
tlocationt
managed_byttagssazurearm.log_cloud_errorR(R
RRtcreate_or_updateRRR(RRRRRtresource_group_paramsRR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytresource_group_create_or_update�scK@sst}tdd|�}y&|jj|�}|j�t}Wn-tk
rn}tddt|�|�nX|S(s�
    .. versionadded:: 2019.2.0

    Delete a resource group from the subscription.

    :param name: The resource group name to delete.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.resource_group_delete testgroup

    sazurearm.get_clientR
sazurearm.log_cloud_error(RR
RtdeletetwaittTrueRR(RRRRRR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytresource_group_delete�s

cK@s�tdd|�}y1|jjd|d|d|�}|j�}Wn@tk
r�}tddt|�|�it|�d6}nX|S(s�
    .. versionadded:: 2019.2.0

    Get a deployment operation within a deployment.

    :param operation: The operation ID of the operation within the deployment.

    :param deployment: The name of the deployment containing the operation.

    :param resource_group: The resource group name assigned to the
        deployment.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployment_operation_get XXXXX testdeploy testgroup

    sazurearm.get_clientR
tresource_group_nametdeployment_nametoperation_idsazurearm.log_cloud_errorR(R
tdeployment_operationsRRRR(t	operationt
deploymenttresource_groupRRRR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytdeployment_operation_get�s	i
c	K@s�i}tdd|�}yNtd|jjd|d|d|��}x|D]}|||d<qNWWn@tk
r�}tddt|�|�it|�d	6}nX|S(
s�
    .. versionadded:: 2019.2.0

    List all deployment operations within a deployment.

    :param name: The name of the deployment to query.

    :param resource_group: The resource group name assigned to the
        deployment.

    :param result_limit: (Default: 10) The limit on the list of deployment
        operations.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployment_operations_list testdeploy testgroup

    sazurearm.get_clientR
sazurearm.paged_object_to_listR'R(ttopR)sazurearm.log_cloud_errorR(R
R*RRR(	RR-tresult_limitRRRt
operationstoperR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytdeployment_operations_lists
cK@s|t}tdd|�}y/|jjd|d|�}|j�t}Wn-tk
rw}tddt|�|�nX|S(sG
    .. versionadded:: 2019.2.0

    Delete a deployment.

    :param name: The name of the deployment to delete.

    :param resource_group: The resource group name assigned to the
        deployment.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployment_delete testdeploy testgroup

    sazurearm.get_clientR
R(R'sazurearm.log_cloud_error(RR
tdeploymentsR#R$R%RR(RR-RRRtdeployR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytdeployment_delete-s	

cK@slt}tdd|�}y|jjd|d|�}Wn-tk
rg}tddt|�|�nX|S(s_
    .. versionadded:: 2019.2.0

    Check the existence of a deployment.

    :param name: The name of the deployment to query.

    :param resource_group: The resource group name assigned to the
        deployment.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployment_check_existence testdeploy testgroup

    sazurearm.get_clientR
R(R'sazurearm.log_cloud_error(RR
R4RRR(RR-RRRR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytdeployment_check_existenceNs
tincrementaltnonecK@stdd|�}	i|d6}
i|d6|
d<|rD||
d<n-t|t�r`||
d<ni|d6|
d<|r�||
d	<n-t|t�r�||
d
<ni|d6|
d
<|j�}|j|
�ytddd|�}Wn0tk
r}
id
jt|
��d6}|SXyttd|d||�}d|krG|}nC|	j	j
d|d|d|�}|j�|j�}|j
�}Wnntk
r�}
tddt|
�|�it|
�d6}n/tk
r�}
idjt|
��d6}nX|S(s�
    .. versionadded:: 2019.2.0

    Deploys resources to a resource group.

    :param name: The name of the deployment to create or update.

    :param resource_group: The resource group name assigned to the
        deployment.

    :param deploy_mode: The mode that is used to deploy resources. This value can be either
        'incremental' or 'complete'. In Incremental mode, resources are deployed without deleting
        existing resources that are not included in the template. In Complete mode, resources
        are deployed and existing resources in the resource group that are not included in
        the template are deleted. Be careful when using Complete mode as you may
        unintentionally delete resources.

    :param debug_setting: The debug setting of the deployment. The permitted values are 'none',
        'requestContent', 'responseContent', or 'requestContent,responseContent'. By logging
        information about the request or response, you could potentially expose sensitive data
        that is retrieved through the deployment operations.

    :param deploy_params: JSON string containing name and value pairs that define the deployment
        parameters for the template. You use this element when you want to provide the parameter
        values directly in the request rather than link to an existing parameter file. Use either
        the parameters_link property or the deploy_params property, but not both.

    :param parameters_link: The URI of a parameters file. You use this element to link to an existing
        parameters file. Use either the parameters_link property or the deploy_params property, but not both.

    :param deploy_template: JSON string of template content. You use this element when you want to pass
        the template syntax directly in the request rather than link to an existing template. Use either
        the template_link property or the deploy_template property, but not both.

    :param template_link: The URI of the template. Use either the template_link property or the
        deploy_template property, but not both.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployment_create_or_update testdeploy testgroup

    sazurearm.get_clientR
tmodetdetail_levelt
debug_settingt
parameterstparameters_linkturittemplatet
template_linksazurearm.create_object_modeltDeploymentPropertiess*The object model could not be built. ({0})RRR-R(R't
propertiessazurearm.log_cloud_errors+The object model could not be parsed. ({0})(R
t
isinstancetdicttcopytupdatet	TypeErrortformatRtdeployment_validateR4R R$RRRR(RR-tdeploy_modeR<t
deploy_paramsR>tdeploy_templateRARRtprop_kwargst
deploy_kwargstdeploy_modelRRtvalidateR5t
deploy_result((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytdeployment_create_or_updatemsV0






			
 cK@s�tdd|�}y+|jjd|d|�}|j�}Wn@tk
r�}tddt|�|�it|�d6}nX|S(sW
    .. versionadded:: 2019.2.0

    Get details about a specific deployment.

    :param name: The name of the deployment to query.

    :param resource_group: The resource group name assigned to the
        deployment.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployment_get testdeploy testgroup

    sazurearm.get_clientR
R(R'sazurearm.log_cloud_errorR(R
R4RRRR(RR-RRR5RR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytdeployment_get�s	cK@s�tdd|�}y*|jjd|d|�itd6}WnGtk
r�}tddt|�|�it|�d6td6}nX|S(sk
    .. versionadded:: 2019.2.0

    Cancel a deployment if in 'Accepted' or 'Running' state.

    :param name: The name of the deployment to cancel.

    :param resource_group: The resource group name assigned to the
        deployment.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployment_cancel testdeploy testgroup

    sazurearm.get_clientR
R(R'Rsazurearm.log_cloud_errorR(R
R4tcancelR%RRR(RR-RRRR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytdeployment_cancel�s
cK@s�tdd|�}	i|d6}
i|d6|
d<|rD||
d<n-t|t�r`||
d<ni|d6|
d<|r�||
d	<n-t|t�r�||
d
<ni|d6|
d
<|j�}|j|
�ytddd|�}Wn0tk
r}
id
jt|
��d6}|SXyP|j�}|r9|d�n|	j	jd|d|d|�}|j
�}Wnntk
r�}
tddt|
�|�it|
�d6}n/tk
r�}
idjt|
��d6}nX|S(s�
    .. versionadded:: 2019.2.0

    Validates whether the specified template is syntactically correct
    and will be accepted by Azure Resource Manager.

    :param name: The name of the deployment to validate.

    :param resource_group: The resource group name assigned to the
        deployment.

    :param deploy_mode: The mode that is used to deploy resources. This value can be either
        'incremental' or 'complete'. In Incremental mode, resources are deployed without deleting
        existing resources that are not included in the template. In Complete mode, resources
        are deployed and existing resources in the resource group that are not included in
        the template are deleted. Be careful when using Complete mode as you may
        unintentionally delete resources.

    :param debug_setting: The debug setting of the deployment. The permitted values are 'none',
        'requestContent', 'responseContent', or 'requestContent,responseContent'. By logging
        information about the request or response, you could potentially expose sensitive data
        that is retrieved through the deployment operations.

    :param deploy_params: JSON string containing name and value pairs that define the deployment
        parameters for the template. You use this element when you want to provide the parameter
        values directly in the request rather than link to an existing parameter file. Use either
        the parameters_link property or the deploy_params property, but not both.

    :param parameters_link: The URI of a parameters file. You use this element to link to an existing
        parameters file. Use either the parameters_link property or the deploy_params property, but not both.

    :param deploy_template: JSON string of template content. You use this element when you want to pass
        the template syntax directly in the request rather than link to an existing template. Use either
        the template_link property or the deploy_template property, but not both.

    :param template_link: The URI of the template. Use either the template_link property or the
        deploy_template property, but not both.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployment_validate testdeploy testgroup

    sazurearm.get_clientR
R:R;R<R=R>R?R@RAsazurearm.create_object_modelRBs*The object model could not be built. ({0})RiR(R'RCsazurearm.log_cloud_errors+The object model could not be parsed. ({0})(
R
RDRERFRGRHRIRRQR4RRR(RR-RKR<RLR>RMRARRRNRORPRRtlocal_validationR5((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pyRJsL1







	 cK@s�tdd|�}y+|jjd|d|�}|j�}Wn@tk
r�}tddt|�|�it|�d6}nX|S(sr
    .. versionadded:: 2019.2.0

    Exports the template used for the specified deployment.

    :param name: The name of the deployment to query.

    :param resource_group: The resource group name assigned to the
        deployment.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployment_export_template testdeploy testgroup

    sazurearm.get_clientR
R(R'sazurearm.log_cloud_errorR(R
R4texport_templateRRR(RR-RRR5RR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytdeployment_export_template�s	cK@s�i}tdd|�}yBtd|jjd|��}x|D]}|||d<qBWWn@tk
r�}tddt|�|�it|�d6}nX|S(s�
    .. versionadded:: 2019.2.0

    List all deployments within a resource group.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.deployments_list testgroup

    sazurearm.get_clientR
sazurearm.paged_object_to_listR'Rsazurearm.log_cloud_errorR(R
R4tlist_by_resource_groupRR(R-RRRR4R5R((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytdeployments_list�s

cK@s�i}|s|jd�}n|jd�s:||d<ntdd|�}yFtd|jjd|d��}x|D]}|||d<qzWWn@tk
r�}tddt|�|�it|�d6}nX|S(	s

    .. versionadded:: 2019.2.0

    List all locations for a subscription.

    :param subscription_id: The ID of the subscription to query.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.subscriptions_list_locations XXXXXXXX

    tsubscription_idsazurearm.get_clienttsubscriptionsazurearm.paged_object_to_listRsazurearm.log_cloud_errorR
R(RR
t
subscriptionstlist_locationsRR(R\RRtsubconnt	locationstlocR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytsubscriptions_list_locations�s 

cK@s�i}|s|jd�}n|jd�s:||d<ntdd|�}y.|jjd|jd��}|j�}Wn@tk
r�}tddt|�|�it|�d6}nX|S(s�
    .. versionadded:: 2019.2.0

    Get details about a subscription.

    :param subscription_id: The ID of the subscription to query.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.subscription_get XXXXXXXX

    R\sazurearm.get_clientR]sazurearm.log_cloud_errorR
R(RR
R^RRR(R\RRR`R]R((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytsubscription_get�s
cK@s�i}tdd|�}y<td|jj��}x|D]}|||d<q<WWn@tk
r�}tddt|�|�it|�d6}nX|S(s�
    .. versionadded:: 2019.2.0

    List all subscriptions for a tenant.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.subscriptions_list

    sazurearm.get_clientR]sazurearm.paged_object_to_listR\sazurearm.log_cloud_errorR
R(R
R^RRR(RRR`tsubstsubR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytsubscriptions_list
s

cK@s�i}tdd|�}y<td|jj��}x|D]}|||d<q<WWn@tk
r�}tddt|�|�it|�d6}nX|S(s�
    .. versionadded:: 2019.2.0

    List all tenants for your account.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.tenants_list

    sazurearm.get_clientR]sazurearm.paged_object_to_listt	tenant_idsazurearm.log_cloud_errorR
R(R
ttenantsRRR(RRR`RittenantR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pyttenants_list(s

cK@srt}tdd|�}y%|jjd|d|�}t}Wn-tk
rm}tddt|�|�nX|S(so
    .. versionadded:: 2019.2.0

    Delete a policy assignment.

    :param name: The name of the policy assignment to delete.

    :param scope: The scope of the policy assignment.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.policy_assignment_delete testassign         /subscriptions/bc75htn-a0fhsi-349b-56gh-4fghti-f84852

    sazurearm.get_clienttpolicytpolicy_assignment_nametscopesazurearm.log_cloud_errorR
(RR
tpolicy_assignmentsR#R%RR(RRnRRtpolconnRlR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytpolicy_assignment_deleteCs	
cK@s�tdd|�}t|�}||kr8||}nidj|�d6}d|kr�t|d�}i|d6}|j�}	|	j|�ytddd	|	�}
Wn0tk
r�}id
jt|��d6}|SXy1|jjd|d|d
|
�}
|
j	�}Wq�t
k
rP}tddt|�|�it|�d6}q�tk
r~}idjt|��d6}q�Xnidj|�d6}|S(s�
    .. versionadded:: 2019.2.0

    Create a policy assignment.

    :param name: The name of the policy assignment to create.

    :param scope: The scope of the policy assignment.

    :param definition_name: The name of the policy definition to assign.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.policy_assignment_create testassign         /subscriptions/bc75htn-a0fhsi-349b-56gh-4fghti-f84852 testpolicy

    sazurearm.get_clientRls5The policy definition named "{0}" could not be found.Rtidtpolicy_definition_idsazurearm.create_object_modelsresource.policytPolicyAssignments*The object model could not be built. ({0})RnRmR=sazurearm.log_cloud_errorR
s+The object model could not be parsed. ({0})(R
tpolicy_definitions_listRIRRFRGRHRotcreateRRR(RRntdefinition_nameRRptdefinition_listt
definitiont
definition_idRNt
policy_kwargstpolicy_modelRRRl((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytpolicy_assignment_createds@
	



	#cK@s�tdd|�}y+|jjd|d|�}|j�}Wn@tk
r�}tddt|�|�it|�d6}nX|S(s
    .. versionadded:: 2019.2.0

    Get details about a specific policy assignment.

    :param name: The name of the policy assignment to query.

    :param scope: The scope of the policy assignment.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.policy_assignment_get testassign         /subscriptions/bc75htn-a0fhsi-349b-56gh-4fghti-f84852

    sazurearm.get_clientRlRmRnsazurearm.log_cloud_errorR
R(R
RoRRRR(RRnRRpRlRR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytpolicy_assignment_get�s	cK@s�i}tdd|�}yQtd|jjd|d|jd���}x|D]}|||d<qQWWn@tk
r�}tddt|�|�it|�d	6}nX|S(
s9
    .. versionadded:: 2019.2.0

    List all policy assignments for a resource group.

    :param resource_group: The resource group name to list policy assignments within.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.policy_assignments_list_for_resource_group testgroup

    sazurearm.get_clientRlsazurearm.paged_object_to_listR'tfilterRsazurearm.log_cloud_errorR
R(R
Rotlist_for_resource_groupRRR(R-RRRpt
policy_assigntassignR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pyt*policy_assignments_list_for_resource_group�s
cK@s�i}tdd|�}y<td|jj��}x|D]}|||d<q<WWn@tk
r�}tddt|�|�it|�d6}nX|S(s�
    .. versionadded:: 2019.2.0

    List all policy assignments for a subscription.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.policy_assignments_list

    sazurearm.get_clientRlsazurearm.paged_object_to_listRsazurearm.log_cloud_errorR
R(R
RoRRR(RRRpR�R�R((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytpolicy_assignments_list�s

c
K@sRt|t�s idd6}|Stdd|�}itt|��d6}|j�}|j|�ytddd|�}Wn0tk
r�}id	jt	|��d6}|SXy+|j
jd
|d|�}	|	j�}Wnnt
k
r}tdd
t	|�|�it	|�d6}n/tk
rM}idjt	|��d6}nX|S(s�
    .. versionadded:: 2019.2.0

    Create or update a policy definition.

    :param name: The name of the policy definition to create or update.

    :param policy_rule: A dictionary defining the
        `policy rule <https://docs.microsoft.com/en-us/azure/azure-policy/policy-definition#policy-rule>`_.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.policy_definition_create_or_update testpolicy '{...rule definition..}'

    s%The policy rule must be a dictionary!Rsazurearm.get_clientRltpolicy_rulesazurearm.create_object_modelsresource.policytPolicyDefinitions*The object model could not be built. ({0})tpolicy_definition_nameR=sazurearm.log_cloud_errorR
s+The object model could not be parsed. ({0})(RDRER
RRRFRGRHRIRtpolicy_definitionsR RRR(
RR�RRRpRNR{R|RRl((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pyt"policy_definition_create_or_updates4


	 cK@slt}tdd|�}y|jjd|�}t}Wn-tk
rg}tddt|�|�nX|S(s�
    .. versionadded:: 2019.2.0

    Delete a policy definition.

    :param name: The name of the policy definition to delete.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.policy_definition_delete testpolicy

    sazurearm.get_clientRlR�sazurearm.log_cloud_errorR
(RR
R�R#R%RR(RRRRpRlR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytpolicy_definition_deleteFs	
cK@stdd|�}y%|jjd|�}|j�}Wn@tk
rz}tddt|�|�it|�d6}nX|S(s

    .. versionadded:: 2019.2.0

    Get details about a specific policy definition.

    :param name: The name of the policy definition to query.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.policy_definition_get testpolicy

    sazurearm.get_clientRlR�sazurearm.log_cloud_errorR
R(R
R�RRRR(RRRpt
policy_defRR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pytpolicy_definition_getcs	cK@s�i}tdd|�}yUtd|jj��}x5|D]-}|oU|ddks<|||d<q<q<WWn@tk
r�}tddt|�|�it|�d	6}nX|S(
s'
    .. versionadded:: 2019.2.0

    List all policy definitions for a subscription.

    :param hide_builtin: Boolean which will filter out BuiltIn policy definitions from the result.

    CLI Example:

    .. code-block:: bash

        salt-call azurearm_resource.policy_definitions_list

    sazurearm.get_clientRlsazurearm.paged_object_to_listtpolicy_typetBuiltInRsazurearm.log_cloud_errorR
R(R
R�RRR(thide_builtinRRRptpolicy_defsRlR((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pyRus
(3t__doc__t
__future__RtjsonRRtloggingRRt$azure.mgmt.resource.resources.modelstazuretmsrest.exceptionsRtmsrestazure.azure_exceptionsRR%tImportErrorRt	getLoggert__name__tlogR	RRRR"R&R.R3R6R7tNoneRSRTRVRJRYR[RcRdRgRkRqR}R~R�R�R�R�R�Ru(((sB/usr/lib/python2.7/site-packages/salt/modules/azurearm_resource.pyt<module>/s`

					#		$)	!	i	 	#d	 	'$			!	N	 	"		7		

Zerion Mini Shell 1.0