Adding a Forwarding Rule
API Format
|
Method |
URI |
Description |
|---|---|---|
|
POST |
/v2.0/lbaas/l7policies/{l7policy_id}/rules |
Adds a forwarding rule. |
Constraints
The type of forwarding rules for the same forwarding policy cannot be the same.
Procedure
- Set the request header. Set the header in Postman and place the obtained token in the header.
- Create a forwarding rule for the request whose name starts with /music.
POST https://elb.cn-east-2.myhuaweicloud.com/v2.0/lbaas/l7policies/5b94fb42-b018-4ad6-9ba6-0e8a509c6821/rules { "rule": { "compare_type": "STARTS_WITH", "type": "PATH", "value": "/music" } } - Create a forwarding rule for the request whose name starts with /pic.
POST https://elb.cn-east-2.myhuaweicloud.com/v2.0/lbaas/l7policies/f6c5862d-460c-4ab6-8dc7-2294df442f67/rules { "rule": { "compare_type": "STARTS_WITH", "type": "PATH", "value": "/pic" } } - Check the created forwarding rules on the web console.
Last Article: Adding a Forwarding Policy
Next Article: Adding a Whitelist
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.