<?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: API calls to be handled only within one session in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/72009#M4294</link>
    <description>I stand corrected.</description>
    <pubDate>Fri, 10 Jan 2020 07:57:07 GMT</pubDate>
    <dc:creator>Maarten_Sjouw</dc:creator>
    <dc:date>2020-01-10T07:57:07Z</dc:date>
    <item>
      <title>API calls to be handled only within one session</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/71889#M4283</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;I am working on some script and I would like to have some questions sorted out about API performance and best practise. I am on R80.30 MDS and using API version 1.5.&lt;/P&gt;
&lt;P&gt;My idea is to have opened only 1 session (via login), store session into a variable (or file) and during the entire script, working only with this one session. Means, no other sessions will be opened as I don't want to have an additional load on the machine for login and logout operations.&lt;BR /&gt;&lt;BR /&gt;If I am using "-r true" for any API calls (let's say show domains), will it mean that in the background there will be a new login and logout ?&lt;/P&gt;
&lt;P&gt;At the moment I am struggling with "show packages" for a specific domain and the fact that -s parameter isn't working.&lt;BR /&gt;The code looks like that:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#!/bin/bash

mgmt_cli login user "aa" password "aaaa" --format json &amp;gt; sid.txt
mgmt_cli show packages -d "My_Domain" -s sid.txt --format json
mgmt_cli logout -s sid.txt
rm sid.txt&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And it doesn't give me the desired output - packages of the domain "My_Domain".&lt;BR /&gt;In case I use the following syntax, all is working fine (note -r true parameter instead of -s sid.txt):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;#!/bin/bash

mgmt_cli login user "aa" password "aaaa" --format json &amp;gt; sid.txt
mgmt_cli show packages -d "My_Domain" -r true --format json
mgmt_cli logout -s sid.txt
rm sid.txt​&lt;/LI-CODE&gt;
&lt;P&gt;But the working solution will result that I will have 2 sessions opened, right ? And I want only 1, not more.&lt;/P&gt;
&lt;P&gt;What I am missing here ?&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Jan 2020 23:24:49 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/71889#M4283</guid>
      <dc:creator>JozkoMrkvicka</dc:creator>
      <dc:date>2020-01-08T23:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: API calls to be handled only within one session</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/71896#M4287</link>
      <description>A couple things:&lt;BR /&gt;&lt;BR /&gt;1. mgmt_cli -r true will create a session per command and should be avoided if you're issuing a lot of commands at once.&lt;BR /&gt;2. A session is only valid in the context of a given domain, which means if you want to do something in a different domain, you will need a different session.</description>
      <pubDate>Thu, 09 Jan 2020 03:18:38 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/71896#M4287</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-01-09T03:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: API calls to be handled only within one session</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/71898#M4288</link>
      <description>In other words what point 2 says, you need to put the -d &amp;lt;domain&amp;gt; in the login line, not in the line with the actual commands.</description>
      <pubDate>Thu, 09 Jan 2020 05:32:00 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/71898#M4288</guid>
      <dc:creator>Maarten_Sjouw</dc:creator>
      <dc:date>2020-01-09T05:32:00Z</dc:date>
    </item>
    <item>
      <title>Re: API calls to be handled only within one session</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/71922#M4289</link>
      <description>&lt;P&gt;So that was a missing bit, thank you &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;If I have 20 domains, do I need to iterate over all domains and login into each and every domain separately ? There is no way to login like "super login" which login session will be valid for all domains ?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 10:57:12 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/71922#M4289</guid>
      <dc:creator>JozkoMrkvicka</dc:creator>
      <dc:date>2020-01-09T10:57:12Z</dc:date>
    </item>
    <item>
      <title>Re: API calls to be handled only within one session</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/71923#M4290</link>
      <description>You are correct, you need to login to each and every domain separately as when you login without domain, you are in the Global domain.</description>
      <pubDate>Thu, 09 Jan 2020 11:18:38 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/71923#M4290</guid>
      <dc:creator>Maarten_Sjouw</dc:creator>
      <dc:date>2020-01-09T11:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: API calls to be handled only within one session</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/72002#M4293</link>
      <description>&lt;P&gt;Not 100% correct.&lt;/P&gt;&lt;P&gt;If I am not mistaken on MDS a API command without domain accesses the system domain.&lt;/P&gt;&lt;P&gt;Global needs to be specified as any other!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2020 07:10:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/72002#M4293</guid>
      <dc:creator>Norbert_Bohusch</dc:creator>
      <dc:date>2020-01-10T07:10:53Z</dc:date>
    </item>
    <item>
      <title>Re: API calls to be handled only within one session</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/72009#M4294</link>
      <description>I stand corrected.</description>
      <pubDate>Fri, 10 Jan 2020 07:57:07 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/72009#M4294</guid>
      <dc:creator>Maarten_Sjouw</dc:creator>
      <dc:date>2020-01-10T07:57:07Z</dc:date>
    </item>
    <item>
      <title>Re: API calls to be handled only within one session</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/72115#M4296</link>
      <description>I am sorry that I will use my thread for some other question:&lt;BR /&gt;In HA MDS, how is it working if I want to get data from Active management? Do I need to do it like I did in R77.30 - mdsenv &amp;lt;DOMAIN&amp;gt; and check if CMA (domain) is active using FwIsActiveManagement?&lt;BR /&gt;Or in R80.x it doesnt matter on which MDS I am working, as both have the same data ?</description>
      <pubDate>Sun, 12 Jan 2020 19:10:13 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/72115#M4296</guid>
      <dc:creator>JozkoMrkvicka</dc:creator>
      <dc:date>2020-01-12T19:10:13Z</dc:date>
    </item>
    <item>
      <title>Re: API calls to be handled only within one session</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/72757#M4313</link>
      <description>Please open a new thread.</description>
      <pubDate>Mon, 20 Jan 2020 21:32:53 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/API-calls-to-be-handled-only-within-one-session/m-p/72757#M4313</guid>
      <dc:creator>PhoneBoy</dc:creator>
      <dc:date>2020-01-20T21:32:53Z</dc:date>
    </item>
  </channel>
</rss>

