API property descriptions
This topic describes the properties to configure when you create and publish an API in the CNStack console.
API definition
Basic information
Property | Required | Description |
API name | Yes |
|
Create from an existing API | No |
|
API group | Yes |
|
API description | No | A description of the API's purpose. Up to 64 characters. |
Application | Yes |
|
OperationType | Yes |
|
Request path | Yes |
|
Method | Yes | The action to perform on the HTTP resource:
|
Path matching rule | Yes |
|
Security authentication | Yes |
|
Interface name | Yes |
|
Service identity | No | Optional. Specify a service by its uniqueId. |
Method name | Yes |
|
Message type | Yes | The media type of the request and response. This tells the server how to process request data. It also tells the client, typically a browser, how to parse response data. |
Message encoding | Yes | The character set that the client accepts for text content. |
Entity parameter | No | The full path of the entity parameter used by the client Dubbo service interface method. For example, `Ljava/lang/String;`. Custom parameter entities must end with a semicolon (;). |
Return parameter | No | The full path of the return parameter from the client Dubbo service interface method. For example, `Ljava/lang/String;`. Custom parameter entities must end with a semicolon (;). |
Dubbo group | No | The service group for the client Dubbo service interface subscription. |
Request parameters
Request parameters are the parameters in a request that a client sends to the gateway.
Property | Required | Description |
Parameter name | No | A unique identifier for the parameter. |
Parameter location | No |
|
Type | No |
|
Default value | No | The default value used when the parameter value in the API request is empty. The default value type must match the parameter type. |
Description | No | A business description of the parameter. |
Request Body Type | No | The type of the request body. These are parameters configured for requests that the client sends to the gateway. You can use existing data models. When you use the orchestration feature, an API must have a data model selected to transform and pass through parameters. To generate a software development kit (SDK) in an API group, you must select a data model for the request body or response body.
|
Response parameters
Property | Required | Description |
Successful response example | No | A sample of the data returned on a successful request. This serves as a reference for API subscribers. |
Failed response example | No | A sample of the data returned on a failed request. This serves as a reference for API subscribers. |
Error code | No | Default HTTP error codes. |
Error message | No | A custom error message. |
Description | No | A business description of the error code. |
Response body type | No | The parameters of the response. You can use existing data models. When you use the orchestration feature, an API must have a data model selected to transform and pass through parameters. To generate an SDK in an API group, you must select a data model for the request body or response body.
|
Backend configuration
Property | Required | Description |
Backend service type | Yes | The type of backend service to which the gateway forwards requests:
|
Protocol Type | Yes | The communication protocol used by the backend service that accepts the forwarded request. Supported protocols:
|
Request path | No | The actual request path on the server. If you leave this empty, the request path from the API definition is used by default. |
Path stripping level | No | Only numbers are supported. |
Append path prefix | No | The path prefix to add to the backend request. The prefix must start with a forward slash (/) but not end with one. |
Timeout | Yes | The API request timeout period in milliseconds (ms). The default value is 3000 ms. |
Routing policy | Yes | The policy used by the gateway to route requests:
|
Interface name | Yes |
|
Method name | Yes |
|
Entity parameter | No | The full path of the entity parameter used by the server-side Dubbo service interface method. For example, `Ljava/lang/String;`. Custom parameter entities must end with a semicolon (;). |
Return parameter | No | The full path of the return parameter from the server-side Dubbo service interface method. For example, `Ljava/lang/String;`. Custom parameter entities must end with a semicolon (;). |
Dubbo group | No | The service group for the server-side Dubbo service interface subscription. |
System cluster | Yes | Select the system cluster to attach to the backend. |
Parameter mapping configuration | No | Configure mappings between request and response parameters. You can select an existing parameter mapping rule. |