§
    ÎÑßjØë ã                   ó|  — d Z ddlZddlZddlZddlZddlmZ ddlmZ ddl	m
Z
 ddlmZmZmZmZmZmZmZmZ ddlmZmZmZmZmZmZ ddlmZ dd	lmZ dd
lm Z  dZ!dZ"d„ Z# G d„ de¦  «        Z$ G d„ de¦  «        Z% G d„ d¦  «        Z& G d„ dee¦  «        Z' G d„ de¦  «        Z( G d„ de¦  «        Z) G d„ de¦  «        Z* G d„ de¦  «        Z+ G d„ de¦  «        Z, G d „ d!¦  «        Z- G d"„ d#¦  «        Z. G d$„ d%e¦  «        Z/ G d&„ d'e¦  «        Z0 G d(„ d)e¦  «        Z1 G d*„ d+e¦  «        Z2 G d,„ d-e¦  «        Z3 G d.„ d/e¦  «        Z4 G d0„ d1e¦  «        Z5 G d2„ d3e¦  «        Z6 G d4„ d5e¦  «        Z7 G d6„ d7e¦  «        Z8 G d8„ d9e¦  «        Z9 G d:„ d;e¦  «        Z: G d<„ d=e¦  «        Z; G d>„ d?e¦  «        Z< G d@„ dAe¦  «        Z= G dB„ dCe¦  «        Z> G dD„ dEe¦  «        Z? G dF„ dGe¦  «        Z@ G dH„ dIe¦  «        ZA G dJ„ dKe¦  «        ZB G dL„ dMe¦  «        ZC G dN„ dOe¦  «        ZD G dP„ dQe¦  «        ZEdS )Rz*
Module for Google Compute Engine Driver.
é    N)Úget_pricing)Ú
LazyObject©ÚLibcloudError)ÚNodeÚNodeSizeÚ	NodeImageÚ	UuidMixinÚ
NodeDriverÚNodeLocationÚStorageVolumeÚVolumeSnapshot)ÚGoogleResponseÚGoogleBaseErrorÚResourceExistsErrorÚGoogleBaseConnectionÚResourceNotFoundErrorÚGoogleOAuth2Credential)Ú	NodeState)Ú
parse_date)ÚProviderÚv1é´   c                 ó  — t           j                              | dd…         d¦  «        }t          | dd…         ¦  «        }t          | dd…         ¦  «        t          | dd…         dz   ¦  «        z  }t          j        ||¬	¦  «        }||z   S )
a  
    Return a datetime object that corresponds to the time in an RFC3339
    timestamp.

    :param  timestamp: RFC3339 timestamp string
    :type   timestamp: ``str``

    :return:  Datetime object corresponding to timestamp
    :rtype:   :class:`datetime.datetime`
    Niöÿÿÿz%Y-%m-%dT%H:%M:%SéûÿÿÿéýÿÿÿéþÿÿÿiúÿÿÿÚ1)ÚhoursÚminutes)ÚdatetimeÚstrptimeÚintÚ	timedelta)Ú	timestampÚtsÚtz_hoursÚtz_minsÚtz_deltas        úP/opt/saltstack/salt/lib/python3.11/site-packages/libcloud/compute/drivers/gce.pyÚtimestamp_to_datetimer+   6   sŠ   € õ 
Ô	×	#Ò	# I¨d¨s¨d¤OÐ5HÑ	IÔ	I€BÝ�9˜R ˜UÔ#Ñ$Ô$€HÝ�)˜B˜C˜C”.Ñ!Ô!¥C¨	°"°R°%Ô(8¸3Ñ(>Ñ$?Ô$?Ñ?€GÝÔ!¨¸'ÐBÑBÔB€Hà�‰=Ðó    c                   ó   — e Zd ZdS )ÚGCEResponseN)Ú__name__Ú
__module__Ú__qualname__© r,   r*   r.   r.   K   s   € € € € € Ø€Dr,   r.   c                   óZ   ‡ — e Zd ZdZdZeZ	 	 	 d
ˆ fd„	Zˆ fd„Zd„ Z	ˆ fd„Z
dd„Zd	„ Zˆ xZS )ÚGCEConnectionaÉ  
    Connection class for the GCE driver.

    GCEConnection extends :class:`google.GoogleBaseConnection` for 3 reasons:
      1. modify request_path for GCE URI.
      2. Implement gce_params functionality described below.
      3. Add request_aggregated_items method for making aggregated API calls.

    If the parameter gce_params is set to a dict prior to calling request(),
    the URL parameters will be updated to include those key/values FOR A
    SINGLE REQUEST. If the response contains a nextPageToken,
    gce_params['pageToken'] will be set to its value. This can be used to
    implement paging in list:

    >>> params, more_results = {'maxResults': 2}, True
    >>> while more_results:
    ...     driver.connection.gce_params=params
    ...     driver.ex_list_urlmaps()
    ...     more_results = 'pageToken' in params
    ...
    [<GCEUrlMap id="..." name="cli-map">, <GCEUrlMap id="..." name="lc-map">]
    [<GCEUrlMap id="..." name="web-map">]
    zwww.googleapis.comNc                 ó”   •—  t          ¦   «         j        ||f|||dœ|¤Ž d                     t          |¦  «        | _        d | _        d S )N)ÚsecureÚ	auth_typeÚcredential_fileú/compute/{}/projects/{})ÚsuperÚ__init__ÚformatÚAPI_VERSIONÚrequest_pathÚ
gce_params)	ÚselfÚuser_idÚkeyr6   r7   r8   ÚprojectÚkwargsÚ	__class__s	           €r*   r;   zGCEConnection.__init__k   sj   ø€ ð 	�‰ŒÔØØð	
ð ØØ+ð	
ð 	
ð ð	
ð 	
ð 	
ð 6×<Ò<½[È'ÑRÔRˆÔØˆŒˆˆr,   c                 ó˜   •— t          ¦   «                              ||¦  «        \  }}| j        r|                     | j        ¦  «         ||fS )zŒ
        Update URL parameters with values from self.gce_params.

        @inherits: :class:`GoogleBaseConnection.pre_connect_hook`
        )r:   Úpre_connect_hookr?   Úupdate)r@   ÚparamsÚheadersrE   s      €r*   rG   zGCEConnection.pre_connect_hook€   sJ   ø€ õ  ™'œ'×2Ò2°6¸7ÑCÔC‰ˆ�àŒ?ð 	+Ø�MŠM˜$œ/Ñ*Ô*Ð*à�wˆÐr,   c                 óÊ   — d}g }d|v r|d         nd}d|i}|rH|| _          | j        |i |¤Ž}|                     |j                             dg ¦  «        ¦  «         d|v }|°Hd|iS )zÐ
        Generic function to create a paginated request to any API call
        not only aggregated or zone ones as request_aggregated_items.

        @inherits: :class:`GoogleBaseConnection.request`
        TÚmax_resultséô  Ú
maxResultsÚitemsÚ	pageToken)r?   ÚrequestÚextendÚobjectÚget)r@   ÚargsrD   Úmore_resultsrO   rL   rI   Úresponses           r*   Úpaginated_requestzGCEConnection.paginated_request�   s›   € ð ˆØˆØ/<ÀÐ/FÐ/F�f˜]Ô+Ð+ÈCˆØ Ð,ˆàð 	1Ø$ˆDŒOØ#�t”| TÐ4¨VÐ4Ð4ˆHØ�LŠL˜œ×,Ò,¨W°bÑ9Ô9Ñ:Ô:Ð:Ø&¨&Ð0ˆLð	 ð 	1ð ˜ÐÐr,   c                 ó¶   •—  t          ¦   «         j        |i |¤Ž}| j        r7d|j        v r|j        d         | j        d<   nd| j        v r| j        d= d| _        |S )zŠ
        Perform request then do GCE-specific processing of URL params.

        @inherits: :class:`GoogleBaseConnection.request`
        ÚnextPageTokenrP   N)r:   rQ   r?   rS   )r@   rU   rD   rW   rE   s       €r*   rQ   zGCEConnection.request¡   sq   ø€ ð #•5‘7”7”? DÐ3¨FÐ3Ð3ˆð
 Œ?ð 	#Ø (¤/Ð1Ð1Ø/7¬¸Ô/O�” Ñ,Ð,Ø ¤Ð/Ð/Ø”O KÐ0Ø"ˆDŒOàˆr,   c                 ó8  — |rd                      |j        |¦  «        }nd|z  }g }ddi}d}|rX|| _        |                      |d¬¦  «        j        }d|v r+|r|d         }d	|z  ||ii|d<   |                     |¦  «         d
|v }|°X|                      ||¦  «        S )aà  
        Perform request(s) to obtain all results from 'api_name'.

        This method will make requests to the aggregated 'api_name' until
        all results are received.  It will then, through a helper function,
        combine all results and return a single 'items' dictionary.

        :param    api_name: Name of API to call. Consult API docs
                  for valid names.
        :type     api_name: ``str``

        :param   zone: Optional zone to use.
        :type zone: :class:`GCEZone`

        :return:  dict in the format of the API response.
                  format: { 'items': {'key': {api_name: []}} }
                  ex: { 'items': {'zones/us-central1-a': {disks: []}} }
        :rtype:   ``dict``
        z/zones/{}/{}z/aggregated/%srN   rM   TÚGET©ÚmethodrO   zzones/%srP   )r<   Únamer?   rQ   rS   ÚappendÚ_merge_response_items)	r@   Úapi_nameÚzoner>   Úapi_responsesrI   rV   rW   rO   s	            r*   Úrequest_aggregated_itemsz&GCEConnection.request_aggregated_itemsµ   sã   € ð* ð 	9Ø)×0Ò0°´¸HÑEÔEˆLˆLà+¨xÑ8ˆLàˆà Ð$ˆØˆàð 	1Ø$ˆDŒOØ—|’| L¸�|Ñ?Ô?ÔFˆHà˜(Ð"Ð"Øð Qð % WÔ-�EØ)3°tÑ)<¸xÈÐ>OÐ(P�H˜WÑ%Ø×$Ò$ XÑ.Ô.Ð.Ø&¨&Ð0ˆLð ð 	1ð ×)Ò)¨(°MÑBÔBÐBr,   c                 ó  — i }|D ]z}|                      di ¦  «                             ¦   «         D ]O\  }}||v rF|                     |i ¦  «                             |g ¦  «         ||         |xx         ||         z  cc<   ŒPŒ{d|iS )a  
        Take a list of API responses ("item"-portion only) and combine them.

        Helper function to combine multiple aggregated responses into a single
        dictionary that resembles an API response.

        Note: keys that don't have a 'list_name" key (including warnings)
        are omitted.

        :param   list_name: Name of list in dict.  Practically, this is
                          the name of the API called (e.g. 'disks').
        :type    list_name: ``str``

        :param   response_list: list of API responses (e.g. resp['items']).
                                Each entry in the list is the result of a
                                single API call.  Expected format is:
                                [ { items: {
                                             key1: { api_name:[]},
                                             key2: { api_name:[]}
                                           }}, ... ]
        :type    response_list: ``dict``

        :return: dict in the format of:
                 { items: {key: {api_name:[]}, key2: {api_name:[]}} }
                 ex: { items: {
                         'us-east1-a': {'disks': []},
                         'us-east1-b': {'disks': []}
                         }}
        :rtype:  ``dict``
        rO   )rT   rO   Ú
setdefault)r@   Ú	list_nameÚresponse_listÚmerged_itemsÚrespÚkÚvs          r*   ra   z#GCEConnection._merge_response_itemsã   s­   € ð> ˆà!ð 	?ð 	?ˆDð Ÿš ¨"Ñ-Ô-×3Ò3Ñ5Ô5ð ?ð ?‘��1Ø �>�>Ø ×+Ò+¨A¨rÑ2Ô2×=Ò=¸iÈÑLÔLÐLà  ”O IÐ.Ð.Ô.°!°I´,Ñ>Ð.Ð.Ñ.øð	?ð ˜Ð&Ð&r,   ©NNN©N)r/   r0   r1   Ú__doc__Úhostr.   ÚresponseClsr;   rG   rX   rQ   re   ra   Ú__classcell__©rE   s   @r*   r4   r4   O   sÇ   ø€ € € € € ðð ð0  €DØ€Kð ØØðð ð ð ð ð ð*ð ð ð ð ð ð  ð  ð(ð ð ð ð ð(,Cð ,Cð ,Cð ,Cð\+'ð +'ð +'ð +'ð +'ð +'ð +'r,   r4   c                   ó2   — e Zd ZdZd„ Zd„ Zd„ Zd„ Zd	d„ZdS )
ÚGCEListae  
    An Iterator that wraps list functions to provide additional features.

    GCE enforces a limit on the number of objects returned by a list operation,
    so users with more than 500 objects of a particular type will need to use
    filter(), page() or both.

    >>> l=GCEList(driver, driver.ex_list_urlmaps)
    >>> for sublist in l.filter('name eq ...-map').page(1):
    ...   sublist
    ...
    [<GCEUrlMap id="..." name="cli-map">]
    [<GCEUrlMap id="..." name="web-map">]

    One can create a GCEList manually, but it's slightly easier to use the
    ex_list() method of :class:`GCENodeDriver`.
    c                 ó>   — || _         || _        || _        i | _        dS )zñ
        :param  driver: An initialized :class:``GCENodeDriver``
        :type   driver: :class:``GCENodeDriver``

        :param  list_fn: A bound list method from :class:`GCENodeDriver`.
        :type   list_fn: ``instancemethod``
        N)ÚdriverÚlist_fnrD   rI   )r@   rx   ry   rD   s       r*   r;   zGCEList.__init__$  s$   € ð ˆŒØˆŒØˆŒØˆŒˆˆr,   c              #   ó„   K  — | j         }d}|r2| j        | j        j        _         |di | j        ¤ŽV — d| j        v }|°0d S d S )NTrP   r2   )ry   rI   rx   Ú
connectionr?   rD   )r@   ry   rV   s      r*   Ú__iter__zGCEList.__iter__1  sq   è è € Ø”,ˆØˆàð 	6Ø04´ˆDŒKÔ"Ô-Ø�'Ð(Ð(˜DœKÐ(Ð(Ð(Ð(Ð(Ø&¨$¬+Ð5ˆLð ð 	6ð 	6ð 	6ð 	6ð 	6r,   c                 óf   — d                      | j        j        t          | j        ¦  «        ¦  «        S )Nz<GCEList list="{}" params="{}">)r<   ry   r/   ÚreprrI   ©r@   s    r*   Ú__repr__zGCEList.__repr__:  s/   € Ø0×7Ò7ØŒLÔ!Ý�”ÑÔñ
ô 
ð 	
r,   c                 ó   — || j         d<   | S )aí  
        Filter results of a list operation.

        GCE supports server-side filtering of resources returned by a list
        operation. Syntax of the filter expression is fully described in the
        GCE API reference doc, but in brief it is::

            FIELD_NAME COMPARISON_STRING LITERAL_STRING

        where FIELD_NAME is the resource's property name, COMPARISON_STRING is
        'eq' or 'ne', and LITERAL_STRING is a regular expression in RE2 syntax.

        >>> for sublist in l.filter('name eq ...-map'):
        ...   sublist
        ...
        [<GCEUrlMap id="..." name="cli-map">,                 <GCEUrlMap id="..." name="web-map">]

        API reference: https://cloud.google.com/compute/docs/reference/latest/
        RE2 syntax: https://github.com/google/re2/blob/master/doc/syntax.txt

        :param  expression: Filter expression described above.
        :type   expression: ``str``

        :return: This :class:`GCEList` instance
        :rtype:  :class:`GCEList`
        Úfilter©rI   )r@   Ú
expressions     r*   r‚   zGCEList.filter@  s   € ð8 !+ˆŒ�HÑàˆr,   rM   c                 ó   — || j         d<   | S )aã  
        Limit the number of results by each iteration.

        This implements the paging functionality of the GCE list methods and
        returns this GCEList instance so that results can be chained:

        >>> for sublist in GCEList(driver, driver.ex_list_urlmaps).page(2):
        ...   sublist
        ...
        [<GCEUrlMap id="..." name="cli-map">,                 <GCEUrlMap id="..." name="lc-map">]
        [<GCEUrlMap id="..." name="web-map">]

        :keyword  max_results: Maximum number of results to return per
                               iteration. Defaults to the GCE default of 500.
        :type     max_results: ``int``

        :return: This :class:`GCEList` instance
        :rtype:  :class:`GCEList`
        rN   rƒ   )r@   rL   s     r*   ÚpagezGCEList.page`  s   € ð* %0ˆŒ�LÑ!àˆr,   N)rM   )	r/   r0   r1   rp   r;   r|   r€   r‚   r†   r2   r,   r*   rv   rv     so   € € € € € ðð ð$ð ð ð6ð 6ð 6ð
ð 
ð 
ðð ð ð@ð ð ð ð ð r,   rv   c                   ó*   — e Zd ZdZd„ Zd„ Zd„ Zd„ ZdS )Ú
GCELicensez8A GCE License used to track software usage in GCE nodes.c                 óª   — t          j        | ¦  «         || _        || _        || _        || _        d | _        d | _        |                      ¦   «          d S ro   )	r
   r;   Úidr_   rC   rx   Úcharges_use_feeÚextraÚ_request)r@   r_   rC   rx   s       r*   r;   zGCELicense.__init__}  sO   € ÝÔ˜4Ñ Ô Ð ØˆŒØˆŒ	ØˆŒØˆŒØ#ˆÔØˆŒ
à�Š‰Œˆˆˆr,   c                 óâ  — | j         j        j        }	 |                     | j         j        | j        ¦  «        }|| j         j        _        d| j        z  }| j         j                             |d¬¦  «        j        }n# t          $ r ‚ w xY w	 || j         j        _        n# || j         j        _        w xY w| 	                    d¦  «        | 	                    d¦  «        dœ| _
        |d         | _        d S )Nz/global/licenses/%sr\   r]   ÚselfLinkÚkind)r�   r�   ÚchargesUseFee)rx   r{   r>   ÚreplacerC   r_   rQ   rS   Ú	ExceptionrT   rŒ   r‹   )r@   Úsaved_request_pathÚnew_request_pathrQ   rW   s        r*   r�   zGCELicense._requestˆ  s  € ð "œ[Ô3Ô@Ðð
	EØ1×9Ò9¸$¼+Ô:MÈtÌ|Ñ\Ô\ÐØ2BˆDŒKÔ"Ô/à+¨d¬iÑ7ˆGØ”{Ô-×5Ò5°gÀeÐ5ÑLÔLÔSˆHˆHøÝð 	ð 	ð 	Øð	øøøð ð
 3EˆDŒKÔ"Ô/Ð/øÐ2DˆDŒKÔ"Ô/ÐDÐDÐDÐDð !Ÿš ZÑ0Ô0Ø—L’L Ñ(Ô(ð
ð 
ˆŒ
ð  (¨Ô8ˆÔÐÐs   “A&A: Á9B Á:BÂB ÂB/c                 ó    — t          d¦  «        ‚)Nz#Can not destroy a License resource.r   r   s    r*   ÚdestroyzGCELicense.destroyŸ  s   € ÝÐAÑBÔBÐBr,   c                 óN   — d                      | j        | j        | j        ¦  «        S )Nz3<GCELicense id="{}" name="{}" charges_use_fee="{}">)r<   rŠ   r_   r‹   r   s    r*   r€   zGCELicense.__repr__¢  s*   € ØD×KÒKØŒGØŒIØÔ ñ
ô 
ð 	
r,   N)r/   r0   r1   rp   r;   r�   r—   r€   r2   r,   r*   rˆ   rˆ   z  sY   € € € € € ØBÐBð	ð 	ð 	ð9ð 9ð 9ð.Cð Cð Cð
ð 
ð 
ð 
ð 
r,   rˆ   c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )ÚGCEDiskTypezA GCE DiskType resource.Nc                 óŽ   — t          |¦  «        | _        || _        || _        || _        || _        t          j        | ¦  «         d S ro   ©ÚstrrŠ   r_   rc   rx   rŒ   r
   r;   ©r@   rŠ   r_   rc   rx   rŒ   s         r*   r;   zGCEDiskType.__init__­  óB   € Ý�b‘'”'ˆŒØˆŒ	ØˆŒ	ØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó    — t          d¦  «        ‚)Nz$Can not destroy a DiskType resource.r   r   s    r*   r—   zGCEDiskType.destroyµ  s   € ÝÐBÑCÔCÐCr,   c                 óN   — d                      | j        | j        | j        ¦  «        S )Nz)<GCEDiskType id="{}" name="{}" zone="{}">©r<   rŠ   r_   rc   r   s    r*   r€   zGCEDiskType.__repr__¸  s)   € Ø:×AÒAØŒGØŒIØŒIñ
ô 
ð 	
r,   ro   ©r/   r0   r1   rp   r;   r—   r€   r2   r,   r*   rš   rš   ª  sO   € € € € € Ø"Ð"ð!ð !ð !ð !ðDð Dð Dð
ð 
ð 
ð 
ð 
r,   rš   c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )ÚGCEAcceleratorTypezA GCE AcceleratorType resource.Nc                 óŽ   — t          |¦  «        | _        || _        || _        || _        || _        t          j        | ¦  «         d S ro   rœ   rž   s         r*   r;   zGCEAcceleratorType.__init__Ã  rŸ   r,   c                 ó    — t          d¦  «        ‚)Nz,Can not destroy an AcceleratorType resource.r   r   s    r*   r—   zGCEAcceleratorType.destroyË  s   € ÝÐJÑKÔKÐKr,   c                 óN   — d                      | j        | j        | j        ¦  «        S )Nz0<GCEAcceleratorType id="{}" name="{}" zone="{}">r¢   r   s    r*   r€   zGCEAcceleratorType.__repr__Î  s)   € ØA×HÒHØŒGØŒIØŒIñ
ô 
ð 	
r,   ro   r£   r2   r,   r*   r¥   r¥   À  sO   € € € € € Ø)Ð)ð!ð !ð !ð !ðLð Lð Lð
ð 
ð 
ð 
ð 
r,   r¥   c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )Ú
GCEAddresszA GCE Static address.Nc                 óœ   — t          |¦  «        | _        || _        || _        || _        || _        || _        t          j        | ¦  «         d S ro   )	r�   rŠ   r_   ÚaddressÚregionrx   rŒ   r
   r;   )r@   rŠ   r_   r¬   r­   rx   rŒ   s          r*   r;   zGCEAddress.__init__Ù  sI   € Ý�b‘'”'ˆŒØˆŒ	ØˆŒØˆŒØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó8   — | j                              | ¬¦  «        S )zf
        Destroy this address.

        :return: True if successful
        :rtype:  ``bool``
        )r¬   )rx   Úex_destroy_addressr   s    r*   r—   zGCEAddress.destroyâ  ó   € ð Œ{×-Ò-°dÐ-Ñ;Ô;Ð;r,   c           	      óœ   — d                      | j        | j        | j        t	          | j        d¦  «        r| j        j        p| j        ¦  «        S )Nz7<GCEAddress id="{}" name="{}" address="{}" region="{}">r_   )r<   rŠ   r_   r¬   Úhasattrr­   r   s    r*   r€   zGCEAddress.__repr__ì  sI   € ØH×OÒOØŒGØŒIØŒLÝ�T”[ &Ñ)Ô)Ð>¨d¬kÔ.>ÐMÀ$Ä+ñ	
ô 
ð 	
r,   ro   r£   r2   r,   r*   rª   rª   Ö  sL   € € € € € ØÐð!ð !ð !ð !ð<ð <ð <ð
ð 
ð 
ð 
ð 
r,   rª   c                   ó8   — e Zd ZdZ	 	 	 	 	 	 d	d„Zd„ Zd„ Zd„ ZdS )
Ú
GCEBackendz8A GCE Backend.  Only used for creating Backend Services.ÚUTILIZATIONNé   c                 ó„  — t          |t          ¦  «        r|| _        n1t          |t          ¦  «        r|j        | _        nt	          d¦  «        ‚|| _        || _        || _        || _        || _        || _	        |  
                    ¦   «         | _        | j        | _        |p| j        | _        t          j        | ¦  «         d S )NzQinstance_group must be of type GCEInstanceGroupor of type GCEInstanceGroupManager)Ú
isinstanceÚGCEInstanceGroupÚinstance_groupÚGCEInstanceGroupManagerÚ
ValueErrorÚbalancing_modeÚmax_utilizationÚmax_rateÚmax_rate_per_instanceÚcapacity_scalerÚ_gen_idrŠ   r_   Údescriptionr
   r;   ©r@   rº   r½   r¾   r¿   rÀ   rÁ   rÃ   s           r*   r;   zGCEBackend.__init__ø  sË   € õ �nÕ&6Ñ7Ô7ð 	Ø"0ˆDÔÐÝ˜Õ(?Ñ@Ô@ð 	Ø"0Ô"?ˆDÔÐåð5ñô ð ð
 -ˆÔØ,ˆÔØ.ˆÔØ ˆŒØ%:ˆÔ"Ø.ˆÔð —,’,‘.”.ˆŒØ”GˆŒ	à&Ð3¨$¬)ˆÔÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ód   — | j         j        j        }d                     || j         j        ¦  «        S )a  
        Use the Instance Group information to fill in name and id fields.

        :return: id in the format of:
                 ZONE/instanceGroups/INSTANCEGROUPNAME
                 Ex: us-east1-c/instanceGroups/my-instance-group
        :rtype:  ``str``
        z{}/instanceGroups/{})rº   rc   r_   r<   )r@   Ú	zone_names     r*   rÂ   zGCEBackend._gen_id  s.   € ð Ô'Ô,Ô1ˆ	à%×,Ò,¨Y¸Ô8KÔ8PÑQÔQÐQr,   c                 óÞ   — i }| j         j        d         |d<   | j        r
| j        |d<   | j        r
| j        |d<   | j        r
| j        |d<   | j        r
| j        |d<   | j        r
| j        |d<   |S )z»
        Returns dict formatted for inclusion in Backend Service Request.

        :return: dict formatted as a list entry for Backend Service 'backend'.
        :rtype: ``dict``
        r�   ÚgroupÚbalancingModeÚmaxUtilizationÚmaxRateÚmaxRatePerInstanceÚcapacityScaler)rº   rŒ   r½   r¾   r¿   rÀ   rÁ   )r@   Úds     r*   Úto_backend_dictzGCEBackend.to_backend_dict(  s›   € ð ˆØÔ(Ô.¨zÔ:ˆˆ'‰
àÔð 	5Ø!%Ô!4ˆAˆoÑàÔð 	7Ø"&Ô"6ˆAÐÑàŒ=ð 	)Øœ=ˆAˆi‰LàÔ%ð 	AØ&*Ô&@ˆAÐ"Ñ#àÔð 	7Ø"&Ô"6ˆAÐÑàˆr,   c                 óB   — d                      | j        | j        ¦  «        S )Nz3<GCEBackend instancegroup="{}" balancing_mode="{}">)r<   rŠ   r½   r   s    r*   r€   zGCEBackend.__repr__C  s%   € ØD×KÒKØŒGØÔñ
ô 
ð 	
r,   ©rµ   NNNr¶   N)r/   r0   r1   rp   r;   rÂ   rÏ   r€   r2   r,   r*   r´   r´   õ  ss   € € € € € ØBÐBð
 %ØØØ"ØØð!!ð !!ð !!ð !!ðFRð Rð Rðð ð ð6
ð 
ð 
ð 
ð 
r,   r´   c                   ó(   — e Zd ZdZ	 dd„Zd„ Zd„ ZdS )ÚGCEBackendServicezA GCE Backend Service.Nc                 óà   — t          |¦  «        | _        || _        |pg | _        |pg | _        || _        || _        || _        || _        |	| _	        |
pi | _
        t          j        | ¦  «         d S ro   )r�   rŠ   r_   ÚbackendsÚhealthchecksÚportÚ	port_nameÚprotocolÚtimeoutrx   rŒ   r
   r;   )r@   rŠ   r_   rÕ   rÖ   r×   rØ   rÙ   rÚ   rx   rŒ   s              r*   r;   zGCEBackendService.__init__M  su   € õ �b‘'”'ˆŒØˆŒ	Ø ˜ BˆŒØ(Ð.¨BˆÔØˆŒ	Ø"ˆŒØ ˆŒØˆŒØˆŒØ�[˜bˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 óB   — d                      | j        | j        ¦  «        S )Nz%<GCEBackendService id="{}" name="{}">©r<   rŠ   r_   r   s    r*   r€   zGCEBackendService.__repr__f  s   € Ø6×=Ò=¸d¼gÀtÄyÑQÔQÐQr,   c                 ó8   — | j                              | ¬¦  «        S )zn
        Destroy this Backend Service.

        :return: True if successful
        :rtype:  ``bool``
        )Úbackendservice)rx   Úex_destroy_backendservicer   s    r*   r—   zGCEBackendService.destroyi  ó   € ð Œ{×4Ò4ÀDÐ4ÑIÔIÐIr,   ro   ©r/   r0   r1   rp   r;   r€   r—   r2   r,   r*   rÓ   rÓ   J  sY   € € € € € Ø Ð ð ð!ð !ð !ð !ð2Rð Rð RðJð Jð Jð Jð Jr,   rÓ   c                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚGCEFailedDiskz1Dummy Node object for disks that are not created.c                 ó0   — || _         || _        || _        d S ro   ©r_   ÚerrorÚcode©r@   r_   ræ   rç   s       r*   r;   zGCEFailedDisk.__init__w  ó   € ØˆŒ	ØˆŒ
ØˆŒ	ˆ	ˆ	r,   c                 óB   — d                      | j        | j        ¦  «        S )Nz)<GCEFailedDisk name="{}" error_code="{}">©r<   r_   rç   r   s    r*   r€   zGCEFailedDisk.__repr__|  ó   € Ø:×AÒAÀ$Ä)ÈTÌYÑWÔWÐWr,   N©r/   r0   r1   rp   r;   r€   r2   r,   r*   rã   rã   t  ó=   € € € € € Ø;Ð;ðð ð ð
Xð Xð Xð Xð Xr,   rã   c                   ó   — e Zd ZdZd„ Zd„ ZdS )ÚGCEFailedNodez1Dummy Node object for nodes that are not created.c                 ó0   — || _         || _        || _        d S ro   rå   rè   s       r*   r;   zGCEFailedNode.__init__ƒ  ré   r,   c                 óB   — d                      | j        | j        ¦  «        S )Nz)<GCEFailedNode name="{}" error_code="{}">rë   r   s    r*   r€   zGCEFailedNode.__repr__ˆ  rì   r,   Nrí   r2   r,   r*   rð   rð   €  rî   r,   rð   c                   ó.   — e Zd ZdZ	 dd„Zd„ Zd„ Zd„ ZdS )ÚGCEHealthCheckzA GCE Http Health Check class.Nc                 óØ   — t          |¦  «        | _        || _        || _        || _        || _        || _        || _        || _        |	| _	        |
pi | _
        t          j        | ¦  «         d S ro   )r�   rŠ   r_   Úpathr×   ÚintervalrÚ   Úunhealthy_thresholdÚhealthy_thresholdrx   rŒ   r
   r;   )r@   rŠ   r_   rö   r×   r÷   rÚ   rø   rù   rx   rŒ   s              r*   r;   zGCEHealthCheck.__init__�  sm   € õ �b‘'”'ˆŒØˆŒ	ØˆŒ	ØˆŒ	Ø ˆŒØˆŒØ#6ˆÔ Ø!2ˆÔØˆŒØ�[˜bˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó8   — | j                              | ¬¦  «        S )zm
        Destroy this Health Check.

        :return:  True if successful
        :rtype:   ``bool``
        ©Úhealthcheck)rx   Úex_destroy_healthcheckr   s    r*   r—   zGCEHealthCheck.destroy¨  s   € ð Œ{×1Ò1¸dÐ1ÑCÔCÐCr,   c                 ó8   — | j                              | ¬¦  «        S )zŒ
        Commit updated healthcheck values.

        :return:  Updated Healthcheck object
        :rtype:   :class:`GCEHealthcheck`
        rû   )rx   Úex_update_healthcheckr   s    r*   rH   zGCEHealthCheck.update²  s   € ð Œ{×0Ò0¸TÐ0ÑBÔBÐBr,   c                 óZ   — d                      | j        | j        | j        | j        ¦  «        S )Nz6<GCEHealthCheck id="{}" name="{}" path="{}" port="{}">)r<   rŠ   r_   rö   r×   r   s    r*   r€   zGCEHealthCheck.__repr__¼  s.   € ØG×NÒNØŒGØŒIØŒIØŒIñ	
ô 
ð 	
r,   ro   ©r/   r0   r1   rp   r;   r—   rH   r€   r2   r,   r*   rô   rô   Œ  sf   € € € € € Ø(Ð(ð ð!ð !ð !ð !ð2Dð Dð DðCð Cð Cð
ð 
ð 
ð 
ð 
r,   rô   c                   ó.   — e Zd ZdZ	 dd„Zd„ Zd„ Zd„ ZdS )ÚGCEFirewallzA GCE Firewall rule class.Nc                 ó  — t          |¦  «        | _        || _        || _        || _        || _        || _        |	| _        || _        || _	        |
| _
        || _        || _        || _        || _        || _        t!          j        | ¦  «         d S ro   )r�   rŠ   r_   ÚnetworkÚallowedÚdeniedÚ	directionÚpriorityÚsource_rangesÚsource_tagsÚsource_service_accountsÚtarget_tagsÚtarget_service_accountsÚtarget_rangesrx   rŒ   r
   r;   )r@   rŠ   r_   r  r  r  r  r
  r  r	  r  r  r  r  rx   rŒ   s                   r*   r;   zGCEFirewall.__init__È  s�   € õ$ �b‘'”'ˆŒØˆŒ	ØˆŒØˆŒØˆŒØ"ˆŒØ ˆŒØ*ˆÔØ&ˆÔØ'>ˆÔ$Ø&ˆÔØ'>ˆÔ$Ø*ˆÔØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó8   — | j                              | ¬¦  «        S )zg
        Destroy this firewall.

        :return: True if successful
        :rtype:  ``bool``
        ©Úfirewall)rx   Úex_destroy_firewallr   s    r*   r—   zGCEFirewall.destroyë  s   € ð Œ{×.Ò.¸Ð.Ñ=Ô=Ð=r,   c                 ó8   — | j                              | ¬¦  «        S )zƒ
        Commit updated firewall values.

        :return:  Updated Firewall object
        :rtype:   :class:`GCEFirewall`
        r  )rx   Úex_update_firewallr   s    r*   rH   zGCEFirewall.updateõ  s   € ð Œ{×-Ò-°tÐ-Ñ<Ô<Ð<r,   c                 óX   — d                      | j        | j        | j        j        ¦  «        S )Nz,<GCEFirewall id="{}" name="{}" network="{}">)r<   rŠ   r_   r  r   s    r*   r€   zGCEFirewall.__repr__ÿ  s,   € Ø=×DÒDØŒGØŒIØŒLÔñ
ô 
ð 	
r,   ro   r  r2   r,   r*   r  r  Å  sa   € € € € € Ø$Ð$ð$ ð!!!ð !!ð !!ð !!ðF>ð >ð >ð=ð =ð =ð
ð 
ð 
ð 
ð 
r,   r  c                   ó"   — e Zd Zdd„Zd„ Zd„ ZdS )ÚGCEForwardingRuleNc	                 ó¸   — t          |¦  «        | _        || _        || _        || _        || _        || _        || _        || _        t          j
        | ¦  «         d S ro   )r�   rŠ   r_   r­   r¬   rÙ   Ú
targetpoolrx   rŒ   r
   r;   )	r@   rŠ   r_   r­   r¬   rÙ   r  rx   rŒ   s	            r*   r;   zGCEForwardingRule.__init__  sY   € Ý�b‘'”'ˆŒØˆŒ	ØˆŒØˆŒØ ˆŒð %ˆŒØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó8   — | j                              | ¬¦  «        S )zo
        Destroy this Forwarding Rule

        :return:  True if successful
        :rtype:   ``bool``
        )Úforwarding_rule)rx   Úex_destroy_forwarding_ruler   s    r*   r—   zGCEForwardingRule.destroy  ó   € ð Œ{×5Ò5ÀdÐ5ÑKÔKÐKr,   c                 óN   — d                      | j        | j        | j        ¦  «        S )Nz2<GCEForwardingRule id="{}" name="{}" address="{}">)r<   rŠ   r_   r¬   r   s    r*   r€   zGCEForwardingRule.__repr__  s)   € ØC×JÒJØŒGØŒIØŒLñ
ô 
ð 	
r,   ro   ©r/   r0   r1   r;   r—   r€   r2   r,   r*   r  r    sI   € € € € € ð!ð !ð !ð !ðLð Lð Lð
ð 
ð 
ð 
ð 
r,   r  c                   ó2   ‡ — e Zd ZdZdˆ fd„	Zd„ Zdd„Zˆ xZS )ÚGCENodeImagezA GCE Node Image class.Nc                 óR   •— t          ¦   «                              ||||¬¦  «         d S ©N©rŒ   )r:   r;   )r@   rŠ   r_   rx   rŒ   rE   s        €r*   r;   zGCENodeImage.__init__*  s*   ø€ Ý‰Œ×Ò˜˜T 6°ÐÑ7Ô7Ð7Ð7Ð7r,   c                 ó8   — | j                              | ¬¦  «        S )zb
        Delete this image

        :return: True if successful
        :rtype:  ``bool``
        )Úimage)rx   Úex_delete_imager   s    r*   ÚdeletezGCENodeImage.delete-  s   € ð Œ{×*Ò*°Ð*Ñ6Ô6Ð6r,   c                 ó@   — | j                              | |||||¦  «        S )aß  
        Deprecate this image

        :param  replacement: Image to use as a replacement
        :type   replacement: ``str`` or :class: `GCENodeImage`

        :param  state: Deprecation state of this image. Possible values include
                       'ACTIVE', 'DELETED', 'DEPRECATED' or 'OBSOLETE'.
        :type   state: ``str``

        :param  deprecated: RFC3339 timestamp to mark DEPRECATED
        :type   deprecated: ``str`` or ``None``

        :param  obsolete: RFC3339 timestamp to mark OBSOLETE
        :type   obsolete: ``str`` or ``None``

        :param  deleted: RFC3339 timestamp to mark DELETED
        :type   deleted: ``str`` or ``None``

        :return: True if successful
        :rtype:  ``bool``
        )rx   Úex_deprecate_image)r@   ÚreplacementÚstateÚ
deprecatedÚobsoleteÚdeleteds         r*   Ú	deprecatezGCENodeImage.deprecate7  s+   € ð0 Œ{×-Ò-Ø�+˜u j°(¸Gñ
ô 
ð 	
r,   ro   rn   )r/   r0   r1   rp   r;   r)  r1  rs   rt   s   @r*   r"  r"  '  sf   ø€ € € € € Ø!Ð!ð8ð 8ð 8ð 8ð 8ð 8ð7ð 7ð 7ð
ð 
ð 
ð 
ð 
ð 
ð 
ð 
r,   r"  c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )ÚGCESslCertificatez9GCESslCertificate represents the SslCertificate resource.Nc                 ó‚   — || _         || _        || _        || _        || _        || _        t          j        | ¦  «         dS )av  
        :param  name:  Name of the resource. Provided by the client when the
                       resource is created. The name must be 1-63 characters
                       long, and comply with RFC1035. Specifically, the name
                       must be 1-63 characters long and match the regular
                       expression [a-z]([-a-z0-9]*[a-z0-9])? which means the
                       first character must be a lowercase letter, and all
                       following characters must be a dash, lowercase letter,
                       or digit, except the last character, which cannot be a
                       dash.
        :type   name: ``str``

        :param  certificate:  A local certificate file. The certificate must
                              be in PEM format. The certificate chain must be
                              no greater than 5 certs long. The chain must
                              include at least one intermediate cert.
        :type   certificate: ``str``

        :param  private_key:  A write-only private key in PEM format. Only
                              insert RPCs will include this field.
        :type   private_key: ``str``

        :keyword  description:  An optional description of this resource.
                              Provide this property when you create the
                              resource.
        :type   description: ``str``

        :keyword  driver:  An initialized :class: `GCENodeDriver`
        :type   driver: :class:`:class: `GCENodeDriver``

        :keyword  extra:  A dictionary of extra information.
        :type   extra: ``:class: ``dict````

        N)r_   ÚcertificateÚprivate_keyrÃ   rx   rŒ   r
   r;   )r@   rŠ   r_   r5  rx   rŒ   r6  rÃ   s           r*   r;   zGCESslCertificate.__init__W  sI   € ðH ˆŒ	Ø&ˆÔØ&ˆÔØ&ˆÔØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó   — d| j         z  S )Nz<GCESslCertificate name="%s">©r_   r   s    r*   r€   zGCESslCertificate.__repr__ƒ  s   € Ø.°$´)Ñ<Ð<r,   c                 ó8   — | j                              | ¬¦  «        S )zu
        Destroy this SslCertificate.

        :return:  Return True if successful.
        :rtype: ``bool``
        )Ússlcertificate)rx   Úex_destroy_sslcertificater   s    r*   r—   zGCESslCertificate.destroy†  rà   r,   ©NNrá   r2   r,   r*   r3  r3  T  sR   € € € € € ØCÐCð*!ð *!ð *!ð *!ðX=ð =ð =ðJð Jð Jð Jð Jr,   r3  c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )ÚGCESubnetworkzA GCE Subnetwork object class.Nc                 óª   — t          |¦  «        | _        || _        || _        || _        || _        || _        || _        t          j	        | ¦  «         d S ro   )
r�   rŠ   r_   Úcidrr  r­   rx   rŒ   r
   r;   )r@   rŠ   r_   r@  r  r­   rx   rŒ   s           r*   r;   zGCESubnetwork.__init__”  sP   € Ý�b‘'”'ˆŒØˆŒ	ØˆŒ	ØˆŒØˆŒØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó6   — | j                              | ¦  «        S )zh
        Destroy this subnetwork

        :return: True if successful
        :rtype:  ``bool``
        )rx   Úex_destroy_subnetworkr   s    r*   r—   zGCESubnetwork.destroyž  s   € ð Œ{×0Ò0°Ñ6Ô6Ð6r,   c                 ól   — d| j         ›d| j        ›d| j        j        ›d| j        j        ›d| j        ›d�S )Nz<GCESubnetwork id="z" name="z
" region="z" network="z" cidr="z">)rŠ   r_   r­   r  r@  r   s    r*   r€   zGCESubnetwork.__repr__¨  sE   € € àŒGˆGˆGØŒIˆIˆIØŒKÔÐÐØŒLÔÐÐØŒIˆIˆIð
ð 	
r,   ro   r£   r2   r,   r*   r>  r>  ‘  sL   € € € € € Ø(Ð(ð!ð !ð !ð !ð7ð 7ð 7ð
ð 
ð 
ð 
ð 
r,   r>  c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )Ú
GCENetworkzA GCE Network object class.Nc                 óþ   — t          |¦  «        | _        || _        || _        || _        || _        d| _        g | _        d|v r&|d         dk    r|d         | _        |d         | _        t          j	        | ¦  «         d S )NÚlegacyÚmodeÚsubnetworks)
r�   rŠ   r_   r@  rx   rŒ   rH  rI  r
   r;   )r@   rŠ   r_   r@  rx   rŒ   s         r*   r;   zGCENetwork.__init__µ  s€   € Ý�b‘'”'ˆŒØˆŒ	ØˆŒ	ØˆŒØˆŒ
ØˆŒ	ØˆÔà�Uˆ?ˆ?˜u Vœ}°Ò8Ð8Ø˜fœˆDŒIØ$ ]Ô3ˆDÔÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó8   — | j                              | ¬¦  «        S )ze
        Destroy this network

        :return: True if successful
        :rtype:  ``bool``
        )r  )rx   Úex_destroy_networkr   s    r*   r—   zGCENetwork.destroyÃ  r°   r,   c                 óZ   — d                      | j        | j        | j        | j        ¦  «        S )Nz2<GCENetwork id="{}" name="{}" cidr="{}" mode="{}">)r<   rŠ   r_   r@  rH  r   s    r*   r€   zGCENetwork.__repr__Í  s.   € ØC×JÒJØŒGØŒIØŒIØŒIñ	
ô 
ð 	
r,   ro   r£   r2   r,   r*   rE  rE  ²  sL   € € € € € Ø%Ð%ð!ð !ð !ð !ð<ð <ð <ð
ð 
ð 
ð 
ð 
r,   rE  c                   ó.   — e Zd ZdZ	 	 	 	 dd„Zd„ Zd„ ZdS )ÚGCERoutezA GCE Route object class.ÚdefaultNc	                 ó¸   — t          |¦  «        | _        || _        || _        || _        || _        || _        || _        || _        t          j
        | ¦  «         d S ro   )r�   rŠ   r_   Ú
dest_ranger	  r  Útagsrx   rŒ   r
   r;   )	r@   rŠ   r_   rQ  r	  r  rR  rx   rŒ   s	            r*   r;   zGCERoute.__init__Ù  sY   € õ �b‘'”'ˆŒØˆŒ	Ø$ˆŒØ ˆŒØˆŒØˆŒ	ØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó8   — | j                              | ¬¦  «        S )zc
        Destroy this route

        :return: True if successful
        :rtype:  ``bool``
        )Úroute)rx   Úex_destroy_router   s    r*   r—   zGCERoute.destroyî  s   € ð Œ{×+Ò+°$Ð+Ñ7Ô7Ð7r,   c                 ó†   — t          | j        d| j        ¦  «        }d                     | j        | j        | j        |¦  «        S )Nr_   z9<GCERoute id="{}" name="{}" dest_range="{}" network="{}">)Úgetattrr  r<   rŠ   r_   rQ  )r@   Únetwork_names     r*   r€   zGCERoute.__repr__ø  sA   € Ý˜tœ|¨V°T´\ÑBÔBˆàJ×QÒQØŒGØŒIØŒOØñ	
ô 
ð 	
r,   )rO  NNNr£   r2   r,   r*   rN  rN  Ö  sZ   € € € € € Ø#Ð#ð ØØØð!ð !ð !ð !ð*8ð 8ð 8ð
ð 
ð 
ð 
ð 
r,   rN  c                   ó$   ‡ — e Zd ZdZdˆ fd„	Zˆ xZS )ÚGCENodeSizez$A GCE Node Size (MachineType) class.Nc	           
      óh   •— || _         t          ¦   «                              ||||||||¬¦  «         d S r$  )rŒ   r:   r;   )
r@   rŠ   r_   ÚramÚdiskÚ	bandwidthÚpricerx   rŒ   rE   s
            €r*   r;   zGCENodeSize.__init__  s9   ø€ ØˆŒ
Ý‰Œ×Ò˜˜T 3¨¨i¸ÀÈeÐÑTÔTÐTÐTÐTr,   ro   )r/   r0   r1   rp   r;   rs   rt   s   @r*   rZ  rZ    sM   ø€ € € € € Ø.Ð.ðUð Uð Uð Uð Uð Uð Uð Uð Uð Ur,   rZ  c                   ó0   — e Zd ZdZdd„Zd	d„Zdd„Zd„ ZdS )
Ú
GCEProjectzGCE Project information.Nc                 óœ   — t          |¦  «        | _        || _        || _        || _        || _        || _        t          j        | ¦  «         d S ro   )	r�   rŠ   r_   ÚmetadataÚquotasrx   rŒ   r
   r;   )r@   rŠ   r_   rc  rd  rx   rŒ   s          r*   r;   zGCEProject.__init__  sI   € Ý�b‘'”'ˆŒØˆŒ	Ø ˆŒØˆŒØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   Fc                 ó:   — | j                              ||¬¦  «        S )á^  
        Set common instance metadata for the project. Common uses
        are for setting 'sshKeys', or setting a project-wide
        'startup-script' for all nodes (instances).  Passing in
        ``None`` for the 'metadata' parameter will clear out all common
        instance metadata *except* for 'sshKeys'. If you also want to
        update 'sshKeys', set the 'force' parameter to ``True``.

        :param  metadata: Dictionary of metadata. Can be either a standard
                          python dictionary, or the format expected by
                          GCE (e.g. {'items': [{'key': k1, 'value': v1}, ...}]
        :type   metadata: ``dict`` or ``None``

        :param  force: Force update of 'sshKeys'. If force is ``False`` (the
                       default), existing sshKeys will be retained. Setting
                       force to ``True`` will either replace sshKeys if a new
                       a new value is supplied, or deleted if no new value
                       is supplied.
        :type   force: ``bool``

        :return: True if successful
        :rtype:  ``bool``
        )rc  Úforce)rx   Úex_set_common_instance_metadata)r@   rc  rg  s      r*   Úset_common_instance_metadataz'GCEProject.set_common_instance_metadata  s    € ð2 Œ{×:Ò:ÀHÐTYÐ:ÑZÔZÐZr,   c                 ó:   — | j                              ||¬¦  «        S )á.  
        Used to retain Compute Engine resource usage, storing the CSV data in
        a Google Cloud Storage bucket. See the
        `docs <https://cloud.google.com/compute/docs/usage-export>`_ for more
        information. Please ensure you have followed the necessary setup steps
        prior to enabling this feature (e.g. bucket exists, ACLs are in place,
        etc.)

        :param  bucket: Name of the Google Cloud Storage bucket. Specify the
                        name in either 'gs://<bucket_name>' or the full URL
                        'https://storage.googleapis.com/<bucket_name>'.
        :type   bucket: ``str``

        :param  prefix: Optional prefix string for all reports.
        :type   prefix: ``str`` or ``None``

        :return: True if successful
        :rtype:  ``bool``
        )ÚbucketÚprefix)rx   Úex_set_usage_export_bucket)r@   rl  rm  s      r*   Úset_usage_export_bucketz"GCEProject.set_usage_export_bucket2  s   € ð* Œ{×5Ò5¸VÈFÐ5ÑSÔSÐSr,   c                 óB   — d                      | j        | j        ¦  «        S )Nz<GCEProject id="{}" name="{}">rÜ   r   s    r*   r€   zGCEProject.__repr__I  s   € Ø/×6Ò6°t´wÀÄ	ÑJÔJÐJr,   ro   ©NF)r/   r0   r1   rp   r;   ri  ro  r€   r2   r,   r*   ra  ra    sr   € € € € € Ø"Ð"ð!ð !ð !ð !ð[ð [ð [ð [ð6Tð Tð Tð Tð.Kð Kð Kð Kð Kr,   ra  c                   ó   — e Zd Zdd„Zd„ ZdS )Ú	GCERegionNc	                 ó¸   — t          |¦  «        | _        || _        || _        || _        || _        || _        || _        || _        t          j
        | ¦  «         d S ro   )r�   rŠ   r_   ÚstatusÚzonesrd  r.  rx   rŒ   r
   r;   )	r@   rŠ   r_   ru  rv  rd  r.  rx   rŒ   s	            r*   r;   zGCERegion.__init__N  sW   € Ý�b‘'”'ˆŒØˆŒ	ØˆŒØˆŒ
ØˆŒØ$ˆŒØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 óN   — d                      | j        | j        | j        ¦  «        S )Nz*<GCERegion id="{}" name="{}", status="{}">©r<   rŠ   r_   ru  r   s    r*   r€   zGCERegion.__repr__Y  s)   € Ø;×BÒBØŒGØŒIØŒKñ
ô 
ð 	
r,   ro   )r/   r0   r1   r;   r€   r2   r,   r*   rs  rs  M  s7   € € € € € ð	!ð 	!ð 	!ð 	!ð
ð 
ð 
ð 
ð 
r,   rs  c                   ó    ‡ — e Zd Zdˆ fd„	Zˆ xZS )ÚGCESnapshotNc                 ód   •— || _         t          ¦   «                              ||||||¬¦  «         d S )Nr8  )ru  r:   r;   )	r@   rŠ   r_   Úsizeru  rx   rŒ   ÚcreatedrE   s	           €r*   r;   zGCESnapshot.__init__b  s5   ø€ ØˆŒÝ‰Œ×Ò˜˜V T¨5°'ÀÐÑEÔEÐEÐEÐEr,   r<  )r/   r0   r1   r;   rs   rt   s   @r*   rz  rz  a  sG   ø€ € € € € ðFð Fð Fð Fð Fð Fð Fð Fð Fð Fr,   rz  c                   ó"   — e Zd Zdd„Zd„ Zd„ ZdS )ÚGCETargetHttpProxyNc                 ó’   — t          |¦  «        | _        || _        || _        || _        |pi | _        t          j        | ¦  «         d S ro   )r�   rŠ   r_   Úurlmaprx   rŒ   r
   r;   )r@   rŠ   r_   r�  rx   rŒ   s         r*   r;   zGCETargetHttpProxy.__init__h  sF   € Ý�b‘'”'ˆŒØˆŒ	ØˆŒØˆŒØ�[˜bˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 óB   — d                      | j        | j        ¦  «        S )Nz&<GCETargetHttpProxy id="{}" name="{}">rÜ   r   s    r*   r€   zGCETargetHttpProxy.__repr__p  s   € Ø7×>Ò>¸t¼wÈÌ	ÑRÔRÐRr,   c                 ó8   — | j                              | ¬¦  «        S )zr
        Destroy this Target HTTP Proxy.

        :return:  True if successful
        :rtype:   ``bool``
        )Útargethttpproxy)rx   Úex_destroy_targethttpproxyr   s    r*   r—   zGCETargetHttpProxy.destroys  r  r,   ro   )r/   r0   r1   r;   r€   r—   r2   r,   r*   r  r  g  sN   € € € € € ð!ð !ð !ð !ðSð Sð SðLð Lð Lð Lð Lr,   r  c                   ó<   — e Zd ZdZ	 	 	 	 	 dd„Zd„ Zd„ Zd„ Zd„ ZdS )	ÚGCETargetHttpsProxyz=GCETargetHttpsProxy represents the TargetHttpsProxy resource.Nc                 ó‚   — || _         || _        || _        || _        || _        || _        t          j        | ¦  «         dS )a_  
        :param  name:  Name of the resource. Provided by the client when the
                       resource is created. The name must be 1-63 characters
                       long, and comply with RFC1035. Specifically, the name
                       must be 1-63 characters long and match the regular
                       expression [a-z]([-a-z0-9]*[a-z0-9])? which means the
                       first character must be a lowercase letter, and all
                       following characters must be a dash, lowercase letter,
                       or digit, except the last character, which cannot be a
                       dash.
        :type   name: ``str``

        :param  description:  An optional description of this resource.
                              Provide this property when you create the
                              resource.
        :type   description: ``str``

        :param  sslcertificates:  URLs to SslCertificate resources that are
                                   used to authenticate connections between
                                   users and the load balancer. Currently,
                                   exactly one SSL certificate must be
                                   specified.
        :type   sslcertificates: ``list`` of :class:`GCESslcertificates`

        :param  urlmap:  A fully-qualified or valid partial URL to the
                          UrlMap resource that defines the mapping from URL
                          to the BackendService. For example, the following
                          are all valid URLs for specifying a URL map:   - ht
                          tps://www.googleapis.compute/v1/projects/project/gl
                          obal/urlMaps/url-map  -
                          projects/project/global/urlMaps/url-map  -
                          global/urlMaps/url-map
        :type   urlmap: :class:`GCEUrlMap`

        :keyword  driver:  An initialized :class: `GCENodeDriver`
        :type   driver: :class:`:class: `GCENodeDriver``

        :keyword  extra:  A dictionary of extra information.
        :type   extra: ``:class: ``dict````

        N)r_   rÃ   Ússlcertificatesr�  rx   rŒ   r
   r;   )r@   rŠ   r_   rÃ   r‰  r�  rx   rŒ   s           r*   r;   zGCETargetHttpsProxy.__init__�  sH   € ðh ˆŒ	Ø&ˆÔØ.ˆÔØˆŒØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó   — d| j         z  S )Nz<GCETargetHttpsProxy name="%s">r8  r   s    r*   r€   zGCETargetHttpsProxy.__repr__½  s   € Ø0°D´IÑ>Ð>r,   c                 ó:   — | j                              | |¬¦  «        S )a  
        Set the SSL Certificates for this TargetHTTPSProxy

        :param  sslcertificates: SSL Certificates to set.
        :type   sslcertificates: ``list`` of :class:`GCESslCertificate`

        :return:  True if successful
        :rtype:   ``bool``
        )Útargethttpsproxyr‰  )rx   Ú'ex_targethttpsproxy_set_sslcertificates)r@   r‰  s     r*   Úset_sslcertificatesz'GCETargetHttpsProxy.set_sslcertificatesÀ  s)   € ð Œ{×BÒBØ!°?ð Cñ 
ô 
ð 	
r,   c                 ó:   — | j                              | |¬¦  «        S )a  
        Changes the URL map for TargetHttpsProxy.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  targethttpsproxy:  Name of the TargetHttpsProxy resource
                                   whose URL map is to be set.
        :type   targethttpsproxy: ``str``

        :param  urlmap:  UrlMap to set.
        :type   urlmap: :class:`GCEUrlMap`

        :return:  True
        :rtype: ``bool``
        )rŒ  r�  )rx   Úex_targethttpsproxy_set_urlmap)r@   r�  s     r*   Ú
set_urlmapzGCETargetHttpsProxy.set_urlmapÏ  s    € ð& Œ{×9Ò9È4ÐX^Ð9Ñ_Ô_Ð_r,   c                 ó8   — | j                              | ¬¦  «        S )zw
        Destroy this TargetHttpsProxy.

        :return:  Return True if successful.
        :rtype: ``bool``
        )rŒ  )rx   Úex_destroy_targethttpsproxyr   s    r*   r—   zGCETargetHttpsProxy.destroyä  ó   € ð Œ{×6Ò6ÈÐ6ÑMÔMÐMr,   )NNNNN)	r/   r0   r1   rp   r;   r€   rŽ  r‘  r—   r2   r,   r*   r‡  r‡  ~  s„   € € € € € ØGÐGð ØØØØð:!ð :!ð :!ð :!ðx?ð ?ð ?ð
ð 
ð 
ð`ð `ð `ð*Nð Nð Nð Nð Nr,   r‡  c                   ó"   — e Zd Zdd„Zd„ Zd„ ZdS )ÚGCETargetInstanceNc                 óœ   — t          |¦  «        | _        || _        || _        || _        || _        || _        t          j        | ¦  «         d S ro   )	r�   rŠ   r_   rc   Únoderx   rŒ   r
   r;   )r@   rŠ   r_   rc   r˜  rx   rŒ   s          r*   r;   zGCETargetInstance.__init__ð  sI   € Ý�b‘'”'ˆŒØˆŒ	ØˆŒ	ØˆŒ	ØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó8   — | j                              | ¬¦  «        S )zo
        Destroy this Target Instance

        :return:  True if successful
        :rtype:   ``bool``
        )Útargetinstance)rx   Úex_destroy_targetinstancer   s    r*   r—   zGCETargetInstance.destroyù  rà   r,   c           	      ó¦   — d                      | j        | j        | j        j        t	          | j        d¦  «        r| j        j        p| j        ¦  «        S )Nz9<GCETargetInstance id="{}" name="{}" zone="{}" node="{}">r_   )r<   rŠ   r_   rc   r²   r˜  r   s    r*   r€   zGCETargetInstance.__repr__  sJ   € ØJ×QÒQØŒGØŒIØŒIŒNÝ�T”Y Ñ'Ô'Ð:¨D¬I¬NÐG¸d¼iñ	
ô 
ð 	
r,   ro   r   r2   r,   r*   r–  r–  ï  sI   € € € € € ð!ð !ð !ð !ðJð Jð Jð
ð 
ð 
ð 
ð 
r,   r–  c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )ÚGCEAutoscalerzERepresents a autoscaling policy object used to scale Instance Groups.Nc                 óª   — t          |¦  «        | _        || _        || _        || _        || _        || _        || _        t          j	        | ¦  «         d S ro   )
r�   rŠ   r_   rc   ÚtargetÚpolicyrx   rŒ   r
   r;   )r@   rŠ   r_   rc   r   r¡  rx   rŒ   s           r*   r;   zGCEAutoscaler.__init__  sP   € Ý�b‘'”'ˆŒØˆŒ	ØˆŒ	ØˆŒØˆŒØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó8   — | j                              | ¬¦  «        S )zk
        Destroy this Autoscaler.

        :return:  True if successful
        :rtype:   ``bool``
        )Ú
autoscaler)rx   Úex_destroy_autoscalerr   s    r*   r—   zGCEAutoscaler.destroy  ó   € ð Œ{×0Ò0¸DÐ0ÑAÔAÐAr,   c                 ón   — d                      | j        | j        | j        j        | j        j        ¦  «        S )Nz7<GCEAutoScaler id="{}" name="{}" zone="{}" target="{}">)r<   rŠ   r_   rc   r   r   s    r*   r€   zGCEAutoscaler.__repr__#  s3   € ØH×OÒOØŒGØŒIØŒIŒNØŒKÔñ	
ô 
ð 	
r,   ro   r£   r2   r,   r*   rž  rž    sO   € € € € € ØOÐOð!ð !ð !ð !ðBð Bð Bð
ð 
ð 
ð 
ð 
r,   rž  c                   ó&   — e Zd ZdZdd„Zd„ Zd„ ZdS )ÚGCEInstanceTemplatezDRepresents a machine configuration used in creating Instance Groups.Nc                 ó€   — t          |¦  «        | _        || _        || _        || _        t          j        | ¦  «         d S ro   )r�   rŠ   r_   rx   rŒ   r
   r;   )r@   rŠ   r_   rx   rŒ   s        r*   r;   zGCEInstanceTemplate.__init__/  s;   € Ý�b‘'”'ˆŒØˆŒ	ØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó‚   — d                      | j        | j        | j        d                              dd¦  «        ¦  «        S )Nz8<GCEInstanceTemplate id="{}" name="{}" machineType="{}">Ú
propertiesÚmachineTypeÚUNKNOWN)r<   rŠ   r_   rŒ   rT   r   s    r*   r€   zGCEInstanceTemplate.__repr__6  s>   € ØI×PÒPØŒGØŒIØŒJ�|Ô$×(Ò(¨¸	ÑBÔBñ
ô 
ð 	
r,   c                 ó8   — | j                              | ¬¦  «        S )zw
        Destroy this InstanceTemplate.

        :return:  Return True if successful.
        :rtype: ``bool``
        )Úinstancetemplate)rx   Úex_destroy_instancetemplater   s    r*   r—   zGCEInstanceTemplate.destroy=  r”  r,   ro   rá   r2   r,   r*   r¨  r¨  ,  sQ   € € € € € ØNÐNð!ð !ð !ð !ð
ð 
ð 
ðNð Nð Nð Nð Nr,   r¨  c                   óF   — e Zd ZdZ	 	 	 	 d
d„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
dS )r¹   z7GCEInstanceGroup represents the InstanceGroup resource.Nc	                 ó�   — || _         || _        || _        || _        || _        || _        || _        t          j        | ¦  «         dS )a(  
        :param  name:  Required. The name of the instance group. The name
                       must be 1-63 characters long, and comply with RFC1035.
        :type   name: ``str``

        :param  zone:  The URL of the zone where the instance group is
                       located.
        :type   zone: :class:`GCEZone`

        :param  network:  The URL of the network to which all instances in
                          the instance group belong.
        :type   network: :class:`GCENetwork`

        :param  subnetwork:  The URL of the subnetwork to which all instances
                             in the instance group belong.
        :type   subnetwork: :class:`GCESubnetwork`

        :param  named_ports:  Assigns a name to a port number. For example:
                              {name: "http", port: 80}  This allows the
                              system to reference ports by the assigned name
                              instead of a port number. Named ports can also
                              contain multiple ports. For example: [{name:
                              "http", port: 80},{name: "http", port: 8080}]
                              Named ports apply to all instances in this
                              instance group.
        :type   named_ports: ``"<type 'list'>"``

        N)	r_   rc   r  Ú
subnetworkÚnamed_portsrx   rŒ   r
   r;   )	r@   rŠ   r_   rc   rx   rŒ   r  r³  r´  s	            r*   r;   zGCEInstanceGroup.__init__K  sN   € ðP ˆŒ	ØˆŒ	ØˆŒØ$ˆŒØ&ˆÔØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 óL   — d                      | j        | j        j        ¦  «        S )Nz&<GCEInstanceGroup name="{}" zone="{}">)r<   r_   rc   r   s    r*   r€   zGCEInstanceGroup.__repr__|  s   € Ø7×>Ò>¸t¼yÈ$Ì)Ì.ÑYÔYÐYr,   c                 ó8   — | j                              | ¬¦  «        S )zt
        Destroy this InstanceGroup.

        :return:  Return True if successful.
        :rtype: ``bool``
        ©Úinstancegroup)rx   Úex_destroy_instancegroupr   s    r*   r—   zGCEInstanceGroup.destroy  s   € ð Œ{×3Ò3À$Ð3ÑGÔGÐGr,   c                 ó:   — | j                              | |¬¦  «        S )á  
        Adds a list of instances to the specified instance group. All of the
        instances in the instance group must be in the same
        network/subnetwork. Read  Adding instances for more information.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  instancegroup:  The Instance Group where you are
                                adding instances.
        :type   instancegroup: :class:``GCEInstanceGroup``

        :param  node_list: List of nodes to add.
        :type   node_list: ``list`` of :class:`Node` or ``list`` of
                           :class:`GCENode`

        :return:  Return True if successful.
        :rtype: ``bool``
        ©r¸  Ú	node_list)rx   Úex_instancegroup_add_instances©r@   r½  s     r*   Úadd_instanceszGCEInstanceGroup.add_instances‰  s    € ð, Œ{×9Ò9ÈÐXaÐ9ÑbÔbÐbr,   c                 ó8   — | j                              | ¬¦  «        S )a†  
        Lists the instances in the specified instance group.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute
        * https://www.googleapis.com/auth/compute.readonly

        :return:  List of :class:`GCENode` objects.
        :rtype: ``list`` of :class:`GCENode` objects.
        r·  )rx   Úex_instancegroup_list_instancesr   s    r*   Úlist_instanceszGCEInstanceGroup.list_instances¡  s   € ð Œ{×:Ò:ÈÐ:ÑNÔNÐNr,   c                 ó:   — | j                              | |¬¦  «        S )a²  
        Removes one or more instances from the specified instance group,
        but does not delete those instances.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  instancegroup:  The Instance Group where you are
                                removng instances.
        :type   instancegroup: :class:``GCEInstanceGroup``

        :param  node_list: List of nodes to add.
        :type   node_list: ``list`` of :class:`Node` or ``list`` of
                           :class:`GCENode`

        :return:  Return True if successful.
        :rtype: ``bool``
        r¼  )rx   Ú!ex_instancegroup_remove_instancesr¿  s     r*   Úremove_instancesz!GCEInstanceGroup.remove_instances°  s(   € ð* Œ{×<Ò<Ø¨)ð =ñ 
ô 
ð 	
r,   c                 ó:   — | j                              | |¬¦  «        S )a²  
        Sets the named ports for the specified instance group.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  named_ports:  Assigns a name to a port number. For example:
                              {name: "http", port: 80}  This allows the
                              system to reference ports by the assigned name
                              instead of a port number. Named ports can also
                              contain multiple ports. For example: [{name:
                              "http", port: 80},{name: "http", port: 8080}]
                              Named ports apply to all instances in this
                              instance group.
        :type   named_ports: ``list`` of {'name': ``str``, 'port`: ``int``}

        :return:  Return True if successful.
        :rtype: ``bool``
        ©r¸  r´  )rx   Ú ex_instancegroup_set_named_ports©r@   r´  s     r*   Úset_named_portsz GCEInstanceGroup.set_named_portsÉ  s(   € ð, Œ{×;Ò;Ø¨Kð <ñ 
ô 
ð 	
r,   ©NNNN)r/   r0   r1   rp   r;   r€   r—   rÀ  rÃ  rÆ  rË  r2   r,   r*   r¹   r¹   H  s£   € € € € € ØAÐAð ØØØð/!ð /!ð /!ð /!ðbZð Zð ZðHð Hð Hðcð cð cð0Oð Oð Oð
ð 
ð 
ð2
ð 
ð 
ð 
ð 
r,   r¹   c                   óP   — e Zd ZdZdd„Zd„ Zd„ Zd„ Zd„ Zd„ Z	d	„ Z
d
„ Zd„ Zd„ ZdS )r»   zÀ
    GCE Instance Groups Manager class.

    Handles 'managed' Instance Groups.
    For more information on Instance Groups, see:
    https://cloud.google.com/compute/docs/instance-groups
    Nc	                 ó¼   — t          |¦  «        | _        || _        || _        |pd| _        || _        || _        || _        || _        t          j
        | ¦  «         dS )a]  
        :param  id: Internal identifier of Instance Group.  Display only.
        :type   id: ``str``

        :param  name: The name of this Instance Group.
        :type   name: ``str``

        :param  zone: Zone in witch the Instance Group belongs
        :type   zone: :class: ``GCEZone``

        :param  size: Number of instances in this Instance Group.
        :type   size: ``int``

        :param  template: An initialized :class:``GCEInstanceTemplate``
        :type   driver: :class:``GCEInstanceTemplate``

        :param  instance_group: An initialized :class:``GCEInstanceGroup``
        :type   driver: :class:``GCEInstanceGroup``

        :param  driver: An initialized :class:``GCENodeDriver``
        :type   driver: :class:``GCENodeDriver``

        :param  extra: A dictionary of extra information.
        :type   extra: ``dict``
        r   N)r�   rŠ   r_   rc   r|  Útemplaterº   rx   rŒ   r
   r;   )	r@   rŠ   r_   rc   r|  rÏ  rº   rx   rŒ   s	            r*   r;   z GCEInstanceGroupManager.__init__í  s^   € õ4 �b‘'”'ˆŒØˆŒ	ØˆŒ	Ø�I˜AˆŒ	Ø ˆŒØ,ˆÔØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó8   — | j                              | ¬¦  «        S )z®
        Destroy this Instance Group.  Destroys all instances managed by the
        Instance Group.

        :return:  True if successful
        :rtype:   ``bool``
        ©Úmanager)rx   Úex_destroy_instancegroupmanagerr   s    r*   r—   zGCEInstanceGroupManager.destroy  s   € ð Œ{×:Ò:À4Ð:ÑHÔHÐHr,   c                 ó8   — | j                              | ¬¦  «        S )a  
        Lists all of the instances in this managed instance group.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute
        * https://www.googleapis.com/auth/compute.readonly

        :return:  ``list`` of ``dict`` containing instance URI and
                  currentAction. See
                  ex_instancegroupmanager_list_managed_instances for
                  more details.
        :rtype: ``list``
        rÑ  )rx   Ú.ex_instancegroupmanager_list_managed_instancesr   s    r*   Úlist_managed_instancesz.GCEInstanceGroupManager.list_managed_instances  s   € ð  Œ{×IÒIÐRVÐIÑWÔWÐWr,   c                 ó:   — | j                              | |¬¦  «        S )a  
        Set the Instance Template for this Instance Group.

        :param  instancetemplate: Instance Template to set.
        :type   instancetemplate: :class:`GCEInstanceTemplate`

        :return:  True if successful
        :rtype:   ``bool``
        )rÒ  r¯  )rx   Ú,ex_instancegroupmanager_set_instancetemplate)r@   r¯  s     r*   Úset_instancetemplatez,GCEInstanceGroupManager.set_instancetemplate.  s*   € ð Œ{×GÒGØÐ+;ð Hñ 
ô 
ð 	
r,   c                 ó8   — | j                              | ¬¦  «        S )a(  
        Recreate instances in a Managed Instance Group.

        :return:  ``list`` of ``dict`` containing instance URI and
                  currentAction. See
                  ex_instancegroupmanager_list_managed_instances for
                  more details.
        :rtype: ``list``
        rÑ  )rx   Ú*ex_instancegroupmanager_recreate_instancesr   s    r*   Úrecreate_instancesz*GCEInstanceGroupManager.recreate_instances=  s   € ð Œ{×EÒEÈdÐEÑSÔSÐSr,   c                 ó:   — | j                              | |¬¦  «        S )aü  
        Removes one or more instances from the specified instance group,
        and delete those instances.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  node_list: List of nodes to delete.
        :type   node_list: ``list`` of :class:`Node` or ``list`` of
                           :class:`GCENode`

        :return:  Return True if successful.
        :rtype: ``bool``
        )rÒ  r½  )rx   Ú(ex_instancegroupmanager_delete_instancesr¿  s     r*   Údelete_instancesz(GCEInstanceGroupManager.delete_instancesJ  s)   € ð" Œ{×CÒCØ Ið Dñ 
ô 
ð 	
r,   c                 ó:   — | j                              | |¬¦  «        S )a^  
        Set the number of instances for this Instance Group.  An increase in
        num_instances will result in VMs being created.  A decrease will result
        in VMs being destroyed.

        :param  size: Number to instances to resize to.
        :type   size: ``int``

        :return:  True if successful
        :rtype:   ``bool``
        )rÒ  r|  )rx   Úex_instancegroupmanager_resize)r@   r|  s     r*   ÚresizezGCEInstanceGroupManager.resize_  s   € ð Œ{×9Ò9À$ÈTÐ9ÑRÔRÐRr,   c                 óD   — | j                              | j        |¬¦  «        S )aÃ  
        Sets the named ports for the instance group controlled by this manager.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  named_ports:  Assigns a name to a port number. For example:
                              {name: "http", port: 80}  This allows the
                              system to reference ports by the assigned name
                              instead of a port number. Named ports can also
                              contain multiple ports. For example: [{name:
                              "http", port: 80},{name: "http", port: 8080}]
                              Named ports apply to all instances in this
                              instance group.
        :type   named_ports: ``list`` of {'name': ``str``, 'port`: ``int``}

        :return:  Return True if successful.
        :rtype: ``bool``
        rÈ  )rx   rÉ  rº   rÊ  s     r*   rË  z'GCEInstanceGroupManager.set_named_portsn  s+   € ð, Œ{×;Ò;ØÔ-¸;ð <ñ 
ô 
ð 	
r,   c                 ó<   — | j                              | ||¬¦  «        S )a  
        Sets the autohealing policies for the instance for the instance group
        controlled by this manager.

        :param  healthcheck: Healthcheck to add
        :type   healthcheck: :class:`GCEHealthCheck`

        :param  initialdelaysec:  The time to allow an instance to boot and
                                  applications to fully start before the first
                                  health check
        :type   initialdelaysec:  ``int``

        :return:  Return True if successful.
        :rtype: ``bool``
        )rÒ  rü   Úinitialdelaysec)rx   Ú/ex_instancegroupmanager_set_autohealingpolicies)r@   rü   rå  s      r*   Úset_autohealingpoliciesz/GCEInstanceGroupManager.set_autohealingpoliciesˆ  s+   € ð" Œ{×JÒJØ kÀ?ð Kñ 
ô 
ð 	
r,   c                 ó:   — d| j         | j        j         | j        fz  S )Nz7<GCEInstanceGroupManager name="%s" zone="%s" size="%d">)r_   rc   r|  r   s    r*   r€   z GCEInstanceGroupManager.__repr__�  s&   € ØHØŒIØŒIŒNØŒIðL
ñ 
ð 	
r,   ro   )r/   r0   r1   rp   r;   r—   rÖ  rÙ  rÜ  rß  râ  rË  rç  r€   r2   r,   r*   r»   r»   ä  sÆ   € € € € € ðð ð"!ð "!ð "!ð "!ðH	Ið 	Ið 	IðXð Xð Xð$
ð 
ð 
ðTð Tð Tð
ð 
ð 
ð*Sð Sð Sð
ð 
ð 
ð4
ð 
ð 
ð*
ð 
ð 
ð 
ð 
r,   r»   c                   óJ   — e Zd Zdd„Zd„ Zd„ Zd„ Zd„ Zdd„Zdd	„Z	d
„ Z
d„ ZdS )ÚGCETargetPoolNc                 óª   — t          |¦  «        | _        || _        || _        || _        || _        || _        || _        t          j	        | ¦  «         d S ro   )
r�   rŠ   r_   r­   rÖ   Únodesrx   rŒ   r
   r;   )r@   rŠ   r_   r­   rÖ   rì  rx   rŒ   s           r*   r;   zGCETargetPool.__init__¦  sQ   € Ý�b‘'”'ˆŒØˆŒ	ØˆŒØ(ˆÔØˆŒ
ØˆŒØˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 ó:   — | j                              | |¬¦  «        S )zÄ
        Add a node to this target pool.

        :param  node: Node to add
        :type   node: ``str`` or :class:`Node`

        :return:  True if successful
        :rtype:   ``bool``
        ©r  r˜  )rx   Úex_targetpool_add_node©r@   r˜  s     r*   Úadd_nodezGCETargetPool.add_node°  s   € ð Œ{×1Ò1¸TÈÐ1ÑMÔMÐMr,   c                 ó:   — | j                              | |¬¦  «        S )zÌ
        Remove a node from this target pool.

        :param  node: Node to remove
        :type   node: ``str`` or :class:`Node`

        :return:  True if successful
        :rtype:   ``bool``
        rî  )rx   Úex_targetpool_remove_noderð  s     r*   Úremove_nodezGCETargetPool.remove_node½  s   € ð Œ{×4Ò4ÀÈ4Ð4ÑPÔPÐPr,   c                 ó:   — | j                              | |¬¦  «        S )zê
        Add a healthcheck to this target pool.

        :param  healthcheck: Healthcheck to add
        :type   healthcheck: ``str`` or :class:`GCEHealthCheck`

        :return:  True if successful
        :rtype:   ``bool``
        ©r  rü   )rx   Úex_targetpool_add_healthcheck©r@   rü   s     r*   Úadd_healthcheckzGCETargetPool.add_healthcheckÊ  s    € ð Œ{×8Ò8ÀDÐVaÐ8ÑbÔbÐbr,   c                 ó:   — | j                              | |¬¦  «        S )zò
        Remove a healthcheck from this target pool.

        :param  healthcheck: Healthcheck to remove
        :type   healthcheck: ``str`` or :class:`GCEHealthCheck`

        :return:  True if successful
        :rtype:   ``bool``
        rö  )rx   Ú ex_targetpool_remove_healthcheckrø  s     r*   Úremove_healthcheckz GCETargetPool.remove_healthcheck×  s(   € ð Œ{×;Ò;Ø¨ð <ñ 
ô 
ð 	
r,   çš™™™™™¹?c                 ó<   — | j                              | ||¬¦  «        S )a/  
        Set a backup targetpool.

        :param  backup_targetpool: The existing targetpool to use for
                                   failover traffic.
        :type   backup_targetpool: :class:`GCETargetPool`

        :param  failover_ratio: The percentage of healthy VMs must fall at or
                                below this value before traffic will be sent
                                to the backup targetpool (default 0.10)
        :type   failover_ratio: ``float``

        :return:  True if successful
        :rtype:   ``bool``
        )r  Úbackup_targetpoolÚfailover_ratio)rx   Ú#ex_targetpool_set_backup_targetpool)r@   rÿ  r   s      r*   Úset_backup_targetpoolz#GCETargetPool.set_backup_targetpoolæ  s,   € ð" Œ{×>Ò>ØØ/Ø)ð ?ñ 
ô 
ð 	
r,   c                 ó:   — | j                              | |¬¦  «        S )al  
        Return a hash of target pool instances and their health.

        :param  node: Optional node to specify if only a specific node's
                      health status should be returned
        :type   node: ``str``, ``Node``, or ``None``

        :return: List of hashes of nodes and their respective health
        :rtype:  ``list`` of ``dict``
        rî  )rx   Úex_targetpool_get_healthrð  s     r*   Ú
get_healthzGCETargetPool.get_healthý  s   € ð Œ{×3Ò3¸tÈ$Ð3ÑOÔOÐOr,   c                 ó8   — | j                              | ¬¦  «        S )zk
        Destroy this Target Pool

        :return:  True if successful
        :rtype:   ``bool``
        )r  )rx   Úex_destroy_targetpoolr   s    r*   r—   zGCETargetPool.destroy  r¥  r,   c                 óX   — d                      | j        | j        | j        j        ¦  «        S )Nz-<GCETargetPool id="{}" name="{}" region="{}">)r<   rŠ   r_   r­   r   s    r*   r€   zGCETargetPool.__repr__  s,   € Ø>×EÒEØŒGØŒIØŒKÔñ
ô 
ð 	
r,   ro   ©rý  )r/   r0   r1   r;   rñ  rô  rù  rü  r  r  r—   r€   r2   r,   r*   rê  rê  ¥  sº   € € € € € ð!ð !ð !ð !ðNð Nð NðQð Qð Qðcð cð cð
ð 
ð 
ð
ð 
ð 
ð 
ð.Pð Pð Pð PðBð Bð Bð
ð 
ð 
ð 
ð 
r,   rê  c                   ó(   — e Zd ZdZ	 dd„Zd„ Zd„ ZdS )Ú	GCEUrlMapzA GCE URL Map.Nc	                 óÈ   — t          |¦  «        | _        || _        || _        |pg | _        |pg | _        |pg | _        || _        |pi | _        t          j
        | ¦  «         d S ro   )r�   rŠ   r_   Údefault_serviceÚ
host_rulesÚpath_matchersÚtestsrx   rŒ   r
   r;   )	r@   rŠ   r_   r  r  r  r  rx   rŒ   s	            r*   r;   zGCEUrlMap.__init__   sm   € õ �b‘'”'ˆŒØˆŒ	Ø.ˆÔØ$Ð*¨ˆŒØ*Ð0¨bˆÔØ�[˜bˆŒ
ØˆŒØ�[˜bˆŒ
ÝÔ˜4Ñ Ô Ð Ð Ð r,   c                 óB   — d                      | j        | j        ¦  «        S )Nz<GCEUrlMap id="{}" name="{}">rÜ   r   s    r*   r€   zGCEUrlMap.__repr__5  s   € Ø.×5Ò5°d´g¸t¼yÑIÔIÐIr,   c                 ó8   — | j                              | ¬¦  «        S )zg
        Destroy this URL Map

        :return:  True if successful
        :rtype:   ``bool``
        )r�  )rx   Úex_destroy_urlmapr   s    r*   r—   zGCEUrlMap.destroy8  s   € ð Œ{×,Ò,°DÐ,Ñ9Ô9Ð9r,   ro   rá   r2   r,   r*   r  r    sT   € € € € € ØÐð ð!ð !ð !ð !ð*Jð Jð Jð:ð :ð :ð :ð :r,   r  c                   ón   ‡ — e Zd ZdZdˆ fd„	Zed„ ¦   «         Zed„ ¦   «         Zd„ Zd„ Z	d„ Z
d	„ Zd
„ Zˆ xZS )ÚGCEZonez;Subclass of NodeLocation to provide additional information.Nc                 óÜ   •— || _         || _        || _        || _        |                     d¦  «        d         }t          ¦   «                              t          |¦  «        ||||¬¦  «         d S )Nú-r   )rŠ   r_   Úcountryrx   rŒ   )ru  Úmaintenance_windowsr.  rŒ   Úsplitr:   r;   r�   )
r@   rŠ   r_   ru  r  r.  rx   rŒ   r  rE   s
            €r*   r;   zGCEZone.__init__F  sd   ø€ ØˆŒØ#6ˆÔ Ø$ˆŒØˆŒ
Ø—*’*˜S‘/”/ !Ô$ˆÝ‰Œ×Ò�C ™GœG¨$¸ÈÐV[ÐÑ\Ô\Ð\Ð\Ð\r,   c                 ó*   — |                       ¦   «         S )zl
        Returns the time until the next Maintenance Window as a
        datetime.timedelta object.
        )Ú_get_time_until_mwr   s    r*   Útime_until_mwzGCEZone.time_until_mwN  s   € ð ×&Ò&Ñ(Ô(Ð(r,   c                 ó*   — |                       ¦   «         S )zm
        Returns the duration of the next Maintenance Window as a
        datetime.timedelta object.
        )Ú_get_next_mw_durationr   s    r*   Únext_mw_durationzGCEZone.next_mw_durationW  s   € ð ×)Ò)Ñ+Ô+Ð+r,   c                 ó>   — t           j                              ¦   «         S )zT
        Returns current UTC time.

        Can be overridden in unittests.
        )r!   Úutcnowr   s    r*   Ú_nowzGCEZone._now`  s   € õ Ô ×'Ò'Ñ)Ô)Ð)r,   c                 óÀ   — d}d}| j         sdS t          | j         ¦  «        dk    r| j         d         S | j         D ]#}t          |d         ¦  «        }|r||k     r|}|}Œ$|S )a%  
        Returns the next Maintenance Window.

        :return:  A dictionary containing maintenance window info (or None if
                  no maintenance windows are scheduled)
                  The dictionary contains 4 keys with values of type ``str``
                      - name: The name of the maintenance window
                      - description: Description of the maintenance window
                      - beginTime: RFC3339 Timestamp
                      - endTime: RFC3339 Timestamp
        :rtype:   ``dict`` or ``None``
        Nr¶   r   Ú	beginTime)r  Úlenr+   )r@   ÚbeginÚnext_windowÚmwÚ
begin_nexts        r*   Ú_get_next_maintzGCEZone._get_next_mainti  sˆ   € ð ˆØˆàÔ'ð 	Ø�4åˆtÔ'Ñ(Ô(¨AÒ-Ð-ØÔ+¨AÔ.Ð.àÔ*ð 	!ð 	!ˆBÝ.¨r°+¬Ñ?Ô?ˆJàð !˜z¨EÒ1Ð1Ø"�Ø �øàÐr,   c                 óŽ   — |                       ¦   «         }|sdS |                      ¦   «         }t          |d         ¦  «        }||z
  S )zñ
        Returns time until next maintenance window.

        :return:  Time until next maintenance window (or None if no
                  maintenance windows are scheduled)
        :rtype:   :class:`datetime.timedelta` or ``None``
        Nr%  )r+  r#  r+   )r@   r(  ÚnowÚ
next_begins       r*   r  zGCEZone._get_time_until_mwˆ  sL   € ð ×*Ò*Ñ,Ô,ˆàð 	Ø�4Ø�iŠi‰kŒkˆÝ*¨;°{Ô+CÑDÔDˆ
à˜CÑÐr,   c                 ó�   — |                       ¦   «         }|sdS t          |d         ¦  «        }t          |d         ¦  «        }||z
  S )zû
        Returns the duration of the next maintenance window.

        :return:  Duration of next maintenance window (or None if no
                  maintenance windows are scheduled)
        :rtype:   :class:`datetime.timedelta` or ``None``
        Nr%  ÚendTime)r+  r+   )r@   r(  r.  Únext_ends       r*   r  zGCEZone._get_next_mw_duration™  sQ   € ð ×*Ò*Ñ,Ô,ˆàð 	Ø�4Ý*¨;°{Ô+CÑDÔDˆ
Ý(¨°YÔ)?Ñ@Ô@ˆà˜*Ñ$Ð$r,   c                 óN   — d                      | j        | j        | j        ¦  «        S )Nz'<GCEZone id="{}" name="{}" status="{}">rx  r   s    r*   r€   zGCEZone.__repr__ª  s)   € Ø8×?Ò?ØŒGØŒIØŒKñ
ô 
ð 	
r,   ro   )r/   r0   r1   rp   r;   Úpropertyr  r   r#  r+  r  r  r€   rs   rt   s   @r*   r  r  C  sÊ   ø€ € € € € ØEÐEð]ð ]ð ]ð ]ð ]ð ]ð ð)ð )ñ „Xð)ð ð,ð ,ñ „Xð,ð*ð *ð *ðð ð ð> ð  ð  ð"%ð %ð %ð"
ð 
ð 
ð 
ð 
ð 
ð 
r,   r  c                   óÌ
  ‡ — e Zd ZdZeZdZdZej	        Z
dZddgiZej        ej        ej        ej        ej        ej        ej        dœZdZi d	d	“d
d
“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd“dd “d!d"“d#d#“d$d%“d&d'd(œ¥Zg d)¢g d*¢g d+¢g d,¢d-gg d.¢g d/¢g d0¢g d1¢g d2¢g d3¢g d4¢d5œZg d6¢Z	 	 	 	 	 	 �d5ˆ fd8„	Zed9„ ¦   «         Zed:„ ¦   «         Zed;„ ¦   «         Zed<„ ¦   «         Z�d6d=„Zd>„ Zd?„ Z d@„ Z!dA„ Z"dB„ Z#dC„ Z$dD„ Z%�d7dE„Z&�d7dF„Z'�d8dH„Z(�d7dI„Z)dJ„ Z*dK„ Z+dL„ Z,�d8dM„Z-�d8dN„Z.�d8dO„Z/dP„ Z0dQ„ Z1dR„ Z2�d7dS„Z3dT„ Z4�d9dV„Z5dW„ Z6�d7dX„Z7dY„ Z8dZ„ Z9d[„ Z:�d7d\„Z;�d7d]„Z<d^„ Z=d_„ Z>�d7d`„Z?da„ Z@�d7db„ZA�d7dc„ZBdd„ ZC	 	 	 	 	 �d:df„ZD�d7dg„ZE	 	 	 	 	 	 �d;dj„ZFg d7d7d7dGd7d7fdk„ZG	 	 	 	 	 	 	 	 �d<dl„ZH	 	 	 	 	 	 	 	 	 	 	 	 �d=dp„ZI	 	 	 	 	 	 	 	 	 �d>dr„ZJ	 	 	 	 	 	 	 �d?ds„ZK�d@dt„ZL	 	 	 	 �dAdu„ZM	 �d6dv„ZN	 	 	 	 	 �dBdx„ZO�d@dy„ZP	 	 	 	 	 	 �d5dz„ZQ�dCd|„ZR	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 �dDd„ZS	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 �dEd€„ZT	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 �dFd�„ZU	 	 	 	 	 	 	 	 	 	 �dGd„„ZV�dHd…„ZW	 	 	 	 �dId†„ZX	 	 �dJd‡„ZY	 	 	 �dKdˆ„ZZ	 �d@d‰„Z[d7dmd7d7d7dUdUdŠd}d7d~dUd7e\d7d7d7d7d7d7d7d7d7d7fd‹„Z]dŒ„ Z^�d7d�„Z_	 �dLd�„Z`	 	 	 	 	 	 �d5d�„Zad‘„ Zb	 	 	 	 	 	 �dMd’„Zcd“„ Zdd”„ Zed•„ Zfd–„ Zgd—„ Zhd˜„ Zid™„ Zj�d7dš„Zk	 �dNdœ„Zld�„ Zmdž„ ZndŸ„ Zod „ Zpd¡„ Zqd¢„ Zrd£„ Zsg fd¤„Ztd¥„ Zud¦„ Zvd§„ Zwd¨„ Zx�d7d©„Zydª„ Zzd«„ Z{d¬„ Z|d­„ Z}�d6d®„Z~	 	 	 	 	 	 	 	 	 �dOd¯„Zd°„ Z€�d7d±„Z��dPd²„Z‚d³„ Zƒd´„ Z„dµ„ Z…	 	 	 	 �dAd¶„Z†d·„ Z‡d¸„ Zˆd¹„ Z‰dº„ ZŠd»„ Z‹�dQd½„ZŒ�dPd¾„Z��dPd¿„ZŽ�dPdÀ„Z��dPdÁ„Z�dÂ„ Z‘dÃ„ Z’dÄ„ Z“�dRdÅ„Z”dUdGdŠe\fdÆ„Z•dÇ„ Z–dÈ„ Z—dÉ„ Z˜dÊ„ Z™dË„ ZšdÌ„ Z›dÍ„ ZœdÎ„ Z��d7dÏ„Zž�d7dÐ„ZŸ�d7dÑ„Z dÒ„ Z¡dÓ„ Z¢dÔ„ Z£�d8dÕ„Z¤�d9dÖ„Z¥	 �d9d×„Z¦dØ„ Z§dÙ„ Z¨�d7dÚ„Z©�d7dÛ„ZªdÜ„ Z«�d7dÝ„Z¬dÞ„ Z­�d7dß„Z®dà„ Z¯�d8dá„Z°dâ„ Z±dã„ Z²dä„ Z³då„ Z´�d7dæ„Zµ�d7dç„Z¶dè„ Z·�d7dé„Z¸�d7dê„Z¹dë„ Zº�d7dì„Z»dí„ Z¼dî„ Z½dï„ Z¾�d7dð„Z¿dñ„ ZÀ�dSdò„ZÁdó„ ZÂdô„ ZÃdõ„ ZÄ�dTdö„ZÅd÷„ ZÆdø„ ZÇdù„ ZÈ	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 	 �dUdú„ZÉdû„ ZÊdü„ ZËdý„ ZÌdþ„ ZÍ	 	 	 	 �dVdÿ„ZÎ�d „ ZÏ�d„ ZÐ�d„ ZÑ�d„ ZÒ�d„ ZÓ�d„ ZÔ�d„ ZÕ�d„ ZÖ�d„ Z×�d	„ ZØ�d
„ ZÙ�d„ ZÚ�d„ ZÛ�dS�d„ZÜ�d„ ZÝ�d„ ZÞ�d„ Zß�d„ Zà�d„ Zá�d„ Zâ�d„ Zã�d„ Zä�d„ Zå�d„ Zæ�d„ Zç�d„ Zè�d„ Zé�d„ Zê�d7�d„Zë�d„ Zì�d„ Zí�dW�d „Zî�d!„ Zïi �d"eÑ“�d#eÒ“�d$eá“�d%eÔ“�d&eÕ“�d'eÓ“�d(eÚ“�d)eÜ“�d*eÝ“�d+eØ“�d,eÞ“�d-eß“�d.eà“�d/eÖ“�d0eâ“�d1eã“�d2eä“eåeìeí�d3œ¥Zð�d7�d4„Zñˆ xZòS (X  ÚGCENodeDrivera–  
    GCE Node Driver class.

    This is the primary driver for interacting with Google Compute Engine.  It
    contains all of the standard libcloud methods, plus additional ex_* methods
    for more features.

    Note that many methods allow either objects or strings (or lists of
    objects/strings).  In most cases, passing strings instead of objects will
    result in additional GCE API calls.
    ÚgooglezGoogle Compute Enginezhttps://cloud.google.com/Úcreate_nodeÚssh_key)ÚPROVISIONINGÚSTAGINGÚRUNNINGÚSTOPPINGÚ	SUSPENDEDÚ
TERMINATEDr­  z https://www.googleapis.com/auth/Úbigqueryzcloud-platformz
compute-rozcompute.readonlyz
compute-rwÚcomputeÚ	datastorezlogging-writezlogging.writeÚ
monitoringzmonitoring-writezmonitoring.writezservice-controlÚservicecontrolzservice-managementzservice.managementÚsqlÚ
sqlservicez	sql-adminzsqlservice.adminzstorage-fullzdevstorage.full_controlz
storage-roúdevstorage.read_onlyz
storage-rwzdevstorage.read_writeÚ	taskqueuezuseraccounts-rozcloud.useraccounts.readonlyzcloud.useraccountszuserinfo.email)zuseraccounts-rwzuserinfo-email)zcentos-6zcentos-7zcentos-8)zcos-betazcos-devz
cos-stable)zcoreos-alphazcoreos-betazcoreos-stable)zdebian-8zdebian-9z	debian-10zopensuse-leap)zrhel-6zrhel-7zrhel-8)zsles-11zsles-12zsles-15)zsles-11-byoszsles-12-byoszsles-12-sp2-sap-byoszsles-12-sp3-sap-byoszsuse-manager-proxy-byoszsuse-manager-server-byos)zsles-12-sp2-sapzsles-12-sp3-sapzsles-12-sp4-sapzsles-15-sap)zubuntu-1404-ltszubuntu-1604-ltszubuntu-minimal-1604-ltszubuntu-1710zubuntu-1804-ltszubuntu-minimal-1804-ltszubuntu-1810zubuntu-minimal-1810zubuntu-1904zubuntu-minimal-1904zubuntu-1910zubuntu-minimal-1910zubuntu-2004-ltszubuntu-minimal-2004-lts)z windows-1709-core-for-containerszwindows-1709-corezwindows-2008-r2zwindows-2012-r2-corezwindows-2012-r2zwindows-2016-corezwindows-2016)zsql-ent-2012-win-2012-r2zsql-std-2012-win-2012-r2zsql-web-2012-win-2012-r2zsql-ent-2014-win-2012-r2zsql-ent-2014-win-2016zsql-std-2014-win-2012-r2zsql-web-2014-win-2012-r2zsql-ent-2016-win-2012-r2zsql-ent-2016-win-2016zsql-std-2016-win-2012-r2zsql-std-2016-win-2016zsql-web-2016-win-2012-r2zsql-web-2016-win-2016zsql-ent-2017-win-2016zsql-exp-2017-win-2012-r2zsql-exp-2017-win-2016zsql-std-2017-win-2016zsql-web-2017-win-2016)zcentos-cloudz	cos-cloudzcoreos-cloudzdebian-cloudzopensuse-cloudz
rhel-cloudz
suse-cloudzsuse-byos-cloudzsuse-sap-cloudzubuntu-os-cloudzwindows-cloudzwindows-sql-cloud)ÚHTTPÚHTTPSÚHTTP2ÚTCPÚSSLNc                 óú  •— |st          d¦  «        ‚|| _        || _        || _        |pt          j        dz   | j        z   | _         t          ¦   «         j        ||fi |¤Ž d 	                    t          | j        ¦  «        | _        d| _        d| _        |r|                      |¦  «        | _        nd| _        d| _        d| _        | j        r |                      | j        ¦  «        | _        nd| _        i | _        dS )a*  
        :param  user_id: The email address (for service accounts) or Client ID
                         (for installed apps) to be used for authentication.
        :type   user_id: ``str``

        :param  key: The RSA Key (for service accounts) or file path containing
                     key or Client Secret (for installed apps) to be used for
                     authentication.
        :type   key: ``str``

        :keyword  datacenter: The name of the datacenter (zone) used for
                              operations.
        :type     datacenter: ``str``

        :keyword  project: Your GCE project name. (required)
        :type     project: ``str``

        :keyword  auth_type: Accepted values are "SA" or "IA" or "GCE"
                             ("Service Account" or "Installed Application" or
                             "GCE" if libcloud is being used on a GCE instance
                             with service account enabled).
                             If not supplied, auth_type will be guessed based
                             on value of user_id or if the code is being
                             executed in a GCE instance.
        :type     auth_type: ``str``

        :keyword  scopes: List of authorization URLs. Default is empty and
                          grants read/write to Compute, Storage, DNS.
        :type     scopes: ``list``

        :keyword  credential_file: Path to file for caching authentication
                                   information used by GCEConnection.
        :type     credential_file: ``str``
        z7Project name must be specified using "project" keyword.ú.r9   N)r¼   r7   rC   Úscopesr   Údefault_credential_filer8   r:   r;   r<   r=   Ú	base_pathÚ
_zone_dictÚ
_zone_listÚex_get_zonerc   Ú_region_dictÚ_region_listÚ_get_region_from_zoner­   Ú_ex_volume_dict)
r@   rA   rB   Ú
datacenterrC   r7   rO  r8   rD   rE   s
            €r*   r;   zGCENodeDriver.__init__:  s  ø€ ð\ ð 	[ÝÐYÑZÔZÐZà"ˆŒØˆŒØˆŒàÐbÕ5ÔMÐPSÑSÐVZÔVbÑbð 	Ôð 	�‰ŒÔ˜ #Ð0Ð0¨Ð0Ð0Ð0ð 3×9Ò9½+ÀtÄ|ÑTÔTˆŒàˆŒØˆŒàð 	Ø×(Ò(¨Ñ4Ô4ˆDŒIˆIàˆDŒIà ˆÔØ ˆÔàŒ9ð 	Ø×4Ò4°T´YÑ?Ô?ˆDŒKˆKàˆDŒKð  "ˆÔÐÐr,   c                 óh   — | j         €%|                      ¦   «         }d„ |D ¦   «         | _         | j         S )Nc                 ó   — i | ]
}|j         |“ŒS r2   r8  )Ú.0rc   s     r*   ú
<dictcomp>z+GCENodeDriver.zone_dict.<locals>.<dictcomp>�  s   € ÐAÐAÐA°4˜tœy¨$ÐAÐAÐAr,   )rR  Úex_list_zones)r@   rv  s     r*   Ú	zone_dictzGCENodeDriver.zone_dictŒ  s8   € àŒ?Ð"Ø×&Ò&Ñ(Ô(ˆEØAÐA¸5ÐAÑAÔAˆDŒOàŒÐr,   c                 ót   — | j         €+t          | j                             ¦   «         ¦  «        | _         | j         S ro   )rS  Úlistr_  Úvaluesr   s    r*   Ú	zone_listzGCENodeDriver.zone_list”  s/   € àŒ?Ð"Ý" 4¤>×#8Ò#8Ñ#:Ô#:Ñ;Ô;ˆDŒOàŒÐr,   c                 óh   — | j         €%|                      ¦   «         }d„ |D ¦   «         | _         | j         S )Nc                 ó   — i | ]
}|j         |“ŒS r2   r8  )r\  r­   s     r*   r]  z-GCENodeDriver.region_dict.<locals>.<dictcomp>Ÿ  s   € Ð KÐ KÐ K¸ ¤¨fÐ KÐ KÐ Kr,   )rU  Úex_list_regions)r@   Úregionss     r*   Úregion_dictzGCENodeDriver.region_dict›  s;   € àÔÐ$Ø×*Ò*Ñ,Ô,ˆGØ KÐ KÀ7Ð KÑ KÔ KˆDÔàÔ Ð r,   c                 ót   — | j         €+t          | j                             ¦   «         ¦  «        | _         | j         S ro   )rV  ra  rh  rb  r   s    r*   Úregion_listzGCENodeDriver.region_list£  s3   € àÔÐ$Ý $ TÔ%5×%<Ò%<Ñ%>Ô%>Ñ ?Ô ?ˆDÔàÔ Ð r,   c                 ó  — t          |t          ¦  «        st          d¦  «        ‚|j        }|j        d         j        }d|i}|€d}||d<   |�||d<   d|i}	d	                     ||¦  «        }
| j                             |
d
||	¬¦  «         dS )aL  
        Add a network interface access configuration to a node.

        :keyword  node: The existing target Node (instance) that will receive
                        the new access config.
        :type     node: ``Node``

        :keyword  name: Name of the new access config.
        :type     node: ``str``

        :keyword  nat_ip: The external existing static IP Address to use for
                          the access config. If not provided, an ephemeral
                          IP address will be allocated.
        :type     nat_ip: ``str`` or ``None``

        :keyword  config_type: The type of access config to create. Currently
                               the only supported type is 'ONE_TO_ONE_NAT'.
        :type     config_type: ``str`` or ``None``

        :return: True if successful
        :rtype:  ``bool``
        ú*Must specify a valid libcloud node object.rc   r_   NÚONE_TO_ONE_NATÚtypeÚnatIPÚnetworkInterfacez&/zones/{}/instances/{}/addAccessConfigÚPOST©r^   ÚdatarI   T©r¸   r   r¼   r_   rŒ   r<   r{   Úasync_request)r@   r˜  r_   ÚnicÚnat_ipÚconfig_typeÚ	node_namerÆ   ÚconfigrI   rQ   s              r*   Úex_add_access_configz"GCENodeDriver.ex_add_access_configª  s¬   € õ0 ˜$¥Ñ%Ô%ð 	KÝÐIÑJÔJÐJØ”Iˆ	Ø”J˜vÔ&Ô+ˆ	à˜$�ˆàÐØ*ˆKØ$ˆˆv‰àÐØ$ˆF�7‰OØ$ cÐ*ˆØ:×AÒAÀ)ÈYÑWÔWˆØŒ×%Ò% g°fÀ6ÐRXÐ%ÑYÔYÐYàˆtr,   c                 óð   — t          |t          ¦  «        st          d¦  «        ‚|j        }|j        d         j        }||dœ}d                     ||¦  «        }| j                             |d|¬¦  «         dS )a¦  
        Delete a network interface access configuration from a node.

        :keyword  node: The existing target Node (instance) for the request.
        :type     node: ``Node``

        :keyword  name: Name of the access config.
        :type     name: ``str``

        :keyword  nic: Name of the network interface.
        :type     nic: ``str``

        :return: True if successful
        :rtype:  ``bool``
        rl  rc   )ÚaccessConfigrp  z)/zones/{}/instances/{}/deleteAccessConfigrq  ©r^   rI   Trt  )r@   r˜  r_   rv  ry  rÆ   rI   rQ   s           r*   Úex_delete_access_configz%GCENodeDriver.ex_delete_access_configÕ  s�   € õ" ˜$¥Ñ%Ô%ð 	KÝÐIÑJÔJÐJØ”Iˆ	Ø”J˜vÔ&Ô+ˆ	à"&¸CÐ@Ð@ˆØ=×DÒDÀYÐPYÑZÔZˆØŒ×%Ò% g°fÀVÐ%ÑLÔLÐLàˆtr,   c                 ón  — t          |t          ¦  «        st          d¦  «        ‚|j        }|j        d         j        }d|j        v r#d|j        d         v r|j        d         d         }nd}|                      ||¦  «        }d                     ||¦  «        }| j                             |d|¬¦  «         d	S )
aŠ  
        Set metadata for the specified node.

        :keyword  node: The existing target Node (instance) for the request.
        :type     node: ``Node``

        :keyword  metadata: Set (or clear with None) metadata for this
                            particular node.
        :type     metadata: ``dict`` or ``None``

        :return: True if successful
        :rtype:  ``bool``
        rl  rc   rc  ÚfingerprintÚabsentz"/zones/{}/instances/{}/setMetadatarq  ©r^   rs  T)	r¸   r   r¼   r_   rŒ   Ú_format_metadatar<   r{   ru  )r@   r˜  rc  ry  rÆ   Ú
current_fpÚbodyrQ   s           r*   Úex_set_node_metadataz"GCENodeDriver.ex_set_node_metadatañ  s¾   € õ ˜$¥Ñ%Ô%ð 	KÝÐIÑJÔJÐJØ”Iˆ	Ø”J˜vÔ&Ô+ˆ	à˜œÐ#Ð#¨¸¼ÀJÔ9OÐ(OÐ(OØœ JÔ/°Ô>ˆJˆJà!ˆJØ×$Ò$ Z°Ñ:Ô:ˆØ6×=Ò=¸iÈÑSÔSˆØŒ×%Ò% g°fÀ4Ð%ÑHÔHÐHàˆtr,   c                 ó
  — t          |t          ¦  «        st          d¦  «        ‚|j        }|j        d         j        }|j        d         }||dœ}d                     ||¦  «        }| j                             |d|¬¦  «         dS )	a[  
        Set labels for the specified node.

        :keyword  node: The existing target Node (instance) for the request.
        :type     node: ``Node``

        :keyword  labels: Set (or clear with None) labels for this node.
        :type     labels: ``dict`` or ``None``

        :return: True if successful
        :rtype:  ``bool``
        rl  rc   ÚlabelFingerprint©Úlabelsr‰  z /zones/{}/instances/{}/setLabelsrq  rƒ  Trt  )r@   r˜  r‹  ry  rÆ   r…  r†  rQ   s           r*   Úex_set_node_labelsz GCENodeDriver.ex_set_node_labels	  s�   € õ ˜$¥Ñ%Ô%ð 	KÝÐIÑJÔJÐJØ”Iˆ	Ø”J˜vÔ&Ô+ˆ	Ø”ZÐ 2Ô3ˆ
Ø °jÐAÐAˆØ4×;Ò;¸IÀyÑQÔQˆØŒ×%Ò% g°fÀ4Ð%ÑHÔHÐHàˆtr,   c                 óÀ   — t          |t          ¦  «        st          d¦  «        ‚|j        d         }||dœ}d|j        z  }| j                             |d|¬¦  «         dS )aZ  
        Set labels for the specified image.

        :keyword  image: The existing target Image for the request.
        :type     image: ``NodeImage``

        :keyword  labels: Set (or clear with None) labels for this image.
        :type     labels: ``dict`` or ``None``

        :return: True if successful
        :rtype:  ``bool``
        z+Must specify a valid libcloud image object.r‰  rŠ  z/global/images/%s/setLabelsrq  rƒ  T)r¸   r	   r¼   rŒ   r_   r{   ru  )r@   r'  r‹  r…  r†  rQ   s         r*   Úex_set_image_labelsz!GCENodeDriver.ex_set_image_labels(	  sn   € õ ˜%¥Ñ+Ô+ð 	LÝÐJÑKÔKÐKØ”[Ð!3Ô4ˆ
Ø °jÐAÐAˆØ/°5´:Ñ>ˆØŒ×%Ò% g°fÀ4Ð%ÑHÔHÐHàˆtr,   c                 ó
  — t          |t          ¦  «        st          d¦  «        ‚|j        }|j        d         j        }|j        d         }||dœ}d                     ||¦  «        }| j                             |d|¬¦  «         dS )	ap  
        Set labels for the specified volume (disk).

        :keyword  volume: The existing target StorageVolume for the request.
        :type     volume: ``StorageVolume``

        :keyword  labels: Set (or clear with None) labels for this image.
        :type     labels: ``dict`` or ``None``

        :return: True if successful
        :rtype:  ``bool``
        z,Must specify a valid libcloud volume object.rc   r‰  rŠ  z/zones/{}/disks/{}/setLabelsrq  rƒ  T)r¸   r   r¼   r_   rŒ   r<   r{   ru  )r@   Úvolumer‹  Úvolume_namerÆ   r…  r†  rQ   s           r*   Úex_set_volume_labelsz"GCENodeDriver.ex_set_volume_labels?	  s�   € õ ˜&¥-Ñ0Ô0ð 	MÝÐKÑLÔLÐLà”kˆØ”L Ô(Ô-ˆ	Ø”\Ð"4Ô5ˆ
Ø °jÐAÐAˆØ0×7Ò7¸	À;ÑOÔOˆØŒ×%Ò% g°fÀ4Ð%ÑHÔHÐHàˆtr,   c                 óú   — t          |t          ¦  «        st          d¦  «        ‚|j        }|j        d         j        }d                     ||¦  «        }| j                             |d¬¦  «        j        }|d         S )a  
        Fetch the console/serial port output from the node.

        :keyword  node: The existing target Node (instance) for the request.
        :type     node: ``Node``

        :return: A string containing serial port output of the node.
        :rtype:  ``str``
        rl  rc   z!/zones/{}/instances/{}/serialPortr\   r]   Úcontents)	r¸   r   r¼   r_   rŒ   r<   r{   rQ   rS   )r@   r˜  ry  rÆ   rQ   rW   s         r*   Úex_get_serial_outputz"GCENodeDriver.ex_get_serial_outputY	  sy   € õ ˜$¥Ñ%Ô%ð 	KÝÐIÑJÔJÐJØ”Iˆ	Ø”J˜vÔ&Ô+ˆ	Ø5×<Ò<¸YÈ	ÑRÔRˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà˜
Ô#Ð#r,   c                 ó    — t          d| |dœ|¤ŽS )a  
        Wrap a list method in a :class:`GCEList` iterator.

        >>> for sublist in driver.ex_list(driver.ex_list_urlmaps).page(1):
        ...   sublist
        ...
        [<GCEUrlMap id="..." name="cli-map">]
        [<GCEUrlMap id="..." name="lc-map">]
        [<GCEUrlMap id="..." name="web-map">]

        :param  list_fn: A bound list method from :class:`GCENodeDriver`.
        :type   list_fn: ``instancemethod``

        :return: An iterator that returns sublists from list_fn.
        :rtype: :class:`GCEList`
        )rx   ry   r2   )rv   )r@   ry   rD   s      r*   Úex_listzGCENodeDriver.ex_listm	  s   € õ$ Ð>˜d¨GÐ>Ð>°vÐ>Ð>Ð>r,   c                 ót  ‡ — g }‰                       |¦  «        }|€d}n
d|j        z  }‰ j                             |d¬¦  «        j        }d|v rk|€U|d                              ¦   «         D ]9}ˆ fd„|                     dg ¦  «        D ¦   «         }|                     |¦  «         Œ:nˆ fd	„|d         D ¦   «         }|S )
a±  
        Return a list of DiskTypes for a zone or all.

        :keyword  zone: The zone to return DiskTypes from. For example:
                        'us-central1-a'.  If None, will return DiskTypes from
                        self.zone.  If 'all', will return all DiskTypes.
        :type     zone: ``str`` or ``None``

        :return: A list of static DiskType objects.
        :rtype: ``list`` of :class:`GCEDiskType`
        Nú/aggregated/diskTypesz/zones/%s/diskTypesr\   r]   rO   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   ©Ú_to_disktype©r\  Úar@   s     €r*   ú
<listcomp>z3GCENodeDriver.ex_list_disktypes.<locals>.<listcomp>›	  s'   ø€ Ð%[Ð%[Ð%[¸q d×&7Ò&7¸Ñ&:Ô&:Ð%[Ð%[Ð%[r,   Ú	diskTypesc                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   r›  r�  s     €r*   rŸ  z3GCENodeDriver.ex_list_disktypes.<locals>.<listcomp>ž	  s'   ø€ Ð!RÐ!RÐ!R¸1 $×"3Ò"3°AÑ"6Ô"6Ð!RÐ!RÐ!Rr,   ©Ú	_set_zoner_   r{   rQ   rS   rb  rT   rR   )r@   rc   Úlist_disktypesrQ   rW   rm   Úzone_disktypess   `      r*   Úex_list_disktypeszGCENodeDriver.ex_list_disktypes�	  sí   ø€ ð ˆØ�~Š~˜dÑ#Ô#ˆàˆ<Ø-ˆGˆGà+¨t¬yÑ9ˆGØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�hÐÐð ˆ|Ø! 'Ô*×1Ò1Ñ3Ô3ð :ð :�AØ%[Ð%[Ð%[Ð%[ÀAÇEÂEÈ+ÐWYÑDZÔDZÐ%[Ñ%[Ô%[�NØ"×)Ò)¨.Ñ9Ô9Ð9Ð9ð:ð "SÐ!RÐ!RÐ!RÀÈÔ@QÐ!RÑ!RÔ!R�àÐr,   c                 óÔ   — |                      d¦  «        s|                      d¦  «        rd|i}nt          d|z  ¦  «        ‚|r||d<   d}| j                             |d|¬¦  «         d	S )
rk  zhttps://www.googleapis.com/úgs://Ú
bucketNamezInvalid bucket name: %sÚreportNamePrefixz/setUsageExportBucketrq  rƒ  T)Ú
startswithr¼   r{   ru  )r@   rl  rm  rs  rQ   s        r*   rn  z(GCENodeDriver.ex_set_usage_export_bucket¢	  s�   € ð* ×ÒÐ:Ñ;Ô;ð 	A¸v×?PÒ?PÐQXÑ?YÔ?Yð 	AØ  &Ð)ˆDˆDåÐ6¸Ñ?Ñ@Ô@Ð@àð 	.Ø'-ˆDÐ#Ñ$à)ˆØŒ×%Ò% g°fÀ4Ð%ÑHÔHÐHàˆtr,   Fc                 óP  — |r|                       d|¦  «        }d}|                      ¦   «         }|j        d         }|d         }g }d|v r|d         }d}|D ]}	|	d         dk    r|	d	         }Œ|                      |||¦  «        }
||
d
œ}	| j                             |d|	¬¦  «         dS )rf  Únaz/setCommonInstanceMetadataÚcommonInstanceMetadatar�  rO   Ú rB   ÚsshKeysÚvalue©r�  rO   rq  rƒ  T)r„  Úex_get_projectrŒ   Ú_set_project_metadatar{   ru  )r@   rc  rg  rQ   rC   Úcurrent_metadatar�  Úmd_itemsÚcurrent_keysÚmdÚnew_mds              r*   rh  z-GCENodeDriver.ex_set_common_instance_metadataÄ	  sß   € ð2 ð 	=Ø×,Ò,¨T°8Ñ<Ô<ˆHà.ˆà×%Ò%Ñ'Ô'ˆØ"œ=Ð)AÔBÐØ& }Ô5ˆØˆàÐ&Ð&Ð&Ø'¨Ô0ˆHð ˆàð 	+ð 	+ˆBØ�%Œy˜IÒ%Ð%Ø! 'œ{�øà×+Ò+¨H°e¸\ÑJÔJˆà(°6Ð:Ð:ˆØŒ×%Ò% g°fÀ2Ð%ÑFÔFÐFàˆtr,   c                 ó’  ‡ — g }|dk    r‰                       |¦  «        }|€d}n|dk    rd}n
d|j        z  }‰ j                             |d¬¦  «        j        }d|v rk|€U|d                              ¦   «         D ]9}ˆ fd	„|                     d
g ¦  «        D ¦   «         }|                     |¦  «         Œ:nˆ fd„|d         D ¦   «         }|S )aH  
        Return a list of static addresses for a region, 'global', or all.

        :keyword  region: The region to return addresses from. For example:
                          'us-central1'.  If None, will return addresses from
                          region of self.zone.  If 'all', will return all
                          addresses. If 'global', it will return addresses in
                          the global namespace.
        :type     region: ``str`` or ``None``

        :return: A list of static address objects.
        :rtype: ``list`` of :class:`GCEAddress`
        ÚglobalNz/aggregated/addressesú/global/addressesú/regions/%s/addressesr\   r]   rO   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   ©Ú_to_addressr�  s     €r*   rŸ  z3GCENodeDriver.ex_list_addresses.<locals>.<listcomp>
  s'   ø€ Ð'\Ð'\Ð'\À¨×(8Ò(8¸Ñ(;Ô(;Ð'\Ð'\Ð'\r,   Ú	addressesc                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   r¿  r�  s     €r*   rŸ  z3GCENodeDriver.ex_list_addresses.<locals>.<listcomp>
  s'   ø€ Ð!QÐ!QÐ!Q¸! $×"2Ò"2°1Ñ"5Ô"5Ð!QÐ!QÐ!Qr,   ©Ú_set_regionr_   r{   rQ   rS   rb  rT   rR   )r@   r­   Úlist_addressesrQ   rW   rm   Úregion_addressess   `      r*   Úex_list_addresseszGCENodeDriver.ex_list_addressesø	  s  ø€ ð ˆà�XÒÐØ×%Ò% fÑ-Ô-ˆFàˆ>Ø-ˆGˆGØ�xÒÐØ)ˆGˆGà-°´Ñ=ˆGØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�hÐÐð ˆ~Ø! 'Ô*×1Ò1Ñ3Ô3ð <ð <�AØ'\Ð'\Ð'\Ð'\ÀQÇUÂUÈ;ÐXZÑE[ÔE[Ð'\Ñ'\Ô'\Ð$Ø"×)Ò)Ð*:Ñ;Ô;Ð;Ð;ð<ð "RÐ!QÐ!QÐ!Q¸xÈÔ?PÐ!QÑ!QÔ!Q�àÐr,   c                 ó’   ‡ — g }‰ j                              dd¬¦  «        j        }ˆ fd„|                     dg ¦  «        D ¦   «         }|S )z 
        Return a list of backend services.

        :return: A list of backend service objects.
        :rtype: ``list`` of :class:`GCEBackendService`
        ú/global/backendServicesr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú_to_backendservice©r\  rÎ   r@   s     €r*   rŸ  z9GCENodeDriver.ex_list_backendservices.<locals>.<listcomp>)
  s'   ø€ Ð^Ð^Ð^¸q × 7Ò 7¸Ñ :Ô :Ð^Ð^Ð^r,   rO   ©r{   rQ   rS   rT   )r@   Úlist_backendservicesrW   s   `  r*   Úex_list_backendservicesz%GCENodeDriver.ex_list_backendservices
  sY   ø€ ð  "ÐØ”?×*Ò*Ð+DÈUÐ*ÑSÔSÔZˆà^Ð^Ð^Ð^ÀHÇLÂLÐQXÐZ\ÑD]ÔD]Ð^Ñ^Ô^Ðà#Ð#r,   c                 ó–   ‡ — g }d}‰ j                              |d¬¦  «        j        }ˆ fd„|                     dg ¦  «        D ¦   «         }|S )z™
        Return the list of health checks.

        :return: A list of health check objects.
        :rtype: ``list`` of :class:`GCEHealthCheck`
        ú/global/httpHealthChecksr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú_to_healthcheck©r\  Úhr@   s     €r*   rŸ  z6GCENodeDriver.ex_list_healthchecks.<locals>.<listcomp>7
  s'   ø€ ÐXÐXÐX¸˜T×1Ò1°!Ñ4Ô4ÐXÐXÐXr,   rO   rÍ  )r@   Úlist_healthchecksrQ   rW   s   `   r*   Úex_list_healthchecksz"GCENodeDriver.ex_list_healthchecks-
  s\   ø€ ð ÐØ,ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆØXÐXÐXÐX¸h¿lºlÈ7ÐTVÑ>WÔ>WÐXÑXÔXÐà Ð r,   c                 ó–   ‡ — g }d}‰ j                              |d¬¦  «        j        }ˆ fd„|                     dg ¦  «        D ¦   «         }|S )zŽ
        Return the list of firewalls.

        :return: A list of firewall objects.
        :rtype: ``list`` of :class:`GCEFirewall`
        ú/global/firewallsr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú_to_firewall©r\  Úfr@   s     €r*   rŸ  z3GCENodeDriver.ex_list_firewalls.<locals>.<listcomp>E
  ó'   ø€ ÐRÐRÐR°1˜$×+Ò+¨AÑ.Ô.ÐRÐRÐRr,   rO   rÍ  )r@   Úlist_firewallsrQ   rW   s   `   r*   Úex_list_firewallszGCENodeDriver.ex_list_firewalls;
  óY   ø€ ð ˆØ%ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆØRÐRÐRÐR¸¿ºÀWÈbÑ8QÔ8QÐRÑRÔRˆàÐr,   c                 ó†  ‡ — g }|rd}d}n$‰                       |¦  «        }|€d}n
d|j        z  }‰ j                             |d¬¦  «        j        }d|v rm|sW|€U|d                              ¦   «         D ]9}ˆ fd„|                     d	g ¦  «        D ¦   «         }|                     |¦  «         Œ:nˆ fd
„|d         D ¦   «         }|S )a±  
        Return the list of forwarding rules for a region or all.

        :keyword  region: The region to return forwarding rules from.  For
                          example: 'us-central1'.  If None, will return
                          forwarding rules from the region of self.region
                          (which is based on self.zone).  If 'all', will
                          return forwarding rules for all regions, which does
                          not include the global forwarding rules.
        :type     region: ``str`` or :class:`GCERegion` or ``None``

        :keyword  global_rules: List global forwarding rules instead of
                                per-region rules.  Setting True will cause
                                'region' parameter to be ignored.
        :type     global_rules: ``bool``

        :return: A list of forwarding rule objects.
        :rtype: ``list`` of :class:`GCEForwardingRule`
        Nú/global/forwardingRulesz/aggregated/forwardingRulesú/regions/%s/forwardingRulesr\   r]   rO   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   ©Ú_to_forwarding_rulerÜ  s     €r*   rŸ  z:GCENodeDriver.ex_list_forwarding_rules.<locals>.<listcomp>p
  s4   ø€ ð /ð /ð /Ø89˜×0Ò0°Ñ3Ô3ð/ð /ð /r,   ÚforwardingRulesc                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   ræ  rÜ  s     €r*   rŸ  z:GCENodeDriver.ex_list_forwarding_rules.<locals>.<listcomp>u
  s'   ø€ Ð(`Ð(`Ð(`È¨×)AÒ)AÀ!Ñ)DÔ)DÐ(`Ð(`Ð(`r,   rÃ  )r@   r­   Úglobal_rulesÚlist_forwarding_rulesrQ   rW   rm   Úregion_forwarding_ruless   `       r*   Úex_list_forwarding_rulesz&GCENodeDriver.ex_list_forwarding_rulesI
  s&  ø€ ð( !#Ðàð 		HØˆFØ/ˆGˆGà×%Ò% fÑ-Ô-ˆFàˆ~Ø7��à7¸6¼;ÑG�Ø”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�hÐÐð  ð a F NØ! 'Ô*×1Ò1Ñ3Ô3ð Jð J�Að/ð /ð /ð /Ø=>¿UºUÐCTÐVXÑ=YÔ=Yð/ñ /ô /Ð+ð *×0Ò0Ð1HÑIÔIÐIÐIð	Jð )aÐ(`Ð(`Ð(`ÈhÐW^ÔN_Ð(`Ñ(`Ô(`Ð%à$Ð$r,   c                 ó2  — |}|�|                       ||¬¦  «        S |                       d|¬¦  «        }t          | j                             ¦   «         ¦  «        D ]=}	 |                     |                       ||¬¦  «        ¦  «         Œ.# t
          $ r Y Œ:w xY w|S )a  
        Return a list of image objects. If no project is specified, a list of
        all non-deprecated global and vendor images images is returned. By
        default, only non-deprecated images are returned.

        :keyword  ex_project: Optional alternate project name.
        :type     ex_project: ``str``, ``list`` of ``str``, or ``None``

        :keyword  ex_include_deprecated: If True, even DEPRECATED images will
                                         be returned.
        :type     ex_include_deprecated: ``bool``

        :return:  List of GCENodeImage objects
        :rtype:   ``list`` of :class:`GCENodeImage`
        N©Ú
ex_projectÚex_include_deprecated)Úex_list_project_imagesra  ÚIMAGE_PROJECTSÚkeysrR   r“   )r@   rð  rñ  ÚdepÚ
image_listÚimg_projs         r*   Úlist_imageszGCENodeDriver.list_imagesy
  sË   € ð  $ˆàÐ!Ø×.Ò.¸*Ð\_Ð.Ñ`Ô`Ð`Ø×0Ò0¸DÐX[Ð0Ñ\Ô\ˆ
å˜TÔ0×5Ò5Ñ7Ô7Ñ8Ô8ð 	ð 	ˆHðØ×!Ò!Ø×/Ò/¸8Ð[^Ð/Ñ_Ô_ñô ð ð øõ ð ð ð à�ðøøøð Ðs   Á*BÂ
BÂBc                 óJ  — g }d}|€Ž| j                              |d¬¦  «        }|                     dg ¦  «        D ]Y}d|vr)|                     |                      |¦  «        ¦  «         Œ/|r(|                     |                      |¦  «        ¦  «         ŒZ�ng }| j         j        }t          |t          ¦  «        r|g}|D ]å}|                     | j	        |¦  «        }	|	| j         _        	 | j                              |d¬¦  «        }n# t          $ r ‚ w xY w	 || j         _        n# || j         _        w xY w|                     dg ¦  «        D ]Y}d|vr)|                     |                      |¦  «        ¦  «         Œ/|r(|                     |                      |¦  «        ¦  «         ŒZŒæ|S )a2  
        Return a list of image objects for a project. If no project is
        specified, only a list of 'global' images is returned.

        :keyword  ex_project: Optional alternate project name.
        :type     ex_project: ``str``, ``list`` of ``str``, or ``None``

        :keyword  ex_include_deprecated: If True, even DEPRECATED images will
                                         be returned.
        :type     ex_include_deprecated: ``bool``

        :return:  List of GCENodeImage objects
        :rtype:   ``list`` of :class:`GCENodeImage`
        ú/global/imagesNr\   r]   rO   r.  )r{   rX   rT   r`   Ú_to_node_imager>   r¸   r�   r’   rC   r“   )
r@   rð  rñ  rø  rQ   rW   ÚimgÚsave_request_pathÚprojr•   s
             r*   rò  z$GCENodeDriver.ex_list_project_imagesš
  s  € ð ˆØ"ˆàÐØ”×8Ò8¸ÈÐ8ÑOÔOˆHà—|’| G¨RÑ0Ô0ð Eð E�Ø sÐ*Ð*Ø×&Ò& t×':Ò':¸3Ñ'?Ô'?Ñ@Ô@Ð@Ð@à,ð EØ#×*Ò*¨4×+>Ò+>¸sÑ+CÔ+CÑDÔDÐDøñEð ˆKà $¤Ô <Ðå˜*¥cÑ*Ô*ð *Ø(˜\�
à"ð Ið I�à#4×#<Ò#<¸T¼\È4Ñ#PÔ#PÐ Ø/?�”Ô,ðEØ#œ×@Ò@ÀÐQVÐ@ÑWÔW�H�HøÝ ð ð ð Øðøøøð ð
 4E�D”OÔ0Ð0øÐ3D�D”OÔ0ÐDÐDÐDÐDà#Ÿ<š<¨°Ñ4Ô4ð Ið I�CØ#¨3Ð.Ð.Ø#×*Ò*¨4×+>Ò+>¸sÑ+CÔ+CÑDÔDÐDÐDà0ð IØ'×.Ò.¨t×/BÒ/BÀ3Ñ/GÔ/GÑHÔHÐHøðIð Ðs   Ã'DÄD!ÄDÄD!Ä!D/c                 óz   ‡ — g }d}‰ j                              |d¬¦  «        j        }ˆ fd„|d         D ¦   «         }|S )a  
        Return a list of locations (zones).

        The :class:`ex_list_zones` method returns more comprehensive results,
        but this is here for compatibility.

        :return: List of NodeLocation objects
        :rtype: ``list`` of :class:`NodeLocation`
        ú/zonesr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú_to_node_location)r\  Úlocr@   s     €r*   rŸ  z0GCENodeDriver.list_locations.<locals>.<listcomp>ß
  s'   ø€ ÐSÐSÐS¸#˜$×0Ò0°Ñ5Ô5ÐSÐSÐSr,   rO   ©r{   rQ   rS   )r@   Úlist_locationsrQ   rW   s   `   r*   r  zGCENodeDriver.list_locationsÒ
  sP   ø€ ð ˆØˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆØSÐSÐSÐSÀÈ'ÔARÐSÑSÔSˆàÐr,   c                 ó–   ‡ — g }d}‰ j                              |d¬¦  «        j        }ˆ fd„|                     dg ¦  «        D ¦   «         }|S )z…
        Return the list of routes.

        :return: A list of route objects.
        :rtype: ``list`` of :class:`GCERoute`
        ú/global/routesr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú	_to_route©r\  Únr@   s     €r*   rŸ  z0GCENodeDriver.ex_list_routes.<locals>.<listcomp>í
  s%   ø€ ÐLÐLÐL¨Q�t—~’~ aÑ(Ô(ÐLÐLÐLr,   rO   rÍ  )r@   Úlist_routesrQ   rW   s   `   r*   Úex_list_routeszGCENodeDriver.ex_list_routesã
  sY   ø€ ð ˆØ"ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆØLÐLÐLÐL°(·,²,¸wÈÑ2KÔ2KÐLÑLÔLˆàÐr,   c                 ó–   ‡ — g }d}‰ j                              |d¬¦  «        j        }ˆ fd„|                     dg ¦  «        D ¦   «         }|S )a¬  
        Retrieves the list of SslCertificate resources available to the
        specified project.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute
        * https://www.googleapis.com/auth/compute.readonly

        :return: A list of SSLCertificate objects.
        :rtype: ``list`` of :class:`GCESslCertificate`
        ú/global/sslCertificatesr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú_to_sslcertificater�  s     €r*   rŸ  z9GCENodeDriver.ex_list_sslcertificates.<locals>.<listcomp>  s'   ø€ ÐSÐSÐS°A�T×,Ò,¨QÑ/Ô/ÐSÐSÐSr,   rO   rÍ  )r@   Ú	list_datarQ   rW   s   `   r*   Úex_list_sslcertificatesz%GCENodeDriver.ex_list_sslcertificatesñ
  sY   ø€ ð ˆ	Ø+ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆØSÐSÐSÐS¸¿ºÀgÈrÑ9RÔ9RÐSÑSÔSˆ	àÐr,   c                 ó  — |                       |¦  «        }|€d}n
d|j        z  }g }| j                             |d¬¦  «        j        }d|v r¶|€p|d                              ¦   «         D ]T}|                     dg ¦  «        D ];}	 |                     |                      |¦  «        ¦  «         Œ,# t          $ r Y Œ8w xY wŒUnD|d         D ];}	 |                     |                      |¦  «        ¦  «         Œ,# t          $ r Y Œ8w xY w|S )aX  
        Return the list of subnetworks.

        :keyword  region: Region for the subnetwork. Specify 'all' to return
                          the aggregated list of subnetworks.
        :type     region: ``str`` or :class:`GCERegion`

        :return: A list of subnetwork objects.
        :rtype: ``list`` of :class:`GCESubnetwork`
        Nz/aggregated/subnetworksú/regions/%s/subnetworksr\   r]   rO   rI  )
rÄ  r_   r{   rQ   rS   rb  rT   r`   Ú_to_subnetworkr   )r@   r­   rQ   Úlist_subnetworksrW   rm   Úis          r*   Úex_list_subnetworksz!GCENodeDriver.ex_list_subnetworks  s[  € ð ×!Ò! &Ñ)Ô)ˆàˆ>Ø/ˆGˆGà/°6´;Ñ?ˆGàÐØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�hÐÐØˆ~Ø! 'Ô*×1Ò1Ñ3Ô3ð !ð !�AØŸUšU =°"Ñ5Ô5ð !ð !˜ð!Ø,×3Ò3°D×4GÒ4GÈÑ4JÔ4JÑKÔKÐKÐKøÝ4ð !ð !ð !Ø ˜Dð!øøøð!ð!ð " 'Ô*ð ð �AðØ(×/Ò/°×0CÒ0CÀAÑ0FÔ0FÑGÔGÐGÐGøÝ0ð ð ð Ø˜ðøøøð  Ðs$   Â(B,Â,
B9Â8B9Ã	(C2Ã2
C?Ã>C?c                 ó–   ‡ — g }d}‰ j                              |d¬¦  «        j        }ˆ fd„|                     dg ¦  «        D ¦   «         }|S )z‹
        Return the list of networks.

        :return: A list of network objects.
        :rtype: ``list`` of :class:`GCENetwork`
        ú/global/networksr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú_to_networkr
  s     €r*   rŸ  z2GCENodeDriver.ex_list_networks.<locals>.<listcomp>5  s'   ø€ ÐPÐPÐP°˜×)Ò)¨!Ñ,Ô,ÐPÐPÐPr,   rO   rÍ  )r@   Úlist_networksrQ   rW   s   `   r*   Úex_list_networkszGCENodeDriver.ex_list_networks+  sY   ø€ ð ˆØ$ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆØPÐPÐPÐP°h·l²lÀ7ÈBÑ6OÔ6OÐPÑPÔPˆàÐr,   Tc                 óÀ  — |                       |¦  «        }| j                             d|¬¦  «        }|                     dg ¦  «        sg S g }|                      ¦   «          |d                              ¦   «         }d„ |D ¦   «         }t          j        |Ž }|D ]@}	 |                      ||¬¦  «        }	n# t          $ r Y Œ'w xY w| 
                    |	¦  «         ŒAi | _        |S )aZ  
        Return a list of nodes in the current zone or all zones.

        :keyword  ex_zone:  Optional zone name or 'all'
        :type     ex_zone:  ``str`` or :class:`GCEZone` or
                            :class:`NodeLocation` or ``None``

        :keyword  ex_use_disk_cache:  Disk information for each node will
                                   retrieved from a dictionary rather
                                   than making a distinct API call for it.
        :type     ex_use_disk_cache: ``bool``

        :return:  List of Node objects
        :rtype:   ``list`` of :class:`Node`
        Ú	instances©rc   rO   c                 ó:   — g | ]}|                      d g ¦  «        ‘ŒS )r!  ©rT   )r\  Úitems     r*   rŸ  z,GCENodeDriver.list_nodes.<locals>.<listcomp>V  s&   € ÐAÐAÐA°4�T—X’X˜k¨2Ñ.Ô.ÐAÐAÐAr,   )Úuse_disk_cache)r£  r{   re   rT   Ú_ex_populate_volume_dictrb  Ú	itertoolsÚchainÚ_to_noder   r`   rX  )
r@   Úex_zoneÚex_use_disk_cacherc   rW   Ú
list_nodesrO   r!  Úinstancer˜  s
             r*   r-  zGCENodeDriver.list_nodes9  s  € ð  �~Š~˜gÑ&Ô&ˆØ”?×;Ò;¸KÈdÐ;ÑSÔSˆà�|Š|˜G RÑ(Ô(ð 	ØˆIàˆ
ð 	×%Ò%Ñ'Ô'Ð'à˜Ô!×(Ò(Ñ*Ô*ˆØAÐA¸5ÐAÑAÔAˆ	Ý”O YÐ/ˆ	à!ð 	$ð 	$ˆHðØ—}’} XÐ>O�}ÑPÔP��øÝ(ð 	ð 	ð 	ð �ð	øøøð ×Ò˜dÑ#Ô#Ð#Ð#ð  "ˆÔàÐs   ÂB1Â1
B>Â=B>c                 óz   ‡ — g }d}‰ j                              |d¬¦  «        j        }ˆ fd„|d         D ¦   «         }|S )zˆ
        Return the list of regions.

        :return: A list of region objects.
        :rtype: ``list`` of :class:`GCERegion`
        z/regionsr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú
_to_region)r\  Úrr@   s     €r*   rŸ  z1GCENodeDriver.ex_list_regions.<locals>.<listcomp>x  s%   ø€ ÐFÐFÐF¨q˜Ÿš¨Ñ*Ô*ÐFÐFÐFr,   rO   r  )r@   Úlist_regionsrQ   rW   s   `   r*   rf  zGCENodeDriver.ex_list_regionsn  sP   ø€ ð ˆØˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆØFÐFÐFÐF°H¸WÔ4EÐFÑFÔFˆàÐr,   c                 óœ  ‡ ‡— g }‰                       |¦  «        }|€d}n
d|j        z  }‰ j                             |d¬¦  «        j        }t          dd¬¦  «        Šd	|v rm|€V|d	                              ¦   «         D ]:}ˆˆ fd
„|                     dg ¦  «        D ¦   «         }|                     |¦  «         Œ;nˆˆ fd„|d	         D ¦   «         }|S )aU  
        Return a list of sizes (machineTypes) in a zone.

        :keyword  location: Location or Zone for sizes
        :type     location: ``str`` or :class:`GCEZone` or
                            :class:`NodeLocation` or ``None``

        :return:  List of GCENodeSize objects
        :rtype:   ``list`` of :class:`GCENodeSize`
        Nz/aggregated/machineTypesz/zones/%s/machineTypesr\   r]   r@  Úgce_instances©Údriver_typeÚdriver_namerO   c                 ó<   •— g | ]}‰                      |‰¦  «        ‘ŒS r2   ©Ú_to_node_size©r\  ÚsÚinstance_pricesr@   s     €€r*   rŸ  z,GCENodeDriver.list_sizes.<locals>.<listcomp>˜  s6   ø€ ð "ð "ð "ØCD˜×*Ò*¨1¨oÑ>Ô>ð"ð "ð "r,   ÚmachineTypesc                 ó<   •— g | ]}‰                      |‰¦  «        ‘ŒS r2   r:  r<  s     €€r*   rŸ  z,GCENodeDriver.list_sizes.<locals>.<listcomp>�  s)   ø€ Ð`Ð`Ð`È˜d×0Ò0°°OÑDÔDÐ`Ð`Ð`r,   )	r£  r_   r{   rQ   rS   r   rb  rT   rR   )	r@   ÚlocationÚ
list_sizesrc   rQ   rW   rm   Ú
zone_sizesr>  s	   `       @r*   rB  zGCENodeDriver.list_sizes|  s  øø€ ð ˆ
Ø�~Š~˜hÑ'Ô'ˆàˆ<Ø0ˆGˆGà.°$´)Ñ<ˆGà”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆå%°)ÈÐYÑYÔYˆà�hÐÐð ˆ|Ø! 'Ô*×1Ò1Ñ3Ô3ð 2ð 2�Að"ð "ð "ð "ð "ØHIÏÊÈnÐ^`ÑHaÔHað"ñ "ô "�Jð ×%Ò% jÑ1Ô1Ð1Ð1ð	2ð aÐ`Ð`Ð`Ð`ÈhÐW^ÔN_Ð`Ñ`Ô`�
àÐr,   c                 ó–   ‡ — g }d}‰ j                              |d¬¦  «        j        }ˆ fd„|                     dg ¦  «        D ¦   «         }|S )z¤
        Return the list of disk snapshots in the project.

        :return:  A list of snapshot objects
        :rtype:   ``list`` of :class:`GCESnapshot`
        z/global/snapshotsr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú_to_snapshot)r\  r=  r@   s     €r*   rŸ  z3GCENodeDriver.ex_list_snapshots.<locals>.<listcomp>«  rÞ  r,   rO   rÍ  )r@   Úlist_snapshotsrQ   rW   s   `   r*   Úex_list_snapshotszGCENodeDriver.ex_list_snapshots¡  rá  r,   c                 óŽ   ‡ — d}‰ j                              |d¬¦  «        j        }ˆ fd„|                     dg ¦  «        D ¦   «         S )zª
        Return the list of target HTTP proxies.

        :return:  A list of target http proxy objects
        :rtype:   ``list`` of :class:`GCETargetHttpProxy`
        ú/global/targetHttpProxiesr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú_to_targethttpproxy©r\  Úur@   s     €r*   rŸ  z;GCENodeDriver.ex_list_targethttpproxies.<locals>.<listcomp>¹  s'   ø€ ÐOÐOÐO°�×(Ò(¨Ñ+Ô+ÐOÐOÐOr,   rO   rÍ  ©r@   rQ   rW   s   `  r*   Úex_list_targethttpproxiesz'GCENodeDriver.ex_list_targethttpproxies¯  sO   ø€ ð .ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆàOÐOÐOÐO°X·\²\À'È2Ñ5NÔ5NÐOÑOÔOÐOr,   c                 óŽ   ‡ — d}‰ j                              |d¬¦  «        j        }ˆ fd„|                     dg ¦  «        D ¦   «         S )z­
        Return the list of target HTTPs proxies.

        :return:  A list of target https proxy objects
        :rtype:   ``list`` of :class:`GCETargetHttpsProxy`
        ú/global/targetHttpsProxiesr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú_to_targethttpsproxy©r\  Úxr@   s     €r*   rŸ  z<GCENodeDriver.ex_list_targethttpsproxies.<locals>.<listcomp>Å  ó'   ø€ ÐPÐPÐP°�×)Ò)¨!Ñ,Ô,ÐPÐPÐPr,   rO   rÍ  rO  s   `  r*   Úex_list_targethttpsproxiesz(GCENodeDriver.ex_list_targethttpsproxies»  sO   ø€ ð /ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆàPÐPÐPÐP°h·l²lÀ7ÈBÑ6OÔ6OÐPÑPÔPÐPr,   c                 ót  ‡ — g }‰                       |¦  «        }|€d}n
d|j        z  }‰ j                             |d¬¦  «        j        }d|v rk|€U|d                              ¦   «         D ]9}ˆ fd„|                     dg ¦  «        D ¦   «         }|                     |¦  «         Œ:nˆ fd	„|d         D ¦   «         }|S )
z¤
        Return the list of target instances.

        :return:  A list of target instance objects
        :rtype:   ``list`` of :class:`GCETargetInstance`
        Nz/aggregated/targetInstancesú/zones/%s/targetInstancesr\   r]   rO   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   ©Ú_to_targetinstance©r\  Útr@   s     €r*   rŸ  z9GCENodeDriver.ex_list_targetinstances.<locals>.<listcomp>Ü  s4   ø€ ð ,ð ,ð ,Ø78˜×/Ò/°Ñ2Ô2ð,ð ,ð ,r,   ÚtargetInstancesc                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   r\  r^  s     €r*   rŸ  z9GCENodeDriver.ex_list_targetinstances.<locals>.<listcomp>á  s'   ø€ Ð'^Ð'^Ð'^Àq¨×(?Ò(?ÀÑ(BÔ(BÐ'^Ð'^Ð'^r,   r¢  )r@   rc   Úlist_targetinstancesrQ   rW   rm   Úzone_targetinstancess   `      r*   Úex_list_targetinstancesz%GCENodeDriver.ex_list_targetinstancesÇ  s  ø€ ð  "ÐØ�~Š~˜dÑ#Ô#ˆàˆ<Ø3ˆGˆGà1°T´YÑ?ˆGØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�hÐÐð ˆ|Ø! 'Ô*×1Ò1Ñ3Ô3ð Fð F�Að,ð ,ð ,ð ,Ø<=¿EºEÐBSÐUWÑ<XÔ<Xð,ñ ,ô ,Ð(ð )×/Ò/Ð0DÑEÔEÐEÐEð	Fð (_Ð'^Ð'^Ð'^ÈHÐU\ÔL]Ð'^Ñ'^Ô'^Ð$à#Ð#r,   c                 ót  ‡ — g }‰                       |¦  «        }|€d}n
d|j        z  }‰ j                             |d¬¦  «        j        }d|v rk|€U|d                              ¦   «         D ]9}ˆ fd„|                     dg ¦  «        D ¦   «         }|                     |¦  «         Œ:nˆ fd	„|d         D ¦   «         }|S )
z˜
        Return the list of target pools.

        :return:  A list of target pool objects
        :rtype:   ``list`` of :class:`GCETargetPool`
        Nz/aggregated/targetPoolsú/regions/%s/targetPoolsr\   r]   rO   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   ©Ú_to_targetpoolr^  s     €r*   rŸ  z5GCENodeDriver.ex_list_targetpools.<locals>.<listcomp>ú  s'   ø€ Ð)cÐ)cÐ)cÀQ¨$×*=Ò*=¸aÑ*@Ô*@Ð)cÐ)cÐ)cr,   ÚtargetPoolsc                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   rh  r^  s     €r*   rŸ  z5GCENodeDriver.ex_list_targetpools.<locals>.<listcomp>ý  ó'   ø€ Ð#VÐ#VÐ#V¸q D×$7Ò$7¸Ñ$:Ô$:Ð#VÐ#VÐ#Vr,   rÃ  )r@   r­   Úlist_targetpoolsrQ   rW   rm   Úregion_targetpoolss   `      r*   Úex_list_targetpoolsz!GCENodeDriver.ex_list_targetpoolså  s÷   ø€ ð ÐØ×!Ò! &Ñ)Ô)ˆàˆ>Ø/ˆGˆGà/°6´;Ñ?ˆGØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�hÐÐð ˆ~Ø! 'Ô*×1Ò1Ñ3Ô3ð @ð @�AØ)cÐ)cÐ)cÐ)cÈ!Ï%Ê%ÐP]Ð_aÑJbÔJbÐ)cÑ)cÔ)cÐ&Ø$×+Ò+Ð,>Ñ?Ô?Ð?Ð?ð@ð $WÐ#VÐ#VÐ#VÀHÈWÔDUÐ#VÑ#VÔ#VÐ àÐr,   c                 óŽ   ‡ — d}‰ j                              |d¬¦  «        j        }ˆ fd„|                     dg ¦  «        D ¦   «         S )z›
        Return the list of URL Maps in the project.

        :return:  A list of url map objects
        :rtype:   ``list`` of :class:`GCEUrlMap`
        ú/global/urlMapsr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú
_to_urlmaprM  s     €r*   rŸ  z1GCENodeDriver.ex_list_urlmaps.<locals>.<listcomp>  s%   ø€ ÐFÐFÐF q�—’ Ñ"Ô"ÐFÐFÐFr,   rO   rÍ  rO  s   `  r*   Úex_list_urlmapszGCENodeDriver.ex_list_urlmaps  sO   ø€ ð $ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆàFÐFÐFÐF¨H¯LªL¸À"Ñ,EÔ,EÐFÑFÔFÐFr,   c                 ót  ‡ — g }‰                       |¦  «        }|€d}n
d|j        z  }‰ j                             |d¬¦  «        j        }d|v rk|€U|d                              ¦   «         D ]9}ˆ fd„|                     dg ¦  «        D ¦   «         }|                     |¦  «         Œ:nˆ fd	„|d         D ¦   «         }|S )
aF  
        Retrieves the list of instance groups that are located in the specified
        project and zone.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute
        * https://www.googleapis.com/auth/compute.readonly

        :param  zone:  The name of the zone where the instance group is
                       located.
        :type   zone: ``str``

        :return: A list of instance group mgr  objects.
        :rtype: ``list`` of :class:`GCEInstanceGroupManagers`
        Nz/aggregated/instanceGroupsú/zones/%s/instanceGroupsr\   r]   rO   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   ©Ú_to_instancegroupr�  s     €r*   rŸ  z8GCENodeDriver.ex_list_instancegroups.<locals>.<listcomp>-  s'   ø€ Ð `Ð `Ð `¸q ×!7Ò!7¸Ñ!:Ô!:Ð `Ð `Ð `r,   ÚinstanceGroupsc                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   rx  r�  s     €r*   rŸ  z8GCENodeDriver.ex_list_instancegroups.<locals>.<listcomp>0  s'   ø€ ÐRÐRÐR¸1˜T×3Ò3°AÑ6Ô6ÐRÐRÐRr,   r¢  )r@   rc   r  rQ   rW   rm   Ú	zone_datas   `      r*   Úex_list_instancegroupsz$GCENodeDriver.ex_list_instancegroups  sî   ø€ ð$ ˆ	Ø�~Š~˜dÑ#Ô#ˆàˆ<Ø2ˆGˆGà0°D´IÑ>ˆGØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�hÐÐð ˆ|Ø! 'Ô*×1Ò1Ñ3Ô3ð 0ð 0�AØ `Ð `Ð `Ð `ÀAÇEÂEÐJZÐ\^ÑD_ÔD_Ð `Ñ `Ô `�IØ×$Ò$ YÑ/Ô/Ð/Ð/ð0ð SÐRÐRÐRÀÈÔ@QÐRÑRÔR�	àÐr,   c                 ót  ‡ — g }‰                       |¦  «        }|€d}n
d|j        z  }‰ j                             |d¬¦  «        j        }d|v rk|€U|d                              ¦   «         D ]9}ˆ fd„|                     dg ¦  «        D ¦   «         }|                     |¦  «         Œ:nˆ fd	„|d         D ¦   «         }|S )
aú  
        Return a list of Instance Group Managers.

        :keyword  zone: The zone to return InstanceGroupManagers from.
                        For example: 'us-central1-a'.  If None, will return
                        InstanceGroupManagers from self.zone.  If 'all', will
                        return all InstanceGroupManagers.
        :type     zone: ``str`` or ``None``

        :return: A list of instance group mgr  objects.
        :rtype: ``list`` of :class:`GCEInstanceGroupManagers`
        Nz!/aggregated/instanceGroupManagersú/zones/%s/instanceGroupManagersr\   r]   rO   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   ©Ú_to_instancegroupmanagerr�  s     €r*   rŸ  z?GCENodeDriver.ex_list_instancegroupmanagers.<locals>.<listcomp>O  s4   ø€ ð %ð %ð %Ø=>˜×5Ò5°aÑ8Ô8ð%ð %ð %r,   ÚinstanceGroupManagersc                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   r�  r�  s     €r*   rŸ  z?GCENodeDriver.ex_list_instancegroupmanagers.<locals>.<listcomp>T  s'   ø€ Ð ]Ð ]Ð ]Àa ×!>Ò!>¸qÑ!AÔ!AÐ ]Ð ]Ð ]r,   r¢  )r@   rc   Úlist_managersrQ   rW   rm   Úzone_managerss   `      r*   Úex_list_instancegroupmanagersz+GCENodeDriver.ex_list_instancegroupmanagers4  s   ø€ ð ˆØ�~Š~˜dÑ#Ô#ˆàˆ<Ø9ˆGˆGà7¸4¼9ÑEˆGØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�hÐÐð ˆ|Ø! 'Ô*×1Ò1Ñ3Ô3ð 8ð 8�Að%ð %ð %ð %ØBCÇ%Â%ÐH_ÐacÑBdÔBdð%ñ %ô %�Mð "×(Ò(¨Ñ7Ô7Ð7Ð7ð	8ð !^Ð ]Ð ]Ð ]È8ÐT[ÔK\Ð ]Ñ ]Ô ]�àÐr,   c                 óŽ   ‡ — d}‰ j                              |d¬¦  «        j        }ˆ fd„|                     dg ¦  «        D ¦   «         S )zª
        Return the list of Instance Templates.

        :return:  A list of Instance Template Objects
        :rtype:   ``list`` of :class:`GCEInstanceTemplate`
        ú/global/instanceTemplatesr\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú_to_instancetemplaterM  s     €r*   rŸ  z;GCENodeDriver.ex_list_instancetemplates.<locals>.<listcomp>b  rW  r,   rO   rÍ  rO  s   `  r*   Úex_list_instancetemplatesz'GCENodeDriver.ex_list_instancetemplatesX  sO   ø€ ð .ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆàPÐPÐPÐP°h·l²lÀ7ÈBÑ6OÔ6OÐPÑPÔPÐPr,   c                 ót  ‡ — g }‰                       |¦  «        }|€d}n
d|j        z  }‰ j                             |d¬¦  «        j        }d|v rk|€U|d                              ¦   «         D ]9}ˆ fd„|                     dg ¦  «        D ¦   «         }|                     |¦  «         Œ:nˆ fd	„|d         D ¦   «         }|S )
aÞ  
        Return the list of AutoScalers.

        :keyword  zone: The zone to return InstanceGroupManagers from.
                        For example: 'us-central1-a'.  If None, will return
                        InstanceGroupManagers from self.zone.  If 'all', will
                        return all InstanceGroupManagers.
        :type     zone: ``str`` or ``None``

        :return:  A list of AutoScaler Objects
        :rtype:   ``list`` of :class:`GCEAutoScaler`
        Nz/aggregated/autoscalersú/zones/%s/autoscalersr\   r]   rO   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   ©Ú_to_autoscalerr�  s     €r*   rŸ  z5GCENodeDriver.ex_list_autoscalers.<locals>.<listcomp>€  s'   ø€ ÐXÐXÐX¸!˜t×2Ò2°1Ñ5Ô5ÐXÐXÐXr,   Úautoscalersc                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   r�  r�  s     €r*   rŸ  z5GCENodeDriver.ex_list_autoscalers.<locals>.<listcomp>ƒ  rl  r,   r¢  )r@   rc   Úlist_autoscalersrQ   rW   rm   Úzone_ass   `      r*   Úex_list_autoscalersz!GCENodeDriver.ex_list_autoscalersd  sï   ø€ ð ÐØ�~Š~˜dÑ#Ô#ˆàˆ<Ø/ˆGˆGà-°´Ñ;ˆGà”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�hÐÐð ˆ|Ø! 'Ô*×1Ò1Ñ3Ô3ð 5ð 5�AØXÐXÐXÐX¸q¿uºuÀ]ÐTVÑ?WÔ?WÐXÑXÔX�GØ$×+Ò+¨GÑ4Ô4Ð4Ð4ð5ð $WÐ#VÐ#VÐ#VÀHÈWÔDUÐ#VÑ#VÔ#VÐ àÐr,   c                 ót  ‡ — g }‰                       |¦  «        }|€d}n
d|j        z  }‰ j                             |d¬¦  «        j        }d|v rk|€U|d                              ¦   «         D ]9}ˆ fd„|                     dg ¦  «        D ¦   «         }|                     |¦  «         Œ:nˆ fd	„|d         D ¦   «         }|S )
aÁ  
        Return a list of volumes for a zone or all.

        Will return list from provided zone, or from the default zone unless
        given the value of 'all'.

        :keyword  ex_zone: The zone to return volumes from.
        :type     ex_zone: ``str`` or :class:`GCEZone` or
                            :class:`NodeLocation` or ``None``

        :return: A list of volume objects.
        :rtype: ``list`` of :class:`StorageVolume`
        Nz/aggregated/disksú/zones/%s/disksr\   r]   rO   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   ©Ú_to_storage_volumerÌ  s     €r*   rŸ  z.GCENodeDriver.list_volumes.<locals>.<listcomp>¤  s'   ø€ Ð#[Ð#[Ð#[À1 D×$;Ò$;¸AÑ$>Ô$>Ð#[Ð#[Ð#[r,   Údisksc                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   rš  rÌ  s     €r*   rŸ  z.GCENodeDriver.list_volumes.<locals>.<listcomp>§  s'   ø€ ÐVÐVÐV¸q × 7Ò 7¸Ñ :Ô :ÐVÐVÐVr,   r¢  )r@   r+  Úlist_volumesrc   rQ   rW   rm   Úzone_volumess   `       r*   rž  zGCENodeDriver.list_volumes‡  sí   ø€ ð ˆØ�~Š~˜gÑ&Ô&ˆàˆ<Ø)ˆGˆGà'¨4¬9Ñ5ˆGà”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�hÐÐð ˆ|Ø! 'Ô*×1Ò1Ñ3Ô3ð 6ð 6�AØ#[Ð#[Ð#[Ð#[ÈÏÊÈgÐWYÑHZÔHZÐ#[Ñ#[Ô#[�LØ ×'Ò'¨Ñ5Ô5Ð5Ð5ð6ð  WÐVÐVÐVÀHÈWÔDUÐVÑVÔV�àÐr,   c                 óz   ‡ — g }d}‰ j                              |d¬¦  «        j        }ˆ fd„|d         D ¦   «         }|S )z‚
        Return the list of zones.

        :return: A list of zone objects.
        :rtype: ``list`` of :class:`GCEZone`
        r   r\   r]   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )Ú_to_zone©r\  Úzr@   s     €r*   rŸ  z/GCENodeDriver.ex_list_zones.<locals>.<listcomp>µ  s%   ø€ ÐBÐBÐB¨1�d—m’m AÑ&Ô&ÐBÐBÐBr,   rO   r  )r@   Ú
list_zonesrQ   rW   s   `   r*   r^  zGCENodeDriver.ex_list_zones«  sP   ø€ ð ˆ
ØˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆØBÐBÐBÐB°¸Ô0AÐBÑBÔBˆ
àÐr,   ÚEXTERNALc                 óö  — |p| j         }|€t          dd¦  «        ‚|dk    r%t          |d¦  «        s|                      |¦  «        }d|i}|r||d<   |r||d<   |r|dvrt          d	d
¦  «        ‚||d<   |r|dk    rt          dd¦  «        ‚|r&t          |d¦  «        s|                      ||¦  «        }|dk    rd}n
d|j        z  }| j                             |d|¬¦  «         |                      ||¬¦  «        S )aˆ  
        Create a static address in a region, or a global address.

        :param  name: Name of static address
        :type   name: ``str``

        :keyword  region: Name of region for the address (e.g. 'us-central1')
                          Use 'global' to create a global address.
        :type     region: ``str`` or :class:`GCERegion`

        :keyword  address: Ephemeral IP address to promote to a static one
                           (e.g. 'xxx.xxx.xxx.xxx')
        :type     address: ``str`` or ``None``

        :keyword  description: Optional descriptive comment.
        :type     description: ``str`` or ``None``

        :keyword  address_type: Optional The type of address to reserve,
                                either INTERNAL or EXTERNAL. If unspecified,
                                defaults to EXTERNAL.
        :type     description: ``str``

        :keyword  subnetwork: Optional The URL of the subnetwork in which to
                              reserve the address. If an IP address is
                              specified, it must be within the subnetwork's
                              IP range. This field can only be used with
                              INTERNAL type with GCE_ENDPOINT/DNS_RESOLVER
                              purposes.
        :type     description: ``str``

        :return:  Static Address object
        :rtype:   :class:`GCEAddress`
        NÚREGION_NOT_SPECIFIEDz&Region must be provided for an addressr»  r_   r¬   rÃ   )r¦  ÚINTERNALÚADDRESS_TYPE_WRONGzQAddress type must be either EXTERNAL or                                  INTERNALÚaddressTyper©  ÚINVALID_ARGUMENT_COMBINATIONzQAddress type must be internal if subnetwork                              providedr¼  r½  rq  rƒ  ©r­   )	r­   r¼   r²   Úex_get_regionÚex_get_subnetworkr_   r{   ru  Úex_get_address)	r@   r_   r­   r¬   rÃ   Úaddress_typer³  Úaddress_datarQ   s	            r*   Úex_create_addresszGCENodeDriver.ex_create_address¹  sn  € ðT Ð&˜4œ;ˆàˆ>ÝÐ3Ð5]Ñ^Ô^Ð^à�XÒÐ¥g¨f°fÑ&=Ô&=ÐØ×'Ò'¨Ñ/Ô/ˆFØ �~ˆàð 	.Ø&-ˆL˜Ñ#àð 	6Ø*5ˆL˜Ñ'àð 	;ØÐ#;Ð;Ð;Ý Ø(ð+ñô ð ð /;�˜]Ñ+àð 	˜,¨*Ò4Ð4ÝØ.ð'ñô ð ð ð 	D�g j°&Ñ9Ô9ð 	DØ×/Ò/°
¸FÑCÔCˆJà�XÒÐØ)ˆGˆGà-°´Ñ=ˆGØŒ×%Ò% g°fÀ<Ð%ÑPÔPÐPà×"Ò" 4°Ð"Ñ7Ô7Ð7r,   c                 ó.  — |p| j         }i }d|i}t          |d¦  «        s|                      |¦  «        }|j        d         |d<   ||d<   d|j        z  }|j        d         |d<   | j                             |d|¬¦  «         |                      ||¦  «        S )	a{  
        Create an Autoscaler for an Instance Group.

        :param  name: The name of the Autoscaler
        :type   name: ``str``

        :param  zone: The zone to which the Instance Group belongs
        :type   zone: ``str`` or :class:`GCEZone`

        :param  instance_group:  An Instance Group Manager object.
        :type:  :class:`GCEInstanceGroupManager`

        :param  policy:  A dict containing policy configuration.  See the
                         API documentation for Autoscalers for more details.
        :type:  ``dict``

        :return:  An Autoscaler object.
        :rtype:   :class:`GCEAutoscaler`
        r_   r�   rc   ÚautoscalingPolicyrŽ  r   rq  rƒ  )rc   r²   rT  rŒ   r_   r{   ru  Úex_get_autoscaler)r@   r_   rc   rº   r¡  rÃ   Úautoscaler_datarQ   s           r*   Úex_create_autoscalerz"GCENodeDriver.ex_create_autoscaler  s²   € ð( Ð �t”yˆØˆØ! 4˜.ˆå�t˜VÑ$Ô$ð 	*Ø×#Ò# DÑ)Ô)ˆDØ"&¤*¨ZÔ"8ˆ˜Ñð 06ˆÐ+Ñ,Ø)¨D¬IÑ5ˆØ$2Ô$8¸Ô$Dˆ˜Ñ!ØŒ×%Ò% g°fÀ?Ð%ÑSÔSÐSà×%Ò% d¨DÑ1Ô1Ð1r,   rµ   r¶   c           	      ó.   — t          |||||||¬¦  «        S )a  
        Helper Object to create a backend.

        :param  instance_group: The Instance Group for this Backend.
        :type   instance_group: :class: `GCEInstanceGroup`

        :param  balancing_mode: Specifies the balancing mode for this backend.
                                For global HTTP(S) load balancing, the valid
                                values are UTILIZATION (default) and RATE.
                                For global SSL load balancing, the valid
                                values are UTILIZATION (default) and
                                CONNECTION.
        :type   balancing_mode: ``str``

        :param  max_utilization: Used when balancingMode is UTILIZATION.
                                 This ratio defines the CPU utilization
                                 target for the group. The default is 0.8.
                                 Valid range is [0.0, 1.0].
        :type   max_utilization: ``float``

        :param  max_rate: The max requests per second (RPS) of the group.
                          Can be used with either RATE or UTILIZATION balancing
                          modes, but required if RATE mode. For RATE mode,
                          either maxRate or maxRatePerInstance must be set.
        :type   max_rate: ``int``

        :param  max_rate_per_instance: The max requests per second (RPS) that
                                       a single backend instance can handle.
                                       This is used to calculate the capacity
                                       of the group. Can be used in either
                                       balancing mode. For RATE mode, either
                                       maxRate or maxRatePerInstance must be
                                       set.
        :type   max_rate_per_instance: ``float``

        :param  capacity_scaler: A multiplier applied to the group's maximum
                                 servicing capacity (based on UTILIZATION,
                                 RATE, or CONNECTION). Default value is 1,
                                 which means the group will serve up to 100%
                                 of its configured capacity (depending on
                                 balancingMode). A setting of 0 means the
                                 group is completely drained, offering 0%
                                 of its available capacity. Valid range is
                                 [0.0,1.0].
        :type   capacity_scaler: ``float``

        :param  description: An optional description of this resource.
                             Provide this property when you create the
                             resource.
        :type   description: ``str``

        :return: A GCEBackend object.
        :rtype: :class: `GCEBackend`
        )rº   r½   r¾   r¿   rÀ   rÁ   rÃ   )r´   rÄ   s           r*   Úex_create_backendzGCENodeDriver.ex_create_backend2  s1   € õB Ø)Ø)Ø+ØØ"7Ø+Ø#ð
ñ 
ô 
ð 	
r,   c
                 óŽ  — |g g |dœ}
|D ]N}t          |d¦  «        s|                      |¬¦  «        }|
d                              |j        d         ¦  «         ŒO|D ]`}t	          |t
          ¦  «        r.|
d                              |                     ¦   «         ¦  «         ŒE|
d                              |¦  «         Œa|r||
d<   |	r|	|
d<   |r||
d	<   |r9|| j        v r||
d
<   n*t          dd 	                    | j        ¦  «        z  ¦  «        ‚|r||
d<   d}| j
                             |d|
¬¦  «         |                      |¦  «        S )aQ
  
        Create a global Backend Service.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  name:  Name of the resource. Provided by the client when the
                       resource is created. The name must be 1-63 characters
                       long, and comply with RFC1035. Specifically, the name
                       must be 1-63 characters long and match the regular
                       expression [a-z]([-a-z0-9]*[a-z0-9])? which means the
                       first character must be a lowercase letter, and all
                       following characters must be a dash, lowercase letter,
                       or digit, except the last character, which cannot be a
                       dash.
        :type   name: ``str``

        :param    healthchecks: A list of HTTP Health Checks to use for this
                                service.  There must be at least one.
        :type     healthchecks: ``list`` of (``str`` or
                                :class:`GCEHealthCheck`)

        :keyword  backends:  The list of backends that serve this
                             BackendService.
        :type   backends: ``list`` of :class `GCEBackend` or list of ``dict``

        :keyword  timeout_sec:  How many seconds to wait for the backend
                                before considering it a failed request.
                                Default is 30 seconds.
        :type   timeout_sec: ``integer``

        :keyword  enable_cdn:  If true, enable Cloud CDN for this
                                 BackendService.  When the load balancing
                                 scheme is INTERNAL, this field is not used.
        :type   enable_cdn: ``bool``

        :keyword  port:  Deprecated in favor of port_name. The TCP port to
                         connect on the backend. The default value is 80.
                         This cannot be used for internal load balancing.
        :type   port: ``integer``

        :keyword  port_name: Name of backend port. The same name should appear
                             in the instance groups referenced by this service.
        :type     port_name: ``str``

        :keyword  protocol: The protocol this Backend Service uses to
                            communicate with backends.
                            Possible values are HTTP, HTTPS, HTTP2, TCP
                            and SSL.
        :type     protocol: ``str``

        :return:  A Backend Service object.
        :rtype:   :class:`GCEBackendService`
        )r_   ÚhealthChecksrÕ   Ú	enableCDNrŒ   r8  r¼  r�   rÕ   r×   ÚportNameÚ
timeoutSecrÙ   zProtocol must be one of %sú,rÃ   rÉ  rq  rƒ  )r²   Úex_get_healthcheckr`   rŒ   r¸   r´   rÏ   ÚBACKEND_SERVICE_PROTOCOLSr¼   Újoinr{   ru  Úex_get_backendservice)r@   r_   rÖ   rÕ   rÙ   rÃ   Útimeout_secÚ
enable_cdnr×   rØ   Úbackendservice_dataÚhcÚberQ   s                 r*   Úex_create_backendservicez&GCENodeDriver.ex_create_backendservice}  s³  € ðH ØØØ#ð	
ð 
Ðð ð 	Mð 	MˆBÝ˜2˜wÑ'Ô'ð 6Ø×,Ò,°"Ð,Ñ5Ô5�Ø Ô/×6Ò6°r´xÀ
Ô7KÑLÔLÐLÐLàð 	;ð 	;ˆBÝ˜"�jÑ)Ô)ð ;Ø# JÔ/×6Ò6°r×7IÒ7IÑ7KÔ7KÑLÔLÐLÐLà# JÔ/×6Ò6°rÑ:Ô:Ð:Ð:àð 	/Ø*.Ð Ñ'àð 	8Ø.7Ð 
Ñ+àð 	<Ø0;Ð Ñ-àð 	Ø˜4Ô9Ð9Ð9Ø2:Ð# JÑ/Ð/å Ø0°3·8²8¸DÔ<ZÑ3[Ô3[Ñ[ñô ð ð ð 	=Ø1<Ð Ñ.à+ˆØŒ×%Ò% g°fÐCVÐ%ÑWÔWÐWà×)Ò)¨$Ñ/Ô/Ð/r,   c
                 óè   — i }
||
d<   |r||
d<   |	r|	|
d<   |pd|
d<   |pd|
d<   |pd|
d	<   |pd|
d
<   |pd|
d<   |pd|
d<   d}| j                              |d|
¬¦  «         |                      |¦  «        S )a  
        Create an Http Health Check.

        :param  name: Name of health check
        :type   name: ``str``

        :keyword  host: Hostname of health check request.  Defaults to empty
                        and public IP is used instead.
        :type     host: ``str``

        :keyword  path: The request path for the check.  Defaults to /.
        :type     path: ``str``

        :keyword  port: The TCP port number for the check.  Defaults to 80.
        :type     port: ``int``

        :keyword  interval: How often (in seconds) to check.  Defaults to 5.
        :type     interval: ``int``

        :keyword  timeout: How long to wait before failing. Defaults to 5.
        :type     timeout: ``int``

        :keyword  unhealthy_threshold: How many failures before marking
                                       unhealthy.  Defaults to 2.
        :type     unhealthy_threshold: ``int``

        :keyword  healthy_threshold: How many successes before marking as
                                     healthy.  Defaults to 2.
        :type     healthy_threshold: ``int``

        :keyword  description: The description of the check.  Defaults to None.
        :type     description: ``str`` or ``None``

        :return:  Health Check object
        :rtype:   :class:`GCEHealthCheck`
        r_   rq   rÃ   ú/ÚrequestPathéP   r×   é   ÚcheckIntervalSecr¿  é   ÚunhealthyThresholdÚhealthyThresholdrÑ  rq  rƒ  )r{   ru  rÁ  )r@   r_   rq   rö   r×   r÷   rÚ   rø   rù   rÃ   Úhc_datarQ   s               r*   Úex_create_healthcheckz#GCENodeDriver.ex_create_healthcheckë  sÆ   € ð` ˆØˆ�‰àð 	#Ø"ˆG�F‰Oàð 	1Ø%0ˆG�MÑ"ð "& ¨ˆ�ÑØ˜* "ˆ�‰Ø&. m°!ˆÐ"Ñ#Ø ' ¨1ˆ�ÑØ(;Ð(@¸qˆÐ$Ñ%Ø&7Ð&<¸1ˆÐ"Ñ#à,ˆàŒ×%Ò% g°fÀ7Ð%ÑKÔKÐKà×&Ò& tÑ,Ô,Ð,r,   rO  ÚINGRESSéè  c                 óš  — i }t          |d¦  «        s|                      |¦  «        }n|}||d<   ||d<   ||d<   ||d<   |dk    r||d<   n|dk    r||d<   |j        d	         |d
<   |
€|€|€dg}
|
�|
|d<   |�||d<   |�||d<   |�||d<   |	�|	|d<   |�||d<   d}| j                             |d|¬¦  «         |                      |¦  «        S )a±  
        Create a firewall rule on a network.
        Rules can be for Ingress or Egress, and they may Allow or
        Deny traffic. They are also applied in order based on action
        (Deny, Allow) and Priority. Rules can be applied using various Source
        and Target filters.

        Firewall rules should be supplied in the "allowed" or "denied" field.
        This is a list of dictionaries formatted like so ("ports" is optional):

            [{"IPProtocol": "<protocol string or number>",
              "ports": "<port_numbers or ranges>"}]

        For example, to allow tcp on port 8080 and udp on all ports, 'allowed'
        would be::

            [{"IPProtocol": "tcp",
              "ports": ["8080"]},
             {"IPProtocol": "udp"}]

        Note that valid inputs vary by direction (INGRESS vs EGRESS), action
        (allow/deny), and source/target filters (tag vs range etc).

        See `Firewall Reference <https://developers.google.com/compute/docs/
        reference/latest/firewalls/insert>`_ for more information.

        :param  name: Name of the firewall to be created
        :type   name: ``str``

        :param  description: Optional description of the rule.
        :type   description: ``str``

        :param  direction: Direction of the FW rule - "INGRESS" or "EGRESS"
                           Defaults to 'INGRESS'.
        :type   direction: ``str``

        :param  priority: Priority integer of the rule -
                          lower is applied first. Defaults to 1000
        :type   priority: ``int``

        :param  allowed: List of dictionaries with rules for type INGRESS
        :type   allowed: ``list`` of ``dict``

        :param  denied: List of dictionaries with rules for type EGRESS
        :type   denied: ``list`` of ``dict``

        :keyword  network: The network that the firewall applies to.
        :type     network: ``str`` or :class:`GCENetwork`

        :keyword  source_ranges: A list of IP ranges in CIDR format that the
                                 firewall should apply to. Defaults to
                                 ['0.0.0.0/0']
        :type     source_ranges: ``list`` of ``str``

        :keyword  source_service_accounts: A list of source service accounts
                                        the rules apply to.
        :type     source_service_accounts: ``list`` of ``str``

        :keyword  source_tags: A list of source instance tags the rules apply
                               to.
        :type     source_tags: ``list`` of ``str``

        :keyword  target_tags: A list of target instance tags the rules apply
                               to.
        :type     target_tags: ``list`` of ``str``

        :keyword  target_service_accounts: A list of target service accounts
                                        the rules apply to.
        :type     target_service_accounts: ``list`` of ``str``

        :keyword  target_ranges: A list of IP ranges in CIDR format that the
                                EGRESS type rule should apply to. Defaults
                                to ['0.0.0.0/0']
        :type     target_ranges: ``list`` of ``str``

        :return:  Firewall object
        :rtype:   :class:`GCEFirewall`
        r_   r  r	  rÃ   rÖ  r  ÚEGRESSr  r�   r  Nz	0.0.0.0/0ÚsourceRangesÚ
sourceTagsÚsourceServiceAccountsÚ
targetTagsÚtargetServiceAccountsÚdestinationRangesrÙ  rq  rƒ  )r²   Úex_get_networkrŒ   r{   ru  Úex_get_firewall)r@   r_   r  r  r  r  r  r	  r  r  r
  r  r  rÃ   Úfirewall_dataÚnwrQ   s                    r*   Úex_create_firewallz GCENodeDriver.ex_create_firewall2  sM  € ð| ˆå�w Ñ'Ô'ð 	Ø×$Ò$ WÑ-Ô-ˆBˆBàˆBà $ˆ�fÑØ%.ˆ�kÑ"Ø$,ˆ�jÑ!Ø'2ˆ�mÑ$à˜	Ò!Ð!Ø'.ˆM˜)Ñ$Ð$Ø˜(Ò"Ð"Ø&,ˆM˜(Ñ#Ø#%¤8¨JÔ#7ˆ�iÑ àÐ  [Ð%8Ð=TÐ=\Ø(˜MˆMàÐ$Ø,9ˆM˜.Ñ)àÐ"Ø*5ˆM˜,Ñ'à"Ð.Ø5LˆMÐ1Ñ2àÐ"Ø*5ˆM˜,Ñ'à"Ð.Ø5LˆMÐ1Ñ2àÐ$Ø1>ˆMÐ-Ñ.à%ˆàŒ×%Ò% g°fÀ=Ð%ÑQÔQÐQà×#Ò# DÑ)Ô)Ð)r,   Útcpc                 ó”  — d|i}|r&t          |d¦  «        s|                      |¦  «        }nh|p| j        }t          |d¦  «        s|                      |¦  «        }|j        d         |d<   |s|	}t          |d¦  «        s|                      ||¦  «        }|j        d         |d<   |                     ¦   «         |d<   |r4t          |d¦  «        s|                      ||rdn|¦  «        }|j        |d<   |r||d<   |r||d	<   |
r|
|d
<   |rd}n
d|j	        z  }| j
                             |d|¬¦  «         |                      ||¬¦  «        S )aÍ  
        Create a forwarding rule.

        :param  name: Name of forwarding rule to be created
        :type   name: ``str``

        :keyword  target: The target of this forwarding rule.  For global
                          forwarding rules this must be a global
                          TargetHttpProxy. For regional rules this may be
                          either a TargetPool or TargetInstance. If passed
                          a string instead of the object, it will be the name
                          of a TargetHttpProxy for global rules or a
                          TargetPool for regional rules.  A TargetInstance
                          must be passed by object. (required)
        :type     target: ``str`` or :class:`GCETargetHttpProxy` or
                          :class:`GCETargetInstance` or :class:`GCETargetPool`

        :keyword  region: Region to create the forwarding rule in.  Defaults to
                          self.region.  Ignored if global_rule is True.
        :type     region: ``str`` or :class:`GCERegion`

        :keyword  protocol: Should be 'tcp' or 'udp'
        :type     protocol: ``str``

        :keyword  port_range: Single port number or range separated by a dash.
                              Examples: '80', '5000-5999'.  Required for global
                              forwarding rules, optional for regional rules.
        :type     port_range: ``str``

        :keyword  address: Optional static address for forwarding rule. Must be
                           in same region.
        :type     address: ``str`` or :class:`GCEAddress`

        :keyword  description: The description of the forwarding rule.
                               Defaults to None.
        :type     description: ``str`` or ``None``

        :keyword  targetpool: Deprecated parameter for backwards compatibility.
                              Use target instead.
        :type     targetpool: ``str`` or :class:`GCETargetPool`

        :keyword  lb_scheme: Load balancing scheme, can be 'EXTERNAL' or
                             'INTERNAL'. Defaults to 'EXTERNAL'.
        :type     lb_scheme: ``str`` or ``None``

        :return:  Forwarding Rule object
        :rtype:   :class:`GCEForwardingRule`
        r_   r�   r­   r   Ú
IPProtocolr»  Ú	IPAddressÚ	portRangerÃ   ÚloadBalancingSchemerã  rä  rq  rƒ  )Úglobal_rule)r²   Úex_get_targethttpproxyr­   r®  rŒ   Úex_get_targetpoolÚupperr°  r¬   r_   r{   ru  Úex_get_forwarding_rule)r@   r_   r   r­   rÙ   Ú
port_ranger¬   rÃ   rë  r  Ú	lb_schemeÚforwarding_rule_datarQ   s                r*   Úex_create_forwarding_rulez'GCENodeDriver.ex_create_forwarding_rule½  s³  € ðz !'¨˜~Ðàð 	@Ý˜6 6Ñ*Ô*ð =Ø×4Ò4°VÑ<Ô<�øàÐ*˜tœ{ˆFå˜6 6Ñ*Ô*ð 4Ø×+Ò+¨FÑ3Ô3�Ø-3¬\¸*Ô-EÐ  Ñ*àð $Ø#�å˜6 6Ñ*Ô*ð @Ø×/Ò/°¸Ñ?Ô?�à)/¬°jÔ)AÐ˜XÑ&Ø-5¯^ª^Ñ-=Ô-=Ð˜\Ñ*àð 	@Ý˜7 FÑ+Ô+ð \Ø×-Ò-¨gÀ;Ð7Z°x°xÐTZÑ[Ô[�Ø07´Ð  Ñ-àð 	;Ø0:Ð  Ñ-àð 	>Ø2=Ð  Ñ/àð 	DØ:CÐ Ð!6Ñ7àð 	DØ/ˆGˆGà3°v´{ÑCˆGàŒ×%Ò% g°fÐCWÐ%ÑXÔXÐXà×*Ò*¨4¸[Ð*ÑIÔIÐIr,   c
                 óø  — i }
||
d<   ||
d<   ||
d<   t          |t          ¦  «        r&|j        d         |
d<   |j        d         j        |
d<   nWt          |t          ¦  «        r3|                     d¦  «        r|                     d¦  «        r	|d	d
œ|
d<   nt          d¦  «        ‚|rt          |t          ¦  «        r|g}||
d<   |	r|	|
d<   |r?g |
d<   t          |t          ¦  «        r|g}|D ]}|
d                              d|i¦  «         Œ d}	 |r| j	         
                    |d|
¬¦  «         n| j	                             |d|
¬¦  «         n# t          $ r}|s|‚Y d}~nd}~ww xY w|                      |¦  «        S )a`  
        Create an image from the provided volume.

        :param  name: The name of the image to create.
        :type   name: ``str``

        :param  volume: The volume to use to create the image, or the
                        Google Cloud Storage URI
        :type   volume: ``str`` or :class:`StorageVolume`

        :keyword  description: Description of the new Image
        :type     description: ``str``

        :keyword  family: The name of the image family to which this image
                          belongs. If you create resources by specifying an
                          image family instead of a specific image name, the
                          resource uses the latest non-deprecated image that
                          is set with that family name.
        :type     family: ``str``

        :keyword  guest_os_features: Features of the guest operating system,
                                     valid for bootable images only.
        :type     guest_os_features: ``list`` of ``str`` or ``None``

        :keyword  ex_licenses: List of strings representing licenses
                               to be associated with the image.
        :type     ex_licenses: ``list`` of ``str``

        :keyword  ex_labels: Labels dictionary for image.
        :type     ex_labels: ``dict`` or ``None``

        :keyword  use_existing: If True and an image with the given name
                                already exists, return an object for that
                                image instead of attempting to create
                                a new image.
        :type     use_existing: ``bool``

        :keyword  wait_for_completion: If True, wait until the new image is
                                       created before returning a new NodeImage
                                       Otherwise, return a new NodeImage
                                       instance, and let the user track the
                                       creation progress
        :type     wait_for_completion: ``bool``

        :return:  A GCENodeImage object for the new image
        :rtype:   :class:`GCENodeImage`

        r_   rÃ   Úfamilyr�   Ú
sourceDiskrc   úhttps://ztar.gzÚTAR)ÚsourceÚcontainerTypeÚrawDiskz/Source must be instance of StorageVolume or URIÚlicensesr‹  ÚguestOsFeaturesrn  rú  rq  rƒ  N)r¸   r   rŒ   r_   r�   r«  Úendswithr¼   r`   r{   ru  rQ   r   Úex_get_image)r@   r_   r�  rÃ   rõ  Úguest_os_featuresÚuse_existingÚwait_for_completionÚex_licensesÚ	ex_labelsÚ
image_dataÚfeaturerQ   Úes                 r*   Úex_create_imagezGCENodeDriver.ex_create_image&  s  € ðx ˆ
Ø!ˆ
�6ÑØ$/ˆ
�=Ñ!Ø%ˆ
�8Ñå�f�mÑ,Ô,ð 	PØ'-¤|°JÔ'?ˆJ�|Ñ$Ø!'¤¨fÔ!5Ô!:ˆJ�vÑÐå�v�sÑ#Ô#ð	PØ(.×(9Ò(9¸*Ñ(EÔ(Eð	PØJPÏ/Ê/ÐZbÑJcÔJcð	Pð 06ÈÐ$NÐ$NˆJ�yÑ!Ð!åÐNÑOÔOÐOàð 	1Ý˜+¥sÑ+Ô+ð ,Ø*˜m�Ø%0ˆJ�zÑ"àð 	-Ø#,ˆJ�xÑ àð 	HØ,.ˆJÐ(Ñ)åÐ+­SÑ1Ô1ð 8Ø%6Ð$7Ð!à,ð Hð H�ØÐ,Ô-×4Ò4°f¸gÐ5FÑGÔGÐGÐGØ"ˆð	Ø"ð QØ”×-Ò-¨g¸fÈ:Ð-ÑVÔVÐVÐVà”×'Ò'¨¸ÀZÐ'ÑPÔPÐPøøå"ð 	ð 	ð 	Øð Ø�ðð ð ð ð øøøøð	øøøð × Ò  Ñ&Ô&Ð&s   Ä=E Å
E$ÅEÅE$c                 óX  — |                      d¦  «        r|                     ddd¦  «        }|||dd|idœ}|r?g |d<   t          |t          ¦  «        r|g}|D ]}|d                              d|i¦  «         Œ d	}| j                             |d
|¬¦  «         |                      |¦  «        S )aä  
        Copy an image to your image collection.

        :param  name: The name of the image
        :type   name: ``str``

        :param  url: The URL to the image. The URL can start with `gs://`
        :type url: ``str``

        :param  description: The description of the image
        :type   description: ``str``

        :param  family: The family of the image
        :type   family: ``str``

        :param  guest_os_features: The features of the guest operating system.
        :type   guest_os_features: ``list`` of ``str`` or ``None``

        :return:  NodeImage object based on provided information or None if an
                  image with that name is not found.
        :rtype:   :class:`NodeImage` or ``None``
        r¨  zhttps://storage.googleapis.com/r¶   ÚRAWrù  )r_   rÃ   rõ  Ú
sourceTyperû  rý  rn  rú  rq  rƒ  )r«  r’   r¸   r�   r`   r{   ru  rÿ  )	r@   r_   ÚurlrÃ   rõ  r   r  r  rQ   s	            r*   Úex_copy_imagezGCENodeDriver.ex_copy_image�  së   € ð4 �>Š>˜'Ñ"Ô"ð 	MØ—+’+˜gÐ'HÈ!ÑLÔLˆCð Ø&ØØØ  #�ð
ð 
ˆ
ð ð 	HØ,.ˆJÐ(Ñ)åÐ+­SÑ1Ô1ð 8Ø%6Ð$7Ð!à,ð Hð H�ØÐ,Ô-×4Ò4°f¸gÐ5FÑGÔGÐGÐGà"ˆØŒ×%Ò% g°fÀ:Ð%ÑNÔNÐNà× Ò  Ñ&Ô&Ð&r,   c                 ój  — |p| j         }t          |d¦  «        s|                      |¦  «        }d|j        z  }i }||d<   |j        d         |d<   |r||d<   |r|j        d         |d<   |r|j        d         |d<   |r||d<   | j                             |d	|¬
¦  «         |                      ||¦  «        S )a­  
        Creates an instance group in the specified project using the
        parameters that are included in the request.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  name:  Required. The name of the instance group. The name
                       must be 1-63 characters long, and comply with RFC1035.
        :type   name: ``str``

        :param  zone:  The URL of the zone where the instance group is
                       located.
        :type   zone: :class:`GCEZone`

        :keyword  description:  An optional description of this resource.
                                Provide this property when you create the
                                resource.
        :type   description: ``str``

        :keyword  network:  The URL of the network to which all instances in
                            the instance group belong.
        :type   network: :class:`GCENetwork`

        :keyword  subnetwork:  The URL of the subnetwork to which all
                               instances in the instance group belong.
        :type   subnetwork: :class:`GCESubnetwork`

        :keyword  named_ports:  Assigns a name to a port number. For example:
                                {name: "http", port: 80}  This allows the
                                system to reference ports by the assigned
                                name instead of a port number. Named ports
                                can also contain multiple ports. For example:
                                [{name: "http", port: 80},{name: "http",
                                port: 8080}]   Named ports apply to all
                                instances in this instance group.
        :type   named_ports: ``list`` of {'name': ``str``, 'port`: ``int``}

        :return:  `GCEInstanceGroup` object.
        :rtype: :class:`GCEInstanceGroup`
        r_   rv  r�   rc   rÃ   r  r³  Ú
namedPortsrq  rƒ  )rc   r²   rT  r_   rŒ   r{   ru  Úex_get_instancegroup)	r@   r_   rc   rÃ   r  r³  r´  rQ   Úrequest_datas	            r*   Úex_create_instancegroupz%GCENodeDriver.ex_create_instancegroupÂ  sî   € ðf Ð �t”yˆå�t˜VÑ$Ô$ð 	*Ø×#Ò# DÑ)Ô)ˆDØ,°´	Ñ:ˆØˆØ#ˆ�VÑØ#œz¨*Ô5ˆ�VÑàð 	6Ø*5ˆL˜Ñ'àð 	@Ø&-¤m°JÔ&?ˆL˜Ñ#àð 	FØ)3Ô)9¸*Ô)EˆL˜Ñ&àð 	5Ø)4ˆL˜Ñ&àŒ×%Ò% g°fÀ<Ð%ÑPÔPÐPà×(Ò(¨¨tÑ4Ô4Ð4r,   c                 ó|  — |p| j         }t          |d¦  «        s|                      |¦  «        }d|j        z  }i }t          |d¦  «        s|                      |¦  «        }|j        d         |d<   ||d<   |�||d<   ||d<   ||d<   ||d<   | j                             |d	|¬
¦  «         |                      ||¦  «        S )ar  
        Create a Managed Instance Group.

        :param  name: Name of the Instance Group.
        :type   name: ``str``

        :param  zone: The zone to which the Instance Group belongs
        :type   zone: ``str`` or :class:`GCEZone` or ``None``

        :param  template: The Instance Template.  Should be an instance
                                of GCEInstanceTemplate or a string.
        :type   template: ``str`` or :class:`GCEInstanceTemplate`

        :param  base_instance_name: The prefix for each instance created.
                                    If None, Instance Group name will be used.
        :type   base_instance_name: ``str``

        :param  description: User-supplied text about the Instance Group.
        :type   description: ``str``

        :return:  An Instance Group Manager object.
        :rtype:   :class:`GCEInstanceGroupManager`
        r_   r  r�   ÚinstanceTemplateÚbaseInstanceNameNÚ
targetSizerÃ   rq  rƒ  )	rc   r²   rT  r_   Úex_get_instancetemplaterŒ   r{   ru  Úex_get_instancegroupmanager)	r@   r_   rc   rÏ  r|  Úbase_instance_namerÃ   rQ   Úmanager_datas	            r*   Úex_create_instancegroupmanagerz,GCENodeDriver.ex_create_instancegroupmanager  sî   € ð4 Ð �t”yˆå�t˜VÑ$Ô$ð 	*Ø×#Ò# DÑ)Ô)ˆDà3°t´yÑAˆàˆõ �x Ñ(Ô(ð 	>Ø×3Ò3°HÑ=Ô=ˆHØ+3¬>¸*Ô+EˆÐ'Ñ(ð ,0ˆÐ'Ñ(àÐ)Ø/AˆLÐ+Ñ,à#ˆ�VÑØ%)ˆ�\Ñ"Ø&1ˆ�]Ñ#àŒ×%Ò% g°fÀ<Ð%ÑPÔPÐPà×/Ò/°°dÑ;Ô;Ð;r,   rM   c                 ó6  — i }||d<   ||d<   ||d<   ||d<   t          |t          ¦  «        r|                     d¦  «        r|}	nEt          |t          ¦  «        r#|                      |¦  «        }|j        d         }	n|j        d         }	|	|d<   ||d<   |€'d
                     t          | j        d¦  «        }
|
|d<   n+t          |t          ¦  «        r||d<   n|j        d         |d<   d}| j         	                    |d|¬¦  «         |  
                    |¦  «        S )ag  
        Create a route.

        :param  name: Name of route to be created
        :type   name: ``str``

        :param  dest_range: Address range of route in CIDR format.
        :type   dest_range: ``str``

        :param  priority: Priority value, lower values take precedence
        :type   priority: ``int``

        :param  network: The network the route belongs to. Can be either the
                         full URL of the network, the name of the network  or
                         a libcloud object.
        :type   network: ``str`` or ``GCENetwork``

        :param  tags: List of instance-tags for routing, empty for all nodes
        :type   tags: ``list`` of ``str`` or ``None``

        :param  next_hop: Next traffic hop. Use ``None`` for the default
                          Internet gateway, or specify an instance or IP
                          address.
        :type   next_hop: ``str``, ``Node``, or ``None``

        :param  description: Custom description for the route.
        :type   description: ``str`` or ``None``

        :return:  Route object
        :rtype:   :class:`GCERoute`
        r_   Ú	destRanger	  rÃ   r÷  r�   r  rR  Nz4https://www.googleapis.com/compute/{}/projects/{}/{}z(global/gateways/default-internet-gatewayÚnextHopGatewayÚ	nextHopIpÚnextHopInstancer  rq  rƒ  )r¸   r�   r«  rà  rŒ   r<   r=   rC   r{   ru  Úex_get_route)r@   r_   rQ  r	  r  rR  Únext_hoprÃ   Ú
route_dataÚnetwork_urir  rQ   s               r*   Úex_create_routezGCENodeDriver.ex_create_routeE  sQ  € ðR ˆ
Ø!ˆ
�6ÑØ",ˆ
�;ÑØ!)ˆ
�:ÑØ$/ˆ
�=Ñ!å�g�sÑ#Ô#ð 	4¨×(:Ò(:¸:Ñ(FÔ(Fð 	4Ø!ˆKˆKÝ˜¥Ñ%Ô%ð 	4Ø×)Ò)¨'Ñ2Ô2ˆGØ!œ-¨
Ô3ˆKˆKà!œ-¨
Ô3ˆKØ +ˆ
�9ÑØ!ˆ
�6ÑàÐØH×OÒOÝØ”Ø:ñô ˆCð
 ,/ˆJÐ'Ñ(Ð(Ý˜¥#Ñ&Ô&ð 	GØ&.ˆJ�{Ñ#Ð#à,4¬N¸:Ô,FˆJÐ(Ñ)à"ˆØŒ×%Ò% g°fÀ:Ð%ÑNÔNÐNà× Ò  Ñ&Ô&Ð&r,   c                 ó–   — d}i }||d<   ||d<   ||d<   ||d<   | j                              |d|¬¦  «         |                      |¦  «        S )aD  
        Creates a SslCertificate resource in the specified project using the
        data included in the request.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  name:  Name of the resource. Provided by the client when the
                       resource is created. The name must be 1-63 characters
                       long, and comply with RFC1035. Specifically, the name
                       must be 1-63 characters long and match the regular
                       expression [a-z]([-a-z0-9]*[a-z0-9])? which means the
                       first character must be a lowercase letter, and all
                       following characters must be a dash, lowercase letter,
                       or digit, except the last character, which cannot be a
                       dash.
        :type   name: ``str``

        :param  certificate:  A string containing local certificate file in
                              PEM format. The certificate chain
                              must be no greater than 5 certs long. The
                              chain must include at least one intermediate
                              cert.
        :type   certificate: ``str``

        :param  private_key:  A string containing a write-only private key
                              in PEM format. Only insert RPCs will include
                              this field.
        :type   private_key: ``str``

        :keyword  description:  An optional description of this resource.
                                Provide this property when you create the
                                resource.
        :type   description: ``str``

        :return:  `GCESslCertificate` object.
        :rtype: :class:`GCESslCertificate`
        r  r_   r5  Ú
privateKeyrÃ   rq  rƒ  )r{   ru  Úex_get_sslcertificate)r@   r_   r5  r6  rÃ   rQ   r  s          r*   Úex_create_sslcertificatez&GCENodeDriver.ex_create_sslcertificate�  sh   € ðR ,ˆØˆØ#ˆ�VÑØ&1ˆ�]Ñ#Ø%0ˆ�\Ñ"Ø&1ˆ�]Ñ#àŒ×%Ò% g°fÀ<Ð%ÑPÔPÐPà×)Ò)¨$Ñ/Ô/Ð/r,   c                 óÌ  — |st          d¦  «        ‚|st          d¦  «        ‚t          |t          ¦  «        r|j        d         }n:|                     d¦  «        r|}n"|                      |¦  «        }	|	j        d         }|st          d¦  «        ‚t          |t          ¦  «        r|j        d         }
n:|                     d¦  «        r|}
n"|                      |¦  «        }|j        d         }
i }||d<   ||d<   ||d<   ||d	<   |
|d
<   ||d<   ||d<   |
                     d¦  «        d         }d|z  }| j	         
                    |d|¬¦  «         |                      ||¦  «        S )aô  
        Create a subnetwork.

        :param  name: Name of subnetwork to be created
        :type   name: ``str``

        :param  cidr: Address range of network in CIDR format.
        :type   cidr: ``str``

        :param  network: The network name or object this subnet belongs to.
        :type   network: ``str`` or :class:`GCENetwork`

        :param  region: The region the subnetwork belongs to.
        :type   region: ``str`` or :class:`GCERegion`

        :param  description: Custom description for the network.
        :type   description: ``str`` or ``None``

        :param  privateipgoogleaccess: Allow access to Google services without
                                       assigned external IP addresses.
        :type   privateipgoogleaccess: ``bool` or ``None``

        :param  secondaryipranges: List of dicts of secondary or "alias" IP
                                   ranges for this subnetwork in
                                   [{"rangeName": "second1",
                                   "ipCidrRange": "192.168.168.0/24"},
                                   {k:v, k:v}] format.
        :type   secondaryipranges: ``list`` of ``dict`` or ``None``

        :return:  Subnetwork object
        :rtype:   :class:`GCESubnetwork`
        z,Must provide an IP network in CIDR notation.z*Must provide a network for the subnetwork.r�   r÷  z)Must provide a region for the subnetwork.r_   rÃ   ÚipCidrRanger  r­   ÚprivateIpGoogleAccessÚsecondaryIpRangesrÌ  éÿÿÿÿr  rq  rƒ  )r¼   r¸   rE  rŒ   r«  rà  rs  r®  r  r{   ru  r¯  )r@   r_   r@  r  r­   rÃ   ÚprivateipgoogleaccessÚsecondaryiprangesÚnetwork_urlÚnetwork_objÚ
region_urlÚ
region_objÚsubnet_dataÚregion_namerQ   s                  r*   Úex_create_subnetworkz"GCENodeDriver.ex_create_subnetworkÃ  sª  € ðV ð 	MÝÐKÑLÔLÐLàð 
	@ÝÐIÑJÔJÐJå˜'¥:Ñ.Ô.ð @Ø%œm¨JÔ7��à×%Ò% jÑ1Ô1ð @Ø")�K�Kà"&×"5Ò"5°gÑ">Ô">�KØ"-Ô"3°JÔ"?�Kàð 
	>ÝÐHÑIÔIÐIå˜&¥)Ñ,Ô,ð >Ø#œ\¨*Ô5�
�
à×$Ò$ ZÑ0Ô0ð >Ø!'�J�Jà!%×!3Ò!3°FÑ!;Ô!;�JØ!+Ô!1°*Ô!=�JàˆØ"ˆ�FÑØ%0ˆ�MÑ"Ø%)ˆ�MÑ"Ø!,ˆ�IÑØ *ˆ�HÑØ/DˆÐ+Ñ,Ø+<ˆÐ'Ñ(Ø ×&Ò& sÑ+Ô+¨BÔ/ˆà+¨{Ñ;ˆØŒ×%Ò% g°fÀ;Ð%ÑOÔOÐOà×%Ò% d¨KÑ8Ô8Ð8r,   rG  c                 óò  — i }||d<   ||d<   |                      ¦   «         dvrt          d|z  ¦  «        ‚|r|dv rt          d¦  «        ‚|dk    r|st          d¦  «        ‚||d	<   n|                      ¦   «         d
k    |d<   |rA|                      ¦   «         dvrt          d|z  ¦  «        ‚d|                     ¦   «         i|d<   d}| j                             |d|¬¦  «         |                      |¦  «        S )a”  
        Create a network. In November 2015, Google introduced Subnetworks and
        suggests using networks with 'auto' generated subnetworks. See, the
        `subnet docs <https://cloud.google.com/compute/docs/subnetworks>`_ for
        more details. Note that libcloud follows the usability pattern from
        the Cloud SDK (e.g. 'gcloud compute' command-line utility) and uses
        'mode' to specify 'auto', 'custom', or 'legacy'.

        :param  name: Name of network to be created
        :type   name: ``str``

        :param  cidr: Address range of network in CIDR format.
        :type   cidr: ``str`` or ``None``

        :param  description: Custom description for the network.
        :type   description: ``str`` or ``None``

        :param  mode: Create a 'auto', 'custom', or 'legacy' network.
        :type   mode: ``str``

        :param  routing_mode: Create network with 'Global' or 'Regional'
                              routing mode for BGP advertisements.
                              Defaults to 'Regional'
        :type   routing_mode: ``str`` or ``None``

        :return:  Network object
        :rtype:   :class:`GCENetwork`
        r_   rÃ   )ÚautoÚcustomrG  zBInvalid network mode: '%s'. Must be 'auto', 'custom', or 'legacy'.)r9  r:  z.Can only specify IPv4Range with 'legacy' mode.rG  z*Must specify IPv4Range with 'legacy' mode.Ú	IPv4Ranger9  ÚautoCreateSubnetworks)Úregionalr»  z<Invalid Routing Mode: '%s'. Must be 'REGIONAL', or 'GLOBAL'.ÚroutingModeÚroutingConfigr  rq  rƒ  )Úlowerr¼   rî  r{   ru  rà  )r@   r_   r@  rÃ   rH  Úrouting_modeÚnetwork_datarQ   s           r*   Úex_create_networkzGCENodeDriver.ex_create_network  sH  € ð: ˆØ#ˆ�VÑØ&1ˆ�]Ñ#à�:Š:‰<Œ<Ð;Ð;Ð;ÝØWÐZ^Ñ^ñô ð ð ð 	O�DÐ.Ð.Ð.ÝÐMÑNÔNÐNà�8ÒÐØð OÝ Ð!MÑNÔNÐNØ(,ˆL˜Ñ%Ð%à48·J²J±L´LÀFÒ4JˆLÐ0Ñ1àð 	VØ×!Ò!Ñ#Ô#Ð+AÐAÐAÝ ØUÐXdÑdñô ð ð 2?À×@RÒ@RÑ@TÔ@TÐ0U�˜_Ñ-à$ˆàŒ×%Ò% g°fÀ<Ð%ÑPÔPÐPà×"Ò" 4Ñ(Ô(Ð(r,   Ú	ephemeralúpd-standardc                 ó   — |	r|rt          d¦  «        ‚|r|rt          d¦  «        ‚|s|s|	s|st          d¦  «        ‚|p| j        }|r%t          |d¦  «        s|                      |¦  «        }t          |d¦  «        s|                      ||¦  «        }t          |d¦  «        s|                      |¦  «        }|r:t          |d¦  «        s*|                      ||                      |¦  «        ¬¦  «        }|r|                      |¦  «        }|r%t          |d¦  «        s|  	                    |¦  «        }|r't          |d¦  «        s|  
                    ||¬¦  «        }|	r't          |	d¦  «        s|                      |	|¬¦  «        }	|r8t          |d¦  «        s(|€t          d¦  «        ‚|                      ||¬¦  «        }|s'|	s%|d	d
d||||j        d         |j        d         dœdœg}|s(|j                             dd¦  «        r|j        d         }|                      |¬¦  «         |                      ||||||||	||||||||||||||||¬¦  «        \  }}| j                             |d|¬¦  «         |                      ||j        ¦  «        S )a7  
        Create a new node and return a node object for the node.

        :param  name: The name of the node to create.
        :type   name: ``str``

        :param  size: The machine type to use.
        :type   size: ``str`` or :class:`GCENodeSize`

        :param  image: The image to use to create the node (or, if attaching
                       a persistent disk, the image used to create the disk)
        :type   image: ``str`` or :class:`GCENodeImage` or ``None``

        :keyword  location: The location (zone) to create the node in.
        :type     location: ``str`` or :class:`NodeLocation` or
                            :class:`GCEZone` or ``None``

        :keyword  ex_network: The network to associate with the node.
        :type     ex_network: ``str`` or :class:`GCENetwork`

        :keyword  ex_subnetwork: The subnetwork to associate with the node.
        :type     ex_subnetwork: ``str`` or :class:`GCESubnetwork`

        :keyword  ex_tags: A list of tags to associate with the node.
        :type     ex_tags: ``list`` of ``str`` or ``None``

        :keyword  ex_metadata: Metadata dictionary for instance.
        :type     ex_metadata: ``dict`` or ``None``

        :keyword  ex_boot_disk: The boot disk to attach to the instance.
        :type     ex_boot_disk: :class:`StorageVolume` or ``str`` or ``None``

        :keyword  use_existing_disk: If True and if an existing disk with the
                                     same name/location is found, use that
                                     disk instead of creating a new one.
        :type     use_existing_disk: ``bool``

        :keyword  external_ip: The external IP address to use.  If 'ephemeral'
                               (default), a new non-static address will be
                               used.  If 'None', then no external address will
                               be used.  To use an existing static IP address,
                               a GCEAddress object should be passed in.
        :type     external_ip: :class:`GCEAddress` or ``str`` or ``None``

        :keyword  internal_ip: The private IP address to use.
        :type     internal_ip: :class:`GCEAddress` or ``str`` or ``None``

        :keyword  ex_disk_type: Specify a pd-standard (default) disk or pd-ssd
                                for an SSD disk.
        :type     ex_disk_type: ``str`` or :class:`GCEDiskType`

        :keyword  ex_disk_auto_delete: Indicate that the boot disk should be
                                       deleted when the Node is deleted. Set to
                                       True by default.
        :type     ex_disk_auto_delete: ``bool``

        :keyword  ex_service_accounts: Specify a list of serviceAccounts when
                                       creating the instance. The format is a
                                       list of dictionaries containing email
                                       and list of scopes, e.g.
                                       [{'email':'default',
                                       'scopes':['compute', ...]}, ...]
                                       Scopes can either be full URLs or short
                                       names. If not provided, use the
                                       'default' service account email and a
                                       scope of 'devstorage.read_only'. Also
                                       accepts the aliases defined in
                                       'gcloud compute'.
        :type     ex_service_accounts: ``list``

        :keyword  description: The description of the node (instance).
        :type     description: ``str`` or ``None``

        :keyword  ex_can_ip_forward: Set to ``True`` to allow this node to
                                  send/receive non-matching src/dst packets.
        :type     ex_can_ip_forward: ``bool`` or ``None``

        :keyword  ex_disks_gce_struct: Support for passing in the GCE-specific
                                       formatted disks[] structure. No attempt
                                       is made to ensure proper formatting of
                                       the disks[] structure. Using this
                                       structure obviates the need of using
                                       other disk params like 'ex_boot_disk',
                                       etc. See the GCE docs for specific
                                       details.
        :type     ex_disks_gce_struct: ``list`` or ``None``

        :keyword  ex_nic_gce_struct: Support passing in the GCE-specific
                                     formatted networkInterfaces[] structure.
                                     No attempt is made to ensure proper
                                     formatting of the networkInterfaces[]
                                     data. Using this structure obviates the
                                     need of using 'external_ip' and
                                     'ex_network'.  See the GCE docs for
                                     details.
        :type     ex_nic_gce_struct: ``list`` or ``None``

        :keyword  ex_on_host_maintenance: Defines whether node should be
                                          terminated or migrated when host
                                          machine goes down. Acceptable values
                                          are: 'MIGRATE' or 'TERMINATE' (If
                                          not supplied, value will be reset to
                                          GCE default value for the instance
                                          type.)
        :type     ex_on_host_maintenance: ``str`` or ``None``

        :keyword  ex_automatic_restart: Defines whether the instance should be
                                        automatically restarted when it is
                                        terminated by Compute Engine. (If not
                                        supplied, value will be set to the GCE
                                        default value for the instance type.)
        :type     ex_automatic_restart: ``bool`` or ``None``

        :keyword  ex_preemptible: Defines whether the instance is preemptible.
                                  (If not supplied, the instance will not be
                                  preemptible)
        :type     ex_preemptible: ``bool`` or ``None``

        :keyword  ex_image_family: Determine image from an 'Image Family'
                                   instead of by name. 'image' should be None
                                   to use this keyword.
        :type     ex_image_family: ``str`` or ``None``

        :keyword  ex_labels: Labels dictionary for instance.
        :type     ex_labels: ``dict`` or ``None``

        :keyword  ex_accelerator_type: Defines the accelerator to use with this
                                       node. Must set 'ex_on_host_maintenance'
                                       to 'TERMINATE'. Must include a count of
                                       accelerators to use in
                                       'ex_accelerator_count'.
        :type     ex_accelerator_type: ``str`` or ``None``

        :keyword  ex_accelerator_count: The number of 'ex_accelerator_type'
                                        accelerators to attach to the node.
        :type     ex_accelerator_count: ``int`` or ``None``

        :keyword  ex_disk_size: Defines size of the boot disk.
                                Integer in gigabytes.
        :type     ex_disk_size: ``int`` or ``None``

        :return:  A Node object for the new node.
        :rtype:   :class:`Node`
        z<Cannot specify both 'ex_boot_disk' and 'ex_disks_gce_struct'ú1Cannot specify both 'image' and 'ex_image_family'z„Missing root device or image. Must specify an 'image', 'ex_image_family', existing 'ex_boot_disk', or use the 'ex_disks_gce_struct'.r_   r­  r"  NzcMissing accelerator count. Must specify an 'ex_accelerator_count' when using 'ex_accelerator_type'.TÚ
PERSISTENTÚ
READ_WRITEr�   )ÚdiskNameÚ
diskSizeGbÚdiskTypeÚsourceImage)Ú
autoDeleteÚbootrn  rH  Ú
deviceNameÚinitializeParamsrc   )r  rR  rc  Ú	boot_diskÚexternal_ipÚinternal_ipÚex_disk_typeÚex_disk_auto_deleteÚex_service_accountsrÃ   Úex_can_ip_forwardÚex_disks_gce_structÚex_nic_gce_structÚex_on_host_maintenanceÚex_automatic_restartÚex_preemptibleÚex_subnetworkr  Úex_accelerator_typeÚex_accelerator_countrq  rƒ  )r¼   rc   r²   rT  Úex_get_sizerà  r¯  rW  Úex_get_image_from_familyrÿ  Úex_get_disktypeÚex_get_volumeÚex_get_accelerator_typerŒ   rT   Ú_verify_zone_is_setÚ_create_node_reqr{   ru  Úex_get_noder_   )r@   r_   r|  r'  rA  Ú
ex_networkr^  Úex_tagsÚex_metadataÚex_boot_diskÚuse_existing_diskrS  rT  rU  rV  rW  rÃ   rX  rY  rZ  r[  r\  r]  Úex_image_familyr  r_  r`  Úex_disk_sizerQ   Ú	node_datas                                 r*   r7  zGCENodeDriver.create_nodeV  sŒ  € ð^ ð 	`Ð/ð 	`ÝÐ^Ñ_Ô_Ð_àð 	U�_ð 	UÝÐSÑTÔTÐTàð 	˜ð 	¨Lð 	Ð<Oð 	Ýð)ñô ð ð Ð(˜tœyˆàð 	2�G H¨fÑ5Ô5ð 	2Ø×'Ò'¨Ñ1Ô1ˆHå�t˜VÑ$Ô$ð 	4Ø×#Ò# D¨(Ñ3Ô3ˆDå�z 6Ñ*Ô*ð 	9Ø×,Ò,¨ZÑ8Ô8ˆJàð 	¥¨¸Ñ!?Ô!?ð 	Ø ×2Ò2Ø d×&@Ò&@ÀÑ&JÔ&Jð 3ñ ô ˆMð ð 	CØ×1Ò1°/ÑBÔBˆEàð 	-� ¨Ñ/Ô/ð 	-Ø×%Ò% eÑ,Ô,ˆEàð 	M¥¨°fÑ =Ô =ð 	MØ×/Ò/°À8Ð/ÑLÔLˆLàð 	K¥¨°fÑ =Ô =ð 	KØ×-Ò-¨lÀÐ-ÑJÔJˆLàð 	c¥wÐ/BÀFÑ'KÔ'Kð 	cØ#Ð+Ý ð-ñô ð ð
 #'×">Ò">Ð?RÐYaÐ">Ñ"bÔ"bÐð #ð 	¨<ð 	ð #6Ø Ø(Ø(Ø"&à$(Ø&2Ø$0Ô$6°zÔ$BØ',¤{°:Ô'>ð	)ð )ðð ð#Ðð  ð 	*˜DœJŸNšN¨6°4Ñ8Ô8ð 	*ð
 ”z &Ô)ˆHð 	× Ò  hÐ Ñ/Ô/Ð/à!×2Ò2ØØØØØØØ Ø"Ø#Ø#Ø%Ø 3Ø 3Ø#Ø/Ø 3Ø/Ø#9Ø!5Ø)Ø'ØØ 3Ø!5ð1 3ñ 
ô 
Ñˆ�ð4 	Œ×%Ò% g°fÀ9Ð%ÑMÔMÐMà×Ò  h¤mÑ4Ô4Ð4r,   c                 óÊ   — d}|                       |||||d|
|||	||||||||||d¬¦  «        }|||dœ}| j                             |d|¬¦  «         |                      |¦  «        S )aš  
        Creates an instance template in the specified project using the data
        that is included in the request. If you are creating a new template to
        update an existing instance group, your new instance template must
        use the same network or, if applicable, the same subnetwork as the
        original template.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  name: The name of the node to create.
        :type   name: ``str``

        :param  size: The machine type to use.
        :type   size: ``str`` or :class:`GCENodeSize`

        :param  image: The image to use to create the node (or, if attaching
                       a persistent disk, the image used to create the disk)
        :type   image: ``str`` or :class:`GCENodeImage` or ``None``

        :keyword  network: The network to associate with the template.
        :type     network: ``str`` or :class:`GCENetwork`

        :keyword  subnetwork: The subnetwork to associate with the node.
        :type     subnetwork: ``str`` or :class:`GCESubnetwork`

        :keyword  tags: A list of tags to associate with the node.
        :type     tags: ``list`` of ``str`` or ``None``

        :keyword  metadata: Metadata dictionary for instance.
        :type     metadata: ``dict`` or ``None``

        :keyword  external_ip: The external IP address to use.  If 'ephemeral'
                               (default), a new non-static address will be
                               used.  If 'None', then no external address will
                               be used.  To use an existing static IP address,
                               a GCEAddress object should be passed in.
        :type     external_ip: :class:`GCEAddress` or ``str`` or ``None``

        :keyword  internal_ip: The private IP address to use.
        :type     internal_ip: :class:`GCEAddress` or ``str`` or ``None``

        :keyword  disk_type: Specify a pd-standard (default) disk or pd-ssd
                                for an SSD disk.
        :type     disk_type: ``str`` or :class:`GCEDiskType`

        :keyword  disk_auto_delete: Indicate that the boot disk should be
                                       deleted when the Node is deleted. Set to
                                       True by default.
        :type     disk_auto_delete: ``bool``

        :keyword  service_accounts: Specify a list of serviceAccounts when
                                       creating the instance. The format is a
                                       list of dictionaries containing email
                                       and list of scopes, e.g.
                                       [{'email':'default',
                                       'scopes':['compute', ...]}, ...]
                                       Scopes can either be full URLs or short
                                       names. If not provided, use the
                                       'default' service account email and a
                                       scope of 'devstorage.read_only'. Also
                                       accepts the aliases defined in
                                       'gcloud compute'.
        :type     service_accounts: ``list``

        :keyword  description: The description of the node (instance).
        :type     description: ``str`` or ``None``

        :keyword  can_ip_forward: Set to ``True`` to allow this node to
                                  send/receive non-matching src/dst packets.
        :type     can_ip_forward: ``bool`` or ``None``

        :keyword  disks_gce_struct: Support for passing in the GCE-specific
                                       formatted disks[] structure. No attempt
                                       is made to ensure proper formatting of
                                       the disks[] structure. Using this
                                       structure obviates the need of using
                                       other disk params like 'ex_boot_disk',
                                       etc. See the GCE docs for specific
                                       details.
        :type     disks_gce_struct: ``list`` or ``None``

        :keyword  nic_gce_struct: Support passing in the GCE-specific
                                     formatted networkInterfaces[] structure.
                                     No attempt is made to ensure proper
                                     formatting of the networkInterfaces[]
                                     data. Using this structure obviates the
                                     need of using 'external_ip' and
                                     'ex_network'.  See the GCE docs for
                                     details.
        :type     nic_gce_struct: ``list`` or ``None``

        :keyword  on_host_maintenance: Defines whether node should be
                                          terminated or migrated when host
                                          machine goes down. Acceptable values
                                          are: 'MIGRATE' or 'TERMINATE' (If
                                          not supplied, value will be reset to
                                          GCE default value for the instance
                                          type.)
        :type     ex_on_host_maintenance: ``str`` or ``None``

        :keyword  automatic_restart: Defines whether the instance should be
                                        automatically restarted when it is
                                        terminated by Compute Engine. (If not
                                        supplied, value will be set to the GCE
                                        default value for the instance type.)
        :type     automatic_restart: ``bool`` or ``None``

        :keyword  preemptible: Defines whether the instance is preemptible.
                                  (If not supplied, the instance will not be
                                  preemptible)
        :type     preemptible: ``bool`` or ``None``

        :return:  An Instance Template object.
        :rtype:   :class:`GCEInstanceTemplate`
        r‰  TF)Ú	node_sizerù  r'  Ú	disk_typeÚdisk_auto_deleterS  r  r³  Úcan_ip_forwardÚservice_accountsÚon_host_maintenancerT  Úautomatic_restartÚpreemptiblerR  rc  rÃ   Údisks_gce_structÚnic_gce_structÚuse_selflinks)r_   rÃ   r«  rq  rƒ  )Ú_create_instance_propertiesr{   ru  r  )r@   r_   r|  rù  r'  rs  rt  r  r³  ru  rS  rT  rv  rw  rx  ry  rR  rc  rÃ   rz  r{  rQ   r«  r  s                           r*   Úex_create_instancetemplatez(GCENodeDriver.ex_create_instancetemplates  s­   € ðX .ˆà×5Ò5ØØØØØØ!Ø#ØØ!Ø)Ø-Ø 3Ø#Ø/Ø#ØØØ#Ø-Ø)Øð+ 6ñ 
ô 
ˆ
ð2 Ø&Ø$ð
ð 
ˆð 	Œ×%Ò% g°fÀ<Ð%ÑPÔPÐPà×+Ò+¨DÑ1Ô1Ð1r,   c                 ó(  — i }|s|s|st          d¦  «        ‚|r|rt          d¦  «        ‚|r||d<   n:d}d}|r|j        }|j        }d}|                      |||||dd|d||¬¦  «        g|d<   |�Rt          |	d	¦  «        rt          d
¦  «        ‚t          |d¦  «        r|j        dk    rd}nt          d¦  «        ‚||d<   n|                      |||	d|
¬¦  «        g|d<   |                      |||¦  «        }|r||d<   |                      |¦  «        |d<   |�|                      ||¦  «        |d<   |rt          |¦  «        |d<   |rd|i|d<   |r|  	                    d|¬¦  «        |d<   |r||d<   |rd|d<   |  
                    ||d¬¦  «        |d<   |S )aé  
        Create the GCE instance properties needed for instance templates.

        :param    node_size: The machine type to use.
        :type     node_size: ``str`` or :class:`GCENodeSize`

        :keyword  source: A source disk to attach to the instance. Cannot
                          specify both 'image' and 'source'.
        :type     source: :class:`StorageVolume` or ``str`` or ``None``

        :param    image: The image to use to create the node. Cannot specify
                         both 'image' and 'source'.
        :type     image: ``str`` or :class:`GCENodeImage` or ``None``

        :keyword  disk_type: Specify a pd-standard (default) disk or pd-ssd
                             for an SSD disk.
        :type     disk_type: ``str`` or :class:`GCEDiskType`

        :keyword  disk_auto_delete: Indicate that the boot disk should be
                                    deleted when the Node is deleted. Set to
                                    True by default.
        :type     disk_auto_delete: ``bool``

        :keyword  network: The network to associate with the node.
        :type     network: ``str`` or :class:`GCENetwork`

        :keyword  subnetwork: The Subnetwork resource for this instance. If
                              the network resource is in legacy mode, do not
                              provide this property. If the network is in auto
                              subnet mode, providing the subnetwork is
                              optional. If the network is in custom subnet
                              mode, then this field should be specified.
        :type     subnetwork: :class: `GCESubnetwork` or None

        :keyword  external_ip: The external IP address to use.  If 'ephemeral'
                               (default), a new non-static address will be
                               used.  If 'None', then no external address will
                               be used.  To use an existing static IP address,
                               a GCEAddress object should be passed in.
        :type     external_ip: :class:`GCEAddress` or ``str`` or ``None``

        :keyword  internal_ip: The private IP address to use.
        :type     internal_ip: :class:`GCEAddress` or ``str`` or ``None``

        :keyword  can_ip_forward: Set to ``True`` to allow this node to
                                  send/receive non-matching src/dst packets.
        :type     can_ip_forward: ``bool`` or ``None``

        :keyword  service_accounts: Specify a list of serviceAccounts when
                                    creating the instance. The format is a
                                    list of dictionaries containing email
                                    and list of scopes, e.g.
                                    [{'email':'default',
                                    'scopes':['compute', ...]}, ...]
                                    Scopes can either be full URLs or short
                                    names. If not provided, use the
                                    'default' service account email and a
                                    scope of 'devstorage.read_only'. Also
                                    accepts the aliases defined in
                                    'gcloud compute'.
        :type     service_accounts: ``list``

        :keyword  on_host_maintenance: Defines whether node should be
                                       terminated or migrated when host
                                       machine goes down. Acceptable values
                                       are: 'MIGRATE' or 'TERMINATE' (If
                                       not supplied, value will be reset to
                                       GCE default value for the instance
                                       type.)
        :type     on_host_maintenance: ``str`` or ``None``

        :keyword  automatic_restart: Defines whether the instance should be
                                     automatically restarted when it is
                                     terminated by Compute Engine. (If not
                                     supplied, value will be set to the GCE
                                     default value for the instance type.)
        :type     automatic_restart: ``bool`` or ``None``

        :keyword  preemptible: Defines whether the instance is preemptible.
                               (If not supplied, the instance will not be
                               preemptible)
        :type     preemptible: ``bool`` or ``None``

        :keyword  tags: A list of tags to associate with the node.
        :type     tags: ``list`` of ``str`` or ``None``

        :keyword  metadata: Metadata dictionary for instance.
        :type     metadata: ``dict`` or ``None``

        :keyword  description: The description of the node (instance).
        :type     description: ``str`` or ``None``

        :keyword  disks_gce_struct: Support for passing in the GCE-specific
                                    formatted disks[] structure. No attempt
                                    is made to ensure proper formatting of
                                    the disks[] structure. Using this
                                    structure obviates the need of using
                                    other disk params like 'boot_disk',
                                    etc. See the GCE docs for specific
                                    details.
        :type     disks_gce_struct: ``list`` or ``None``

        :keyword  nic_gce_struct: Support passing in the GCE-specific
                                  formatted networkInterfaces[] structure.
                                  No attempt is made to ensure proper
                                  formatting of the networkInterfaces[]
                                  data. Using this structure obviates the
                                  need of using 'external_ip' and
                                  'network'.  See the GCE docs for
                                  details.
        :type     nic_gce_struct: ``list`` or ``None``

        :type     labels: Labels dict for instance
        :type     labels: ``dict`` or ``None``

        :keyword  accelerator_type: Support for passing in the GCE-specifc
                                    accelerator type to request for the VM.
        :type     accelerator_type: :class:`GCEAcceleratorType` or ``None``

        :keyword  accelerator_count: Support for passing in the number of
                                     requested 'accelerator_type' accelerators
                                     attached to the VM. Will only pay attention
                                     to this field if 'accelerator_type' is not
                                     None.
        :type     accelerator_count: ``int`` or ``None``

        :keyword  disk_size: Specify size of the boot disk.
                             Integer in gigabytes.
        :type     disk_size: ``int`` or ``None``

        :return:  A dictionary formatted for use with the GCE API.
        :rtype:   ``dict``
        z]Missing root device or image. Must specify an 'image', source, or use the 'disks_gce_struct'.zJCannot specify both 'source' and 'disks_gce_struct'. Use one or the other.rœ  NrH  rI  T)
rù  rs  r'  Ú	disk_nameÚ
usage_typeÚ
mount_modeÚauto_deleteÚis_bootr|  Ú	disk_sizer¬   zSCannot specify both a static IP address and 'nic_gce_struct'. Use one or the other.r_   rO  zICannot specify both 'network' and 'nic_gce_struct'. Use one or the other.ÚnetworkInterfaces)r  r³  rS  r|  rT  Ú
schedulingÚserviceAccountsÚguestAcceleratorsrÃ   rO   rR  r­  )r�  rc  rc  r‹  ÚcanIpForwardr|  ©ÚobjÚget_selflinksÚobjnamer¬  )r¼   r_   Ú_build_disk_gce_structr²   Ú_build_network_gce_structÚ_build_scheduling_gce_structÚ _build_service_accounts_gce_listÚ_format_guest_acceleratorsr�   r„  Ú_get_selflink_or_name)r@   r_   rr  rù  r'  rs  rt  r  r³  rS  rT  ru  rv  rw  rx  ry  rR  rc  rÃ   rz  r{  r|  r‹  Úaccelerator_typeÚaccelerator_countr…  Úinstance_propertiesr€  Údevice_namer‡  s                                 r*   r}  z)GCENodeDriver._create_instance_properties#  sÜ  € ðB !Ðð ð 	˜Vð 	Ð,<ð 	Ýð&ñô ð ð ð 	Ð&ð 	ÝØ_ñô ð ð ð 	Ø+;Ð Ñ(Ð(àˆIØˆKàð Ø"œK�	à$œk�Ø�ð ×+Ò+ØØ!Ø'ØØ'Ø+Ø+Ø 0Ø Ø"/Ø'ð ,ñ ô ð,Ð Ñ(ð$ Ð%Ý�{ IÑ.Ô.ð Ý ðñô ð õ �w Ñ'Ô'ð Ø”< 9Ò,Ð,ð #�G�Gå$ð!ñô ð ð
 8FÐÐ 3Ñ4Ð4ð ×.Ò.Ø#Ø)Ø +Ø"&Ø +ð /ñ ô ð8ÐÐ 3Ñ4ð ×6Ò6ØÐ!2°Kñ
ô 
ˆ
ð ð 	;Ø0:Ð Ñ-ð 26×1VÒ1VØñ2
ô 2
ÐÐ-Ñ.ð Ð'Ø7;×7VÒ7VØ Ð"3ñ8ô 8ÐÐ 3Ñ4ð ð 	BÝ14°[Ñ1AÔ1AÐ Ñ.àð 	:Ø+2°D¨/Ð Ñ'àð 	Ø.2×.CÒ.CØ ¨8ð /Dñ /ô /Ð 
Ñ+ð ð 	3Ø,2Ð Ñ)àð 	7Ø26Ð Ñ/à-1×-GÒ-GØ¨Àð .Hñ .
ô .
Ð˜MÑ*ð #Ð"r,   rI  rH  c                 óÆ  — |€|€t          d¦  «        ‚t          |
t          ¦  «        st          d¦  «        ‚|�Ht          |t          ¦  «        s3|                     ¦   «         st          dt          |¦  «        z  ¦  «        ‚ddg}||vr%t          dd                     |¦  «        z  ¦  «        ‚d	d
g}|	|vr%t          dd                     |¦  «        z  ¦  «        ‚i }|s|}|�|                      ||d¬¦  «        |d<   nF|                      |dd¬¦  «        }|                      ||d¬¦  «        }|||dœ|d<   |�||d         d<   |                     ||	|||
dœ¦  «         |S )a‹  
        Generates the GCP dict for a disk.

        :param    device_name: Specifies a unique device name of your
                               choice that is reflected into the
                               /dev/disk/by-id/google-* tree
                               of a Linux operating system running within the
                               instance. This name can be used to reference the
                               device for mounting, resizing, and so on, from
                               within the instance.  Defaults to disk_name.
        :type      device_name: ``str``

        :keyword   source: The disk to attach to the instance.
        :type      source: ``str`` of selfLink, :class:`StorageVolume` or None

        :keyword   disk_type: Specify a URL or DiskType object.
        :type      disk_type: ``str`` or :class:`GCEDiskType` or ``None``

        :keyword   image: The image to use to create the disk.
        :type      image: :class:`GCENodeImage` or ``None``

        :keyword   disk_size: Integer in gigabytes.
        :type      disk_size: ``int``

        :param     disk_name: Specifies the disk name. If not specified, the
                              default is to use the device_name.
        :type      disk_name: ``str``

        :keyword   mount_mode: The mode in which to attach this disk, either
                               READ_WRITE or READ_ONLY. If not specified,
                               the default is to attach the disk in READ_WRITE
                               mode.
        :type      mount_mode: ``str``

        :keyword   usage_type: Specifies the type of the disk, either SCRATCH
                               or PERSISTENT. If not specified, the default
                               is PERSISTENT.
        :type      usage_type: ``str``

        :keyword   auto_delete: Indicate that the boot disk should be
                                deleted when the Node is deleted. Set to
                                True by default.
        :type      auto_delete: ``bool``

        :return:   Dictionary to be used in disk-portion of
                   instance API call.
        :rtype:    ``dict``
        Nz:Either the 'source' or 'image' argument must be specified.z auto_delete field is not a bool.z)disk_size must be a digit, '%s' provided.rI  Ú	READ_ONLYzmount mode must be one of: %s.rÀ  rH  ÚSCRATCHzusage type must be one of: %s.r�  r‹  rù  Tr'  Údisktype)rJ  rL  rM  rQ  rK  )rO  rn  rH  rP  rN  )	r¼   r¸   Úboolr#   Úisdigitr�   rÃ  r”  rH   )r@   r˜  rù  rs  r…  r'  r€  r„  r‚  r�  rƒ  r|  Úmount_modesÚusage_typesr]  s                  r*   r�  z$GCENodeDriver._build_disk_gce_struct?  sÓ  € ð@ ˆ>˜e˜mÝÐYÑZÔZÐZå˜+¥tÑ,Ô,ð 	AÝÐ?Ñ@Ô@Ð@àÐ ­*°YÅÑ*DÔ*DÐ È	×HYÒHYÑH[ÔH[Ð ÝÐHÍ3ÈyÉ>Ì>ÑYÑZÔZÐZà# [Ð1ˆà˜[Ð(Ð(ÝÐ=ÀÇÂÈ+ÑAVÔAVÑWÑXÔXÐXØ# YÐ/ˆà˜[Ð(Ð(ÝÐ=ÀÇÂÈ+ÑAVÔAVÑWÑXÔXÐXàˆàð 	$Ø#ˆIàÐØ!×7Ò7Ø¨-Àð 8ñ ô ˆD�‰NˆNð ×.Ò.°5ÈÐV]Ð.Ñ^Ô^ˆEØ×2Ò2Ø¨]ÀJð 3ñ ô ˆIð
 &Ø%Ø$ð(ð (ˆDÐ#Ñ$ð Ð$Ø9B�Ð'Ô(¨Ñ6ð 	�ŠàØ"Ø"Ø)Ø)ðð ñ	
ô 	
ð 	
ð ˆr,   c                 óÒ   — |rMt          |d¦  «        s0|rt          | d|z  ¦  «        } ||¦  «        }nt          d¦  «        ‚|j        d         S t          |d¦  «        s|S |j        S )a·  
        Return the selflink or name, given a name or object.

        Will try to fetch the appropriate object if necessary (assumes
        we only need one parameter to fetch the object, no introspection
        is performed).

        :param    obj: object to test.
        :type     obj: ``str`` or ``object``

        :param    get_selflinks: Inform if we should return selfLinks or just
                              the name.  Default is True.
        :param    get_selflinks: ``bool``

        :param    objname: string to use in constructing method call
        :type     objname: ``str`` or None

        :return:  URL from extra['selfLink'] or name
        :rtype:   ``str``
        r_   ú	ex_get_%sz)objname must be set if selflinks is True.r�   )r²   rW  r¼   rŒ   r_   )r@   rŒ  r�  rŽ  Úgetobjs        r*   r”  z#GCENodeDriver._get_selflink_or_name¹  s…   € ð, ð 	 Ý˜3 Ñ'Ô'ð RØð RÝ$ T¨;¸'Ñ+BÑCÔC�FØ ˜& ™+œ+�C�Cå$Ð%PÑQÔQÐQà”9˜ZÔ(Ð(å˜3 Ñ'Ô'ð  Ø�
à”x�r,   c                 óò   — i }ddi}|€d}|                       ||d¬¦  «        |d<   |r|                       ||d¬¦  «        |d<   |r+dd	d
œg}t          |d¦  «        r|j        |d         d<   ||d<   |r||d<   |S )aæ  
        Build network interface dict for use in the GCE API.

        Note: Must be wrapped in a list before passing to the GCE API.

        :param    network: The network to associate with the node.
        :type     network: :class:`GCENetwork`

        :keyword  subnetwork: The subnetwork to include.
        :type     subnetwork: :class:`GCESubNetwork`

        :keyword  external_ip: The external IP address to use.  If 'ephemeral'
                               (default), a new non-static address will be
                               used.  If 'None', then no external address will
                               be used.  To use an existing static IP address,
                               a GCEAddress object should be passed in.
        :type     external_ip: :class:`GCEAddress`

        :keyword  internal_ip: The private IP address to use.
        :type     internal_ip: :class:`GCEAddress` or ``str``

        :return:  network interface dict
        :rtype:   ``dict``
        r�   z compute#instanceNetworkInterfaceNrO  r  r‹  r³  zExternal NATrm  )r_   rn  r¬   r   ro  ÚaccessConfigsÚ	networkIP)r”  r²   r¬   )r@   r  r³  rS  r|  rT  ÚniÚaccess_configss           r*   r�  z'GCENodeDriver._build_network_gce_structÞ  sÔ   € ð@ ˆØÐ8Ð9ˆàˆ?ØˆGà×2Ò2Ø }¸ið 3ñ 
ô 
ˆˆ9‰ð ð 	Ø#×9Ò9Ø¨mÀ\ð  :ñ  ô  ˆBˆ|Ñð ð 	1Ø'5Ð?OÐPÐPÐQˆNå�{ IÑ.Ô.ð AØ-8Ô-@�˜qÔ! 'Ñ*Ø"0ˆBˆÑàð 	*Ø)ˆBˆ{‰Oàˆ	r,   c                 ó   — t          |t          ¦  «        s=t          dt          t	          |¦  «        ¦  «        ›dt          |¦  «        ›d�¦  «        ‚i }d|vr||d<   n|d         |d<   d|vr| j        |z   g|d<   n‘g }|d         D ]�}|                     | j        ¦  «        r|                     |¦  «         Œ2|| j        v r)|                     | j        | j        |         z   ¦  «         Œd|                     | j        |z   ¦  «         Œ‚||d<   |S )a›  
         Helper to create Service Account dict.  Use
         _build_service_accounts_gce_list to create a list ready for the
         GCE API.

         :param: service_account: dictionarie containing email
                                  and list of scopes, e.g.
                                  [{'email':'default',
                                  'scopes':['compute', ...]}, ...]
                                  Scopes can either be full URLs or short
                                  names. If not provided, use the
                                  'default' service account email and a
                                  scope of 'devstorage.read_only'. Also
                                  accepts the aliases defined in
                                  'gcloud compute'.
        :type    service_account: ``dict`` or None

        :return: dict usable in GCE API call.
        :rtype:  ``dict``
        z+service_account not in the correct format,'z - ú'ÚemailrO  )	r¸   Údictr¼   r�   rn  ÚAUTH_URLr«  r`   ÚSA_SCOPES_MAP)r@   Úservice_accountÚdefault_emailÚdefault_scopeÚsaÚpsÚscopes          r*   Ú!_build_service_account_gce_structz/GCENodeDriver._build_service_account_gce_struct  sF  € õ6 ˜/­4Ñ0Ô0ð 	Ý�*å"¥4¨Ñ#8Ô#8Ñ9Ô9Ð9Ð9½3¸Ñ;OÔ;OÐ;OÐ;OðQñô ð ð ˆà˜/Ð)Ð)Ø'ˆBˆw‰KˆKà)¨'Ô2ˆBˆw‰Kà˜?Ð*Ð*Ø œM¨MÑ9Ð:ˆBˆx‰LˆLàˆBà(¨Ô2ð 5ð 5�Ø×#Ò# D¤MÑ2Ô2ð 5Ø—I’I˜eÑ$Ô$Ð$Ð$Ø˜dÔ0Ð0Ð0Ø—I’I˜dœm¨dÔ.@ÀÔ.GÑGÑHÔHÐHÐHà—I’I˜dœm¨eÑ3Ñ4Ô4Ð4Ð4ØˆBˆx‰Làˆ	r,   c                 óÒ   — g }|€|| j         |z   gdœg}nRt          |t          ¦  «        st          d¦  «        ‚|D ]+}|                     |                      |¬¦  «        ¦  «         Œ,|S )a"  
        Helper to create service account list for GCE API.

        :keyword  service_accounts: Specify a list of serviceAccounts when
                                       creating the instance. The format is a
                                       list of dictionaries containing email
                                       and list of scopes, e.g.
                                       [{'email':'default',
                                       'scopes':['compute', ...]}, ...]
                                       Scopes can either be full URLs or short
                                       names. If not provided, use the
                                       'default' service account email and a
                                       scope of 'devstorage.read_only'. Also
                                       accepts the aliases defined in
                                       'gcloud compute'.

        :type     service_accounts: ``list`` of ``dict``, ``None`` or an empty
                                    list. ``None` means use a default service
                                    account and an empty list indicates no
                                    service account.

        :return:  list of dictionaries usable in the GCE API.
        :rtype:   ``list`` of ``dict``
        N)r«  rO  z%service_accounts field is not a list.)r¯  )r­  r¸   ra  r¼   r`   rµ  )r@   rv  r°  r±  Úgce_service_accountsr²  s         r*   r’  z.GCENodeDriver._build_service_accounts_gce_listP  sœ   € ð<  "ÐàÐ#à'°D´MÀMÑ4QÐ3RÐSÐSð$Ð Ð õ Ð,­dÑ3Ô3ð 	ÝÐDÑEÔEÐEà&ð ð �Ø$×+Ò+Ø×:Ò:È2Ð:ÑNÔNñô ð ð ð $Ð#r,   c                 ó®  — i }|�*t          |t          ¦  «        r||d<   nt          d¦  «        ‚|�addg}t          |t          ¦  «        r#||v r|du r|dk    rt          d¦  «        ‚||d<   n%t          d	d
                     |¦  «        z  ¦  «        ‚|�At          |t          ¦  «        r|du r|du rt          d¦  «        ‚||d<   nt          d¦  «        ‚|S )a¬  
        Build the scheduling dict suitable for use with the GCE API.

        :param    on_host_maintenance: Defines whether node should be
                                          terminated or migrated when host
                                          machine goes down. Acceptable values
                                          are: 'MIGRATE' or 'TERMINATE' (If
                                          not supplied, value will be reset to
                                          GCE default value for the instance
                                          type.)
        :type     on_host_maintenance: ``str`` or ``None``

        :param    automatic_restart: Defines whether the instance should be
                                        automatically restarted when it is
                                        terminated by Compute Engine. (If not
                                        supplied, value will be set to the GCE
                                        default value for the instance type.)
        :type     automatic_restart: ``bool`` or ``None``

        :param    preemptible: Defines whether the instance is preemptible.
                                        (If not supplied, the instance will
                                         not be preemptible)
        :type     preemptible: ``bool`` or ``None``

        :return:  A dictionary of scheduling options for the GCE API.
        :rtype:   ``dict``
        Nry  z boolean expected for preemptibleÚMIGRATEÚ	TERMINATETz@host maintenance cannot be 'MIGRATE' if instance is preemptible.ÚonHostMaintenancez"host maintenance must be one of %srÀ  z2instance cannot be restarted if it is preemptible.ÚautomaticRestartzboolean expected for automatic)r¸   r�  r¼   r�   rÃ  )r@   rw  rx  ry  r‡  Ú
maint_optss         r*   r‘  z*GCENodeDriver._build_scheduling_gce_struct~  s-  € ð< ˆ
àÐ"Ý˜+¥tÑ,Ô,ð EØ,7�
˜=Ñ)Ð)å Ð!CÑDÔDÐDàÐ*Ø# [Ð1ˆJåÐ-­sÑ3Ô3ð `Ð8KÈzÐ8YÐ8YØ $Ð&Ð&Ð+>À)Ò+KÐ+KÝ$Ø]ñô ð ð 3F�
Ð.Ñ/Ð/å Ð!EÈÏÊÐR\ÑI]ÔI]Ñ!^Ñ_Ô_Ð_àÐ(ÝÐ+­TÑ2Ô2ð CØ$¨Ð,Ð,°ÀÐ1DÐ1DÝ$Ð%YÑZÔZÐZØ1B�
Ð-Ñ.Ð.õ !Ð!AÑBÔBÐBàÐr,   rÑ  c                 óú  — |r|rt          d¦  «        ‚|r|rt          d¦  «        ‚|p| j        }t          |d¦  «        s|                      |¦  «        }t          |d¦  «        s|                      ||¦  «        }t          |d¦  «        s|                      |¦  «        }|r:t          |d¦  «        s*|                      ||                      |¦  «        ¬¦  «        }|r|                      |¦  «        }|r%t          |d¦  «        s|  	                    |¦  «        }t          |d¦  «        s|  
                    ||¬¦  «        }i d|“d|“d|“d	|“d
|“d|“d|	“d|
“d|“d|“d|“d|“d|“d|“d|“d|“d|“||||||dœ¥}g }t          |¦  «        D ]$}d||fz  } | dddœ}!|                     |!¦  «         Œ%t          j        ¦   «         }"d}#|#s�t          j        ¦   «         |"z
  |k    rt          d¦  «        ‚d}#t          j        |¦  «         |D ]I}!|!d         s5|!d         s|                      |!|¦  «         n|                      |!|¦  «         |!d         sd}#ŒJ|#¯�g }$|D ]}!|$                     |!d         ¦  «         Œ|$S ) a'  
        Create multiple nodes and return a list of Node objects.

        Nodes will be named with the base name and a number.  For example, if
        the base name is 'libcloud' and you create 3 nodes, they will be
        named::

            libcloud-000
            libcloud-001
            libcloud-002

        :param  base_name: The base name of the nodes to create.
        :type   base_name: ``str``

        :param  size: The machine type to use.
        :type   size: ``str`` or :class:`GCENodeSize`

        :param  image: The image to use to create the nodes.
        :type   image: ``str`` or :class:`GCENodeImage`

        :param  number: The number of nodes to create.
        :type   number: ``int``

        :keyword  location: The location (zone) to create the nodes in.
        :type     location: ``str`` or :class:`NodeLocation` or
                            :class:`GCEZone` or ``None``

        :keyword  ex_network: The network to associate with the nodes.
        :type     ex_network: ``str`` or :class:`GCENetwork`

        :keyword  ex_tags: A list of tags to associate with the nodes.
        :type     ex_tags: ``list`` of ``str`` or ``None``

        :keyword  ex_metadata: Metadata dictionary for instances.
        :type     ex_metadata: ``dict`` or ``None``

        :keyword  ignore_errors: If True, don't raise Exceptions if one or
                                 more nodes fails.
        :type     ignore_errors: ``bool``

        :keyword  use_existing_disk: If True and if an existing disk with the
                                     same name/location is found, use that
                                     disk instead of creating a new one.
        :type     use_existing_disk: ``bool``

        :keyword  poll_interval: Number of seconds between status checks.
        :type     poll_interval: ``int``

        :keyword  external_ip: The external IP address to use.  If 'ephemeral'
                               (default), a new non-static address will be
                               used. If 'None', then no external address will
                               be used. (Static addresses are not supported for
                               multiple node creation.)
        :type     external_ip: ``str`` or None


        :keyword  internal_ip: The private IP address to use.
        :type     internal_ip: :class:`GCEAddress` or ``str`` or ``None``

        :keyword  ex_disk_type: Specify a pd-standard (default) disk or pd-ssd
                                for an SSD disk.
        :type     ex_disk_type: ``str`` or :class:`GCEDiskType`

        :keyword  ex_disk_auto_delete: Indicate that the boot disk should be
                                       deleted when the Node is deleted. Set to
                                       True by default.
        :type     ex_disk_auto_delete: ``bool``

        :keyword  ex_service_accounts: Specify a list of serviceAccounts when
                                       creating the instance. The format is a
                                       list of dictionaries containing email
                                       and list of scopes, e.g.
                                       [{'email':'default',
                                       'scopes':['compute', ...]}, ...]
                                       Scopes can either be full URLs or short
                                       names. If not provided, use the
                                       'default' service account email and a
                                       scope of 'devstorage.read_only'. Also
                                       accepts the aliases defined in
                                       'gcloud compute'.
        :type     ex_service_accounts: ``list``

        :keyword  timeout: The number of seconds to wait for all nodes to be
                           created before timing out.
        :type     timeout: ``int``

        :keyword  description: The description of the node (instance).
        :type     description: ``str`` or ``None``

        :keyword  ex_can_ip_forward: Set to ``True`` to allow this node to
                                     send/receive non-matching src/dst packets.
        :type     ex_can_ip_forward: ``bool`` or ``None``

        :keyword  ex_preemptible: Defines whether the instance is preemptible.
                                  (If not supplied, the instance will
                                  not be preemptible)
        :type     ex_preemptible: ``bool`` or ``None``

        :keyword  ex_disks_gce_struct: Support for passing in the GCE-specific
                                       formatted disks[] structure. No attempt
                                       is made to ensure proper formatting of
                                       the disks[] structure. Using this
                                       structure obviates the need of using
                                       other disk params like 'ex_boot_disk',
                                       etc. See the GCE docs for specific
                                       details.
        :type     ex_disks_gce_struct: ``list`` or ``None``

        :keyword  ex_nic_gce_struct: Support passing in the GCE-specific
                                     formatted networkInterfaces[] structure.
                                     No attempt is made to ensure proper
                                     formatting of the networkInterfaces[]
                                     data. Using this structure obviates the
                                     need of using 'external_ip' and
                                     'ex_network'.  See the GCE docs for
                                     details.
        :type     ex_nic_gce_struct: ``list`` or ``None``

        :keyword  ex_on_host_maintenance: Defines whether node should be
                                          terminated or migrated when host
                                          machine goes down. Acceptable values
                                          are: 'MIGRATE' or 'TERMINATE' (If
                                          not supplied, value will be reset to
                                          GCE default value for the instance
                                          type.)
        :type     ex_on_host_maintenance: ``str`` or ``None``

        :keyword  ex_automatic_restart: Defines whether the instance should be
                                        automatically restarted when it is
                                        terminated by Compute Engine. (If not
                                        supplied, value will be set to the GCE
                                        default value for the instance type.)
        :type     ex_automatic_restart: ``bool`` or ``None``

        :keyword  ex_image_family: Determine image from an 'Image Family'
                                   instead of by name. 'image' should be None
                                   to use this keyword.
        :type     ex_image_family: ``str`` or ``None``

        :param    ex_labels: Label dict for node.
        :type     ex_labels: ``dict``

        :keyword  ex_disk_size: Defines size of the boot disk.
                                Integer in gigabytes.
        :type     ex_disk_size: ``int`` or ``None``

        :return:  A list of Node objects for the new nodes.
        :rtype:   ``list`` of :class:`Node`

        z6Cannot specify both 'image' and 'ex_disks_gce_struct'.rG  r_   r­  r"  r|  r'  rA  r  r³  rR  rc  Úignore_errorsrm  rS  rT  rU  rV  rW  rÃ   rX  rY  )rZ  r[  r\  r]  r  ro  z%s-%03dN)r_   Únode_responser˜  Fz5Timeout (%s sec) while waiting for multiple instancesTr˜  rÀ  )r¼   rc   r²   rT  ra  rà  r¯  rW  rb  rÿ  rc  Úranger`   Útimer“   ÚsleepÚ_multi_create_nodeÚ_multi_check_node)%r@   Ú	base_namer|  r'  ÚnumberrA  ri  r^  rj  rk  r¿  rm  Úpoll_intervalrS  rT  rU  rV  rW  rÚ   rÃ   rX  rY  rZ  r[  r\  rn  r]  r  ro  Ú
node_attrsÚstatus_listr  r_   ru  Ú
start_timeÚcompleter½  s%                                        r*   Úex_create_multiple_nodesz&GCENodeDriver.ex_create_multiple_nodes»  sÇ  € ðl ð 	ZÐ(ð 	ZÝÐXÑYÔYÐYàð 	U�_ð 	UÝÐSÑTÔTÐTàÐ(˜tœyˆå�x Ñ(Ô(ð 	2Ø×'Ò'¨Ñ1Ô1ˆHå�t˜VÑ$Ô$ð 	4Ø×#Ò# D¨(Ñ3Ô3ˆDå�z 6Ñ*Ô*ð 	9Ø×,Ò,¨ZÑ8Ô8ˆJàð 	¥¨¸Ñ!?Ô!?ð 	Ø ×2Ò2Ø d×&@Ò&@ÀÑ&JÔ&Jð 3ñ ô ˆMð ð 	CØ×1Ò1°/ÑBÔBˆEàð 	-� ¨Ñ/Ô/ð 	-Ø×%Ò% eÑ,Ô,ˆEå�| VÑ,Ô,ð 	MØ×/Ò/°À8Ð/ÑLÔLˆLð
Ø�Dð
à�Uð
ð ˜ð
ð �zð	
ð
 ˜-ð
ð �Gð
ð ˜ð
ð ˜]ð
ð  Ð!2ð
ð ˜;ð
ð ˜;ð
ð ˜Lð
ð "Ð#6ð
ð "Ð#6ð
ð ˜;ð
ð   Ð!2ð!
ð" "Ð#6ð#
ð$ "3Ø&<Ø$8Ø,Ø"Ø(ð/
ð 
ð 
ˆ
ð4 ˆå�v‘”ð 	'ð 	'ˆAØ 	¨1˜~Ñ-ˆDØ"°TÀ4ÐHÐHˆFØ×Ò˜vÑ&Ô&Ð&Ð&å”Y‘[”[ˆ
Øˆàð 	%ÝŒy‰{Œ{˜ZÑ'¨7Ò2Ð2ÝÐ ZÑ[Ô[Ð[ØˆHÝŒJ�}Ñ%Ô%Ð%à%ð %ð %�ð ˜f”~ð CØ! /Ô2ð CØ×/Ò/°¸
ÑCÔCÐCÐCà×.Ò.¨v°zÑBÔBÐBð ˜f”~ð %Ø$�Høð% ð 	%ð* ˆ	à!ð 	-ð 	-ˆFØ×Ò˜V Fœ^Ñ,Ô,Ð,Ð,àÐr,   c                 óÜ   — d|i}t          |d¦  «        s|                      |¦  «        }|j        d         |d<   d}| j                             |d|¬¦  «         |                      |¦  «        S )a|  
        Create a target HTTP proxy.

        :param  name: Name of target HTTP proxy
        :type   name: ``str``

        :keyword  urlmap: URL map defining the mapping from URl to the
                           backendservice.
        :type     healthchecks: ``str`` or :class:`GCEUrlMap`

        :return:  Target Pool object
        :rtype:   :class:`GCETargetPool`
        r_   r�   ÚurlMaprJ  rq  rƒ  )r²   Úex_get_urlmaprŒ   r{   ru  rì  )r@   r_   r�  Útargetproxy_datarQ   s        r*   Úex_create_targethttpproxyz'GCENodeDriver.ex_create_targethttpproxyÐ  s|   € ð # D˜>Ðå�v˜vÑ&Ô&ð 	0Ø×'Ò'¨Ñ/Ô/ˆFØ%+¤\°*Ô%=Ð˜Ñ"à-ˆØŒ×%Ò% g°fÐCSÐ%ÑTÔTÐTà×*Ò*¨4Ñ0Ô0Ð0r,   c                 óÀ   — d}i }||d<   ||d<   d„ |D ¦   «         |d<   |j         d         |d<   | j                             |d|¬	¦  «         |                      |¦  «        S )
a™  
        Creates a TargetHttpsProxy resource in the specified project
        using the data included in the request.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  name:  Name of the resource. Provided by the client when the
                       resource is created. The name must be 1-63 characters
                       long, and comply with RFC1035. Specifically, the name
                       must be 1-63 characters long and match the regular
                       expression [a-z]([-a-z0-9]*[a-z0-9])? which means the
                       first character must be a lowercase letter, and all
                       following characters must be a dash, lowercase letter,
                       or digit, except the last character, which cannot be a
                       dash.
        :type   name: ``str``

        :param  sslcertificates:  URLs to SslCertificate resources that
                                     are used to authenticate connections
                                     between users and the load balancer.
                                     Currently, exactly one SSL certificate
                                     must be specified.
        :type   sslcertificates: ``list`` of :class:`GCESslcertificates`

        :param  urlmap:  A fully-qualified or valid partial URL to the
                            UrlMap resource that defines the mapping from URL
                            to the BackendService.
        :type   urlmap: :class:`GCEUrlMap`

        :keyword  description:  An optional description of this resource.
                                Provide this property when you create the
                                resource.
        :type   description: ``str``

        :return:  `GCETargetHttpsProxy` object.
        :rtype: :class:`GCETargetHttpsProxy`
        rR  r_   rÃ   c                 ó(   — g | ]}|j         d          ‘ŒS ©r�   r%  ©r\  rV  s     r*   rŸ  z<GCENodeDriver.ex_create_targethttpsproxy.<locals>.<listcomp>  s   € Ð*XÐ*XÐ*XÀ1¨1¬7°:Ô+>Ð*XÐ*XÐ*Xr,   ÚsslCertificatesr�   rÏ  rq  rƒ  )rŒ   r{   ru  Úex_get_targethttpsproxy)r@   r_   r�  r‰  rÃ   rQ   r  s          r*   Úex_create_targethttpsproxyz(GCENodeDriver.ex_create_targethttpsproxyé  s~   € ðP /ˆØˆØ#ˆ�VÑØ&1ˆ�]Ñ#Ø*XÐ*XÈÐ*XÑ*XÔ*XˆÐ&Ñ'Ø!'¤¨jÔ!9ˆ�XÑàŒ×%Ò% g°fÀ<Ð%ÑPÔPÐPà×+Ò+¨DÑ1Ô1Ð1r,   ÚNO_NATc                 óŽ  — |p| j         }i }||d<   t          |d¦  «        s|                      |¦  «        }|j        d         |d<   |�6t          |d¦  «        s|                      ||¦  «        }|j        d         |d<   ||d<   |r||d<   d|j        z  }| j                             |d	|¬
¦  «         |                      ||¦  «        S )aô  
        Create a target instance.

        :param  name: Name of target instance
        :type   name: ``str``

        :keyword  region: Zone to create the target pool in. Defaults to
                          self.zone
        :type     region: ``str`` or :class:`GCEZone` or ``None``

        :keyword  node: The actual instance to be used as the traffic target.
        :type     node: ``str`` or :class:`Node`

        :keyword  description: A text description for the target instance
        :type     description: ``str`` or ``None``

        :keyword  nat_policy: The NAT option for how IPs are NAT'd to the node.
        :type     nat_policy: ``str``

        :return:  Target Instance object
        :rtype:   :class:`GCETargetInstance`
        r_   r�   rc   Nr.  Ú	natPolicyrÃ   rZ  rq  rƒ  )	rc   r²   rT  rŒ   rh  r_   r{   ru  Úex_get_targetinstance)r@   r_   rc   r˜  rÃ   Ú
nat_policyÚtargetinstance_datarQ   s           r*   Úex_create_targetinstancez&GCENodeDriver.ex_create_targetinstance  sõ   € ð2 Ð �t”yˆØ ÐØ&*Ð˜FÑ#å�t˜VÑ$Ô$ð 	*Ø×#Ò# DÑ)Ô)ˆDØ&*¤j°Ô&<Ð˜FÑ#àÐÝ˜4 Ñ(Ô(ð 4Ø×'Ò'¨¨dÑ3Ô3�Ø.2¬j¸Ô.DÐ 
Ñ+Ø+5Ð˜KÑ(àð 	=Ø1<Ð Ñ.à-°´Ñ;ˆØŒ×%Ò% g°fÐCVÐ%ÑWÔWÐWà×)Ò)¨$°Ñ5Ô5Ð5r,   c                 óV  ‡ — i }|p‰ j         }|r|sd}||d<   |j        d         |d<   |r|sd}	t          |	¦  «        ‚||d<   t          |d¦  «        s‰                      |¦  «        }|j        d         |d<   |r6t          |d         d¦  «        sˆ fd	„|D ¦   «         }
nd
„ |D ¦   «         }
|
|d<   |r6t          |d         d¦  «        sˆ fd„|D ¦   «         }nd„ |D ¦   «         }||d<   |r||d<   d|j        z  }‰ j                             |d|¬¦  «         ‰                      ||¦  «        S )a'  
        Create a target pool.

        :param  name: Name of target pool
        :type   name: ``str``

        :keyword  region: Region to create the target pool in. Defaults to
                          self.region
        :type     region: ``str`` or :class:`GCERegion` or ``None``

        :keyword  healthchecks: Optional list of health checks to attach
        :type     healthchecks: ``list`` of ``str`` or :class:`GCEHealthCheck`

        :keyword  nodes:  Optional list of nodes to attach to the pool
        :type     nodes:  ``list`` of ``str`` or :class:`Node`

        :keyword  session_affinity:  Optional algorithm to use for session
                                     affinity.
        :type     session_affinity:  ``str``

        :keyword  backup_pool: Optional backup targetpool to take over traffic
                               if the failover_ratio is exceeded.
        :type     backup_pool: ``GCETargetPool`` or ``None``

        :keyword  failover_ratio: The percentage of healthy VMs must fall at
                                  or below this value before traffic will be
                                  sent to the backup_pool.
        :type     failover_ratio: :class:`GCETargetPool` or ``None``

        :return:  Target Pool object
        :rtype:   :class:`GCETargetPool`
        rý  ÚfailoverRatior�   Ú
backupPoolz;Must supply a backup targetPool when setting failover_ratior_   r­   r   c                 óP   •— g | ]"}‰                      |¦  «        j        d          ‘Œ#S rÕ  )rÁ  rŒ   rÔ  s     €r*   rŸ  z6GCENodeDriver.ex_create_targetpool.<locals>.<listcomp>ˆ  s/   ø€ Ð^Ð^Ð^ÈA˜4×2Ò2°1Ñ5Ô5Ô;¸JÔGÐ^Ð^Ð^r,   c                 ó(   — g | ]}|j         d          ‘ŒS rÕ  r%  )r\  rÕ  s     r*   rŸ  z6GCENodeDriver.ex_create_targetpool.<locals>.<listcomp>Š  s   € ÐEÐEÐE°1˜1œ7 :Ô.ÐEÐEÐEr,   r¼  c                 óR   •— g | ]#}‰                      |d ¦  «        j        d         ‘Œ$S )Úallr�   )rh  rŒ   r
  s     €r*   rŸ  z6GCENodeDriver.ex_create_targetpool.<locals>.<listcomp>�  s1   ø€ ÐYÐYÐYÈa˜T×-Ò-¨a°Ñ7Ô7Ô=¸jÔIÐYÐYÐYr,   c                 ó(   — g | ]}|j         d          ‘ŒS rÕ  r%  )r\  r  s     r*   rŸ  z6GCENodeDriver.ex_create_targetpool.<locals>.<listcomp>‘  s   € Ð@Ð@Ð@°Q˜QœW ZÔ0Ð@Ð@Ð@r,   r!  ÚsessionAffinityrf  rq  rƒ  )	r­   rŒ   r¼   r²   r®  r_   r{   ru  rí  )r@   r_   r­   rÖ   rì  Úsession_affinityÚbackup_poolr   Útargetpool_datar  Úhc_listr½  rQ   s   `            r*   Úex_create_targetpoolz"GCENodeDriver.ex_create_targetpoolK  s¬  ø€ ðT ˆØÐ&˜4œ;ˆàð 	J˜~ð 	JØ ˆNØ/=ˆO˜OÑ,Ø,7Ô,=¸jÔ,IˆO˜LÑ)àð 	  +ð 	 ØMˆAÝ˜Q‘-”-ÐØ"&ˆ˜Ñå�v˜vÑ&Ô&ð 	0Ø×'Ò'¨Ñ/Ô/ˆFØ$*¤L°Ô$<ˆ˜Ñ!àð 	6Ý˜<¨œ?¨FÑ3Ô3ð FØ^Ð^Ð^Ð^ÐQ]Ð^Ñ^Ô^��àEÐE¸ÐEÑEÔE�Ø.5ˆO˜NÑ+àð 	5Ý˜5 œ8 VÑ,Ô,ð AØYÐYÐYÐYÐSXÐYÑYÔY�	�	à@Ð@¸%Ð@Ñ@Ô@�	Ø+4ˆO˜KÑ(àð 	BØ1AˆOÐ-Ñ.à+¨v¬{Ñ;ˆàŒ×%Ò% g°fÀ?Ð%ÑSÔSÐSà×%Ò% d¨FÑ3Ô3Ð3r,   c                 óÜ   — d|i}t          |d¦  «        s|                      |¦  «        }|j        d         |d<   d}| j                             |d|¬¦  «         |                      |¦  «        S )aF  
        Create a URL Map.

        :param  name: Name of the URL Map.
        :type   name: ``str``

        :keyword  default_service: Default backend service for the map.
        :type     default_service: ``str`` or :class:`GCEBackendService`

        :return:  URL Map object
        :rtype:   :class:`GCEUrlMap`
        r_   r�   ÚdefaultServicerq  rq  rƒ  )r²   rÄ  rŒ   r{   ru  rÐ  )r@   r_   r  Úurlmap_datarQ   s        r*   Úex_create_urlmapzGCENodeDriver.ex_create_urlmap�  s~   € ð ˜t�nˆõ �¨Ñ/Ô/ð 	JØ"×8Ò8¸ÑIÔIˆOØ(7Ô(=¸jÔ(IˆÐ$Ñ%à#ˆØŒ×%Ò% g°fÀ;Ð%ÑOÔOÐOà×!Ò! $Ñ'Ô'Ð'r,   c	                 ó4  — |r|rt          d¦  «        ‚|r|                      |¦  «        }|                      ||||||¦  «        \  }	}
}	 | j                             |	d|
|¬¦  «         n# t
          $ r}|s|‚Y d}~nd}~ww xY w|                      ||¦  «        S )a  
        Create a volume (disk).

        :param  size: Size of volume to create (in GB). Can be None if image
                      or snapshot is supplied.
        :type   size: ``int`` or ``str`` or ``None``

        :param  name: Name of volume to create
        :type   name: ``str``

        :keyword  location: Location (zone) to create the volume in
        :type     location: ``str`` or :class:`GCEZone` or
                            :class:`NodeLocation` or ``None``

        :keyword  snapshot: Snapshot to create image from
        :type     snapshot: :class:`GCESnapshot` or ``str`` or ``None``

        :keyword  image: Image to create disk from.
        :type     image: :class:`GCENodeImage` or ``str`` or ``None``

        :keyword  use_existing: If True and a disk with the given name already
                                exists, return an object for that disk instead
                                of attempting to create a new disk.
        :type     use_existing: ``bool``

        :keyword  ex_disk_type: Specify a pd-standard (default) disk or pd-ssd
                                for an SSD disk.
        :type     ex_disk_type: ``str`` or :class:`GCEDiskType`

        :keyword  ex_image_family: Determine image from an 'Image Family'
                                   instead of by name. 'image' should be None
                                   to use this keyword.
        :type     ex_image_family: ``str`` or ``None``

        :return:  Storage Volume object
        :rtype:   :class:`StorageVolume`
        rG  rq  rr  N)r¼   rb  Ú_create_vol_reqr{   ru  r   rd  )r@   r|  r_   rA  Úsnapshotr'  r  rU  rn  rQ   Úvolume_datarI   r  s                r*   Úcreate_volumezGCENodeDriver.create_volume·  sï   € ðb ð 	U�_ð 	UÝÐSÑTÔTÐTàð 	CØ×1Ò1°/ÑBÔBˆEà'+×';Ò';Ø�$˜ (¨E°<ñ(
ô (
Ñ$ˆ�˜fð	ØŒO×)Ò)¨'¸&À{Ð[aÐ)ÑbÔbÐbÐbøÝ"ð 	ð 	ð 	Øð Ø�ðð ð ð ð øøøøð	øøøð ×!Ò! $¨Ñ1Ô1Ð1s   Á
A) Á)
BÁ3A<Á<Bc                 óÊ   — i }||d<   d                      |j        d         j        |j        ¦  «        }| j                             |d|¬¦  «         |                      |¦  «        S )zê
        Create a snapshot of the provided Volume.

        :param  volume: A StorageVolume object
        :type   volume: :class:`StorageVolume`

        :return:  A GCE Snapshot object
        :rtype:   :class:`GCESnapshot`
        r_   z!/zones/{}/disks/{}/createSnapshotrc   rq  rƒ  )r<   rŒ   r_   r{   ru  Úex_get_snapshot)r@   r�  r_   Úsnapshot_datarQ   s        r*   Úcreate_volume_snapshotz$GCENodeDriver.create_volume_snapshotù  sm   € ð ˆØ $ˆ�fÑØ5×<Ò<ØŒL˜Ô Ô%ØŒKñ
ô 
ˆð 	Œ×%Ò% g°fÀ=Ð%ÑQÔQÐQà×#Ò# DÑ)Ô)Ð)r,   c                 ó¢   — g }|j         d         }|                      ¦   «         }|D ](}|j         d         |k    r|                     |¦  «         Œ)|S )a¡  
        List snapshots created from the provided volume.

        For GCE, snapshots are global, but while the volume they were
        created from still exists, the source disk for the snapshot is
        tracked.

        :param  volume: A StorageVolume object
        :type   volume: :class:`StorageVolume`

        :return:  A list of Snapshot objects
        :rtype:   ``list`` of :class:`GCESnapshot`
        r�   rö  )rŒ   rH  r`   )r@   r�  Úvolume_snapshotsÚvolume_linkÚall_snapshotsrõ  s         r*   Úlist_volume_snapshotsz#GCENodeDriver.list_volume_snapshots  sc   € ð ÐØ”l :Ô.ˆØ×.Ò.Ñ0Ô0ˆà%ð 	2ð 	2ˆHØŒ~˜lÔ+¨{Ò:Ð:Ø ×'Ò'¨Ñ1Ô1Ð1øàÐr,   c                 óð   — d|j         j        z  }i }|j        |d<   |j        |d<   |j        j        d         |d<   | j                             |d|¬¦  «         |                      |j        |j         ¦  «        S )a•  
        Update an autoscaler with new values.

        To update, change the attributes of the autoscaler object and pass
        the updated object to the method.

        :param  autoscaler: An Autoscaler object with updated values.
        :type   autoscaler: :class:`GCEAutoscaler`

        :return:  An Autoscaler object representing the new state.
        :rtype:   :class:`GCEAutoscaler``
        rŽ  r_   rµ  r�   r   ÚPUTrƒ  )rc   r_   r¡  r   rŒ   r{   ru  r¶  )r@   r£  rQ   Úas_datas       r*   Úex_update_autoscalerz"GCENodeDriver.ex_update_autoscaler%  s}   € ð *¨Z¬_Ô-AÑBˆØˆØ$œ/ˆ�‰Ø'1Ô'8ˆÐ#Ñ$Ø&Ô-Ô3°JÔ?ˆ�ÑàŒ×%Ò% g°eÀ'Ð%ÑJÔJÐJà×%Ò% j¤o°z´ÑGÔGÐGr,   c                 óˆ  — i }|j         |d<   |j        |d<   |j        |d<   |j        |d<   |j        |d<   |j        |d<   |j        |d<   |j        d         r|j        d         |d<   |j        d	         r|j        d	         |d	<   d
|j         z  }| j         	                    |d|¬¦  «         |  
                    |j         ¦  «        S )a¤  
        Update a health check with new values.

        To update, change the attributes of the health check object and pass
        the updated object to the method.

        :param  healthcheck: A healthcheck object with updated values.
        :type   healthcheck: :class:`GCEHealthCheck`

        :return:  An object representing the new state of the health check.
        :rtype:   :class:`GCEHealthCheck`
        r_   rÍ  r×   rÐ  r¿  rÒ  rÓ  rq   rÃ   ú/global/httpHealthChecks/%sr  rƒ  )r_   rö   r×   r÷   rÚ   rø   rù   rŒ   r{   ru  rÁ  )r@   rü   rÔ  rQ   s       r*   rÿ   z#GCENodeDriver.ex_update_healthcheck<  sê   € ð ˆØ%Ô*ˆ�‰Ø!,Ô!1ˆ�ÑØ%Ô*ˆ�‰Ø&1Ô&:ˆÐ"Ñ#Ø +Ô 3ˆ�ÑØ(3Ô(GˆÐ$Ñ%Ø&1Ô&CˆÐ"Ñ#àÔ˜VÔ$ð 	8Ø)Ô/°Ô7ˆG�F‰OàÔ˜]Ô+ð 	FØ%0Ô%6°}Ô%EˆG�MÑ"à/°;Ô3CÑDˆàŒ×%Ò% g°eÀ'Ð%ÑJÔJÐJà×&Ò& {Ô'7Ñ8Ô8Ð8r,   c                 óô  — i }|j         |d<   |j        |d<   |j        |d<   |j        j        d         |d<   |j        r
|j        |d<   |j        r
|j        |d<   |j        r
|j        |d<   |j        r
|j        |d	<   |j	        r
|j	        |d
<   |j
        r
|j
        |d<   |j        d         r|j        d         |d<   d|j         z  }| j                             |d|¬¦  «         |                      |j         ¦  «        S )a‰  
        Update a firewall with new values.

        To update, change the attributes of the firewall object and pass the
        updated object to the method.

        :param  firewall: A firewall object with updated values.
        :type   firewall: :class:`GCEFirewall`

        :return:  An object representing the new state of the firewall.
        :rtype:   :class:`GCEFirewall`
        r_   r  r  r�   r  rÚ  rÛ  rÜ  rÝ  rÞ  rß  rÃ   ú/global/firewalls/%sr  rƒ  )r_   r  r  r  rŒ   r
  r  r  r  r  r  r{   ru  rá  )r@   r  râ  rQ   s       r*   r  z GCENodeDriver.ex_update_firewall^  s:  € ð ˆØ (¤ˆ�fÑØ#+Ô#3ˆ�iÑ Ø"*¤/ˆ�hÑà#+Ô#3Ô#9¸*Ô#Eˆ�iÑ àÔ!ð 	CØ,4Ô,BˆM˜.Ñ)àÔð 	?Ø*2Ô*>ˆM˜,Ñ'àÔ+ð 	VØ5=Ô5UˆMÐ1Ñ2àÔð 	?Ø*2Ô*>ˆM˜,Ñ'àÔ+ð 	VØ5=Ô5UˆMÐ1Ñ2àÔ!ð 	HØ19Ô1GˆMÐ-Ñ.àŒ>˜-Ô(ð 	IØ+3¬>¸-Ô+HˆM˜-Ñ(à(¨H¬MÑ:ˆàŒ×%Ò% g°eÀ-Ð%ÑPÔPÐPà×#Ò# H¤MÑ2Ô2Ð2r,   c                 óp   — d|j         z  }dd„ |D ¦   «         i}| j                             |d|¬¦  «         dS )aN  
        Replaces SslCertificates for TargetHttpsProxy.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  targethttpsproxy:  Name of the TargetHttpsProxy resource to
                                   set an SslCertificates resource for.
        :type   targethttpsproxy: ``str``

        :param  sslcertificates:  sslcertificates to set.
        :type   sslcertificates: ``list`` of :class:`GCESslCertificates`

        :return:  True
        :rtype: ``bool``
        z)/targetHttpsProxies/%s/setSslCertificatesr×  c                 ó(   — g | ]}|j         d          ‘ŒS rÕ  r%  rÖ  s     r*   rŸ  zIGCENodeDriver.ex_targethttpsproxy_set_sslcertificates.<locals>.<listcomp>¡  s   € Ð+YÐ+YÐ+YÀA¨A¬G°JÔ,?Ð+YÐ+YÐ+Yr,   rq  rƒ  T©r_   r{   ru  )r@   rŒ  r‰  rQ   r  s        r*   r�  z5GCENodeDriver.ex_targethttpsproxy_set_sslcertificates�  sM   € ð& >ÐAQÔAVÑWˆØ)Ð+YÐ+YÈÐ+YÑ+YÔ+YÐZˆØŒ×%Ò% g°fÀ<Ð%ÑPÔPÐPàˆtr,   c                 ór   — d|j         z  }d|j        d         i}| j                             |d|¬¦  «         dS )a  
        Changes the URL map for TargetHttpsProxy.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  targethttpsproxy:  Name of the TargetHttpsProxy resource
                                   whose URL map is to be set.
        :type   targethttpsproxy: ``str``

        :param  urlmap:  urlmap to set.
        :type   urlmap: :class:`GCEUrlMap`

        :return:  True
        :rtype: ``bool``
        z /targetHttpsProxies/%s/setUrlMaprÏ  r�   rq  rƒ  T)r_   rŒ   r{   ru  )r@   rŒ  r�  rQ   r  s        r*   r�  z,GCENodeDriver.ex_targethttpsproxy_set_urlmap¦  sE   € ð& 5Ð8HÔ8MÑNˆØ  &¤,¨zÔ":Ð;ˆØŒ×%Ò% g°fÀ<Ð%ÑPÔPÐPàˆtr,   c                 ó>  — g }|j         j        }d                     ||j        ¦  «        }|�t          |d¦  «        r|j        }n|}nd}|j        }|D ]Ê}|ri||j        k    r]d|j        d         i}	| j                             |d|	¬¦  «        j        }
|
d         d	         d
         }| 	                    ||dœ¦  «         Œmd|j        d         i}	| j                             |d|	¬¦  «        j        }
|
d         d	         d
         }| 	                    ||dœ¦  «         ŒË|S )a7  
        Return a hash of target pool instances and their health.

        :param  targetpool: Targetpool containing healthchecked instances.
        :type   targetpool: :class:`GCETargetPool`

        :param  node: Optional node to specify if only a specific node's
                      health status should be returned
        :type   node: ``str``, ``Node``, or ``None``

        :return: List of hashes of instances and their respective health,
                 e.g. [{'node': ``Node``, 'health': 'UNHEALTHY'}, ...]
        :rtype:  ``list`` of ``dict``
        z$/regions/{}/targetPools/{}/getHealthNr_   r.  r�   rq  rƒ  ÚhealthStatusr   ÚhealthState)r˜  Úhealth)
r­   r_   r<   r²   rì  rŒ   r{   rQ   rS   r`   )r@   r  r˜  r  r6  rQ   ry  rì  Únode_objectr†  rk   ru  s               r*   r  z&GCENodeDriver.ex_targetpool_get_health¿  sX  € ð ˆØ Ô'Ô,ˆØ8×?Ò?ØØŒOñ
ô 
ˆð
 ÐÝ�t˜VÑ$Ô$ð !Ø œI�	�	à �	�	àˆIàÔ ˆà ð 	Gð 	GˆKØð 
GØ Ô 0Ò0Ð0Ø&¨Ô(9¸*Ô(EÐF�DØœ?×2Ò2°7À6ÐPTÐ2ÑUÔUÔ\�DØ! .Ô1°!Ô4°]ÔC�FØ—M’M¨;À&Ð"IÐ"IÑJÔJÐJøà" KÔ$5°jÔ$AÐB�Ø”×.Ò.¨w¸vÈDÐ.ÑQÔQÔX�Ø˜nÔ-¨aÔ0°Ô?�Ø—’ {¸fÐEÐEÑFÔFÐFÐFàˆr,   rý  c                 óº   — |j         j        }|j        }d|j        d         i}d|i}d                     ||¦  «        }| j                             |d||¬¦  «         dS )aŸ  
        Set a backup targetpool.

        :param  targetpool: The existing primary targetpool
        :type   targetpool: :class:`GCETargetPool`

        :param  backup_targetpool: The existing targetpool to use for
                                   failover traffic.
        :type   backup_targetpool: :class:`GCETargetPool`

        :param  failover_ratio: The percentage of healthy VMs must fall at or
                                below this value before traffic will be sent
                                to the backup targetpool (default 0.10)
        :type   failover_ratio: ``float``

        :return:  True if successful
        :rtype:   ``bool``
        r   r�   râ  z$/regions/{}/targetPools/{}/setBackuprq  rr  T)r­   r_   rŒ   r<   r{   ru  )	r@   r  rÿ  r   r­   r_   Úreq_datarI   rQ   s	            r*   r  z1GCENodeDriver.ex_targetpool_set_backup_targetpoolî  sm   € ð* Ô"Ô'ˆØŒˆØÐ/Ô5°jÔAÐBˆØ! >Ð2ˆà8×?Ò?ÀÈÑMÔMˆØŒ×%Ò% g°fÀ8ÐTZÐ%Ñ[Ô[Ð[àˆtr,   c                 ó
  ‡— t          |d¦  «        s|                      |¦  «        }t          |d¦  «        r|j        d         Šn;|                     d¦  «        r|Šn#|                      |d¦  «        }|j        d         Šdd‰igi}d                     |j        j        |j        ¦  «        }| j         	                    |d|¬	¦  «         t          ˆfd
„|j        D ¦   «         ¦  «        r|j                             |¦  «         dS )a<  
        Add a node to a target pool.

        :param  targetpool: The targetpool to add node to
        :type   targetpool: ``str`` or :class:`GCETargetPool`

        :param  node: The node to add
        :type   node: ``str`` or :class:`Node`

        :return: True if successful
        :rtype:  ``bool``
        r_   r�   r÷  rç  r!  r.  z&/regions/{}/targetPools/{}/addInstancerq  rƒ  c              3   óh   •K  — | ],}‰|k    o!t          |d ¦  «         p|j        d         ‰k    V — Œ-dS )rŒ   r�   N)r²   rŒ   )r\  r  Únode_uris     €r*   ú	<genexpr>z7GCENodeDriver.ex_targetpool_add_node.<locals>.<genexpr>/  s_   øè è € ð 
ð 
àð ˜Š]Ð\¥W¨Q°Ñ%8Ô%8Ð!8Ð![¸A¼GÀJÔ<OÐS[Ò<[ð
ð 
ð 
ð 
ð 
ð 
r,   T)r²   rí  rŒ   r«  rh  r<   r­   r_   r{   ru  rç  rì  r`   )r@   r  r˜  rì  rQ   r  s        @r*   rï  z$GCENodeDriver.ex_targetpool_add_node  s3  ø€ õ �z 6Ñ*Ô*ð 	<Ø×/Ò/°
Ñ;Ô;ˆJå�4˜Ñ Ô ð 	2Ø”z *Ô-ˆHˆHà�Š˜zÑ*Ô*ð 2Ø��à×'Ò'¨¨eÑ4Ô4�Øœ: jÔ1�à&¨*°hÐ)?Ð(@ÐAˆà:×AÒAØÔÔ"ØŒOñ
ô 
ˆð 	Œ×%Ò% g°fÀ?Ð%ÑSÔSÐSåð 
ð 
ð 
ð 
àÔ%ð
ñ 
ô 
ñ 
ô 
ð 	*ð Ô×#Ò# DÑ)Ô)Ð)àˆtr,   c                 óv  — t          |d¦  «        s|                      |¦  «        }t          |d¦  «        s|                      |¦  «        }dd|j        d         igi}d                     |j        j        |j        ¦  «        }| j                             |d|¬¦  «         |j	         
                    |¦  «         dS )	ak  
        Add a health check to a target pool.

        :param  targetpool: The targetpool to add health check to
        :type   targetpool: ``str`` or :class:`GCETargetPool`

        :param  healthcheck: The healthcheck to add
        :type   healthcheck: ``str`` or :class:`GCEHealthCheck`

        :return: True if successful
        :rtype:  ``bool``
        r_   r¼  ÚhealthCheckr�   z)/regions/{}/targetPools/{}/addHealthCheckrq  rƒ  T)r²   rí  rÁ  rŒ   r<   r­   r_   r{   ru  rÖ   r`   )r@   r  rü   rì  rQ   s        r*   r÷  z+GCENodeDriver.ex_targetpool_add_healthcheck7  sÆ   € õ �z 6Ñ*Ô*ð 	<Ø×/Ò/°
Ñ;Ô;ˆJå�{ FÑ+Ô+ð 	?Ø×1Ò1°+Ñ>Ô>ˆKà)¨]¸KÔ<MÈjÔ<YÐ,ZÐ+[Ð\ˆà=×DÒDØÔÔ"ØŒOñ
ô 
ˆð 	Œ×%Ò% g°fÀ?Ð%ÑSÔSÐSØÔ×&Ò& {Ñ3Ô3Ð3àˆtr,   c                 óZ  — t          |d¦  «        s|                      |¦  «        }t          |d¦  «        r|j        d         }n;|                     d¦  «        r|}n#|                      |d¦  «        }|j        d         }dd|igi}d                     |j        j        |j        ¦  «        }| j         	                    |d|¬	¦  «         d
}t          |j        ¦  «        D ]0\  }}||k    s!t          |d¦  «        r|j        d         |k    r|} nŒ1|�|j                             |¦  «         dS )aI  
        Remove a node from a target pool.

        :param  targetpool: The targetpool to remove node from
        :type   targetpool: ``str`` or :class:`GCETargetPool`

        :param  node: The node to remove
        :type   node: ``str`` or :class:`Node`

        :return: True if successful
        :rtype:  ``bool``
        r_   r�   r÷  rç  r!  r.  z)/regions/{}/targetPools/{}/removeInstancerq  rƒ  NrŒ   T)r²   rí  rŒ   r«  rh  r<   r­   r_   r{   ru  Ú	enumeraterì  Úpop)	r@   r  r˜  r  rì  rQ   Úindexr  Únds	            r*   ró  z'GCENodeDriver.ex_targetpool_remove_nodeV  sR  € õ �z 6Ñ*Ô*ð 	<Ø×/Ò/°
Ñ;Ô;ˆJå�4˜Ñ Ô ð 	2Ø”z *Ô-ˆHˆHà�Š˜zÑ*Ô*ð 2Ø��à×'Ò'¨¨eÑ4Ô4�Øœ: jÔ1�à&¨*°hÐ)?Ð(@ÐAˆà=×DÒDØÔÔ"ØŒOñ
ô 
ˆð 	Œ×%Ò% g°fÀ?Ð%ÑSÔSÐSàˆå˜zÔ/Ñ0Ô0ð 	ð 	‰EˆAˆrØ�XŠ~ˆ~¥'¨"¨gÑ"6Ô"6ˆ~¸2¼8ÀJÔ;OÐS[Ò;[Ð;[Ø�à�øàÐØÔ× Ò  Ñ'Ô'Ð'àˆtr,   c                 óÖ  — t          |d¦  «        s|                      |¦  «        }t          |d¦  «        s|                      |¦  «        }dd|j        d         igi}d                     |j        j        |j        ¦  «        }| j                             |d|¬¦  «         d}t          |j
        ¦  «        D ]\  }}|j        |j        k    r|}Œ|�|j
                             |¦  «         d	S )
ax  
        Remove a health check from a target pool.

        :param  targetpool: The targetpool to remove health check from
        :type   targetpool: ``str`` or :class:`GCETargetPool`

        :param  healthcheck: The healthcheck to remove
        :type   healthcheck: ``str`` or :class:`GCEHealthCheck`

        :return: True if successful
        :rtype:  ``bool``
        r_   r¼  r  r�   z,/regions/{}/targetPools/{}/removeHealthCheckrq  rƒ  NT)r²   rí  rÁ  rŒ   r<   r­   r_   r{   ru  r  rÖ   r  )r@   r  rü   rì  rQ   r  r  rÈ  s           r*   rû  z.GCENodeDriver.ex_targetpool_remove_healthcheck…  s  € õ �z 6Ñ*Ô*ð 	<Ø×/Ò/°
Ñ;Ô;ˆJå�{ FÑ+Ô+ð 	?Ø×1Ò1°+Ñ>Ô>ˆKà)¨]¸KÔ<MÈjÔ<YÐ,ZÐ+[Ð\ˆà@×GÒGØÔÔ"ØŒOñ
ô 
ˆð 	Œ×%Ò% g°fÀ?Ð%ÑSÔSÐSàˆå˜zÔ6Ñ7Ô7ð 	ð 	‰EˆAˆrØŒw˜+Ô*Ò*Ð*Ø�øàÐØÔ#×'Ò'¨Ñ.Ô.Ð.àˆtr,   c                 ó¦   — d                      |j        j        |j        ¦  «        }dd„ |D ¦   «         i}| j                             |d|¬¦  «         dS )r»  z(/zones/{}/instanceGroups/{}/addInstancesr!  c                 ó,   — g | ]}d |j         d         i‘ŒS ©r.  r�   r%  rÖ  s     r*   rŸ  z@GCENodeDriver.ex_instancegroup_add_instances.<locals>.<listcomp>Å  ó$   € Ð%[Ð%[Ð%[ÈA z°1´7¸:Ô3FÐ&GÐ%[Ð%[Ð%[r,   rq  rƒ  T©r<   rc   r_   r{   ru  ©r@   r¸  r½  rQ   r  s        r*   r¾  z,GCENodeDriver.ex_instancegroup_add_instances¬  sf   € ð* =×CÒCØÔÔ#ØÔñ
ô 
ˆð $Ð%[Ð%[ÐQZÐ%[Ñ%[Ô%[Ð\ˆØŒ×%Ò% g°fÀ<Ð%ÑPÔPÐPàˆtr,   c                 ó¦   — d                      |j        j        |j        ¦  «        }dd„ |D ¦   «         i}| j                             |d|¬¦  «         dS )a¹  
        Removes one or more instances from the specified instance group,
        but does not delete those instances.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  instancegroup:  The Instance Group where the
                                specified instances will be removed.
        :type   instancegroup: :class:``GCEInstanceGroup``

        :param  node_list: List of nodes to add.
        :type   node_list: ``list`` of :class:`Node` or ``list`` of
                           :class:`GCENode`

        :return:  True if successful.
        :rtype: ``bool``
        z+/zones/{}/instanceGroups/{}/removeInstancesr!  c                 ó,   — g | ]}d |j         d         i‘ŒS r"  r%  rÖ  s     r*   rŸ  zCGCENodeDriver.ex_instancegroup_remove_instances.<locals>.<listcomp>â  r#  r,   rq  rƒ  Tr$  r%  s        r*   rÅ  z/GCENodeDriver.ex_instancegroup_remove_instancesÊ  sg   € ð( @×FÒFØÔÔ#ØÔñ
ô 
ˆð $Ð%[Ð%[ÐQZÐ%[Ñ%[Ô%[Ð\ˆØŒ×%Ò% g°fÀ<Ð%ÑPÔPÐPàˆtr,   c                 óT  — d                      |j        j        |j        ¦  «        }| j                             |d¬¦  «        j        }g }d|v r[|d         D ]R}|                      |d         ¦  «        }|                     |                      |d         |d         ¦  «        ¦  «         ŒS|S )aw  
        Lists the instances in the specified instance group.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute
        * https://www.googleapis.com/auth/compute.readonly

        :param  instancegroup:  The Instance Group where from which you
                                want to generate a list of included
                                instances.
        :type   instancegroup: :class:`GCEInstanceGroup`

        :return:  List of :class:`GCENode` objects.
        :rtype: ``list`` of :class:`GCENode` objects.
        z)/zones/{}/instanceGroups/{}/listInstancesrq  r]   rO   r.  r_   rc   )	r<   rc   r_   r{   rQ   rS   Ú_get_components_from_pathr`   rh  )r@   r¸  rQ   rW   r  rm   Úinstance_infos          r*   rÂ  z-GCENodeDriver.ex_instancegroup_list_instancesç  s¼   € ð" >×DÒDØÔÔ#ØÔñ
ô 
ˆð ”?×*Ò*¨7¸6Ð*ÑBÔBÔIˆàˆ	à�hÐÐØ˜gÔ&ð að a�Ø $× >Ò >¸qÀ¼}Ñ MÔ M�Ø× Ò  ×!1Ò!1°-ÀÔ2GÈÐW]ÔI^Ñ!_Ô!_Ñ`Ô`Ð`Ð`àÐr,   c                 óò   — t          |t          ¦  «        st          d¦  «        ‚d                     |j        j        |j        ¦  «        }||j        d         dœ}| j                             |d|¬¦  «         dS )ah  
        Sets the named ports for the specified instance group.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  instancegroup:  The Instance Group where where the
                                named ports are updated.
        :type   instancegroup: :class:`GCEInstanceGroup`

        :param  named_ports:  Assigns a name to a port number. For example:
                              {name: "http", port: 80}  This allows the
                              system to reference ports by the assigned name
                              instead of a port number. Named ports can also
                              contain multiple ports. For example: [{name:
                              "http", port: 80},{name: "http", port: 8080}]
                              Named ports apply to all instances in this
                              instance group.
        :type   named_ports: ``list`` of {'name': ``str``, 'port`: ``int``}

        :return:  Return True if successful.
        :rtype: ``bool``
        z7'named_ports' must be a list of name/port dictionaries.z)/zones/{}/instanceGroups/{}/setNamedPortsr�  )r  r�  rq  rƒ  T)	r¸   ra  r¼   r<   rc   r_   rŒ   r{   ru  )r@   r¸  r´  rQ   r  s        r*   rÉ  z.GCENodeDriver.ex_instancegroup_set_named_ports	  sŠ   € õ4 ˜+¥tÑ,Ô,ð 	[ÝÐYÑZÔZÐZà=×DÒDØÔÔ#ØÔñ
ô 
ˆð
 &Ø(Ô.¨}Ô=ð
ð 
ˆð 	Œ×%Ò% g°fÀ<Ð%ÑPÔPÐPàˆtr,   c                 óŽ   — d                      |j        j        |j        ¦  «        }i }| j                             |d|¬¦  «         dS )aN  
        Deletes the specified instance group. The instances in the group
        are not deleted. Note that instance group must not belong to a backend
        service. Read  Deleting an instance group for more information.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  instancegroup:  The name of the instance group to delete.
        :type   instancegroup: :class:`GCEInstanceGroup`

        :return:  Return True if successful.
        :rtype: ``bool``
        ú/zones/{}/instanceGroups/{}ÚDELETErƒ  Tr$  )r@   r¸  rQ   r  s       r*   r¹  z&GCENodeDriver.ex_destroy_instancegroup2  sQ   € ð" 0×6Ò6ØÔÔ#ØÔñ
ô 
ˆð ˆØŒ×%Ò% g°hÀ\Ð%ÑRÔRÐRàˆtr,   c                 óD  — d                      |j        j        |j        ¦  «        }| j                             |d¬¦  «        j        }g }d|v rS|d         D ]J}|                      |d         ¦  «        d         |d<   |j        j        |d<   |                     |¦  «         ŒK|S )a¿  
        Lists all of the instances in the Managed Instance Group.

        Each instance in the list has a currentAction, which indicates
        the action that the managed instance group is performing on the
        instance. For example, if the group is still creating an instance,
        the currentAction is 'CREATING'.  Note that 'instanceStatus' might not
        be available, for example, if currentAction is 'CREATING' or
        'RECREATING'. If a previous action failed, the list displays the errors
        for that failed action.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute
        * https://www.googleapis.com/auth/compute.readonly

        'currentAction' values are one of:
           'ABANDONING', 'CREATING', 'DELETING', 'NONE',
           'RECREATING', 'REFRESHING', 'RESTARTING'

        :param  manager: Instance Group Manager to operate on.
        :type   manager: :class:`GCEInstanceGroupManager`

        :return: ``list`` of ``dict`` containing 'name', 'zone', 'lastAttempt',
                 'currentAction', 'instance' and 'instanceStatus'.
        :rtype: ``list``
        z7/zones/{}/instanceGroupManagers/{}/listManagedInstancesrq  r]   ÚmanagedInstancesr.  r_   rc   )r<   rc   r_   r{   rQ   rS   r)  r`   )r@   rÒ  rQ   rW   Úinstance_datar  s         r*   rÕ  z<GCENodeDriver.ex_instancegroupmanager_list_managed_instancesL  s¶   € ð8 L×RÒRØŒLÔØŒLñ
ô 
ˆð ”?×*Ò*¨7¸6Ð*ÑBÔBÔIˆàˆà Ð)Ð)ØÐ0Ô1ð (ð (�Ø ×:Ò:¸1¸Z¼=ÑIÔIÈ&ÔQ��&‘	Ø#œLÔ-��&‘	Ø×$Ò$ QÑ'Ô'Ð'Ð'àÐr,   c                 óª   — i }|j         |dœg|d<   d                     |j        j        |j        ¦  «        }| j                             |d|¬¦  «         dS )aã  
        Set the Autohealing Policies for this Instance Group.

        :param  healthcheck: Healthcheck to add
        :type   healthcheck: :class:`GCEHealthCheck`

        :param  initialdelaysec:  The time to allow an instance to boot and
                                  applications to fully start before the first
                                  health check
        :type   initialdelaysec:  ``int``

        :return:  True if successful
        :rtype:   ``bool``
        )r  ÚinitialDelaySecÚautoHealingPoliciesz#/zones/{}/instanceGroupManagers/{}/ÚPATCHrƒ  T)rö   r<   rc   r_   r{   ru  )r@   rÒ  rü   rå  r  rQ   s         r*   ræ  z=GCENodeDriver.ex_instancegroupmanager_set_autohealingpoliciesz  sl   € ð" ˆà'Ô,ÀÐQÐQð/
ˆÐ*Ñ+ð 8×>Ò>ØŒLÔØŒLñ
ô 
ˆð 	Œ×%Ò% g°gÀLÐ%ÑQÔQÐQàˆtr,   c                 óŽ   — d|j         d         i}d|j        j        ›d|j        ›d�}| j                             |d|¬¦  «         dS )	aÆ  
        Set the Instance Template for this Instance Group.  Existing VMs are
        not recreated by setting a new InstanceTemplate.

        :param  manager: Instance Group Manager to operate on.
        :type   manager: :class:`GCEInstanceGroupManager`

        :param  instancetemplate: Instance Template to set.
        :type   instancetemplate: :class:`GCEInstanceTemplate`

        :return:  True if successful
        :rtype:   ``bool``
        r  r�   z/zones/z/instanceGroupManagers/z/setInstanceTemplaterq  rƒ  T)rŒ   rc   r_   r{   ru  )r@   rÒ  r¯  r  rQ   s        r*   rØ  z:GCENodeDriver.ex_instancegroupmanager_set_instancetemplate˜  s]   € ð 'Ð(8Ô(>¸zÔ(JÐKˆˆð ŒLÔÐÐØŒLˆLˆLð
ˆð 	Œ×%Ò% g°fÀ8Ð%ÑLÔLÐLàˆtr,   c                 ó  — g }t          |t          ¦  «        s4t          |t          ¦  «        st          dt	          |¦  «        z  ¦  «        ‚t          |t          ¦  «        r|                      |¦  «        }|€"|                      |¦  «        }d„ |D ¦   «         }nŽt          |t          ¦  «        rj|D ]f}|                     d¦  «        r| 	                    |¦  «         Œ-| 	                    |  
                    ||j        ¦  «        j        d         ¦  «         Œgnt          d¦  «        ‚d                     |j        j        |j        ¦  «        }d|i}| j                             |d	|¬
¦  «        j         |                      |¦  «        S )aÝ  
        Schedules a group action to recreate the specified instances in the
        managed instance group. The instances are deleted and recreated using
        the current instance template for the managed instance group. This
        operation is marked as DONE when the action is scheduled even if the
        instances have not yet been recreated. You must separately verify
        the status of the recreating action with the listmanagedinstances
        method or querying the managed instance group directly.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  manager:  Required. The name of the managed instance group. The
                       name must be 1-63 characters long, and comply with
                       RFC1035.
        :type   manager: ``str`` or :class: `GCEInstanceGroupManager`

        :keyword  instances:  list of Node objects to be recreated. If equal
                              to None, all instances in the managed instance
                              group are recreated.
        :type   instances: ``list`` of :class: `Node`, ``list`` of instance
                            names (only), ``list`` of instance URIs, or None.

        :return:  Dictionary containing instance URI and currentAction.
                  See ex_instancegroupmanager_list_managed_instances for
                  more details.
        :rtype: ``dict``
        zWInstanceGroupManager must be of type str or GCEInstanceGroupManager. Type '%s' providedNc                 ó   — g | ]
}|d          ‘ŒS )r.  r2   rÖ  s     r*   rŸ  zLGCENodeDriver.ex_instancegroupmanager_recreate_instances.<locals>.<listcomp>Û  s   € Ð7Ð7Ð7¨q˜Q˜zœ]Ð7Ð7Ð7r,   r÷  r�   zRinstances must be 'None or a list of instance URIs, instance names, orNode objectsz4/zones/{}/instanceGroupManagers/{}/recreateInstancesr!  rq  rƒ  )r¸   r»   r�   r¼   rn  r  rÕ  ra  r«  r`   rh  rc   rŒ   r<   r_   r{   rQ   rS   )r@   rÒ  r!  Úinstance_urisÚilr  rQ   r  s           r*   rÛ  z8GCENodeDriver.ex_instancegroupmanager_recreate_instances°  s¯  € ð< ˆå˜'Õ#:Ñ;Ô;ð 	ÅJÈwÕX[ÑD\ÔD\ð 	Ýð>ÝAEÀgÁÄñPñô ð õ
 �g�sÑ#Ô#ð 	@Ø×6Ò6°wÑ?Ô?ˆGàÐØ×DÒDÀWÑMÔMˆBØ7Ð7°BÐ7Ñ7Ô7ˆMˆMÝ˜	¥4Ñ(Ô(ð 	Øð ^ð ^�Ø—<’< 
Ñ+Ô+ð ^Ø!×(Ò(¨Ñ+Ô+Ð+Ð+à!×(Ò(¨×)9Ò)9¸!¸W¼\Ñ)JÔ)JÔ)PÐQ[Ô)\Ñ]Ô]Ð]Ð]ð	^õ ðñô ð ð I×OÒOØŒLÔØŒLñ
ô 
ˆð $ ]Ð3ˆØŒ×Ò °¸\ÐÑJÔJÔQÐQà×BÒBÀ7ÑKÔKÐKr,   c                 ó°   — d                      |j        j        |j        ¦  «        }dd„ |D ¦   «         i}| j                             |d|¬¦  «        j         dS )a¬  
        Remove instances from GCEInstanceGroupManager and destroy
        the instance

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  manager:  Required. The name of the managed instance group. The
                       name must be 1-63 characters long, and comply with
                       RFC1035.
        :type   manager: ``str`` or :class: `GCEInstanceGroupManager`

        :param  node_list:  list of Node objects to delete.
        :type   node_list: ``list`` of :class:`Node`

        :return:  True if successful
        :rtype: ``bool``
        z2/zones/{}/instanceGroupManagers/{}/deleteInstancesr!  c                 ó(   — g | ]}|j         d          ‘ŒS rÕ  r%  rÖ  s     r*   rŸ  zJGCENodeDriver.ex_instancegroupmanager_delete_instances.<locals>.<listcomp>  s   € Ð%MÐ%MÐ%M¸a a¤g¨jÔ&9Ð%MÐ%MÐ%Mr,   rq  rƒ  T)r<   rc   r_   r{   rQ   rS   )r@   rÒ  r½  rQ   r  s        r*   rÞ  z6GCENodeDriver.ex_instancegroupmanager_delete_instancesò  sg   € ð* G×MÒMØŒLÔØŒLñ
ô 
ˆð $Ð%MÐ%MÀ9Ð%MÑ%MÔ%MÐNˆØŒ×Ò °¸\ÐÑJÔJÔQÐQàˆtr,   c                 ó’   — d|i}d                      |j        j        |j        ¦  «        }| j                             |d|¬¦  «         dS )aX  
        Set the Instance Template for this Instance Group.

        :param  manager: Instance Group Manager to operate on.
        :type   manager: :class:`GCEInstanceGroupManager`

        :param  size: New size of Managed Instance Group.
        :type   size: ``int``

        :return:  True if successful
        :rtype:   ``bool``
        r|  z)/zones/{}/instanceGroupManagers/{}/resizerq  r~  Tr$  )r@   rÒ  r|  Ú
req_paramsrQ   s        r*   rá  z,GCENodeDriver.ex_instancegroupmanager_resize  sS   € ð ˜d�^ˆ
à=×DÒDØŒLÔØŒLñ
ô 
ˆð 	Œ×%Ò% g°fÀZÐ%ÑPÔPÐPàˆtr,   c                 ó–   — d                      |j        d         j        |j        ¦  «        }| j                             |dd¬¦  «         dS )z¾
        Reboot a node.

        :param  node: Node to be rebooted
        :type   node: :class:`Node`

        :return:  True if successful, False if not
        :rtype:   ``bool``
        z/zones/{}/instances/{}/resetrc   rq  Úignoredrƒ  T©r<   rŒ   r_   r{   ru  )r@   r˜  rQ   s      r*   Úreboot_nodezGCENodeDriver.reboot_node'  sI   € ð 1×7Ò7¸¼
À6Ô8JÔ8OÐQUÔQZÑ[Ô[ˆØŒ×%Ò% g°fÀ9Ð%ÑMÔMÐMàˆtr,   c                 ód  — d                      |j        d         j        |j        ¦  «        }i }||d<   |j        d         |d<   | j                             |d|¬¦  «         |                      |j        |j        d         ¦  «        }|j        d         |j        d<   |j        d         |j        d<   d	S )
aY  
        Set the tags on a Node instance.

        Note that this updates the node object directly.

        :param  node: Node object
        :type   node: :class:`Node`

        :param  tags: List of tags to apply to the object
        :type   tags: ``list`` of ``str``

        :return:  True if successful
        :rtype:   ``bool``
        z/zones/{}/instances/{}/setTagsrc   rO   Útags_fingerprintr�  rq  rƒ  rR  T)r<   rŒ   r_   r{   ru  rh  )r@   r˜  rR  rQ   Ú	tags_dataÚnew_nodes         r*   Úex_set_node_tagszGCENodeDriver.ex_set_node_tags6  s¶   € ð 3×9Ò9ØŒJ�vÔÔ#ØŒIñ
ô 
ˆð
 ˆ	Ø!ˆ	�'ÑØ#'¤:Ð.@Ô#Aˆ	�-Ñ àŒ×%Ò% g°fÀ9Ð%ÑMÔMÐMØ×#Ò# D¤I¨t¬z¸&Ô/AÑBÔBˆØ%œ^¨FÔ3ˆŒ
�6ÑØ)1¬Ð8JÔ)KˆŒ
Ð%Ñ&àˆtr,   c                 ó¢  — t          |d¦  «        s|                      |d¦  «        }|�A|                     ¦   «         }ddg}||vr%t          dd                     |¦  «        z  ¦  «        ‚d                     |j        d	         j        |j        ¦  «        }i }|�||d
<   |�||d<   | j         	                    |d|¬¦  «         |                      |j        |j        d	         ¦  «        }|j        d         |j        d<   |j        d          
                    d
¦  «        }|j        d          
                    d¦  «        }	d}
|d|fvrd}
|d|	fvrd}
|
S )aÛ  Set the maintenance behavior for the node.

        See `Scheduling <https://developers.google.com/compute/
        docs/instances#onhostmaintenance>`_ documentation for more info.

        :param  node: Node object
        :type   node: :class:`Node`

        :keyword  on_host_maintenance: Defines whether node should be
                                       terminated or migrated when host machine
                                       goes down. Acceptable values are:
                                       'MIGRATE' or 'TERMINATE' (If not
                                       supplied, value will be reset to GCE
                                       default value for the instance type.)
        :type     on_host_maintenance: ``str``

        :keyword  automatic_restart: Defines whether the instance should be
                                     automatically restarted when it is
                                     terminated by Compute Engine. (If not
                                     supplied, value will be set to the GCE
                                     default value for the instance type.)
        :type     automatic_restart: ``bool``

        :return:  True if successful.
        :rtype:   ``bool``
        r_   rç  Nr¹  rº  z%on_host_maintenance must be one of %srÀ  z$/zones/{}/instances/{}/setSchedulingrc   r»  r¼  rq  rƒ  r‡  TF)r²   rh  rî  r¼   rÃ  r<   rŒ   r_   r{   ru  rT   )r@   r˜  rw  rx  Ú
ohm_valuesrQ   Úscheduling_datarF  ÚohmÚarÚsuccesss              r*   Úex_set_node_schedulingz$GCENodeDriver.ex_set_node_schedulingU  s  € õ8 �t˜VÑ$Ô$ð 	1Ø×#Ò# D¨%Ñ0Ô0ˆDàÐ*Ø"5×";Ò";Ñ"=Ô"=ÐØ# [Ð1ˆJà"¨*Ð4Ð4Ý Ð!HÈ3Ï8Ê8ÐT^ÑK_ÔK_Ñ!_Ñ`Ô`Ð`à8×?Ò?ØŒJ�vÔÔ#ØŒIñ
ô 
ˆð
 ˆàÐ*Ø3FˆOÐ/Ñ0àÐ(Ø2CˆOÐ.Ñ/àŒ×%Ò% g°fÀ?Ð%ÑSÔSÐSà×#Ò# D¤I¨t¬z¸&Ô/AÑBÔBˆØ#+¤>°,Ô#?ˆŒ
�<Ñ àŒj˜Ô&×*Ò*Ð+>Ñ?Ô?ˆØŒZ˜Ô%×)Ò)Ð*<Ñ=Ô=ˆàˆà t¨S kÐ1Ð1ØˆGà T¨2 JÐ.Ð.ØˆGàˆr,   c                 óš  — |€|€t          d¦  «        ‚|€|€t          d¦  «        ‚i }|r||d<   |	r|	|d<   |
r|
|d<   |r||d<   |r||d<   |r||d	<   |p|j        d
         |d<   |pd|d<   |r||d<   n
|j        |d<   ||d<   d                     |j        d         j        |j        ¦  «        }| j                             |d|¬¦  «         dS )a_  
        Attach a volume to a node.

        If volume is None, an ex_source URL must be provided.

        :param  node: The node to attach the volume to
        :type   node: :class:`Node` or ``None``

        :param  volume: The volume to attach.
        :type   volume: :class:`StorageVolume` or ``None``

        :keyword  device: The device name to attach the volume as. Defaults to
                          volume name.
        :type     device: ``str``

        :keyword  ex_mode: Either 'READ_WRITE' or 'READ_ONLY'
        :type     ex_mode: ``str``

        :keyword  ex_boot: If true, disk will be attached as a boot disk
        :type     ex_boot: ``bool``

        :keyword  ex_type: Specify either 'PERSISTENT' (default) or 'SCRATCH'.
        :type     ex_type: ``str``

        :keyword  ex_source: URL (full or partial) of disk source. Must be
                             present if not using an existing StorageVolume.
        :type     ex_source: ``str`` or ``None``

        :keyword  ex_auto_delete: If set, the disk will be auto-deleted
                                  if the parent node/instance is deleted.
        :type     ex_auto_delete: ``bool`` or ``None``

        :keyword  ex_initialize_params: Allow user to pass in full JSON
                                        struct of `initializeParams` as
                                        documented in GCE's API.
        :type     ex_initialize_params: ``dict`` or ``None``

        :keyword  ex_licenses: List of strings representing licenses
                               associated with the volume/disk.
        :type     ex_licenses: ``list`` of ``str``

        :keyword  ex_interface: User can specify either 'SCSI' (default) or
                                'NVME'.
        :type     ex_interface: ``str`` or ``None``

        :return:  True if successful
        :rtype:   ``bool``
        NzOMust supply either a StorageVolume or set `ex_source` URL for an existing disk.z8Must supply either a StorageVolume or set `device` name.rù  ÚinitialzeParamsrü  Ú	interfacern  rN  r�   rI  rH  rP  rO  z!/zones/{}/instances/{}/attachDiskrc   rq  rƒ  T)r¼   rŒ   r_   r<   r{   ru  )r@   r˜  r�  ÚdeviceÚex_modeÚex_bootÚex_typeÚ	ex_sourceÚex_auto_deleteÚex_initialize_paramsr  Úex_interfacerö  rQ   s                 r*   Úattach_volumezGCENodeDriver.attach_volumeš  sL  € ð~ ˆ>˜iÐ/ÝØdñô ð ð ˆ>˜f˜nÝÐZÑ[Ô[Ð[àˆàð 	.Ø$-ˆK˜Ñ!àð 	BØ-AˆKÐ)Ñ*àð 	2Ø&1ˆK˜
Ñ#àð 	4Ø'3ˆK˜Ñ$àð 	*Ø")ˆK˜Ñàð 	7Ø(6ˆK˜Ñ%à )Ð E¨V¬\¸*Ô-Eˆ�HÑØ%Ð5¨ˆ�FÑàð 	4Ø(.ˆK˜Ñ%Ð%à(.¬ˆK˜Ñ%à%ˆ�FÑà5×<Ò<ØŒJ�vÔÔ#ØŒIñ
ô 
ˆð 	Œ×%Ò% g°fÀ;Ð%ÑOÔOÐOàˆtr,   c                 ó¸   — d                      |j        d         j        |j        ¦  «        }dt          |¦  «        i}| j                             |d|¬¦  «         dS )a4  
        Resize a volume to the specified size.

        :param volume: Volume object to resize
        :type  volume: :class:`StorageVolume`

        :param size: The size in GB of the volume to resize to.
        :type size: ``int``

        :return:  True if successful
        :rtype:   ``bool``
        z/zones/{}/disks/{}/resizerc   ÚsizeGbrq  rƒ  T)r<   rŒ   r_   r#   r{   ru  )r@   r�  r|  rQ   r  s        r*   Úex_resize_volumezGCENodeDriver.ex_resize_volume  sY   € ð .×4Ò4°V´\À&Ô5IÔ5NÐPVÔP[Ñ\Ô\ˆØ ¥# d¡)¤)Ð,ˆàŒ×%Ò% g°fÀ<Ð%ÑPÔPÐPàˆtr,   c                 óª   — |sdS d                      |j        d         j        |j        |j        ¦  «        }| j                             |dd¬¦  «         dS )aA  
        Detach a volume from a node.

        :param  volume: Volume object to detach
        :type   volume: :class:`StorageVolume`

        :keyword  ex_node: Node object to detach volume from (required)
        :type     ex_node: :class:`Node`

        :return:  True if successful
        :rtype:   ``bool``
        Fz//zones/{}/instances/{}/detachDisk?deviceName={}rc   rq  r@  rƒ  TrA  )r@   r�  Úex_noderQ   s       r*   Údetach_volumezGCENodeDriver.detach_volume  sa   € ð ð 	Ø�5ØC×JÒJØŒM˜&Ô!Ô&ØŒLØŒKñ
ô 
ˆð 	Œ×%Ò% g°fÀ9Ð%ÑMÔMÐMàˆtr,   c                 óª   — d                      |j        d         j        |j        ¦  «        }|j        |dœ}| j                             |d|¬¦  «         dS )a×  
        Sets the auto-delete flag for a volume attached to a node.

        :param  volume: Volume object to auto-delete
        :type   volume: :class:`StorageVolume`

        :param   ex_node: Node object to auto-delete volume from
        :type    ex_node: :class:`Node`

        :keyword auto_delete: Flag to set for the auto-delete value
        :type    auto_delete: ``bool`` (default True)

        :return:  True if successful
        :rtype:   ``bool``
        z(/zones/{}/instances/{}/setDiskAutoDeleterc   )rP  rN  rq  r~  TrA  )r@   r�  r˜  rƒ  rQ   Údelete_paramss         r*   Úex_set_volume_auto_deletez'GCENodeDriver.ex_set_volume_auto_delete5  se   € ð  =×CÒCØŒJ�vÔÔ#ØŒIñ
ô 
ˆð
 !œ+Ø%ð
ð 
ˆð 	Œ×%Ò% g°fÀ]Ð%ÑSÔSÐSàˆtr,   c                 ó  — t          |d¦  «        s|                      |¦  «        }t          |j        d¦  «        r&d                     |j        j        |j        ¦  «        }n
d|j        z  }| j                             |d¬¦  «         dS )zØ
        Destroy a static address.

        :param  address: Address object to destroy
        :type   address: ``str`` or :class:`GCEAddress`

        :return:  True if successful
        :rtype:   ``bool``
        r_   ú/regions/{}/addresses/{}ú/global/addresses/%sr.  r]   T)r²   r°  r­   r<   r_   r{   ru  )r@   r¬   rQ   s      r*   r¯   z GCENodeDriver.ex_destroy_addressQ  s‡   € õ �w Ñ'Ô'ð 	3Ø×)Ò)¨'Ñ2Ô2ˆGå�7”> 6Ñ*Ô*ð 	>Ø0×7Ò7¸¼Ô8KÈWÌ\ÑZÔZˆGˆGà,°´Ñ=ˆGàŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 óR   — d|j         z  }| j                             |d¬¦  «         dS )zê
        Destroy a Backend Service.

        :param  backendservice: BackendService object to destroy
        :type   backendservice: :class:`GCEBackendService`

        :return:  True if successful
        :rtype:   ``bool``
        ú/global/backendServices/%sr.  r]   Tr  )r@   rÞ   rQ   s      r*   rß   z'GCENodeDriver.ex_destroy_backendserviceh  s1   € ð /°Ô1DÑDˆàŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 óœ   — t          |d¦  «        s|                      |¦  «        }d|j        z  }| j                             |d¬¦  «         dS )zÙ
        Delete a specific image resource.

        :param  image: Image object to delete
        :type   image: ``str`` or :class:`GCENodeImage`

        :return: True if successful
        :rtype:  ``bool``
        r_   z/global/images/%sr.  r]   T)r²   rÿ  r_   r{   ru  )r@   r'  rQ   s      r*   r(  zGCENodeDriver.ex_delete_imagex  sU   € õ �u˜fÑ%Ô%ð 	-Ø×%Ò% eÑ,Ô,ˆEà%¨¬Ñ4ˆØŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 ó  — t          |d¦  «        s|                      |¦  «        }t          |d¦  «        s|                      |¦  «        }|€d}g d¢}||vr%t          dd                     |¦  «        z  ¦  «        ‚|dk    ri }nZ||j        d         d	œ}d
|fd|fd|ffD ]>\  }	}
|
€Œ	 t          |
¦  «         n # t          $ r t          d|	z  ¦  «        ‚w xY w|
||	<   Œ?d|j        z  }| j         	                    |d|¬¦  «        j
         dS )aó  
        Deprecate a specific image resource.

        :param  image: Image object to deprecate
        :type   image: ``str`` or :class: `GCENodeImage`

        :param  replacement: Image object to use as a replacement
        :type   replacement: ``str`` or :class: `GCENodeImage`

        :param  state: State of the image
        :type   state: ``str``

        :param  deprecated: RFC3339 timestamp to mark DEPRECATED
        :type   deprecated: ``str`` or ``None``

        :param  obsolete: RFC3339 timestamp to mark OBSOLETE
        :type   obsolete: ``str`` or ``None``

        :param  deleted: RFC3339 timestamp to mark DELETED
        :type   deleted: ``str`` or ``None``

        :return: True if successful
        :rtype:  ``bool``
        r_   NÚ
DEPRECATED)ÚACTIVEÚDELETEDrk  ÚOBSOLETEzstate must be one of %srÀ  rl  r�   )r-  r,  r.  r/  r0  z%s must be an RFC3339 timestampz/global/images/%s/deprecaterq  rƒ  T)r²   rÿ  r¼   rÃ  rŒ   r+   r“   r_   r{   rQ   rS   )r@   r'  r,  r-  r.  r/  r0  Úpossible_statesr  Ú	attributer±  rQ   s               r*   r+  z GCENodeDriver.ex_deprecate_image‹  s  € õD �u˜fÑ%Ô%ð 	-Ø×%Ò% eÑ,Ô,ˆEå�{ FÑ+Ô+ð 	9Ø×+Ò+¨KÑ8Ô8ˆKàˆ=Ø ˆEàIÐIÐIˆà˜Ð'Ð'ÝÐ6¸¿ºÀ/Ñ9RÔ9RÑRÑSÔSÐSà�HÒÐØˆJˆJð Ø*Ô0°Ô<ðð ˆJð ˜zÐ*Ø˜XÐ&Ø˜GÐ$ð%ð .ð .Ñ �	˜5ð
 �=ØðTÝ)¨%Ñ0Ô0Ð0Ð0øÝ ð Tð Tð TÝ$Ð%FÈÑ%RÑSÔSÐSðTøøøà(-�
˜9Ñ%Ð%à/°5´:Ñ>ˆàŒ×Ò °¸ZÐÑHÔHÔOÐOàˆts   Â)B9Â9Cc                 óR   — d|j         z  }| j                             |d¬¦  «         dS )zÛ
        Destroy a healthcheck.

        :param  healthcheck: Health check object to destroy
        :type   healthcheck: :class:`GCEHealthCheck`

        :return:  True if successful
        :rtype:   ``bool``
        r  r.  r]   Tr  )r@   rü   rQ   s      r*   rý   z$GCENodeDriver.ex_destroy_healthcheck×  s1   € ð 0°;Ô3CÑDˆØŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 óR   — d|j         z  }| j                             |d¬¦  «         dS )zË
        Destroy a firewall.

        :param  firewall: Firewall object to destroy
        :type   firewall: :class:`GCEFirewall`

        :return:  True if successful
        :rtype:   ``bool``
        r  r.  r]   Tr  )r@   r  rQ   s      r*   r  z!GCENodeDriver.ex_destroy_firewallæ  ó0   € ð )¨H¬MÑ:ˆØŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 ó¬   — |j         r&d                     |j         j        |j        ¦  «        }n
d|j        z  }| j                             |d¬¦  «         dS )zí
        Destroy a forwarding rule.

        :param  forwarding_rule: Forwarding Rule object to destroy
        :type   forwarding_rule: :class:`GCEForwardingRule`

        :return:  True if successful
        :rtype:   ``bool``
        ú/regions/{}/forwardingRules/{}ú/global/forwardingRules/%sr.  r]   T)r­   r<   r_   r{   ru  )r@   r  rQ   s      r*   r  z(GCENodeDriver.ex_destroy_forwarding_ruleõ  se   € ð Ô!ð 	JØ6×=Ò=ØÔ&Ô+ØÔ$ñô ˆGˆGð
 3°_Ô5IÑIˆGØŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 óR   — d|j         z  }| j                             |d¬¦  «         dS )z¼
        Destroy a route.

        :param  route: Route object to destroy
        :type   route: :class:`GCERoute`

        :return:  True if successful
        :rtype:   ``bool``
        ú/global/routes/%sr.  r]   Tr  )r@   rT  rQ   s      r*   rU  zGCENodeDriver.ex_destroy_route  s0   € ð &¨¬Ñ4ˆØŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 óR   — d|j         z  }| j                             |d¬¦  «         dS )zÆ
        Destroy a network.

        :param  network: Network object to destroy
        :type   network: :class:`GCENetwork`

        :return:  True if successful
        :rtype:   ``bool``
        ú/global/networks/%sr.  r]   Tr  )r@   r  rQ   s      r*   rK  z GCENodeDriver.ex_destroy_network  s0   € ð (¨7¬<Ñ8ˆØŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   ún1-standard-1c                 ó  — d|j         d         j        z  x}}|                     d¦  «        d         }d                     ||¦  «        }d                     ||j        ¦  «        }d|i}| j                             |d|¬	¦  «         d
S )ai  
        Set the machine type of the stopped instance. Can be the short-name,
        a full, or partial URL.

        :param  node: Target node object to change
        :type   node: :class:`Node`

        :param  machine_type: Desired machine type
        :type   machine_type: ``str``

        :return:  True if successful
        :rtype:   ``bool``
        ú	/zones/%src   rÌ  r.  z{}/machineTypes/{}z{}/instances/{}/setMachineTyper¬  rq  rƒ  T)rŒ   r_   r  r<   r{   ru  )r@   r˜  Úmachine_typerQ   Úmt_urlÚmtr†  s          r*   Úex_set_machine_typez!GCENodeDriver.ex_set_machine_type)  s�   € ð '¨¬°FÔ);Ô)@Ñ@Ð@ˆ�&à×Ò Ñ$Ô$ RÔ(ˆØ%×,Ò,¨V°RÑ8Ô8ˆà2×9Ò9¸'À4Ä9ÑMÔMˆØ˜vÐ&ˆØŒ×%Ò% g°fÀ4Ð%ÑHÔHÐHàˆtr,   c                 óÒ   — d                      |j        d         j        |j        ¦  «        }|r| j                             |d¬¦  «         n| j                             |d¬¦  «         dS )aD  
        Start a node that is stopped and in TERMINATED state.

        :param  node: Node object to start
        :type   node: :class:`Node`

        :keyword  sync: If true, do not return until destroyed or timeout
        :type     sync: ``bool``

        :return:  True if successful
        :rtype:   ``bool``
        z/zones/{}/instances/{}/startrc   rq  r]   T©r<   rŒ   r_   r{   ru  rQ   ©r@   r˜  Úex_syncrQ   s       r*   Ú
start_nodezGCENodeDriver.start_nodeB  sm   € ð 1×7Ò7¸¼
À6Ô8JÔ8OÐQUÔQZÑ[Ô[ˆàð 	<ØŒO×)Ò)¨'¸&Ð)ÑAÔAÐAÐAàŒO×#Ò# G°FÐ#Ñ;Ô;Ð;àˆtr,   c                 óÒ   — d                      |j        d         j        |j        ¦  «        }|r| j                             |d¬¦  «         n| j                             |d¬¦  «         dS )a"  
        Stop a running node.

        :param  node: Node object to stop
        :type   node: :class:`Node`

        :keyword  sync: If true, do not return until destroyed or timeout
        :type     sync: ``bool``

        :return:  True if successful
        :rtype:   ``bool``
        z/zones/{}/instances/{}/stoprc   rq  r]   Trƒ  r„  s       r*   Ú	stop_nodezGCENodeDriver.stop_nodeX  sm   € ð 0×6Ò6°t´zÀ&Ô7IÔ7NÐPTÔPYÑZÔZˆàð 	<ØŒO×)Ò)¨'¸&Ð)ÑAÔAÐAÐAàŒO×#Ò# G°FÐ#Ñ;Ô;Ð;àˆtr,   c                 ó0   — |                       ||¬¦  «        S ©N)r˜  r…  )r†  ©r@   r˜  Úsyncs      r*   Úex_start_nodezGCENodeDriver.ex_start_noden  s   € ð
 �Š D°$ˆÑ7Ô7Ð7r,   c                 ó0   — |                       ||¬¦  «        S rŠ  )rˆ  r‹  s      r*   Úex_stop_nodezGCENodeDriver.ex_stop_nodeu  s   € ð
 �~Š~ 4°ˆ~Ñ6Ô6Ð6r,   c                 óˆ   — d                      |j        j        |j        ¦  «        }| j                             |d¬¦  «         dS )a.  
        Destroy a managed instance group.  This will destroy all instances
        that belong to the instance group.

        :param  manager: InstanceGroup object to destroy.
        :type   manager: :class:`GCEInstanceGroup`

        :return:  True if successful
        :rtype:   ``bool``
        ú"/zones/{}/instanceGroupManagers/{}r.  r]   Tr$  )r@   rÒ  rQ   s      r*   rÓ  z-GCENodeDriver.ex_destroy_instancegroupmanager|  sH   € ð 7×=Ò=ØŒLÔØŒLñ
ô 
ˆð
 	Œ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 óX   — d|j         z  }i }| j                             |d|¬¦  «         dS )añ  
        Deletes the specified instance template. If you delete an instance
        template that is being referenced from another instance group, the
        instance group will not be able to create or recreate virtual machine
        instances. Deleting an instance template is permanent and cannot be
        undone.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  instancetemplate:  The name of the instance template to
                                   delete.
        :type   instancetemplate: ``str``

        :return  instanceTemplate:  Return True if successful.
        :rtype   instanceTemplate: ````bool````
        ú/global/instanceTemplates/%sr.  rƒ  Tr  )r@   r¯  rQ   r  s       r*   r°  z)GCENodeDriver.ex_destroy_instancetemplate�  s9   € ð( 1Ð4DÔ4IÑJˆØˆØŒ×%Ò% g°hÀ\Ð%ÑRÔRÐRàˆtr,   c                 óˆ   — d                      |j        j        |j        ¦  «        }| j                             |d¬¦  «         dS )z×
        Destroy an Autoscaler.

        :param  autoscaler: Autoscaler object to destroy.
        :type   autoscaler: :class:`GCEAutoscaler`

        :return:  True if successful
        :rtype:   ``bool``
        ú/zones/{}/autoscalers/{}r.  r]   Tr$  )r@   r£  rQ   s      r*   r¤  z#GCENodeDriver.ex_destroy_autoscalerª  s@   € ð -×3Ò3°J´OÔ4HÈ*Ì/ÑZÔZˆàŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 ó.  — d                      |j        d         j        |j        ¦  «        }|r| j                             |d¬¦  «         n| j                             |d¬¦  «         |r,|j        d         r|j        d                              ¦   «          dS )ac  
        Destroy a node.

        :param  node: Node object to destroy
        :type   node: :class:`Node`

        :keyword  destroy_boot_disk: If true, also destroy the node's
                                     boot disk. (Note that this keyword is not
                                     accessible from the node's .destroy()
                                     method.)
        :type     destroy_boot_disk: ``bool``

        :keyword  ex_sync: If true, do not return until destroyed or timeout
        :type     ex_sync: ``bool``

        :return:  True if successful
        :rtype:   ``bool``
        ú/zones/{}/instances/{}rc   r.  r]   rR  T)r<   rŒ   r_   r{   ru  rQ   r—   )r@   r˜  Údestroy_boot_diskr…  rQ   s        r*   Údestroy_nodezGCENodeDriver.destroy_nodeº  sš   € ð& +×1Ò1°$´*¸VÔ2DÔ2IÈ4Ì9ÑUÔUˆàð 	>ØŒO×)Ò)¨'¸(Ð)ÑCÔCÐCÐCàŒO×#Ò# G°HÐ#Ñ=Ô=Ð=àð 	. ¤¨KÔ!8ð 	.ØŒJ�{Ô#×+Ò+Ñ-Ô-Ð-àˆtr,   c                 óÞ  — g }d}t          j         ¦   «         }|D ]–}	d                     |	j        d         j        |	j        ¦  «        }
	 | j                             |
d¬¦  «        j        }n(# t          $ r |                      |¬¦  «         d}Y nw xY w|	d|| ddœ}| 	                    |¦  «         Œ—|�s�t          j         ¦   «         |z
  |k    rt          d	¦  «        ‚d
}|D �][}|d         p|d         }d}|r€d
}	 | j                             |d         ¦  «        j        }n,# t          $ r |                      |¬¦  «         d}ddi}Y nw xY w|d         dk    r|d         rd|d<   ||d<   d
}n
d|d<   ||d<   |rš|r˜|d         j        d         }|r~d                     |j        d         j        |j        ¦  «        }
	 | j                             |
d¬¦  «        j        }n*# t          $ r |                      |¬¦  «         d}d}Y nw xY w||d<   nd
|d<   |d         p|d         }|rt          j        |¦  «         d}�Œ]|�¯�g }|D ]'}|d         o|d         }| 	                    |¦  «         Œ(|S )a³  
        Destroy multiple nodes at once.

        :param  node_list: List of nodes to destroy
        :type   node_list: ``list`` of :class:`Node`

        :keyword  ignore_errors: If true, don't raise an exception if one or
                                 more nodes fails to be destroyed.
        :type     ignore_errors: ``bool``

        :keyword  destroy_boot_disk: If true, also destroy the nodes' boot
                                     disks.
        :type     destroy_boot_disk: ``bool``

        :keyword  poll_interval: Number of seconds between status checks.
        :type     poll_interval: ``int``

        :keyword  timeout: Number of seconds to wait for all nodes to be
                           destroyed.
        :type     timeout: ``int``

        :return:  A list of boolean values.  One for each node.  True means
                  that the node was successfully destroyed.
        :rtype:   ``list`` of ``bool``
        Fr—  rc   r.  r]   ©r¿  N)r˜  Únode_successrÀ  Údisk_successÚdisk_responsez;Timeout (%s sec) while waiting to delete multiple instancesTrÀ  rž  r�   ru  ÚDONErœ  r�  r˜  rR  ú/zones/{}/disks/{})rÂ  r<   rŒ   r_   r{   rQ   rS   r   Ú_catch_errorr`   r“   rÃ  )r@   r½  r¿  r˜  rÈ  rÚ   rÊ  rÌ  rË  r˜  rQ   rW   ru  Ú	operationÚdelete_diskÚ	no_errorsrR  rM  r=  s                      r*   Úex_destroy_multiple_nodesz'GCENodeDriver.ex_destroy_multiple_nodesÙ  sS  € ðB ˆØˆÝ”Y‘[”[ˆ
àð 	'ð 	'ˆDØ.×5Ò5°d´jÀÔ6HÔ6MÈtÌyÑYÔYˆGð Øœ?×2Ò2°7À8Ð2ÑLÔLÔS��øÝ"ð  ð  ð  Ø×!Ò!°Ð!Ñ>Ô>Ð>Ø���ð øøøð
 Ø %Ø!)Ø$5Ð 5Ø!%ðð ˆFð ×Ò˜vÑ&Ô&Ð&Ð&àñ 6	%ÝŒy‰{Œ{˜ZÑ'¨7Ò2Ð2ÝÐ `ÑaÔaÐaØˆHà%ð 1%ñ 1%�à" ?Ô3ÐN°v¸oÔ7N�	Ø#�àð ?Ø $�Ið6Ø#'¤?×#:Ò#:¸9ÀZÔ;PÑ#QÔ#QÔ#X˜˜øÝ*ð 6ð 6ð 6Ø×)Ò)¸Ð)ÑFÔFÐFØ$)˜	Ø$,¨fÐ#5˜˜˜ð6øøøð
   Ô)¨VÒ3Ð3ð " /Ô2ð ?Ø6:˜F ?Ñ3Ø5>˜F >Ñ2Ø*.˜K˜Kà6:˜F ?Ñ3Ø5>˜F >Ñ2ð ð 6Ð#4ð 6Ø & v¤Ô 4°[Ô A�Ià ð 6Ø"6×"=Ò"=Ø%œO¨FÔ3Ô8Ø%œNñ#ô #˜ð,Ø'+¤×'>Ò'>¸wÈxÐ'>Ñ'XÔ'XÔ'_˜H˜HøÝ.ð ,ð ,ð ,Ø ×-Ò-¸MÐ-ÑJÔJÐJØ(-˜IØ'+˜H˜H˜Hð,øøøð 3;˜˜Ñ/Ð/à15˜˜~Ñ.Ø" ?Ô3ÐN°v¸oÔ7N�	àð %Ý”J˜}Ñ-Ô-Ð-Ø$�Hùðm ñ 6	%ðp ˆà!ð 	ð 	ˆFØ�~Ô&ÐA¨6°.Ô+AˆAØ�NŠN˜1ÑÔÐÐàˆs6   Á!A*Á*"BÂBÃ;%D!Ä!&E
Å	E
Æ=!GÇ$HÈHc                 óR   — d|j         z  }| j                             |d¬¦  «         dS )zð
        Destroy a target HTTP proxy.

        :param  targethttpproxy: TargetHttpProxy object to destroy
        :type   targethttpproxy: :class:`GCETargetHttpProxy`

        :return:  True if successful
        :rtype:   ``bool``
        ú/global/targetHttpProxies/%sr.  r]   Tr  )r@   r„  rQ   s      r*   r…  z(GCENodeDriver.ex_destroy_targethttpproxyP  s1   € ð 1°?Ô3GÑGˆØŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 óX   — d|j         z  }i }| j                             |d|¬¦  «         dS )aî  
        Deletes the specified TargetHttpsProxy resource.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  targethttpsproxy:  Name of the TargetHttpsProxy resource to
                                   delete.
        :type   targethttpsproxy: ``str``

        :return  targetHttpsProxy:  Return True if successful.
        :rtype   targetHttpsProxy: ````bool````
        ú/global/targetHttpsProxies/%sr.  rƒ  Tr  )r@   rŒ  rQ   r  s       r*   r“  z)GCENodeDriver.ex_destroy_targethttpsproxy_  s9   € ð  2Ð5EÔ5JÑKˆØˆØŒ×%Ò% g°hÀ\Ð%ÑRÔRÐRàˆtr,   c                 óˆ   — d                      |j        j        |j        ¦  «        }| j                             |d¬¦  «         dS )zê
        Destroy a target instance.

        :param  targetinstance: TargetInstance object to destroy
        :type   targetinstance: :class:`GCETargetInstance`

        :return:  True if successful
        :rtype:   ``bool``
        ú/zones/{}/targetInstances/{}r.  r]   Tr$  )r@   rš  rQ   s      r*   r›  z'GCENodeDriver.ex_destroy_targetinstanceu  sJ   € ð 1×7Ò7ØÔÔ$ØÔñ
ô 
ˆð 	Œ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 óˆ   — d                      |j        j        |j        ¦  «        }| j                             |d¬¦  «         dS )zÖ
        Destroy a target pool.

        :param  targetpool: TargetPool object to destroy
        :type   targetpool: :class:`GCETargetPool`

        :return:  True if successful
        :rtype:   ``bool``
        ú/regions/{}/targetPools/{}r.  r]   T)r<   r­   r_   r{   ru  )r@   r  rQ   s      r*   r  z#GCENodeDriver.ex_destroy_targetpool‡  sI   € ð /×5Ò5ØÔÔ"ØŒOñ
ô 
ˆð
 	Œ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 óR   — d|j         z  }| j                             |d¬¦  «         dS )zÂ
        Destroy a URL map.

        :param  urlmap: UrlMap object to destroy
        :type   urlmap: :class:`GCEUrlMap`

        :return:  True if successful
        :rtype:   ``bool``
        ú/global/urlMaps/%sr.  r]   Tr  )r@   r�  rQ   s      r*   r  zGCENodeDriver.ex_destroy_urlmapš  s0   € ð '¨¬Ñ4ˆàŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 ó”   — d                      |j        d         j        |j        ¦  «        }| j                             |d¬¦  «         dS )zÅ
        Destroy a volume.

        :param  volume: Volume object to destroy
        :type   volume: :class:`StorageVolume`

        :return:  True if successful
        :rtype:   ``bool``
        r   rc   r.  r]   TrA  )r@   r�  rQ   s      r*   Údestroy_volumezGCENodeDriver.destroy_volumeª  sE   € ð '×-Ò-¨f¬l¸6Ô.BÔ.GÈÌÑUÔUˆØŒ×%Ò% g°hÐ%Ñ?Ô?Ð?àˆtr,   c                 óR   — d|j         z  }| j                             |d¬¦  «         dS )zË
        Destroy a snapshot.

        :param  snapshot: Snapshot object to destroy
        :type   snapshot: :class:`GCESnapshot`

        :return:  True if successful
        :rtype:   ``bool``
        ú/global/snapshots/%sr.  r]   Tr  )r@   rõ  rQ   s      r*   Údestroy_volume_snapshotz%GCENodeDriver.destroy_volume_snapshot¹  rs  r,   c                 ó:   — t                                ||| ¦  «        S )a^  
        Return a License object for specified project and name.

        :param  project: The project to reference when looking up the license.
        :type   project: ``str``

        :param  name: The name of the License
        :type   name: ``str``

        :return:  A License object for the name
        :rtype:   :class:`GCELicense`
        )rˆ   Úlazy)r@   rC   r_   s      r*   Úex_get_licensezGCENodeDriver.ex_get_licenseÈ  s   € õ �Š˜t W¨dÑ3Ô3Ð3r,   c                 ó–  — |                       |¦  «        }|rd                     |j        |¦  «        }nd}| j                             |d¬¦  «        }d|j        v r@d}|j        d                              ¦   «         D ]}|d         D ]}|d         |k    r|} nŒŒn|j        }|st          d	|z  ¦  «        ‚|                      |¦  «        S )
a®  
        Return a DiskType object based on a name and optional zone.

        :param  name: The name of the DiskType
        :type   name: ``str``

        :keyword  zone: The zone to search for the DiskType in (set to
                          'all' to search all zones)
        :type     zone: ``str`` :class:`GCEZone` or ``None``

        :return:  A DiskType object for the name
        :rtype:   :class:`GCEDiskType`
        z/zones/{}/diskTypes/{}r™  r\   r]   rO   Nr   r_   z"Disk type with name "%s" not found)	r£  r<   r_   r{   rQ   rS   rb  r¼   rœ  )r@   r_   rc   r>   rW   rs  Ú	zone_itemr%  s           r*   rc  zGCENodeDriver.ex_get_disktypeØ  sû   € ð �~Š~˜dÑ#Ô#ˆàð 	3Ø3×:Ò:¸4¼9ÀdÑKÔKˆLˆLà2ˆLà”?×*Ò*¨<ÀÐ*ÑFÔFˆà�h”oÐ%Ð%àˆDà%œ_¨WÔ5×<Ò<Ñ>Ô>ð ð �	Ø% kÔ2ð ð �DØ˜F”| tÒ+Ð+Ø#˜à˜ð ,øðð ”?ˆDàð 	LÝÐAÀTÑJÑKÔKÐKà× Ò  Ñ&Ô&Ð&r,   c                 óÎ   — |                       |¦  «        }d                     |j        |¦  «        }| j                             |d¬¦  «        j        }|                      |¦  «        S )av  
        Return an AcceleratorType object based on a name and zone.

        :param  name: The name of the AcceleratorType
        :type   name: ``str``

        :param  zone: The zone to search for the AcceleratorType in.
        :type   zone: :class:`GCEZone`

        :return:  An AcceleratorType object for the name
        :rtype:   :class:`GCEAcceleratorType`
        z/zones/{}/acceleratorTypes/{}r\   r]   )r£  r<   r_   r{   rQ   rS   Ú_to_accelerator_type©r@   r_   rc   rQ   rW   s        r*   re  z%GCENodeDriver.ex_get_accelerator_type  s]   € ð �~Š~˜dÑ#Ô#ˆØ1×8Ò8¸¼ÀDÑIÔIˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×(Ò(¨Ñ2Ô2Ð2r,   c                 ó  — |dk    rd|z  }nI|                       |¦  «        p|                      |ddd¬¦  «        }d                     |j        |¦  «        }| j                             |d¬	¦  «        j        }|                      |¦  «        S )
aÃ  
        Return an Address object based on an address name and optional region.

        :param  name: The name of the address
        :type   name: ``str``

        :keyword  region: The region to search for the address in (set to
                          'all' to search all regions)
        :type     region: ``str`` :class:`GCERegion` or ``None``

        :return:  An Address object for the address
        :rtype:   :class:`GCEAddress`
        r»  rf  rÁ  TÚAddress©r­   Úres_namere  r\   r]   )rÄ  Ú_find_zone_or_regionr<   r_   r{   rQ   rS   rÀ  ©r@   r_   r­   rQ   rW   s        r*   r°  zGCENodeDriver.ex_get_address  sž   € ð �XÒÐØ,°Ñ5ˆGˆGà×%Ò% fÑ-Ô-ð °×1JÒ1JØ�k¨$¸ð 2Kñ 2ô 2ˆFð 1×7Ò7¸¼ÀTÑJÔJˆGØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×Ò Ñ)Ô)Ð)r,   c                 óx   — d|z  }| j                              |d¬¦  «        j        }|                      |¦  «        S )a  
        Return a Backend Service object based on name

        :param  name: The name of the backend service
        :type   name: ``str``

        :return:  A BackendService object for the backend service
        :rtype:   :class:`GCEBackendService`
        rh  r\   r]   )r{   rQ   rS   rË  ©r@   r_   rQ   rW   s       r*   rÄ  z#GCENodeDriver.ex_get_backendservice.  s?   € ð /°Ñ5ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×&Ò& xÑ0Ô0Ð0r,   c                 óx   — d|z  }| j                              |d¬¦  «        j        }|                      |¦  «        S )zò
        Return a HealthCheck object based on the healthcheck name.

        :param  name: The name of the healthcheck
        :type   name: ``str``

        :return:  A GCEHealthCheck object
        :rtype:   :class:`GCEHealthCheck`
        r  r\   r]   )r{   rQ   rS   rÓ  rÄ  s       r*   rÁ  z GCENodeDriver.ex_get_healthcheck=  s?   € ð 0°4Ñ8ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×#Ò# HÑ-Ô-Ð-r,   c                 óx   — d|z  }| j                              |d¬¦  «        j        }|                      |¦  «        S )zã
        Return a Firewall object based on the firewall name.

        :param  name: The name of the firewall
        :type   name: ``str``

        :return:  A GCEFirewall object
        :rtype:   :class:`GCEFirewall`
        r  r\   r]   )r{   rQ   rS   rÛ  rÄ  s       r*   rá  zGCENodeDriver.ex_get_firewallL  ó?   € ð )¨DÑ1ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà× Ò  Ñ*Ô*Ð*r,   c                 ó  — |rd|z  }nI|                       |¦  «        p|                      |ddd¬¦  «        }d                     |j        |¦  «        }| j                             |d¬¦  «        j        }|                      |¦  «        S )	ag  
        Return a Forwarding Rule object based on the forwarding rule name.

        :param  name: The name of the forwarding rule
        :type   name: ``str``

        :keyword  region: The region to search for the rule in (set to 'all'
                          to search all regions).
        :type     region: ``str`` or ``None``

        :keyword  global_rule: Set to True to get a global forwarding rule.
                                Region will be ignored if True.
        :type     global_rule: ``bool``

        :return:  A GCEForwardingRule object
        :rtype:   :class:`GCEForwardingRule`
        rv  rè  TÚForwardingRuler¿  ru  r\   r]   )rÄ  rÁ  r<   r_   r{   rQ   rS   rç  )r@   r_   r­   rë  rQ   rW   s         r*   rï  z$GCENodeDriver.ex_get_forwarding_rule[  sž   € ð& ð 	QØ2°TÑ9ˆGˆGà×%Ò% fÑ-Ô-ð °×1JÒ1JØÐ'°Ð?Oð 2Kñ 2ô 2ˆFð 7×=Ò=¸f¼kÈ4ÑPÔPˆGà”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×'Ò'¨Ñ1Ô1Ð1r,   c                 óš  — |                      d¦  «        r6| j                             |d¬¦  «        }|                      |j        ¦  «        S |                      ||¦  «        }|sQ|rO| j                             ¦   «         D ]5\  }}|D ]-}|                      |¦  «        r|                      ||¦  «        }Œ.Œ6|st          d|z  dd¦  «        ‚|S )aV  
        Return an GCENodeImage object based on the name or link provided.

        :param  partial_name: The name, partial name, or full path of a GCE
                              image.
        :type   partial_name: ``str``

        :param  ex_project_list: The name of the project to list for images.
                                 Examples include: 'debian-cloud'.
        :type   ex_project_list: ``str`` or ``list`` of ``str`` or ``None``

        :param  ex_standard_projects: If true, check in standard projects if
                                      the image is not found.
        :type   ex_standard_projects: ``bool``

        :return:  GCENodeImage object based on provided information or None if
                  an image with that name is not found.
        :rtype:   :class:`GCENodeImage` or raise ``ResourceNotFoundError``
        r÷  r\   r]   zCould not find image '%s'N)	r«  r{   rQ   rû  rS   Ú_match_imagesró  rO   r   )	r@   Úpartial_nameÚex_project_listÚex_standard_projectsrW   r'  r÷  Ú
short_listÚ
short_names	            r*   rÿ  zGCENodeDriver.ex_get_imagez  s  € ð* ×"Ò" :Ñ.Ô.ð 	8Ø”×.Ò.¨|ÀEÐ.ÑJÔJˆHà×&Ò& x¤Ñ7Ô7Ð7Ø×"Ò" ?°LÑAÔAˆàð 	KÐ-ð 	KØ(,Ô(;×(AÒ(AÑ(CÔ(Cð Kð KÑ$�˜*Ø",ð Kð K�JØ#×.Ò.¨zÑ:Ô:ð KØ $× 2Ò 2°8¸\Ñ JÔ J˜øðKð ð 	bÝ'Ð(CÀ|Ñ(TÐVZÐ\`ÑaÔaÐaàˆr,   c                 ó¾  ‡ — dˆ fd„	}d}|                      d¦  «        r6‰ j                             |d¬¦  «        }‰                      |j        ¦  «        S |s ||¦  «        }n|D ]} |||¬¦  «        }|r nŒ|sL|rJ‰ j                             ¦   «         D ]0\  }}|D ](}	|                      |	¦  «        r |||¬¦  «        }|r nŒ)Œ1|st          d|z  dd¦  «        ‚|S )	a\  
        Return an GCENodeImage object based on an image family name.

        :param  image_family: The name of the 'Image Family' to return the
                              latest image from.
        :type   image_family: ``str``

        :param  ex_project_list: The name of the project to list for images.
                                 Examples include: 'debian-cloud'.
        :type   ex_project_list: ``list`` of ``str``, or ``None``

        :param  ex_standard_projects: If true, check in standard projects if
                                      the image is not found.
        :type   ex_standard_projects: ``bool``

        :return:  GCENodeImage object based on provided information or
                  ResourceNotFoundError if the image family is not found.
        :rtype:   :class:`GCENodeImage` or raise ``ResourceNotFoundError``
        Nc                 óL  •— d| z  }‰j         j        }|r'|                     ‰j        |¦  «        }|‰j         _        	 ‰j                              |d¬¦  «        }‰                     |j        ¦  «        }n# t          $ r d }Y nw xY w|‰j         _        n# |‰j         _        w xY w|S )Nz/global/images/family/%sr\   r]   )r{   r>   r’   rC   rQ   rû  rS   r   )Úimage_familyrC   rQ   rý  r•   rW   r'  r@   s          €r*   Ú_try_image_familyzAGCENodeDriver.ex_get_image_from_family.<locals>._try_image_family·  sÊ   ø€ Ø0°LÑAˆGØ $¤Ô <Ðàð @Ø#4×#<Ò#<¸T¼\È7Ñ#SÔ#SÐ Ø/?�”Ô,ðAØœ?×2Ò2°7À5Ð2ÑIÔI�Ø×+Ò+¨H¬OÑ<Ô<��øÝ(ð ð ð Ø���ðøøøð 0A�”Ô,Ð,øÐ/@�”Ô,Ð@Ð@Ð@Ð@àˆLs)   ½6A4 Á3B Á4BÂ B ÂBÂB ÂB!r÷  r\   r]   )rC   z$Could not find image for family '%s'ro   )r«  r{   rQ   rû  rS   ró  rO   r   )
r@   rÓ  rÍ  rÎ  rÔ  r'  rW   r÷  rÏ  rÐ  s
   `         r*   rb  z&GCENodeDriver.ex_get_image_from_family   sj  ø€ ð.	ð 	ð 	ð 	ð 	ð 	ð" ˆà×"Ò" :Ñ.Ô.ð 	8Ø”×.Ò.¨|ÀEÐ.ÑJÔJˆHà×&Ò& x¤Ñ7Ô7Ð7àð 	Ø%Ð% lÑ3Ô3ˆEˆEà+ð ð �Ø)Ð)¨,ÀÐIÑIÔI�àð Ø�Eðð ð 	"Ð-ð 	"Ø(,Ô(;×(AÒ(AÑ(CÔ(Cð "ð "Ñ$�˜*Ø",ð "ð "�JØ#×.Ò.¨zÑ:Ô:ð "Ø 1Ð 1°,ÈÐ QÑ QÔ Q˜à ð "Ø!˜Eøøàð 	Ý'Ø9¸\ÑJÈDÐRVñô ð ð ˆr,   c                 óx   — d|z  }| j                              |d¬¦  «        j        }|                      |¦  «        S )zã
        Return a Route object based on a route name.

        :param  name: The name of the route
        :type   name: ``str``

        :return:  A Route object for the named route
        :rtype:   :class:`GCERoute`
        rx  r\   r]   )r{   rQ   rS   r	  rÄ  s       r*   r!  zGCENodeDriver.ex_get_routeè  s=   € ð &¨Ñ.ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�~Š~˜hÑ'Ô'Ð'r,   c                 óX   — d|j         z  }i }| j                             |d|¬¦  «         dS )aà  
        Deletes the specified SslCertificate resource.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute

        :param  sslcertificate:  Name of the SslCertificate resource to
                                 delete.
        :type   sslcertificate: ``str``

        :return  sslCertificate:  Return True if successful.
        :rtype   sslCertificate: ````bool````
        ú/global/sslCertificates/%sr.  rƒ  Tr  )r@   r:  rQ   r  s       r*   r;  z'GCENodeDriver.ex_destroy_sslcertificate÷  s8   € ð  /°.Ô2EÑFˆØˆØŒ×%Ò% g°hÀ\Ð%ÑRÔRÐRàˆtr,   c                 óR  — d}d}|rPt          |t          ¦  «        r|j        }n3|                     d¦  «        r|                     d¦  «        d         }n|}t          |t
          ¦  «        r|j        }|s|j        j        }n?|                     d¦  «        r(|                      |¦  «        }|d         }|s|d         }n|}|s-|                      |¦  «        }|st          d¦  «        ‚|j        }d 
                    ||¦  «        }| j                             |d	¬
¦  «        j         dS )aŽ  
        Delete a Subnetwork object based on name and region.

        :param  name: The name, URL or object of the subnetwork
        :type   name: ``str`` or :class:`GCESubnetwork`

        :keyword region: The region object, name, or URL of the subnetwork
        :type   region: ``str`` or :class:`GCERegion` or ``None``

        :return:  True if successful
        :rtype:   ``bool``
        Nr÷  rÌ  r.  r_   r­   ú*Could not determine region for subnetwork.ú/regions/{}/subnetworks/{}r.  r]   T)r¸   rs  r_   r«  r  r>  r­   r)  rÄ  r¼   r<   r{   ru  rS   )r@   r_   r­   r6  Úsubnet_nameÚ	url_partsrQ   s          r*   rB  z#GCENodeDriver.ex_destroy_subnetwork   sJ  € ð ˆØˆàð 	)Ý˜&¥)Ñ,Ô,ð )Ø$œk��à×$Ò$ ZÑ0Ô0ð )Ø"(§,¢,¨sÑ"3Ô"3°BÔ"7�K�Kà"(�Kå�d�MÑ*Ô*ð 	#Øœ)ˆKàð /Ø"œkÔ.�øà�Š˜zÑ*Ô*ð #Ø ×:Ò:¸4Ñ@Ô@�	Ø'¨Ô/�à"ð 6Ø"+¨HÔ"5�Køà"�àð 	*Ø×%Ò% fÑ-Ô-ˆFàð *Ý Ð!MÑNÔNÐNà$œk�à.×5Ò5°kÀ;ÑOÔOˆØŒ×%Ò% g°hÐ%Ñ?Ô?ÔFÐFàˆtr,   c                 óö  — d}|                      d¦  «        r|}nªt          |t          ¦  «        r|j        }nHt          |t          ¦  «        r3|                      d¦  «        r|                     d¦  «        d         }n|}|s-|                      |¦  «        }|st          d¦  «        ‚|j        }d                     ||¦  «        }| j	         
                    |d¬¦  «        j        }|                      |¦  «        S )	af  
        Return a Subnetwork object based on name and region.

        :param  name: The name or URL of the subnetwork
        :type   name: ``str``

        :keyword region: The region of the subnetwork
        :type   region: ``str`` or :class:`GCERegion` or ``None``

        :return:  A Subnetwork object
        :rtype:   :class:`GCESubnetwork`
        Nr÷  rÌ  r.  rÙ  rÚ  r\   r]   )r«  r¸   rs  r_   r�   r  rÄ  r¼   r<   r{   rQ   rS   r  )r@   r_   r­   r6  rQ   rW   s         r*   r¯  zGCENodeDriver.ex_get_subnetworkB   s  € ð ˆà�?Š?˜:Ñ&Ô&ð 	MØˆGˆGå˜&¥)Ñ,Ô,ð )Ø$œk��Ý˜F¥CÑ(Ô(ð )Ø×$Ò$ ZÑ0Ô0ð )Ø"(§,¢,¨sÑ"3Ô"3°BÔ"7�K�Kà"(�Kàð .Ø×)Ò)¨&Ñ1Ô1�àð .Ý$Ð%QÑRÔRÐRà"(¤+�Kà2×9Ò9¸+ÀtÑLÔLˆGà”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×"Ò" 8Ñ,Ô,Ð,r,   c                 ó¨   — |                      d¦  «        r|}nd|z  }| j                             |d¬¦  «        j        }|                      |¦  «        S )zð
        Return a Network object based on a network name.

        :param  name: The name or URL of the network
        :type   name: ``str``

        :return:  A Network object for the network
        :rtype:   :class:`GCENetwork`
        r÷  rz  r\   r]   )r«  r{   rQ   rS   r  rÄ  s       r*   rà  zGCENodeDriver.ex_get_networkj   sZ   € ð �?Š?˜:Ñ&Ô&ð 	5ØˆGˆGà+¨tÑ4ˆGØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×Ò Ñ)Ô)Ð)r,   c                 óþ   — |                       |¦  «        p|                      |dd¬¦  «        }d                     |j        |¦  «        }| j                             |d¬¦  «        j        }|                      |¦  «        S )aá  
        Return a Node object based on a node name and optional zone.

        :param  name: The name of the node
        :type   name: ``str``

        :keyword  zone: The zone to search for the node in.  If set to 'all',
                        search all zones for the instance.
        :type     zone: ``str`` or :class:`GCEZone` or
                        :class:`NodeLocation` or ``None``

        :return:  A Node object for the node
        :rtype:   :class:`Node`
        r!  r   ©rÀ  r—  r\   r]   )r£  rÁ  r<   r_   r{   rQ   rS   r*  r¼  s        r*   rh  zGCENodeDriver.ex_get_node}   sv   € ð �~Š~˜dÑ#Ô#Ðd t×'@Ò'@ÀÀ{Ð]cÐ'@Ñ'dÔ'dˆØ*×1Ò1°$´)¸TÑBÔBˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�}Š}˜XÑ&Ô&Ð&r,   c                 ón   — | j                              dd¬¦  «        j        }|                      |¦  «        S )z•
        Return a Project object with project-wide information.

        :return:  A GCEProject object
        :rtype:   :class:`GCEProject`
        r¯  r\   r]   )r{   rQ   rS   Ú_to_project)r@   rW   s     r*   r³  zGCENodeDriver.ex_get_project’   s5   € ð ”?×*Ò*¨2°eÐ*Ñ<Ô<ÔCˆà×Ò Ñ)Ô)Ð)r,   c                 ó$  — |p| j         }t          |d¦  «        s|                      |¦  «        }d                     |j        |¦  «        }| j                             |d¬¦  «        j        }t          dd¬¦  «        }|  	                    ||¦  «        S )a°  
        Return a size object based on a machine type name and zone.

        :param  name: The name of the node
        :type   name: ``str``

        :keyword  zone: The zone to search for the machine type in
        :type     zone: ``str`` or :class:`GCEZone` or
                        :class:`NodeLocation` or ``None``

        :return:  A GCENodeSize object for the machine type
        :rtype:   :class:`GCENodeSize`
        r_   z/zones/{}/machineTypes/{}r\   r]   r@  r5  r6  )
rc   r²   rT  r<   r_   r{   rQ   rS   r   r;  )r@   r_   rc   rQ   rW   r>  s         r*   ra  zGCENodeDriver.ex_get_size�   s‘   € ð Ð �t”yˆå�t˜VÑ$Ô$ð 	*Ø×#Ò# DÑ)Ô)ˆDØ-×4Ò4°T´YÀÑEÔEˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆÝ%°)ÈÐYÑYÔYˆà×!Ò! (¨OÑ<Ô<Ð<r,   c                 óx   — d|z  }| j                              |d¬¦  «        j        }|                      |¦  «        S )zð
        Return a Snapshot object based on snapshot name.

        :param  name: The name of the snapshot
        :type   name: ``str``

        :return:  A GCESnapshot object for the snapshot
        :rtype:   :class:`GCESnapshot`
        r³  r\   r]   )r{   rQ   rS   rF  rÄ  s       r*   rù  zGCENodeDriver.ex_get_snapshotµ   rÇ  r,   c                 óž   — | j         r|du r|                      ¦   «          	 |j        }n# t          $ r Y nw xY w|                      ||¦  «        S )a  
        Return a Volume object based on a volume name and optional zone.

        To improve performance, we request all disks and allow the user
        to consult the cache dictionary rather than making an API call.

        :param    name: The name of the volume
        :type     name: ``str``

        :keyword  zone: The zone to search for the volume in (set to 'all' to
                        search all zones)
        :type     zone: ``str`` or :class:`GCEZone` or :class:`NodeLocation`
                        or ``None``

        :keyword  use_cache: Search for the volume in the existing cache of
                             volumes.  If True, we omit the API call and search
                             self.volumes_dict.  If False, a call to
                             disks/aggregatedList is made prior to searching
                             self._ex_volume_dict.
        :type     use_cache: ``bool``

        :return:  A StorageVolume object for the volume
        :rtype:   :class:`StorageVolume`
        F)rX  r'  r_   ÚAttributeErrorÚ_ex_lookup_volume)r@   r_   rc   Ú	use_caches       r*   rd  zGCENodeDriver.ex_get_volumeÄ   sq   € ð4 Ô#ð 	, y°EÐ'9Ð'9à×)Ò)Ñ+Ô+Ð+ð	à”9ˆDˆDøÝð 	ð 	ð 	ØˆDð	øøøð ×%Ò% d¨DÑ1Ô1Ð1s   ¡) ©
6µ6c                 ó  — |                      d¦  «        r|                      |¦  «        d         }|}n|}d|z  }|| j        v r| j        |         S | j                             |d¬¦  «        j        }|                      |¦  «        S )zé
        Return a Region object based on the region name.

        :param  name: The name of the region.
        :type   name: ``str``

        :return:  A GCERegion object for the region
        :rtype:   :class:`GCERegion`
        r÷  r_   z/regions/%sr\   r]   )r«  r)  rh  r{   rQ   rS   r1  ©r@   r_   rÐ  rQ   rW   s        r*   r®  zGCENodeDriver.ex_get_regionê   s“   € ð �?Š?˜:Ñ&Ô&ð 	-Ø×7Ò7¸Ñ=Ô=¸fÔEˆJØˆGˆGàˆJØ# tÑ,ˆGð ˜Ô)Ð)Ð)ØÔ# JÔ/Ð/à”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�Š˜xÑ(Ô(Ð(r,   c                 óx   — d|z  }| j                              |d¬¦  «        j        }|                      |¦  «        S )aB  
        Returns the specified SslCertificate resource. Get a list of available
        SSL certificates by making a list() request.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute
        * https://www.googleapis.com/auth/compute.readonly

        :param  name:  Name of the SslCertificate resource to
                                 return.
        :type   name: ``str``

        :return:  `GCESslCertificate` object.
        :rtype: :class:`GCESslCertificate`
        r×  r\   r]   )r{   rQ   rS   r  rÄ  s       r*   r(  z#GCENodeDriver.ex_get_sslcertificate!  s?   € ð$ /°$Ñ7ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×&Ò& xÑ0Ô0Ð0r,   c                 óx   — d|z  }| j                              |d¬¦  «        j        }|                      |¦  «        S )a  
        Return a Target HTTP Proxy object based on its name.

        :param  name: The name of the target HTTP proxy.
        :type   name: ``str``

        :return:  A Target HTTP Proxy object for the pool
        :rtype:   :class:`GCETargetHttpProxy`
        r§  r\   r]   )r{   rQ   rS   rL  rÄ  s       r*   rì  z$GCENodeDriver.ex_get_targethttpproxy!  s?   € ð 1°4Ñ7ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×'Ò'¨Ñ1Ô1Ð1r,   c                 óx   — d|z  }| j                              |d¬¦  «        j        }|                      |¦  «        S )aP  
        Returns the specified TargetHttpsProxy resource. Get a list of
        available target HTTPS proxies by making a list() request.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute
        * https://www.googleapis.com/auth/compute.readonly

        :param  name:  Name of the TargetHttpsProxy resource to
                                   return.
        :type   name: ``str``

        :return:  `GCETargetHttpsProxy` object.
        :rtype: :class:`GCETargetHttpsProxy`
        r©  r\   r]   )r{   rQ   rS   rT  rÄ  s       r*   rØ  z%GCENodeDriver.ex_get_targethttpsproxy*!  s?   € ð$ 2°TÑ:ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×(Ò(¨Ñ2Ô2Ð2r,   c                 óþ   — |                       |¦  «        p|                      |dd¬¦  «        }d                     |j        |¦  «        }| j                             |d¬¦  «        j        }|                      |¦  «        S )aÖ  
        Return a TargetInstance object based on a name and optional zone.

        :param  name: The name of the target instance
        :type   name: ``str``

        :keyword  zone: The zone to search for the target instance in (set to
                          'all' to search all zones).
        :type     zone: ``str`` or :class:`GCEZone` or ``None``

        :return:  A TargetInstance object for the instance
        :rtype:   :class:`GCETargetInstance`
        r`  ÚTargetInstancerà  r«  r\   r]   )r£  rÁ  r<   r_   r{   rQ   rS   r]  r¼  s        r*   rÝ  z#GCENodeDriver.ex_get_targetinstanceA!  s…   € ð �~Š~˜dÑ#Ô#ð 
 t×'@Ò'@ØÐ#Ð.>ð (Añ (
ô (
ˆð 1×7Ò7¸¼	À4ÑHÔHˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×&Ò& xÑ0Ô0Ð0r,   c                 ó   — |                       |¦  «        p|                      |ddd¬¦  «        }d                     |j        |¦  «        }| j                             |d¬¦  «        j        }|                      |¦  «        S )aÊ  
        Return a TargetPool object based on a name and optional region.

        :param  name: The name of the target pool
        :type   name: ``str``

        :keyword  region: The region to search for the target pool in (set to
                          'all' to search all regions).
        :type     region: ``str`` or :class:`GCERegion` or ``None``

        :return:  A TargetPool object for the pool
        :rtype:   :class:`GCETargetPool`
        rj  TÚ
TargetPoolr¿  r­  r\   r]   )rÄ  rÁ  r<   r_   r{   rQ   rS   ri  rÂ  s        r*   rí  zGCENodeDriver.ex_get_targetpoolW!  s‡   € ð ×!Ò! &Ñ)Ô)ð 
¨T×-FÒ-FØ�-¨°|ð .Gñ .
ô .
ˆð /×5Ò5°f´kÀ4ÑHÔHˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×"Ò" 8Ñ,Ô,Ð,r,   c                 óx   — d|z  }| j                              |d¬¦  «        j        }|                      |¦  «        S )zå
        Return a URL Map object based on name

        :param  name: The name of the url map
        :type   name: ``str``

        :return:  A URL Map object for the backend service
        :rtype:   :class:`GCEUrlMap`
        r¯  r\   r]   )r{   rQ   rS   rs  rÄ  s       r*   rÐ  zGCENodeDriver.ex_get_urlmapm!  s=   € ð '¨Ñ-ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà�Š˜xÑ(Ô(Ð(r,   c                 ó   — |                       |¦  «        p|                      |ddd¬¦  «        }d                     |j        |¦  «        }| j                             |d¬¦  «        j        }|                      |¦  «        S )a�  
        Returns the specified Instance Group. Get a list of available instance
        groups by making a list() request.

        Scopes needed - one of the following:
        * https://www.googleapis.com/auth/cloud-platform
        * https://www.googleapis.com/auth/compute
        * https://www.googleapis.com/auth/compute.readonly

        :param  name:  The name of the instance group.
        :type   name: ``str``

        :param  zone:  The name of the zone where the instance group is
                       located.
        :type   zone: ``str``

        :return:  `GCEInstanceGroup` object.
        :rtype:   :class:`GCEInstanceGroup`
        rz  FÚInstancegroupr¿  r-  r\   r]   )r£  rÁ  r<   r_   r{   rQ   rS   ry  r¼  s        r*   r  z"GCENodeDriver.ex_get_instancegroup|!  s†   € ð( �~Š~˜dÑ#Ô#ð 
 t×'@Ò'@ØÐ"¨5¸?ð (Añ (
ô (
ˆð 0×6Ò6°t´yÀ$ÑGÔGˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×%Ò% hÑ/Ô/Ð/r,   c                 ó   — |                       |¦  «        p|                      |ddd¬¦  «        }d                     |j        |¦  «        }| j                             |d¬¦  «        j        }|                      |¦  «        S )aä  
        Return a InstanceGroupManager object based on a name and optional zone.

        :param  name: The name of the Instance Group Manager.
        :type   name: ``str``

        :keyword  zone: The zone to search for the Instance Group Manager.
                        Set to 'all' to search all zones.
        :type     zone: ``str`` or :class:`GCEZone` or ``None``

        :return:  An Instance Group Manager object.
        :rtype:   :class:`GCEInstanceGroupManager`
        rƒ  FÚInstancegroupmanagerr¿  r‘  r\   r]   )r£  rÁ  r<   r_   r{   rQ   rS   r‚  r¼  s        r*   r  z)GCENodeDriver.ex_get_instancegroupmanager˜!  s‡   € ð �~Š~˜dÑ#Ô#ð 
 t×'@Ò'@ØÐ)°%ÐBXð (Añ (
ô (
ˆð 7×=Ò=¸d¼iÈÑNÔNˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×,Ò,¨XÑ6Ô6Ð6r,   c                 óx   — d|z  }| j                              |d¬¦  «        j        }|                      |¦  «        S )a  
        Return an InstanceTemplate object based on a name and optional zone.

        :param  name: The name of the Instance Template.
        :type   name: ``str``

        :return:  An Instance Template object.
        :rtype:   :class:`GCEInstanceTemplate`
        r“  r\   r]   )r{   rQ   rS   r‹  rÄ  s       r*   r  z%GCENodeDriver.ex_get_instancetemplate®!  s?   € ð 1°DÑ9ˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×(Ò(¨Ñ2Ô2Ð2r,   c                 ó   — |                       |¦  «        p|                      |ddd¬¦  «        }d                     |j        |¦  «        }| j                             |d¬¦  «        j        }|                      |¦  «        S )a°  
        Return an Autoscaler object based on a name and optional zone.

        :param  name: The name of the Autoscaler.
        :type   name: ``str``

        :keyword  zone: The zone to search for the Autoscaler.  Set to
                          'all' to search all zones.
        :type     zone: ``str`` or :class:`GCEZone` or ``None``

        :return:  An Autoscaler object.
        :rtype:   :class:`GCEAutoscaler`
        ÚAutoscalersFr¿  r•  r\   r]   )r£  rÁ  r<   r_   r{   rQ   rS   r‘  r¼  s        r*   r¶  zGCENodeDriver.ex_get_autoscaler½!  s…   € ð �~Š~˜dÑ#Ô#ð 
 t×'@Ò'@Ø�-¨¸ð (Añ (
ô (
ˆð -×3Ò3°D´I¸tÑDÔDˆØ”?×*Ò*¨7¸5Ð*ÑAÔAÔHˆà×"Ò" 8Ñ,Ô,Ð,r,   c                 ó4  — |                      d¦  «        r|                      |¦  «        d         }|}n|}d|z  }|| j        v r| j        |         S 	 | j                             |d¬¦  «        j        }n# t          $ r Y dS w xY w|                      |¦  «        S )zþ
        Return a Zone object based on the zone name.

        :param  name: The name of the zone.
        :type   name: ``str``

        :return:  A GCEZone object for the zone or None if not found
        :rtype:   :class:`GCEZone` or ``None``
        r÷  r_   r}  r\   r]   N)r«  r)  r_  r{   rQ   rS   r   r¢  rê  s        r*   rT  zGCENodeDriver.ex_get_zoneÓ!  s¼   € ð �?Š?˜:Ñ&Ô&ð 	+Ø×7Ò7¸Ñ=Ô=¸fÔEˆJØˆGˆGàˆJØ! TÑ*ˆGð ˜œÐ'Ð'Ø”> *Ô-Ð-ð	Ø”×.Ò.¨w¸uÐ.ÑEÔEÔLˆHˆHøÝ$ð 	ð 	ð 	Ø�4�4ð	øøøð �}Š}˜XÑ&Ô&Ð&s   Á!A4 Á4
BÂBc                 ó8   — | j         | j        | j        | j        dœS )N©r7   rC   rO  r8   rü  r   s    r*   Ú_ex_connection_class_kwargsz)GCENodeDriver._ex_connection_class_kwargsð!  s&   € àœØ”|Ø”kØ#Ô3ð	
ð 
ð 	
r,   c                 ó  — i }|                      ¦   «         D ]q\  }}|                     dd¦  «        }|                     dg ¦  «        }|D ]=}|d         }|                     |i ¦  «         ||                              ||i¦  «         Œ>Œr|S )a¨  
        Build a dictionary in [name][zone]=disk format.

        :param  zone_dict: dict in the format of:
                 { items: {key: {api_name:[], key2: api_name:[]}} }
        :type   zone_dict: ``dict``

        :return:  dict of volumes, organized by name, then zone  Format:
                  { 'disk_name':
                   {'zone_name1': disk_info, 'zone_name2': disk_info} }
        :rtype: ``dict``
        zzones/r¯  rœ  r_   )rO   r’   rT   rg   rH   )	r@   r_  Úname_zone_dictrl   rm   rÆ   rœ  r]  r  s	            r*   Ú_build_volume_dictz GCENodeDriver._build_volume_dictø!  s¨   € ð ˆà—O’OÑ%Ô%ð 	<ð 	<‰DˆAˆqØŸ	š	 (¨BÑ/Ô/ˆIØ—E’E˜' 2Ñ&Ô&ˆEàð <ð <�Ø˜”L�Ø×)Ò)¨!¨RÑ0Ô0Ð0Ø˜qÔ!×(Ò(¨)°TÐ):Ñ;Ô;Ð;Ð;ð<ð
 Ðr,   c                 ó¢  — || j         vrB|                      ¦   «          || j         vr%t          d                     ||¦  «        dd¦  «        ‚|�|dk    r t	          | j         |         ¦  «        d         }| j         |                              |d¦  «        }|s%t          d                     ||¦  «        dd¦  «        ‚|                      |¦  «        S )aM  
        Look up volume by name and zone in volume dict.

        If zone isn't specified or equals 'all', we return the volume
        for the first zone, as determined alphabetically.

        :param    volume_name: The name of the volume.
        :type     volume_name: ``str``

        :keyword  zone: The zone to search for the volume in (set to 'all' to
                        search all zones)
        :type     zone: ``str`` or ``None``

        :return:  A StorageVolume object for the volume.
        :rtype:   :class:`StorageVolume` or raise ``ResourceNotFoundError``.
        z%Volume name: '{}' not found. Zone: {}Nrç  r   z"Volume '{}' not found for zone {}.)rX  r'  r   r<   ÚsortedrT   r›  )r@   r‘  rc   r�  s       r*   rç  zGCENodeDriver._ex_lookup_volume"  sï   € ð$ ˜dÔ2Ð2Ð2ð ×)Ò)Ñ+Ô+Ð+à $Ô"6Ð6Ð6Ý+Ø;×BÒBÀ;ÐPTÑUÔUØØñô ð ð ˆ<˜4 5š=˜=Ý˜$Ô.¨{Ô;Ñ<Ô<¸QÔ?ˆDàÔ% kÔ2×6Ò6°t¸TÑBÔBˆàð 	Ý'Ø4×;Ò;¸KÈÑNÔNÐPTÐVZñô ð ð ×&Ò& vÑ.Ô.Ð.r,   c                 óz   — | j                              d¦  «        }|                      |d         ¦  «        | _        dS )z�
        Fetch the volume information using disks/aggregatedList
        and store it in _ex_volume_dict.

        return:  ``None``
        rœ  rO   N)r{   re   r   rX  )r@   Úaggregated_itemss     r*   r'  z&GCENodeDriver._ex_populate_volume_dict?"  s=   € ð  œ?×CÒCÀGÑLÔLÐð  $×6Ò6Ð7GÈÔ7PÑQÔQˆÔàˆtr,   c                 ó@   — t          j        ¦   «         d         }|r|S |‚)aM  
        Catch an exception and raise it unless asked to ignore it.

        :keyword  ignore_errors: If true, just return the error.  Otherwise,
                                 raise the error.
        :type     ignore_errors: ``bool``

        :return:  The exception that was raised.
        :rtype:   :class:`Exception`
        r¶   )ÚsysÚexc_info)r@   r¿  r  s      r*   r¡  zGCENodeDriver._catch_errorO"  s&   € õ ŒL‰NŒN˜1Ôˆàð 	ØˆHàˆGr,   c                 óÆ   — d}d}d}|                      d¦  «        }|d         }|d         dk    r	|d         }n#|d         dk    r	|d         }n|d         d	k    rd
}||||dœS )aZ  
        Return a dictionary containing name & zone/region from a request path.

        :param  path: HTTP request path (e.g.
                      '/project/pjt-name/zones/us-central1-a/instances/mynode')
        :type   path: ``str``

        :return:  Dictionary containing name and zone/region of resource
        :rtype:   ``dict``
        NFrÌ  r.  éüÿÿÿrg  r   rv  r»  T)r_   r­   rc   r»  )r  )r@   rö   r­   rc   ÚglobÚ
componentsr_   s          r*   r)  z'GCENodeDriver._get_components_from_patha"  s…   € ð ˆØˆØˆØ—Z’Z ‘_”_ˆ
Ø˜"Œ~ˆà�bŒ>˜YÒ&Ð&Ø ”^ˆFˆFØ˜Œ^˜wÒ&Ð&Ø˜b”>ˆDˆDØ˜Œ^˜xÒ'Ð'ØˆDà¨¸ÈÐMÐMÐMr,   c                 óŽ   — |sdS | j                              |d¬¦  «        j        }t          j        |d                  | |¦  «        S )a“  
        Fetch a resource and return its object representation by mapping its
        'kind' parameter to the appropriate class.  Returns ``None`` if url is
        ``None``

        :param  url: fully qualified URL of the resource to request from GCE
        :type   url: ``str``

        :return:  Object representation of the requested resource.
        "rtype:   :class:`object` or ``None``
        Nr\   r]   r�   )r{   rQ   rS   r5  ÚKIND_METHOD_MAP)r@   r  rW   s      r*   Ú_get_object_by_kindz!GCENodeDriver._get_object_by_kind{"  sM   € ð ð 	Ø�4ð ”?×*Ò*¨3°uÐ*Ñ=Ô=ÔDˆåÔ,¨X°fÔ-=Ô>¸tÀXÑNÔNÐNr,   c                 óV   — | j         D ] }d„ |j        D ¦   «         }|j        |v r|c S Œ!dS )zö
        Return the Region object that contains the given Zone object.

        :param  zone: Zone object
        :type   zone: :class:`GCEZone`

        :return:  Region object that contains the zone
        :rtype:   :class:`GCERegion`
        c                 ó   — g | ]	}|j         ‘Œ
S r2   r8  ©r\  r¤  s     r*   rŸ  z7GCENodeDriver._get_region_from_zone.<locals>.<listcomp>�"  s   € Ð2Ð2Ð2 �Q”VÐ2Ð2Ð2r,   N)rj  rv  r_   )r@   rc   r­   rv  s       r*   rW  z#GCENodeDriver._get_region_from_zone‘"  sP   € ð Ô&ð 	ð 	ˆFØ2Ð2 V¤\Ð2Ñ2Ô2ˆEàŒy˜EÐ!Ð!Ø���ð "ð	ð 	r,   c                 óœ  — |rd}nd}d}|p|}| j                              |¦  «        }|d                              ¦   «         D ]E\  }}	|	                     |g ¦  «        D ])}
|
d         |k    r|                     d|z  d¦  «        } nŒ*ŒF|s&t          d                     |||¦  «        dd¦  «        ‚t          | d	|z  ¦  «        } ||¦  «        S )
aÕ  
        Find the zone or region for a named resource.

        :param  name: Name of resource to find
        :type   name: ``str``

        :param  res_type: Type of resource to find.
                          Examples include: 'disks', 'instances' or 'addresses'
        :type   res_type: ``str``

        :keyword  region: If True, search regions instead of zones
        :type     region: ``bool``

        :keyword  res_name: The name of the resource type for error messages.
                            Examples: 'Volume', 'Node', 'Address'
        :keyword  res_name: ``str``

        :return:  Zone/Region object for the zone/region for the resource.
        :rtype:   :class:`GCEZone` or :class:`GCERegion`
        r­   rc   NrO   r_   z%ss/r¯  z{} '{}' not found in any {}.r¢  )r{   re   rO   rT   r’   r   r<   rW  )r@   r_   Úres_typer­   rÀ  ÚrzÚrz_nameÚres_listrl   rm   ÚresÚgetrzs               r*   rÁ  z"GCENodeDriver._find_zone_or_region¢"  s  € ð, ð 	ØˆBˆBàˆBØˆØÐ'˜xˆØ”?×;Ò;¸HÑEÔEˆà˜WÔ%×+Ò+Ñ-Ô-ð 	ð 	‰DˆAˆqØ—u’u˜X rÑ*Ô*ð ð �Ø�v”; $Ò&Ð&ØŸiši¨°"©°rÑ:Ô:�Gà�Eð 'øð
 ð 	"Ý'Ø.×5Ò5°hÀÀbÑIÔIÈ4ÐQUñô ð õ ˜D +°Ñ"4Ñ5Ô5ˆEà�5˜‘>”>Ð!r,   c                 ó>  — |                       | j        |d¬¦  «        }g }|                     ¦   «         D ]^}|D ]Y}|j        |k    r|c c S |j                             |¦  «        r,t          |j        d         ¦  «        }|r|d         |k     r||g}ŒZŒ_|r|d         S dS )aX  
        Find the latest image, given a partial name.

        For example, providing 'debian-7' will return the image object for the
        most recent image with a name that starts with 'debian-7' in the
        supplied project.  If no project is given, it will search your own
        project.

        :param  project: The name of the project to search for images.
                         Examples include: 'debian-cloud' and 'centos-cloud'.
        :type   project: ``str``, ``list`` of ``str``, or ``None``

        :param  partial_name: The full name or beginning of a name for an
                              image.
        :type   partial_name: ``str``

        :return:  The latest image object that matches the partial name or None
                  if no matching image is found.
        :rtype:   :class:`GCENodeImage` or ``None``
        Trï  ÚcreationTimestampr   r¶   N)r—  rø  r†   r_   r«  r+   rŒ   )r@   rC   rÌ  Úproject_images_listÚpartial_matchr†   r'  r&   s           r*   rË  zGCENodeDriver._match_imagesÐ"  sä   € ð* #ŸlšlØÔ¨Èð +ñ 
ô 
Ðð ˆà'×,Ò,Ñ.Ô.ð 		4ð 		4ˆDØð 4ð 4�Ø”: Ò-Ð-Ø �L�L�L�L�Là”:×(Ò(¨Ñ6Ô6ð 4Ý.¨u¬{Ð;NÔ/OÑPÔP�Bà(ð 4¨M¸!Ô,<¸rÒ,AÐ,AØ)+¨U¨˜øð4ð ð 	$Ø  Ô#Ð#ð	$ð 	$r,   c                 óv   — |p| j         }|dk    s|€dS t          |d¦  «        s|                      |¦  «        }|S )aB  
        Return the region to use for listing resources.

        :param  region: A name, region object, None, or 'all'
        :type   region: ``str`` or :class:`GCERegion` or ``None``

        :return:  A region object or None if all regions should be considered
        :rtype:   :class:`GCERegion` or ``None``
        rç  Nr_   )r­   r²   r®  )r@   r­   s     r*   rÄ  zGCENodeDriver._set_regionø"  sL   € ð Ð&˜4œ;ˆà�UŠ?ˆ?˜f˜nØ�4å�v˜vÑ&Ô&ð 	0Ø×'Ò'¨Ñ/Ô/ˆFàˆr,   c                 óv   — |p| j         }|dk    s|€dS t          |d¦  «        s|                      |¦  «        }|S )a2  
        Return the zone to use for listing resources.

        :param  zone: A name, zone object, None, or 'all'
        :type   zone: ``str`` or :class:`GCEZone` or ``None``

        :return:  A zone object or None if all zones should be considered
        :rtype:   :class:`GCEZone` or ``None``
        rç  Nr_   )rc   r²   rT  )r@   rc   s     r*   r£  zGCENodeDriver._set_zone#  sL   € ð Ð �t”yˆà�5Š=ˆ=˜D˜LØ�4å�t˜VÑ$Ô$ð 	*Ø×#Ò# DÑ)Ô)ˆDàˆr,   c                 óä   — |s|s|st          d¦  «        ‚|r|rt          d¦  «        ‚d}d}|r|}|                      |||||||	||||
||||||||||||||¬¦  «        }||d<   d|j        z  }||fS )a2  
        Returns a request and body to create a new node.

        This is a helper method to support both :class:`create_node` and
        :class:`ex_create_multiple_nodes`.

        :param  name: The name of the node to create.
        :type   name: ``str``

        :param  size: The machine type to use.
        :type   size: :class:`GCENodeSize`

        :param  image: The image to use to create the node (or, if using a
                       persistent disk, the image the disk was created from).
        :type   image: :class:`GCENodeImage` or ``None``

        :param  location: The location (zone) to create the node in.
        :type   location: :class:`NodeLocation` or :class:`GCEZone`

        :param  network: The network to associate with the node.
        :type   network: :class:`GCENetwork`

        :keyword  tags: A list of tags to associate with the node.
        :type     tags: ``list`` of ``str``

        :keyword  metadata: Metadata dictionary for instance.
        :type     metadata: ``dict``

        :keyword  boot_disk: Persistent boot disk to attach.
        :type     :class:`StorageVolume` or ``None``

        :keyword  external_ip: The external IP address to use.  If 'ephemeral'
                               (default), a new non-static address will be
                               used.  If 'None', then no external address will
                               be used.  To use an existing static IP address,
                               a GCEAddress object should be passed in. This
                               param will be ignored if also using the
                               ex_nic_gce_struct param.
        :type     external_ip: :class:`GCEAddress` or ``str`` or None

        :keyword  internal_ip: The private IP address to use.
        :type     internal_ip: :class:`GCEAddress` or ``str`` or ``None``

        :keyword  ex_disk_type: Specify a pd-standard (default) disk or pd-ssd
                                for an SSD disk.
        :type     ex_disk_type: ``str`` or :class:`GCEDiskType` or ``None``

        :keyword  ex_disk_auto_delete: Indicate that the boot disk should be
                                       deleted when the Node is deleted. Set to
                                       True by default.
        :type     ex_disk_auto_delete: ``bool``

        :keyword  ex_service_accounts: Specify a list of serviceAccounts when
                                       creating the instance. The format is a
                                       list of dictionaries containing email
                                       and list of scopes, e.g.
                                       [{'email':'default',
                                       'scopes':['compute', ...]}, ...]
                                       Scopes can either be full URLs or short
                                       names. If not provided, use the
                                       'default' service account email and a
                                       scope of 'devstorage.read_only'. Also
                                       accepts the aliases defined in
                                       'gcloud compute'.
        :type     ex_service_accounts: ``list``

        :keyword  description: The description of the node (instance).
        :type     description: ``str`` or ``None``

        :keyword  ex_can_ip_forward: Set to ``True`` to allow this node to
                                  send/receive non-matching src/dst packets.
        :type     ex_can_ip_forward: ``bool`` or ``None``

        :keyword  ex_disks_gce_struct: Support for passing in the GCE-specific
                                       formatted disks[] structure. No attempt
                                       is made to ensure proper formatting of
                                       the disks[] structure. Using this
                                       structure obviates the need of using
                                       other disk params like 'boot_disk',
                                       etc. See the GCE docs for specific
                                       details.
        :type     ex_disks_gce_struct: ``list`` or ``None``

        :keyword  ex_nic_gce_struct: Support passing in the GCE-specific
                                     formatted networkInterfaces[] structure.
                                     No attempt is made to ensure proper
                                     formatting of the networkInterfaces[]
                                     data. Using this structure obviates the
                                     need of using 'external_ip' and
                                     'ex_network'.  See the GCE docs for
                                     details.
        :type     ex_nic_gce_struct: ``list`` or ``None``

        :keyword  ex_on_host_maintenance: Defines whether node should be
                                          terminated or migrated when host
                                          machine goes down. Acceptable values
                                          are: 'MIGRATE' or 'TERMINATE' (If
                                          not supplied, value will be reset to
                                          GCE default value for the instance
                                          type.)
        :type     ex_on_host_maintenance: ``str`` or ``None``

        :keyword  ex_automatic_restart: Defines whether the instance should be
                                        automatically restarted when it is
                                        terminated by Compute Engine. (If not
                                        supplied, value will be set to the GCE
                                        default value for the instance type.)
        :type     ex_automatic_restart: ``bool`` or ``None``

        :keyword  ex_preemptible: Defines whether the instance is preemptible.
                                        (If not supplied, the instance will
                                         not be preemptible)
        :type     ex_preemptible: ``bool`` or ``None``

        :param  ex_subnetwork: The network to associate with the node.
        :type   ex_subnetwork: :class:`GCESubnetwork`

        :keyword  ex_disk_size: Specify the size of boot disk.
                                Integer in gigabytes.
        :type     ex_disk_size: ``int`` or ``None``

        :param  ex_labels: Label dict for node.
        :type   ex_labels: ``dict`` or ``None``

        :param  ex_accelerator_type: The accelerator to associate with the
                                     node.
        :type   ex_accelerator_type: :class:`GCEAcceleratorType` or ``None``

        :param  ex_accelerator_count: The number of accelerators to associate
                                      with the node.
        :type   ex_accelerator_count: ``int`` or ``None``

        :keyword  ex_disk_size: Specify size of the boot disk.
                                Integer in gigabytes.
        :type     ex_disk_size: ``int`` or ``None``

        :return:  A tuple containing a request string and a node_data dict.
        :rtype:   ``tuple`` of ``str`` and ``dict``
        znMissing root device or image. Must specify an 'image', existing 'boot_disk', or use the 'ex_disks_gce_struct'.zPCannot specify both 'boot_disk' and 'ex_disks_gce_struct'. Use one or the other.TN)rr  r'  rù  rs  rt  rS  r  r³  ru  rT  rv  rw  rx  ry  rR  rc  r‹  rÃ   rz  r{  r•  r–  r|  r…  r_   z/zones/%s/instances)r¼   r}  r_   )r@   r_   r|  r'  rA  r  rR  rc  rR  rS  rT  rU  rV  rW  rÃ   rX  rY  rZ  r[  r\  r]  r^  r  r_  r`  ro  r|  rù  rp  rQ   s                                 r*   rg  zGCENodeDriver._create_node_req #  sý   € ðT ð 	˜Yð 	Ð/Bð 	Ýð)ñô ð ð ð 	Ð,ð 	Ýð?ñô ð ð
 ˆØˆàð 	ØˆFà×4Ò4ØØØØØ"Ø0Ø#ØØ$Ø,Ø#Ø0Ø 6Ø2Ø&ØØØØ#Ø0Ø,Ø0Ø2Ø'Ø"ð3 5ñ 
ô 
ˆ	ð6 !ˆ	�&Ñà'¨8¬=Ñ9ˆà˜	Ð!Ð!r,   c                 ó   — d}|d         r4	 |                       |d         |d         ¦  «        }n# t          $ r Y nw xY w|r||d<   dS |                      d|d         |d         |d         |d         ¬¦  «        \  }}}	 | j                             |d	||¬
¦  «        j        }nV# t          $ rI |                      |d         ¬¦  «        }|j        }	|j	        }
d}t          |d         |	|
¦  «        |d<   Y nw xY w||d<   dS )a   Create disk for ex_create_multiple_nodes.

        :param  status: Dictionary for holding node/disk creation status.
                        (This dictionary is modified by this method)
        :type   status: ``dict``

        :param  node_attrs: Dictionary for holding node attribute information.
                            (size, image, location, ex_disk_type, etc.)
        :type   node_attrs: ``dict``
        Nrm  r_   rA  r]  r'  rU  )rA  r'  rU  rq  rr  r¿  r›  rž  )rd  r   rô  r{   rQ   rS   r   r¡  r±  rç   rã   )r@   ru  rÉ  r]  Údisk_reqÚ	disk_dataÚdisk_paramsÚdisk_resr  ræ   rç   s              r*   Ú_multi_create_diskz GCENodeDriver._multi_create_diskþ#  sl  € ð ˆð Ð)Ô*ð 	ðØ×)Ò)¨&°¬.¸*ÀZÔ:PÑQÔQ��øÝ(ð ð ð Ø�ðøøøð ð 	/Ø!ˆF�6‰NˆNˆNð 04×/CÒ/CØØ�v”Ø# JÔ/Ø  Ô)Ø'¨Ô7ð 0Dñ 0ô 0Ñ,ˆH�i ð	LØœ?×2Ò2Ø V°)ÀKð 3ñ ô äð �øõ #ð Lð Lð LØ×%Ò%°J¸Ô4OÐ%ÑPÔP�Øœ�Ø”v�Ø�Ý!.¨v°f¬~¸uÀdÑ!KÔ!K��v‘��ðLøøøð '/ˆF�?Ñ#Ð#Ð#s   Œ"/ ¯
<»<Á?#B# Â#AC6Ã5C6c                 ó�  — d}d}	 | j                              |d         d         ¦  «        j        }n># t          $ r1 |                      |d         ¬¦  «        }|j        }|j        }ddi}Y nw xY w|d         dk    rJd|d<   |rt          |d         ||¦  «        |d	<   dS |                      |d         |d
         ¦  «        |d	<   dS dS )a˜  Check disk status for ex_create_multiple_nodes.

        :param  status: Dictionary for holding node/disk creation status.
                        (This dictionary is modified by this method)
        :type   status: ``dict``

        :param  node_attrs: Dictionary for holding node attribute information.
                            (size, image, location, etc.)
        :type   node_attrs: ``dict``
        Nrž  r�   r¿  r›  ru  rŸ  r_   r]  rA  )	r{   rQ   rS   r   r¡  r±  rç   rã   rd  ©r@   ru  rÉ  ræ   rç   rW   r  s          r*   Ú_multi_check_diskzGCENodeDriver._multi_check_disk*$  sù   € ð ˆØˆð	*Ø”×.Ò.¨v°oÔ/FÀzÔ/RÑSÔSÔZˆHˆHøÝð 	*ð 	*ð 	*Ø×!Ò!°
¸?Ô0KÐ!ÑLÔLˆAØ”GˆEØ”6ˆDØ  &Ð)ˆHˆHˆHð		*øøøð �HÔ Ò'Ð'Ø&*ˆF�?Ñ#àð \Ý!.¨v°f¬~¸uÀdÑ!KÔ!K��v‘��à!%×!3Ò!3°F¸6´NÀJÈzÔDZÑ![Ô![��v‘��ð (Ð'ó   †+2 ²8A-Á,A-c                 óZ  — |                       |d         |d         |d         |d         |d         |d         |d         |d         |d	         |d
         |d         |d         |d         |d         |d         |d         |d         |d         |d         |d         |d         ¬¦  «        \  }}	 | j                             |d|¬¦  «        j        }nV# t          $ rI |                      |d         ¬¦  «        }|j        }|j        }d}t          |d         ||¦  «        |d<   Y nw xY w||d<   dS )a�  Create node for ex_create_multiple_nodes.

        :param  status: Dictionary for holding node creation status.
                        (This dictionary is modified by this method)
        :type   status: ``dict``

        :param  node_attrs: Dictionary for holding node attribute information.
                            (size, image, location, etc.)
        :type   node_attrs: ``dict``
        r_   r|  r'  rA  r  rR  rc  rS  rT  rW  rÃ   rX  rV  rY  rZ  r[  r\  r³  r]  r  ro  )rS  rT  rW  rÃ   rX  rV  rY  rZ  r[  r\  r^  r]  r  ro  rq  rƒ  r¿  r›  Nr˜  rÀ  )	rg  r{   rQ   rS   r   r¡  r±  rç   rð   )	r@   ru  rÉ  rQ   rp  Únode_resr  ræ   rç   s	            r*   rÄ  z GCENodeDriver._multi_create_nodeG$  su  € ð "×2Ò2Ø�6ŒNØ�vÔØ�wÔØ�zÔ"Ø�yÔ!Ø�vÔØ�zÔ"Ø" =Ô1Ø" =Ô1Ø *Ð+@Ô AØ" =Ô1Ø(Ð)<Ô=Ø *Ð+@Ô AØ *Ð+@Ô AØ(Ð)<Ô=Ø#-Ð.FÔ#GØ!+Ð,BÔ!CØ$ \Ô2Ø%Ð&6Ô7Ø  Ô-Ø# NÔ3ð+ 3ñ 
ô 
Ñˆ�ð0	HØ”×.Ò.¨w¸vÈIÐ.ÑVÔVÔ]ˆHˆHøÝð 	Hð 	Hð 	HØ×!Ò!°
¸?Ô0KÐ!ÑLÔLˆAØ”GˆEØ”6ˆDØˆHÝ*¨6°&¬>¸5À$ÑGÔGˆF�6‰NˆNˆNð	Høøøð #+ˆˆÑÐÐs   Â-"C ÃAD#Ä"D#c                 ó�  — d}d}	 | j                              |d         d         ¦  «        j        }n># t          $ r1 |                      |d         ¬¦  «        }|j        }|j        }ddi}Y nw xY w|d         dk    rJd|d<   |rt          |d         ||¦  «        |d	<   dS |                      |d         |d
         ¦  «        |d	<   dS dS )a˜  Check node status for ex_create_multiple_nodes.

        :param  status: Dictionary for holding node/disk creation status.
                        (This dictionary is modified by this method)
        :type   status: ``dict``

        :param  node_attrs: Dictionary for holding node attribute information.
                            (size, image, location, etc.)
        :type   node_attrs: ``dict``
        NrÀ  r�   r¿  r›  ru  rŸ  r_   r˜  rA  )	r{   rQ   rS   r   r¡  r±  rç   rð   rh  r'  s          r*   rÅ  zGCENodeDriver._multi_check_nodew$  sù   € ð ˆØˆð	*Ø”×.Ò.¨v°oÔ/FÀzÔ/RÑSÔSÔZˆHˆHøÝð 	*ð 	*ð 	*Ø×!Ò!°
¸?Ô0KÐ!ÑLÔLˆAØ”GˆEØ”6ˆDØ  &Ð)ˆHˆHˆHð		*øøøð �HÔ Ò'Ð'Ø&*ˆF�?Ñ#àð ZÝ!.¨v°f¬~¸uÀdÑ!KÔ!K��v‘��à!%×!1Ò!1°&¸´.À*ÈZÔBXÑ!YÔ!Y��v‘��ð (Ð'r)  c           	      ó  — i }d}||d<   |rt          |¦  «        |d<   |rGt          |d¦  «        s|                      |¦  «        }d|j        d         i}d|j        d         z  |d<   |rot          |d¦  «        sE|                     d¦  «        r|                      |¦  «        d         }|                      |¦  «        }|j        d         }	|	|d	<   d
|	z  |d<   |p| j        }t          |d¦  «        s|                      |¦  «        }t          |d¦  «        r|j        d         |d<   nU|                     d¦  «        r||d<   n:d|d<   |dxx         d 	                    t          | j        |j        |¦  «        z  cc<   d|j        z  }
|
||fS )aT  
        Assemble the request/data for creating a volume.

        Used by create_volume and ex_create_multiple_nodes

        :param  size: Size of volume to create (in GB). Can be None if image
                      or snapshot is supplied.
        :type   size: ``int`` or ``str`` or ``None``

        :param  name: Name of volume to create
        :type   name: ``str``

        :keyword  location: Location (zone) to create the volume in
        :type     location: ``str`` or :class:`GCEZone` or
                            :class:`NodeLocation` or ``None``

        :keyword  snapshot: Snapshot to create image from
        :type     snapshot: :class:`GCESnapshot` or ``str`` or ``None``

        :keyword  image: Image to create disk from.
        :type     image: :class:`GCENodeImage` or ``str`` or ``None``

        :keyword  ex_disk_type: Specify pd-standard (default) or pd-ssd
        :type     ex_disk_type: ``str`` or :class:`GCEDiskType`

        :return:  Tuple containing the request string, the data dictionary and
                  the URL parameters
        :rtype:   ``tuple``
        Nr_   r\  rM  r�   z	Image: %srÃ   ÚhttpsÚsourceSnapshotzSnapshot: %srn  z#https://www.googleapis.com/compute/z${}/projects/{}/zones/{}/diskTypes/{}r˜  )r�   r²   rÿ  rŒ   r«  r)  rù  rc   rT  r<   r=   rC   r_   )r@   r|  r_   rA  rõ  r'  rU  rö  rI   Úsnapshot_linkrQ   s              r*   rô  zGCENodeDriver._create_vol_req”$  sê  € ðL ˆØˆØ"ˆ�FÑàð 	.Ý$'¨¡I¤IˆK˜Ñ!àð 	QÝ˜5 &Ñ)Ô)ð 1Ø×)Ò)¨%Ñ0Ô0�Ø# U¤[°Ô%<Ð=ˆFØ)4¸¼ÀJÔ8OÑ)PˆK˜Ñ&àð 		JÝ˜8 VÑ,Ô,ð :ð ×&Ò& wÑ/Ô/ð PØ#×=Ò=¸hÑGÔGÈÔO�HØ×/Ò/°Ñ9Ô9�Ø$œN¨:Ô6ˆMØ,9ˆKÐ(Ñ)Ø)7¸=Ñ)IˆK˜Ñ&ØÐ(˜tœyˆå�x Ñ(Ô(ð 	2Ø×'Ò'¨Ñ1Ô1ˆHå�< Ñ(Ô(ð 	à".Ô"4°ZÔ"@ˆK˜ÑÐØ×$Ò$ WÑ-Ô-ð 		Ø".ˆK˜ÑÐà"GˆK˜ÑØ˜ÐÐÔÐ#I×#PÒ#PÝØ”Ø”Øñ	$ô $ñ ÐÐÑð $ x¤}Ñ5ˆà˜ VÐ+Ð+r,   c                 ó¢  — i }|                       |d         ¦  «        }|                     d¦  «        |d<   |                     d¦  «        |d<   |                     d¦  «        |d<   |                     d¦  «        |d<   |                     d¦  «        |d<   d	                     |j        |d
         ¦  «        }t	          ||d
         || |¬¦  «        S )zú
        Return a DiskType object from the JSON-response dictionary.

        :param  disktype: The dictionary describing the disktype.
        :type   disktype: ``dict``

        :return: DiskType object
        :rtype: :class:`GCEDiskType`
        rc   r�   r  rÃ   ÚvalidDiskSizeÚvalid_disk_sizeÚdefaultDiskSizeGbÚdefault_disk_size_gbú{}:{}r_   ©rŠ   r_   rc   rx   rŒ   )rT  rT   r<   r_   rš   )r@   rœ  rŒ   rc   Útype_ids        r*   rœ  zGCENodeDriver._to_disktypeç$  sÎ   € ð ˆà×Ò ¨Ô 0Ñ1Ô1ˆà$ŸLšL¨Ñ4Ô4ˆˆjÑØ%-§\¢\Ð2EÑ%FÔ%FˆÐ!Ñ"Ø'Ÿ|š|¨MÑ:Ô:ˆˆmÑØ#+§<¢<°Ñ#@Ô#@ˆÐÑ Ø(0¯ªÐ5HÑ(IÔ(IˆÐ$Ñ%Ø—.’. ¤¨H°VÔ,<Ñ=Ô=ˆå˜g¨H°VÔ,<À4ÐPTÐ\aÐbÑbÔbÐbr,   c                 ó¢  — i }|                       |d         ¦  «        }|                     d¦  «        |d<   |                     d¦  «        |d<   |                     d¦  «        |d<   |                     d¦  «        |d<   |                     d¦  «        |d<   d                     |j        |d	         ¦  «        }t	          ||d	         || |¬
¦  «        S )aK  
        Return an AcceleratorType object from the JSON-response dictionary.

        :param  accelerator_type: The dictionary describing the
                                  accelerator_type.
        :type   accelerator_type: ``dict``

        :return: AcceleratorType object
        :rtype:  :class:`GCEAcceleratorType`
        rc   r�   r  rÃ   ÚmaximumCardsPerInstancer4  r5  r6  r_   r7  )rT  rT   r<   r_   r¥   )r@   r•  rŒ   rc   r8  s        r*   r»  z"GCENodeDriver._to_accelerator_typeþ$  sæ   € ð ˆà×ÒÐ 0°Ô 8Ñ9Ô9ˆà,×0Ò0°Ñ<Ô<ˆˆjÑØ%5×%9Ò%9Ð:MÑ%NÔ%NˆÐ!Ñ"Ø/×3Ò3°MÑBÔBˆˆmÑØ+;×+?Ò+?Ð@YÑ+ZÔ+ZˆÐ'Ñ(Ø(8×(<Ò(<Ð=PÑ(QÔ(QˆÐ$Ñ%Ø—.’. ¤Ð,<¸VÔ,DÑEÔEˆå!ØØ! &Ô)ØØØð
ñ 
ô 
ð 	
r,   c                 ó¶  — i }d|v r|                       |d         ¦  «        }nd}|                     d¦  «        |d<   |                     d¦  «        |d<   |                     dd¦  «        |d<   |                     dd¦  «        �|                     d¦  «        |d<   |                     d¦  «        |d<   t          |d	         |d
         |d         || |¬¦  «        S )zõ
        Return an Address object from the JSON-response dictionary.

        :param  address: The dictionary describing the address.
        :type   address: ``dict``

        :return: Address object
        :rtype: :class:`GCEAddress`
        r­   r»  r�   ru  rÃ   NÚusersr  rŠ   r_   r¬   )rŠ   r_   r¬   r­   rx   rŒ   )r®  rT   rª   )r@   r¬   rŒ   r­   s       r*   rÀ  zGCENodeDriver._to_address%  sí   € ð ˆà�wÐÐØ×'Ò'¨°Ô(9Ñ:Ô:ˆFˆFàˆFà#ŸKšK¨
Ñ3Ô3ˆˆjÑØ!Ÿ+š+ hÑ/Ô/ˆˆh‰Ø&Ÿ{š{¨=¸$Ñ?Ô?ˆˆmÑà�;Š;�w Ñ%Ô%Ð1Ø$Ÿ[š[¨Ñ1Ô1ˆE�'‰NØ%,§[¢[Ð1DÑ%EÔ%EˆÐ!Ñ"åØ�tŒ}Ø˜”Ø˜IÔ&ØØØð
ñ 
ô 
ð 	
r,   c                 ó,  ‡ — i }dD ]}|                      |¦  «        ||<   Œ|                      dg ¦  «        }ˆ fd„|                      dg ¦  «        D ¦   «         }t          |d         |d         |||d         |d         |d	         |d
         ‰ |¬¦
  «
        S )a   
        Return a Backend Service object from the JSON-response dictionary.

        :param  backendservice: The dictionary describing the backend service.
        :type   backendservice: ``dict``

        :return: BackendService object
        :rtype: :class:`GCEBackendService`
        )r�   r  r�  rÃ   rÕ   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   ©r  rÔ  s     €r*   rŸ  z4GCENodeDriver._to_backendservice.<locals>.<listcomp>S%  s'   ø€ ÐdÐdÐd¸˜×0Ò0°Ñ3Ô3ÐdÐdÐdr,   r¼  rŠ   r_   r×   r¾  rÙ   r¿  )
rŠ   r_   rÕ   rÖ   r×   rØ   rÙ   rÚ   rx   rŒ   )rT   rÓ   )r@   rÞ   rŒ   Ú	extra_keyrÕ   rÖ   s   `     r*   rË  z GCENodeDriver._to_backendservice>%  sË   ø€ ð ˆð
ð 	=ð 	=ˆIð  .×1Ò1°)Ñ<Ô<ˆE�)ÑÐà!×%Ò% j°"Ñ5Ô5ˆØdÐdÐdÐd¸^×=OÒ=OÐP^Ð`bÑ=cÔ=cÐdÑdÔdˆå Ø˜dÔ#Ø Ô'ØØ%Ø Ô'Ø$ ZÔ0Ø# JÔ/Ø" <Ô0ØØð
ñ 
ô 
ð 	
r,   c                 óô  — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   t          |d         |d         |                      d¦  «        |                      d¦  «        |                      d	¦  «        |                      d
¦  «        |                      d¦  «        |                      d¦  «        | |¬¦
  «
        S )a  
        Return a HealthCheck object from the JSON-response dictionary.

        :param  healthcheck: The dictionary describing the healthcheck.
        :type   healthcheck: ``dict``

        :return: HealthCheck object
        :rtype: :class:`GCEHealthCheck`
        r�   r  rÃ   rq   rŠ   r_   rÍ  r×   rÐ  r¿  rÒ  rÓ  )
rŠ   r_   rö   r×   r÷   rÚ   rø   rù   rx   rŒ   )rT   rô   )r@   rü   rŒ   s      r*   rÓ  zGCENodeDriver._to_healthcheckb%  sì   € ð ˆØ'ŸOšO¨JÑ7Ô7ˆˆjÑØ%0§_¢_Ð5HÑ%IÔ%IˆÐ!Ñ"Ø*Ÿš¨}Ñ=Ô=ˆˆmÑØ#Ÿš¨Ñ/Ô/ˆˆf‰åØ˜4Ô Ø˜VÔ$Ø—’ Ñ/Ô/Ø—’ Ñ(Ô(Ø —_’_Ð%7Ñ8Ô8Ø—O’O LÑ1Ô1Ø +§¢Ð0DÑ EÔ EØ)ŸošoÐ.@ÑAÔAØØð
ñ 
ô 
ð 	
r,   c                 ó  — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      |d         ¦  «        d         |d<   |                      |d         ¦  «        }|                      d¦  «        }|                      d¦  «        }|                      d	¦  «        }|                      d
¦  «        }|                      d¦  «        }|                      d¦  «        }	|                      d¦  «        }
|                      d¦  «        }|                      d¦  «        }|                      d¦  «        }t          |d         |d         |||||||	||
||| |¬¦  «        S )zú
        Return a Firewall object from the JSON-response dictionary.

        :param  firewall: The dictionary describing the firewall.
        :type   firewall: ``dict``

        :return: Firewall object
        :rtype: :class:`GCEFirewall`
        r�   r  rÃ   r  r_   rX  r  r  r	  r  rÚ  rÛ  rÜ  rÝ  rÞ  ÚtargetRangesrŠ   )rŠ   r_   r  r  r  r  r
  r	  r  r  r  r  r  rx   rŒ   )rT   r)  rà  r  )r@   r  rŒ   r  r  r  r	  r  r
  r  r  r  r  r  s                 r*   rÛ  zGCENodeDriver._to_firewall%  sƒ  € ð ˆØ$ŸLšL¨Ñ4Ô4ˆˆjÑØ%-§\¢\Ð2EÑ%FÔ%FˆÐ!Ñ"Ø'Ÿ|š|¨MÑ:Ô:ˆˆmÑØ $× >Ò >¸xÈ	Ô?RÑ SÔ SÐTZÔ [ˆˆnÑà×%Ò% e¨NÔ&;Ñ<Ô<ˆà—,’,˜yÑ)Ô)ˆØ—’˜hÑ'Ô'ˆØ—<’< 
Ñ+Ô+ˆØ—L’L Ñ-Ô-ˆ	Ø Ÿš ^Ñ4Ô4ˆØ—l’l <Ñ0Ô0ˆØ"*§,¢,Ð/FÑ"GÔ"GÐØ—l’l <Ñ0Ô0ˆØ"*§,¢,Ð/FÑ"GÔ"GÐØ Ÿš ^Ñ4Ô4ˆåØ˜Œ~Ø˜&Ô!ØØØØ'Ø'ØØ#Ø#Ø$;Ø$;ØØØð
ñ 
ô 
ð 	
r,   c           
      óæ  — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        }|r|                      |¦  «        }|                      |d         ¦  «        }t          |d         |d         ||                      d	¦  «        |                      d
¦  «        || |¬¦  «        S )a  
        Return a Forwarding Rule object from the JSON-response dictionary.

        :param  forwarding_rule: The dictionary describing the rule.
        :type   forwarding_rule: ``dict``

        :return: ForwardingRule object
        :rtype: :class:`GCEForwardingRule`
        r�   ré  r  rÃ   r­   r   rŠ   r_   rè  rç  )rŠ   r_   r­   r¬   rÙ   r  rx   rŒ   )rT   r®  r  r  )r@   r  rŒ   r­   r   s        r*   rç  z!GCENodeDriver._to_forwarding_rule®%  s  € ð ˆØ+×/Ò/°
Ñ;Ô;ˆˆjÑØ,×0Ò0°Ñ=Ô=ˆˆkÑØ%4×%8Ò%8Ð9LÑ%MÔ%MˆÐ!Ñ"Ø.×2Ò2°=ÑAÔAˆˆmÑà ×$Ò$ XÑ.Ô.ˆàð 	0Ø×'Ò'¨Ñ/Ô/ˆFØ×)Ò)¨/¸(Ô*CÑDÔDˆå Ø˜tÔ$Ø  Ô(ØØ#×'Ò'¨Ñ4Ô4Ø$×(Ò(¨Ñ6Ô6ØØØð	
ñ 	
ô 	
ð 		
r,   c                 ó†   — i }d|v r|d         |d<   |d         |d<   t          |d         |d         |d         | |¬¦  «        S )a  
        Return the SslCertificate object from the JSON-response.

        :param  sslcertificate:  Dictionary describing SslCertificate
        :type   sslcertificate: ``dict``

        :return:  Return SslCertificate object.
        :rtype: :class:`GCESslCertificate`
        rÃ   r�   rŠ   r_   r5  )rŠ   r_   r5  rx   rŒ   )r3  )r@   r:  rŒ   s      r*   r  z GCENodeDriver._to_sslcertificateÏ%  sg   € ð ˆà˜NÐ*Ð*Ø#1°-Ô#@ˆE�-Ñ Ø*¨:Ô6ˆˆjÑå Ø˜dÔ#Ø Ô'Ø& }Ô5ØØð
ñ 
ô 
ð 	
r,   c           	      óÀ  — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d	¦  «        |d	<   |                      |                      d¦  «        ¦  «        }|                      |                      d¦  «        ¦  «        }t          |d
         |d         |                      d¦  «        ||| |¬¦  «        S )a  
        Return a Subnetwork object from the JSON-response dictionary.

        :param  subnetwork: The dictionary describing the subnetwork.
        :type   subnetwork: ``dict``

        :return: Subnetwork object
        :rtype: :class:`GCESubnetwork`
        r  rÃ   ÚgatewayAddressr+  r  r­   r�   r,  r-  rŠ   r_   )rŠ   r_   r@  r  r­   rx   rŒ   )rT   r  r>  )r@   r³  rŒ   r  r­   s        r*   r  zGCENodeDriver._to_subnetworkç%  sV  € ð ˆà%/§^¢^Ð4GÑ%HÔ%HˆÐ!Ñ"Ø)Ÿ~š~¨mÑ<Ô<ˆˆmÑØ",§.¢.Ð1AÑ"BÔ"BˆÐÑØ)Ÿ~š~¨mÑ<Ô<ˆˆmÑØ%Ÿ>š>¨)Ñ4Ô4ˆˆiÑØ$Ÿ.š.¨Ñ2Ô2ˆˆh‰Ø&ŸNšN¨:Ñ6Ô6ˆˆjÑØ)3¯ªÐ8OÑ)PÔ)PˆÐ%Ñ&Ø%/§^¢^Ð4GÑ%HÔ%HˆÐ!Ñ"Ø×*Ò*¨:¯>ª>¸)Ñ+DÔ+DÑEÔEˆØ×)Ò)¨*¯.ª.¸Ñ*BÔ*BÑCÔCˆåØ˜$ÔØ˜FÔ#Ø—’ Ñ.Ô.ØØØØð
ñ 
ô 
ð 	
r,   c                 ó&  — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   d|v r|d         rd	|d
<   nd|d
<   nd|d
<   t          |d         |d         |                      d¦  «        | |¬¦  «        S )zô
        Return a Network object from the JSON-response dictionary.

        :param  network: The dictionary describing the network.
        :type   network: ``dict``

        :return: Network object
        :rtype: :class:`GCENetwork`
        r�   rÃ   r  ÚgatewayIPv4r;  r<  rI  r?  r9  rH  r:  rG  rŠ   r_   )rŠ   r_   r@  rx   rŒ   )rT   rE  )r@   r  rŒ   s      r*   r  zGCENodeDriver._to_network	&  s1  € ð ˆà#ŸKšK¨
Ñ3Ô3ˆˆjÑØ&Ÿ{š{¨=Ñ9Ô9ˆˆmÑØ%,§[¢[Ð1DÑ%EÔ%EˆÐ!Ñ"à&Ÿ{š{¨=Ñ9Ô9ˆˆmÑØ$Ÿ[š[¨Ñ5Ô5ˆˆkÑà)0¯ªÐ5LÑ)MÔ)MˆÐ%Ñ&Ø&Ÿ{š{¨=Ñ9Ô9ˆˆmÑØ!(§¢¨_Ñ!=Ô!=ˆˆoÑð # gÐ-Ð-ØÐ.Ô/ð )Ø &��f‘�à (��f‘�à$ˆE�&‰MåØ�tŒ}Ø˜”Ø—’˜[Ñ)Ô)ØØð
ñ 
ô 
ð 	
r,   c           
      ó  — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        }|                      d¦  «        }d|v r|d         |d<   d|v r|d         |d<   d|v r|d         |d<   d	|v r|d	         |d	<   d
|v r|d
         |d
<   t          |d         |d         |                      d¦  «        |||                      d¦  «        | |¬¦  «        S )zè
        Return a Route object from the JSON-response dictionary.

        :param  route: The dictionary describing the route.
        :type   route: ``dict``

        :return: Route object
        :rtype: :class:`GCERoute`
        r�   rÃ   r  r  r	  r   r  ÚnextHopNetworkr  ÚwarningsrŠ   r_   r  rR  )rŠ   r_   rQ  r	  r  rR  rx   rŒ   )rT   rN  )r@   rT  rŒ   r  r	  s        r*   r	  zGCENodeDriver._to_route2&  sF  € ð ˆà!ŸIšI jÑ1Ô1ˆˆjÑØ$Ÿyšy¨Ñ7Ô7ˆˆmÑØ%*§Y¢YÐ/BÑ%CÔ%CˆÐ!Ñ"Ø—)’)˜IÑ&Ô&ˆØ—9’9˜ZÑ(Ô(ˆà Ð%Ð%Ø',Ð->Ô'?ˆEÐ#Ñ$à˜%ÐÐØ!& {Ô!3ˆE�+Ñà˜uÐ$Ð$Ø&+Ð,<Ô&=ˆEÐ"Ñ#à˜uÐ$Ð$Ø&+Ð,<Ô&=ˆEÐ"Ñ#à˜ÐÐØ % jÔ 1ˆE�*ÑåØ�TŒ{Ø�v”Ø—y’y Ñ-Ô-ØØØ—’˜6Ñ"Ô"ØØð	
ñ 	
ô 	
ð 		
r,   c                 óÒ  — i }d|v r|                      dd¦  «        |d<   |                      dd¦  «        |d<   |                      dd¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   d|v r|                      dd¦  «        |d<   |                      dd¦  «        |d<   |                      d	d¦  «        |d	<   |                      d
d¦  «        |d
<   |                      dd¦  «        |d<   |                      dd¦  «        |d<   d|v r|                      dg ¦  «        |d<   d|v r|                      dd¦  «        |d<   d|v r|                      dd¦  «        |d<   d|v r!|                      |d         ¬¦  «        }||d<   |                      dd¦  «        |d<   |                      dd¦  «        |d<   t          |d         |d         | |¬¦  «        S )zí
        Return an Image object from the JSON-response dictionary.

        :param  image: The dictionary describing the image.
        :type   image: ``dict``

        :return: Image object
        :rtype: :class:`GCENodeImage`
        ÚpreferredKernelNrÃ   rõ  r  r�   r.  r  rû  ru  ÚarchiveSizeBytesrK  rý  rö  ÚsourceDiskIdrü  ©rü  r‹  r‰  rŠ   r_   ©rŠ   r_   rx   rŒ   )rT   Ú_licenses_from_urlsr"  )r@   r'  rŒ   Úlic_objss       r*   rû  zGCENodeDriver._to_node_image^&  s  € ð ˆà Ð%Ð%Ø',§y¢yÐ1BÀDÑ'IÔ'IˆEÐ#Ñ$Ø$Ÿyšy¨¸Ñ=Ô=ˆˆmÑØŸ)š) H¨dÑ3Ô3ˆˆh‰Ø%*§Y¢YÐ/BÑ%CÔ%CˆÐ!Ñ"Ø!ŸIšI jÑ1Ô1ˆˆjÑà˜5Ð Ð Ø"'§)¢)¨L¸$Ñ"?Ô"?ˆE�,ÑØ#Ÿiši¨°dÑ;Ô;ˆˆlÑØ Ÿ9š9 Y°Ñ5Ô5ˆˆiÑØŸ)š) H¨dÑ3Ô3ˆˆh‰Ø$)§I¢IÐ.@À$Ñ$GÔ$GˆÐ Ñ!Ø#Ÿiši¨°dÑ;Ô;ˆˆlÑà Ð%Ð%Ø',§y¢yÐ1BÀBÑ'GÔ'GˆEÐ#Ñ$à˜5Ð Ð Ø"'§)¢)¨L¸$Ñ"?Ô"?ˆE�,Ñà˜UÐ"Ð"Ø$)§I¢I¨n¸dÑ$CÔ$CˆE�.Ñ!à˜ÐÐØ×/Ò/¸¸zÔ9JÐ/ÑKÔKˆHØ (ˆE�*ÑØŸ)š) H¨dÑ3Ô3ˆˆh‰Ø$)§I¢IÐ.@À$Ñ$GÔ$GˆÐ Ñ!å˜u Tœ{°°v´ÀtÐSXÐYÑYÔYÐYr,   c                 ó~   — t          |d         |d         |d                              d¦  «        d         | ¬¦  «        S )zû
        Return a Location object from the JSON-response dictionary.

        :param  location: The dictionary describing the location.
        :type   location: ``dict``

        :return: Location object
        :rtype: :class:`NodeLocation`
        rŠ   r_   r  r   )rŠ   r_   r  rx   )r   r  )r@   rA  s     r*   r  zGCENodeDriver._to_node_locationŠ&  sH   € õ Ø˜Œ~Ø˜&Ô!Ø˜VÔ$×*Ò*¨3Ñ/Ô/°Ô2Øð	
ñ 
ô 
ð 	
r,   c                 óÐ  — g }g }i }|                      dd¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      |d         ¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d	¦  «        |d	<   |                      d
g ¦  «        |d
<   |                      d¦  «        |d<   |d         |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |d         |d<   |                      di ¦  «        |d<   |d         d         |d<   |                      di ¦  «        |d<   |                      dd¦  «        rdnd|d<   |                      d¦  «        |d<   |                      dg ¦  «        |d<   |                      di ¦  «        |d<   d|d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |d
         D ]r}|                      d¦  «        r[|                      d ¦  «        d!k    rB|                      |d"         ¦  «        }|                      |d         |d         |¬#¦  «        |d<   Œsd$|d         v r|d         d$         }ng }||d<   |                      dg ¦  «        D ]k}	|                     |	                      d%¦  «        ¦  «         |	                      d&g ¦  «        D ]*}
|                     |
                      d'¦  «        ¦  «         Œ+Œld}|d         r"|                      |d         ¦  «        d         }ns|d         rft          |d         d(¦  «        rPd)|d         j        v rA|d         j        d)         �.|d         j        d)         }|                      |¦  «        d         }||d<   |                      |d         ¦  «        d         }| j                              |d         t          j	        ¦  «        }t          |d         |d         |||| |||¬*¦	  «	        S )+a`  
        Return a Node object from the JSON-response dictionary.

        :param    node: The dictionary describing the node.
        :type     node: ``dict``

        :keyword  use_disk_cache: If true, ex_get_volume call will use cache.
        :type     use_disk_cache: ``bool``

        :return:  Node object
        :rtype:   :class:`Node`
        ru  r­  ÚstatusMessagerÃ   rc   r'  r¬  ÚcpuPlatformÚminCpuPlatformrœ  r†  rŠ   r�   r�   r  r_   rc  rR  r�  rD  r‡  r.  NTFrŠ  rˆ  rR  r‹  r‰  rO  rn  rH  rù  )rè  rO   r¦  r¥  ro  rŒ   rM  )	rŠ   r_   r-  Ú
public_ipsÚprivate_ipsrx   r|  r'  rŒ   )rT   rT  r)  rd  r`   r²   rŒ   ÚNODE_STATE_MAPr   r­  r   )r@   r˜  r&  rZ  r[  rŒ   r]  ÚbdrR  Únetwork_interfaceÚaccess_configr'  Ú	src_imager|  r-  s                  r*   r*  zGCENodeDriver._to_nodeœ&  s¡  € ð ˆ
ØˆØˆàŸ(š( 8¨YÑ7Ô7ˆˆh‰Ø!%§¢¨/Ñ!:Ô!:ˆˆoÑØ#Ÿxšx¨Ñ6Ô6ˆˆmÑØ×(Ò(¨¨f¬Ñ6Ô6ˆˆf‰ØŸš 'Ñ*Ô*ˆˆg‰Ø#Ÿxšx¨Ñ6Ô6ˆˆmÑØ#Ÿxšx¨Ñ6Ô6ˆˆmÑØ"&§(¢(Ð+;Ñ"<Ô"<ˆÐÑØŸš '¨2Ñ.Ô.ˆˆg‰Ø%)§X¢XÐ.AÑ%BÔ%BˆÐ!Ñ"Ø˜4”jˆˆd‰Ø ŸHšH ZÑ0Ô0ˆˆjÑØŸš Ñ(Ô(ˆˆf‰Ø%)§X¢XÐ.AÑ%BÔ%BˆÐ!Ñ"Ø˜Vœˆˆf‰Ø ŸHšH Z°Ñ4Ô4ˆˆjÑØ$(¨¤L°Ô$?ˆÐ Ñ!Ø"Ÿhšh |°RÑ8Ô8ˆˆlÑØ&*§h¢h¨|¸TÑ&BÔ&BÐM˜d˜dÈˆˆlÑØ $§¢¨Ñ 8Ô 8ˆˆnÑØ#'§8¢8Ð,=¸rÑ#BÔ#BˆÐÑ Ø"Ÿhšh |°RÑ8Ô8ˆˆlÑØ!ˆˆkÑØŸ(š( 8Ñ,Ô,ˆˆh‰Ø$(§H¢HÐ-?Ñ$@Ô$@ˆÐ Ñ!à˜'”Nð 	ð 	ˆDØ�xŠx˜ÑÔð  D§H¢H¨VÑ$4Ô$4¸Ò$DÐ$DØ×3Ò3°D¸´NÑCÔC�Ø%)×%7Ò%7Ø�v”J  6¤
°nð &8ñ &ô &��kÑ"øð �d˜6”lÐ"Ð"Ø˜”< Ô(ˆDˆDàˆDØˆˆf‰à!%§¢Ð*=¸rÑ!BÔ!Bð 	>ð 	>ÐØ×ÒÐ0×4Ò4°[ÑAÔAÑBÔBÐBà!2×!6Ò!6°ÈÑ!KÔ!Kð >ð >�Ø×!Ò! -×"3Ò"3°GÑ"<Ô"<Ñ=Ô=Ð=Ð=ð>ð
 ˆà�Œ>ð 	#Ø×2Ò2°5¸´>ÑBÔBÀ6ÔJˆEˆEð �kÔ"ðJå˜E +Ô.°Ñ8Ô8ðJð " U¨;Ô%7Ô%=Ð=Ð=Ø˜+Ô&Ô,¨]Ô;ÐGà! +Ô.Ô4°]ÔC�	Ø×6Ò6°yÑAÔAÀ&ÔI�Ø"ˆE�'‰NØ×-Ò-¨d°=Ô.AÑBÔBÀ6ÔJˆàÔ#×'Ò'¨¨X¬½	Ô8IÑJÔJˆåØ�DŒzØ�f”ØØ!Ø#ØØØØð

ñ 

ô 

ð 
	
r,   c           
      ó®  — i }|                      d¦  «        |d<   |                      |d         ¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      dg ¦  «        |d<   	 |d         dd	…         }|d         j        }d
                     |                     d
¦  «        dd	…         ¦  «        }t          |                      dd¦  «        ¦  «        dz  }t          |d         ¦  «        }||         d         d         |         d         }||         d         d         |         d         }	||z  ||	z  z   }
n# t          $ r d}
Y nt          $ r d}
Y nw xY wt          |d         |d         |                      d¦  «        |                      d¦  «        d|
| |¬¦  «        S )zù
        Return a Size object from the JSON-response dictionary.

        :param  machine_type: The dictionary describing the machine.
        :type   machine_type: ``dict``

        :return: Size object
        :rtype: :class:`GCENodeSize`
        r�   rc   rÃ   Ú	guestCpusr  Úacceleratorsr_   NrÑ  r  ÚmemoryMbr   i   ÚcpuÚ	on_demandr_  r\  rŠ   ÚimageSpaceGb)rŠ   r_   r\  r]  r^  r_  rx   rŒ   )	rT   rT  r_   rÃ  r  ÚfloatÚKeyErrorræ  rZ  )r@   r~  r>  rŒ   Ú	size_namerA  Úmachine_ramÚmachine_cpusÚ	cpu_priceÚ	ram_pricer_  s              r*   r;  zGCENodeDriver._to_node_sizeú&  s	  € ð ˆØ(×,Ò,¨ZÑ8Ô8ˆˆjÑØ×(Ò(¨°fÔ)=Ñ>Ô>ˆˆf‰Ø+×/Ò/°Ñ>Ô>ˆˆmÑØ)×-Ò-¨kÑ:Ô:ˆˆkÑØ%1×%5Ò%5Ð6IÑ%JÔ%JˆÐ!Ñ"Ø ,× 0Ò 0°ÀÑ DÔ DˆˆnÑð	Ø$ VÔ,¨R¨a¨RÔ0ˆIØ˜V”}Ô)ˆHØ—x’x §¢¨sÑ 3Ô 3°B°Q°BÔ 7Ñ8Ô8ˆHÝ × 0Ò 0°¸QÑ ?Ô ?Ñ@Ô@À4ÑGˆKÝ   {Ô!3Ñ4Ô4ˆLØ'¨	Ô2°5Ô9¸+ÔFÀxÔPÐQXÔYˆIØ'¨	Ô2°5Ô9¸+ÔFÀxÔPÐQXÔYˆIØ  9Ñ,¨{¸YÑ/FÑFˆEˆEøÝð 	ð 	ð 	ØˆEˆEˆEÝð 	ð 	ð 	ØˆEˆEˆEð	øøøõ Ø˜DÔ!Ø˜fÔ%Ø× Ò  Ñ,Ô,Ø×!Ò! .Ñ1Ô1ØØØØð	
ñ 	
ô 	
ð 		
s   ÂCE/ Å/FÅ=FÆ
Fc                 óp  — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |d                               d¦  «        }d|v r|d         |d<   d|v r|d         |d<   t          |d         |d         ||                      d	¦  «        | |¬
¦  «        S )zô
        Return a Project object from the JSON-response dictionary.

        :param  project: The dictionary describing the project.
        :type   project: ``dict``

        :return: Project object
        :rtype: :class:`GCEProject`
        r�   r  rÃ   r®  rO   ÚusageExportLocationrŠ   r_   rd  )rŠ   r_   rc  rd  rx   rŒ   )rT   ra  )r@   rC   rŒ   rc  s       r*   râ  zGCENodeDriver._to_project$'  sÛ   € ð ˆØ#ŸKšK¨
Ñ3Ô3ˆˆjÑØ%,§[¢[Ð1DÑ%EÔ%EˆÐ!Ñ"Ø&Ÿ{š{¨=Ñ9Ô9ˆˆmÑØÐ3Ô4×8Ò8¸ÑAÔAˆà# wÐ.Ð.à.5Ð6NÔ.OˆEÐ*Ñ+à  GÐ+Ð+Ø+2Ð3HÔ+IˆEÐ'Ñ(åØ�tŒ}Ø˜”ØØ—;’;˜xÑ(Ô(ØØð
ñ 
ô 
ð 	
r,   c           
      ó´  ‡ — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        }ˆ fd„|                      dg ¦  «        D ¦   «         }d„ |D ¦   «         }|                      d¦  «        }t          |d	         |d
         |                      d¦  «        |||‰ |¬¦  «        S )zî
        Return a Region object from the JSON-response dictionary.

        :param  region: The dictionary describing the region.
        :type   region: ``dict``

        :return: Region object
        :rtype: :class:`GCERegion`
        r�   r  rÃ   rd  c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   )rT  r£  s     €r*   rŸ  z,GCENodeDriver._to_region.<locals>.<listcomp>T'  s'   ø€ ÐFÐFÐF¨�×!Ò! !Ñ$Ô$ÐFÐFÐFr,   rv  c                 ó   — g | ]}|®|‘ŒS ro   r2   r  s     r*   rŸ  z,GCENodeDriver._to_region.<locals>.<listcomp>W'  s   € Ð3Ð3Ð3�q Q ]� ] ] ]r,   r.  rŠ   r_   ru  )rŠ   r_   ru  rv  rd  r.  rx   rŒ   )rT   rs  )r@   r­   rŒ   rd  rv  r.  s   `     r*   r1  zGCENodeDriver._to_regionD'  sï   ø€ ð ˆØ"ŸJšJ zÑ2Ô2ˆˆjÑØ%+§Z¢ZÐ0CÑ%DÔ%DˆÐ!Ñ"Ø%Ÿzšz¨-Ñ8Ô8ˆˆmÑà—’˜HÑ%Ô%ˆØFÐFÐFÐF¨f¯jªj¸À"Ñ.EÔ.EÐFÑFÔFˆð 4Ð3˜EÐ3Ñ3Ô3ˆØ—Z’Z Ñ-Ô-ˆ
åØ�dŒ|Ø˜”Ø—:’:˜hÑ'Ô'ØØØ!ØØð	
ñ 	
ô 	
ð 		
r,   c           	      ó:  — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   d|v r|d         |d<   d|v r|d         |d<   d|v r|d         |d<   d|v r|d         |d<   d|v r!|                      |d         ¬	¦  «        }||d<   	 t          |                      d¦  «        ¦  «        }n# t          $ r d
}Y nw xY wt	          |d         |d         |d         |                      d¦  «        | ||¬¦  «        S )zÿ
        Return a Snapshot object from the JSON-response dictionary.

        :param  snapshot: The dictionary describing the snapshot
        :type   snapshot: ``dict``

        :return:  Snapshot object
        :rtype:   :class:`VolumeSnapshot`
        r�   r  rö  rÃ   rP  ÚstorageBytesÚstorageBytesStatusrü  rQ  NrŠ   r_   rK  ru  )rŠ   r_   r|  ru  rx   rŒ   r}  )rT   rS  r   r¼   rz  )r@   rõ  rŒ   rT  r}  s        r*   rF  zGCENodeDriver._to_snapshote'  st  € ð ˆØ$ŸLšL¨Ñ4Ô4ˆˆjÑØ%-§\¢\Ð2EÑ%FÔ%FˆÐ!Ñ"Ø&Ÿlšl¨<Ñ8Ô8ˆˆlÑà˜HÐ$Ð$Ø#+¨MÔ#:ˆE�-Ñ à˜XÐ%Ð%Ø$,¨^Ô$<ˆE�.Ñ!à˜XÐ%Ð%Ø$,¨^Ô$<ˆE�.Ñ!à 8Ð+Ð+Ø*2Ð3GÔ*HˆEÐ&Ñ'à˜Ð!Ð!Ø×/Ò/¸À*Ô9MÐ/ÑNÔNˆHØ (ˆE�*Ñð	Ý  §¢Ð.AÑ!BÔ!BÑCÔCˆGˆGøÝð 	ð 	ð 	ØˆGˆGˆGð	øøøõ Ø˜Œ~Ø˜&Ô!Ø˜,Ô'Ø—<’< Ñ)Ô)ØØØð
ñ 
ô 
ð 	
s   Â-"C ÃCÃCc                 ó€  — i }|                      d¦  «        |d<   |                      |d         ¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d	¦  «        |d	<   |                      d
¦  «        |d
<   |                      di ¦  «        |d<   |                      d¦  «        |d<   |                      dg ¦  «        |d<   d|v r!|                      |d         ¬¦  «        }||d<   |                      dd¦  «                             d¦  «        d         |d<   t	          |d         |d         |d         | |¬¦  «        S )zò
        Return a Volume object from the JSON-response dictionary.

        :param  volume: The dictionary describing the volume.
        :type   volume: ``dict``

        :return: Volume object
        :rtype: :class:`StorageVolume`
        r�   rc   ru  r  rÃ   rM  ÚsourceImageIdr/  ÚsourceSnapshotIdÚoptionsr‹  r‰  r<  rü  rQ  rn  rE  rÌ  r.  rŠ   r_   r\  )rŠ   r_   r|  rx   rŒ   )rT   rT  rS  r  r   )r@   r�  rŒ   rT  s       r*   r›  z GCENodeDriver._to_storage_volume“'  sÂ  € ð ˆØ"ŸJšJ zÑ2Ô2ˆˆjÑØ×(Ò(¨°¬Ñ8Ô8ˆˆf‰Ø Ÿ*š* XÑ.Ô.ˆˆh‰Ø%+§Z¢ZÐ0CÑ%DÔ%DˆÐ!Ñ"Ø%Ÿzšz¨-Ñ8Ô8ˆˆmÑØ%Ÿzšz¨-Ñ8Ô8ˆˆmÑØ!'§¢¨OÑ!<Ô!<ˆˆoÑØ"(§*¢*Ð-=Ñ">Ô">ˆÐÑØ$*§J¢JÐ/AÑ$BÔ$BˆÐ Ñ!Ø!Ÿ:š: iÑ0Ô0ˆˆiÑØ Ÿ*š* X¨rÑ2Ô2ˆˆh‰Ø$*§J¢JÐ/AÑ$BÔ$BˆÐ Ñ!ØŸš G¨RÑ0Ô0ˆˆg‰à˜ÐÐØ×/Ò/¸À
Ô9KÐ/ÑLÔLˆHØ (ˆE�*ÑàŸ
š
 6¨=Ñ9Ô9×?Ò?ÀÑDÔDÀRÔHˆˆf‰åØ�dŒ|Ø˜”Ø˜Ô!ØØð
ñ 
ô 
ð 	
r,   c                 ó°   ‡— ˆfd„dD ¦   «         }|                       ‰                     d¦  «        ¦  «        }t          ‰d         ‰d         || |¬¦  «        S )a  
        Return a Target HTTP Proxy object from the JSON-response dictionary.

        :param  targethttpproxy: The dictionary describing the proxy.
        :type   targethttpproxy: ``dict``

        :return: Target HTTP Proxy object
        :rtype:  :class:`GCETargetHttpProxy`
        c                 ó<   •— i | ]}|‰                      |¦  «        “ŒS r2   r$  )r\  rl   r„  s     €r*   r]  z5GCENodeDriver._to_targethttpproxy.<locals>.<dictcomp>Ä'  s6   ø€ ð 
ð 
ð 
Ø*+ˆAˆ×"Ò" 1Ñ%Ô%ð
ð 
ð 
r,   )r  rÃ   r�   rÏ  rŠ   r_   )rŠ   r_   r�  rx   rŒ   )r  rT   r  )r@   r„  rŒ   r�  s    `  r*   rL  z!GCENodeDriver._to_targethttpproxyº'  s~   ø€ ð
ð 
ð 
ð 
Ø/_ð
ñ 
ô 
ˆð ×)Ò)¨/×*=Ò*=¸hÑ*GÔ*GÑHÔHˆå!Ø˜tÔ$Ø  Ô(ØØØð
ñ 
ô 
ð 	
r,   c                 ó.  ‡ — i }d|v r|d         |d<   |d         |d<   ˆ fd„|                      dg ¦  «        D ¦   «         }‰                      |d         ¦  «        d         }‰                      |¦  «        }t          |d         |d         ||‰ |¬¦  «        S )	a"  
        Return the TargetHttpsProxy object from the JSON-response.

        :param  targethttpsproxy:  Dictionary describing TargetHttpsProxy
        :type   targethttpsproxy: ``dict``

        :return:  Return TargetHttpsProxy object.
        :rtype: :class:`GCETargetHttpsProxy`
        rÃ   r�   c                 ó:   •— g | ]}‰                      |¦  «        ‘ŒS r2   r?  rU  s     €r*   rŸ  z6GCENodeDriver._to_targethttpsproxy.<locals>.<listcomp>â'  s4   ø€ ð 
ð 
ð 
Ø,-ˆD×$Ò$ QÑ'Ô'ð
ð 
ð 
r,   r×  rÏ  r_   rŠ   )rŠ   r_   r‰  r�  rx   rŒ   )rT   r)  rÐ  r‡  )r@   rŒ  rŒ   r‰  Úobj_namer�  s   `     r*   rT  z"GCENodeDriver._to_targethttpsproxyÒ'  sÔ   ø€ ð ˆàÐ,Ð,Ð,Ø#3°MÔ#BˆE�-Ñ Ø,¨ZÔ8ˆˆjÑð
ð 
ð 
ð 
Ø1A×1EÒ1EÐFWÐY[Ñ1\Ô1\ð
ñ 
ô 
ˆð ×1Ò1Ð2BÀ8Ô2LÑMÔMÈfÔUˆØ×#Ò# HÑ-Ô-ˆå"Ø Ô%Ø! &Ô)Ø+ØØØð
ñ 
ô 
ð 	
r,   c                 ó¼  — d}i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      |d         ¦  «        }d|v rQ|d                              d¦  «        d         }	 |                      ||¦  «        }n# t          $ r |d         }Y nw xY wt          |d	         |d
         ||| |¬¦  «        S )a"  
        Return a Target Instance object from the JSON-response dictionary.

        :param  targetinstance: The dictionary describing the target instance.
        :type   targetinstance: ``dict``

        :return: Target Instance object
        :rtype:  :class:`GCETargetInstance`
        Nr�   rÃ   rÜ  rc   r.  rÌ  r.  rŠ   r_   )rŠ   r_   rc   r˜  rx   rŒ   )rT   rT  r  rh  r   r–  )r@   rš  r˜  rŒ   rc   ry  s         r*   r]  z GCENodeDriver._to_targetinstanceñ'  s  € ð ˆØˆØ*×.Ò.¨zÑ:Ô:ˆˆjÑØ-×1Ò1°-Ñ@Ô@ˆˆmÑØ+×/Ò/°Ñ<Ô<ˆˆkÑØ×Ò ¨vÔ 6Ñ7Ô7ˆà˜Ð'Ð'Ø& zÔ2×8Ò8¸Ñ=Ô=¸bÔAˆIð2Ø×'Ò'¨	°4Ñ8Ô8��øÝ(ð 2ð 2ð 2Ø% jÔ1���ð2øøøõ !Ø˜dÔ#Ø Ô'ØØØØð
ñ 
ô 
ð 	
s   ÂB% Â%B:Â9B:c           	      óò  ‡ — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   ‰                      |d         ¦  «        }ˆ fd„|                      dg ¦  «        D ¦   «         }g }|                      dg ¦  «        D ]b}‰                      |¦  «        }	 ‰                      |d         |d	         ¦  «        }n# t          $ r |}Y nw xY w|                     |¦  «         Œcd
|v r|d
         |d
<   d|v r@|d                              d¦  «        }	‰                      |	d         |	d         ¦  «        |d<   t          |d         |d         |||‰ |¬¦  «        S )a  
        Return a Target Pool object from the JSON-response dictionary.

        :param  targetpool: The dictionary describing the volume.
        :type   targetpool: ``dict``

        :return: Target Pool object
        :rtype:  :class:`GCETargetPool`
        r�   rÃ   ré  r­   c                 ól   •— g | ]0}‰                      |                     d ¦  «        d         ¦  «        ‘Œ1S )rÌ  r.  )rÁ  r  rÔ  s     €r*   rŸ  z0GCENodeDriver._to_targetpool.<locals>.<listcomp>!(  sC   ø€ ð 
ð 
ð 
Ø:;ˆD×#Ò# A§G¢G¨C¡L¤L°Ô$4Ñ5Ô5ð
ð 
ð 
r,   r¼  r!  r_   rc   râ  rã  rÌ  é
   é   rŠ   )rŠ   r_   r­   rÖ   rì  rx   rŒ   )	rT   r®  r)  rh  r   r`   r  rí  rê  )
r@   r  rŒ   r­   Úhealthcheck_listr½  r  Úcompr˜  Útp_splits
   `         r*   ri  zGCENodeDriver._to_targetpool(  sÌ  ø€ ð ˆØ&ŸNšN¨:Ñ6Ô6ˆˆjÑØ)Ÿ~š~¨mÑ<Ô<ˆˆmÑØ#-§>¢>Ð2CÑ#DÔ#DˆÐÑ Ø×#Ò# J¨xÔ$8Ñ9Ô9ˆð
ð 
ð 
ð 
Ø?I¿~º~ÈnÐ^`Ñ?aÔ?að
ñ 
ô 
Ðð ˆ	à—’ ¨RÑ0Ô0ð 		#ð 		#ˆAð ×1Ò1°!Ñ4Ô4ˆDðØ×'Ò'¨¨V¬°d¸6´lÑCÔC��øÝ(ð ð ð Ø���ðøøøà×Ò˜TÑ"Ô"Ð"Ð"à˜jÐ(Ð(Ø%/°Ô%@ˆE�/Ñ"à˜:Ð%Ð%Ø! ,Ô/×5Ò5°cÑ:Ô:ˆHØ"&×"8Ò"8¸À"¼ÀxÐPQÄ{Ñ"SÔ"SˆE�,ÑåØ˜$ÔØ˜FÔ#ØØ)ØØØð
ñ 
ô 
ð 	
s   Â9"CÃC+Ã*C+c                 ó.  — i }|                      dd¦  «        |d<   |d         |d<   |                      dg ¦  «        |d<   |                      dd¦  «        |d<   |                      dd¦  «        }|r|                      |¦  «        }|                      dd¦  «        }|r|                      |¦  «        }|                      dd¦  «        }|r|                      |¦  «        }t	          |d	         |d
         ||||                      dg ¦  «        | |¬¦  «        S )a  
        Return the InstanceGroup object from the JSON-response.

        :param  instancegroup:  Dictionary describing InstanceGroup
        :type   instancegroup: ``dict``

        :return: InstanceGroup object.
        :rtype: :class:`GCEInstanceGroup`
        rÃ   Nr�   r  r�  rc   r  r³  rŠ   r_   )rŠ   r_   rc   r  r³  r´  rx   rŒ   )rT   rT  rà  r¯  r¹   )r@   r¸  rŒ   rc   r  r³  s         r*   ry  zGCENodeDriver._to_instancegroupB(  sC  € ð ˆØ,×0Ò0°ÀÑEÔEˆˆmÑØ)¨*Ô5ˆˆjÑØ+×/Ò/°¸bÑAÔAˆˆlÑØ,×0Ò0°ÀÑEÔEˆˆmÑà× Ò  ¨Ñ.Ô.ˆàð 	*ð ×#Ò# DÑ)Ô)ˆDð  ×#Ò# I¨tÑ4Ô4ˆàð 	3Ø×)Ò)¨'Ñ2Ô2ˆGà"×&Ò& |°TÑ:Ô:ˆ
àð 	<Ø×/Ò/°
Ñ;Ô;ˆJåØ˜TÔ"Ø˜vÔ&ØØØ!Ø%×)Ò)¨,¸Ñ;Ô;ØØð	
ñ 	
ô 	
ð 		
r,   c           
      óŒ  — |                       |d         ¦  «        }i }|                     d¦  «        |d<   |                     d¦  «        |d<   |                     d¦  «        |d<   |                     d¦  «        |d<   |                     dg ¦  «        |d<   |                     dg ¦  «        |d<   |                      |d         ¦  «        d	         }|                      |¦  «        }|                      |d
         ¦  «        d	         }|                      ||¦  «        }t          |d         |d	         ||d         ||| |¬¦  «        S )a]  
        Return a Instance Group Manager object from the JSON-response.

        :param  instancegroupmanager: dictionary describing the Instance
                                  Group Manager.
        :type   instancegroupmanager: ``dict``

        :return: Instance Group Manager object.
        :rtype:  :class:`GCEInstanceGroupManager`
        rc   r�   rÃ   ÚcurrentActionsr  r  r4  r  r_   ÚinstanceGrouprŠ   r  )rŠ   r_   rc   r|  rº   rÏ  rx   rŒ   )rT  rT   r)  r  r  r»   )r@   rÒ  rc   rŒ   Útemplate_namerÏ  Úig_namerº   s           r*   r‚  z&GCENodeDriver._to_instancegroupmanagerp(  sN  € ð ×Ò ¨¤Ñ0Ô0ˆàˆØ#ŸKšK¨
Ñ3Ô3ˆˆjÑØ&Ÿ{š{¨=Ñ9Ô9ˆˆmÑØ")§+¢+Ð.>Ñ"?Ô"?ˆÐÑØ$+§K¢KÐ0BÑ$CÔ$CˆÐ Ñ!Ø%Ÿkšk¨,¸Ñ;Ô;ˆˆlÑØ'.§{¢{Ð3HÈ"Ñ'MÔ'MˆÐ#Ñ$Ø×6Ò6°wÐ?QÔ7RÑSÔSÐTZÔ[ˆØ×/Ò/°Ñ>Ô>ˆØ×0Ò0°¸Ô1IÑJÔJÈ6ÔRˆØ×2Ò2°7¸DÑAÔAˆå&Ø�tŒ}Ø˜”ØØ˜Ô&Ø)ØØØð	
ñ 	
ô 	
ð 		
r,   c                 óÔ   — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   t          |d         |d         | |¬¦  «        S )aB  
        Return a Instance Template object from the JSON-response.

        :param  instancetemplate: dictionary describing the Instance
                                  Template.
        :type   instancetemplate: ``dict``

        :return: Instance Template object.
        :rtype:  :class:`GCEInstanceTemplate`
        r�   rÃ   r«  rŠ   r_   rR  )rT   r¨  )r@   r¯  rŒ   s      r*   r‹  z"GCENodeDriver._to_instancetemplate”(  s~   € ð ˆØ,×0Ò0°Ñ<Ô<ˆˆjÑØ/×3Ò3°MÑBÔBˆˆmÑØ.×2Ò2°<Ñ@Ô@ˆˆlÑå"Ø Ô%Ø! &Ô)ØØð	
ñ 
ô 
ð 	
r,   c           	      óŽ  — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      |                      d¦  «        ¦  «        }|                      |                      d¦  «        ¦  «        d         }|                      ||¦  «        }t	          |d         |d         |||d         | |¬¦  «        S )	zú
        Return an Autoscaler object from the JSON-response.

        :param  autoscaler: dictionary describing the Autoscaler.
        :type   autoscaler: ``dict``

        :return: Autoscaler object.
        :rtype:  :class:`GCEAutoscaler`
        r�   rÃ   rc   r   r_   rŠ   rµ  )rŠ   r_   rc   r   r¡  rx   rŒ   )rT   rT  r)  r  rž  )r@   r£  rŒ   rc   r�  r   s         r*   r‘  zGCENodeDriver._to_autoscaler«(  sÉ   € ð ˆØ&ŸNšN¨:Ñ6Ô6ˆˆjÑØ)Ÿ~š~¨mÑ<Ô<ˆˆmÑØ×Ò 
§¢¨vÑ 6Ô 6Ñ7Ô7ˆØ×0Ò0°·²ÀÑ1IÔ1IÑJÔJÈ6ÔRˆØ×1Ò1°'¸4Ñ@Ô@ˆåØ˜$ÔØ˜FÔ#ØØØÐ1Ô2ØØð
ñ 
ô 
ð 	
r,   c                 ó>   — |                       |dd¬¦  «        }||dœgS )a5  
        Formats a GCE-friendly guestAccelerators request. Accepts an
        accelerator_type and accelerator_count that is wrapped up into a list
        of dictionaries for GCE to consume for a node creation request.

        :param  accelerator_type: Accelerator type to request.
        :type   accelerator_type: :class:`GCEAcceleratorType`

        :param  accelerator_count: Number of accelerators to request.
        :type   accelerator_count: ``int``

        :return: GCE-friendly guestAccelerators list of dictionaries.
        :rtype:  ``list``
        Tr•  r‹  )ÚacceleratorTypeÚacceleratorCount)r”  )r@   r•  r–  s      r*   r“  z(GCENodeDriver._format_guest_acceleratorsÆ(  s;   € ð  ×5Ò5Ø °Ð>Pð 6ñ 
ô 
Ðð %5ÐJ[Ð\Ð\Ð]Ð]r,   c                 ób  — |s|g dœS d|i}t          |t          ¦  «        råg }|D ]Û}t          |t          ¦  «        r¶d|v r-d|v r)t          |¦  «        dk    r|                     |¦  «         ŒHt          |¦  «        dk    rc|                     t          |                     ¦   «         ¦  «        d         t          |                     ¦   «         ¦  «        d         dœ¦  «         Œ¾t          d	¦  «        ‚t          d	¦  «        ‚||d
<   t          |t          ¦  «        �r d|v rd|v rt          |¦  «        dk    r|g|d
<   nÞt          |¦  «        dk    rŽd
|v r6t          |d
         t          ¦  «        r|d
         |d
<   n t          d	¦  «        ‚t          |                     ¦   «         ¦  «        d         t          |                     ¦   «         ¦  «        d         dœg|d
<   n=g |d
<   |                     ¦   «         D ]#\  }}|d
                              ||dœ¦  «         Œ$d
|vrt          d	¦  «        ‚|S )aà  
        Convert various data formats into the metadata format expected by
        Google Compute Engine and suitable for passing along to the API. Can
        accept the following formats:

          (a) [{'key': 'k1', 'value': 'v1'}, ...]
          (b) [{'k1': 'v1'}, ...]
          (c) {'key': 'k1', 'value': 'v1'}
          (d) {'k1': 'v1', 'k2': v2', ...}
          (e) {'items': [...]}       # does not check for valid list contents

        The return value is a 'dict' that GCE expects, e.g.

          {'fingerprint': 'xx...',
           'items': [{'key': 'key1', 'value': 'val1'},
                     {'key': 'key2', 'value': 'val2'},
                     ...,
                    ]
          }

        :param  fingerprint: Current metadata fingerprint
        :type   fingerprint: ``str``

        :param  metadata: Variety of input formats.
        :type   metadata: ``list``, ``dict``, or ``None``

        :return: GCE-friendly metadata dict
        :rtype:  ``dict``
        r²  r�  rB   r±  rÑ  r¶   r   ©rB   r±  zUnsupported metadata format.rO   )	r¸   ra  r¬  r&  r`   rô  rb  r¼   rO   )r@   r�  rc  r¸  Ú	item_listr  rl   rm   s           r*   r„  zGCENodeDriver._format_metadataÛ(  sn  € ð> ð 	=Ø#.¸Ð<Ð<Ð<Ø˜[Ð)ˆõ �h¥Ñ%Ô%ð 	$ØˆIàð Eð E�Ý˜a¥Ñ&Ô&ð Eð  �z�z g° l lµs¸1±v´vÀ²{°{Ø!×(Ò(¨Ñ+Ô+Ð+Ð+å˜Q™œ 1š˜Ø!×(Ò(µ°a·f²f±h´h±´ÀÔ1BÍTÐRS×RZÒRZÑR\ÔR\ÑM]ÔM]Ð^_ÔM`Ð)aÐ)aÑbÔbÐbÐbå(Ð)GÑHÔHÐHå$Ð%CÑDÔDÐDØ#ˆBˆw‰Kõ �h¥Ñ%Ô%ñ 	?ð ˜Ð Ð  W°Ð%8Ð%8½SÀ¹]¼]ÈaÒ=OÐ=OØ'˜j��7‘�å�X‘” !Ò#Ð#Ø˜hÐ&Ð&õ " (¨7Ô"3µTÑ:Ô:ð IØ&.¨wÔ&7˜˜7™˜å(Ð)GÑHÔHÐHõ $(¨¯ª©¬Ñ#8Ô#8¸Ô#;Ý%)¨(¯/ª/Ñ*;Ô*;Ñ%<Ô%<¸QÔ%?ðð ð#�B�w‘K�Kð !��7‘à$ŸNšNÑ,Ô,ð ?ð ?‘D�A�qØ�w”K×&Ò&¨q¸1Ð'=Ð'=Ñ>Ô>Ð>Ð>à˜"ÐÐÝÐ;Ñ<Ô<Ð<àˆ	r,   c           
      ó:  ‡— ˆfd„dD ¦   «         }|                       ‰                     d¦  «        ¦  «        }‰                     dg ¦  «        }‰                     dg ¦  «        }‰                     dg ¦  «        }t          ‰d         ‰d         ||||| |¬	¦  «        S )
zë
        Return a UrlMap object from the JSON-response dictionary.

        :param  zone: The dictionary describing the url-map.
        :type   zone: ``dict``

        :return: UrlMap object
        :rtype: :class:`GCEUrlMap`
        c                 ó<   •— i | ]}|‰                      |¦  «        “ŒS r2   r$  )r\  rl   r�  s     €r*   r]  z,GCENodeDriver._to_urlmap.<locals>.<dictcomp>D)  s5   ø€ ð 
ð 
ð 
àð ˆv�zŠz˜!‰}Œ}ð
ð 
ð 
r,   )r  rÃ   r�  r�   rð  Ú	hostRulesÚpathMatchersr  rŠ   r_   )rŠ   r_   r  r  r  r  rx   rŒ   )r  rT   r  )r@   r�  rŒ   r  r  r  r  s    `     r*   rs  zGCENodeDriver._to_urlmap:)  s½   ø€ ð
ð 
ð 
ð 
àTð
ñ 
ô 
ˆð
 ×2Ò2°6·:²:Ð>NÑ3OÔ3OÑPÔPˆà—Z’Z ¨RÑ0Ô0ˆ
ØŸ
š
 >°2Ñ6Ô6ˆØ—
’
˜7 BÑ'Ô'ˆåØ�dŒ|Ø˜”Ø+Ø!Ø'ØØØð	
ñ 	
ô 	
ð 		
r,   c           	      óf  — i }|                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        |d<   |                      d¦  «        }t          |d         |d         |d         |                      d	¦  «        || |¬
¦  «        S )zâ
        Return a Zone object from the JSON-response dictionary.

        :param  zone: The dictionary describing the zone.
        :type   zone: ``dict``

        :return: Zone object
        :rtype: :class:`GCEZone`
        r�   r  rÃ   r­   r.  rŠ   r_   ru  ÚmaintenanceWindows)rŠ   r_   ru  r  r.  rx   rŒ   )rT   r  )r@   rc   rŒ   r.  s       r*   r¢  zGCENodeDriver._to_zoneZ)  s¸   € ð ˆØ ŸHšH ZÑ0Ô0ˆˆjÑØ%)§X¢XÐ.AÑ%BÔ%BˆÐ!Ñ"Ø#Ÿxšx¨Ñ6Ô6ˆˆmÑØŸ(š( 8Ñ,Ô,ˆˆh‰à—X’X˜lÑ+Ô+ˆ
åØ�DŒzØ�f”Ø˜”>Ø $§¢Ð)=Ñ >Ô >Ø!ØØð
ñ 
ô 
ð 	
r,   r¯  c                 óà   — |€|s	|rd|dœg}n`g }n]|d         }|sS|rQg }|D ]2}|d         dk    r$|                      |d         |d         dœ¦  «         Œ3|}|                      d|dœ¦  «         |S )a¶  
        Return the GCE-friendly dictionary of metadata with/without an
        entry for 'sshKeys' based on params for 'force' and 'current_keys'.
        This method was added to simplify the set_common_instance_metadata
        method and make it easier to test.

        :param  metadata: The GCE-formatted dict (e.g. 'items' list of dicts)
        :type   metadata: ``dict`` or ``None``

        :param  force: Flag to specify user preference for keeping current_keys
        :type   force: ``bool``

        :param  current_keys: The value, if any, of existing 'sshKeys'
        :type   current_keys: ``str``

        :return: GCE-friendly metadata dict
        :rtype:  ``dict``
        Nr°  r”  rO   rB   r±  )r`   )r@   rc  rg  r·  r¹  Ú
updated_mdrÎ   s          r*   r´  z#GCENodeDriver._set_project_metadatav)  sÁ   € ð( Ðð
 ð ˜\ð Ø"+°lÐCÐCÐD��à��ð
 ˜gÔ&ˆFàð 	I˜\ð 	Ið  �
àð Rð R�AØ˜”x 9Ò,Ð,Ø"×)Ò)°!°E´(ÀQÀwÄZÐ*PÐ*PÑQÔQÐQøØ#�Ø—’ i¸,ÐGÐGÑHÔHÐHàˆr,   c                 ó²   — g }|D ]Q}|                      d¦  «        }|d         }|d         }|                     |                      ||¬¦  «        ¦  «         ŒR|S )a(  
        Convert a list of license selfLinks into a list of :class:`GCELicense`
        objects.

        :param  licenses: A list of GCE license selfLink URLs.
        :type   licenses: ``list`` of ``str``

        :return: List of :class:`GCELicense` objects.
        :rtype:  ``list``
        rÌ  é   r.  )rC   r_   )r  r`   r·  )r@   rü  Úreturn_listÚlicenseÚselfLink_partsÚlic_projÚlic_names          r*   rS  z!GCENodeDriver._licenses_from_urls¦)  so   € ð ˆàð 	Uð 	UˆGØ$Ÿ]š]¨3Ñ/Ô/ˆNØ% aÔ(ˆHØ% bÔ)ˆHØ×Ò˜t×2Ò2¸8È(Ð2ÑSÔSÑTÔTÐTÐTàÐr,   zcompute#addresszcompute#backendServicezcompute#diskzcompute#firewallzcompute#forwardingRulezcompute#httpHealthCheckzcompute#imagezcompute#instancezcompute#machineTypezcompute#networkzcompute#projectzcompute#regionzcompute#snapshotzcompute#sslCertificatezcompute#targetHttpProxyzcompute#targetHttpsProxyzcompute#targetInstance)zcompute#targetPoolzcompute#urlMapzcompute#zonec                 ó>   — | j         rdS |sd}t          |¦  «        ‚dS )a_  
        Verify that the zone / location is set for a particular operation -
        either via "datacenter" driver constructor argument or via
        "location" / "zone" keyword argument passed to the specific method
        call.

        This check is mandatory for methods which rely on the location being
        set - e.g. create_node.
        TzÃZone not provided. Zone needs to be specified for thisoperation. This can be done by passing "datacenter" argument to the driver constructor or by passing location / zone argument to this method.)rc   r¼   )r@   rc   Úmsgs      r*   rf  z!GCENodeDriver._verify_zone_is_setÒ)  s8   € ð Œ9ð 	Ø�4àð 	"ð2ð õ ˜S‘/”/Ð!àˆtr,   )NNNNNNr<  ro   rq  )NT)NNNr¦  NrÑ   )NNNNNNNN)NNrO  NrÖ  r×  NNNNNN)	NNrå  NNNFNN)NNNTTNNrn   rÌ  )rM   rO  NNN)NrG  N)NrO  NNNNTrD  NrE  TNNNNNNNNNNNNN)NNrE  TrO  NNrD  NNNNNNNNNN)NNrE  TrO  NrD  NNNNNNNNNNNTNNNN)
NNNNNTrI  rH  TT)TN)NNTN)rO  rF  )NrO  rF  )NNNrÚ  )NNNTrE  Nr	  )	NNFNNNNNN)T)r{  )FT)F)FN)NNNNrD  NrE  TNNNNNNNNNNNNN)NNNrE  )NFr¯  )ór/   r0   r1   rp   r4   ÚconnectionClsrb   r_   r   ÚGCErn  ÚwebsiteÚfeaturesr   ÚPENDINGr;  r=  ÚSTOPPEDr­  r\  r­  r®  ró  rÂ  r;   r3  r_  rc  rh  rj  r{  r  r‡  rŒ  rŽ  r’  r•  r—  r¦  rn  rh  rÇ  rÏ  r×  rà  rí  rø  rò  r  r  r  r  r  r-  rf  rB  rH  rP  rX  rd  ro  rt  r}  r‡  rŒ  r–  rž  r^  r³  r¸  rº  rÊ  rÕ  rä  ró  r  r  r  r  r%  r)  r7  rC  r7  r~  r}  r�  r”  r�  rµ  r’  r‘  ÚDEFAULT_TASK_COMPLETION_TIMEOUTrÍ  rÒ  rÙ  rà  rî  rò  r÷  rû  r   r  rÿ   r  r�  r�  r  r  rï  r÷  ró  rû  r¾  rÅ  rÂ  rÉ  r¹  rÕ  ræ  rØ  rÛ  rÞ  rá  rB  rG  rN  rZ  r]  r`  rc  r¯   rß   r(  r+  rý   r  r  rU  rK  r�  r†  rˆ  r�  r�  rÓ  r°  r¤  r™  r¥  r…  r“  r›  r  r  r±  r´  r·  rc  re  r°  rÄ  rÁ  rá  rï  rÿ  rb  r!  r;  rB  r¯  rà  rh  r³  ra  rù  rd  r®  r(  rì  rØ  rÝ  rí  rÐ  r  r  r  r¶  rT  rý  r   rç  r'  r¡  r)  r  rW  rÁ  rË  rÄ  r£  rg  r%  r(  rÄ  rÅ  rô  rœ  r»  rÀ  rË  rÓ  rÛ  rç  r  r  r  r	  rû  r  r*  r;  râ  r1  rF  r›  rL  rT  r]  ri  ry  r‚  r‹  r‘  r“  r„  rs  r¢  r´  rS  r  rf  rs   rt   s   @r*   r5  r5  ²  sÂ  ø€ € € € € ð
ð 
ð "€MØ€HØ"€DØŒ<€DØ)€GØ 	˜{Ð+€Hð "Ô)ØÔ$ØÔ$ØÔ%ØÔ(ØÔ'ØÔ$ðð €Nð 2€Hðà�Jðð 	Ð*ðð 	Ð(ð	ð
 	�iðð 	�[ðð 	˜ðð 	�lðð 	Ð.ðð 	Ð+ðð 	Ð2ðð 	ˆ|ðð 	Ð'ðð 	Ð1ðð 	Ð,ðð  	Ð-ð!ð" 	�[ð#ð$ 	Ð8ð%ð& 0Ø*ð)ð ð €Mð2 =Ð<Ð<Ø:Ð:Ð:ØHÐHÐHØ=Ð=Ð=Ø*Ð+Ø4Ð4Ð4Ø7Ð7Ð7ð
ð 
ð 
ð
ð 
ð 
ð
ð 
ð 
ð 
ð 
ð 
ð
ð 
ð 
ð_Cð C€NðJ !IÐ HÐ HÐð
 ØØØØØñP"ð P"ð P"ð P"ð P"ð P"ðd ðð ñ „Xðð ðð ñ „Xðð ð!ð !ñ „Xð!ð ð!ð !ñ „Xð!ñ)ð )ð )ð )ðVð ð ð8ð ð ð<ð ð ð2ð ð ð.ð ð ð4$ð $ð $ð(?ð ?ð ?ñ(ð ð ð ñB ð  ð  ð  ñD2ð 2ð 2ð 2ñh%ð %ð %ð %ðN$ð $ð $ð!ð !ð !ðð ð ñ.%ð .%ð .%ð .%ñ`ð ð ð ñB6ð 6ð 6ð 6ðpð ð ð"ð ð ðð ð ñ($ ð $ ð $ ð $ ðLð ð ñ3ð 3ð 3ð 3ðjð ð ñ#ð #ð #ð #ðJð ð ð
Pð 
Pð 
Pð
Qð 
Qð 
Qñ$ð $ð $ð $ñ< ð  ð  ð  ð8
Gð 
Gð 
Gð%ð %ð %ñN"ð "ð "ð "ðH
Qð 
Qð 
Qñ! ð ! ð ! ð ! ñF"ð "ð "ð "ðHð ð ð" ØØØØñS8ð S8ð S8ð S8ñj"2ð "2ð "2ð "2ðN %ØØØ"ØØñI
ð I
ð I
ð I
ð^ ØØØØØØðl0ð l0ð l0ð l0ðb ØØØØØ ØØñE-ð E-ð E-ð E-ðT ØØØØØØ $Ø $ØØØØñI*ð I*ð I*ð I*ð\ ØØØØØØØØñgJð gJð gJð gJðZ ØØØØ ØØñg'ð g'ð g'ð g'ñR1'ð 1'ð 1'ð 1'ðn ØØØñJ5ð J5ð J5ð J5ðZ PTñ5<ð 5<ð 5<ð 5<ðv ØØØØñH'ð H'ð H'ð H'ñT20ð 20ð 20ð 20ðn ØØØØ"ØñS9ð S9ð S9ð S9ñj<)ð <)ð <)ð <)ðF ØØØØØØØØØ"Ø Ø ØØØ ØØ#Ø!ØØØØ Ø!Øñ9[5ð [5ð [5ð [5ðB	 ØØØØØØØØØØ ØØØØØØØñ+n2ð n2ð n2ð n2ðh ØØØØØØØØØØ ØØØØØØØØØØØØñ5Z#ð Z#ð Z#ð Z#ð~ ØØØØØØØØØñxð xð xð xñt# ð # ð # ð # ðP ØØØñ9ð 9ð 9ð 9ð|  Ø,ñ	5ð 5ð 5ð 5ðr ØØ,ñ	,$ð ,$ð ,$ð ,$ð^ MQñ;ð ;ð ;ð ;ðF ØØØØØØØØØØ"Ø Ø Ø/ØØØ ØØ#Ø!ØØØØð;Sð Sð Sð Sðj1ð 1ð 1ñ212ð 12ð 12ð 12ðh HPñ-6ð -6ð -6ð -6ðd ØØØØØñP4ð P4ð P4ð P4ðd(ð (ð (ð< ØØØØ"Øñ@2ð @2ð @2ð @2ðD*ð *ð *ð( ð  ð  ð0Hð Hð Hð. 9ð  9ð  9ðD-3ð -3ð -3ð^ð ð ð2ð ð ñ2-ð -ð -ð -ð` =@ñð ð ð ð>(ð (ð (ðTð ð ð>-ð -ð -ð^%ð %ð %ðNð ð ð<ð ð ð: ð  ð  ðD KMð 'ð 'ð 'ð 'ðRð ð ð4,ð ,ð ,ð\ð ð ð<ð ð ñ0@Lð @Lð @Lð @LðDð ð ð<ð ð ð.ð ð ðð ð ñ>Cð Cð Cð CðR ØØØØØØ!ØØñkð kð kð kðZð ð ñ(ð ð ð ñ4ð ð ð ð8ð ð ð.ð ð ð ð ð ð. ØØØñJð Jð Jð JðXð ð ðð ð ðð ð ð,ð ð ðð ð ñð ð ð ñ2ð ð ð ñ,ð ð ð ñ,8ð 8ð 8ð 8ñ7ð 7ð 7ð 7ðð ð ð(ð ð ð4ð ð ñ ð ð ð ðD ØØØ/ðuð uð uð uðnð ð ðð ð ð,ð ð ð$ð ð ð&ð ð ð ð ð ðð ð ð4ð 4ð 4ñ ''ð ''ð ''ð ''ñR3ð 3ð 3ð 3ñ&*ð *ð *ð *ð41ð 1ð 1ð.ð .ð .ð+ð +ð +ñ2ð 2ð 2ð 2ñ>$ð $ð $ð $ðN HLñFð Fð Fð FðP(ð (ð (ðð ð ñ,3ð 3ð 3ð 3ñj&-ð &-ð &-ð &-ðP*ð *ð *ñ&'ð 'ð 'ð 'ð*	*ð 	*ð 	*ñ=ð =ð =ð =ð0+ð +ð +ñ$2ð $2ð $2ð $2ðL)ð )ð )ð41ð 1ð 1ð.2ð 2ð 2ð3ð 3ð 3ñ.1ð 1ð 1ð 1ñ,-ð -ð -ð -ð,)ð )ð )ñ0ð 0ð 0ð 0ñ87ð 7ð 7ð 7ð,3ð 3ð 3ñ-ð -ð -ð -ð,'ð 'ð 'ð:
ð 
ð 
ðð ð ñ4+/ð +/ð +/ð +/ðZð ð ñ ð ð ð ð$Nð Nð Nð4Oð Oð Oð,ð ð ñ","ð ,"ð ,"ð ,"ð\&$ð &$ð &$ðPð ð ð(ð ð ð4 ØØØØØØ"Ø Ø ØØØ ØØ#Ø!ØØØØ Ø!Øñ5\"ð \"ð \"ð \"ð|*/ð */ð */ðX\ð \ð \ð:.+ð .+ð .+ð`Zð Zð ZðB ØØØ"ñQ,ð Q,ð Q,ð Q,ñfcð cð cñ.
ð 
ð 
ñ< 
ð  
ð  
ñD"
ð "
ð "
ñH
ð 
ð 
ñ:-
ð -
ð -
ñ^
ð 
ð 
ñB
ð 
ð 
ñ0 
ð  
ð  
ñD'
ð '
ð '
ñR*
ð *
ð *
ñX*Zð *Zð *ZñX
ð 
ð 
ñ$\
ñ \
ð \
ð \
ñ|(
ð (
ð (
ñT
ð 
ð 
ñ@
ð 
ð 
ñB,
ð ,
ð ,
ñ\%
ð %
ð %
ñN
ð 
ð 
ñ0
ð 
ð 
ñ>
ð 
ð 
ñB.
ð .
ð .
ñ`,
ð ,
ð ,
ñ\"
ð "
ð "
ñH
ð 
ð 
ñ.
ð 
ð 
ñ6^ð ^ð ^ñ*]ñ ]ð ]ð ]ñ~
ð 
ð 
ñ@
ð 
ð 
ñ8.ñ .ð .ð .ñ`ð ð ð*Ù˜;ðá Ð"4ðñ 	Ð*ðñ 	˜Lð	ñ
 	!Ð"5ðñ 	" ?ðñ 	˜ðñ 	˜Hðñ 	˜}ðñ 	˜;ðñ 	˜;ðñ 	˜*ðñ 	˜Lðñ 	!Ð"4ðñ 	"Ð#6ðñ  	#Ð$8ð!ñ" 	!Ð"4ð#ð$ -Ø$Ø ñ)ð ð €Oñ.ñ ð ð ð ð ð ð r,   r5  )Frp   r  rÂ  r!   r(  Úlibcloud.pricingr   Úlibcloud.common.baser   Úlibcloud.common.typesr   Úlibcloud.compute.baser   r   r	   r
   r   r   r   r   Úlibcloud.common.googler   r   r   r   r   r   Úlibcloud.compute.typesr   Úlibcloud.utils.iso8601r   Úlibcloud.compute.providersr   r=   r­  r+   r.   r4   rv   rˆ   rš   r¥   rª   r´   rÓ   rã   rð   rô   r  r  r"  r3  r>  rE  rN  rZ  ra  rs  rz  r  r‡  r–  rž  r¨  r¹   r»   rê  r  r  r5  r2   r,   r*   ú<module>r¶     sÈ  ðð ð ð €
€
€
Ø €€€Ø €€€Ø Ð Ð Ð à (Ð (Ð (Ð (Ð (Ð (Ø +Ð +Ð +Ð +Ð +Ð +Ø /Ð /Ð /Ð /Ð /Ð /ð	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ð 	ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð -Ð ,Ð ,Ð ,Ð ,Ð ,Ø -Ð -Ð -Ð -Ð -Ð -Ø /Ð /Ð /Ð /Ð /Ð /à€Ø"%Ð ðð ð ð*	ð 	ð 	ð 	ð 	�.ñ 	ô 	ð 	ð'ð 'ð 'ð 'ð 'Ð(ñ 'ô 'ð 'ðDfð fð fð fð fñ fô fð fðR-
ð -
ð -
ð -
ð -
�˜Jñ -
ô -
ð -
ð`
ð 
ð 
ð 
ð 
�)ñ 
ô 
ð 
ð,
ð 
ð 
ð 
ð 
˜ñ 
ô 
ð 
ð,
ð 
ð 
ð 
ð 
�ñ 
ô 
ð 
ð>R
ð R
ð R
ð R
ð R
�ñ R
ô R
ð R
ðj'Jð 'Jð 'Jð 'Jð 'J˜	ñ 'Jô 'Jð 'JðT	Xð 	Xð 	Xð 	Xð 	Xñ 	Xô 	Xð 	Xð	Xð 	Xð 	Xð 	Xð 	Xñ 	Xô 	Xð 	Xð6
ð 6
ð 6
ð 6
ð 6
�Yñ 6
ô 6
ð 6
ðr?
ð ?
ð ?
ð ?
ð ?
�)ñ ?
ô ?
ð ?
ðD
ð 
ð 
ð 
ð 
˜	ñ 
ô 
ð 
ð@*
ð *
ð *
ð *
ð *
�9ñ *
ô *
ð *
ðZ:Jð :Jð :Jð :Jð :J˜	ñ :Jô :Jð :Jðz
ð 
ð 
ð 
ð 
�Iñ 
ô 
ð 
ðB!
ð !
ð !
ð !
ð !
�ñ !
ô !
ð !
ðH*
ð *
ð *
ð *
ð *
ˆyñ *
ô *
ð *
ðZUð Uð Uð Uð U�(ñ Uô Uð Uð?Kð ?Kð ?Kð ?Kð ?K�ñ ?Kô ?Kð ?KðD
ð 
ð 
ð 
ð 
�	ñ 
ô 
ð 
ð(Fð Fð Fð Fð F�.ñ Fô Fð FðLð Lð Lð Lð L˜ñ Lô Lð Lð.nNð nNð nNð nNð nN˜)ñ nNô nNð nNðb
ð 
ð 
ð 
ð 
˜	ñ 
ô 
ð 
ð:
ð 
ð 
ð 
ð 
�Iñ 
ô 
ð 
ð@Nð Nð Nð Nð N˜)ñ Nô Nð Nð8Y
ð Y
ð Y
ð Y
ð Y
�yñ Y
ô Y
ð Y
ðx~
ð ~
ð ~
ð ~
ð ~
˜iñ ~
ô ~
ð ~
ðBu
ð u
ð u
ð u
ð u
�Iñ u
ô u
ð u
ðp#:ð #:ð #:ð #:ð #:�	ñ #:ô #:ð #:ðLl
ð l
ð l
ð l
ð l
ˆlñ l
ô l
ð l
ð^wHð wHð wHð wHð wH�Jñ wHô wHð wHð wHð wHr,   