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

Mgmt CLI - show gateways-and-servers - object "type" values?

Hello, 

I had a script on R80.40 used to pull a list of individual gateways and cluster members using mgmt_cli and save it as a txt file. 

After migration to R81.20 I only get the Simple Gateways, without cluster members. 

"select(.type == "simple-gateway" or .type == "CpmiClusterMember")"

 

Management API Reference  v1.9   - "show gateways-and-servers "does not provide string values for "type".

Any idea where I can get a list of values for "object type"?

 

Thanks!

 

0 Kudos
2 Solutions

Accepted Solutions
Amir_Senn
Employee
Employee

I see in my lab that cluster members have returned type:"cluster-member".

Maybe try to edit the script to: "select(.type == "simple-gateway" or .type == "CpmiClusterMember" or .type == "cluster-member")" and see if it solves the issue?

Kind regards, Amir Senn

View solution in original post

(1)
Bob_Zimmerman
Authority
Authority

Looks like the type is now "cluster-member". Here's some output from one of my managements with a few normal clusters and a few VSX clusters:

[Expert@SomeSmartCenter]# mgmt_cli -f json -r true show gateways-and-servers details-level full limit 500 | jq '.objects[]|.type' | sort | uniq -c
      6 "CpmiGatewayCluster"
      5 "CpmiVsClusterNetobj"
      6 "CpmiVsxClusterMember"
      3 "CpmiVsxClusterNetobj"
      3 "checkpoint-host"
     12 "cluster-member"

View solution in original post

7 Replies
Amir_Senn
Employee
Employee

I see in my lab that cluster members have returned type:"cluster-member".

Maybe try to edit the script to: "select(.type == "simple-gateway" or .type == "CpmiClusterMember" or .type == "cluster-member")" and see if it solves the issue?

Kind regards, Amir Senn
(1)
sorinstf
Participant

Hello, 


that's exactly what I chose after digging into thousands of lines of code 🙂 

mgmt_cli -f json -r true show gateways-and-servers details-level full limit 500

 

Regards, 

Sorin

0 Kudos
Bob_Zimmerman
Authority
Authority

Looks like the type is now "cluster-member". Here's some output from one of my managements with a few normal clusters and a few VSX clusters:

[Expert@SomeSmartCenter]# mgmt_cli -f json -r true show gateways-and-servers details-level full limit 500 | jq '.objects[]|.type' | sort | uniq -c
      6 "CpmiGatewayCluster"
      5 "CpmiVsClusterNetobj"
      6 "CpmiVsxClusterMember"
      3 "CpmiVsxClusterNetobj"
      3 "checkpoint-host"
     12 "cluster-member"
sorinstf
Participant

Excellent! Many thanks for your reply!

0 Kudos
PhoneBoy
Admin
Admin

This is probably a good time to remind folks that the API is versioned.
This means that even though you've upgraded to a new release, you can call the old version of the API...and get results that are consistent with that version.
The API version that I believe maps to R80.40 is v1.7.
See: https://sc1.checkpoint.com/documents/latest/APIs/index.html#api_versions~v1.9%20 

0 Kudos
sorinstf
Participant

Hello, 

yes,  you are right! You can still reference to your initial API version in the API command.. I found out about it after chaning the script object type. This is where I was not able to find all the string values of the object...  

[--version, -v]
What command version should be called. By default the latest version is used.

[Expert@mds-prod-8040:0]# mgmt_cli -r true show api-versions
current-version: "1.6.1"

0 Kudos
PhoneBoy
Admin
Admin

Yeah 1.6.1 is R80.40 JHF, 1.7 is R81.

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events