<?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 What is the easiest way to get the number of objects for a specific type, e.g. hosts in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/What-is-the-easiest-way-to-get-the-number-of-objects-for-a/m-p/4316#M392</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the easiest way to get the number of objects for a specific type, e.g. hosts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Especially if there are more than the current limit maximum value of 500?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see easy commands like "get number of objects" or something like "show &amp;lt;objects&amp;gt; total"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I found might work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;[Expert@X:0]# mgmt_cli login &amp;gt; id.txt&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;[Expert@X:0]# mgmt_cli show groups --format json -s id.txt | $CPDIR/jq/jq ".total"&lt;BR /&gt;171&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And generating a variable would look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;[Expert@X:0]# total_groups=$(mgmt_cli show groups --format json -s id.txt | $CPDIR/jq/jq ".total")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;[Expert@X:0]# echo "$total_groups"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;171&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Jul 2017 13:04:21 GMT</pubDate>
    <dc:creator>Eric_Beasley</dc:creator>
    <dc:date>2017-07-21T13:04:21Z</dc:date>
    <item>
      <title>What is the easiest way to get the number of objects for a specific type, e.g. hosts</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/What-is-the-easiest-way-to-get-the-number-of-objects-for-a/m-p/4316#M392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What is the easiest way to get the number of objects for a specific type, e.g. hosts?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Especially if there are more than the current limit maximum value of 500?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't see easy commands like "get number of objects" or something like "show &amp;lt;objects&amp;gt; total"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is what I found might work:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;[Expert@X:0]# mgmt_cli login &amp;gt; id.txt&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;[Expert@X:0]# mgmt_cli show groups --format json -s id.txt | $CPDIR/jq/jq ".total"&lt;BR /&gt;171&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And generating a variable would look like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;[Expert@X:0]# total_groups=$(mgmt_cli show groups --format json -s id.txt | $CPDIR/jq/jq ".total")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;[Expert@X:0]# echo "$total_groups"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN style="font-family: terminal,monaco,monospace;"&gt;171&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I missing something here?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jul 2017 13:04:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/What-is-the-easiest-way-to-get-the-number-of-objects-for-a/m-p/4316#M392</guid>
      <dc:creator>Eric_Beasley</dc:creator>
      <dc:date>2017-07-21T13:04:21Z</dc:date>
    </item>
    <item>
      <title>Re: What is the easiest way to get the number of objects for a specific type, e.g. hosts</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/What-is-the-easiest-way-to-get-the-number-of-objects-for-a/m-p/4317#M393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what about something like that:&lt;BR /&gt;# show objects order.1.ASC "name" type "host" --format json | $CPDIR/jq/jq ".total"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My env:&lt;BR /&gt;I have 1K hosts , I run the command and got:&lt;BR /&gt;1000&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;using show-objects with filter option &lt;BR /&gt;&lt;A class="jive-link-external-small" href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#gui-cli/show-objects~v1.1" rel="nofollow"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#gui-cli/show-objects~v1.1&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 31 Jul 2017 05:17:25 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/What-is-the-easiest-way-to-get-the-number-of-objects-for-a/m-p/4317#M393</guid>
      <dc:creator>Ofir_Shikolski</dc:creator>
      <dc:date>2017-07-31T05:17:25Z</dc:date>
    </item>
  </channel>
</rss>

