%PDF- %PDF-
Mini Shell

Mini Shell

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

�
���^c@@s�dZddlmZmZmZddlZddlZddlZddlZ	yddl
Z	eZWne
k
r�eZnXddlmZddlmZeje�Zidd6Zd�Zd	�Zd
d�Zd
d�Zd
d
�Zdd�Zdd�Zdd�Zdd�Z dd�Z!ddd�Z"dd�Z#d�Z$dddddd�Z%dd�Z&d�Z'd�Z(d�Z)d�Z*d�Z+d �Z,d!�Z-d"�Z.d#�Z/dS($u9
Salt-specific interface for calling Salt Cloud directly
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltCloudConfigError(tsixuprofileuprofile_cC@str
tStdfS(u)
    Only work on POSIX-like systems
    uSThe cloud execution module cannot be loaded: only available on non-Windows systems.(t
HAS_SALTCLOUDtTruetFalse(((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyt__virtual__ scC@sPtjjtjjtjjtd�d�dtj	t
jdi���}|S(u
    Return a cloud client
    u	conf_fileucloudtpillars(tsalttcloudtCloudClienttostpathtjointdirnamet__opts__tcopytdeepcopyt
__pillar__tget(tclient((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyt_get_client)s	%uallcC@st�}|j|�}|S(u�
    List cloud provider sizes for the given providers

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.list_sizes my-gce-config
    (Rt
list_sizes(tproviderRtsizes((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyR4s
	cC@st�}|j|�}|S(u�
    List cloud provider images for the given providers

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.list_images my-gce-config
    (Rtlist_images(RRtimages((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyRCs
	cC@st�}|j|�}|S(u�
    List cloud provider locations for the given providers

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.list_locations my-gce-config
    (Rtlist_locations(RRt	locations((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyRRs
	u
list_nodescC@st�}|j|�}|S(u�
    List cloud provider data for all providers

    CLI Examples:

    .. code-block:: bash

        salt minionname cloud.query
        salt minionname cloud.query list_nodes_full
        salt minionname cloud.query list_nodes_select
    (Rtquery(t
query_typeRtinfo((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyRas	ulist_nodes_fullcC@s
td|�S(u�
    List all available cloud provider data

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.full_query
    R (R(R ((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyt
full_queryrs
ulist_nodes_selectcC@s
td|�S(uu
    List selected nodes

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.select_query
    R (R(R ((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pytselect_querys
cC@s#t||�}|dkrtStS(u�
    Return true if the instance is found on a provider

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.has_instance myinstance
    N(tget_instancetNoneRR(tnameRtdata((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pythas_instance�s
cC@s�tddd|gd|�}tjjj|�}y7ttjttjttj|������}Wntk
r~dSX|S(uY
    Return details on an instance.

    Similar to the cloud action show_instance
    but returns only the instance details.

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.get_instance myinstance

    SLS Example:

    .. code-block:: bash

        {{ salt['cloud.get_instance']('myinstance')['mac_address'] }}

    tfunu
show_instancetnamesRN(
tactionR
tutilsR'tsimple_types_filtertnextRt
itervaluestAttributeErrorR%(R&RR'R!((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyR$�s7
cK@sJt�}t|t�r+|jj|�n|j||d||�}|S(u�
    Spin up an instance using Salt Cloud

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.profile my-gce-config myinstance
    tvm_overrides(Rt
isinstancetdicttoptstupdatetprofile(R6R*R1R4tkwargsRR!((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pytprofile_�s

	cK@st�}|j||�}|S(uR
    Execute a salt cloud map file

    Cloud Map data can be retrieved from several sources:

    - a local file (provide the path to the file to the 'path' argument)
    - a JSON-formatted map directly (provide the appropriately formatted to using the 'map_data' argument)
    - the Salt Pillar (provide the map name of under 'pillar:cloud:maps' to the 'map_pillar' argument)

    .. note::
        Only one of these sources can be read at a time. The options are listed
        in their order of precedence.

    CLI Examples:

    .. code-block:: bash

        salt minionname cloud.map_run /path/to/cloud.map
        salt minionname cloud.map_run path=/path/to/cloud.map
        salt minionname cloud.map_run map_pillar='<map_pillar>'
          .. versionchanged:: 2018.3.1
        salt minionname cloud.map_run map_data='<actual map data>'
    (Rtmap_run(RR7RR!((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyR9�s	cC@st�}|j|�}|S(u
    Destroy the named VM(s)

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.destroy myinstance
    (Rtdestroy(R*RR!((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyR:�s
	c	K@sSt�}y"|j||||||�}Wn!tk
rN}tj|�dSX|S(uD
    Execute a single action on the given provider/instance

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.action start instance=myinstance
        salt minionname cloud.action stop instance=myinstance
        salt minionname cloud.action show_image provider=my-ec2-config image=ami-1624987f
    N(RR+RtlogterrorR%(	R)tcloudmapR*RtinstanceR7RR!terr((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyR+�s	"
cK@sDt�}t|t�r+|jj|�n|j|||�}|S(u�
    Create an instance using Salt Cloud

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.create my-ec2-config myinstance image=ami-1624987f size='t1.micro' ssh_username=ec2-user securitygroup=default delvol_on_destroy=True
    (RR2R3R4R5tcreate(RR*R4R7RR!((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyR@s

	cC@s/t�}|jddd|dd�}|dS(u�
    List block storage volumes

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.volume_list my-nova

    R+uvolume_listRR*uname(Rtextra_action(RRR!((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pytvolume_list$s	cK@s.t�}|jd|d|dd|�}|S(u�
    Delete volume

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.volume_delete my-nova myblock

    RR*R+u
volume_delete(RRA(RR*R7RR!((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyt
volume_delete4s	!cK@s.t�}|jddd|d||�}|S(u�
    Create volume

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.volume_create my-nova myblock size=100 voltype=SSD

    R+u
volume_createR*R(RRA(RR*R7RR!((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyt
volume_createDs	!cK@s.t�}|jd|d|dd|�}|S(u�
    Attach volume to a server

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.volume_attach my-nova myblock server_name=myserver device='/dev/xvdf'

    RR*R+u
volume_attach(RRA(RR*R7RR!((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyt
volume_attachTs	!cK@s.t�}|jd|d|dd|�}|S(u�
    Detach volume from a server

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.volume_detach my-nova myblock server_name=myserver

    RR*R+u
volume_detach(RRA(RR*R7RR!((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyt
volume_detachds	!cC@s%t�}|jddd|dd�S(u�
    List private networks

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.network_list my-nova

    R+unetwork_listRR*unames(RRA(RR((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pytnetwork_listts	cK@s(t�}|jd|d|dd|�S(u�
    Create private network

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.network_create my-nova names=['salt'] cidr='192.168.100.0/24'

    RR*R+unetwork_create(RRA(RR*R7R((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pytnetwork_create�s	cK@s(t�}|jd|d|dd|�S(u�
    List virtual interfaces on a server

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.virtual_interface_list my-nova names=['salt-master']

    RR*R+uvirtual_interface_list(RRA(RR*R7R((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pytvirtual_interface_list�s	cK@s(t�}|jd|d|dd|�S(u�
    Attach private interfaces to a server

    CLI Example:

    .. code-block:: bash

        salt minionname cloud.virtual_interface_create my-nova names=['salt-master'] net_name='salt'

    RR*R+uvirtual_interface_create(RRA(RR*R7R((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pytvirtual_interface_create�s	(0t__doc__t
__future__RRRR
tloggingRtsalt.utils.dataR
t
salt.cloudRRtImportErrorRtsalt.exceptionsRtsalt.extRt	getLoggert__name__R;t__func_alias__RRRRRRR"R#R%R(R$R8R9R:R+R@RBRCRDRERFRGRHRIRJ(((s6/usr/lib/python2.7/site-packages/salt/modules/cloud.pyt<module>sV



			

									

Zerion Mini Shell 1.0