The current structure of SDK section is not well listed in the toc tree. This commit moves the overview in sdk.rst to a sub page sdk_overview.rst so that all subsections in SDK section are displayed in the toc. Also moves 'Create a legacy client object' page to upper level. Previously this page is listed as a bullet in the authenticate page so it was small. This change makes the page more highlighed. Change-Id: I6414b748a77a6375423da38e52113b36359e5f7d
2.2 KiB
Overview
OpenStack provides four different options for interacting with its APIs from Python, each targetting a slightly different user:
- OpenStack SDK
- shade
- Per-project client libraries
- Direct REST calls via keystoneauth
You should also be familiar with:
- RESTful web services
- HTTP/1.1
- JSON and data serialization formats
OpenStack SDK
The OpenStack Python Software Development Kit (SDK) is used to write Python automation scripts that create and manage resources in your OpenStack cloud. The SDK implements Python bindings to the OpenStack API, which enables you to perform automation tasks in Python by making calls on Python objects, rather than making REST calls directly.
New users should default to coding against the OpenStack SDK.
shade
shade is a an abstraction library focused on hiding implementation differences between OpenStack clouds. While the OpenStack SDK presents a clean object interface to the underlying REST APIs, shade hides them if doing so is advantageous. If you plan on running the same Python program against many OpenStack clouds, you may want to use shade - but if you need to access any features of a cloud that do not have a cloud-neutral abstraction mapping, you will be unable to do so with shade.
Per-project client libraries
Each OpenStack project produces a client library that wraps its own REST API. Unless there is no other choice for some reason, the per-project libraries should be avoided.
Direct REST calls via keystoneauth
All of OpenStack's APIs are actually REST APIs. The keystoneauth library provides an object that looks very much like a Session object from the Python requests library that handles all of the authentication for you. If you are more comfortable just dealing with REST or if there is a feature implemented in your cloud that has not seen support in any of the libraries yet, this option is for you.