sonicos -
Hi, I was doing some "API" tests.
I don't find many examples.
I would like to understand how to create an address object and insert it into a group object. At the moment I did this (maybe someone needs it)
curl -k -i -u "admin:pass" -X POST https://10.10.0.240:443/api/sonicos/auth
curl -k -i -X POST "https://10.10.0.240:443/api/sonicos/address-objects/ipv4" -H "accept: application/Json" -H "Content-Type: application/Json" -d @add.Json
curl -k -X POST "https://10.10.0.240:443/api/sonicos/config/pending" -H "accept: application/Json"
curl -k -i -u "admin:pass" -X DELETE https://10.10.0.240:443/api/sonicos/auth
file add.Json :
{
"address_objects": [
{
"ipv4": {
"name": "Test 1",
"zone": "LAN",
"host": {
"ip": "192.168.168.10"
}
}
},
{
"ipv4": {
"name": "Test 2",
"zone": "LAN",
"host": {
"ip": "192.168.168.20"
}
}
},
{
"ipv4": {
"name": "Test 3",
"zone": "LAN",
"host": {
"ip": "192.168.168.30"
}
}
}
]
}
Answers
@Alberto,
This KB should be helpful for adding address objects:
There is an API reference guide and you can always use Swagger UI for more details.
I hope this helps!
Thanks!
Shipra Sahu
Technical Support Advisor, Premier Services