Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Zoltan_Bogdan
Contributor

batch add groups/members in JSON

Hi There,

 

I need to add multiple groups opf several types (service-group group) including members or adding members after that and I'd like to do it by means of JSON. that's because I already write a bunch of scripts for adding Hosts and services and the like.

I'm quite sure tis i possible but can't get my mind wrapped around the appropriate JSON Syntax.

 

Thanks & Kind Regards

Zoltan

 

 

0 Kudos
2 Replies
Zoltan_Bogdan
Contributor

ok this seems to work:

 

POST {{server}}/set-objects-batch
Content-Type: application/json
X-chkp-sid: {{session}}
{
    "objects": [
        {
            "type": "group",
            "list": [
                {
                    "name": "Group1",
                    "members" : [
                        "host1",
                        "net1"
                    ]
                },
                {
                    "name": "Group2",
                    "members": [
                         "host1",
                         "net1",
                         "host2"
                    ]
                }      
            ]
        }
    ]
}
0 Kudos
PhoneBoy
Admin
Admin

There is a specific example of how to add a service group using JSON here (scroll to the bottom): https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/add-service-group~v1.9.1%20
You can also add services to a given service group when they are created (again, JSON example at the bottom): https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/add-service-tcp~v1.9.1%20

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events