<?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: Using SmartConsole Demo Mode Server for API testing in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-SmartConsole-Demo-Mode-Server-for-API-testing/m-p/123653#M6022</link>
    <description>&lt;P&gt;Nice.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is something else that can be tried to add multiple hosts (without using the batch option) while using the session ID captured into a text file ( &amp;gt; ) and then read from the text file ( -s ).&lt;/P&gt;&lt;P&gt;You will know this option but might help someone who is new to the management API &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C:\Program Files (x86)\CheckPoint\SmartConsole\R81\PROGRAM\mgmt_cli.exe&lt;/P&gt;&lt;P&gt;mgmt_cli login user aa password vpn123 -m 54.241.188.146 &amp;gt; api-session.txt&lt;BR /&gt;mgmt_cli add host name A-PC ip-address 10.1.1.5 color green -m 10.1.1.101 -s api-session.txt&lt;BR /&gt;mgmt_cli add host name A-Host ip-address 10.1.1.6 color green -m 10.1.1.101 -s api-session.txt&lt;BR /&gt;mgmt_cli add host name B-Host ip-address 10.1.1.7 color green -m 10.1.1.101 -s api-session.txt&lt;BR /&gt;mgmt_cli add host name A-LDAP-Server ip-address 192.168.11.5 color orange -s api-session.txt&lt;BR /&gt;mgmt_cli add host name A-DMZ-Server ip-address 192.168.12.5 color red -s api-session.txt&lt;BR /&gt;mgmt_cli add host name B-DMZ-Server ip-address 192.168.13.5 color red -s api-session.txt&lt;BR /&gt;mgmt_cli add host name C-DMZ-Server ip-address 192.168.14.5 color red -s api-session.txt&lt;BR /&gt;mgmt_cli publish -m 54.241.188.146 -s api-session.txt&lt;BR /&gt;mgmt_cli logout -m 54.241.188.146 -s api-session.txt&lt;/P&gt;</description>
    <pubDate>Mon, 12 Jul 2021 20:02:34 GMT</pubDate>
    <dc:creator>Don_Paterson</dc:creator>
    <dc:date>2021-07-12T20:02:34Z</dc:date>
    <item>
      <title>Using SmartConsole Demo Mode Server for API testing</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-SmartConsole-Demo-Mode-Server-for-API-testing/m-p/122863#M5976</link>
      <description>&lt;P&gt;Since R80, the only way to use SmartConsole in Demo Mode is to connect to a server.&lt;BR /&gt;We host Demo Mode servers in the cloud for currently supported versions for this reason.&lt;BR /&gt;These&amp;nbsp;Demo Mode servers can be used to test API calls.&lt;BR /&gt;These servers are only available for short-term usage (a few hours at the most).&lt;/P&gt;
