Ñò ›ˆQc @sþdZddkZddkZddklZddkZddklZddkl Z ddkl Z ddkl Z ddkl Z dd kl Z eiZe iZd e ifd „ƒYZd efd „ƒYZdefd„ƒYZd„ZdS(s4Commands for interacting with Google Compute Engine.iÿÿÿÿN(t appcommands(t auth_helper(t command_base(tgcutil_logging(tmetadata(tscopes(tversiontProjectCommandcBs;eZdZdZddfZd„Zd„Zd„ZRS( s6Base command for working with the projects collection.tnametipstexternalIpAddressescCstt|ƒi||ƒdS(N(tsuperRt__init__(tselfRt flag_values((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pyR -scCs|iƒ|_dS(sœSet the Google Compute Engine API for the command. Args: api: The Google Compute Engine API used by this command. Returns: None. N(tprojectst _projects_api(R tapi((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pytSetApi0s c Cs5|idƒ|idƒxe|idgƒD]Q}|id|diƒiddƒdt|dƒt|d ƒffƒq-W|id gƒoœ|idƒ|idƒ|id gƒ}d |jo|id gƒ}nxJ|D]>}|id|iddƒ|i|iddƒƒfƒqëWndS(sÁCustomized result printing for this type. Args: result: json dictionary returned by the server table: the pretty printing table to be customized Returns: None. ttusagetquotass %stmetrict_t-s%s/%stlimittcommonInstanceMetadatascommon-instance-metadatatkindtitemstkeytvalueN(RR(susageR(RR(scommon-instance-metadataR(tAddRowtgettlowertreplacetstrt_PresentElement(R tresultttabletquotatmetadata_containertmetadata_entry((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pytCustomizePrintResult<s  #,   (snamesname(R sexternalIpAddresses(t__name__t __module__t__doc__tdefault_sort_fieldtsummary_fieldsR RR*(((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pyR&s   t GetProjectcBs;eZdZdZd d d d fZd„Zdd „ZRS(s5Get the resource for a Google Compute Engine project.sRt descriptions creation-timetcreationTimestampR R cCstt|ƒi||ƒdS(N(R R0R (R RR((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pyR dscCs2|p |ii}|iid|ƒ}|iƒS(s–Get the specified project. Args: project: The project for which to get defails. Returns: The result of getting the project. tproject(t_flagsR3RR texecute(R R3tproject_request((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pytHandlegs (snamesname(s descriptions description(s creation-timescreationTimestamp(sipssexternalIpAddressesN(R+R,R-tpositional_argst detail_fieldsR tNoneR7(((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pyR0Ys  tSetCommonInstanceMetadatacBs eZdZd„Zd„ZRS(sSet the commonInstanceMetadata field for a Google Compute Engine project. This is a blanket overwrite of all of the project wide metadata. cCsNtt|ƒi||ƒtidtdd|ddƒti|ƒ|_dS(Ntforces0Set the metadata even if it erases existing keysRt short_nametf( R R;R tflagst DEFINE_booltFalseRtMetadataFlagsProcessort_metadata_flags_processor(R RR((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pyR {s c CsK|iiƒ}|iipí|iid|iiƒ}|iƒ}|idgƒ}d|jo|idgƒ}ntg}|D]}||dq†~ƒ}tg}|D]}||dq±~ƒ} || } | o&t i ddi t | ƒƒƒ‚q n|ii d|iidh|id ƒd6|d6ƒ} | iƒS( sSet the metadata common to all instances in the specified project. Args: None. Returns: The result of setting the project wide metadata. Raises: command_base.CommandError: If the update would cause some metadata to be deleted. R3RRRRsoDiscarding update that would wipe out the following metadata: %s. Re-run with the -f flag to force the update.s, tbodyR(RCtGatherMetadataR4R<RR R3R5tsetRt CommandErrortjointlisttsetCommonInstanceMetadatat_GetResourceApiKind( R t new_metadatat get_requesttproject_resourcetproject_metadatat_[1]tentryt existing_keyst_[2]tnew_keyst dropped_keysR6((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pyR7…s&   ++ !   (R+R,R-R R7(((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pyR;us cCs$tidtƒtidtƒdS(Nt getprojecttsetcommoninstancemetadata(RtAddCmdR0R;(((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pyt AddCommands«s(R-thttplib2tjsontgoogle.apputilsRtgflagsR?tgcutilRRRRRRtFLAGStLOGGERtGoogleComputeCommandRR0R;RY(((sa/Users/riccardo/git/gcloud/packages/gcutil-1.7.1/lib/google_compute_engine/gcutil/project_cmds.pyts      36