%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@sdZddlmZmZmZddlZddlZddlZddl	Zddl
mZeje
�Zd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Zdd�Zdddd�Zddd�Zdd�Zddddddd�Zdd�ZdS(u�
The Salt Cloud Runner
=====================

This runner wraps the functionality of salt cloud making salt cloud routines
available to all internal apis via the runner system
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltCloudConfigErrorcC@s5tjjtjjtjjtd�d��}|S(u
    Return cloud client
    u	conf_fileucloud(tsalttcloudtCloudClienttostpathtjointdirnamet__opts__(tclient((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyt_get_clients	(uallcC@st�}|j|�}|S(u;
    List cloud provider sizes for the given providers
    (R
t
list_sizes(tproviderRtsizes((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyR"s	cC@st�}|j|�}|S(u<
    List cloud provider images for the given providers
    (R
tlist_images(RRtimages((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyR+s	cC@st�}|j|�}|S(u;
    List cloud provider sizes for the given providers
    (R
tlist_locations(RRt	locations((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyR4s	u
list_nodescC@st�}|j|�}|S(u4
    List cloud provider data for all providers
    (R
tquery(t
query_typeRtinfo((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyR=s	ulist_nodes_fullcC@st�}|j|�}|S(u0
    List all available cloud provider data
    (R
t
full_query(RRR((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyRFs	ulist_nodes_selectcC@st�}|j|�}|S(u
    List selected nodes
    (R
tselect_query(RRR((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyROs	cK@s�|dkr%d|kr%|d}n|dkr<idd6S|dkrad|kra|d}n|dkrxidd6St�}t|t�r�|jj|�n|j||tjj	j
|��}|S(u�
    Create a cloud vm with the given profile and instances, instances can be a
    list or comma-delimited string

    CLI Example:

    .. code-block:: bash

        salt-run cloud.profile prof=my-ec2 instances=node1,node2,node3
    uprofileu#A profile (or prof) must be defineduErrorunamesu3One or more instances (comma-delimited) must be setN(tNoneR
t
isinstancetdicttoptstupdatetprofileRtutilstargstclean_kwargs(tproft	instancesRtkwargsRR((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyRXs

	$cK@sPt�}t|t�r+|jj|�n|j|tjjj	|��}|S(u'
    Execute a salt cloud map file
    (
R
RRRRtmap_runRR R!R"(RRR%RR((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyR&vs
	!cC@s>t�}t|t�r+|jj|�n|j|�}|S(u!
    Destroy the named vm(s)
    (R
RRRRtdestroy(R$RRR((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyR'�s
	c
K@s�i}t�}t|t�r1|jj|�ny1|j|||||tjjj	|��}Wn t
k
r�}	tj|	�nX|S(u�
    Execute a single action on the given map/provider/instance

    CLI Example:

    .. code-block:: bash

        salt-run cloud.action start my-salt-vm
    (
R
RRRRtactionRR R!R"Rtlogterror(
tfunctcloudmapR$RtinstanceRR%RRterr((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyR(�s	cK@sSt�}t|t�r+|jj|�n|j||tjjj	|��}|S(u
    Create an instance using Salt Cloud

    CLI Example:

    .. code-block:: bash

        salt-run cloud.create my-ec2-config myinstance             image=ami-1624987f size='t1.micro' ssh_username=ec2-user             securitygroup=default delvol_on_destroy=True
    (
R
RRRRtcreateRR R!R"(RR$RR%RR((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyR/�s
	$(t__doc__t
__future__RRRtloggingRt
salt.cloudRtsalt.utils.argstsalt.exceptionsRt	getLoggert__name__R)R
RRRRRRRRR&R'R(R/(((s6/usr/lib/python2.7/site-packages/salt/runners/cloud.pyt<module>s0	
						

Zerion Mini Shell 1.0