&lt;P&gt;&lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/332"&gt;@Tomer_Sole&lt;/a&gt;&amp;nbsp;did &lt;A href="https://community.checkpoint.com/t5/API-CLI-Discussion/How-to-test-the-Management-API-with-the-Cloud-Demo/m-p/24127#M1484" target="_self"&gt;a post on this a while back&lt;/A&gt;, so this isn't new knowledge.&lt;BR /&gt;Some of the basic details have changed since then, so it's worth a new post on this topic.&lt;/P&gt;
&lt;P&gt;To get access to the Demo Mode server for API access, use your preferred version of SmartConsole and open it in Demo Mode.&lt;BR /&gt;In this example, we're using R81, but it should be the same basic steps with any currently supported R8x version.&lt;/P&gt;
&lt;P&gt;First, we need to create a user with known credentials.&lt;BR /&gt;That is done in Manage &amp;amp; Settings &amp;gt; Permissions and Administrators.&lt;BR /&gt;Click on the "add user" button as shown here.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 866px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/12414iB7E0DB38745F0D0E/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Create a user like similar to:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 595px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/12415i17E02BAF39782139/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Confirm that the API server will accept connections from any IP.&lt;BR /&gt;This is done in Manage &amp;amp; Settings &amp;gt; Blades &amp;gt; Management API.&lt;BR /&gt;It should look like the following (this is the default in R81):&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 854px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/12416i77F9E30B8C50E09D/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Publish the changes:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="Screen Shot 2021-07-02 at 8.01.39 PM.png" style="width: 400px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/12419i1CDC3C9552B3C287/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Screen Shot 2021-07-02 at 8.01.39 PM.png" alt="Screen Shot 2021-07-02 at 8.01.39 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now you can use the API server with known credentials.&lt;BR /&gt;Next step is to get the IP address of the management server.&lt;BR /&gt;Click on Cloud Demo Server &amp;gt; Demo Server Information &amp;gt; Copy server IP address to clipboard:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 544px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/12413iC7CD5F54C08977BE/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Now: how to test the API?&lt;BR /&gt;You can use any REST API client you want while the API server is active.&lt;BR /&gt;This can be something you've written or something like mgmt_cli from any Check Point gateway/management running R80 or above.&lt;/P&gt;
&lt;P&gt;You can also use mgmt_cli from the SmartConsole host as well on Windows.&lt;BR /&gt;mgmt_cli.exe is installed&amp;nbsp;in the same directory as the SmartConsole binary.&lt;BR /&gt;For example, in R81, it is in&amp;nbsp;C:\Program Files (x86)\CheckPoint\SmartConsole\R81\PROGRAM&lt;BR /&gt;In this example, you can see that I:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Logged in, accepting the fingerprint from the management server, and copied the sid value from the output to use for other commands.&lt;/LI&gt;
&lt;LI&gt;Created the host MyHost with IP address 1.2.3.4&lt;/LI&gt;
&lt;LI&gt;Published the session&lt;/LI&gt;
&lt;LI&gt;Logged out&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;You can see the results from the screenshot below:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-center" image-alt="image.png" style="width: 999px;"&gt;&lt;img src="https://community.checkpoint.com/t5/image/serverpage/image-id/12420iD44CF5CCA9D9A1DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 03:40:28 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-SmartConsole-Demo-Mode-Server-for-API-testing/m-p/122863#M5976</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2021-07-03T03:40:28Z</dc:date>
    </item>
    <item>
      <title>Re: Using SmartConsole Demo Mode Server for API testing</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-SmartConsole-Demo-Mode-Server-for-API-testing/m-p/123653#M6022</link>
      <description>&lt;P&gt;Nice.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is something else that can be tried to add multiple hosts (without using the batch option) while using the session ID captured into a text file ( &amp;gt; ) and then read from the text file ( -s ).&lt;/P&gt;&lt;P&gt;You will know this option but might help someone who is new to the management API &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;C:\Program Files (x86)\CheckPoint\SmartConsole\R81\PROGRAM\mgmt_cli.exe&lt;/P&gt;&lt;P&gt;mgmt_cli login user aa password vpn123 -m 54.241.188.146 &amp;gt; api-session.txt&lt;BR /&gt;mgmt_cli add host name A-PC ip-address 10.1.1.5 color green -m 10.1.1.101 -s api-session.txt&lt;BR /&gt;mgmt_cli add host name A-Host ip-address 10.1.1.6 color green -m 10.1.1.101 -s api-session.txt&lt;BR /&gt;mgmt_cli add host name B-Host ip-address 10.1.1.7 color green -m 10.1.1.101 -s api-session.txt&lt;BR /&gt;mgmt_cli add host name A-LDAP-Server ip-address 192.168.11.5 color orange -s api-session.txt&lt;BR /&gt;mgmt_cli add host name A-DMZ-Server ip-address 192.168.12.5 color red -s api-session.txt&lt;BR /&gt;mgmt_cli add host name B-DMZ-Server ip-address 192.168.13.5 color red -s api-session.txt&lt;BR /&gt;mgmt_cli add host name C-DMZ-Server ip-address 192.168.14.5 color red -s api-session.txt&lt;BR /&gt;mgmt_cli publish -m 54.241.188.146 -s api-session.txt&lt;BR /&gt;mgmt_cli logout -m 54.241.188.146 -s api-session.txt&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jul 2021 20:02:34 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-SmartConsole-Demo-Mode-Server-for-API-testing/m-p/123653#M6022</guid>
      <dc:creator>Don_Paterson</dc:creator>
      <dc:date>2021-07-12T20:02:34Z</dc:date>
    </item>
  </channel>
</rss>

