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

Format of csv file to add object in group

Jump to solution

Hi,

I am trying to add the objects to the specific group using .csv file. I found " mgmt_cli set group --batch group-members_full_csv.csv" command from one of the SK but couldn't find the csv format. Has anybody done this, if yes please give me the format of .csv file.

Regards,
Sagar Manandhar

1 Solution

Accepted Solutions
Employee+
Employee+

Re: Format of csv file to add object in group

Jump to solution

The full command for set group can be found at the following URL:

https://sc1.checkpoint.com/documents/latest/APIs/index.html#gui-cli/set-group~v1.1

The CSV should have the following header row:

name,members.add

The name field is for the group and the members.add field will be the host object to add to the group.

The rest of the body of the CSV would then be filled in as you wish:

group1,host1

group1,host2

group1,host3

group2,host1

group2,host2

group2,host3

You can then use the mgmt_cli command to run the batch job:

mgmt_cli -r true login > session.id

mgmt_cli -s session.id set group -b CSVFILE

mgmt_cli -s session.id publish

mgmt_cli -s session.id logout

6 Replies
Employee+
Employee+

Re: Format of csv file to add object in group

Jump to solution

The full command for set group can be found at the following URL:

https://sc1.checkpoint.com/documents/latest/APIs/index.html#gui-cli/set-group~v1.1

The CSV should have the following header row:

name,members.add

The name field is for the group and the members.add field will be the host object to add to the group.

The rest of the body of the CSV would then be filled in as you wish:

group1,host1

group1,host2

group1,host3

group2,host1

group2,host2

group2,host3

You can then use the mgmt_cli command to run the batch job:

mgmt_cli -r true login > session.id

mgmt_cli -s session.id set group -b CSVFILE

mgmt_cli -s session.id publish

mgmt_cli -s session.id logout

Employee++
Employee++

Re: Format of csv file to add object in group

Jump to solution

Kudos for "members.add", not intuitive at all.

Robert.

Re: Format of csv file to add object in group

Jump to solution

Hi,

I have run the batch file but getting below error. 

csv format is like below

0 Kudos
Employee++
Employee++

Re: Format of csv file to add object in group

Jump to solution

does the file exist in your current workin directory?

0 Kudos

Re: Format of csv file to add object in group

Jump to solution

Hi Robert,

Ok. I have put my file in existing directory and it worked. I adjusted the setting of format and it worked.

Thanks for your support.

0 Kudos
Highlighted

Re: Format of csv file to add object in group

Jump to solution

Hi,

csv file would look like below.

0 Kudos