Bookmark this page

Chapter 2. Managing APIs with Red Hat 3scale API Management

Abstract

Goal Manage your cloud-native APIs with the Red Hat 3scale Admin Portal.
Objectives
  • Create Backends and Products in the Admin Portal. Describe the process to promote APIs from Development to Production.

  • Create application plans and set rate limits for APIs.

  • Create and configure multiple versions of APIs.

  • Discover applications deployed on OpenShift automatically.

  • Create multiple tenants in Red Hat 3scale API Management.

Sections
  • Creating Backends and Products (and Guided Exercise)

  • Creating Application Plans and Rate Limits (and Guided Exercise)

  • Managing API Versions (and Guided Exercise)

  • Configuring Service Discovery (and Guided Exercise)

  • Creating Multiple Tenants in Red Hat 3Scale API Management (and Guided Exercise)

  • Managing APIs with Red Hat 3scale API Management (Quiz)

Creating Backends and Products

Objectives

After completing this section, you should be able to create Backends and Products in the Admin Portal. Describe the process to promote APIs from Development to Production.

Introducing 3scale API Management Backends and Products

3scale API Management acts as a configurable proxy to your applications. It also provides functionality for various API management tasks, such as billing and usage monitoring. Backends and products are two of the main types of objects in 3scale API Management.

Conceptually, you can imagine requests traversing through the various parts of your configuration.

Figure 2.1: Conceptual request flow

In the preceding diagram, note that the underlying APIs are not publicly exposed.

Backends

A backend represents a deployed application by pointing to its root URL.

For example, a REST API is hosted at http://myapp.example.com and provides a /ping endpoint. The full path to the endpoint would be http://myapp.example.com/ping.

However, the URL of the 3scale backend would solely contain http://myapp.example.com. This allows the requester to reach multiple endpoints with a single backend for an application.

Backends are associated with one or more products. By associating a backend to a product, the product's users can access the underlying API.

Creating a Backend with the Admin Portal

Navigate to backend management with the top pane drop-down menu within the admin portal.

Figure 2.2: 3scale top pane navigation

From here, you can create new backends and manage existing ones.

To create a new backend, click Create Backend, fill out the form, and submit it.

Products

Products, previously called services, represent a collection of 3scale objects that pertain to a specific client or group of users.

Products contain the following 3scale configuration objects:

  • Application plans

  • Applications

  • A map of backends to applications

Note that backends do not belong to a product. This is because the same backend can be associated with several different products. Different products do not need separate backends for the same underlying API.

Creating a Product with the 3scale Toolbox

Currently, the 3scale Toolbox CLI tool provides super-commands labeled product and service. Inspect the service super-command when you manage products, because not all of the features have been moved to the product super-command.

The service super-command provides the following sub-commands:

  • Create

  • Copy

  • Delete

  • Show

  • List

  • Apply

Note that 3scale service apply is used to modify the service.

For example, to create a new product, use the following command:

[user@host ~]$ 3scale service create \ 1
3scale-tenant \ 2
library-product3

1

Specifies that you want to create a new product.

2

Puts the product in the 3scale-tenant tenant.

3

Names the product library-product.

Managing a Product with the Admin Portal

Navigate to product management with the top pane drop-down menu within the admin portal.

From here, you can create new products and manage existing ones.

After selecting a product to work within, the left-hand pane is used to navigate between the management pages for components within that product.

Figure 2.3: Product left pane navigation.

For example, in the previous screenshot, the library-product is selected. Click ApplicationsApplication Plans to manage application plans within that product.

Associating Backends with Products by using the Admin Portal

To use a backend within a product, you must first associate the two. Within the product section in the admin portal, navigate to IntegrationBackends.

This page shows the list of backends currently accessible by the product, their URLs, and the product path to access them. To add an existing backend to the product, click Add Backend, select the backend, and provide a path. This path is a suffix that maps to the backend.

Note that backend paths must be unique within a product, as they are what the router uses to direct requests to the correct backend.

Promoting Configurations to Staging and Production

Within the product section in the admin portal, navigate to IntegrationConfiguration. This page shows the status of your staging and production environments.

Changes you make to a product are not live until you promote the configuration. If you have any changes not yet in the staging environment then the Configuration item shows a warning icon.

Figure 2.4: A warning icon shows that there are changes to be promoted.

The two environments are staging and production. Each environment can have separate configurations, but changes must go to the staging environment first.

To promote configuration changes to the staging environment, click Promote v. X to Staging APIcast, where X is an auto-incrementing version number.

After promoting changes to staging, you can then promote them to production by clicking Promote v. X to Production APIcast.

 

References

For more information, refer to the Adding backends to a product chapter in the Red Hat 3scale API Management Getting Started Guide at https://access.redhat.com/documentation/en-us/red_hat_3scale_api_management/2.8/html/getting_started/first-steps#adding-backends-product

Revision: do240-2.11-40390f6