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

R80.10: How to show list Pushlish Task by "show objects" api

When I use api: show-object

  • Input:
    "uid": <publish task uid>. example: 673c6c16-1a69-4d46-84de-be6e0259f7ce
    "details-level"
    : "full"
  • Reponse:
    {'uid': '673c6c16-1a69-4d46-84de-be6e0259f7ce', 'name': 'admin@8/1/2021 11:09', 'type': 'session', 'domain': {'uid': '41e821a0-3720-11e3-aa6e-0800200c9fde', 'name': 'SMC User', 'domain-type': 'domain'}, 'state': 'published', 'user-name': 'admin', 'description': '1 change published by admin on 8/1/2021', 'last-login-time': {'posix': 1627641068995, 'iso-8601': '2021-07-30T17:31+0700'}, 'publish-time': {'posix': 1627790909012, 'iso-8601': '2021-08-01T11:08+0700'}, 'expired-session': False, 'application': 'SmartConsole', 'changes': 1, 'in-work': False, 'ip-address': '192.168.26.220', 'locks': 1, 'connection-mode': 'read write', 'session-timeout': 600, 'comments': '', 'color': 'black', 'icon': 'Objects/worksession', 'tags': [], 'meta-info': {'lock': 'unlocked', 'validation-state': 'ok', 'last-modify-time': {'posix': 1627790909016, 'iso-8601': '2021-08-01T11:08+0700'}, 'last-modifier': 'admin', 'creation-time': {'posix': 1627790882137, 'iso-8601': '2021-08-01T11:08+0700'}, 'creator': 'admin'}, 'read-only': False}

But:

When I use api: show-objects

  • Input:
    "type": "session"
    "details-level"
    : "full"
  • Output: not found this Publish Task (673c6c16-1a69-4d46-84de-be6e0259f7ce). Only, That are login sessions.

I tried use type = "task", then the response is

{"code" : "generic_err_invalid_api_type", "message" : "Requested API type: [task] not found"} 

I have questions: 

- What is object type list when use "show objects" api?

- How to show list Pushlish Task by "show objects" api

 

Reference: https://community.checkpoint.com/t5/Management/R80-Management-API-tips-and-tricks-quot-show-objects-...

Thanks.

0 Kudos
1 Solution

Accepted Solutions
PhoneBoy
Admin
Admin

For that, use the show sessions API, specifically with view-published-sessions: true.
This will show you all published sessions starting with the most recent. 
https://sc1.checkpoint.com/documents/latest/APIs/#cli/show-sessions~v1.1%20

 

View solution in original post

(1)
6 Replies
PhoneBoy
Admin
Admin

Generally the show object API is useful when you don’t know what kind of object a UID is, or there isn’t a specific API endpoint for the object type.
Why not use the actual API endpoint for showing sessions?
https://sc1.checkpoint.com/documents/latest/APIs/#cli/show-session~v1.1

(1)
vnpt2324
Participant

Thanks,

I want to show Publish history. The Show Session API endpoint does not have publish information.

Isuse: Show Object API endpoint can show a Publish information, but don't use Show Objects API endpoint to find Publish history.

0 Kudos
PhoneBoy
Admin
Admin

For that, use the show sessions API, specifically with view-published-sessions: true.
This will show you all published sessions starting with the most recent. 
https://sc1.checkpoint.com/documents/latest/APIs/#cli/show-sessions~v1.1%20

 

(1)
vnpt2324
Participant

Thank you so much. It worked!

Note: specifically with view-published-sessions: true and "details-level": "full".

0 Kudos
vnpt2324
Participant

Dear Admin,

How can show recent-task by API (R80.10).

Thank you.

0 Kudos
PhoneBoy
Admin
Admin

The show tasks API is not available in R80.10.
R80.20 and above have this API and, given R80.10 is close to End of Support, I highly recommend upgrading to at least R80.40.

(1)

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events