Ask Your Question
0

How to use REST API

asked 2016-04-19 08:13:04 -0500

Sofiane68 gravatar image

Hi guys

I got a question about REST APIs:

What is the use of using it ?

From where should I run the API command :

  • from Controller node?
  • from Compute node?
  • from instances?

How can I use it from Mozilla Firefox ?

I downloaded the pluging REST API client but I do not know what to do after

thank you in advance ;)

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted
2

answered 2016-04-19 13:56:01 -0500

dbaxps gravatar image

updated 2016-04-25 10:23:03 -0500

UPDATE 04/25/2016
@Sofiane68,

1. When you obtain authentication token - http://controller:5000/v2  Keystone (httpd) is running on Controller, CONFIG_KEYSTONE_API=v2.0 was set during install.
2. If you send POST or GET to nova-api - http://controller:8774/v2  nova-api is running on Controller. Keystone public port is 5000, openstack-nova-api port is 8774.

Please, see http://lxer.com/module/newswire/view/...
Lxer.com had me to make improvements to article during 2 or 3 days. They made about 70 moderations silently
Any given rejection I was supposed to guess which place they disliked this time. As far as it finally hit news wire means that article looks good to editorial team. It should be written good for you as well. Chrome Advanced REST Client provide a real relief, unless you run it in batch mode ( script ). I fixed confusing typo bellow just one IP address , which is Controller running keystone service ( public port 5000) and nova-api ( port 8774 )
(keystone service was included as apache wsgi in the past releases)

END UPDATE

Take a look at posts :-
http://bderzhavets.blogspot.com/2016/...
http://bderzhavets.blogspot.com/2016/...

I was able reproduce http://developer.openstack.org/api-gu...
However , REST API requests like :-

[root@ip-192-169-142-127 ~(keystone_admin)]# curl -s -H "X-Auth-Token: $OS_TOKEN" \
http://192.169.142.127:8774/v2/$OS_TENANT_NAME/flavors \
| python -m json.tool

failed.
I got samples running after update :-

[root@ip-192-169-142-127 ~(keystone_admin)]# curl -s -H "X-Auth-Token: $OS_TOKEN"   http://192.169.142.127:8774/v2/b47473d8953d49b29910fc681a2ff773/flavors  | python -m json.tool

where b47473d8953d49b29910fc681a2ff773 is admin's tenant id.

Starting server via Firefox RESTClient POST request

image description

edit flag offensive delete link more
0

answered 2016-04-25 07:44:55 -0500

Sofiane68 gravatar image

Thank you very much..

For me I got only one address for all API .. it is the case for you?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2016-04-19 08:13:04 -0500

Seen: 949 times

Last updated: Apr 25 '16