Hello
I'm trying to realize a BASH script to automate the creation of object groups, when I perform the add-group, group is not created 'cause it's working in read-only mode.
Here follows my calls (made with cURL):
First, I login to the management server (192.168.1.202):
curl -H 'Content-Type: application/json' -X POST -d '{"user":"admin","password":"vpn123","read-only":"false"}' https://192.168.1.202/web_api/login --insecure
Second, I check if a specific object group exist or not
curl -H 'Content-Type: application/json' -H 'X-chkp-sid: 3lhppE2MdlMGpEOYUtUZ0Hiek2EsfXS0urk2BUttW1w' -X POST -d '{"name":"group1"}' https://192.168.1.202/web_api/show-group --insecure
If the object group doesn't exist I create it:
curl -H 'Content-Type: application/json' -H 'X-chkp-sid: 3lhppE2MdlMGpEOYUtUZ0Hiek2EsfXS0urk2BUttW1w' -X POST -d '{"name":"group1","color":"blue","comments":"Group1"}' https://192.168.1.202/web_api/add-group --insecure
This is the response when adding a group, where read-only is set to false
{
"uid" : "e5981105-9d77-496a-9863-a85c7be0e01b",
"name" : "group1",
"type" : "group",
"domain" : {
"uid" : "41e821a0-3720-11e3-aa6e-0800200c9fde",
"name" : "SMC User",
"domain-type" : "domain"
},
"members" : [ ],
"groups" : [ ],
"comments" : "Group1",
"color" : "blue",
"icon" : "General/group",
"tags" : [ ],
"meta-info" : {
"lock" : "unlocked",
"validation-state" : "ok",
"last-modify-time" : {
"posix" : 1587536887663,
"iso-8601" : "2020-04-22T08:28+0200"
},
"last-modifier" : "admin",
"creation-time" : {
"posix" : 1587536887663,
"iso-8601" : "2020-04-22T08:28+0200"
},
"creator" : "admin"
},
"read-only" : true
}+ exit
What I'm missing?
Thanks