Created
July 2, 2011 18:41
-
-
Save seungjin/1061509 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import json | |
| r = """ { | |
| "result" : { | |
| "code" : "success" , | |
| "meta" : "" , | |
| "value" : [{ "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-B2711E5D" , "image_location" : "seungjin_mi_atmoboot_test/admin_mi_CBSU_workshop_20110519.img.manifest.xml" , "image_ownerid" : "seungjin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-4F911F48" , "image_location" : "admin_mi_CBSU_workshop_20110520_001/admin_mi_CBSU_workshop_20110520.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-02371E4C" , "image_location" : "admin_mi_basic_CoGe_API_20110622/admin_mi_basic_CoGe_API_20110622.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "public" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "Base image (hi!)", "image_description" : "Base image", "image_tags" : "", "image_id" : "emi-D9602AB9" , "image_location" : "admin_mi_basic_xwindows_realvnc_ldap_20110525/admin_mi_basic_xwindows_realvnc_ldap_20110525.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "None" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-C3F817C0" , "image_location" : "christos_mi_R_20110626/christos_mi_R_20110626.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "public" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-DBC41E32" , "image_location" : "admin_mi_CBSU_Workshop_20110627/admin_mi_CBSU_Workshop_20110627.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "public" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-7AB6130E" , "image_location" : "vms-buckets01/centos.5-3.x86-64.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "public" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "None","image_kernel_id" : "None", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-E06F2CA1" , "image_location" : "admin_mi_basic_xwindows_realvnc_ldap_NC_20110517/admin_mi_basic_xwindows_realvnc_ldap_NC_20110517.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-EEA8148D","image_kernel_id" : "eki-0DDF1515", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-940A1FE1" , "image_location" : "admin_mi_CBSU_workshop_20110522_02/admin_mi_CBSU_workshop_20110522_02.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "public" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-4C0020ED" , "image_location" : "seungjin_mi_atmoboot_test_5/seungjin_mi_CBSU_atmoboot_test_5.img.manifest.xml" , "image_ownerid" : "seungjin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-8CF216D5" , "image_location" : "seungjin_mi_test_20110520/centos.5-3.x86-64.img.manifest.xml" , "image_ownerid" : "seungjin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-478E1D23" , "image_location" : "seungjin_test_goodluck/admin_mi_CBSU_workshop_20110519.img.manifest.xml" , "image_ownerid" : "seungjin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-E92C1E5A" , "image_location" : "admin_mi_CBSU_workshop_20110522/admin_mi_CBSU_workshop_20110522.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-1A0B261E" , "image_location" : "admin_BSA-Workshop_20110701_200854/sriramus_BSA-Workshop-image_20110701_200854_newcluster.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "public" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-0CBD1E93" , "image_location" : "admin_20110628_185409/sriramus_TEd-image-13_20110628_181343_newcluster.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-A28E27A4" , "image_location" : "admin_20110630_173637/sriramus_Basic-Linux-Secure-XWindows-Puppet_20110630_173637_newcluster.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-48102584" , "image_location" : "admin_mi_basic_xwindows_realvnc_ldap_matlab_20110621/Matlab_largebase_image.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-E99E1E7B" , "image_location" : "admin_mi_CBSU_workshop_20110521/admin_mi_CBSU_workshop_20110521.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-93CA1FE7" , "image_location" : "admin_mi_CBSU_workshop_20110522_01/admin_mi_CBSU_workshop_20110522_01.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-A8EC1FF3" , "image_location" : "cdwentworth_mi_DoaneIBM01_20110624/cdwentworth_mi_DoaneIBM01_20110624.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "public" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-0A8A205D" , "image_location" : "seungjin_mi_atmoboot_test_2/seungjin_mi_CBSU_atmoboot_test.img.manifest.xml" , "image_ownerid" : "seungjin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-0AAB2058" , "image_location" : "seungjin_mi_atmoboot_test_3/seungjin_mi_CBSU_atmoboot_test.img.manifest.xml" , "image_ownerid" : "seungjin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-DFC6235D" , "image_location" : "admin_20110628_182912/sriramus_Basic-Linux-VNC-Makeflow_20110628_205010_newcluster.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-A286278F" , "image_location" : "admin_20110628_184233/sriramus_Basic-Linux-Secure-XWindows-Puppet_20110628_180207_newcluster.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-40D7292F" , "image_location" : "admin_mi_Bioinformatics_Douglas_Fir_20110623/admin_mi_Bioinformatics_Douglas_Fir_20110623.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "public" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-9FF3207A" , "image_location" : "admin_mi_iPlant_Biotools_20110624/admin_mi_iPlant_Biotools_20110624.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "public" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-84EE2767" , "image_location" : "sriramus_20110606/sriramus_Basic-Linux-Secure-XWindows-Puppet_20110606_172551_newcluster.img.manifest.xml" , "image_ownerid" : "sriramus" , "image_state" : "available" ,"image_is_public" : "public" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-E8F11E6D" , "image_location" : "admin_mi_CBSU_workshop_20110520/admin_mi_CBSU_workshop_20110520.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-0ACD2053" , "image_location" : "seungjin_mi_atmoboot_test_4/seungjin_mi_CBSU_atmoboot_test.img.manifest.xml" , "image_ownerid" : "seungjin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-EBC41E79" , "image_location" : "admin_mi_CBSU_workshop_20110519/admin_mi_CBSU_workshop_20110519.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-96571A1D" , "image_location" : "admin_20110624/sriramus_Acan-test-image_20110624_210203.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-D79C2AAC" , "image_location" : "admin_mi_basic_xwindows_realvnc_ldap_20110620/admin_mi_basic_xwindows_realvnc_ldap_20110620.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "public" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-0A292047" , "image_location" : "seungjin_mi_atmoboot_test_2/seungjin_mi_CBSU_atmoboot_test.img.manifest.xml" , "image_ownerid" : "seungjin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }, { "image_name" : "", "image_description" : "", "image_tags" : "no tags", "image_id" : "emi-DAA22ABC" , "image_location" : "admin_mi_basic_xwindows_realvnc_ldap_20110519/admin_mi_basic_xwindows_realvnc_ldap_20110519.img.manifest.xml" , "image_ownerid" : "admin" , "image_state" : "available" ,"image_is_public" : "private" ,"image_product_codes" : "[]" ,"image_architecture" : "x86_64" ,"image_type" : "machine","image_ramdisk_id" : "eri-B6B91781","image_kernel_id" : "eki-DB23180A", "image_condition" : "", "image_type" : "" , "image_condition" : "" }] | |
| } | |
| }""" | |
| rjson = json.loads(r) | |
| v = rjson['result']['value'] | |
| print v # all image | |
| p = filter(lambda e : e['image_is_public'] == 'public' , v) # print public image | |
| print p | |
| m = filter(lambda e : e['image_ownerid'] == 'seungjin' and e['image_is_public'] == 'private' , v) # print my image and private | |
| print m | |
| pm = filter(lambda e: e['image_is_public'] == 'public' or e['image_ownerid'] == 'seungjin', v) | |
| print pm |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment