- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- Re: How to add multiple network objects easily for...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to add multiple network objects easily for a beginner
Hi Friends,
I want to add multiple network objects (more than 400). Is there a easy way of doing this.
I have read on checkmates about using csv file but not really sure about exact steps.
I tried postman but it only lets me add 1 host at a time.
We are running multi domain environment.
Sorry am new to scripting/automation so please bear with me.
Appreciate your response
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Ravi,
If you are using R80 you could use the management cli, create a CSV file and then from powershell remotely create the objects.
Please see: https://community.checkpoint.com/thread/1342 seems to have the steps you'll need to complete the task.
Let us know how you get on.
Mark
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your reply mate, forgot to mention we are using R80.10
I was thinking of using mgmt._cli.....
To use mgmt._cli do I just have to go in expert mode on the MDM, change to relevant MDS and run the command similar to below?
mgmt_cli add host --batch data.csv
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Not a problem at all.
Yeah that should be it. Once the command finishes it will also publish the changes to to the database as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hey Mark,
What is the way to add multiple hosts using Web API like Postman. It only gives option to add one host a time. There should be some way to add multiple hosts using Postman?
Thanks,
KK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The add-host API call only supports adding one host at a time.
The add-objects-batch API call in R80.40+ supports adding more than one at a time.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Another cool option is to use the [relatively] new batch API option:
https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/add-objects-batch~v1.7%20
With this, you can use the mgmt_cli or Postman and pass a single JSON with many objects.
Another benefit is that the server is much more efficient when handling a single batch API call with many objects, instead of a loop of multiple calls.
