%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/gcp_addon.pyc

�
���^c
@@s�dZddlmZmZmZddlZddlmZeje	�Z
y"ddlZddl
ZeZWnek
r�eZnXdZd�Zd�Zd�Zdddddddddd	�	ZdS(
uw
A route is a rule that specifies how certain packets should be handled by the
virtual network. Routes are associated with virtual machine instances by tag,
and the set of routes for a particular VM is called its routing table.
For each packet leaving a virtual machine, the system searches that machine's
routing table for a single best matching route.

.. versionadded:: 2018.3.0

This module will create a route to send traffic destined to the Internet
through your gateway instance.

:codeauthor: :email:`Pratik Bandarkar <pratik.bandarkar@gmail.com>`
:maturity:   new
:depends:    google-api-python-client
:platform:   Linux

i(tabsolute_importtunicode_literalstprint_functionN(tsixugcpcC@sttkrtdfStS(u'
    Check for googleapiclient api
    uMRequired dependencies 'googleapiclient' and/or 'oauth2client' were not found.(tHAS_LIBtFalset__virtualname__(((s:/usr/lib/python2.7/site-packages/salt/modules/gcp_addon.pyt__virtual__(s
cC@s"|j�jd|d|�j�S(u3
    Fetch network selfLink from network name.
    tprojecttnetwork(tnetworkstgettexecute(t
project_idtnetwork_nametservice((s:/usr/lib/python2.7/site-packages/salt/modules/gcp_addon.pyt_get_network1scC@s(|j�jd|d|d|�j�S(u
    Get instance details
    Rtzonetinstance(t	instancesRR(R
t
instance_zonetnameR((s:/usr/lib/python2.7/site-packages/salt/modules/gcp_addon.pyt
_get_instance9sc	C@s�tjjj|�}	tjjddd|	�}
|
j�}itj	|�d6t
|tj	|�d|
�dd6tj	|�d6t|||d|
�dd	6|d
6|d6}|jd|d
|�}
|
j
�S(u

    Create a route to send traffic destined to the Internet through your
    gateway instance

    credential_file : string
        File location of application default credential. For more information,
        refer: https://developers.google.com/identity/protocols/application-default-credentials
    project_id : string
        Project ID where instance and network resides.
    name : string
        name of the route to create
    next_hop_instance : string
        the name of an instance that should handle traffic matching this route.
    instance_zone : string
        zone where instance("next_hop_instance") resides
    network : string
        Specifies the network to which the route will be applied.
    dest_range : string
        The destination range of outgoing packets that the route will apply to.
    tags : list
        (optional) Identifies the set of instances that this route will apply to.
    priority : int
        (optional) Specifies the priority of this route relative to other routes.
        default=1000

    CLI Example:

    salt 'salt-master.novalocal' gcp.route_create
        credential_file=/root/secret_key.json
        project_id=cp100-170315
        name=derby-db-route1
        next_hop_instance=instance-1
        instance_zone=us-central1-a
        network=default
        dest_range=0.0.0.0/0
        tags=['no-ip']
        priority=700

    In above example, the instances which are having tag "no-ip" will route the
    packet to instance "instance-1"(if packet is intended to other network)
    ucomputeuv1tcredentialsunameRuselfLinkunetworku	destRangeunextHopInstanceutagsupriorityRtbody(toauth2clienttservice_accounttServiceAccountCredentialstfrom_json_keyfile_nametgoogleapiclientt	discoverytbuildtroutesRt	text_typeRRtinsertR(tcredential_fileR
Rt
dest_rangetnext_hop_instanceRttagsR	tpriorityRRR t
routes_configtroute_create_request((s:/usr/lib/python2.7/site-packages/salt/modules/gcp_addon.pytroute_createBs$4			
	(t__doc__t
__future__RRRtloggingtsalt.extRt	getLoggert__name__tlogtgoogleapiclient.discoveryRtoauth2client.service_accountRtTrueRtImportErrorRRRRRtNoneR*(((s:/usr/lib/python2.7/site-packages/salt/modules/gcp_addon.pyt<module>s.


					

Zerion Mini Shell 1.0