 Hello everyone. My name is Tong Chen. I'm from ED Stack and this is my friend Chen Rui. He's from Huawei Today we are going to share with you something about two client interface projects in OpenStack OpenStack client and OpenStack SDK Here is the agenda today as you know if you want to access to OpenStack you You have to access to some client first Each project in OpenStack provides its own client So first we I want to say something about the common problems existing in these clients and then I and then I would give an overall introduction to OpenStack client and SDK and in this section we will know how OSC and SDK could solve these problems and then some detail about OSC and SDK and After that Chen Rui will share with you some user experience of OpenStack client and at last some future works Okay So first the problems in the existing open in the existing clients You know each so each Project in OpenStack have its own client and there are some problems for example There are duplicating functionality in these clients You can see normal client and the glance client both of them have image related commands if your type of help You can see you can see the exact The exact the same output there. They are They are the same commands, but the code resides in different projects Another problem is naming conflict The most famous one is flavor flavor Flavor in no in no more client flavor means the flavor for virtual machine, but in neutron it means The flavor of a neutron service of a network service you They are both named flavor, but they are actually different things So there is also a problem It often confuse users and Some other problems they are very difficult to use for example Terms like Nova neutron it means nothing to users instead compute network They are much more easier to understand and remember and use a lot of clients makes Debug and upgrade more and more difficult because you have to install individual client packages and At last too much redundant code Right, so I will introduce you open-stack client and open-stack SDK. They are known as Unified open-stack command line client and SDK Now before we talk deeply into OSC and SDK, let's Make it clear that what is actually a client You can simply say that a client provides two types of user interface user interfaces command line interface for any users like operators and system administrators and API for application developers like the ones in the red box and the command line should based on the API of course So first open-stack client, which is also known as OSC It is a command line client for open-stack that brings all commands together in a single interactive share with uniform command structure and It also provides a plug-in framework for other clients to integrate their commands into OSC It provides a variety of output formators for example the table which is human readable and Jason could be handled by a lot of libraries and Even pure strings, which is for Linux share commands such as grip for now only Keystone has has advocated his command line client and Use open-stack client as its offshore command line Neutron is now Transciting to OSC and the work and half of the work has been done and more than 16 plugins have been supported now and Open-stack SDK it is the collection of Libraries for building applications to work with open-stack it aims to Provide a consistent and complete set of interactions with all open-stack services along with complete documentation and examples it uses Application developer friendly language in description in description just like I said just now Compute instead of Noah So this is SDK Now let's take an example to see what's the difference between use existing clients and OSC or SDK This is a graph When we when we create a bare mental node if we have a compute node using Using the ironic driver when user type Noah put it will start a bare mental mode it first of course called Noah client and the Noah client Call Noah API Noah service a compute service have has to communicate with Neutron services for some net for some network information and also ironic services to create the real bare mental node so Noah's compute service of course it will call Neutron client and ironic client and Finally bare mental node is created You can see that a lot of called a lot of course in there and the and it is very difficult to debug So if we use OSC and SDK it will be quite simple The the command line OSC provides command line to users and SDK provides API to Cloud APPs you you can also see OSC as an application in OpenStack so when we type command in OpenStack client it directly SDK APIs and all the all the other services Community communicate with each other through OpenStack SDK It's much simpler than the one before Now let's see some detail about OpenStack client First I would like to talk about three Help modules in OpenStack client. The first one is cliff cliff is cliff contains all the base classes for OpenStack client command line It has built it has built in output for meters and and and implemented an interactive share wrapper another one is Arc pass it is used to pass the command line options and OSC leap which provides a Lot of other functionalities like authentications translation support loggers and exceptions and The architecture of OpenStack client consists of two types of command line first the OpenStack client plan to implement six core API commands in itself They are Kistone, Nova, Neutron, Singer, Guns and Swift and all the other Modules should implement their command line as a plug-in to OpenStack client So this is the architecture Okay So how to add a commander to OpenStack client? Two steps first you implement a new class for the commander in this class two Basic methods should be implemented implemented get parser, which is used to pass the command option and Take action, which is the main logic of your command line And after that you should map your entry point to the class this is done in setup config file and you write something like this and Python setup tools will handle the rest work for you and you can then type then you Reinstall your code and then you can just type a command for example server create in your terminal and the code you write will be wrong and How to add a plug-in in OpenStack client? It's a little more complicated, but still very simple a Plug-in is discovered by in numerating the entry points from under extension direct directory So you should first add your plug-in Into this directory. This is also done in setup config file Then you should implement a plug-in client. The plug-in client is The entry point of your plug-in of all the commands in your plug-in Two methods should be implemented implemented make client which will return the client object and Build option parser, which is used to build some global options for your commands and after that they are it's the same as the one before You should implement a class a common class with get parser and take action and Then map your entry point to your class So that's the OpenStack client and OpenStack SDK OpenStack SDK is actually a two-level architecture The resource core level and proxy core level Each resource in OpenStack should be Should be implemented in OpenStack SDK as a class. This is called a resource class and the resource class will call the REST API directly and And It will encapsulate the resource operations into resource core Maybe you may do multiple REST API calls to finish one single resource core and above that a proxy should be implemented and The proxy provides APIs for SDK users for cloud applications and and the proxy and you can do a multiple resource cores to finish one proxy core That it and all the cloud APP the cloud applications should call Should call proxy call, but not the resource core So how to use SDK in your application development? First you should create a connection object. It's a built-in class object in OpenStack SDK Which handles the username password your project region something like that the authentication things and And with this connection object You can access to all the proxies You have implemented for example now we have compute network image and so on the name is Very easy to understand and remember for example when you want to access to normal services you just you just Obtain the compute proxy with Connection compute then you get it and then you can Call the rest call the proxy core as you like for example if you want to list up all the Service you can simply call Compute proxy service and all the service will obtain and you can also delete a network you Obtain the network proxy and call the delete network proxy core that's it and You can find all the supported the proxy in this page That is the SDK and Next I would invite Chen Wei to share with you some user experience of OpenStack client Okay Thanks to Tantran Sherry. I'm Chen Wei a contributor of the OpenStack client project Now work for Huawei. You know OpenStack client had a lot of excellent characteristics For example consistent command structure switching between clothes and Interactive mode operation log and so on what I want to highlight discuss that here is Consistent command structure that impact the user experience directly OpenStack has a consistent and a predictable format for all of his commands command take the phone OpenStack optional global options object 1 action object 2 and optional command structures It's expressed as Take object 1 and perform action using object 2 to it And the role is applied for the all OpenStack and the command If we use the interactive mode that to make the timing laser We only to need to input the object 1 and the related action The second object is is optional according to the command requirements And the Consistent and the predictable command structure make it easier for user to remain the command for example server add volume network list volume list and volume create you can find The input is different in each command, but the command structure is fixed Bear in mind of the role you can try anything you want in the OpenStack client for example image list stamp create and so on and Good user interface don't need the manual in the OpenStack All the object name Composed a unical name For example include the call services Noah, Neutron, Sender, Kstone, Gloss and Swift and the other big-time services like Hit, Cylometer, Ironic and so on You know we always use the different word to describe the one action for example create instance Launch instance boot instance and the run instance in the OpenStack client will define the similar operation to a unical name Like create, delete, list, show, add, remove and some special action For example restore, resume and so on So in OpenStack client you will have no feeling that You are jumping from one object to other projects OpenStack and handle the details and the difference Okay, let's do some operation to express the difference Imagine a scenario how to create the server with the bootable volume in CLI the following step We have to exclude in the CLI Choose the image and create the volume with the specified image choose the flavor choose the network and the create the server with these options Okay, let me try to use the project specific CLI first I need an image So I have to include Gloss image list, but if I need some details of Image the wearables option is required and Then create the volume with the specified image Gloss create add the image option Then choose the flavor Let me think Which project in all the flavor? Okay, it's now a flavor list And I need the address specs option to show the detail of flavor the first step Choose the network It's neutral net list Actually, I don't know why it's not not a network But what's whatever actually Finally, we create the server with these options Now our boot bootable volume nick and the flavor In this process you can find something First we must switch from the target object name to the project name Image Gloss and the volume sender and the network neutral second The options is consist inconsistent in the different commands for example wearables and The extra specs option are both showing the details of object, but We may have different name third The command is the unproductive for example Center create then now a credit right. No, it's not a boot We have to try to interact with the CLI As the one have to switch in between the different command structure and different output formatting capability and require a deeper knowledge about Which project is responsibility for the different task Then let me try to use the open stack client You can find if I need the image image list volume volume create and the flavor flavor list Open stack client has the long options is a short the Short the project the object to details If I want to check some details long options is always available Open stack client provide a more natural user experience Like talking directly and the efficiently Reduce the complexity of the open stack interaction Next part let me try Let me see the future works of open stack client and SDK Next step we propose to neutron sender guns can transition to the open stack based on SDK and Swift command and the API application in SDK and the amount of the API development for SDK and This is a reference about the open stack client and the open stack SDK Document we have a detailed document for the contributors and the users Okay We know open stack client and the open stack SDK to push the UX of open stack to the new level More and more users know it, but it's not enough like the blue sleet say no one is not enough We must apply where is not enough must do I Hope the more and the more the contributors and the users can join us to make it a better. Let's do it Okay Any questions and concerns Okay Michael Well, if your resource name has been used you cannot use it anymore That's it Sorry, can you I didn't quite understand your question you mean client or SDK in other programming languages You you mean documentation. So you mean the SDK libraries in other programming languages, right? Actually, there there are other SDK in other programming languages Yeah, not not not in the these two projects These two are for Python only oh I see the the rules the spec for Yeah, well, I don't think there is a spec in such a detail now there are some Goals in in this in these two pages You can take a look at that but not a documentation not not a spec in detail Well, I think we can Discuss it more in the work session tomorrow in there. There is a open-stack client work session tomorrow and the and the core team and Ptl will be there and we can write this question there again and see what we'll do Thank you other questions Please yeah, and and use you have to of course you have to install the service This is the server side package. Yes. Yes. Yes. Yes so No questions Okay, thank you very much. Thank you very ass