Document navigation

IPsec Operations

CreateIPsecConnection

API Request

URLs

POST zstack/v1/ipsec

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "name": "Test-IPSec",
    "vipUuid": "cefa2f4e56ef33e496ccbb5879850f76",
    "peerAddress": "100.64.10.10",
    "authMode": "psk",
    "authKey": "auth",
    "idType": "ip",
    "localId": "1.1.1.1",
    "remoteId": "2.2.2.2",
    "l3NetworkUuid": "a4097ba23a7e38339029e1839bb415e1",
    "peerCidrs": [
      "192.168.100.0/24"
    ],
    "ikeVersion": "ikev2",
    "ikeAuthAlgorithm": "sha256",
    "ikeEncryptionAlgorithm": "aes-256",
    "ikeDhGroup": 2.0,
    "ikeLifeTime": 86400.0,
    "policyAuthAlgorithm": "sha256",
    "policyEncryptionAlgorithm": "aes-256",
    "pfs": "dh-group14",
    "policyMode": "tunnel",
    "transformProtocol": "esp",
    "lifeTime": 3600.0
  },
  "systemTags": [],
  "userTags": []
}

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":{"name":"Test-IPSec","vipUuid":"cefa2f4e56ef33e496ccbb5879850f76","peerAddress":"100.64.10.10","authMode":"psk","authKey":"auth","idType":"ip","localId":"1.1.1.1","remoteId":"2.2.2.2","l3NetworkUuid":"a4097ba23a7e38339029e1839bb415e1","peerCidrs":["192.168.100.0/24"],"ikeVersion":"ikev2","ikeAuthAlgorithm":"sha256","ikeEncryptionAlgorithm":"aes-256","ikeDhGroup":2.0,"ikeLifeTime":86400.0,"policyAuthAlgorithm":"sha256","policyEncryptionAlgorithm":"aes-256","pfs":"dh-group14","policyMode":"tunnel","transformProtocol":"esp","lifeTime":3600.0}}' \
http://localhost:8080/zstack/v1/ipsec

Request Parameters

Name Type Location Description Optional Value Starting Version
name String body (contained in the params structure) The resource name. 0.6
description String body (contained in the params structure) Optional. The detailed description of the resource. 0.6
l3NetworkUuid String body (contained in the paramsstructure) Optional. The L3 network UUID. 2.3
peerAddress String body (contained in the params structure) The remote network address. 0.6
authMode String body (contained in the params structure) Optional. The authentication mode.
  • psk
  • certs
0.6
authKey String body (contained in the params structure) The authentication key. 0.6
idType String body (contained in the params structure) The ID configuration method.
  • ip
  • name
  • fqdn
4.5.0
vipUuid String body (contained in the params structure) The VIP UUID. 0.6
localId String body (contained in the params structure) Optional. The local ID. 4.5.0
remoteId String body (contained in the params structure) Optional. The remote ID. 4.5.0
peerCidrs List body (contained in the params structure) Optional. The detination network Cidrs. 4.5.0
ikeVersion String body (contained in the params structure) Optional. The IKE version.
  • ike
  • ikev1
  • ikev2
4.5.0
ikeAuthAlgorithm String body (contained in the params structure) Optional. The IKE authentication algorithm.
  • md5
  • sha1
  • sha256
  • sha384
  • sha512
0.6
ikeEncryptionAlgorithm String body (contained in the params structure) Optional. The IKE encryption algorithm.
  • 3des
  • aes-128
  • aes-192
  • aes-256
0.6
ikeDhGroup int body (contained in the params structure) Optional. The IKE DH Group. 4.5.0
ikeLifeTime int body (contained in the params structure) Optional. The IKE lifetime. 4.5.0
policyAuthAlgorithm String body (contained in the params structure) Optional. The ESP authentication algorithm.
  • md5
  • sha1
  • sha256
  • sha384
  • sha512
0.6
policyEncryptionAlgorithm String body (contained in the params structure) Optional. The ESP encryption algorithm.
  • 3des
  • aes-128
  • aes-192
  • aes-256
0.6
pfs String body (contained in the params structure) Optional. The perfect forward secrecy.
  • none
  • dh-group0
  • dh-group2
  • dh-group5
  • dh-group14
  • dh-group15
  • dh-group16
  • dh-group17
  • dh-group18
  • dh-group19
  • dh-group20
  • dh-group21
  • dh-group22
  • dh-group23
  • dh-group24
  • dh-group25
  • dh-group26
4.5.0
policyMode String body (contained in the params structure) Optional. The policy mode.
  • tunnel
  • transport
0.6
transformProtocol String body (contained in the params structure) Optional. The transform protocol.
  • esp
  • ah
  • ah-esp
0.6
resourceUuid String body (contained in the params structure) Optional. The resource UUID. 0.6
tagUuids List body (contained in the params structure) Optional. The tag UUID list. 4.5.0
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample Response

