How does the CLI invoke core methods?

for instance in src/cli/onevm the vm.allocate(template,on_hold) -which is written in ruby- is called which I believe sends a command to the correct .cc file to execute the correct function with the correct parameters. so my question is which part of the code is responsible for this behavior? and how does it work?

and if you can be so kind please drop links to articles that shade some light onto that subject .

I have been searching for days for the answer to this question and couldn’t reach an answer on my own.

All help is much appreciated.

The CLI use the ruby binding for sending messages to oned service. It use an XMLRPC client used for sending request to the service.

The source files of the ruby bindings are available here: https://github.com/OpenNebula/one/tree/master/src/oca/ruby/opennebula

You can find some examples here: http://docs.opennebula.org/5.8/integration/system_interfaces/ruby.html

Also the XML-RPC API docs are available here: http://docs.opennebula.org/5.8/integration/system_interfaces/api.html

1 Like