Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: OpenStack: Dev

Invoking Glance REST API

 

 

OpenStack dev RSS feed   Index | Next | Previous | View Threaded


sajhak at gmail

Aug 9, 2012, 2:05 AM

Post #1 of 3 (125 views)
Permalink
Invoking Glance REST API

Hi all,

I'm trying to invoke Openstack Glance REST API s using a Java client, to
get image details. etc (Ultimately I need to upload an image)

When I invoke http://<Glance_URL>:<PORT>/images/detail GET request in Java
code, I'm getting *HTTP 300 *as the response code.

4 < 300
4 < Date: Thu, 09 Aug 2012 08:56:29 GMT
4 < Content-Length: 222
4 < Content-Type: application/json
4 < Connection: keep-alive


Any idea what could have gone wrong there?

--
Best Regards
Sajith


bcwaldon at gmail

Aug 9, 2012, 9:01 AM

Post #2 of 3 (118 views)
Permalink
Re: Invoking Glance REST API [In reply to]

You're getting a '300 Multiple Choices' response as you haven't indicated a version in your request. You can parse the body as json (indicated in the headers) to see what API versions are available to you at any given time. If you don't care about taking that extra step, just use a URI with 'v1' as the first token in your path: http://<Glance_URL>:<PORT>/v1/images/detail

Brian Waldon


On Aug 9, 2012, at 2:05 AM, Sajith Kariyawasam wrote:

> Hi all,
>
> I'm trying to invoke Openstack Glance REST API s using a Java client, to get image details. etc (Ultimately I need to upload an image)
>
> When I invoke http://<Glance_URL>:<PORT>/images/detail GET request in Java code, I'm getting HTTP 300 as the response code.
>
> 4 < 300
> 4 < Date: Thu, 09 Aug 2012 08:56:29 GMT
> 4 < Content-Length: 222
> 4 < Content-Type: application/json
> 4 < Connection: keep-alive
>
> Any idea what could have gone wrong there?
>
> --
> Best Regards
> Sajith
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to : openstack [at] lists
> Unsubscribe : https://launchpad.net/~openstack
> More help : https://help.launchpad.net/ListHelp


sajhak at gmail

Aug 10, 2012, 4:32 AM

Post #3 of 3 (121 views)
Permalink
Re: Invoking Glance REST API [In reply to]

Thanks Brian.. that worked ..! :)

On Thu, Aug 9, 2012 at 9:31 PM, Brian Waldon <bcwaldon [at] gmail> wrote:

> You're getting a '300 Multiple Choices' response as you haven't indicated
> a version in your request. You can parse the body as json (indicated in the
> headers) to see what API versions are available to you at any given time.
> If you don't care about taking that extra step, just use a URI with 'v1'
> as the first token in your path: http://
> <Glance_URL>:<PORT>/v1/images/detail
>
> Brian Waldon
>
>
> On Aug 9, 2012, at 2:05 AM, Sajith Kariyawasam wrote:
>
> Hi all,
>
> I'm trying to invoke Openstack Glance REST API s using a Java client, to
> get image details. etc (Ultimately I need to upload an image)
>
> When I invoke http://<Glance_URL>:<PORT>/images/detail GET request in
> Java code, I'm getting *HTTP 300 *as the response code.
>
> 4 < 300
> 4 < Date: Thu, 09 Aug 2012 08:56:29 GMT
> 4 < Content-Length: 222
> 4 < Content-Type: application/json
> 4 < Connection: keep-alive
>
>
> Any idea what could have gone wrong there?
>
> --
> Best Regards
> Sajith
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openstack
> Post to : openstack [at] lists
> Unsubscribe : https://launchpad.net/~openstack
> More help : https://help.launchpad.net/ListHelp
>
>
>


--
Best Regards
Sajith

OpenStack dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.