<?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 Script to delete objects in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-delete-objects/m-p/64083#M3987</link>
    <description>&lt;P&gt;Hello everybody.&lt;/P&gt;&lt;P&gt;I'm doing a script to delete objects and rules. I'm having troubles to define if the object is the last in cell. In the SmartConsole, if I go to 'Where Used' in the object, I can see if it are the Last in Cell, but in the "mgmt_cli where used" there isn't a field with this information. Does anynone have this same problem? Is there another way to do this?&lt;/P&gt;&lt;P&gt;Thanks for while.&lt;/P&gt;</description>
    <pubDate>Tue, 01 Oct 2019 17:06:16 GMT</pubDate>
    <dc:creator>carlosgeib</dc:creator>
    <dc:date>2019-10-01T17:06:16Z</dc:date>
    <item>
      <title>Script to delete objects</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-delete-objects/m-p/64083#M3987</link>
      <description>&lt;P&gt;Hello everybody.&lt;/P&gt;&lt;P&gt;I'm doing a script to delete objects and rules. I'm having troubles to define if the object is the last in cell. In the SmartConsole, if I go to 'Where Used' in the object, I can see if it are the Last in Cell, but in the "mgmt_cli where used" there isn't a field with this information. Does anynone have this same problem? Is there another way to do this?&lt;/P&gt;&lt;P&gt;Thanks for while.&lt;/P&gt;</description>
      <pubDate>Tue, 01 Oct 2019 17:06:16 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-delete-objects/m-p/64083#M3987</guid>
      <dc:creator>carlosgeib</dc:creator>
      <dc:date>2019-10-01T17:06:16Z</dc:date>
    </item>
    <item>
      <title>Re: Script to delete objects</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-delete-objects/m-p/64089#M3988</link>
      <description>The API does not return if a particular object is "last in cell" or not.&lt;BR /&gt;You would have to parse the individual results returned by the where-used API call to determine if it is "last in cell" or not.</description>
      <pubDate>Tue, 01 Oct 2019 18:02:36 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-delete-objects/m-p/64089#M3988</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-10-01T18:02:36Z</dc:date>
    </item>
    <item>
      <title>Re: Script to delete objects</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-delete-objects/m-p/79774#M4631</link>
      <description>&lt;P&gt;Hi Dameon,&lt;/P&gt;&lt;P&gt;Will this be fixed in a future version?&lt;/P&gt;&lt;P&gt;If not, could you please elaborate on your answer?&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't see how to determine if the object is last-in-cell.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tnx in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PS. Did anybody solve this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 10:41:34 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-delete-objects/m-p/79774#M4631</guid>
      <dc:creator>fwmeister</dc:creator>
      <dc:date>2020-03-26T10:41:34Z</dc:date>
    </item>
    <item>
      <title>Re: Script to delete objects</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-delete-objects/m-p/79782#M4632</link>
      <description>&lt;P&gt;Hi fwmeister.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I did a count in the source and destination colunms, to check if there is only one object. This is the only way I found to solve this problem.&lt;/P&gt;&lt;P&gt;mgmt_cli -r true -d "$DOMAIN" show access-rule uid "$(cat &amp;lt; ruleuid.json)" layer "$(cat &amp;lt; layer.json)" --format json &amp;gt; $ACCESS_RULE&lt;BR /&gt;cat access_rule.json | jq '.name' &amp;gt; $RULENAME&lt;BR /&gt;cat access_rule.json | jq '.source[] | .name' &amp;gt; $SOURCE_POSITION&lt;BR /&gt;cat access_rule.json | jq '.destination[] | .name' &amp;gt; $DESTINATION_POSITION&lt;BR /&gt;SOURCE_OBJECTS=$(cat source_p.json | wc -l)&lt;BR /&gt;DESTINATION_OBJECTS=$(cat destination_p.json | wc -l)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Please let me know if you need a help.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Mar 2020 11:56:03 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-delete-objects/m-p/79782#M4632</guid>
      <dc:creator>carlosgeib</dc:creator>
      <dc:date>2020-03-26T11:56:03Z</dc:date>
    </item>
    <item>
      <title>Re: Script to delete objects</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-delete-objects/m-p/79878#M4636</link>
      <description>That's about the way to do it.&lt;BR /&gt;Where used will tell you what rules a particular object is used in.&lt;BR /&gt;You then have to evaluate each rule to determine whether it is "last in cell" or not.&lt;BR /&gt;Removing something "last in cell" can completely change the meaning of a rule, thus it can only be done by modifying the rule itself and not indirectly (e.g. by deleting a given object).</description>
      <pubDate>Thu, 26 Mar 2020 22:28:02 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Script-to-delete-objects/m-p/79878#M4636</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-03-26T22:28:02Z</dc:date>
    </item>
  </channel>
</rss>

