<?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 a-synchronous commands (e.g. publish, install-policy and run-script) in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-a-synchronous-commands-e-g-publish-install-policy-and-run/m-p/2121#M50</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I seem to have encountered an issue using Postman where the dash "-" in "task-id" is have a valid reference.&amp;nbsp; I am trying to pass the task-id as a variable to a following request to view the status.&amp;nbsp; I posted a question for assistance here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.checkpoint.com/message/34104" target="_blank"&gt;https://community.checkpoint.com/message/34104&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Jun 2019 08:55:11 GMT</pubDate>
    <dc:creator>Jason_Rakers</dc:creator>
    <dc:date>2019-06-21T08:55:11Z</dc:date>
    <item>
      <title>Using a-synchronous commands (e.g. publish, install-policy and run-script)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-a-synchronous-commands-e-g-publish-install-policy-and-run/m-p/2120#M49</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Most API/CLI calls are very fast and return the requested output in a second.&lt;/P&gt;&lt;P&gt;On the other hand, some operations may take longer to complete. For example running a custom script may take minutes or even more.&lt;/P&gt;&lt;P&gt;For a developer, calling an API that takes a long and unknown time to complete, is challenging:&lt;/P&gt;&lt;P&gt;* The application cannot wait forever, a timeout is likely to be triggered and this might end the application with an error message.&lt;/P&gt;&lt;P&gt;* To improve the usability of the application, it is recommended to show some kind of progress indicator. The user should know that the application is not stuck.&lt;/P&gt;&lt;P&gt;* while the application is waiting, other things may happen, the application should stay responsive.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For these reasons, when calling an API that might take long to complete. We use the following technique:&lt;/P&gt;&lt;P&gt;Instead of waiting for the operation to complete, the API would return a response immediately. However, the response will show a "task-id" and not the actual result of the command (which at this point is still unknown).&lt;/P&gt;&lt;P&gt;The developer can now, call a different API (show-task) to check on the progress and output of the previous call.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is all nice and well, but sometime you just want a simple command-line without bothering to check on its status using other commands. That's why when you call a mgmt_cli command and the server responds with a task-id, mgmt_cli will automatically call the show-task commands every few seconds until the command is no longer in-progress.&lt;/P&gt;&lt;P&gt;If you don't want mgmt_cli to call the show-task API automatically for you, add "--sync false" to your mgmt_cli command.&lt;/P&gt;&lt;P&gt;Attaching a bash script sample, that shows how to check the progress of a 'publish' command when using "--sync false"&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 10 Apr 2016 18:50:24 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-a-synchronous-commands-e-g-publish-install-policy-and-run/m-p/2120#M49</guid>
      <dc:creator>Uri_Bialik</dc:creator>
      <dc:date>2016-04-10T18:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using a-synchronous commands (e.g. publish, install-policy and run-script)</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-a-synchronous-commands-e-g-publish-install-policy-and-run/m-p/2121#M50</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I seem to have encountered an issue using Postman where the dash "-" in "task-id" is have a valid reference.&amp;nbsp; I am trying to pass the task-id as a variable to a following request to view the status.&amp;nbsp; I posted a question for assistance here:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.checkpoint.com/message/34104" target="_blank"&gt;https://community.checkpoint.com/message/34104&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jun 2019 08:55:11 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Using-a-synchronous-commands-e-g-publish-install-policy-and-run/m-p/2121#M50</guid>
      <dc:creator>Jason_Rakers</dc:creator>
      <dc:date>2019-06-21T08:55:11Z</dc:date>
    </item>
  </channel>
</rss>

