AddRemoteCidrsToIPsecConnection
API Request
URLs
POST zstack/v1/ipsec/{uuid}/remote-cidrsHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"peerCidrs": [
"192.168.100.0/24"
]
},
"systemTags": [],
"userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.Curl
Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"peerCidrs":["192.168.100.0/24"]}}' \
http://localhost:8080/zstack/v1/ipsec/053658b061363df4be557d13ee0baaef/remote-cidrsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| peerCidrs | List | body (contained in the params structure) | 2.3 | ||
| resourceUuid | String | body (contained in the params structure) | Optional. | 2.3 | |
| systemTags | List | body | Optional. The system tags. | 2.3 | |
| userTags | List | body | Optional. The user tags. | 2.3 |
API Response
Sample
Response
{
"inventory": {
"uuid": "55c06a7088a5341c8b4ebed294282bfe",
"name": "Test-IPSec",
"peerAddress": "100.64.10.10",
"authKey": "auth",
"vipUuid": "a66955e81e893c0f81effba08f1f2f94",
"peerCidrs": [
{
"uuid": "15b9949bc0553aeeaf53e96a1b437e7c",
"cidr": "192.168.100.0/24",
"connectionUuid": "55c06a7088a5341c8b4ebed294282bfe",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"l3NetworkRefs": [
{
"uuid": "1223ba4c4d0533feb975ff45027ab47f",
"connectionUuid": "55c06a7088a5341c8b4ebed294282bfe",
"l3NetworkUuid": "163595b272913065b082d890a68d96a7",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
]
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 2.3 |
| inventory | IPsecConnectionInventory | See inventory. | 2.3 |
#error
| Name | Type | Description | Starting Version |
|---|---|---|---|
| code | String | The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. | 2.3 |
| description | String | The brief description of the error. | 2.3 |
| details | String | The details about the error. | 2.3 |
| elaboration | String | The reserved field. Default value: null. | 2.3 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 2.3 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 2.3 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| name | String | The resource name. | 2.3 |
| description | String | The detailed description of the resource. | 2.3 |
| peerAddress | String | 2.3 | |
| authMode | String | 2.3 | |
| authKey | String | 2.3 | |
| vipUuid | String | The VIP UUID. | 2.3 |
| ikeAuthAlgorithm | String | 2.3 | |
| ikeEncryptionAlgorithm | String | 2.3 | |
| ikeDhGroup | Integer | 2.3 | |
| policyAuthAlgorithm | String | 2.3 | |
| policyEncryptionAlgorithm | String | 2.3 | |
| pfs | String | 2.3 | |
| policyMode | String | 2.3 | |
| transformProtocol | String | 2.3 | |
| state | String | 2.3 | |
| status | String | 2.3 | |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
| peerCidrs | List | See peerCidrs. | 2.3 |
| l3NetworkRefs | List | See l3NetworkRefs. | 2.3 |
#peerCidrs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| cidr | String | 2.3 | |
| connectionUuid | String | 2.3 | |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
#l3NetworkRefs
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 2.3 |
| connectionUuid | String | 2.3 | |
| l3NetworkUuid | String | The L3 network UUID. | 2.3 |
| createDate | Timestamp | The creation date. | 2.3 |
| lastOpDate | Timestamp | The last operation date. | 2.3 |
SDK Sample
Java
SDK
AddRemoteCidrsToIPsecConnectionAction action = new AddRemoteCidrsToIPsecConnectionAction();
action.uuid = "053658b061363df4be557d13ee0baaef";
action.peerCidrs = asList("192.168.100.0/24");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AddRemoteCidrsToIPsecConnectionAction.Result res = action.call();Python
SDK
AddRemoteCidrsToIPsecConnectionAction action = AddRemoteCidrsToIPsecConnectionAction()
action.uuid = "053658b061363df4be557d13ee0baaef"
action.peerCidrs = [192.168.100.0/24]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AddRemoteCidrsToIPsecConnectionAction.Result res = action.call()