- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- R80 API - Create multiple objects JSON
- 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
R80 API - Create multiple objects JSON
Looking at the API for add-host. What is the proper syntax to add multiple hosts in one payload rather than just one at a time?
Example:
add one host
{
"name" : "New Host 1",
"ip-address" : "192.0.2.1"
}
add multiple hosts
[
{
"name" : "New Host 1",
"ip-address" : "192.0.2.1"
},
{
"name" : "New Host 2",
"ip-address" : "192.0.2.2"
}
]
The above gives the following error:
Can not deserialize instance of com.checkpoint.management.web_api.core.handler.objects.network_objects.host.HostRequestNew out of START_ARRAY token
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, you can't make multiple objects with a single API call, you have to call "add-host" API for every object.
When using the mgmt_cli instead of web-services, it is possible to pass a csv file and create multiple objects with one CLI command.
Behind the scenes, when mgmt_cli is processing the csv file, it makes multiple API calls.
Uri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, you can't make multiple objects with a single API call, you have to call "add-host" API for every object.
When using the mgmt_cli instead of web-services, it is possible to pass a csv file and create multiple objects with one CLI command.
Behind the scenes, when mgmt_cli is processing the csv file, it makes multiple API calls.
Uri
