<?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: Executing gaia-api commands using Management Api in API / CLI Discussion</title>
    <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Executing-gaia-api-commands-using-Management-Api/m-p/125797#M6107</link>
    <description>&lt;P&gt;I'm using Check Point Gaia R80.40&lt;/P&gt;</description>
    <pubDate>Thu, 05 Aug 2021 15:49:54 GMT</pubDate>
    <dc:creator>Claudiu_Chiriac</dc:creator>
    <dc:date>2021-08-05T15:49:54Z</dc:date>
    <item>
      <title>Executing gaia-api commands using Management Api</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Executing-gaia-api-commands-using-Management-Api/m-p/125796#M6106</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;using the documentation at &lt;A href="https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/gaia-api~v1.7%20" target="_blank"&gt;https://sc1.checkpoint.com/documents/latest/APIs/index.html#cli/gaia-api~v1.7%20&lt;/A&gt; I am trying to execute a simple gaia-api command (show-hostname) against the management server, but the commands seem to fail (tried both mgmt_cli tool and web services version):&lt;/P&gt;&lt;P&gt;LPACAICSP1&amp;gt; mgmt login user admin&lt;BR /&gt;Enter password:&lt;BR /&gt;LPACAICSP1&amp;gt; mgmt_cli gaia-api/show-hostname target 'LPACAICSP1' --format json&lt;BR /&gt;MGMT9000 {&lt;BR /&gt;"code" : "generic_error",&lt;BR /&gt;"message" : "Command execution failed. Response body is empty"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;LPACAICSP1&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#gaia-api/show-hostname&lt;BR /&gt;$URLAnon = "&lt;A href="https://10.171.69.11/web_api/gaia-api/show-hostname" target="_blank"&gt;https://10.171.69.11/web_api/gaia-api/show-hostname&lt;/A&gt;"&lt;BR /&gt;$headers = @{&lt;BR /&gt;"Content-Type" = "application/json"&lt;BR /&gt;"X-chkp-sid" = $sid&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;$body=@{&lt;BR /&gt;"target" = "LPACAICSP1"#"10.171.69.11"&lt;BR /&gt;}&lt;BR /&gt;$body = $body | ConvertTo-Json&lt;BR /&gt;$response = Invoke-RestMethod -Method Post -Headers $headers -Uri $URLAnon -Body $body&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;Invoke-RestMethod : The remote server returned an error: (404) Not Found.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The API requests that do not use gaia-api pass OK.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The log entries for the two attempts:&lt;/P&gt;&lt;P&gt;2021-08-05 17:35:27,109 INFO org.apache.cxf.interceptor.LoggingInInterceptor.log:250 [qtp121837096-27] - Inbound Message&lt;BR /&gt;----------------------------&lt;BR /&gt;ID: 197&lt;BR /&gt;Address: &lt;A href="http://127.0.0.1:50277/web_api/gaia-api/show-hostname" target="_blank"&gt;http://127.0.0.1:50277/web_api/gaia-api/show-hostname&lt;/A&gt;&lt;BR /&gt;Encoding: ISO-8859-1&lt;BR /&gt;Http-Method: POST&lt;BR /&gt;Content-Type: application/json&lt;BR /&gt;Headers: {connection=[keep-alive], Content-Length=[33], content-type=[application/json], Host=[127.0.0.1:50277], User-Agent=[Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US) WindowsPowerShell/5.1.19041.1023], X-chkp-sid=[e5a0ac40efccd1d7a9c1652d874fe105], X-Forwarded-For=[172.17.132.66], X-Forwarded-Host=[10.171.69.11], X-Forwarded-Host-Port=[443], X-Forwarded-Server=[10.171.69.11]}&lt;BR /&gt;Payload: {&lt;BR /&gt;"target": "LPACAICSP1"&lt;BR /&gt;}&lt;BR /&gt;--------------------------------------&lt;BR /&gt;2021-08-05 17:35:27,137 WARN org.apache.cxf.jaxrs.utils.JAXRSUtils.findTargetMethod:473 [qtp121837096-27] - No operation matching request path "/web_api/gaia-api/show-hostname" is found, Relative Path: /gaia-api/show-hostname, HTTP Method: POST, ContentType: application/json, Accept: */*,. Please enable FINE/TRACE log level for more details.&lt;BR /&gt;2021-08-05 17:35:27,138 WARN org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper.toResponse:73 [qtp121837096-27] - javax.ws.rs.ClientErrorException&lt;BR /&gt;at org.apache.cxf.jaxrs.utils.SpecExceptions.toHttpException(SpecExceptions.java:110)&lt;/P&gt;&lt;P&gt;.........................................&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2021-08-05 17:36:43,199 INFO org.apache.cxf.interceptor.LoggingInInterceptor.log:250 [qtp121837096-27] - Inbound Message&lt;BR /&gt;----------------------------&lt;BR /&gt;ID: 199&lt;BR /&gt;Address: &lt;A href="http://127.0.0.1:50277/web_api/gaia-api/show-hostname" target="_blank"&gt;http://127.0.0.1:50277/web_api/gaia-api/show-hostname&lt;/A&gt;&lt;BR /&gt;Encoding: ISO-8859-1&lt;BR /&gt;Http-Method: POST&lt;BR /&gt;Content-Type: application/json&lt;BR /&gt;Headers: {Accept=[application/json], connection=[keep-alive], Content-Length=[24], content-type=[application/json], Host=[127.0.0.1:50277], User-Agent=[mgmt_cli_clish], X-chkp-sid=[7999af6d4736f3c8376b563cc8c889c7], X-Forwarded-For=[127.0.0.1], X-Forwarded-Host=[127.0.0.1], X-Forwarded-Host-Port=[443], X-Forwarded-Server=[10.171.69.11]}&lt;BR /&gt;Payload: {"target":"LPACAICSP1"}&lt;/P&gt;&lt;P&gt;--------------------------------------&lt;BR /&gt;2021-08-05 17:36:43,206 WARN org.apache.cxf.jaxrs.utils.JAXRSUtils.findTargetMethod:473 [qtp121837096-27] - No operation matching request path "/web_api/gaia-api/show-hostname" is found, Relative Path: /gaia-api/show-hostname, HTTP Method: POST, ContentType: application/json, Accept: application/json,. Please enable FINE/TRACE log level for more details.&lt;BR /&gt;2021-08-05 17:36:43,208 WARN org.apache.cxf.jaxrs.impl.WebApplicationExceptionMapper.toResponse:73 [qtp121837096-27] - javax.ws.rs.ClientErrorException&lt;BR /&gt;at org.apache.cxf.jaxrs.utils.SpecExceptions.toHttpException(SpecExceptions.java:110)&lt;BR /&gt;..........................................&lt;/P&gt;&lt;P&gt;2021-08-05 17:36:43,209 INFO org.apache.cxf.interceptor.LoggingOutInterceptor.log:250 [qtp121837096-27] - Outbound Message&lt;BR /&gt;---------------------------&lt;BR /&gt;ID: 199&lt;BR /&gt;Response-Code: 404&lt;BR /&gt;Content-Type:&lt;BR /&gt;Headers: {Allow=[POST, GET, OPTIONS, HEAD], Date=[Thu, 05 Aug 2021 15:36:43 GMT], Content-Length=[0]}&lt;BR /&gt;--------------------------------------&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;[Expert@LPACAICSP1:0]# gaia_api status&lt;/P&gt;&lt;P&gt;API Status:&lt;BR /&gt;---------------------&lt;BR /&gt;Build: cp991255022&lt;BR /&gt;Uptime: 0:14:56.810097&lt;BR /&gt;Current Sessions: 0&lt;BR /&gt;Latest Version: 1.5&lt;/P&gt;&lt;P&gt;Processes:&lt;/P&gt;&lt;P&gt;Name State PID&lt;BR /&gt;---------------------------------&lt;BR /&gt;GAIA_API Started 1478&lt;BR /&gt;GAIA_API_DOCS Started 1477&lt;BR /&gt;APACHE Started 8197&lt;BR /&gt;CONFD Started 8194&lt;BR /&gt;CLISHD Started 26614 19329 8282 1433 1147&lt;BR /&gt;CELERY Started 1475&lt;BR /&gt;REDIS Started 1476&lt;/P&gt;&lt;P&gt;Port Details:&lt;BR /&gt;-------------------&lt;BR /&gt;APACHE Gaia Port: 443&lt;/P&gt;&lt;P&gt;--------------------------------------------&lt;BR /&gt;Overall API Status: Started&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;[Expert@LPACAICSP1:0]#&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 15:48:19 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Executing-gaia-api-commands-using-Management-Api/m-p/125796#M6106</guid>
      <dc:creator>Claudiu_Chiriac</dc:creator>
      <dc:date>2021-08-05T15:48:19Z</dc:date>
    </item>
    <item>
      <title>Re: Executing gaia-api commands using Management Api</title>
      <link>https://community.checkpoint.com/t5/API-CLI-Discussion/Executing-gaia-api-commands-using-Management-Api/m-p/125797#M6107</link>
      <description>&lt;P&gt;I'm using Check Point Gaia R80.40&lt;/P&gt;</description>
      <pubDate>Thu, 05 Aug 2021 15:49:54 GMT</pubDate>
      <guid>https://community.checkpoint.com/t5/API-CLI-Discussion/Executing-gaia-api-commands-using-Management-Api/m-p/125797#M6107</guid>
      <dc:creator>Claudiu_Chiriac</dc:creator>
      <dc:date>2021-08-05T15:49:54Z</dc:date>
    </item>
  </channel>
</rss>

