Chapter 5. Overview of the Swift API

Jon Solera

This chapter will be most useful to developers and architects considering building a system that includes Swift, or those writing code against an existing Swift installation. In the first section, we’ll offer a conceptual overview of Swift’s architecture as background for understanding what uses Swift is best suited for. In the second section, we’ll see how these theoretical concepts and practical realities influence Swift’s implementation, and thus which applications do best on a Swift platform. In the third and final section, we offer an applied overview of how to work with the Swift API, covering basics such as authentication, data retrieval and storage, and how to update and best use metadata.

What Is an API, Anyway?

API stands for “application programming interface,” which isn’t much more illuminating if you’re not clear on the term. An API is the set of rules for interacting with a software system. An API promises, “If you pass in this type of data in this manner, and if it meets these criteria, then you’ll get back this result; otherwise, you’ll get this type of error.” More loosely, an API is the set of instructions for how to use a software system.

The Swift API is a set of rules that specify what types of HTTP requests you are allowed to send to a Swift cluster, what types of success and failure responses you’ll get back under what circumstances, and what data those responses will contain. We’ll discuss the details of Swift’s ...

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.