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.
I am searching to create a custom CLI command ,trying to write /create utility, under src/cli/ which is written in ruby.
so my question is which part is responsible for behavior and how CLI works? Does it call XML-RPC API with the CLI commands parameters as request to API call.
Please help sharing details on the flow or articles that would be relevant to subject. @cgonzalez@ruben@ahuertas Team could help with same.
Thanks in Advance!
I think you should just take one of the commands under src/cli/ and read through it to understand how it works. In general, the main executable src/cli/ (e.g., src/cli/onehost) defines all the subcommands and their parameters and does some of the small actions directly, or calls one the helper class from src/cli/one_helper/ (e.g., src/cli/one_helper/onehost_helper.rb) to do the job. It interacts with the OpenNebula over the XML-RPC via the Ruby OCA library (Ruby OpenNebula Cloud API — OpenNebula 6.0.3 documentation).