<?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: How do you find the name of an access rulebase? in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23039#M1405</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The ";" is required by Powershell when I set the variable otherwise it complains about setting something like "x" = "y", once you&amp;nbsp;pipe it to the ConvertTo-JSON it goes away and looks like regular JSON. I am including the login SID in my $headers variable, it just happens earlier in the code.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 10 Jan 2019 18:40:21 GMT</pubDate>
    <dc:creator>Emory_Christens</dc:creator>
    <dc:date>2019-01-10T18:40:21Z</dc:date>
    <item>
      <title>How do you find the name of an access rulebase?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23035#M1401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm looking in the UI under&amp;nbsp;"Access Control" and I see some different groups "Firewall Management", "Infrastructure rules," etc, and inside them are what I am assuming are the "rules" (DNS access, NTP access, etc). My question is: how do I identify which of these I need to reference when making a REST call for show access-rulebase? The API call requires only a name field, and so far everything returns 404.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Full disclosure: I am not a networking engineer, we are just creating some automation to clean up firewall rules for server lifecycle management. If this is the wrong place to ask, I apologize.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2019 19:39:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23035#M1401</guid>
      <dc:creator>Emory_Christens</dc:creator>
      <dc:date>2019-01-09T19:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the name of an access rulebase?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23036#M1402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The "Firewall Management" and "Infrastructure rules" are what we call access-sections.&lt;/P&gt;&lt;P&gt;A rulebase is actually part of a layer.&lt;/P&gt;&lt;P&gt;To get a rulebase, you need to know what layer it is a part of.&lt;/P&gt;&lt;P&gt;The name at the API level may be different than what SmartConsole shows.&lt;/P&gt;&lt;P&gt;To get the layer names, you use the API call show-layers.&lt;/P&gt;&lt;P&gt;From that, you can see the actual name of the layer.&lt;/P&gt;&lt;P&gt;You can also see it in this screen in SmartConsole if you uncheck the "Show only shared layers" checkbox:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.checkpoint.com/legacyfs/online/checkpoint/76924_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2019 21:33:07 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23036#M1402</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-01-09T21:33:07Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the name of an access rulebase?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23037#M1403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When I make the API call for show-access-layers, I get a 400 bad request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using Powershell to do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$layerbody = @{&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;&amp;nbsp;"Limit" = "100";&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;}&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$layerjson = $layerbody | ConvertTo-JSON&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;$layers = irm&amp;nbsp;&lt;A class="jivelink11" href="https://10.16.120.210/web_api/v1.1/show-access-layers" title="https://10.16.120.210/web_api/v1.1/show-access-layers"&gt;https://checkpointserver/web_api/v1.1/show-access-layers&lt;/A&gt;&amp;nbsp;-method POST -headers $headers -body $layerjson -ContentType application/json&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It returns the same if I don't supply a request body. Suggestions?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Jan 2019 21:46:10 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23037#M1403</guid>
      <dc:creator>Emory_Christens</dc:creator>
      <dc:date>2019-01-09T21:46:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the name of an access rulebase?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23038#M1404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Here's how I'm able to get the output of show-access-layers using curl:&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;SPAN class=""&gt;&lt;SPAN&gt;curl --silent --insecure -XPOST &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="https://mgmtip/web_api/v1.1/show-access-layers" rel="nofollow"&gt;https://mgmtip/web_api/v1.1/show-access-layers&lt;/A&gt;&lt;SPAN&gt; --data-binary "{ \"limit\": 100 }" -H "Content-Type: application/json" -H "X-chkp-sid: $SID"&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/BLOCKQUOTE&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Based on what you've done above, I'm guessing the ; is causing an issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;Because when I include it in my call, I get:&lt;/SPAN&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;{&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"code"&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;"generic_err_invalid_syntax"&lt;/SPAN&gt;&lt;SPAN class=""&gt;,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;&lt;SPAN class=""&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN class=""&gt;"message"&lt;/SPAN&gt;&lt;SPAN class=""&gt;: &lt;/SPAN&gt;&lt;SPAN class=""&gt;"Payload is not a valid JSON"&lt;/SPAN&gt;&lt;/P&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;}&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P class=""&gt;&lt;SPAN class=""&gt;It's possible you're also missing the SID header, but I can't tell if you're including it in your headers.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 05:16:43 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23038#M1404</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-01-10T05:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the name of an access rulebase?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23039#M1405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The ";" is required by Powershell when I set the variable otherwise it complains about setting something like "x" = "y", once you&amp;nbsp;pipe it to the ConvertTo-JSON it goes away and looks like regular JSON. I am including the login SID in my $headers variable, it just happens earlier in the code.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 10 Jan 2019 18:40:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23039#M1405</guid>
      <dc:creator>Emory_Christens</dc:creator>
      <dc:date>2019-01-10T18:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the name of an access rulebase?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23040#M1406</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What about the quotes around 100?&lt;/P&gt;&lt;P&gt;That would imply you're setting the limit to a string when it should be an integer.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 04:23:04 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23040#M1406</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2019-01-11T04:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do you find the name of an access rulebase?</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23041#M1407</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The L in limit needs to be lowercase is the first problem, capital L would give a 400 with json response describing Limit as an unrecognized parameter.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Jan 2019 15:30:21 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/How-do-you-find-the-name-of-an-access-rulebase/m-p/23041#M1407</guid>
      <dc:creator>Joshua_Hatter</dc:creator>
      <dc:date>2019-01-11T15:30:21Z</dc:date>
    </item>
  </channel>
</rss>

