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

Problem to publish objects created with API

Hello,

I´m using Postman and mgmt_cli to create host objects but I get the same result. All is running successfully but although I send the POST publish or mgmt_cli command, I don´t get the host object in object list from SmartConsole 80.30.

SmartConsole 993000076 R80.30

API-Version: 1.5

I don´t get any error when login > create host > publish.

login_postman_ok.pngmgmt_cli_ok.pngpublish_postman_ok.pngadd-host_postman_ok.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If I try to create the object again, I get an error because of it's a duplicated object.

duplicated_host_postman_error.PNG

Any Idea what's happening here?

Thanks in advances!

0 Kudos
1 Solution

Accepted Solutions
Javier002
Participant

[SOLVED]

I have been using the uid to define de parameter domain instead of use name variable. You can have something like:

"domain": {
"uid": "0ff14a07-3f01-443b-86c6-8dc7eb1c2b3e",
"name": "name_CMA",
"domain-type": "domain"}

Although you requests to CMA´s IP address, you must to use domain parameter to login and use the name variable to avoid problems; at least that's my experience.

domain_name_cma_works.png

Thanks!

 

View solution in original post

0 Kudos
6 Replies
_Val_
Admin
Admin

It looks like you have created it once but did not publish. Trying to create another object with the same name will then fail. Look at your unpublished sessions in SmartConsole and discard.

If an object already exists and is available for editing (session was published), use "modify" instead of "add"

0 Kudos
Javier002
Participant

I have not session without apply. Session bar is empty of yellow signals and Publish is shown greyed.

sessionBar.PNG

I have nothing pending to publish according to Check Point Lab:

sessionActiviy.PNG

It's a Mutli-Domain environment...

Thank you

0 Kudos
Javier002
Participant

[UPDATE]

If I run the same commands using mgmt_cli the Host is created.

mgmt_cli login -r true domain "domain" > domain-id-$$.txt
mgmt_cli add host name "HostFromMgmtCli" ip-address "192.0.2.5" color "blue" -s domain-id-69936.txt --format json
mgmt_cli publish -s domain-id-69936.txt --format json

BlueHost.PNG

It seems that only works when running at localhost...I'm using Postman with Collection Web API (version 1.5) and a python script using Check Point's SDK to create rules.

Thank you in advance.

0 Kudos
Bob_Zimmerman
Authority
Authority

This will happen if you call publish without specifying the UUID of the session you want to publish (such as in your 'mgmt_cli publish' call in the screenshot). On the CLI of the management, try 'mgmt_cli -r true show sessions details-level full --format json'. I bet you will see a session for your user with changes.

0 Kudos
Javier002
Participant

Hi Bob,

I see all sessions, both the ones that work and the ones that don't. I have compared the session created when I run mgmt_cli with other created using Postman and I´ve not seen any significant difference:

Comparing_uid_webAPI_admin.png

The right side is the output from "mgmt_cli -r true show sessions details-level full --format json" when I run login using Postman:

session_uuid_postman.png

Thank you

0 Kudos
Javier002
Participant

[SOLVED]

I have been using the uid to define de parameter domain instead of use name variable. You can have something like:

"domain": {
"uid": "0ff14a07-3f01-443b-86c6-8dc7eb1c2b3e",
"name": "name_CMA",
"domain-type": "domain"}

Although you requests to CMA´s IP address, you must to use domain parameter to login and use the name variable to avoid problems; at least that's my experience.

domain_name_cma_works.png

Thanks!

 

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events