Ask Your Question

how to extract the image details from glance api

asked 2014-12-22 12:48:02 -0500

eugene.goldberg gravatar image

Greetings! I need to query image details from glance api. I am using the following approach in my .NET client:

var client = new HttpClient();

        client.DefaultRequestHeaders.Add("User-Agent", "python-keystoneclient");
        client.DefaultRequestHeaders.Add("X-Auth-Token", authToken);
        HttpResponseMessage response = await client.GetAsync("");
        var responseBody = await response.Content.ReadAsStringAsync();
        var json = responseBody;

        JObject allImages = JObject.Parse(json);
        var imageList = allImages["versions"];

        foreach (var item in imageList)

However, the response I get looks like this:

"{\"versions\": [{\"status\": \"CURRENT\", \"id\": \"v2.2\", \"links\": [{\"href\": \"\", \"rel\": \"self\"}]}, {\"status\": \"SUPPORTED\", \"id\": \"v2.1\", \"links\": [{\"href\": \"\", \"rel\": \"self\"}]}, {\"status\": \"SUPPORTED\", \"id\": \"v2.0\", \"links\": [{\"href\": \"\", \"rel\": \"self\"}]}, {\"status\": \"CURRENT\", \"id\": \"v1.1\", \"links\": [{\"href\": \"\", \"rel\": \"self\"}]}, {\"status\": \"SUPPORTED\", \"id\": \"v1.0\", \"links\": [{\"href\": \"\", \"rel\": \"self\"}]}]}"

As you can see, the response contains links, but not the image details.

What is the proper syntax for the follow-up query, to bring the details of each image?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2014-12-28 03:38:02 -0500

Glance image-show image_uuid.

Look at the python-glanceclient code to see how it done if you dont want use the cli.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2014-12-22 12:48:02 -0500

Seen: 382 times

Last updated: Dec 28 '14