Summary 

We started this chapter with a discussion about various OpenStack SDKs available on the market. We created a development environment by installing the Python SDK for OpenStack called openstacksdk. We then started by writing a simple OpenStack application that lists the available virtual machines running on the compute node. We wrote application programs to interact with the imaging service that uploads and downloads the images, lists images, and deletes images.

We then explored the SDK further to interact with the OpenStack compute service by writing applications to create a key-pair, launch a new virtual machine, start a VM, stop a VM, pause and unpause a VM, and reboot the VM. We also saw how to create an image from a running virtual machine, assign and unassign a security group to and from a VM, assign and unassign fixed and floating IP addresses to the VMs, and create a custom flavor.

Next, we used the SDK to interface with the networking service. We wrote programs to create and delete a new virtual network and subnet, list available networks, list subnets, and list ports, routers, and network agents. We then created a new security group and defined its firewall rules programmatically.

The Identity Service was leveraged by the SDK by writing application programs that create a new user, delete a user, update the user, and find the user. We also created, updated, and deleted roles and projects. We used the SDK for creating and deleting an OpenStack volume and also created and deleted snapshots of the volumes. Finally, we discussed the OpenStack orchestration service and saw a complex HOT template that deployed two VMs in a specific order. 

The code examples shown in this chapter give you an idea of how each API can be leveraged in your applications. You can now write more complex applications that can make use of these APIs.

This concludes our discussion about developing OpenStack applications.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.252.254