The Distributed SQL Blog

Thoughts on distributed databases, open source, and cloud native

Yugabyte Platform API: Securely Deploying YugabyteDB Clusters Using Infrastructure-as-Code

The Yugabyte Platform console orchestrates and manages YugabyteDB clusters in one or more regions across public cloud and private, on-prem data centers. Yugabyte Platform console is a powerful interface with an immense amount of automation to set up your databases across all major cloud providers around the globe. Through the UI, you can easily deploy a fully scalable global cluster across several regions and even across different cloud providers in a matter of minutes. The UI is super intuitive and great, but you need an API to automate these operations in your way. In this blog post, we’ll highlight some of the key features of the Yugabyte Platform API and provide some next steps for getting started.

What is the Yugabyte Platform API?

Introduced in the release of YugabyteDB 2.8, the Yugabyte Platform API opens new doors for automating operations in your environment using your favorite tools and programming language. It allows you to programmatically interact with the Yugabyte Platform console to perform a variety of administrative functions using a secure RESTful API.

The new Yugabyte Platform API enables users to integrate Yugabyte Platform with all other aspects of their software development life cycle. This allows DevOps teams to create automation on their current processes across all their environments like dev, testing/QA, UAT, and production. For example, DevOps teams can leverage APIs to create ephemeral databases to run their CI/CD processes in lower environments for test purposes. Once it is done, they can just terminate the database deployment.

The Yugabyte Platform API reference guide provides details on all of the available endpoints, including parameters and responses. This guide is an essential resource for learning the ins and outs of the API.

Yugabyte Platform API functions and features

The first iteration of the Yugabyte Platform API focuses on the lifecycle of a cluster and associated functionality. The APIs allow you to create and delete universes, and set up environments and configurations. Using the APIs, you can create applications that automate repetitive manual tasks, such as spinning up new clusters and users for new applications. You can use it to integrate control plane functionality into other applications, or use it to build applications that provide real-time insight into your YugabyteDB ecosystem.

At a high level, the API can perform the following functions:

  • Managing the lifecycle of a cluster
  • Obtaining monitoring information for a cluster
  • Create/Edit/Show cloud provider
  • Show/Delete Backup Providers, Configs
  • Show/Delete Universe Backup Schedules and Status
  • Restore Backups from Schedule, Show Restore Status
  • Security – Encryption at Rest and at Transit
  • Create/Show/Delete Region and Zone
  • Create a new or specify existing VPC
  • Edit universe, cloud configuration, change regions, AZs, Instance configuration.
  • Scale up/down, Adding new nodes/decommission nodes
  • Rolling upgrades and Rolling restarts
  • Alerting, monitoring & notifications stack
  • Enable/disable alerts, List of active alerts/notifications
  • System health of TServer and Master nodes
  • Active/Remaining objects balancing in case of any fault or disaster

In addition, here are some key features worth exploring:

Secure access to the API

1. HTTPS-only: Users can only access the API via HTTPS, ensuring all data sent over the network is fully encrypted using TLS.

2. Key-based access: Each user or application who needs to connect to Yugabyte Platform must generate an API key before accessing the Yugabyte Platform API.

3. User access control: Each Yugabyte Platform user’s API capabilities validates the permissions granted by their user roles.

4. Audit: Yugabyte Platform lists all tasks performed using a particular API key along with the actor.

Automation using preferred programming languages

The Yugabyte Platform API (using Swagger Codegen) can simplify your build process by generating client SDKs for any API as they are defined with the OpenAPI specification. This allows your team to focus better on your API’s implementation and adoption. You can generate client SDKs in over 40 different languages for developers to easily integrate with the Platform API. Swagger Codegen is always updated with the latest and greatest changes in the programming world.

Integration with configuration management tools

Configuration management tools such as Puppet, Chef, and Ansible, which provide the ability to quickly automate config and deployment processes, have become a critical part of many enterprises teams’ plans when building new systems. Implementing an additional cloud service should fit alongside the configuration management methods you already use. The Yugabyte Platform API provides you with the ability to programmatically launch YugabyteDB clusters with your pre-existing toolset, ensuring a repeatable and reliable method that can be customized to your needs.

Postman public workspaces

Users can also import the Yugabyte Platform API Collection to your Postman Workspace and explore all the APIs available to create your automation.

2.8-Feature-Blog-Yugabyte-Platform-API-Image-1

Getting started with the Yugabyte Platform API

To see this new API in actio and try out a variety of other pre-built sample examples that do things like creating and deleting clusters, listing providers, and creating users.

Instead of manually setting up a GCP cloud provider as mentioned here, you can refer to these Python client examples to automate creation of a cloud provider. If you are a Go developer, please refer to this example to create a universe with a simple Go Client. This project uses a generated Swagger client using go-swagger. You can take advantage of these Yugabyte Platform API examples that you can use to learn the API and jumpstart your own application development.

Next steps

We’re very happy to release the Yugabyte Platform API as part of YugabyteDB 2.8. Beyond the examples provided above, we also invite you to learn more and try it out by:

Related Posts