CLI Tool and Rest API for Quantum

Asked by Kevin-Yang

I am new to Quantum and as my current understanding, it seems that Quantum provides both the command line tool used on directly on the Quantum Server and also the set of Rest API that can be invoked remotely. So i want to know whether they both provide the same functional set from the end user perspective, such as create network, interface, port and etc... Therefore, i can use anyone of them to interact with Quantum service from the programming perspective.

Thanks

Question information

Language:
English Edit question
Status:
Solved
For:
neutron Edit question
Assignee:
No assignee Edit question
Solved by:
Salvatore Orlando
Solved:
Last query:
Last reply:
Revision history for this message
Best Salvatore Orlando (salvatore-orlando) said :
#1

Hi Kevin,

I am not entirely sure what you mean by "interact with Quantum service from the programming perspective".
I guess you want to know how you can develop applications that interact with a Quantum server.

If that is correct, then the answer is yes: you can use both the Quantum API directly in your application, by sending HTTP requests with the appropriate JSON payload, or the CLI. For the CLI bear in mind that is based on cliff, a flexibile framework which allows for both human and machine readable output. This means you can output something from a quantum CLI command that could be parsed straight into a python dict.

A third option, if you're developing in python, is to import the quantum client library into your application. In python-quantumclient, the quantumclient.quantum.v2_0 package has modules that can be used in your app to interact with the Quantum server. However, please bear in mind this library at the moment is used only be the CLI and (I tihink) it is not yet officially supported byt the Quantum core team.

Revision history for this message
Kevin-Yang (benbenzhuforever) said :
#2

Thanks Salvatore Orlando, that solved my question.

Revision history for this message
Kevin-Yang (benbenzhuforever) said :
#3

Salvatore Orlando, really appreciated for your detailed and deep information. It definitely provides great insight and direction for my next step.