Chapter 7. Advanced API Features

Jon Solera

While CRUD (create, read, update, delete) operations, covered in Chapter 6, are the foundation of any storage system, Swift also provides a rich API that offers developers many useful, more advanced features. Along with its included middleware, Swift makes it possible to minimize the amount of custom development required to configure a powerful and flexible system. This chapter will provide synopses and use cases, and refer you to more detailed documentation for many of Swift’s most interesting features. If one of these features solves a problem for you, use it! If not, feel free to ignore or disable it. Although they are part of a default installation, none of these are necessary for the basic use of Swift. But they are really helpful when you need them.

In order to make this functionality as easy to use as possible, we also provide code samples using simple command-line HTTP requests (with cURL) at the end of the chapter. You could also use the swift command-line utility (installed via the python-swiftclient package), which usually results in simpler commands, or use an API library in the language of your choice. We use cURL in our code samples so that the HTTP verbs and headers are visible, which makes it easier to convert to other interfaces, because they might use other terminology (e.g., an HTTP PUT is called an upload by the swift CLI).

A number of features in this chapter call for you to pass X- headers in requests, a mechanism discussed ...

Get OpenStack Swift now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.