- CheckMates
- :
- Products
- :
- Quantum
- :
- Management
- :
- Re: vSEC REST API bulk import of object
- 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
vSEC REST API bulk import of object
Hi All,
I was successful in adding host object using REST API 'create-host' call
however, it allows me to add only one object at a time, does anyone know a method of adding bulk import of objects at the same time.
Please let me know
Thanks,
Chandru Saravanan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Via the CLI, you can do it via a single command using a CSV file.
However, this ultimately calls the REST API multiple times, one for each line.
Either way, the objects don't become active until you publish the changes (another API call).
What's the use case for creating multiple objects using a single API call?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Dameon for the reply. I have a list of objects I wanted to upload to management server
I am using the following powershell script to create-host object
- $headers = @{"Content-Type" = "application/json""X-chkp-sid" = $sid}$CreateHost =@{"name" = "MyHost3""ip-address" = "192.0.2.14"}$CreateHost = $CreateHost | ConvertTo-Json$response = Invoke-RestMethod -Method Post -Headers $headers -Uri $URLAnon -Body $CreateHostIt creates the host fine, however I couldn't add multiple $CreateHost variables at the same time.I thought, if there was an other method I was missing. Its been a while I coded, but your reply gave me the idea.I will have all the objects to import in a .CSV file, and then create a "for" loop to call the CreateHost url and then finally publish it
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check out psCheckPoint as PowerShell Module.
It works great on batches.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Hugo. Will check it out
