routing-prefix
This command adds a routing prefix for the API collection.
Syntax
routing-prefix type prefix
Parameters
- type
- Specifies the type of the routing prefix. The API gateway supports the following types.
uri- Uses a URI as the routing prefix. This setting is the default value.
host- Uses a hostname as the routing prefix.
- prefix
- Specifies the prefix that is used to form the complete routing path to the API. The routing
prefix is case sensitive.
- When the type is
uri, the default value is/(slash). - When the type is
host, the default value is blank.
- When the type is
Guidelines
The routing-prefix command adds a prefix of the routing path. Use this command
for each routing prefix to add.
- When the type is
uri, the prefix must begin but not end with slash (/). For example,/foo - When the type is
host, the prefix must not start or end with period (.). You need to specify only the first part of the hostname (with domain name excluded), however, the request must use the complete URL with domain name included.
The API gateway uses the routing prefix to form the complete URI
prefix/base_path/operation_path
and accepts only the incoming requests with this URI. In the complete URI,
base_path is the base path on which the API is served, and
operation_path is the relative path to the base path where the
operations are available.
Examples
Set
/foo as the URI type of routing prefix.
# routing-prefix uri /foo