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

Kuvaja, Erno kuvaja at hpe.com
Thu Sep 10 08:36:06 UTC 2015


This was the case until about two weeks ago.

Since 1.0.0 release we have been defaulting to Images API v2 instead of v1 [0].

If you want to exercise the v1 functionality from the CLI client you would need to specify the either environmental variable OS_IMAGE_API_VERSION=1 or use the command line option –os-image-api-version 1. Either case –debug can be used with glanceclient to provide detailed information about where the request is being sent and what the responses are.

If you haven’t moved to the latest client yet, forget about the above apart from the –debug part.

[0] https://github.com/openstack/python-glanceclient/blob/master/doc/source/index.rst


-          Erno

From: Fei Long Wang [mailto:feilong at catalyst.net.nz]
Sent: Thursday, September 10, 2015 1:04 AM
To: openstack-dev at lists.openstack.org<mailto:openstack-dev at lists.openstack.org>
Subject: Re: [openstack-dev] [glance] differences between def detail() and def index() in glance/registry/api/v1/images.py

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<mailto: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<mailto: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/ddd9e0af/attachment.html>


More information about the OpenStack-dev mailing list