Creating a VPN Access Policy
Function
This API is used to create an access policy on a specified VPN server.
Calling Method
For details, see Calling APIs.
URI
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
project_id |
String |
Yes |
Specifies a project ID. You can obtain the project ID by referring to Obtaining the Project ID. |
vpn_server_id |
String |
Yes |
Specifies the ID of a VPN server. |
Parameter |
Type |
Mandatory |
Description |
---|---|---|---|
X-Client-Token |
String |
No |
|
Request
- Request parameters
Table 3 Request parameters Parameter
Type
Mandatory
Description
access_policy
Yes
Specifies the to-be-created VPN access policy object.
Table 4 CreateVpnAccessPolicyRequestBodyContent Parameter
Type
Mandatory
Description
name
String
Yes
- Specifies the name of an access policy.
user_group_id
String
Yes
- Specifies the ID of a VPN user group.
- The value is a UUID containing 36 characters.
description
String
No
Specifies access policy description.
dest_ip_cidrs
Array of strings
Yes
- Specifies the list of destination CIDR blocks.
- The value is in the format of dotted decimal notation/mask, for example, 192.168.1.0/24.
- There must be at least one CIDR block. A maximum of 10 CIDR blocks are supported.
- Example request
POST https://{Endpoint}/v5/{project_id}/p2c-vpn-gateways/vpn-servers/{vpn_server_id}/access-policies { "access_policy": { "name": "policy-001", "user_group_id": "7625fd92-2e20-4e4d-8c56-66f110fbfaa8", "description": "AccessPolicy1", "dest_ip_cidrs": [ "172.16.0.0/24", "172.16.1.0/24" ] } }
Response
- Response parameters
Returned status code 201: successful operation
Table 5 Parameters in the response body Parameter
Type
Description
access_policy
access_policy object
Specifies the access policy object.
request_id
String
Specifies a request ID.
- Example response
{ "access_policy": { "id": "4f746482-a575-4e1f-9e80-5f6f69ff8588" }, "request_id": "1663cd8cacbb3497ebc88877e5a3ad89" }
Status Codes
For details, see Status Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.