AttachL3NetworksToIPsecConnection
API Request
URLs
POST zstack/v1/ipsec/{uuid}/l3networksHeaders
Authorization: OAuth the-session-uuidBody
{
"params": {
"l3NetworkUuids": [
"4b0779efacdc39a5b2dd4799e2452720"
]
},
"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":{"l3NetworkUuids":["4b0779efacdc39a5b2dd4799e2452720"]}}' \
http://localhost:8080/zstack/v1/ipsec/8f6fa5c86fd13968b8d8666f4b117aca/l3networksRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| l3NetworkUuids | 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": "3293505dd7de3a2aacca821c4a9d8b5e",
"name": "Test-IPSec",
"peerAddress": "100.64.10.10",
"authKey": "auth",
"vipUuid": "58d827fb56cb3fc394c89429c28c29a4",
"peerCidrs": [
{
"uuid": "185878e63f1c39c48de641f55f8a870b",
"cidr": "192.168.100.0/24",
"connectionUuid": "3293505dd7de3a2aacca821c4a9d8b5e",
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM"
}
],
"l3NetworkRefs": [
{
"uuid": "a1e9c14d5d9736c0885b6cc67238873e",
"connectionUuid": "3293505dd7de3a2aacca821c4a9d8b5e",
"l3NetworkUuid": "43253fb59d8c36b49f684278747bf209",
"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
AttachL3NetworksToIPsecConnectionAction action = new AttachL3NetworksToIPsecConnectionAction();
action.uuid = "8f6fa5c86fd13968b8d8666f4b117aca";
action.l3NetworkUuids = asList("4b0779efacdc39a5b2dd4799e2452720");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachL3NetworksToIPsecConnectionAction.Result res = action.call();Python
SDK
AttachL3NetworksToIPsecConnectionAction action = AttachL3NetworksToIPsecConnectionAction()
action.uuid = "8f6fa5c86fd13968b8d8666f4b117aca"
action.l3NetworkUuids = [4b0779efacdc39a5b2dd4799e2452720]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AttachL3NetworksToIPsecConnectionAction.Result res = action.call()