%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/cloud/clouds/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyo

�
���^c@@sudZddlmZmZmZddlZddlZddlZddlZddl	j
Z
ddlmZddl
ZddlZddlZddlmZeZyfddlZddlZddlZddlmZmZmZddlZddlmZeZWnek
r$nXdZ ej!e"�Z#d	�Z$d
�Z%d�Z&d�Z'd
�Z(e)e)d�Z*e)e)d�Z+e)d�Z,e)e)d�Z-e)e)d�Z.e)e)d�Z/e)e)d�Z0e)d�Z1d�Z2e)ed�Z3e)ed�Z3d�Z4e)e)e)d�Z5e)e)d�Z6e)e)e)d�Z7e)e)e)d�Z8e)e)e)d�Z9e9Z:e)e)e)d�Z;e;Z<e)e)e)d �Z=e)e)e)d!�Z>e)e)e)d"�Z?e)e)e)d#�Z@e)e)e)d$�ZAe)e)e)d%�ZBe)e)e)d&�ZCe)e)e)d'�ZDe)e)e)d(�ZEe)e)e)d)�ZFeFZGe)e)e)d*�ZHe)e)e)d+�ZIe)e)e)d,�ZJe)e)e)d-�ZKe)e)e)d.�ZLeLZMe)e)e)d/�ZNe)e)e)d0�ZOe)e)e)d1�ZPe)e)e)d2�ZQeQZRe)e)e)d3�ZSe)e)e)d4�ZTe)e)e)d5�ZUe)e)e)d6�ZVe)e)e)d7�ZWeWZXe)e)e)d8d9�ZYe)e)e)d:�ZZe)e)e)d;�Z[e)e)e)d<�Z\e\Z]e)e)e)d=�Z^e)e)e)d>�Z_e_Z`e)e)e)d?�Zae)e)e)d@�Zbe)e)e)dA�Zce)e)e)dB�Zde)e)e)dC�Zee)e)e)dD�Zfe)e)e)dE�Zge)e)e)dF�ZhehZie)e)e)dG�ZjejZke)e)e)dH�Zle)e)e)dI�ZmemZne)e)e)dJ�Zoe)e)e)dK�Zpe)e)e)dL�Zqe)e)e)dM�Zre)e)e)dN�ZsesZte)e)e)dO�Zue)e)e)dP�ZvevZwe)e)e)dQ�Zxe)e)e)dR�Zye)e)e)dS�ZzdTe)e)e)edU�Z{dS(Vut
Azure Cloud Module
==================

The Azure cloud module is used to control access to Microsoft Azure

:depends:
    * `Microsoft Azure SDK for Python <https://pypi.python.org/pypi/azure/1.0.2>`_ >= 1.0.2
    * python-requests, for Python < 2.7.9
:configuration:
    Required provider parameters:

    * ``apikey``
    * ``certificate_path``
    * ``subscription_id``
    * ``backend``

    A Management Certificate (.pem and .crt files) must be created and the .pem
    file placed on the same machine that salt-cloud is run from. Information on
    creating the pem file to use, and uploading the associated cer file can be
    found at:

    http://www.windowsazure.com/en-us/develop/python/how-to-guides/service-management/

    For users with Python < 2.7.9, ``backend`` must currently be set to ``requests``.

Example ``/etc/salt/cloud.providers`` or
``/etc/salt/cloud.providers.d/azure.conf`` configuration:

