Exposing/Extending an OpenStack specific command

88 views
Skip to first unread message

Leander

unread,
Oct 15, 2012, 9:32:12 AM10/15/12
to jcl...@googlegroups.com
Hello all,

I'm currently using version 1.5.2 and was wondering how I could expose (or extend in case it does not exist) the diagnostics command in the OpenStack driver: 
[API_ENDPOINT]/v2/[TENANT]/servers/[SERVER_ID]/diagnostics? 

What would be the best place to implement this, in case the command implemented?


Regards,

Leander

Adrian Cole

unread,
Oct 15, 2012, 12:06:40 PM10/15/12
to jcl...@googlegroups.com, jclou...@googlegroups.com

Probably more a jclouds-dev question.

Is the command only for servers? Do you have a doc link?

If only for servers, update classes: ServerApi ServerAsyncApi ServerApiExpectTest ServerApiLiveTest

Cheers,
-A

--
You received this message because you are subscribed to the Google Groups "jclouds" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jclouds/-/V9C3Pshi1eMJ.
To post to this group, send email to jcl...@googlegroups.com.
To unsubscribe from this group, send email to jclouds+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds?hl=en.

Leander Bessa Beernaert

unread,
Oct 16, 2012, 4:26:13 AM10/16/12
to jcl...@googlegroups.com, jclou...@googlegroups.com
Sorry about that, shall direct it to the appropriate list next time.  Thanks for the suggestions, I shall look into to those. There is no doc link, as far as I know of, I've retrieved the link by using the python command line tool with the --debug option for the command diagnostics. This command should work with OpenStack Folsom using the Xen API and libvirt ( more hypervisors might support this, although I'm not sure).

Adrian Cole

unread,
Oct 16, 2012, 10:49:45 AM10/16/12
to jcl...@googlegroups.com, jclou...@googlegroups.com

Cool.  While you are on it, you mind pasting what the debug output is?  I'm curious.

-A

Leander Bessa Beernaert

unread,
Oct 16, 2012, 11:34:42 AM10/16/12
to jcl...@googlegroups.com
Since i'm using Essex at the moment, the command doesn't work. The only output it produces is below. If you want to check the output of this command, you can find a sample of Xen and libvirt in this commit log https://github.com/openstack/nova/commit/ad54ed53cf6a475ad0f8042f8b95454a8c0b35a4

REQ: curl -i http://10.0.107.2:8774/v2/4ebf76425efa4d01bc54a182185444a6/servers/9313c838-e004-4993-96c0-e75c0e3efb77/diagnostics -X GET -H "X-Auth-Project-Id: project" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: 5e9ef4cb0d1b43c8b832e2032b7eaf78"

send: u'GET /v2/4ebf76425efa4d01bc54a182185444a6/servers/9313c838-e004-4993-96c0-e75c0e3efb77/diagnostics HTTP/1.1\r\nHost: 10.0.107.2:8774\r\nx-auth-project-id: project\r\nx-auth-token: 5e9ef4cb0d1b43c8b832e2032b7eaf78\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nuser-agent: python-novaclient\r\n\r\n'
reply: 'HTTP/1.1 500 Internal Server Error\r\n'
header: Content-Length: 128
header: Content-Type: application/json; charset=UTF-8
header: X-Compute-Request-Id: req-097428e6-356d-46da-b497-3919caf08762
header: Date: Tue, 16 Oct 2012 15:34:17 GMT
RESP:{'date': 'Tue, 16 Oct 2012 15:34:17 GMT', 'status': '500', 'content-length': '128', 'content-type': 'application/json; charset=UTF-8', 'x-compute-request-id': 'req-097428e6-356d-46da-b497-3919caf08762'} {"computeFault": {"message": "The server has either erred or is incapable of performing the requested operation.", "code": 500}}

DEBUG (shell:534) The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-097428e6-356d-46da-b497-3919caf08762)
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/novaclient/shell.py", line 531, in main
    OpenStackComputeShell().main(sys.argv[1:])
  File "/usr/local/lib/python2.7/dist-packages/novaclient/shell.py", line 467, in main
    args.func(self.cs, args)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/v1_1/shell.py", line 819, in do_diagnostics
    utils.print_dict(cs.servers.diagnostics(server)[1])
  File "/usr/local/lib/python2.7/dist-packages/novaclient/v1_1/servers.py", line 425, in diagnostics
    base.getid(server))
  File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 199, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 186, in _cs_request
    **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 168, in _time_request
    resp, body = self.request(url, method, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/novaclient/client.py", line 162, in request
    raise exceptions.from_response(resp, body)
ClientException: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-097428e6-356d-46da-b497-3919caf08762)
ERROR: The server has either erred or is incapable of performing the requested operation. (HTTP 500) (Request-ID: req-097428e6-356d-46da-b497-3919caf08762)

Leander

unread,
Oct 16, 2012, 4:32:31 PM10/16/12
to jclou...@googlegroups.com, jcl...@googlegroups.com

Leander Bessa Beernaert

unread,
Oct 18, 2012, 5:45:57 AM10/18/12
to jclou...@googlegroups.com, jcl...@googlegroups.com
I've found the ServerAPI file under ./jclouds/apis/openstack-nova/src/main/java/org/jclouds/openstack/nova/v2_0/features/ServerApi.java. Any pointers on how to compile changes using the eclipse setup and using JClouds REST API?

--
You received this message because you are subscribed to the Google Groups "jclouds-dev" group.
To view this discussion on the web visit https://groups.google.com/d/msg/jclouds-dev/-/ICLsBF5WmnoJ.
To post to this group, send email to jclou...@googlegroups.com.
To unsubscribe from this group, send email to jclouds-dev...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/jclouds-dev?hl=en.

Reply all
Reply to author
Forward
0 new messages