This topic describes how to manage APIs through the console, including key steps such as specifying backend services for APIs, adding policies, and configuring consumer authentication.
Specify a backend service for an API
For APIs created outside an instance, the added interfaces inherit the configuration of their associated backend services by default, but you cannot edit the backend services.
For APIs created within an instance, the added interfaces inherit the configuration of their associated backend services by default, and you can also configure settings separately for each interface.
Log on to the Cloud-native API Gateway console. In the left navigation bar, select Instances, and select a region in the top menu bar.
On the Instances page, click the ID of the target gateway instance. In the left navigation bar, select APIs, and click the target API.
On the API Details tab of the target interface, click Edit next to Backend Service.
In the Backend Service section, configure the relevant parameters and click OK.
Parameter
Description
Configuration Mode
The default Configuration Mode is Inherit From API.
Configure Separately For Interface: The interface is associated with a backend service separately, which takes precedence over the API-level configuration.
Inherit From API: Inherits from the backend service associated with the API.
Scenario
Select the scenario for the current interface.
Basic scenarios: Single Service, Mock.
Grayscale scenarios: By Proportion (Multiple Services), By Content (Multiple Services), Tag-based Routing (By Proportion).
NoteThe sum of the traffic percentages of the destination services must be 100%.
Backend Service
Associate a backend service under this gateway/VPC. If there are no backend services under this gateway, you can click Create Service to create one.
ImportantWhen creating a new service, the service port information may not appear immediately. You need to expand the Service Name dropdown list and click Refresh. Because port information synchronization is performed asynchronously, you may need to wait a moment for the complete service port information to load and display.
Debug an API
Prerequisites
You have published the API.
Procedure
Cloud-native API Gateway provides two ways to debug APIs: outside an instance and within an instance:
APIs outside an instance
Log on to the Cloud-native API Gateway console. In the left navigation bar, select APIs, and select a region in the top menu bar.
Click the target API.
APIs within an instance
Log on to the Cloud-native API Gateway console. In the left navigation bar, select Instances, and select a region in the top menu bar.
On the Instances page, click the ID of the target gateway instance. In the left navigation bar, select APIs, and click the target API.
On the API List tab, select the API that you want to debug, and click Debug.
In the Debug API panel, configure the relevant parameters, and then click Send Request to debug.
Edit an API
Cloud-native API Gateway provides two ways to edit APIs: outside an instance and within an instance:
APIs outside an instance
Log on to the Cloud-native API Gateway console. In the left navigation bar, select APIs, and select a region in the top menu bar.
Click the target API. On the API List tab, select the API that you want to edit, and click Edit.
In the Edit API panel, you can modify the Basic Information, Request Definition, Response Definition, Mock, and Consumer Authentication of the API.
APIs within an instance
Log on to the Cloud-native API Gateway console. In the left navigation bar, select Instances, and select a region in the top menu bar.
On the Instances page, click the ID of the target gateway instance. In the left navigation bar, select APIs, and click the target API.
On the API List tab, select the API that you want to edit, and click Edit.
In the Edit API panel, you can modify the Basic Information, Request Definition, Response Definition, and Consumer Authentication of the API.
Stress test
Prerequisites
You have published the API.
Procedure
Cloud-native API Gateway provides two ways to perform stress tests: outside an instance and within an instance:
APIs outside an instance
Log on to the Cloud-native API Gateway console. In the left navigation bar, select APIs, and select a region in the top menu bar.
Click the target API.
APIs within an instance
Log on to the Cloud-native API Gateway console. In the left navigation bar, select Instances, and select a region in the top menu bar.
On the Instances page, click the ID of the target gateway instance. In the left navigation bar, select APIs, and click the target API.
On the API List tab, select the API that you want to stress test, and click . For detailed operations, see PTS Quick Start.
Delete an API
The delete operation is irreversible. Exercise caution when performing this operation.
Cloud-native API Gateway provides two ways to delete APIs: outside an instance and within an instance:
APIs outside an instance
Log on to the Cloud-native API Gateway console. In the left navigation bar, select APIs, and select a region in the top menu bar.
Click the target API.
APIs within an instance
Log on to the Cloud-native API Gateway console. In the left navigation bar, select Instances, and select a region in the top menu bar.
On the Instances page, click the ID of the target gateway instance. In the left navigation bar, select APIs, and click the target API.
On the API List tab, select the API that you want to delete, and click , and then click OK in the confirmation dialog box.