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

Publish cannot be performed with web_api

Hi team,

I'm getting a error while using the mthod publish after using a method add-host .

I use the task-id returned in the publish method on the method show-task and i got the below response:

 

{
    "tasks": [
        {
            "task-id""01234567-89ab-cdef-b239-ae1a014fbefc",
            "task-name""Publish operation",
            "status""failed",
            "progress-percentage"100,
            "suppressed"false,
            "task-details": [
                {
                    "fault-message""Publish cannot be performed without entering a session name and description."
                }
            ]
        }
    ]
}
 
 
As i can see in the documentation publish method only accept empty body:
 
POST {{server}}/v1.1/publish
Content-Type: application/json
X-chkp-sid: {{session}}

{ }

 

How can i solve this problem?

Thanks in advance 

0 Kudos
1 Solution

Accepted Solutions
Bob_Zimmerman
Authority
Authority

You need to make a call to 'set session' to specify the new-name and description for the session.

View solution in original post

0 Kudos
5 Replies
Bob_Zimmerman
Authority
Authority

You need to make a call to 'set session' to specify the new-name and description for the session.

0 Kudos
hermanmaleiane
Explorer

Hi @Bob_Zimmerman,

Thanks for replying.

When do i need to call set session? after the invocation of add-host? 

0 Kudos
Bob_Zimmerman
Authority
Authority

Call it any time after login and before you try to publish.

This is not needed by default. Somebody must have enabled the option on the management server to require all sessions have a name and description.

0 Kudos
jzena
Explorer

hello,

question could you invoke set session ? because i can't add host tries to publish if i run it first and set session creates the session and publish it automatically.

 

Regards

0 Kudos
Bob_Zimmerman
Authority
Authority

It sounds like you're trying to use it with '-r true'. That switch is a batch of API commands: login, make the call in the command line, publish, logout. You can't use it to make changes if you require sessions to have a name or description. Instead, you need to do all of these as distinct steps, like so:

  1. login
  2. Set your session properties
  3. Make your change
  4. publish
  5. logout
0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events