Does the latest version support V2 Web API?

Asked by ericshen

I tried http://localhost:8777/v1/resources and it worked, but http://localhost:8777/v2/resources did not work. So Was V2 Web API supported? or with a different port number?

Question information

Language:
English Edit question
Status:
Solved
For:
Ceilometer Edit question
Assignee:
No assignee Edit question
Solved by:
Jason
Solved:
Last query:
Last reply:
Revision history for this message
Jason (zzs) said :
#1

In my latest enviroment, it works well. Which error did you get and which command?

Revision history for this message
ericshen (batigolsg) said :
#2

Thr response are below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<title>404 Not Found</title>
<h1>Not Found</h1>
<p>The requested URL was not found on the server.</p><p>If you entered the URL manually please check your spelling and try again.</p>

Revision history for this message
Lianhao Lu (lianhao-lu) said :
#3

Which version of ceilometer do you use? Mine(git master latest version) is fine.

Revision history for this message
Jason (zzs) said :
#4

It is strange, it looks like the return is a webpage.

for me, the return is as follows,

HTTP/1.0 404 Not Found
Date: Tue, 12 Mar 2013 02:31:13 GMT
Server: WSGIServer/0.1 Python/2.7.3
Content-Length: 77
Content-Type: application/json

{"error_message": "404 Not Found\n\nThe resource could not be found.\n\n "}

Revision history for this message
ericshen (batigolsg) said :
#5

I used restclient plugin in firefox to send rest request, and then get above response, and I don't why V2 did not work.

Revision history for this message
ericshen (batigolsg) said :
#6

I check the Ceilometer Grizzly-3 Milestone at 2013-02-22 and found that V2 was support in this release. I used devstack and enable ceilometer in devstack, and I am wondering how can I check the ceilometer version? Also I want to know why V2 did not work. Thanks a lot for any help :)

Revision history for this message
Lianhao Lu (lianhao-lu) said :
#7

pip freeze might give you the ceilometer version. b.t.w. you might want to go to #openstack-metering on freenode IRC for quick debug.

Revision history for this message
Jason (zzs) said :
#8

Please check if you removed all the old installation of ceilometer and ceilometer client before you running the devstack.
if still error happened, please paste the log of the ceilometer-api and you localrc without credentials.
And also the irc will be the best place since a lot of nice guys are there to help you out. :-)

Revision history for this message
ericshen (batigolsg) said :
#9

My localrc is below:
ATABASE_PASSWORD=zhu88jie
RABBIT_PASSWORD=zhu88jie
SERVICE_TOKEN=zhu88jie
SERVICE_PASSWORD=zhu88jie
ADMIN_PASSWORD=zhu88jie
# Enable the ceilometer services
enable_service ceilometer-acompute,ceilometer-acentral,ceilometer-collector,ceilometer-api

The pip freeze related output of ceilometer
-e git+https://github.com/openstack/ceilometer.git@581344b63993a31eed1af72bb384e42ffe32e292#egg=ceilometer-dev
-e git+https://github.com/openstack/python-ceilometerclient@a550dcfa4971df5ef517aa73d2ebc7a6675c72c6#egg=python_ceilometerclient-dev

Output of of ceilometer-api.log when I try to get v2 api:
2013-03-18 15:43:36.746 10082 DEBUG ceilometer.storage [-] looking for 'mongodb' driver in 'ceilometer.storage' get_engine /opt/stack/ceilometer/ceilometer/storage/__init__.py:57
2013-03-18 15:43:36.748 10082 INFO ceilometer.storage.impl_mongodb [-] connecting to MongoDB on localhost:27017

BTW, I did not install any old version of ceilometer and ceilometer client. I installed devstack and then followed the guide to enable ceilometer in localrc as I attached above, and then re-run stack.sh, then the ceilometer was installed.

Revision history for this message
Jason (zzs) said :
#10

From the PiP freeze, It looks like the ceilometer and python-ceilometer are on March 5th, can you try the latest version.

Revision history for this message
ericshen (batigolsg) said :
#12

should I uninstall the old version of ceilometer? Can you tell me how to uninstall it? I searched in google and did not found any guide of how to uninstall ceilometer, and sorry for such question as i am new to openstack and ceilometer :).

Revision history for this message
ericshen (batigolsg) said :
#13

Same error when I use ceilometer command with version 2.

@EricLinux:/opt/stack$ ceilometer --os-username ceilometer --os-password zhu88jie --os-tenant-name service --os-auth-url "http://localhost:35357/v2.0" --ceilometer-api-version 2 resource-list
INFO Starting new HTTP connection (1): localhost
WARNING Request returned failure status.
HTTPNotFound (HTTP 404)

Revision history for this message
Best Jason (zzs) said :
#14

The simplest way is running ./unstack and then deleting the ceilometer and python-ceilometer directory and running ./stack.sh again.

Revision history for this message
ericshen (batigolsg) said :
#15

Thanks Jason, that solved my question.

Revision history for this message
ericshen (batigolsg) said :
#16

After following Jason's suggestion, I installed the newest version, and the problem was solved. Thank all you guys help a lot!!!