/usr/lib/python2.6/site-packages/openstackclient/image/v2
NameSizeModeActions
image.py251510644editdlrm
image.pyc193360644editdlrm
__init__.py00644editdlrm
__init__.pyc1680644editdlrm
Edit: /usr/lib/python2.6/site-packages/openstackclient/image/v2/image.pyc (19336B)
Ñò ;vVc@s›dZddkZddkZddkZddklZddklZddklZddkl Z ddk l Z ddk lZddk lZddk l Z dd klZd Zd Zd „Zd eifd„ƒYZdeifd„ƒYZdeifd„ƒYZdeifd„ƒYZdeifd„ƒYZdeifd„ƒYZdeifd„ƒYZdeifd„ƒYZdS(sImage V2 Action ImplementationsiÿÿÿÿN(tcommand(tlister(tshow(tutils(t exceptions(t parseractions(tcommontbaretrawcCsüh}h}ddddddddd d d d d ddddg}xbti|ƒD]Q}||jo|i|ƒ||thelpsImage to share (name or ID)tprojects s,Project to associate with image (name or ID)(tsuperR&t get_parsert add_argumentRt#add_project_domain_option_to_parser(tselft prog_nametparser((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR+Ks cCs›|iid|ƒ|iii}|iii}ti||i|i ƒi }t i |i |iƒi }|ii||ƒ}ttti|iƒƒŒS(Nstake_action(%s)(tlogtdebugtapptclient_managerR!tidentityRt find_projectR)tproject_domainRRt find_resourcetimagest image_memberstcreatetziptsortedRt iteritemst_info(R.t parsed_argst image_clienttidentity_clientt project_idtimage_idt image_member((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyt take_actionZs   (t__name__t __module__t__doc__tloggingt getLoggerR1R+RF(((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR&Fs t CreateImagecBs9eZdZeiedƒZd Zd„Zd „ZRS( sCreate/upload an images .CreateImageRR tlocations copy-fromRtstorec Csþtt|ƒi|ƒ}|idddddƒ|idddddƒ|id d tdd dd tƒ|id d tddddtƒ|iddddtddƒ|iddddtddƒ|idddddƒ|iƒ}|idddddƒ|idddddƒ|iƒ}|id dddd!ƒ|id"dddd#ƒ|id$d%d&dd'dti dd(ƒ|id)d%d*dd+dd,dd-ƒxG|i D]<}|id.|dd/|d%|i d0d1ƒdt i ƒqºW|S(2NR R's R(sNew image names--idssImage ID to reserves--container-formattdefaultss$Image container format (default: %s)s --disk-formats sImage disk format (default: %s)s --min-disks ttypes4Minimum disk size needed to boot image, in gigabytess --min-ramss3Minimum RAM size needed to boot image, in megabytess--filessUpload image from local files --protectedtactiont store_trues Prevent image from being deleteds --unprotecteds#Allow image to be deleted (default)s--publics!Image is accessible to the publics --privates-Image is inaccessible to the public (default)s --propertytdestRs sGSet a property on this image (repeat option to set multiple properties)s--tagRstappends<Set a tag on this image (repeat option to set multiple tags)s--%ss<%s>t-t_(R*RLR+R,tDEFAULT_CONTAINER_FORMATtDEFAULT_DISK_FORMATtinttadd_mutually_exclusive_groupRtKeyValueActiontdeadoptstreplacetargparsetSUPPRESS(R.R/R0tprotected_groupt public_grouptdeadopt((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR+vs’       cCs—|iid|ƒ|iii}xG|iD]<}t||iddƒdƒot i d|ƒ‚q,q,Wh}d}xF|D]>}||jo+t||dƒ}|o|||RtstrRtTruet unprotectedtFalseRcRdtgc_utilst get_data_fileRtwarningR9R;t__exit__t __enter__tuploadRt ExceptiontdeleteRR%R<R=(R.R@RARbtkwargst copy_attrstattrtvaltktvtfpR!teR"((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyRFÙsd            (sownerssizeslocations copy-fromschecksumsstore( RGRHRIRJRKR1R\R+RF(((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyRLps  ct DeleteImagecBs3eZdZeiedƒZd„Zd„ZRS(sDelete image(s)s .DeleteImagecCs;tt|ƒi|ƒ}|idddddddƒ|S(NR9R'stnargst+R(sImage(s) to delete (name or ID)(R*R|R+R,(R.R/R0((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR+*scCsb|iid|ƒ|iii}x9|iD].}ti|i|ƒ}|ii|i ƒq,WdS(Nstake_action(%s)( R1R2R3R4R!R9RR8RsR(R.R@RAR!t image_obj((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyRF4s  (RGRHRIRJRKR1R+RF(((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR|%s t ListImagecBs3eZdZeiedƒZd„Zd„ZRS(sList available imagess .ListImagec Cs tt|ƒi|ƒ}|iƒ}|iddddddtddƒ|id dd dddtdd ƒ|id dd dddtddƒ|iddddtiddƒ|iddddtddƒ|iddddti ƒ|idddddƒ|S(Ns--publicRSRcRQRRROR(sList only public imagess --privateRdsList only private imagess--sharedtsharedsList only shared imagess --propertyR's sFilter output based on propertys--longs List additional fields in outputs --page-sizess--sorts[:]s‰Sort output by selected keys and directions(asc or desc) (default: asc), multiple keys and directions can be specified separated by comma( R*R€R+RZR,RkRR[R^R_(R.R/R0Ra((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR+EsN   c sk|iid|ƒ|iii}h}|iot|d¾s ( R‚sNames Disk FormatsContainer FormatsSizeR…s visibilitys protectedsownerstags( R‚sNames Disk FormatsContainer FormatsSizeR…R†R‡RˆR‰(R‚sName(R1R2R3R4R!RcRiRdRtlongRftapit image_listtextendtpropertytlisttitemst api_utilst simple_filterRt sort_itemstsort( R.R@RARttcolumn_headerstdataRŠtpageRvR‹((R‘sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyRFzsh         (RGRHRIRJRKR1R+RF(((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR€@s 5tRemoveProjectImagecBs3eZdZeiedƒZd„Zd„ZRS(sDisassociate project with images.RemoveProjectImagecCs[tt|ƒi|ƒ}|idddddƒ|idddddƒti|ƒ|S( NR!R'sR(sImage to unshare (name or ID)R)s s/Project to disassociate with image (name or ID)(R*R R+R,RR-(R.R/R0((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR+Ís cCs|iid|ƒ|iii}|iii}ti||i|i ƒi }t i |i |iƒi }|ii||ƒdS(Nstake_action(%s)(R1R2R3R4R!R5RR6R)R7RRR8R9R:Rs(R.R@RARBRCRD((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyRFÜs (RGRHRIRJRKR1R+RF(((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR Ès t SaveImagecBs3eZdZeiedƒZd„Zd„ZRS(sSave an image locallys .SaveImagecCsNtt|ƒi|ƒ}|idddddƒ|idddddƒ|S( Ns--fileR's R(s0Downloaded image save filename (default: stdout)R!ssImage to save (name or ID)(R*R¡R+R,(R.R/R0((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR+òscCsf|iid|ƒ|iii}ti|i|iƒ}|ii|i ƒ}t i ||i ƒdS(Nstake_action(%s)( R1R2R3R4R!RR8R9RžRRlt save_imageR(R.R@RAR!Rž((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyRFs (RGRHRIRJRKR1R+RF(((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR¡ís t ShowImagecBs3eZdZeiedƒZd„Zd„ZRS(sDisplay image detailss .ShowImagecCs5tt|ƒi|ƒ}|idddddƒ|S(NR!R'sR(sImage to display (name or ID)(R*R£R+R,(R.R/R0((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR+s cCs_|iid|ƒ|iii}ti|i|iƒ}t|ƒ}t t t i |ƒƒŒS(Nstake_action(%s)( R1R2R3R4R!RR8R9R%R<R=RR>(R.R@RAR!R"((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyRFs  (RGRHRIRJRKR1R+RF(((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR£ s tSetImagecBs9eZdZeiedƒZd Zd„Zd„ZRS( sSet image propertiess .SetImageR RNRMs copy-fromRc CsÌtt|ƒi|ƒ}|idddddƒ|idddddƒ|id dd dd ƒ|iƒ}|id d dddƒ|idd dddƒ|iƒ}|idd dddƒ|idd dddƒ|idddddƒ|iddtddddƒddg}|iddd d!|dtiƒd"}|id#dd$d|ƒ|id%dd&dd'ƒd(d)d*d+d,d-d.d/d0d1g }d2|}|id3dd4d!|d|ƒ|id5dd6dd7ƒ|id8dd9dd:ƒd;}|id<dd=d|ƒ|id>dtdd?dd@ƒd(d)d*d+dAdBdCg} dD| }|idEddFd!| d|ƒxG|iD]<} |idG| ddH| dI| i dJdKƒdtiƒqˆW|S(LNR!R'sR(sImage to modify (name or ID)s--namessNew image names--architecturessOperating system Architectures --protectedRQRRs Prevent image from being deleteds --unprotecteds#Allow image to be deleted (default)s--publics!Image is accessible to the publics --privates-Image is inaccessible to the public (default)s--instance-uuidss(ID of instance used to create this images --min-diskRPs s4Minimum disk size needed to boot image, in gigabytesRcRds --visibilitys tchoicessWID of image in Glance that should be used as the kernel when booting an AMI-style images --kernel-ids s --os-versions s8Operating system version as specified by the distributorRftamitaritakitvhdtvmdkRtqcow2tvditisos$Format of the disk. Valid values: %ss --disk-formats s --os-distros s,Common name of operating system distributions--ownerssNew Owner of the images_ID of image stored in Glance that should be used as the ramdisk when booting an AMI-style images --ramdisk-ids s --min-ramss,Amount of RAM (in MB) required to boot imageRtovftovas)Format of the container. Valid values: %ss--container-formatss--%ss<%s>RSRURV( R*R¤R+R,RZRYR^R_R\R]( R.R/R0R`Ratvisibility_choicesthelp_msgt disk_choicestmsgtcontainer_choicesRb((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR+.s         c CsŸ|iid|ƒ|iii}xG|iD]<}t||iddƒdƒot i d|ƒ‚q,q,Wh}d}xF|D]>}||jo+t||dƒ}|o|||( R.R@RARbRtRuRvRwR!R"((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyRF±sJ        (ssizesstoreslocations copy-fromschecksum( RGRHRIRJRKR1R\R+RF(((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyR¤(s  ƒ( RIR^RJRtcliffRRRtglanceclient.commonRRltopenstackclient.apiR™topenstackclient.commonRRtopenstackclient.identityRRWRXR%tShowOneR&RLtCommandR|tListerR€R R¡R£R¤(((sN/tmp/pip-build-cD3xZi/python-openstackclient/openstackclient/image/v2/image.pyts.    *µˆ%