- CheckMates
- :
- Products
- :
- Developers
- :
- API / CLI Discussion
- :
- delete-objects-batch web service request structure
- 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
delete-objects-batch web service request structure
Hello,
I am working on a script which uses the show-unused-objects and delete-objects-batch api commands. My plan is to gather all the unused objects with an show-unused-objects call and use the response for the delete-objects-batch call. I am coding the script in python and cant find a way to create the required JSON file for the delete-objects-batch request.
According to the management api reference following structure is required:
{
"objects" : [ {
"type" : "host",
"list" : [ {
"name" : "New Host 1"
}, {
"name" : "New Host 2"
} ]
}, {
"type" : "address-range",
"list" : [ {
"name" : "New Address Range 1"
}, {
"name" : "New Address Range 2"
} ]
} ]
}
As mentioned before, I am struggling to create this structure. Does anyone have an idea how to create this structure?
Kind regards,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Like you know already, this is a JSON format, so you can build your list into an CSV or smth similar, and then convert it to JSON.
But doesn't the response from the show-unused-objects gets you a JSON file ?
Ty,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello,
Maybe that post can help you:
You might adjust this script adding diferents objects types to reach your goal, delete all unused objects. In the other hand, from smartConsole you can filter for unused objects and delete them.
