ChangeIPSecConnectionState
API Request
URLs
PUT zstack/v1/ipsec/{uuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
{
"changeIPSecConnectionState": {
"stateEvent": "enable"
},
"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 OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"changeIPSecConnectionState":{"stateEvent":"enable"}}' \
http://localhost:8080/zstack/v1/ipsec/76424bb25d3a37c9961fff1116bc06da/actionsRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 2.3 | |
| stateEvent | String | body (contained in the changeIPSecConnectionState structure) |
|
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": "13b5a2cd8c5c30a9a47ba95802cf4e1a",
"name": "IPSec-1",
"state": "Enabled"
}
}| 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 |
| l3NetworkUuid | String | The L3 network UUID. | 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
ChangeIPSecConnectionStateAction action = new ChangeIPSecConnectionStateAction();
action.uuid = "76424bb25d3a37c9961fff1116bc06da";
action.stateEvent = "enable";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeIPSecConnectionStateAction.Result res = action.call();Python
SDK
ChangeIPSecConnectionStateAction action = ChangeIPSecConnectionStateAction()
action.uuid = "76424bb25d3a37c9961fff1116bc06da"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
ChangeIPSecConnectionStateAction.Result res = action.call()