[openstack-dev] [glance] differences between def detail() and def index() in glance/registry/api/v1/images.py

Fei Long Wang feilong at catalyst.net.nz
Thu Sep 10 00:04:01 UTC 2015


I assume you're using Glance client, if so, by default, when you issuing 
command 'glance image-list', it will call /v1/images/detail instead of 
/v1/images, you can use curl or any browser http client to see the 
difference. Basically, just like the endpoint name, /v1/images/detail 
will give you more details. See below difference of their response.

Response from /v1/images/detail
{
     "images": [
         {
             "status": "active",
             "deleted_at": null,
             "name": "fedora-21-atomic-3",
             "deleted": false,
             "container_format": "bare",
             "created_at": "2015-09-03T22:56:37.000000",
             "disk_format": "qcow2",
             "updated_at": "2015-09-03T23:00:15.000000",
             "min_disk": 0,
             "protected": false,
             "id": "b940521b-97ff-48d9-a22e-ecc981ec0513",
             "min_ram": 0,
             "checksum": "d3b3da0e07743805dcc852785c7fc258",
             "owner": "5f290ac4b100440b8b4c83fce78c2db7",
             "is_public": true,
             "virtual_size": null,
             "properties": {
                 "os_distro": "fedora-atomic"
             },
             "size": 770179072
         }
     ]
}

Response with /v1/images
{
     "images": [
         {
             "name": "fedora-21-atomic-3",
             "container_format": "bare",
             "disk_format": "qcow2",
             "checksum": "d3b3da0e07743805dcc852785c7fc258",
             "id": "b940521b-97ff-48d9-a22e-ecc981ec0513",
             "size": 770179072
         }
     ]
}


On 10/09/15 11:46, Su Zhang wrote:
>
> Hello,
>
> I am hitting an error and its trace passes def index () 
> in glance/registry/api/v1/images.py.
>
> I assume def index() is called by glance image-list. However, while 
> testing glance image-list I realized that def detail() is called 
> under glance/registry/api/v1/images.py instead of def index().
>
> Could someone let me know what's the difference between the two 
> functions? How can I test out def index() under 
> glance/registry/api/v1/images.py through CLI or API?
>
> Thanks,
>
> -- 
> Su Zhang
>
>
>
> __________________________________________________________________________
> OpenStack Development Mailing List (not for usage questions)
> Unsubscribe: OpenStack-dev-request at lists.openstack.org?subject:unsubscribe
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev

-- 
Cheers & Best regards,
Fei Long Wang (王飞龙)
--------------------------------------------------------------------------
Senior Cloud Software Engineer
Tel: +64-48032246
Email: flwang at catalyst.net.nz
Catalyst IT Limited
Level 6, Catalyst House, 150 Willis Street, Wellington
--------------------------------------------------------------------------

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150910/ba170fe2/attachment.html>


More information about the OpenStack-dev mailing list