This document aims to help you quickly declare APIs for microservices to more effectively monitor and manage your APIs.
In the left navigation bar, click Service List and enter the service for which you want to declare APIs.
Navigate to the API Tab page.
There are two ways to declare the service's API:
Batch import APIs by uploading an API description file that supports the Swagger specification (.yaml
or .json
files), or by entering an API document URL that conforms to the OpenAPI 3.0 specification.
Note:
Parameter Explanation
Refer to the following explanations to configure related parameters.
Parameter | Description |
---|---|
Service Port | The listening port on which the service receives API requests. This port is the service's internal route, exposing the port number of the associated Deployment within the cluster. When there are multiple service ports, the default is the first service port. |
File Import | Batch import APIs contained in the uploaded file by uploading a file that supports the Swagger specification (.yaml or .json files) from local storage. |
Auto Load | Batch import APIs contained in the document by entering an online API document URL that conforms to the OpenAPI 3.0 specification. For example: http://<domain>:<port>/v3/example/api-docs . |
Parameter Explanation
Refer to the following explanations to configure related parameters.
Parameter | Description |
---|---|
Service Port | The listening port on which the service receives API requests. This port is the service's internal route, exposing the port number of the associated Deployment within the cluster. When there are multiple service ports, the default is the first service port. |
API | API Request Path: Enter the request path according to the selected matching method. Precise Match: For example, /path will precisely match that API query data;Regex Match: For example, /path/{param}/path , where {param} is a variable in the API.API Request Method: Single selection, supports GET, PUT, POST, DELETE, PATCH, HEAD, OPTIONS. |
Whether you use Batch Import or Manual Import, once successfully declared, you can view the declared APIs in the API list below.