<?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: ha state in json format in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/ha-state-in-json-format/m-p/169248#M7460</link>
    <description>&lt;P&gt;There is a Gaia API call for this, check out&amp;nbsp;&lt;A href="https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#web/show-cluster-state~v1.7%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#web/show-cluster-state~v1.7%20&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;This command should work for you, I think:&lt;/P&gt;
&lt;PRE&gt;# mgmt_cli show cluster state --context gaia_api&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jan 2023 08:39:22 GMT</pubDate>
    <dc:creator>_Val_</dc:creator>
    <dc:date>2023-01-26T08:39:22Z</dc:date>
    <item>
      <title>ha state in json format</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/ha-state-in-json-format/m-p/169220#M7459</link>
      <description>&lt;P&gt;Hi checkpoint guru's,&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I am trying to print ha state info from firewalls but the output i am getting is not a json format, any tips to return my output in json or readable format?, below is my script and attached is my current output, thank you all&lt;/P&gt;&lt;LI-CODE lang="python"&gt;ha_state = self.run_script("clish -c '''show cluster state'''")   
        time.sleep(3)
        show_ha_config = self.show_task(ha_state)
        show_ha_config = show_ha_config["tasks"][0]["task-details"][0][
            "output"
        ]    
        ha_decoded = base64.b64decode(
            bytes(show_ha_config, "utf-8")
        ).decode("ascii")
        ha_conf = ha_decoded.split("\n")      
        logout_result = self.api_call(self.node, "443", "logout", {}, self.sid)
        return ha_conf&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 05:06:05 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/ha-state-in-json-format/m-p/169220#M7459</guid>
      <dc:creator>ram_kum</dc:creator>
      <dc:date>2023-01-26T05:06:05Z</dc:date>
    </item>
    <item>
      <title>Re: ha state in json format</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/ha-state-in-json-format/m-p/169248#M7460</link>
      <description>&lt;P&gt;There is a Gaia API call for this, check out&amp;nbsp;&lt;A href="https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#web/show-cluster-state~v1.7%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#web/show-cluster-state~v1.7%20&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;This command should work for you, I think:&lt;/P&gt;
&lt;PRE&gt;# mgmt_cli show cluster state --context gaia_api&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 08:39:22 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/ha-state-in-json-format/m-p/169248#M7460</guid>
      <dc:creator>_Val_</dc:creator>
      <dc:date>2023-01-26T08:39:22Z</dc:date>
    </item>
    <item>
      <title>Re: ha state in json format</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/ha-state-in-json-format/m-p/169348#M7461</link>
      <description>&lt;P&gt;thank you &lt;a href="https://community.checkpoint.com/t5/user/viewprofilepage/user-id/181"&gt;@_Val_&lt;/a&gt; , i have changed my api call to below and able to get ha state output in json&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;sh_state = api_call('my_ipaddress', 443,'show-cluster-state', {} ,sid)
return (sh_state)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 02:45:18 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/ha-state-in-json-format/m-p/169348#M7461</guid>
      <dc:creator>ram_kum</dc:creator>
      <dc:date>2023-01-27T02:45:18Z</dc:date>
    </item>
  </channel>
</rss>

