Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
cr4sec
Explorer
Jump to solution

web_api run-clish-command not found

Hi, 

on a R81.20 with web_api 1.9, I'm trying to run run-clish-command command via web_api:

 

https://xxx.yyy.zzz.www:nnn/web_api/run-clish-command

 

but I always get the same error:

 

{
"code": "generic_err_command_not_found",
"message": "Requested API command: [run-clish-command] not found"
}

 

Web api are enabled, policies are ok: before running the run-clish-command command I correctly execute login command and I use the x-chkp-sid parameter with the sid I get from login command , and I can use other web_api commands with success (for example: add-host or publish).

I get the errors only with run-clish-command and install-policy commands.

Can you help me?

0 Kudos
1 Solution

Accepted Solutions
PhoneBoy
Admin
Admin

run-clish-command is not a valid API endpoint.
run-script is what you want: https://sc1.checkpoint.com/documents/latest/APIs/#cli/run-script~v1.9%20 
Note that this executes commands in expert mode.

If you want to do certain things in clish, you might want to look at the Gaia API instead.
See: https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#introduction~v1.7%20

As for your issue with install-policy, please provide your precise API call along with the result received.

View solution in original post

0 Kudos
3 Replies
PhoneBoy
Admin
Admin

run-clish-command is not a valid API endpoint.
run-script is what you want: https://sc1.checkpoint.com/documents/latest/APIs/#cli/run-script~v1.9%20 
Note that this executes commands in expert mode.

If you want to do certain things in clish, you might want to look at the Gaia API instead.
See: https://sc1.checkpoint.com/documents/latest/GaiaAPIs/#introduction~v1.7%20

As for your issue with install-policy, please provide your precise API call along with the result received.

0 Kudos
cr4sec
Explorer

Thank you PhoneBoy,
run-script works like a charm.

Also, to add host objects I'm using Management API web_api/add-hostI'd like to use GAIA API but I can't find any command to add host on the GAIA API Reference link. Am I missing something? 

0 Kudos
PhoneBoy
Admin
Admin

Anything related to the Access Policy must be done through the management API.
The Gaia API is for configuring the device at the operating system level (interfaces, routes, DNS, etc)

0 Kudos