.. code-block:: yaml

    my-azure-config:
      driver: azure
      subscription_id: 3287abc8-f98a-c678-3bde-326766fd3617
      certificate_path: /etc/salt/azure.pem
      management_host: management.core.windows.net
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltCloudSystemExit(tsix(tAzureConflictHttpErrortAzureMissingResourceHttpErrortAzureException(tobject_to_dictuazurecC@s*t�tkrtSt�tkr&tStS(u)
    Check for Azure configurations.
    (tget_configured_providertFalsetget_dependenciest__virtualname__(((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyt__virtual__Os
cC@stjttptd�S(u/
    Return the first configured instance.
    usubscription_iducertificate_path(usubscription_iducertificate_path(tconfigtis_provider_configuredt__opts__t__active_provider_name__R(((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR	\s	cC@stjtitd6�S(u*
    Warn if dependencies aren't met.
    uazure(Rtcheck_driver_dependenciesRtHAS_LIBS(((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyRgscC@s�tjdt�tdt�}tjjjtjdt�tdt��}tjdt�tdtdd�}t	j
j|||�S(u5
    Return a conn object for the passed VM data
    ucertificate_patht
search_globalusubscription_idumanagement_hosttdefaultumanagement.core.windows.net(Rtget_cloud_config_valueR	RR
tsalttutilststringutilstto_strtazuretservicemanagementtServiceManagementService(tcertificate_pathtsubscription_idtmanagement_host((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytget_connqs		cC@sLtjjjtjd|t�|ttjjjtjjjt|���S(u-
    Return the script deployment object
    uscript(	RRtcloudt	os_scriptRRRtsalt_config_to_yamlt
minion_config(tvm_((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytscript�scC@s|dkrtd��n|s-t�}ni}|j�}x9|D]1}i|jd6|jd6|jd6||j<qFW|S(u,
    List available locations for Azure
    uactionufThe avail_locations function must be called with -f or --function, or with the --list-locations optionunameudisplay_nameuavailable_services(RR!tlist_locationstnametdisplay_nametavailable_services(tconntcalltrett	locationstlocation((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytavail_locations�s


cC@s�|dkrtd��n|s-t�}ni}x'|j�D]}t|�||j<q@Wx'|j�D]}t|�||j<qjW|S(u)
    List available images for Azure
    uactionu`The avail_images function must be called with -f or --function, or with the --list-images option(RR!tlist_os_imagesRR)tlist_vm_images(R,R-R.titem((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytavail_images�scC@sa|dkrtd��nt�}|j�}i}x$|jD]}t|�||j<q@W|S(u+
    Return a list of sizes from Azure
    uactionu^The avail_sizes function must be called with -f or --function, or with the --list-sizes option(RR!tlist_role_sizest
role_sizesRR)(R-R,tdataR.R4((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytavail_sizes�s	cC@s�|dkrtd��ni}t||�}xK|D]C}i|d6||<x)d
D]!}||j|�|||<qUWq7W|S(u(
    List VMs on this Azure account
    uactionu=The list_nodes function must be called with -f or --function.unameuiduimageusizeustateuprivate_ipsu
public_ips(uiduimageusizeustateuprivate_ipsu
public_ips(Rtlist_nodes_fulltget(R,R-R.tnodestnodetprop((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyt
list_nodes�s

#cC@s*|dkrtd��n|s-t�}ni}td|d|�}x�|D]�}x�||dD]�}||d|}tj|�}|d=|d=|d}xx|D]p}	|d}
||	||	<||	j|
|	�|	||	d<|||	d	<|
|	d
dkrd||	d
<n3|
|	d
dkrCd||	d
<nd||	d
<g||	d<g||	d<|||	d<|d||	d<|
|	d}|r�tjjj	|�r�||	dj
|�q�||	dj
|�n|
|	d||	d<||	ddd||	d<q�WqdWqOW|S(u?
    List VMs on this Azure account, with full information
    uactionuBThe list_nodes_full function must be called with -f or --function.R,R-udeploymentsu	role_listurole_instance_listuiduhosted_serviceupower_stateuStartedurunningustateuStoppedustoppedupendinguprivate_ipsu
public_ipsu
deploymentuurlu
ip_addressu
instance_sizeusizeu	role_infouos_virtual_hard_diskusource_image_nameuimage(RR!tlist_hosted_servicestcopytdeepcopytupdateRRR"tis_public_iptappend(R,R-R.tservicestservicet
deploymenttdeploy_dicttdeploy_dict_no_role_infotrolestroletrole_instancest
ip_address((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR:�sJ



*c
C@s�|dkrtd��n|s-t�}ni}|j�}x�|D]�}|j}i|jd6|jd6|jd6|jd6|jd6|j	d6|j
d	6|jd
6|jd6|j
d6id
6||j<|jd|jdt�}x�|jD]�}i|jd6|jd6|jd6|j
d	6|jd6|jd
6|jd6|jd6|jd6|jd6|jd6id6id6|jd6|jd6|j
d6|jd6|jd6|jd6||jd
|j<x�|jD]�}i|jd6|j d6|j!d 6|j"d!6|j#d"6|j$d#6|j%d$6|j&d%6|j'd&6|j(d'6|j)d(6||jd
|jd|j)<q�WxU|j*D]J}	i|	j)d(6|	j+d)6||jd
|jd|	j)<|j,d|jd*|jd+|	j)�}
i|
j-d,6|
j.d-6|
j/d.6|
j+d)6|
j)d(6|
j0d/6|
j1d06||jd
|jd|	j)d1<i|
j2j3d26|
j2j4d36|
j2j5d46|
j2j6d56|
j2j7d66|
j2j8d76||jd
|jd|	j)d1d8<qwWq�WqFW|S(9u?
    List VMs on this Azure account, with full information
    uactionuFThe list_hosted_services function must be called with -f or --functionunameuurluaffinity_groupudate_createdudate_last_modifiedudescriptionuextended_propertiesulabelulocationustatusudeploymentstservice_nametembed_detailu
configurationucreated_timeudeployment_slotuinput_endpoint_listulast_modified_timeulockedupersistent_vm_downtime_infou
private_idurole_instance_listu	role_listurollback_allowedusdk_versionuupgrade_domain_countuupgrade_statusufqdnuinstance_error_codeuinstance_fault_domainu
instance_nameu
instance_sizeuinstance_state_detailsuinstance_statusuinstance_upgrade_domainu
ip_addressupower_stateu	role_nameu
os_versiontdeployment_namet	role_nameuavailability_set_nameuconfiguration_setsudata_virtual_hard_disksu	role_sizeu	role_typeu	role_infou
disk_labelu	disk_nameuhost_cachingu
media_linkuosusource_image_nameuos_virtual_hard_disk(9RR!R@thosted_service_propertiesROturltaffinity_grouptdate_createdtdate_last_modifiedtdescriptiontextended_propertiestlabelR0tstatustget_hosted_service_propertiestTruetdeploymentst
configurationtcreated_timetdeployment_slottinput_endpoint_listtlast_modified_timetlockedR)tpersistent_vm_downtime_infot
private_idtrollback_allowedtsdk_versiontupgrade_domain_counttupgrade_statustrole_instance_listtfqdntinstance_error_codetinstance_fault_domaint
instance_namet
instance_sizetinstance_state_detailstinstance_statustinstance_upgrade_domainRNtpower_stateRRt	role_listt
os_versiontget_roletavailability_set_nametconfiguration_setstdata_virtual_hard_diskst	role_sizet	role_typetos_virtual_hard_diskt
disk_labelt	disk_namethost_cachingt
media_linktostsource_image_name(R,R-R.RFRGtpropsR^RHt
role_instanceRLt	role_info((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR@s�
	









	

























.
*			





.




AcC@s8|st�}ntjjjt|d�td|�S(uO
    Return a list of the VMs that are on the provider, with select fields
    ufunctionuquery.selection(R!RRR"tlist_nodes_selectR:R(R,R-((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR�}scC@s�|dkrtd��nt�}||kr4iSd||kr]||d||d<nytd||tt�Wntk
r�tjd�nX||S(uC
    Show the details from the provider concerning an instance
    uactionu<The show_instance action must be called with -a or --action.unameuiducloud.cache_nodeuMUnable to show cache node data; this may be because the node has been deleted(RR:t	__utils__RRt	TypeErrortlogtwarning(R)R-R<((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyt
show_instance�s	
c@s.y=�dr<tjttpd�dd��tkr<tSWntk
rPnXtddddj�d�d	td
d�dddd
g�dtddtd�tj	d�d�t
���jd�d�}�jd�d��i�d6|d6�jd�d�d6}t}d�krTd�krCt}qw�d|d<n#d�krq�d|d<nt}|r�t
d��ntjd�tdddt�}tjjddd d!d"|d#d�}tjj�}|jjj|�d$|_d%�kr�tjjd&�dd'�d%d(�d)�}d*}d+�krW�d+}ntjjdd,d d!d"|d#|�}	|jjj|	�dk|_dk|_n3tjjd-�dd.�d/d0�d1d2t�}�d3}
|
d4j�d�7}
tjj�d5|
�}i	�d6�d66�d7d86|d6�dd96|d:6|d;6�d<d=6|d>6}d?�kr��d?|d?<d@�kr�|jj�d@�q�ntjdA|�i|j�dB6|j�dC6}
|
dCd:=|
dCd;=|
dCd>=tdddDdEj�d�d	td
dF|
t|
��dtddtd�tjdA|�y�j |�Wn�t!k
r�tjdG�not"k
r�}dH}|t#j$|�kr�tj%dI�ddJt&j'�n tj%dK�d|dJt&j'�tSXy6�j(|�}tjdL|j)�t*�|j)�Wn�t!k
r�tjdM�|d8=|d=|d?=�j+|�}t*�|j)�not"k
r�}dH}|t#j$|�kr�tj%dN�ddJt&j'�n tj%dO�d|dJt&j'�tSX���fdP�}t,j-j.j/|dQtjdR�tddl��}|sKtj%dU�tS|j0dVdW�j0dXdW��dY<tjd1�t��dZ<td[�t�}tjd\�tdt�}|r�tddd]d^j�d�d	td
d_�d\g�dtddtd�tj	d`�d�t1�di|d\6�d6�dd66|
d36�dd96�jdat�db6dcdd�}||de<nt2�ddcdd�}tj	df��tjdg�dt3j4|��|j5|�tdddhdij�d�d	td
dj�dddd
g�dtddtd�|S(mu-
    Create a single VM from a data dict
    uprofileuazureR&ucloud.fire_eventueventustarting createusalt/cloud/{0}/creatingunametargsucloud.filter_eventucreatinguproviderudrivertsock_dirusock_dirt	transportu	transportuCreating Cloud VM %sulabeluservice_nameudescudescriptionulocationuaffinity_groupuCEither a location or affinity group must be specified, but not bothuportRiRR)uSSHtprotocoluTCPtportt
local_portuNetworkConfigurationuwin_usernamet
computer_nametadmin_usernametadmin_passworduwin_passwordu445usmb_portuSMBt	host_namet	user_nameussh_usernamet
user_passwordussh_passwordt#disable_ssh_password_authenticationu
media_linku/{0}.vhduimageudeployment_nameuslotudeployment_slotu	role_nameu
system_configuos_virtual_hard_diskusizeu	role_sizeunetwork_configuvirtual_network_nameusubnet_nameu
vm_kwargs: %suservice_kwargsu	vm_kwargsurequesting instanceusalt/cloud/{0}/requestingu
requestinguCloud service already existsu#The hosted service name is invalid.u�Error creating %s on Azure.

The hosted service name is invalid. The name can contain only letters, numbers, and hyphens. The name must start with a letter and must end with a letter or a number.texc_info_on_loglevelumError creating %s on Azure

The following exception was thrown when trying to run the initial deployment: 
%suRequest ID for machine: %suAConflict error. The deployment may already exist, trying add_roleu�Error creating %s on Azure.

The VM name is invalid. The name can contain only letters, numbers, and hyphens. The name must start with a letter and must end with a letter or a number.uJError creating %s on Azure.

The Virtual Machine could not be created. If you are using an already existing Cloud Service, make sure you set up the `port` variable corresponding to the SSH port exists and that the port number is not already in use.
The following exception was thrown when trying to run the initial deployment: 
%sc@s�y^�j���d�t�ddd�}d|kr]|dtjd�kr]|dSWntk
rqnXtjd�tS(u=
        Wait for the IP address to become available
        unameR-uactionuurlui(RwR�Rt	text_typeRttimetsleepR
(R8(R,ROR&(s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytwait_for_hostnamejs%

ttimeoutuwait_for_fun_timeoutii<u'Failed to get a value for the hostname.uhttp://uu/ussh_hostupassworducloud.bootstrapuvolumesuattaching volumesu salt/cloud/{0}/attaching_volumesuattaching_volumesu$Create and attach volumes to node %suset_del_all_vols_on_destroyudel_all_vols_on_destroyR-uactionuAttached VolumesuCreated Cloud VM '%s'u'%s' VM creation details:
%sucreated instanceusalt/cloud/{0}/createducreatedNi�(6Rtis_profile_configuredRRR
tAttributeErrorR�tformatR�tinfoR!R;R]RRRRtConfigurationSetInputEndpointtConfigurationSettinput_endpointsREtconfiguration_set_typetWindowsConfigurationSettNonetdomain_jointwin_rmtLinuxConfigurationSettOSVirtualHardDisktsubnet_namestdebugRAtlisttcreate_hosted_serviceRt	ExceptionRR�terrortloggingtDEBUGt!create_virtual_machine_deploymentt
request_idt_wait_for_asynctadd_roleRRR"twait_for_funtreplacetcreate_attach_volumesR�tpprinttpformatRC(R&RZtservice_kwargst	loc_errortssh_porttssh_endpointtnetwork_configt
system_configtsmb_porttsmb_endpointR�tos_hdt	vm_kwargstevent_kwargstexcR�tresultR�thostnameR.tvolumestcreatedR8((R,ROR&s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytcreate�sj	

"
				



		


	














"
	
 
"
c
C@s|dkrtd��n|dkr0i}nt|dtj�rbtjjj|d�}n
|d}t	�}g}x�|D]�}d|kr�t
jd�tS|j
d|jdd��|j
d	d
�|j
dd�|j
d
|d
d dj|d��|j
d|ddj|d��i|dd6|dd6}dd	d
ddddg}	x+t|j��t|	�D]
}
||
=q�W|j|d|d|d|�}t
j|�|rdj|d|d|�}t
j|�|j|�q�t
jd|�q�W|S(u3
    Create and attach volumes to created node
    uactionuDThe create_attach_volumes action must be called with -a or --action.uvolumesu	disk_nameu<You cannot specify a disk_name. Only new volumes are allowedulogical_disk_size_in_gbusizeiduhost_cachinguReadOnlyuluniu
media_linki����u
-disk-{0}.vhdu
disk_labelu	role_nameu	-disk-{0}uvolume_nameusource_media_linkuservice_nameudeployment_nameu{0} attached to {1} (aka {2})uError attaching %s on AzureN(RR�t
isinstanceRtstring_typesRRtyamlt	safe_loadR!R�R�R
t
setdefaultR;R�tsettkeyst
add_data_diskR�R�RE(
R)tkwargsR-twait_to_finishR�R,R.tvolumetvolume_dicttkwargs_add_data_disktkeytattachtmsg((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR��sT	
	

	 			#	
	
c
C@s|dkrtd��n|dkr0i}nt|dtj�rbtjjj|d�}n
|d}t	�}g}x�|D]}}d|kr�t
jd�tS|j
d|jdd��|j
d	d
�|j
dd�|j
d
|d
d dj|d��|j
d|ddj|d��i|dd6|dd6}dd	d
ddddg}	x+t|j��t|	�D]
}
||
=q�W|j|d|d|d|�}t||j�dj|d|d|�}t
j|�|j|�q�W|S(u3
    Create and attach volumes to created node
    uactionuDThe create_attach_volumes action must be called with -a or --action.uvolumesu	disk_nameu<You cannot specify a disk_name. Only new volumes are allowedulogical_disk_size_in_gbusizeiduhost_cachinguReadOnlyuluniu
media_linki����u
-disk-{0}.vhdu
disk_labelu	role_nameu	-disk-{0}uvolume_nameusource_media_linkuservice_nameudeployment_nameu{0} attached to {1} (aka {2})N(RR�R�RR�RRR�R�R!R�R�R
R�R;R�R�R�R�R�R�R�RE(
R)R�R-R�R�R,R.R�R�R�R�R�R�((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR�sT	
	

	 			#
		
cC@s�d}tjd�|j|�}xT|jdkrx|d}|dkrYtd��ntjd�|j|�}q%W|jdkr�td	jd
|j	j
d|j	j���ndS(
u)
    Helper function for azure tests
    iu.Waiting for asynchronous operation to completeu
