Cluster API is available since R80.40, here is some examples of how to use it
1. add cluster w/o members and interfaces
a) cli: mgmt_cli -r true add-simple-cluster ipv4-address "1.1.1.1" name "AAA" firewall true version "R80.40"
b) json: {
"ipv4-address": "1.1.1.1",
"name": "AAA",
"firewall": true,
"version": "R80.40"
}
2. add one interface and members
a) cli: mgmt_cli -r true set-simple-cluster interfaces.add.name "eth0" interfaces.add.ip-address "1.2.3.100" interfaces.add.ipv4-mask-length "24" interfaces.add.interface-type "cluster" interfaces.add.topology "INTERNAL" interfaces.add.anti-spoofing "true" members.add.name "member1" members.add.ipv4-address "1.2.3.4" members.add.one-time-password "aaaa" members.add.interfaces.0.name "eth0" members.add.interfaces.0.ip-address "1.2.3.4" members.add.interfaces.0.network-mask "255.255.255.0" name "AAA"
b) json: {
"interfaces": {
"add": {
"name": "eth0",
"ip-address": "1.2.3.100",
"ipv4-mask-length": 24,
"interface-type": "cluster",
"topology": "INTERNAL",
"anti-spoofing": true
}
},
"members": {
"add": {
"name": "member1",
"ipv4-address": "1.2.3.4",
"one-time-password": "aaaa",
"interfaces": [
{
"name": "eth0",
"ip-address": "1.2.3.4",
"network-mask": "255.255.255.0"
}
]
}
},
"name": "AAA"
}
3. remove one member
a) cli: mgmt_cli -r true set-simple-cluster name AAA members.remove "member1"
b) json
{
"name" : "AAA",
"members" : { "remove" : "member1" }
}
4. remove one interface
a) mgmt_cli -r true set-simple-cluster name AAA interfaces.remove "eth0"
b) {
"name": "AAA",
"interfaces": {
"remove": "eth0"
}
}
5. add two interfaces and two members
a) mgmt_cli -r true set-simple-cluster name "AAA" interfaces.add.0.name "eth0" interfaces.add.0.ip-address "10.10.10.1" interfaces.add.0.ipv4-mask-length 24 interfaces.add.0.interface-type "cluster" interfaces.add.0.topology "EXTERNAL" interfaces.add.0.anti-spoofing true interfaces.add.1.name "eth1" interfaces.add.1.ip-address "1.1.1.1" interfaces.add.1.ipv4-mask-length 24 interfaces.add.1.interface-type "cluster" interfaces.add.1.topology "INTERNAL" interfaces.add.1.anti-spoofing true members.add.0.name "member1" members.add.0.ip-address "10.10.10.2" members.add.0.interfaces.0.name "eth0" members.add.0.interfaces.0.ipv4-address "10.10.10.2" members.add.0.interfaces.0.ipv4-network-mask "255.255.255.0" members.add.0.interfaces.1.name "eth1" members.add.0.interfaces.1.ipv4-address "1.1.1.2" members.add.0.interfaces.1.ipv4-network-mask "255.255.255.0" members.add.1.name "member2" members.add.1.ip-address "10.10.10.3" members.add.1.interfaces.0.name "eth0" members.add.1.interfaces.0.ipv4-address "10.10.10.3" members.add.1.interfaces.0.ipv4-network-mask "255.255.255.0" members.add.1.interfaces.1.name "eth1" members.add.1.interfaces.1.ipv4-address "1.1.1.3" members.add.1.interfaces.1.ipv4-network-mask "255.255.255.0"
b) {
"name": "AAA",
"interfaces": {
"add": [
{
"name": "eth0",
"ip-address": "10.10.10.1",
"ipv4-mask-length": 24,
"interface-type": "cluster",
"topology": "EXTERNAL",
"anti-spoofing": true
},
{
"name": "eth1",
"ip-address": "1.1.1.1",
"ipv4-mask-length": 24,
"interface-type": "cluster",
"topology": "INTERNAL",
"anti-spoofing": true
}
]
},
"members": {
"add": [
{
"name": "member1",
"ip-address": "10.10.10.2",
"interfaces": [
{
"name": "eth0",
"ipv4-address": "10.10.10.2",
"ipv4-network-mask": "255.255.255.0"
},
{
"name": "eth1",
"ipv4-address": "1.1.1.2",
"ipv4-network-mask": "255.255.255.0"
}
]
},
{
"name": "member2",
"ip-address": "10.10.10.3",
"interfaces": [
{
"name": "eth0",
"ipv4-address": "10.10.10.3",
"ipv4-network-mask": "255.255.255.0"
},
{
"name": "eth1",
"ipv4-address": "1.1.1.3",
"ipv4-network-mask": "255.255.255.0"
}
]
}
]
}
}
6. add simple-cluster with only interfaces
a) mgmt_cli -r true add-simple-cluster ipv4-address "1.1.1.1" name "AAA" firewall true version "R80.40" interfaces.0.name "eth0" interfaces.0.ip-address "10.10.10.1" interfaces.0.ipv4-mask-length 24 interfaces.0.interface-type "cluster" interfaces.0.topology "EXTERNAL" interfaces.0.anti-spoofing true interfaces.1.name "eth1" interfaces.1.ip-address "1.1.1.1" interfaces.1.ipv4-mask-length 24 interfaces.1.interface-type "cluster" interfaces.1.topology "INTERNAL" interfaces.1.anti-spoofing true
b) {
"ipv4-address": "1.1.1.1",
"name": "AAA",
"firewall": true,
"version": "R80.40",
"interfaces": [
{
"name": "eth0",
"ip-address": "10.10.10.1",
"ipv4-mask-length": 24,
"interface-type": "cluster",
"topology": "EXTERNAL",
"anti-spoofing": true
},
{
"name": "eth1",
"ip-address": "1.1.1.1",
"ipv4-mask-length": 24,
"interface-type": "cluster",
"topology": "INTERNAL",
"anti-spoofing": true
}
]
}
7. add simple-cluster with only members without interfaces
a) mgmt_cli -r true add-simple-cluster ipv4-address "1.1.1.1" name "AAA" firewall true version "R80.40" members.0.name "member1" members.0.ipv4-address "1.1.1.2" members.1.name "member2" members.1.ipv4-address "1.1.1.3"
b) {
"ipv4-address": "1.1.1.1",
"name": "AAA",
"firewall": true,
"version": "R80.40",
"members": [
{
"name": "member1",
"ipv4-address": "1.1.1.2"
},
{
"name": "member2",
"ipv4-address": "1.1.1.3"
}
]
}
8. add member w/o interface to exisitng cluster
a) mgmt_cli -r true set-simple-cluster name "AAA" members.add.name "member1" members.add.ipv4-address "17.23.5.4"
b) {
"name": "AAA",
"members": {
"add": {
"name": "member1",
"ipv4-address": "17.23.5.4"
}
}
}