- CheckMates
- :
- Products
- :
- Quantum
- :
- Management
- :
- R80 Management API tips and tricks - "show-objects...
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
R80 Management API tips and tricks - "show-objects" command
The show-objects API command is very useful for general objects search, by specifying the objects "type" parameter and filtering the results by "filter" parameter.
Here is a list of available object types (R80.10) that can be used:
access-role
address-range
administrator
application-site
application-site-category
application-site-group
data-center
data-center-object
dns-domain
dynamic-object
gateways-and-servers
group
group-with-exclusion
host
host-ckp
mds
multicast-address-range
network
opsec-application
scada-application
security-zone
service-dce-rpc
service-icmp
service-icmp6
service-other
service-rcp
service-sctp
service-tcp
service-udp
service-group
session
simple-gateway
tag
task
time
time-group
vpn-community-meshed
vpn-community-star
unused-object
The "filter" parameter can be made up as an expression, containing logical operators - 'AND', 'OR', in capital letters. The provided expression should be exactly the same as it would be given in SmartConsole GUI.
For example, to search all tcp services with names containing "aol" or "bgp", use -
show-objects type service-tcp filter "aol OR bgp"
To search all tcp services having a name containing both "edonkey" and "466", use -
show-objects type service-tcp filter "edonkey AND 466"
In addition, there are undocumented parameters "in" and "not in", for string matching in textual fields, such as name and comments.
For example, to search all tcp services containing "ext" in the name field, use -
show-objects type service-tcp in.1 name in.2 ext
To search all tcp services containing "cifs" in the comments field, use -
show-objects type service-tcp in.1 comments in.2 cifs
To search all tcp services NOT containing "cifs" in the comments field, use -
show-objects type service-tcp not.in.1 comments not.in.2 cifs
Hope this helps.
Robert.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Awsome!!!
Kim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you for it!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Curious, shouldn't this be in Developers (Code Hub)?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I would say yes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Robert,
show objects is really nice, I would love to have the filters in all show commands.
Is there a way to filter by domain? Especially on services it would be super helpful to filter our the pre-defined ones from the "Check Point Data" domain as you cannot edit them.
Thanks
Christian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Is it possible to filter by more than one type ? For example type host or group.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
the best way I found was with a loop with an array like this
querytype: [host, group]
- name: Host Check
checkpoint_object_facts:
object_type: "{{item}}"
object_filter: "{{newip}}"
ip_only: yes
with_items: "{querytype}'