{
  "inventory": {
    "name": "Test-IPSec",
    "peerAddress": "100.64.10.10",
    "authKey": "auth",
    "vipUuid": "6a33d0d912263fd7a47d036eead9a27f",
    "status": "Connecting",
    "ikeLifeTime": 0.0,
    "lifeTime": 0.0,
    "peerCidrs": [
      {
        "uuid": "199b04405d1e3fef83fd67a7a1f77bb3",
        "cidr": "192.168.100.0/24",
        "connectionUuid": "6deaa1c0ffd43f8eb3ebe2e8e7e66811",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "l3NetworkRefs": [
      {}
    ]
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory IPsecConnectionInventory See inventory. 0.6

#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. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6

#inventory

Name Type Description Starting Version
uuid String The resource UUID. 0.6
name String The resource name. 0.6
description String The detailed description of the resource. 0.6
peerAddress String The remote network address. 4.5.0
authMode String The authentication mode. 4.5.0
authKey String The authentication key. 4.5.0
vipUuid String The VIP UUID. 0.6
ikeAuthAlgorithm String The IKE authentication algorithm. 4.5.0
ikeEncryptionAlgorithm String The IKE encryption algorithm. 4.5.0
ikeDhGroup Integer The IKE DH group. 4.5.0
policyAuthAlgorithm String The ESP authentication algorithm. 4.5.0
policyEncryptionAlgorithm String The ESP encryption algorithm. 4.5.0
pfs String The PFS DH group. 4.5.0
policyMode String The encryption mode. 4.5.0
transformProtocol String The security protocol. 4.5.0
ikeVersion String The IKE version. 4.5.0
idType String The ID configuration method. 4.5.0
localId String The local ID. 4.5.0
remoteId String The remote ID. 4.5.0
state String The running state. 4.5.0
status String The ready status. 4.5.0
ikeLifeTime int The IKE lifetime. 4.5.0
lifeTime int The IPsec lifetime. 4.5.0
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
peerCidrs List See peerCidrs. 0.6
l3NetworkRefs List See l3NetworkRefs. 2.3

#peerCidrs

Name Type Description Starting Version
uuid String The resource UUID. 0.6
cidr String The cidr. 0.6
connectionUuid String The connection UUID. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

#l3NetworkRefs

Name Type Description Starting Version
uuid String The resource UUID. 2.3
connectionUuid String The connection UUID. 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

CreateIPsecConnectionAction action = new CreateIPsecConnectionAction();
action.name = "Test-IPSec";
action.vipUuid = "cefa2f4e56ef33e496ccbb5879850f76";
action.peerAddress = "100.64.10.10";
action.authMode = "psk";
action.authKey = "auth";
action.idType = "ip";
action.localId = "1.1.1.1";
action.remoteId = "2.2.2.2";
action.l3NetworkUuid = "a4097ba23a7e38339029e1839bb415e1";
action.peerCidrs = asList("192.168.100.0/24");
action.ikeVersion = "ikev2";
action.ikeAuthAlgorithm = "sha256";
action.ikeEncryptionAlgorithm = "aes-256";
action.ikeDhGroup = 2.0;
action.ikeLifeTime = 86400.0;
action.policyAuthAlgorithm = "sha256";
action.policyEncryptionAlgorithm = "aes-256";
action.pfs = "dh-group14";
action.policyMode = "tunnel";
action.transformProtocol = "esp";
action.lifeTime = 3600.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateIPsecConnectionAction.Result res = action.call();

Python SDK

action = CreateIPsecConnectionAction()
action.name = "Test-IPSec"
action.vipUuid = "cefa2f4e56ef33e496ccbb5879850f76"
action.peerAddress = "100.64.10.10"
action.authMode = "psk"
action.authKey = "auth"
action.idType = "ip"
action.localId = "1.1.1.1"
action.remoteId = "2.2.2.2"
action.l3NetworkUuid = "a4097ba23a7e38339029e1839bb415e1"
action.peerCidrs = [192.168.100.0/24]
action.ikeVersion = "ikev2"
action.ikeAuthAlgorithm = "sha256"
action.ikeEncryptionAlgorithm = "aes-256"
action.ikeDhGroup = 2.0
action.ikeLifeTime = 86400.0
action.policyAuthAlgorithm = "sha256"
action.policyEncryptionAlgorithm = "aes-256"
action.pfs = "dh-group14"
action.policyMode = "tunnel"
action.transformProtocol = "esp"
action.lifeTime = 3600.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

DeleteIPsecConnection

API Request

URLs

DELETE zstack/v1/ipsec/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/ipsec/7176e70d92953235998cce8b486e2467

Request Parameters

Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
deleteMode String body Optional. The delete mode. 4.5.0
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,

{
"error": {
"code": "SYS.1001",
"description": "A message or a operation timeout",
"details": "Create VM on KVM timeout after 300s"
    }
}

SDK Sample

Java SDK

DeleteIPsecConnectionAction action = new DeleteIPsecConnectionAction();
action.uuid = "2935596566fa421f833a801d501dbb53";
action.deleteMode = "Permissive";
action.sessionId = "7392673bd2244ad2a63280e81f9a7014";
DeleteIPsecConnectionAction.Result res = action.call();

Python SDK

action = DeleteIPsecConnectionAction()
action.uuid = "808078c31bdd499591bc009b8ae3446f"
action.deleteMode = "Permissive"
action.sessionId = "fcafdabd9a5e47c5ae7ff92c121173f9"
res = action.call()

QueryIPSecConnection

API Request

URLs

GET zstack/v1/ipsec
GET zstack/v1/ipsec/{uuid}

Headers

Authorization: OAuth the-session-uuid

Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/ipsec
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X GET http://localhost:8080/zstack/v1/ipsec/ea540aa23c0b36a887cd93a912fd0c32

Queryable Fields

You can check all queryable fields and resource names that can be queried across tables by using zstack-cli, entering QueryIPSecConnection, and pressing the Tab key.

API Response

Sample Response

{
  "inventories": [
    {
      "name": "Test-IPSec",
      "peerAddress": "100.64.10.10",
      "authKey": "auth",
      "vipUuid": "ca0f405c79ea3b53aa588f58ed10e410",
      "ikeLifeTime": 0.0,
      "lifeTime": 0.0,
      "peerCidrs": [
        {
          "uuid": "72744840ae243518859730e99ea42157",
          "cidr": "192.168.100.0/24",
          "connectionUuid": "9d832d652fc732d6a5cebe1d8173c6c9",
          "createDate": "Nov 14, 2017 10:20:57 PM",
          "lastOpDate": "Nov 14, 2017 10:20:57 PM"
        }
      ],
      "l3NetworkRefs": [
        {}
      ]
    }
  ]
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventories List See inventories. 0.6

#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. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6

#inventories

Name Type Description Starting Version
uuid String The resource UUID. 0.6
name String The resource name. 0.6
description String The detailed description of the resource. 0.6
peerAddress String The remote network address. 4.5.0
authMode String The authentication mode. 4.5.0
authKey String The authentication key. 4.5.0
vipUuid String The VIP UUID. 0.6
ikeAuthAlgorithm String The IKE authentication algorithm. 4.5.0
ikeEncryptionAlgorithm String The IKE encryption algorithm. 4.5.0
ikeDhGroup Integer The IKE DH group. 4.5.0
policyAuthAlgorithm String The ESP authentication algorithm. 4.5.0
policyEncryptionAlgorithm String The ESP encryption algorithm. 4.5.0
pfs String The PFS DH group. 4.5.0
policyMode String The encryption mode. 4.5.0
transformProtocol String The security protocol. 4.5.0
ikeVersion String The IKE version. 4.5.0
idType String The ID configuration method. 4.5.0
localId String The local ID. 4.5.0
remoteId String The remote ID. 4.5.0
state String The running state. 4.5.0
status String The ready status. 4.5.0
ikeLifeTime int The IKE lifetime. 4.5.0
lifeTime int The IPsec lifetime. 4.5.0
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
peerCidrs List See peerCidrs. 0.6
l3NetworkRefs List See l3NetworkRefs. 2.3

#peerCidrs

Name Type Description Starting Version
uuid String The resource UUID. 0.6
cidr String The cidr. 0.6
connectionUuid String The connection UUID. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

#l3NetworkRefs

Name Type Description Starting Version
uuid String The resource UUID. 2.3
connectionUuid String The connection UUID. 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

QueryIPSecConnectionAction action = new QueryIPSecConnectionAction();
action.conditions = asList();
action.sessionId = "2da0145074b749de95a5f7e6197dedf5";
QueryIPSecConnectionAction.Result res = action.call();

Python SDK

action = QueryIPSecConnectionAction()
action.conditions = []
action.sessionId = "39df08f032b9490a853c60158dee9140"
res = action.call()

UpdateIPsecConnection

API Request

URLs

PUT zstack/v1/ipsec/{uuid}

Headers

Authorization: OAuth the-session-uuid

Body

{
  "updateIPsecConnection": {
    "name": "test Ipsec",
    "description": "info",
    "deleteMode": "Permissive"
  },
  "systemTags": [],
  "userTags": []
}

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 PUT -d '{"updateIPsecConnection":{"name":"test Ipsec","description":"info"}}' \
http://localhost:8080/zstack/v1/ipsec/1bcf0b898cf33f05b29edeb54a87ed82

Request Parameters

Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 0.6
name String body (contained in the updateIPsecConnection structure) Optional. The resource name. 0.6
description String body (contained in the updateIPsecConnection structure) Optional. The detailed description of the resource. 0.6
deleteMode String body (contained in the updateIPsecConnection structure) Optional. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6

API Response

Sample Response

{
  "inventory": {
    "name": "Test-IPSec",
    "description": "desc info ",
    "peerAddress": "100.64.10.10",
    "authKey": "auth",
    "vipUuid": "7c94b57b6daa38c9b6862f11101e9612",
    "ikeLifeTime": 0.0,
    "lifeTime": 0.0,
    "peerCidrs": [
      {
        "uuid": "4796b27ab42d3baba893ea3d34c723e4",
        "cidr": "192.168.100.0/24",
        "connectionUuid": "2ce0380d4a5e3aed95b1511682926aeb",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "l3NetworkRefs": [
      {}
    ]
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory IPsecConnectionInventory See inventory. 0.6

#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. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6

#inventory

Name Type Description Starting Version
uuid String The resource UUID. 0.6
name String The resource name. 0.6
description String The detailed description of the resource. 0.6
peerAddress String The remote network address. 4.5.0
authMode String The authentication mode. 4.5.0
authKey String The authentication key. 4.5.0
vipUuid String The VIP UUID. 0.6
ikeAuthAlgorithm String The IKE authentication algorithm. 4.5.0
ikeEncryptionAlgorithm String The IKE encryption algorithm. 4.5.0
ikeDhGroup Integer The IKE DH group. 4.5.0
policyAuthAlgorithm String The ESP authentication algorithm. 4.5.0
policyEncryptionAlgorithm String The ESP encryption algorithm. 4.5.0
pfs String The PFS DH group. 4.5.0
policyMode String The encryption mode. 4.5.0
transformProtocol String The security protocol. 4.5.0
ikeVersion String The IKE version. 4.5.0
idType String The ID configuration method. 4.5.0
localId String The local ID. 4.5.0
remoteId String The remote ID. 4.5.0
state String The running state. 4.5.0
status String The ready status. 4.5.0
ikeLifeTime int The IKE lifetime. 4.5.0
lifeTime int The IPsec lifetime. 4.5.0
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
peerCidrs List See peerCidrs. 0.6
l3NetworkRefs |List| See l3NetworkRefs. 2.3

#peerCidrs

Name Type Description Starting Version
uuid String The resource UUID. 0.6
cidr String The cidr. 0.6
connectionUuid String The connection UUID. 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6

#l3NetworkRefs

Name Type Description Starting Version
uuid String The resource UUID. 2.3
connectionUuid String The connection UUID. 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

UpdateIPsecConnectionAction action = new UpdateIPsecConnectionAction();
action.uuid = "cedcb7a02f1548cbb8a68665cab0b191";
action.name = "test Ipsec";
action.description = "info";
action.deleteMode = "Permissive";
action.sessionId = "4e74102f098948cf97781ee6604b1571";
UpdateIPsecConnectionAction.Result res = action.call();

Python SDK

action = UpdateIPsecConnectionAction()
action.uuid = "dba5bbf127124fe2a3def62bcb96743d"
action.name = "test Ipsec"
action.description = "info"
action.deleteMode = "Permissive"
action.sessionId = "cc93dbb3278c4a699f2f1635eb756caf"
res = action.call()

ChangeIPSecConnectionState

API Request

URLs

PUT zstack/v1/ipsec/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "changeIPSecConnectionState": {
    "stateEvent": "enable"
  },
  "systemTags": [],
  "userTags": []
}

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 PUT -d '{"changeIPSecConnectionState":{"stateEvent":"enable"}}' \
http://localhost:8080/zstack/v1/ipsec/76424bb25d3a37c9961fff1116bc06da/actions

Request 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) The state event.
  • enable
  • disable
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",
    "ikeLifeTime": 0.0,
    "lifeTime": 0.0
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.5.0
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 The remote network address. 4.5.0
authMode String The authentication mode. 4.5.0
authKey String The authentication key. 4.5.0
vipUuid String The VIP UUID. 2.3
ikeAuthAlgorithm String The IKE authentication algorithm. 4.5.0
ikeEncryptionAlgorithm String The IKE encryption algorithm. 4.5.0
ikeDhGroup Integer The IKE DH group. 4.5.0
policyAuthAlgorithm String The ESP authentication algorithm. 4.5.0
policyEncryptionAlgorithm String The ESP encryption algorithm. 4.5.0
pfs String The PFS DH group. 4.5.0
policyMode String The encryption mode. 4.5.0
transformProtocol String The security protocol. 4.5.0
ikeVersion String The IKE version. 4.5.0
idType String The ID configuration method. 4.5.0
localId String The local ID. 4.5.0
remoteId String The remote ID. 4.5.0
state String The running state. 4.5.0
status String The ready status. 4.5.0
ikeLifeTime int The IKE lifetime. 4.5.0
lifeTime int The IPsec lifetime. 4.5.0
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 The cidr. 2.3
connectionUuid String The connection UUID. 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 The connection UUID. 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

action = ChangeIPSecConnectionStateAction()
action.uuid = "76424bb25d3a37c9961fff1116bc06da"
action.stateEvent = "enable"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

ReconnectIPsecConnection

API Request

URLs

PUT zstack/v1/ipsec/{uuid}/actions

Headers

Authorization: OAuth the-session-uuid

Body

{
  "reconnectIPsecConnection": {},
  "systemTags": [],
  "userTags": []
}

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 PUT -d '{"reconnectIPsecConnection":{}}' \
http://localhost:8080/zstack/v1/ipsec/5186dbf43843358ea9e7420c4af27338/actions

Request Parameters

Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 4.5.0
systemTags List body Optional. The system tag. 4.5.0
userTags List body Optional. The user tag. 4.5.0

API Response

Sample Response

{
  "inventory": {
    "name": "Test-IPSec",
    "description": "desc info ",
    "peerAddress": "100.64.10.10",
    "authKey": "auth",
    "vipUuid": "37c2aa27aff4338abb41fb5bdaa90f77",
    "status": "Connecting",
    "ikeLifeTime": 0.0,
    "lifeTime": 0.0,
    "peerCidrs": [
      {
        "uuid": "0cf06fba80743d09bb31845d0b187197",
        "cidr": "192.168.100.0/24",
        "connectionUuid": "654dedd65de8345cae7042a375451146",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "l3NetworkRefs": [
      {}
    ]
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.5.0
inventory IPsecConnectionInventory See inventory 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. See error 4.5.0

#inventory

Name Type Description Starting Version
uuid String The resource UUID. 4.5.0
name String The resource name. 4.5.0
description String The detailed description of the resource. 4.5.0
peerAddress String The remote network address. 4.5.0
authMode String The authentication mode. 4.5.0
authKey String The authentication key. 4.5.0
vipUuid String The VIP UUID. 4.5.0
ikeAuthAlgorithm String The IKE authentication algorithm. 4.5.0
ikeEncryptionAlgorithm String The IKE encryption algorithm. 4.5.0
ikeDhGroup Integer The IKE DH group. 4.5.0
policyAuthAlgorithm String The ESP authentication algorithm. 4.5.0
policyEncryptionAlgorithm String The ESP encryption algorithm. 4.5.0
pfs String The PFS DH group. 4.5.0
policyMode String The encryption mode. 4.5.0
transformProtocol String The security protocol. 4.5.0
ikeVersion String The IKE version. 4.5.0
idType String The ID configuration method. 4.5.0
localId String The local ID. 4.5.0
remoteId String The remote ID. 4.5.0
state String The running state. 4.5.0
status String The ready status. 4.5.0
ikeLifeTime int The IKE lifetime. 4.5.0
lifeTime int The IPsec lifetime. 4.5.0
createDate Timestamp The creation date. 4.5.0
lastOpDate Timestamp The last operation date. 4.5.0
peerCidrs List See peerCidrs 4.5.0
l3NetworkRefs List See l3NetworkRefs 4.5.0

#peerCidrs

Name Type Description Starting Version
uuid String The resource UUID. 4.5.0
cidr String The cidr. 4.5.0
connectionUuid String The connection UUID. 4.5.0
createDate Timestamp The creation date. 4.5.0
lastOpDate Timestamp The last operation date. 4.5.0

#l3NetworkRefs

Name Type Description Starting Version
uuid String The resource UUID. 4.5.0
connectionUuid String The connection UUID. 4.5.0
l3NetworkUuid String The L3 network UUID. 4.5.0
createDate Timestamp The creation date. 4.5.0
lastOpDate Timestamp The last operation date. 4.5.0

#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. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0

SDK Sample

Java SDK

ReconnectIPsecConnectionAction action = new ReconnectIPsecConnectionAction();
action.uuid = "5186dbf43843358ea9e7420c4af27338";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ReconnectIPsecConnectionAction.Result res = action.call();

Python SDK

action = ReconnectIPsecConnectionAction()
action.uuid = "5186dbf43843358ea9e7420c4af27338"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

ChangeIPsecConnection

API Request

URLs

PUT zstack/v1/ipsec/config/{uuid}

Headers

Authorization: OAuth the-session-uuid

Body

{
  "changeIPsecConnection": {
    "peerAddress": "2.2.2.2",
    "authMode": "psk",
    "authKey": "12345678",
    "idType": "ip",
    "localId": "1.1.1.1",
    "remoteId": "2.2.2.2",
    "ikeVersion": "ikev2",
    "ikeAuthAlgorithm": "sha256",
    "ikeEncryptionAlgorithm": "aes-256",
    "ikeDhGroup": 2.0,
    "ikeLifeTime": 86400.0,
    "policyAuthAlgorithm": "sha256",
    "policyEncryptionAlgorithm": "aes-256",
    "pfs": "dh-group14",
    "policyMode": "tunnel",
    "transformProtocol": "esp",
    "lifeTime": 3600.0
  },
  "systemTags": [],
  "userTags": []
}

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 PUT -d '{"changeIPsecConnection":{"peerAddress":"2.2.2.2","authMode":"psk","authKey":"12345678","idType":"ip","localId":"1.1.1.1","remoteId":"2.2.2.2","ikeVersion":"ikev2","ikeAuthAlgorithm":"sha256","ikeEncryptionAlgorithm":"aes-256","ikeDhGroup":2.0,"ikeLifeTime":86400.0,"policyAuthAlgorithm":"sha256","policyEncryptionAlgorithm":"aes-256","pfs":"dh-group14","policyMode":"tunnel","transformProtocol":"esp","lifeTime":3600.0}}' \
http://localhost:8080/zstack/v1/ipsec/config/fe981c6d20243102b6939d5eada78ef9

Request Parameters

Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 4.5.0
peerAddress String body (contained in the changeIPsecConnection structure) The remote network address. 4.5.0
authMode String body (contained in the changeIPsecConnection structure) Optional. The authentication mode.
  • psk
  • certs
4.5.0
authKey String body (contained in the changeIPsecConnection structure) The authentication key. 4.5.0
idType String body (contained in the changeIPsecConnection structure) Optional. The ID configuration method.
  • ip
  • name
  • fqdn
4.5.0
localId String body (contained in the changeIPsecConnection structure) Optional. The local ID. 4.5.0
remoteId String body (contained in the changeIPsecConnection structure) Optional. The remote ID. 4.5.0
ikeVersion String body (contained in the changeIPsecConnection structure) Optional. The IKE version.
  • ike
  • ikev1
  • ikev2
4.5.0
ikeAuthAlgorithm String body (contained in the changeIPsecConnection structure) Optional. The IKE authentication algorithm.
  • md5
  • sha1
  • sha256
  • sha384
  • sha512
4.5.0
ikeEncryptionAlgorithm String body (contained in the changeIPsecConnection structure) Optional. The IKE encryption algorithm.
  • 3des
  • aes-128
  • aes-192
  • aes-256
4.5.0
ikeDhGroup int body (contained in the changeIPsecConnection structure) Optional. The IKE DH group. 4.5.0
ikeLifeTime int body (contained in the changeIPsecConnection structure) Optional. The IKE lifetime. 4.5.0
policyAuthAlgorithm String body (contained in the changeIPsecConnection structure) Optional. The ESP authentication algorithm.
  • md5
  • sha1
  • sha256
  • sha384
  • sha512
4.5.0
policyEncryptionAlgorithm String body (contained in the changeIPsecConnection structure) Optional. The ESP encryption algorithm.
  • 3des
  • aes-128
  • aes-192
  • aes-256
4.5.0
pfs String body (contained in the changeIPsecConnection structure) Optional. The PFS DH Group.
  • none
  • dh-group2
  • dh-group5
  • dh-group14
  • dh-group15
  • dh-group16
  • dh-group17
  • dh-group18
  • dh-group19
  • dh-group20
  • dh-group21
  • dh-group22
  • dh-group23
  • dh-group24
  • dh-group25
  • dh-group26
4.5.0
policyMode String body (contained in the changeIPsecConnection structure) Optional. The encryption mode.
  • tunnel
  • transport
4.5.0
transformProtocol String body (contained in the changeIPsecConnection structure) Optional. The security protocol.
  • esp
  • ah
  • ah-esp
4.5.0
lifeTime int body (contained in the changeIPsecConnection structure) Optional. The IPsec lifetime. 4.5.0
systemTags List body Optional. The system tag. 4.5.0
userTags List body Optional. The user tag. 4.5.0

API Response

Sample Response

{
  "inventory": {
    "name": "Test-IPSec",
    "description": "desc info ",
    "peerAddress": "100.64.10.10",
    "authKey": "auth",
    "vipUuid": "9f580de9b80c32feb149be989f5c9158",
    "ikeLifeTime": 0.0,
    "lifeTime": 0.0,
    "peerCidrs": [
      {
        "uuid": "c97d7be1bae43cac8fad2099ab9d4ef3",
        "cidr": "192.168.100.0/24",
        "connectionUuid": "5700953056a03c589a264faa51db6a8f",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "l3NetworkRefs": [
      {}
    ]
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.5.0
inventory IPsecConnectionInventory See inventory 4.5.0
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error 4.5.0

#inventory

Name Type Description Starting Version
uuid String The resource UUID. 4.5.0
name String The resource name. 4.5.0
description String The detailed description of the resource. 4.5.0
peerAddress String The remote network address. 4.5.0
authMode String The authentication mode. 4.5.0
authKey String The authentication key. 4.5.0
vipUuid String The VIP UUID. 4.5.0
ikeAuthAlgorithm String The IKE authentication algorithm. 4.5.0
ikeEncryptionAlgorithm String The IKE encryption algorithm. 4.5.0
ikeDhGroup Integer The IKE DH group. 4.5.0
policyAuthAlgorithm String The ESP authentication algorithm. 4.5.0
policyEncryptionAlgorithm String The ESP encryption algorithm. 4.5.0
pfs String The PFS DH group. 4.5.0
policyMode String The encryption mode. 4.5.0
transformProtocol String The security protocol. 4.5.0
ikeVersion String The IKE version. 4.5.0
idType String The ID configuration method. 4.5.0
localId String The local ID. 4.5.0
remoteId String The remote ID. 4.5.0
state String The running state. 4.5.0
status String The ready status. 4.5.0
ikeLifeTime int The IKE lifetime. 4.5.0
lifeTime int The IPsec lifetime. 4.5.0
createDate Timestamp The creation date. 4.5.0
lastOpDate Timestamp The last operation date. 4.5.0
peerCidrs List See peerCidrs 4.5.0
l3NetworkRefs List See l3NetworkRefs 4.5.0

#peerCidrs

Name Type Description Starting Version
uuid String The resource UUID. 4.5.0
cidr String The cidr. 4.5.0
connectionUuid String The connection UUID. 4.5.0
createDate Timestamp The creation date. 4.5.0
lastOpDate Timestamp The last operation date. 4.5.0

#l3NetworkRefs

Name Type Description Starting Version
uuid String The resource UUID. 4.5.0
connectionUuid String The connection UUID. 4.5.0
l3NetworkUuid String The L3 network UUID. 4.5.0
createDate Timestamp The creation date. 4.5.0
lastOpDate Timestamp The last operation date. 4.5.0

#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. 4.5.0
description String The brief description of the error. 4.5.0
details String The details about the error. 4.5.0
elaboration String The reserved field. Default value: null. 4.5.0
opaque LinkedHashMap The reserved field. Default value: null. 4.5.0
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 4.5.0

SDK Sample

Java SDK

ChangeIPsecConnectionAction action = new ChangeIPsecConnectionAction();
action.uuid = "fe981c6d20243102b6939d5eada78ef9";
action.peerAddress = "2.2.2.2";
action.authMode = "psk";
action.authKey = "12345678";
action.idType = "ip";
action.localId = "1.1.1.1";
action.remoteId = "2.2.2.2";
action.ikeVersion = "ikev2";
action.ikeAuthAlgorithm = "sha256";
action.ikeEncryptionAlgorithm = "aes-256";
action.ikeDhGroup = 2.0;
action.ikeLifeTime = 86400.0;
action.policyAuthAlgorithm = "sha256";
action.policyEncryptionAlgorithm = "aes-256";
action.pfs = "dh-group14";
action.policyMode = "tunnel";
action.transformProtocol = "esp";
action.lifeTime = 3600.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
ChangeIPsecConnectionAction.Result res = action.call();

Python SDK

action = ChangeIPsecConnectionAction()
action.uuid = "fe981c6d20243102b6939d5eada78ef9"
action.peerAddress = "2.2.2.2"
action.authMode = "psk"
action.authKey = "12345678"
action.idType = "ip"
action.localId = "1.1.1.1"
action.remoteId = "2.2.2.2"
action.ikeVersion = "ikev2"
action.ikeAuthAlgorithm = "sha256"
action.ikeEncryptionAlgorithm = "aes-256"
action.ikeDhGroup = 2.0
action.ikeLifeTime = 86400.0
action.policyAuthAlgorithm = "sha256"
action.policyEncryptionAlgorithm = "aes-256"
action.pfs = "dh-group14"
action.policyMode = "tunnel"
action.transformProtocol = "esp"
action.lifeTime = 3600.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

AttachL3NetworksToIPsecConnection

API Request

URLs

POST zstack/v1/ipsec/{uuid}/l3networks

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "l3NetworkUuids": [
      "4b0779efacdc39a5b2dd4799e2452720"
    ]
  },
  "systemTags": [],
  "userTags": []
}

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/l3networks

Request 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) The L3 network UUIDs. 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",
    "ikeLifeTime": 0.0,
    "lifeTime": 0.0,
    "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
success boolean Whether the operation succeeded. 4.5.0
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 The remote network address. 4.5.0
authMode String The authentication mode. 4.5.0
authKey String The authentication key. 4.5.0
vipUuid String The VIP UUID. 2.3
ikeAuthAlgorithm String The IKE authentication algorithm. 4.5.0
ikeEncryptionAlgorithm String The IKE encryption algorithm. 4.5.0
ikeDhGroup Integer The IKE DH group. 4.5.0
policyAuthAlgorithm String The ESP authentication algorithm. 4.5.0
policyEncryptionAlgorithm String The ESP encryption algorithm. 4.5.0
pfs String The PFS DH group. 4.5.0
policyMode String The encryption mode. 4.5.0
transformProtocol String The security protocol. 4.5.0
ikeVersion String The IKE version. 4.5.0
idType String The ID configuration method.ID 4.5.0
localId String The local ID. 4.5.0
remoteId String The remote ID. 4.5.0
state String The running state. 4.5.0
status String The ready status. 4.5.0
ikeLifeTime int The IKE lifetime. 4.5.0
lifeTime int The IPsec lifetime. 4.5.0
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 The cidr. 2.3
connectionUuid String The connection UUID. 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 The connection UUID. 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

action = AttachL3NetworksToIPsecConnectionAction()
action.uuid = "8f6fa5c86fd13968b8d8666f4b117aca"
action.l3NetworkUuids = [4b0779efacdc39a5b2dd4799e2452720]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

DetachL3NetworksFromIPsecConnection

API Request

URLs

DELETE zstack/v1/ipsec/{uuid}/l3networks

Headers

Authorization: OAuth the-session-uuid

Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/ipsec/ad4996bae0fb374bbbf696422f64e4aa/l3networks

Request Parameters

Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 2.3
l3NetworkUuids List body The L3 network UUIDs. 4.5.0
systemTags List body Optional. The system tags. 2.3
userTags List body Optional. The user tags. 2.3

API Response

Sample Response

{
  "inventory": {
    "uuid": "8897085a1f673f71abe4b5972959a341",
    "name": "Test-IPSec",
    "peerAddress": "100.64.10.10",
    "authKey": "auth",
    "vipUuid": "bda6c7ab0bfa37ae8fd0404c62bb7782",
    "ikeLifeTime": 0.0,
    "lifeTime": 0.0,
    "peerCidrs": [
      {
        "uuid": "6756721235283be68ff449db51ad480b",
        "cidr": "192.168.100.0/24",
        "connectionUuid": "8897085a1f673f71abe4b5972959a341",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "l3NetworkRefs": [
      {
        "uuid": "7c982a34282a3d5ea7436a80a0d38d0c",
        "connectionUuid": "8897085a1f673f71abe4b5972959a341",
        "l3NetworkUuid": "a110262802763e35a695935852b7b470",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ]
  }
}
Name Type Description Starting Version
success boolean Whether the operation succeeded. 4.5.0
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 The remote network address. 4.5.0
authMode String The authentication mode. 4.5.0
authKey String The authentication key. 4.5.0
vipUuid String The VIP UUID. 2.3
ikeAuthAlgorithm String The IKE authentication algorithm. 4.5.0
ikeEncryptionAlgorithm String The IKE encryption algorithm. 4.5.0
ikeDhGroup Integer The IKE DH group. 4.5.0
policyAuthAlgorithm String The ESP authentication algorithm. 4.5.0
policyEncryptionAlgorithm String The ESP encryption algorithm. 4.5.0
pfs String The PFS DH group. 4.5.0
policyMode String The encryption mode. 4.5.0
transformProtocol String The security protocol. 4.5.0
ikeVersion String The IKE version. 4.5.0
idType String The ID configuration method. 4.5.0
localId String The local ID. 4.5.0
remoteId String The remote ID. 4.5.0
state String The running state. 4.5.0
status String The ready status. 4.5.0
ikeLifeTime int The IKE lifetime. 4.5.0
lifeTime int The IPsec lifetime. 4.5.0
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 The cidr. 2.3
connectionUuid String The connection UUID. 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 The connection UUID. 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

DetachL3NetworksFromIPsecConnectionAction action = new
DetachL3NetworksFromIPsecConnectionAction();
action.uuid = "ad4996bae0fb374bbbf696422f64e4aa";
action.l3NetworkUuids = asList("a835701f0df63d14ad1281eb9cc1a768");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
DetachL3NetworksFromIPsecConnectionAction.Result res = action.call();

Python SDK

action = DetachL3NetworksFromIPsecConnectionAction()
action.uuid = "ad4996bae0fb374bbbf696422f64e4aa"
action.l3NetworkUuids = [a835701f0df63d14ad1281eb9cc1a768]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

AddRemoteCidrsToIPsecConnection

API Request

URLs

POST zstack/v1/ipsec/{uuid}/remote-cidrs

Headers

Authorization: OAuth the-session-uuid

Body

{
  "params": {
    "peerCidrs": [
      "192.168.100.0/24"
    ]
  },
  "systemTags": [],
  "userTags": []
}

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-cidrs

Request 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) The peer cidrs. 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",
    "ikeLifeTime": 0.0,
    "lifeTime": 0.0,
    "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
success boolean Whether the operation succeeded. 4.5.0
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 The remote network address. 4.5.0
authMode String The authentication mode. 4.5.0
authKey String The authentication key. 2.3
vipUuid String The VIP UUID. 2.3
ikeAuthAlgorithm String The IKE authentication algorithm. 4.5.0
ikeEncryptionAlgorithm String The IKE encryption algorithm. 4.5.0
ikeDhGroup Integer The IKE DH group. 4.5.0
policyAuthAlgorithm String The ESP authentication algorithm. 4.5.0
policyEncryptionAlgorithm String The ESP encryption algorithm. 4.5.0
pfs String The PFS DH group. 4.5.0
policyMode String The encryption mode. 4.5.0
transformProtocol String The security protocol. 4.5.0
ikeVersion String The IKE version. 4.5.0
idType String The ID configuration method.ID 4.5.0
localId String The local ID. 4.5.0
remoteId String The remote ID. 4.5.0
state String The running state. 4.5.0
status String The ready status. 4.5.0
ikeLifeTime int The IKE lifetime. 4.5.0
lifeTime int The IPsec lifetime. 4.5.0
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 The cidr. 2.3
connectionUuid String The connection UUID. 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 The connection UUID. 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

action = AddRemoteCidrsToIPsecConnectionAction()
action.uuid = "053658b061363df4be557d13ee0baaef"
action.peerCidrs = [192.168.100.0/24]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()

RemoveRemoteCidrsFromIPsecConnection

API Request

URLs

DELETE zstack/v1/ipsec/{uuid}/remote-cidrs?peerCidrs={peerCidrs}

Headers

Authorization: OAuth the-session-uuid

Curl Sample

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X DELETE http://localhost:8080/zstack/v1/ipsec/2428fc093ea93b6fb4eda5cc921da355/remote-cidrs

Request Parameters

Name Type Location Description Optional Value Starting Version
uuid String url The resource UUID. 2.3
peerCidrs List body 4.5.0
systemTags List body Optional. The system tags. 2.3
userTags List body Optional. The user tags. 2.3

API Response

Sample Response

{
  "inventory": {
    "uuid": "a069f4ee49c835869e046204ff5eba8f",
    "name": "Test-IPSec",
    "peerAddress": "100.64.10.10",
    "authKey": "auth",
    "vipUuid": "6af41f780abb3c69b122c29cc3948bab",
    "ikeLifeTime": 0.0,
    "lifeTime": 0.0,
    "peerCidrs": [
      {
        "uuid": "d0cb54ce25053f629623baef345f4bd0",
        "cidr": "192.168.100.0/24",
        "connectionUuid": "a069f4ee49c835869e046204ff5eba8f",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ],
    "l3NetworkRefs": [
      {
        "uuid": "4e539c9cd56b37d4bb27c6244169fc55",
        "connectionUuid": "a069f4ee49c835869e046204ff5eba8f",
        "l3NetworkUuid": "7c63cc15a47b3c90a0350bd8c6e6906e",
        "createDate": "Nov 14, 2017 10:20:57 PM",
        "lastOpDate": "Nov 14, 2017 10:20:57 PM"
      }
    ]
  }
}
Name Type Description Starting Version
success boolean 4.5.0
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 The remote network address. 4.5.0
authMode String The authentication mode. 4.5.0
authKey String The authentication key. 4.5.0
vipUuid String The VIP UUID. 2.3
ikeAuthAlgorithm String The IKE authentication algorithm. 4.5.0
ikeEncryptionAlgorithm String The IKE encryption algorithm. 4.5.0
ikeDhGroup Integer The IKE DH group. 4.5.0
policyAuthAlgorithm String The ESP authentication algorithm. 4.5.0
policyEncryptionAlgorithm String The ESP encryption algorithm. 4.5.0
pfs String The PFS DH group. 4.5.0
policyMode String The encryption mode. 4.5.0
transformProtocol String The security protocol. 4.5.0
ikeVersion String The IKE version. 4.5.0
idType String The ID configuration method. 4.5.0
localId String The local ID. 4.5.0
remoteId String The remote ID. 4.5.0
state String The running state. 4.5.0
status String The ready status. 4.5.0
ikeLifeTime int The IKE lifetime. 4.5.0
lifeTime int The IPsec lifetime. 4.5.0
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

RemoveRemoteCidrsFromIPsecConnectionAction action = new
RemoveRemoteCidrsFromIPsecConnectionAction();
action.uuid = "2428fc093ea93b6fb4eda5cc921da355";
action.peerCidrs = asList("192.168.100.0/24");
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
RemoveRemoteCidrsFromIPsecConnectionAction.Result res = action.call();

Python SDK

action = RemoveRemoteCidrsFromIPsecConnectionAction()
action.uuid = "2428fc093ea93b6fb4eda5cc921da355"
action.peerCidrs = [192.168.100.0/24]
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
res = action.call()