<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: delete-objects-batch web service request structure in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/delete-objects-batch-web-service-request-structure/m-p/151310#M6909</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Maybe that post can help you:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-to-delete-all-objects-matching-a-pattern/td-p/75217" target="_blank"&gt;https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-to-delete-all-objects-matching-a-pattern/td-p/75217&lt;/A&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Jun 2022 17:59:13 GMT</pubDate>
    <dc:creator>delToro1</dc:creator>
    <dc:date>2022-06-20T17:59:13Z</dc:date>
    <item>
      <title>delete-objects-batch web service request structure</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/delete-objects-batch-web-service-request-structure/m-p/151276#M6901</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I am working on a script which uses the &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/show-unused-objects~v1.8%20" target="_self"&gt;show-unused-objects&lt;/A&gt; and &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/delete-objects-batch~v1.8%20" target="_self"&gt;delete-objects-batch&lt;/A&gt; 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.&lt;/P&gt;&lt;P data-unlink="true"&gt;According to the management api reference following structure is required:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;{
  "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"
    } ]
  } ]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As mentioned before, I am struggling to create this structure. Does anyone have an idea how to create this structure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;/P&gt;&lt;P&gt;Peter&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 11:55:34 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/delete-objects-batch-web-service-request-structure/m-p/151276#M6901</guid>
      <dc:creator>Giu52</dc:creator>
      <dc:date>2022-06-20T11:55:34Z</dc:date>
    </item>
    <item>
      <title>Re: delete-objects-batch web service request structure</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/delete-objects-batch-web-service-request-structure/m-p/151306#M6908</link>
      <description>&lt;P&gt;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.&lt;/P&gt;
&lt;P&gt;But doesn't the response from t&lt;SPAN&gt;he&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#web/show-unused-objects~v1.8%20" target="_self" rel="noopener noreferrer"&gt;show-unused-objects&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;gets you a JSON file ?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Ty,&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 16:51:51 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/delete-objects-batch-web-service-request-structure/m-p/151306#M6908</guid>
      <dc:creator>Sorin_Gogean</dc:creator>
      <dc:date>2022-06-20T16:51:51Z</dc:date>
    </item>
    <item>
      <title>Re: delete-objects-batch web service request structure</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/delete-objects-batch-web-service-request-structure/m-p/151310#M6909</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;Maybe that post can help you:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-to-delete-all-objects-matching-a-pattern/td-p/75217" target="_blank"&gt;https://community.checkpoint.com/t5/API-CLI-Discussion/mgmt-cli-to-delete-all-objects-matching-a-pattern/td-p/75217&lt;/A&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jun 2022 17:59:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/delete-objects-batch-web-service-request-structure/m-p/151310#M6909</guid>
      <dc:creator>delToro1</dc:creator>
      <dc:date>2022-06-20T17:59:13Z</dc:date>
    </item>
  </channel>
</rss>