InProgressiixu9Timed out waiting for asynchronous operation to complete.iu	Succeededu$Operation failed. {message} ({code})tmessagetcodeN(R�R�tget_operation_statusR[t
ValueErrorR�R�RR�R�R�R�(R,R�tcountR�((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR�qs


c
@s|dkrtd��n|s-t�}n|d&krBi}nt|dd�}|dd�|ddd	�i}y,tjd
�|j��|�}d}Wn{tk
r#tjd�y|j���}Wn>t	k
r}tj
|j�td
j||j���nXd}nXt
||j�ii|jd6|6||<tjdt�tkr�td|tjd�dt�ntjdt�tdtdt�}	|	r|jdtjdt�tdtdt���tjd���rtjd�n��fd�}
tjjj|
dtjditdd'��}i�d6�d6|d 6||d!<tjd"t�tdtdt�}|rtjd#���fd$�}
tjjj|
dtjditdd(��}i�d6|d 6||d%<qn|S()u�
    Destroy a VM

    CLI Examples:

    .. code-block:: bash

        salt-cloud -d myminion
        salt-cloud -a destroy myminion service_name=myservice
    ufunctionuEThe destroy action must be called with -d, --destroy, -a or --action.R-uactionu
deploymentunameu	role_infouos_virtual_hard_disku	disk_nameu
Deleting roleudelete_roleu*Failed to delete role, deleting deploymentu{0}: {1}udelete_deploymentu
request_iduupdate_cachedirucloud.delete_minion_cachediru:iu
cleanup_disksRRu
delete_vhducleanup_vhdsuDeleting disk %suDeleting vhdc@s]y+tdi�d6�d6dd�}|SWntk
rKtjd�nXtjd�tS(u7
            Wait for the VM to be deleted
            R�unameu
delete_vhdR-ufunctionu!Waiting for VM to be destroyed...i(tdelete_diskRR�R�R�R�R
(R8(tcleanup_vhdsR(s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytwait_for_destroy�s#

R�uwait_for_fun_timeoutii<udataudelete_diskucleanup_servicesuDeleting service %sc@sVy$tdi�d6dd�}|SWntk
rDtjd�nXtjd�tS(uA
                Wait for the disk to be deleted
                R�unameR-ufunctionu!Waiting for disk to be deleted...i(tdelete_serviceRR�R�R�R�R
(R8(RO(s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytwait_for_disk_delete�s

udelete_servicesNi�i�(RR!R�R�R�R�tdelete_roleRtdelete_deploymentRR�R�R�R�R�RR;R
R]R�RtsplitRRR	RRR"R�(R)R,R-R�t
instance_dataR.R�tdelete_typeR�t
cleanup_disksR�R8tcleanup_servicesR�((R�RROs=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytdestroy�sz	




$cC@s�|dkrtd��n|s-t�}ni}|j�}xZ|jD]O}i|jd6|jd6|jd6|jd6|jd6|j	d6||j<qIW|S(	u?
    List VMs on this Azure account, with full information
    ufunctionuHThe list_storage_services function must be called with -f or --function.ucapabilitiesuservice_nameustorage_service_propertiesuextended_propertiesustorage_service_keysuurl(
RR!tlist_storage_accountststorage_servicestcapabilitiesROtstorage_service_propertiesRYtstorage_service_keysRT(R,R-R.taccountsRG((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytlist_storage_services�s 




cC@s�|dkrtd��n|d
kr0i}nd|krKtd��n|s]t�}n|j|d�}i|jd6|dd6|jd6}t|jd�r�i|jjd6|jj	d6|d	<n|S(u�
    .. versionadded:: 2015.8.0

    Get Operation Status, based on a request ID

    CLI Example:

    .. code-block:: bash

        salt-cloud -f get_operation_status my-azure id=0123456789abcdef0123456789abcdef
    ufunctionu@The show_instance function must be called with -f or --function.uidu&A request ID must be specified as "id"uhttp_status_codeustatusucodeumessageuerrorN(
RR�R!R�thttp_status_codeR[thasattrR�R�R�(R�R,R-R8R.((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR�s&	


cC@s}|dkrtd��n|s-t�}n|j�}tjt|��i}x$|jD]}t|�||j<q\W|S(u�
    .. versionadded:: 2015.8.0

    List storage accounts associated with the account

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_storage my-azure
    ufunctionu?The list_storage function must be called with -f or --function.(RR!R�R�tdirR�RRO(R�R,R-R8R.R4((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytlist_storage?scC@sz|dkrtd��n|s-t�}n|dkrBi}nd|kr]td��n|j|d�}t|�S(u�
    .. versionadded:: 2015.8.0

    List storage service properties

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_storage my-azure name=my_storage
    ufunctionu?The show_storage function must be called with -f or --function.unameu"A name must be specified as "name"N(RR!R�tget_storage_account_propertiesR(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_storage[s	
cC@s�|dkrtd��n|s-t�}n|dkrBi}nd|kr]td��ny|j|d�}Wnutk
r�}tdi|dd6dd�}|ddd	kr�td
��q�tdj|d|j���nXt|�S(
u�
    .. versionadded:: 2015.8.0

    Show storage account keys

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_storage_keys my-azure name=my_storage
    ufunctionuDThe show_storage_keys function must be called with -f or --function.unameu"A name must be specified as "name"R�R-ustorage_service_propertiesustatusuCreatingu3The storage account keys have not yet been created.u{0}: {1}N(	RR!R�tget_storage_account_keysRR�R�R�R(R�R,R-R8R�tstorage_data((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_storage_keyss$	 #cC@sy|dkrtd��n|dkr0i}n|sBt�}nd|kr]td��nd|krxtd��nd|kr�td��nd	|kr�d
|kr�td��ny�|jd|dd
|dd|jdd�d|jd	d�d|jd
d�d|jdd�d|jdd�d|jdd��}idd6SWntk
rttd��nXdS(u�
    .. versionadded:: 2015.8.0

    Create a new storage account

    CLI Example:

    .. code-block:: bash

        salt-cloud -f create_storage my-azure name=my_storage label=my_storage location='West US'
    ufunctionu?The show_storage function must be called with -f or --function.unameu"A name must be specified as "name"udescriptionu0A description must be specified as "description"ulabelu$A label must be specified as "label"ulocationuaffinity_groupuGEither a location or an affinity_group must be specified (but not both)RORZRXR0RURYuextended_propertiestgeo_replication_enabledugeo_replication_enabledtaccount_typeuaccount_typeuStandard_GRSu,The storage account was successfully createduSuccessuQThere was a conflict. This usually means that the storage account already exists.N(RR�R!tcreate_storage_accountR;R(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytcreate_storage�s8		


cC@s�|dkrtd��n|s-t�}n|dkrBi}nd|kr]td��n|jd|dd|jdd�d|jd	d�d
|jdd�d|jd
d�d|jdd��}tdi|dd6dd�S(u�
    .. versionadded:: 2015.8.0

    Update a storage account's properties

    CLI Example:

    .. code-block:: bash

        salt-cloud -f update_storage my-azure name=my_storage label=my_storage
    ufunctionu?The show_storage function must be called with -f or --function.unameu"A name must be specified as "name"RORZulabelRXudescriptionRYuextended_propertiesRugeo_replication_enabledRuaccount_typeuStandard_GRSR�R-N(RR!R�tupdate_storage_accountR;R�(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytupdate_storage�s"		
cC@s�|dkrtd��n|s-t�}n|dkrBi}nd|kr]td��nd|ksy|ddkr�td��nyB|jd	|dd
|d�}tdi|dd6dd�SWntk
r�td
��nXdS(u
    .. versionadded:: 2015.8.0

    Regenerate storage account keys. Requires a key_type ("primary" or
    "secondary") to be specified.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f regenerate_storage_keys my-azure name=my_storage key_type=primary
    ufunctionu?The show_storage function must be called with -f or --function.unameu"A name must be specified as "name"ukey_typeuprimaryu	secondaryu7A key_type must be specified ("primary" or "secondary")ROtkey_typeR�R-uQThere was a conflict. This usually means that the storage account already exists.N(uprimaryu	secondary(RR!R�tregenerate_storage_account_keysRR(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytregenerate_storage_keyss$
		

"
cC@s�|dkrtd��n|dkr0i}nd|krKtd��n|s]t�}ny"|j|d�}idd6SWn2tk
r�}tdj|d|j���nXdS(	u�
    .. versionadded:: 2015.8.0

    Delete a specific storage account

    CLI Examples:

    .. code-block:: bash

        salt-cloud -f delete_storage my-azure name=my_storage
    ufunctionuAThe delete_storage function must be called with -f or --function.unameu"A name must be specified as "name"u,The storage account was successfully deleteduSuccessu{0}: {1}N(RR�R!tdelete_storage_accountRR�R�(R�R,R-R8R�((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytdelete_storage+s	cC@s~|dkrtd��n|s-t�}n|j�}i}x8|jD]-}t|�||j<|j||jd<qIW|S(u�
    .. versionadded:: 2015.8.0

    List hosted services associated with the account

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_services my-azure
    ufunctionu@The list_services function must be called with -f or --function.uname(RR!R@thosted_servicesRRO(R�R,R-R8R.R4((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyt
list_servicesLscC@s�|dkrtd��n|s-t�}n|dkrBi}nd|kr]td��n|j|d|jdt��}t|�}|S(u�
    .. versionadded:: 2015.8.0

    List hosted service properties

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_service my-azure name=my_service
    ufunctionu?The show_service function must be called with -f or --function.unameu"A name must be specified as "name"udetailsN(RR!R�R\R;R
R(R�R,R-R8R.((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_servicehs	c
C@s(|dkrtd��n|s-t�}n|dkrBi}nd|kr]td��nd|krxtd��nd|kr�d|kr�td	��nye|j|d|d|jd
d�|jdd�|jdd�|jdd��}idd
6SWntk
r#td��nXdS(u�
    .. versionadded:: 2015.8.0

    Create a new hosted service

    CLI Example:

    .. code-block:: bash

        salt-cloud -f create_service my-azure name=my_service label=my_service location='West US'
    ufunctionuAThe create_service function must be called with -f or --function.unameu"A name must be specified as "name"ulabelu$A label must be specified as "label"ulocationuaffinity_groupuGEither a location or an affinity_group must be specified (but not both)udescriptionuextended_propertiesu$The service was successfully createduSuccessuIThere was a conflict. This usually means that the service already exists.N(RR!R�R�R;R(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytcreate_service�s0	
cC@s�|dkrtd��n|dkr0i}nd|krKtd��n|s]t�}ny |j|d�idd6SWn2tk
r�}tdj|d|j���nXdS(	u�
    .. versionadded:: 2015.8.0

    Delete a specific service associated with the account

    CLI Examples:

    .. code-block:: bash

        salt-cloud -f delete_service my-azure name=my_service
    ufunctionuAThe delete_service function must be called with -f or --function.unameu"A name must be specified as "name"u$The service was successfully deleteduSuccessu{0}: {1}N(RR�R!tdelete_hosted_serviceRR�R�(R�R,R-R�((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR��s	cC@sj|dkrtd��n|s-t�}n|j�}i}x$|jD]}t|�||j<qIW|S(u�
    .. versionadded:: 2015.8.0

    List disks associated with the account

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_disks my-azure
    ufunctionu=The list_disks function must be called with -f or --function.(RR!t
list_diskstdisksRR)(R�R,R-R8R.R4((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR�scC@sz|dkrtd��n|s-t�}n|dkrBi}nd|kr]td��n|j|d�}t|�S(u�
    .. versionadded:: 2015.8.0

    Return information about a disk

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_disk my-azure name=my_disk
    ufunctionu;The get_disk function must be called with -f or --function.unameu"A name must be specified as "name"N(RR!R�tget_diskR(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyt	show_disk�s	cC@s�|dkrtd��n|d
kr0i}ntd|d|dd�}x}|D]u}||dd
krRi||dd6|jdt�d6}tjd	|d|d�td|dd�}qRqRWtS(u�
    .. versionadded:: 2015.8.0

    Cleans up all disks associated with the account, which are not attached.
    *** CAUTION *** This is a destructive function with no undo button, and no
    "Are you sure?" confirmation!

    CLI Examples:

    .. code-block:: bash

        salt-cloud -f cleanup_unattached_disks my-azure name=my_disk
        salt-cloud -f cleanup_unattached_disks my-azure name=my_disk delete_vhd=True
    ufunctionu>The delete_disk function must be called with -f or --function.R�R,R-uattached_tounameu
delete_vhdu"Deleting disk %s, deleting VHD: %sN(	RR�RR;R
R�R�R�R](R�R,R-Rtdiskt
del_kwargsR8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytcleanup_unattached_diskss 	
cC@s�|dkrtd��n|d	kr0i}nd|krKtd��n|s]t�}ny1|j|d|jdt��}idd6SWn2tk
r�}tdj|d|j���nXd	S(
u

    .. versionadded:: 2015.8.0

    Delete a specific disk associated with the account

    CLI Examples:

    .. code-block:: bash

        salt-cloud -f delete_disk my-azure name=my_disk
        salt-cloud -f delete_disk my-azure name=my_disk delete_vhd=True
    ufunctionu>The delete_disk function must be called with -f or --function.unameu"A name must be specified as "name"u
delete_vhdu!The disk was successfully deleteduSuccessu{0}: {1}N(	RR�R!R�R;R
RR�R�(R�R,R-R8R�((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR�=s
	"cC@s|dkrtd��n|s-t�}n|dkrBi}nd|kr]td��ntdi|dd6dd�}|jd|dd|jd	|d	�d
|jd|d�d|jd
|d
�d|jd|d�d|jd|d��}tdi|dd6dd�S(u
    .. versionadded:: 2015.8.0

    Update a disk's properties

    CLI Example:

    .. code-block:: bash

        salt-cloud -f update_disk my-azure name=my_disk label=my_disk
        salt-cloud -f update_disk my-azure name=my_disk new_name=another_disk
    ufunctionu<The show_disk function must be called with -f or --function.unameu"A name must be specified as "name"R�R-Rthas_operating_systemuhas_operating_systemRZulabelR�u
media_linkR)unew_nameR�uosN(RR!R�Rtupdate_diskR;(R�R,R-told_dataR8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR_s$
	 	
cC@s�|dkrtd��n|dkr0i}nd|krKtd��n|s]t�}n|jd|d�}i}x$|jD]}t|�||j<q�W|S(u�
    .. versionadded:: 2015.8.0

    List certificates associated with the service

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_service_certificates my-azure name=my_service
    ufunctionuLThe list_service_certificates function must be called with -f or --function.unameu*A service name must be specified as "name"RON(RR�R!tlist_service_certificatestcertificatesRt
thumbprint(R�R,R-R8R.R4((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR�s	cC@s�|dkrtd��n|s-t�}n|d	krBi}nd|kr]td��nd|krxtd��nd|kr�td��n|j|d|d|d�}t|�S(
u
    .. versionadded:: 2015.8.0

    Return information about a service certificate

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_service_certificate my-azure name=my_service_certificate \
            thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
    ufunctionuJThe get_service_certificate function must be called with -f or --function.unameu*A service name must be specified as "name"uthumbalgorithmu6A thumbalgorithm must be specified as "thumbalgorithm"u
thumbprintu.A thumbprint must be specified as "thumbprint"N(RR!R�tget_service_certificateR(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_service_certificate�s$
	
cC@s	|dkrtd��n|s-t�}n|dkrBi}nd|kr]td��nd|krxtd��nd|kr�td��nd	|kr�td
��ny7|j|d|d|d|d	�}idd6SWntk
rtd
��nXdS(u
    .. versionadded:: 2015.8.0

    Add a new service certificate

    CLI Example:

    .. code-block:: bash

        salt-cloud -f add_service_certificate my-azure name=my_service_certificate \
            data='...CERT_DATA...' certificate_format=sha1 password=verybadpass
    ufunctionuJThe add_service_certificate function must be called with -f or --function.unameu"A name must be specified as "name"udatau,Certificate data must be specified as "data"ucertificate_formatu>A certificate_format must be specified as "certificate_format"upasswordu*A password must be specified as "password"u.The service certificate was successfully addeduSuccessuUThere was a conflict. This usually means that the service certificate already exists.N(RR!R�tadd_service_certificateR(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR!�s0
	

cC@s�|dkrtd��n|dkr0i}nd|krKtd��nd|krftd��nd|kr�td��n|s�t�}ny0|j|d|d|d�}id	d
6SWn2tk
r�}tdj|d|j���nXdS(
u%
    .. versionadded:: 2015.8.0

    Delete a specific certificate associated with the service

    CLI Examples:

    .. code-block:: bash

        salt-cloud -f delete_service_certificate my-azure name=my_service_certificate \
            thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
    ufunctionuMThe delete_service_certificate function must be called with -f or --function.unameu"A name must be specified as "name"uthumbalgorithmu6A thumbalgorithm must be specified as "thumbalgorithm"u
thumbprintu.A thumbprint must be specified as "thumbprint"u0The service certificate was successfully deleteduSuccessu{0}: {1}N(RR�R!tdelete_service_certificateRR�R�(R�R,R-R8R�((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR"s*
	
cC@sj|dkrtd��n|s-t�}n|j�}i}x$|jD]}t|�||j<qIW|S(u�
    .. versionadded:: 2015.8.0

    List management certificates associated with the subscription

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_management_certificates my-azure name=my_management
    ufunctionuOThe list_management_certificates function must be called with -f or --function.(RR!tlist_management_certificatestsubscription_certificatesRt#subscription_certificate_thumbprint(R�R,R-R8R.R4((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR#1scC@sz|dkrtd��n|s-t�}n|dkrBi}nd|kr]td��n|j|d�}t|�S(u
    .. versionadded:: 2015.8.0

    Return information about a management_certificate

    CLI Example:

    .. code-block:: bash

        salt-cloud -f get_management_certificate my-azure name=my_management_certificate \
            thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
    ufunctionuMThe get_management_certificate function must be called with -f or --function.u
thumbprintu.A thumbprint must be specified as "thumbprint"N(RR!R�tget_management_certificateR(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_management_certificateLs
	cC@s�|dkrtd��n|s-t�}n|d
krBi}nd|kr]td��nd|krxtd��nd|kr�td��ny.|j|d	|d|d�id
d6SWntk
r�td��nXd
S(u
    .. versionadded:: 2015.8.0

    Add a new management certificate

    CLI Example:

    .. code-block:: bash

        salt-cloud -f add_management_certificate my-azure public_key='...PUBKEY...' \
            thumbprint=0123456789ABCDEF data='...CERT_DATA...'
    ufunctionuMThe add_management_certificate function must be called with -f or --function.u
public_keyu.A public_key must be specified as "public_key"u
thumbprintu.A thumbprint must be specified as "thumbprint"udatau,Certificate data must be specified as "data"unameu1The management certificate was successfully addeduSuccessuXThere was a conflict. This usually means that the management certificate already exists.N(RR!R�tadd_management_certificateR(R�R,R-((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR(os*
	
cC@s�|dkrtd��n|dkr0i}nd|krKtd��n|s]t�}ny |j|d�idd6SWn2tk
r�}tdj|d|j���nXdS(	u.
    .. versionadded:: 2015.8.0

    Delete a specific certificate associated with the management

    CLI Examples:

    .. code-block:: bash

        salt-cloud -f delete_management_certificate my-azure name=my_management_certificate \
            thumbalgorithm=sha1 thumbprint=0123456789ABCDEF
    ufunctionuPThe delete_management_certificate function must be called with -f or --function.u
thumbprintu.A thumbprint must be specified as "thumbprint"u3The management certificate was successfully deleteduSuccessu{0}: {1}N(RR�R!tdelete_management_certificateRR�R�(R�R,R-R�((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR)�s
	cC@s1|dkrtd��nd}t|�}|S(u�
    .. versionadded:: 2015.8.0

    List input endpoints associated with the deployment

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_virtual_networks my-azure service=myservice deployment=mydeployment
    ufunctionuHThe list_virtual_networks function must be called with -f or --function.u"services/networking/virtualnetwork(Rtquery(R�R,R-tpathR8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytlist_virtual_networks�sc
C@sl|dkrtd��n|dkr0i}nd|krKtd��nd|krftd��ndj|d|d�}t|�}|dkr�tdj|d|d���ni}x�|D]�}d	|kr�|d	}t|t�s�|S|d
djdi�jd
�}|s&q�nt|t�sA|g}nx|D]}	|	||	d<qHW|Sq�W|S(u�
    .. versionadded:: 2015.8.0

    List input endpoints associated with the deployment

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_input_endpoints my-azure service=myservice deployment=mydeployment
    ufunctionuGThe list_input_endpoints function must be called with -f or --function.userviceu-A service name must be specified as "service"u
deploymentu3A deployment name must be specified as "deployment"u+services/hostedservices/{0}/deployments/{1}uPThere was an error listing endpoints with the {0} service on the {1} deployment.uRoleuConfigurationSetsuConfigurationSetuInputEndpointsu
InputEndpointuNameN(RR�R�R*R�tdictR;R�(
R�R,R-R+R8R.R4RLtinput_endpointtendpoint((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytlist_input_endpoints�sB	


#
cC@st|dkrtd��n|dkr0i}nd|krKtd��ntd|dd�}|j|dd�S(u
    .. versionadded:: 2015.8.0

    Show an input endpoint associated with the deployment

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_input_endpoint my-azure service=myservice \
            deployment=mydeployment name=SSH
    ufunctionuFThe show_input_endpoint function must be called with -f or --function.unameu,An endpoint name must be specified as "name"R�R-N(RR�R0R;(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_input_endpoint
s
	uupdatecC@s�|dkrtd��n|d.kr0i}nd|krKtd��nd|krftd��nd|kr�td��nd	|kr�td
��n|dkrMd|kr�td
��nd|kr�td��nd|kr�|d|d<nd|krt|d<ntj|d�j�|d<d|krMd|d<qMnt|dd�}d}d}|dkr�|||d<|d||dd<nx�|D]�}||d|dkr�|dkr`|j|�}||7}q`q�|jd||dd||dd||dd||dd ||d!d"||jd#d��}||7}q�Wd$j|�}	d%j|d|d|d	�}
t	d&|
d'd(d)id*d+6d,|	d-t�t
S(/u�
    .. versionadded:: 2015.8.0

    Update an input endpoint associated with the deployment. Please note that
    there may be a delay before the changes show up.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f update_input_endpoint my-azure service=myservice \
            deployment=mydeployment role=myrole name=HTTP local_port=80 \
            port=80 protocol=tcp enable_direct_server_return=False \
            timeout_for_tcp_idle_connection=4
    ufunctionuHThe update_input_endpoint function must be called with -f or --function.userviceu-A service name must be specified as "service"u
deploymentu3A deployment name must be specified as "deployment"unameu,An endpoint name must be specified as "name"uroleu(An role name must be specified as "role"udeleteuportu,An endpoint port must be specified as "port"uprotocoluAAn endpoint protocol (tcp or udp) must be specified as "protocol"u
local_portuenable_direct_server_returnutimeout_for_tcp_idle_connectioniR-uu{
        <InputEndpoint>
          <LocalPort>{local_port}</LocalPort>
          <Name>{name}</Name>
          <Port>{port}</Port>
          <Protocol>{protocol}</Protocol>
          <EnableDirectServerReturn>{enable_direct_server_return}</EnableDirectServerReturn>
          <IdleTimeoutInMinutes>{timeout_for_tcp_idle_connection}</IdleTimeoutInMinutes>
        </InputEndpoint>uadduNameR�u	LocalPortR)R�uPortR�uProtocoltenable_direct_server_returnuEnableDirectServerReturnttimeout_for_tcp_idle_connectionuIdleTimeoutInMinutesu�<PersistentVMRole xmlns="http://schemas.microsoft.com/windowsazure"
xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
  <ConfigurationSets>
    <ConfigurationSet>
      <ConfigurationSetType>NetworkConfiguration</ConfigurationSetType>
      <InputEndpoints>{0}
      </InputEndpoints>
    </ConfigurationSet>
  </ConfigurationSets>
  <OSVirtualHardDisk>
  </OSVirtualHardDisk>
</PersistentVMRole>u5services/hostedservices/{0}/deployments/{1}/roles/{2}R+tmethoduPUTtheader_dictuapplication/xmluContent-TypeR8tdecodeN(RR�R
RR�tlowerR0R�R;R*R](R�R,R-tactivityt
old_endpointst
endpoints_xmltendpoint_xmlR/tthis_endpoint_xmltrequest_xmlR+((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytupdate_input_endpoint-sp	
	
	


c	C@std|d|dddd�S(u�
    .. versionadded:: 2015.8.0

    Add an input endpoint to the deployment. Please note that
    there may be a delay before the changes show up.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f add_input_endpoint my-azure service=myservice \
            deployment=mydeployment role=myrole name=HTTP local_port=80 \
            port=80 protocol=tcp enable_direct_server_return=False \
            timeout_for_tcp_idle_connection=4
    R�R,R-ufunctionR8uadd(R>(R�R,R-((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytadd_input_endpoint�s
c	C@std|d|dddd�S(uM
    .. versionadded:: 2015.8.0

    Delete an input endpoint from the deployment. Please note that
    there may be a delay before the changes show up.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f delete_input_endpoint my-azure service=myservice \
            deployment=mydeployment role=myrole name=HTTP
    R�R,R-ufunctionR8udelete(R>(R�R,R-((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytdelete_input_endpoint�s
cC@s�|dkrtd��n|s-t�}n|d	krBi}nd|kr]td��nd|krxtd��n|jd|dd|d�}t|�S(
u�
    .. versionadded:: 2015.8.0

    Return information about a deployment

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_deployment my-azure name=my_deployment
    ufunctionuAThe get_deployment function must be called with -f or --function.uservice_nameu2A service name must be specified as "service_name"udeployment_nameu8A deployment name must be specified as "deployment_name"RORQN(RR!R�tget_deployment_by_nameR(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_deployment�s		

cC@sj|dkrtd��n|s-t�}n|j�}i}x$|jD]}t|�||j<qIW|S(u�
    .. versionadded:: 2015.8.0

    List input endpoints associated with the deployment

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_affinity_groups my-azure
    ufunctionuGThe list_affinity_groups function must be called with -f or --function.(RR!tlist_affinity_groupstaffinity_groupsRR)(R�R,R-R8R.R4((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyRC�scC@s}|dkrtd��n|s-t�}n|dkrBi}nd|kr]td��n|jd|d�}t|�S(u�
    .. versionadded:: 2015.8.0

    Show an affinity group associated with the account

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_affinity_group my-azure service=myservice \
            deployment=mydeployment name=SSH
    ufunctionuFThe show_affinity_group function must be called with -f or --function.unameu2An affinity group name must be specified as "name"taffinity_group_nameN(RR!R�tget_affinity_group_propertiesR(R�R,R-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_affinity_group	s
	cC@s�|dkrtd��n|s-t�}n|d
krBi}nd|kr]td��nd|krxtd��nd|kr�td��ny=|j|d|d|d|jd	d
��id
d6SWntk
r�td��nXd
S(u�
    .. versionadded:: 2015.8.0

    Create a new affinity group

    CLI Example:

    .. code-block:: bash

        salt-cloud -f create_affinity_group my-azure name=my_affinity_group
    ufunctionuHThe create_affinity_group function must be called with -f or --function.unameu"A name must be specified as "name"ulabelu$A label must be specified as "label"ulocationu*A location must be specified as "location"udescriptionu+The affinity group was successfully createduSuccessuPThere was a conflict. This usually means that the affinity group already exists.N(RR!R�tcreate_affinity_groupR;R(R�R,R-((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyRH3	s,	
c	C@s�|dkrtd��n|s-t�}n|d
krBi}nd|kr]td��nd|krxtd��n|jd|dd|dd	|jd
d
��tdi|dd6dd�S(u�
    .. versionadded:: 2015.8.0

    Update an affinity group's properties

    CLI Example:

    .. code-block:: bash

        salt-cloud -f update_affinity_group my-azure name=my_group label=my_group
    ufunctionuHThe update_affinity_group function must be called with -f or --function.unameu"A name must be specified as "name"ulabelu$A label must be specified as "label"RERZRXudescriptionR�R-N(RR!R�tupdate_affinity_groupR;RG(R�R,R-((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyRI_	s 		

cC@s�|dkrtd��n|dkr0i}nd|krKtd��n|s]t�}ny |j|d�idd6SWn2tk
r�}tdj|d|j���nXdS(	u�
    .. versionadded:: 2015.8.0

    Delete a specific affinity group associated with the account

    CLI Examples:

    .. code-block:: bash

        salt-cloud -f delete_affinity_group my-azure name=my_affinity_group
    ufunctionuHThe delete_affinity_group function must be called with -f or --function.unameu"A name must be specified as "name"u+The affinity group was successfully deleteduSuccessu{0}: {1}N(RR�R!tdelete_affinity_groupRR�R�(R�R,R-R�((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyRJ�	s	c
C@s�|dkri}n|sNtjdt�tdtd|jdd��}n|s�tjdt�tdtd|jdd��}ntjj	||�S(u^
    .. versionadded:: 2015.8.0

    Return a storage_conn object for the storage account
    ustorage_accountRRustorage_keyN(
R�RRR	RR
R;RtstoragetBlobService(tstorage_accounttstorage_keytconn_kwargs((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytget_storage_conn�	s	cC@s�|dkrtd��n|dkr0i}nd|krKtd��nd|krftd��n|s~td|�}n|j|d|d|jdd�|jd	d�|jd
d��}i}x$|jD]}t|�||j<q�W|S(u�
    .. versionadded:: 2015.8.0

    Creates the URL to access a blob

    CLI Example:

    .. code-block:: bash

        salt-cloud -f make_blob_url my-azure container=mycontainer blob=myblob

    container:
        Name of the container.
    blob:
        Name of the blob.
    account:
        Name of the storage account. If not specified, derives the host base
        from the provider configuration.
    protocol:
        Protocol to use: 'http' or 'https'. If not specified, derives the host
        base from the provider configuration.
    host_base:
        Live host base URL.  If not specified, derives the host base from the
        provider configuration.
    ufunctionu@The make_blob_url function must be called with -f or --function.u	containeru1A container name must be specified as "container"ublobu'A blob name must be specified as "blob"ROuaccountuprotocolu	host_baseN(RR�RPt
make_blob_urlR;t
containersRR)(R�tstorage_connR-R8R.R4((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyRQ�	s*	cC@sp|dkrtd��n|s3td|�}n|j�}i}x$|jD]}t|�||j<qOW|S(u�
    .. versionadded:: 2015.8.0

    List containers associated with the storage account

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_storage_containers my-azure
    ufunctionuJThe list_storage_containers function must be called with -f or --function.RO(RRPtlist_containersRRRR)(R�RSR-R8R.R4((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytlist_storage_containers�	scC@s�|dkrtd��n|s3td|�}nyY|jd|dd|jdd�d|jd	d�d
|jdt��idd
6SWntk
r�td��nXdS(u/
    .. versionadded:: 2015.8.0

    Create a storage container

    CLI Example:

    .. code-block:: bash

        salt-cloud -f create_storage_container my-azure name=mycontainer

    name:
        Name of container to create.
    meta_name_values:
        Optional. A dict with name_value pairs to associate with the
        container as metadata. Example:{'Category':'test'}
    blob_public_access:
        Optional. Possible values include: container, blob
    fail_on_exist:
        Specify whether to throw an exception when the container exists.
    ufunctionuKThe create_storage_container function must be called with -f or --function.ROtcontainer_nameunametx_ms_meta_name_valuesumeta_name_valuestx_ms_blob_public_accessublob_public_accesst
fail_on_existu
fail_on_existu.The storage container was successfully createduSuccessuSThere was a conflict. This usually means that the storage container already exists.N(RRPtcreate_containerR;R�R
R(R�RSR-((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytcreate_storage_container
s	

cC@s�|dkrtd��n|d	kr0i}nd|krKtd��n|sctd|�}n|jd|dd|jdd	��}|S(
u�
    .. versionadded:: 2015.8.0

    Show a container associated with the storage account

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_storage_container my-azure name=myservice

    name:
        Name of container to show.
    ufunctionuIThe show_storage_container function must be called with -f or --function.unameu5An storage container name must be specified as "name"RORVt
x_ms_lease_idulease_idN(RR�RPtget_container_propertiesR;(R�RSR-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_storage_container:
s		
cC@s�|dkrtd��n|d	kr0i}nd|krKtd��n|sctd|�}n|jd|dd|jdd	��}|S(
u�
    .. versionadded:: 2015.8.0

    Show a storage container's metadata

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_storage_container_metadata my-azure name=myservice

    name:
        Name of container to show.
    lease_id:
        If specified, show_storage_container_metadata only succeeds if the
        container's lease is active and matches this ID.
    ufunctionuIThe show_storage_container function must be called with -f or --function.unameu5An storage container name must be specified as "name"RORVR\ulease_idN(RR�RPtget_container_metadataR;(R�RSR-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_storage_container_metadatab
s		
c	C@s�|dkrtd��n|dkr0i}nd|krKtd��ntjjj|jdd��}|s�td|�}ny;|jd|dd	|d
|jdd��idd
6SWnt	k
r�td��nXdS(u,
    .. versionadded:: 2015.8.0

    Set a storage container's metadata

    CLI Example:

    .. code-block:: bash

        salt-cloud -f set_storage_container my-azure name=mycontainer \
            x_ms_meta_name_values='{"my_name": "my_value"}'

    name:
        Name of existing container.
    meta_name_values:
        A dict containing name, value for metadata.
        Example: {'category':'test'}
    lease_id:
        If specified, set_storage_container_metadata only succeeds if the
        container's lease is active and matches this ID.
    ufunctionuKThe create_storage_container function must be called with -f or --function.unameu5An storage container name must be specified as "name"umeta_name_valuesuRORVRWR\ulease_idu.The storage container was successfully updateduSuccessuThere was a conflict.N(
RR�RRR�R�R;RPtset_container_metadataR(R�RSR-RW((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytset_storage_container_metadata�
s&		

cC@s�|dkrtd��n|d	kr0i}nd|krKtd��n|sctd|�}n|jd|dd|jdd	��}|S(
uz
    .. versionadded:: 2015.8.0

    Show a storage container's acl

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_storage_container_acl my-azure name=myservice

    name:
        Name of existing container.
    lease_id:
        If specified, show_storage_container_acl only succeeds if the
        container's lease is active and matches this ID.
    ufunctionuIThe show_storage_container function must be called with -f or --function.unameu5An storage container name must be specified as "name"RORVR\ulease_idN(RR�RPtget_container_aclR;(R�RSR-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_storage_container_acl�
s		
cC@s�|dkrtd��n|s3td|�}ny[|jd|dd|jdd�d|jd	d�d
|jdd��}idd
6SWntk
r�td��nXdS(u
    .. versionadded:: 2015.8.0

    Set a storage container's acl

    CLI Example:

    .. code-block:: bash

        salt-cloud -f set_storage_container my-azure name=mycontainer

    name:
        Name of existing container.
    signed_identifiers:
        SignedIdentifers instance
    blob_public_access:
        Optional. Possible values include: container, blob
    lease_id:
        If specified, set_storage_container_acl only succeeds if the
        container's lease is active and matches this ID.
    ufunctionuKThe create_storage_container function must be called with -f or --function.RORVunametsigned_identifiersusigned_identifiersRXublob_public_accessR\ulease_idu.The storage container was successfully updateduSuccessuThere was a conflict.N(RRPtset_container_aclR;R�R(R�RSR-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytset_storage_container_acl�
s	

c	C@s�|dkrtd��n|dkr0i}nd|krKtd��n|sctd|�}n|jd|dd|jdd�d	|jd
d��}|S(u�
    .. versionadded:: 2015.8.0

    Delete a container associated with the storage account

    CLI Example:

    .. code-block:: bash

        salt-cloud -f delete_storage_container my-azure name=mycontainer

    name:
        Name of container to create.
    fail_not_exist:
        Specify whether to throw an exception when the container exists.
    lease_id:
        If specified, delete_storage_container only succeeds if the
        container's lease is active and matches this ID.
    ufunctionuKThe delete_storage_container function must be called with -f or --function.unameu5An storage container name must be specified as "name"RORVtfail_not_existufail_not_existR\ulease_idN(RR�RPtdelete_containerR;(R�RSR-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytdelete_storage_containers		
cC@sF|dkrtd��n|dkr0i}nd|krKtd��nd}|jd
d�|kr�tdjdj|����n|d
dkr�d
|kr�tdj|d
���n|s�td|�}n|jd|dd|d
d|jd
d�d|jdd�d|jdd�d|jdd��}|S(uD
    .. versionadded:: 2015.8.0

    Lease a container associated with the storage account

    CLI Example:

    .. code-block:: bash

        salt-cloud -f lease_storage_container my-azure name=mycontainer

    name:
        Name of container to create.
    lease_action:
        Required. Possible values: acquire|renew|release|break|change
    lease_id:
        Required if the container has an active lease.
    lease_duration:
        Specifies the duration of the lease, in seconds, or negative one
        (-1) for a lease that never expires. A non-infinite lease can be
        between 15 and 60 seconds. A lease duration cannot be changed
        using renew or change. For backwards compatibility, the default is
        60, and the value is only used on an acquire operation.
    lease_break_period:
        Optional. For a break operation, this is the proposed duration of
        seconds that the lease should continue before it is broken, between
        0 and 60 seconds. This break period is only used if it is shorter
        than the time remaining on the lease. If longer, the time remaining
        on the lease is used. A new lease will not be available before the
        break period has expired, but the lease may be held for longer than
        the break period. If this header does not appear with a break
        operation, a fixed-duration lease breaks after the remaining lease
        period elapses, and an infinite lease breaks immediately.
    proposed_lease_id:
        Optional for acquire, required for change. Proposed lease ID, in a
        GUID string format.
    ufunctionuJThe lease_storage_container function must be called with -f or --function.unameu5An storage container name must be specified as "name"uacquireurenewureleaseubreakuchangeulease_actionu"A lease_action must be one of: {0}u, ulease_iduEA lease ID must be specified for the "{0}" lease action as "lease_id"RORVtx_ms_lease_actionR\tx_ms_lease_durationulease_durationi<tx_ms_lease_break_periodulease_break_periodtx_ms_proposed_lease_iduproposed_lease_idN(uacquireurenewureleaseubreakuchange(RR�R;R�tjoinRPtlease_container(R�RSR-t
lease_actionsR8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytlease_storage_container?s4&		

cC@s||dkrtd��n|dkr0i}nd|krKtd��n|sctd|�}ntjjjd||�S(ut	
    .. versionadded:: 2015.8.0

    List blobs associated with the container

    CLI Example:

    .. code-block:: bash

        salt-cloud -f list_blobs my-azure container=mycontainer

    container:
        The name of the storage container
    prefix:
        Optional. Filters the results to return only blobs whose names
        begin with the specified prefix.
    marker:
        Optional. A string value that identifies the portion of the list
        to be returned with the next list operation. The operation returns
        a marker value within the response body if the list returned was
        not complete. The marker value may then be used in a subsequent
        call to request the next set of list items. The marker value is
        opaque to the client.
    maxresults:
        Optional. Specifies the maximum number of blobs to return,
        including all BlobPrefix elements. If the request does not specify
        maxresults or specifies a value greater than 5,000, the server will
        return up to 5,000 items. Setting maxresults to a value less than
        or equal to zero results in error response code 400 (Bad Request).
    include:
        Optional. Specifies one or more datasets to include in the
        response. To specify more than one of these options on the URI,
        you must separate each option with a comma. Valid values are:

        snapshots:
            Specifies that snapshots should be included in the
            enumeration. Snapshots are listed from oldest to newest in
            the response.
        metadata:
            Specifies that blob metadata be returned in the response.
        uncommittedblobs:
            Specifies that blobs for which blocks have been uploaded,
            but which have not been committed using Put Block List
            (REST API), be included in the response.
        copy:
            Version 2012-02-12 and newer. Specifies that metadata
            related to any current or previous Copy Blob operation
            should be included in the response.
    delimiter:
        Optional. When the request includes this parameter, the operation
        returns a BlobPrefix element in the response body that acts as a
        placeholder for all blobs whose names begin with the same
        substring up to the appearance of the delimiter character. The
        delimiter may be a single character or a string.
    ufunctionu=The list_blobs function must be called with -f or --function.u	containeru:An storage container name must be specified as "container"RORSN(RR�RPRRtmsazuret
list_blobs(R�RSR-((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyRt�s8	cC@sU|dkrtd��n|s3td|�}n|jd|jdd��}|S(u�
    .. versionadded:: 2015.8.0

    Show a blob's service properties

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_blob_service_properties my-azure
    ufunctionuOThe show_blob_service_properties function must be called with -f or --function.ROR�utimeoutN(RRPtget_blob_service_propertiesR;R�(R�RSR-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_blob_service_properties�s	cC@s�|dkrtd��n|d	kr0i}nd|krKtd��n|sctd|�}n|jd|dd|jdd	��}|S(
u
    .. versionadded:: 2015.8.0

    Sets the properties of a storage account's Blob service, including
    Windows Azure Storage Analytics. You can also use this operation to
    set the default request version for all incoming requests that do not
    have a version specified.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f set_blob_service_properties my-azure

    properties:
        a StorageServiceProperties object.
    timeout:
        Optional. The timeout parameter is expressed in seconds.
    ufunctionuNThe set_blob_service_properties function must be called with -f or --function.u
propertiesuBThe blob service properties name must be specified as "properties"ROR�R�utimeoutN(RR�RPRuR;(R�RSR-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytset_blob_service_properties�s		
c	C@s�|dkrtd��n|d
kr0i}nd|krKtd��nd|krftd��n|s~td|�}ny6|jd|dd	|dd
|jdd
��}Wntk
r�td��nX|S(u�
    .. versionadded:: 2015.8.0

    Returns all user-defined metadata, standard HTTP properties, and
    system properties for the blob.

    CLI Example:

    .. code-block:: bash

        salt-cloud -f show_blob_properties my-azure container=mycontainer blob=myblob

    container:
        Name of existing container.
    blob:
        Name of existing blob.
    lease_id:
        Required if the blob has an active lease.
    ufunctionuGThe show_blob_properties function must be called with -f or --function.u	containeru3The container name must be specified as "container"ublobu)The blob name must be specified as "blob"RORVt	blob_nameR\ulease_idu"The specified blob does not exist.N(RR�RPtget_blob_propertiesR;R(R�RSR-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytshow_blob_propertiess&		


cC@s |dkrtd��n|dkr0i}nd|krKtd��nd|krftd��n|s~td|�}n|jd|dd	|dd
|jdd�d|jd
d�d|jdd�d|jdd�d|jdd�d|jdd�d|jdd��	}|S(u�
    .. versionadded:: 2015.8.0

    Set a blob's properties

    CLI Example:

    .. code-block:: bash

        salt-cloud -f set_blob_properties my-azure

    container:
        Name of existing container.
    blob:
        Name of existing blob.
    blob_cache_control:
        Optional. Modifies the cache control string for the blob.
    blob_content_type:
        Optional. Sets the blob's content type.
    blob_content_md5:
        Optional. Sets the blob's MD5 hash.
    blob_content_encoding:
        Optional. Sets the blob's content encoding.
    blob_content_language:
        Optional. Sets the blob's content language.
    lease_id:
        Required if the blob has an active lease.
    blob_content_disposition:
        Optional. Sets the blob's Content-Disposition header.
        The Content-Disposition response header field conveys additional
        information about how to process the response payload, and also can
        be used to attach additional metadata. For example, if set to
        attachment, it indicates that the user-agent should not display the
        response, but instead show a Save As dialog with a filename other
        than the blob name specified.
    ufunctionuFThe set_blob_properties function must be called with -f or --function.u	containeru8The blob container name must be specified as "container"ublobu)The blob name must be specified as "blob"RORVRxtx_ms_blob_cache_controlublob_cache_controltx_ms_blob_content_typeublob_content_typetx_ms_blob_content_md5ublob_content_md5tx_ms_blob_content_encodingublob_content_encodingtx_ms_blob_content_languageublob_content_languageR\ulease_idtx_ms_blob_content_dispositionublob_content_dispositionN(RR�RPRyR;(R�RSR-R8((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pytset_blob_propertiesSs,%		

cC@s�|dkrtd��n|dkr0i}nd|krKtd��nd|krftd��nd|kr�d|kr�td	��n|s�td
|�}ntjjjd||�S(
u�
    .. versionadded:: 2015.8.0

    Upload a blob

    CLI Examples:

    .. code-block:: bash

        salt-cloud -f put_blob my-azure container=base name=top.sls blob_path=/srv/salt/top.sls
        salt-cloud -f put_blob my-azure container=base name=content.txt blob_content='Some content'

    container:
        Name of existing container.
    name:
        Name of existing blob.
    blob_path:
        The path on the local machine of the file to upload as a blob. Either
        this or blob_content must be specified.
    blob_content:
        The actual content to be uploaded as a blob. Either this or blob_path
        must me specified.
    cache_control:
        Optional. The Blob service stores this value but does not use or
        modify it.
    content_language:
        Optional. Specifies the natural languages used by this resource.
    content_md5:
        Optional. An MD5 hash of the blob content. This hash is used to
        verify the integrity of the blob during transport. When this header
        is specified, the storage service checks the hash that has arrived
        with the one that was sent. If the two hashes do not match, the
        operation will fail with error code 400 (Bad Request).
    blob_content_type:
        Optional. Set the blob's content type.
    blob_content_encoding:
        Optional. Set the blob's content encoding.
    blob_content_language:
        Optional. Set the blob's content language.
    blob_content_md5:
        Optional. Set the blob's MD5 hash.
    blob_cache_control:
        Optional. Sets the blob's cache control.
    meta_name_values:
        A dict containing name, value for metadata.
    lease_id:
        Required if the blob has an active lease.
    ufunctionu;The put_blob function must be called with -f or --function.u	containeru8The blob container name must be specified as "container"unameu)The blob name must be specified as "name"u	blob_pathublob_contentuiEither a path to a file needs to be passed in as "blob_path" or the contents of a blob as "blob_content."RORSN(RR�RPRRRstput_blob(R�RSR-((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR��s1	cC@s�|dkrtd��n|dkr0i}nd|krKtd��nd|krftd��nd|kr�d|kr�td	��n|s�td
|�}ntjjjd||�S(
u4
    .. versionadded:: 2015.8.0

    Download a blob

    CLI Example:

    .. code-block:: bash

        salt-cloud -f get_blob my-azure container=base name=top.sls local_path=/srv/salt/top.sls
        salt-cloud -f get_blob my-azure container=base name=content.txt return_content=True

    container:
        Name of existing container.
    name:
        Name of existing blob.
    local_path:
        The path on the local machine to download the blob to. Either this or
        return_content must be specified.
    return_content:
        Whether or not to return the content directly from the blob. If
        specified, must be True or False. Either this or the local_path must
        be specified.
    snapshot:
        Optional. The snapshot parameter is an opaque DateTime value that,
        when present, specifies the blob snapshot to retrieve.
    lease_id:
        Required if the blob has an active lease.
    progress_callback:
        callback for progress with signature function(current, total) where
        current is the number of bytes transferred so far, and total is the
        size of the blob.
    max_connections:
        Maximum number of parallel connections to use when the blob size
        exceeds 64MB.
        Set to 1 to download the blob chunks sequentially.
        Set to 2 or more to download the blob chunks in parallel. This uses
        more system resources but will download faster.
    max_retries:
        Number of times to retry download of blob chunk if an error occurs.
    retry_wait:
        Sleep time in secs between retries.
    ufunctionu;The get_blob function must be called with -f or --function.u	containeru8The blob container name must be specified as "container"unameu)The blob name must be specified as "name"u
local_pathureturn_contenturEither a local path needs to be passed in as "local_path" or "return_content" to return the blob contents directlyRORSN(RR�RPRRRstget_blob(R�RSR-((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR��s,	uGETcC@s3tjdt�tdt�}tjjjtjdt�tdt��}tjdt�tdtdd�}tjdt�tdt�}	dj	d	|d
|d|�}
|dkr�i}nd|d
<tjjj|
d|d|d|d|dddt
d|d|	d|dd�
}d|kr/|dSdS(u=
    Perform a query directly against the Azure REST API
    ucertificate_pathRusubscription_idumanagement_hostRumanagement.core.windows.netubackendu2https://{management_host}/{subscription_id}/{path}R RR+u
2014-06-01ux-ms-versionR4tparamsR8R5R�i�ttexttcerttbackendR6tdecode_typeuxmludictN(RRR	RR
RRRRR�R�thttpR*R](R+R4R8R�R5R6RRR R�RTR�((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyR*)
sL				
	(|t__doc__t
__future__RRRRAR�R�R�tsalt.configRtsalt.exceptionsRtsalt.utils.cloudRtsalt.utils.stringutilstsalt.utils.yamltsalt.extRR
RRt
azure.storagetazure.servicemanagementtazure.commonRRRtsalt.utils.msazureRR]tImportErrorRt	getLoggert__name__R�R
R	RR!R'R�R1R5R9R?R:R@R�R�R�R�R�R�R�R�R�R�tget_storageRtget_storage_keysRRR
RRRRR�RRRRR�RRR RR!R"R#R'R&R(R)R,R0R1tget_input_endpointR>R?R@RBtget_deploymentRCRGtget_affinity_groupRHRIRJRPRQRUR[R^tget_storage_containerR`tget_storage_container_metadataRbRdtget_storage_container_aclRgRjRrRtRvRuRwRzRyR�R�R�R*(((s=/usr/lib/python2.7/site-packages/salt/cloud/clouds/msazure.pyt<module>&s�

	
		
		0c	�^\	v)!(4%(!"/!&"'!*1, -"9r% ,%!8*%(3(**OI)2EKF

Zerion Mini Shell 1.0