Hi,
hmm, maybe I do not understand the question correctly, but to achieve what you request as far as I understand it, you can simply do the following:
1. Read the existing object by issuing a POST request to the endpoint show-simple-gateway. You will get the data for your existing object. One part of this data is the "interfaces" array.
For example:
"interfaces": [
{
"name": "eth0",
"ipv4-address": "192.168.201.2",
"ipv4-network-mask": "255.255.255.0",
"ipv4-mask-length": 24,
"ipv6-address": "",
"comments": "",
"color": "black",
"icon": "NetworkObjects/network",
"topology": "automatic",
"topology-automatic-calculation": "internal",
"topology-settings": {
"ip-address-behind-this-interface": "not defined",
"interface-leads-to-dmz": false
},
"anti-spoofing": false,
"security-zone": false
},
{
"name": "eth1",
"ipv4-address": "192.168.200.2",
"ipv4-network-mask": "255.255.255.0",
"ipv4-mask-length": 24,
"ipv6-address": "",
"comments": "",
"color": "black",
"icon": "NetworkObjects/network",
"topology": "automatic",
"topology-automatic-calculation": "internal",
"topology-settings": {
"ip-address-behind-this-interface": "not defined",
"interface-leads-to-dmz": false
},
"anti-spoofing": false,
"security-zone": false
}
]
2. Add a new interface if needed or make your changes to the existing ones and remove the "icon" and "topology-automatic-calculation" properties from the existing objects as they are not accepted by the api (@checkpoint: Can you please just ignore such properties? It would make life much easier, when working with api result objects).
In my example I made some changes and added a new interface to my existing gateway and sent a POST to the endpoint set-simple-gateway with the following data:
{
"uid": "6e39115e-c236-41c6-b768-b56ccd056014",
"interfaces": [
{
"name": "eth0",
"ipv4-address": "192.168.201.2",
"ipv4-network-mask": "255.255.255.0",
"ipv4-mask-length": 24,
"ipv6-address": "",
"comments": "",
"color": "black",
"topology": "automatic",
"topology-settings": {
"ip-address-behind-this-interface": "network defined by the interface ip and net mask",
"interface-leads-to-dmz": true
},
"anti-spoofing": true,
"security-zone": true,
"security-zone-settings": {
"specific-zone": "DMZZone"
}
},
{
"name": "eth1",
"ipv4-address": "192.168.200.2",
"ipv4-network-mask": "255.255.255.0",
"ipv4-mask-length": 24,
"ipv6-address": "",
"comments": "",
"color": "black",
"topology": "automatic",
"topology-settings": {
"ip-address-behind-this-interface": "not defined",
"interface-leads-to-dmz": false
},
"anti-spoofing": false,
"security-zone": false
},
{
"name": "eth2",
"ipv4-address": "192.168.203.2",
"ipv4-network-mask": "255.255.255.0",
"ipv4-mask-length": 24,
"topology": "external",
"anti-spoofing": true,
"security-zone": true,
"security-zone-settings": {
"specific-zone": "ExternalZone"
}
}
]
}
And I got back an http/200 with all my changes applied:
{
"uid": "6e39115e-c236-41c6-b768-b56ccd056014",
---SNIP---
"interfaces": [
{
"name": "eth0",
"ipv4-address": "192.168.201.2",
"ipv4-network-mask": "255.255.255.0",
"ipv4-mask-length": 24,
"ipv6-address": "",
"comments": "",
"color": "black",
"icon": "NetworkObjects/network",
"topology": "automatic",
"topology-automatic-calculation": "internal",
"topology-settings": {
"ip-address-behind-this-interface": "not defined",
"interface-leads-to-dmz": false
},
"anti-spoofing": true,
"anti-spoofing-settings": {
"action": "prevent"
},
"security-zone": true,
"security-zone-settings": {
"auto-calculated": false,
"specific-zone": "DMZZone"
}
},
{
"name": "eth1",
"ipv4-address": "192.168.200.2",
"ipv4-network-mask": "255.255.255.0",
"ipv4-mask-length": 24,
"ipv6-address": "",
"comments": "",
"color": "black",
"icon": "NetworkObjects/network",
"topology": "automatic",
"topology-automatic-calculation": "internal",
"topology-settings": {
"ip-address-behind-this-interface": "not defined",
"interface-leads-to-dmz": false
},
"anti-spoofing": false,
"security-zone": false
},
{
"name": "eth2",
"ipv4-address": "192.168.203.2",
"ipv4-network-mask": "255.255.255.0",
"ipv4-mask-length": 24,
"ipv6-address": "",
"comments": "",
"color": "black",
"icon": "NetworkObjects/network",
"topology": "external",
"anti-spoofing": true,
"anti-spoofing-settings": {
"action": "prevent"
},
"security-zone": true,
"security-zone-settings": {
"auto-calculated": false,
"specific-zone": "ExternalZone"
}
}
],
--- SNIP ---
}
So I think that's that what you want to achieve, right?
Cheers,
Thomas