MX 1-to-Many rule output is incomplete

SOLVED
rockpaper
Here to help

MX 1-to-Many rule output is incomplete

Hello,

 

When using the API to GET the MX 1:Many NAT rules, my output is incomplete. Instead of displaying the port rules the output displays portRules=System.Object[]

 

I am using powershell

I have read-only priveleges

 

My output (using fake IP's):

 

{publicIp=193.1.1.1; uplink=internet1; portRules=System.Object[]}

 

 

Documentation output:

publicIp: 146.11.11.13, uplink: internet1, portRules: [ { name: Rule 1, protocol: tcp, publicPort: 9443, localIp: 192.168.128.1, localPort: 443, allowedIps: [ any ]

 

 

any assistance is welcome

cheers!

 

 

1 ACCEPTED SOLUTION
PhilipDAth
Kind of a big deal
Kind of a big deal

I believe you get System.Object() when powershell doesn't know how to convert the object to a string.  You are going to need to unpack it yourself first.

View solution in original post

4 REPLIES 4
PhilipDAth
Kind of a big deal
Kind of a big deal

PhilipDAth
Kind of a big deal
Kind of a big deal

I believe you get System.Object() when powershell doesn't know how to convert the object to a string.  You are going to need to unpack it yourself first.

Thanks, PhilipDath, i will give that a go.

I thought I would try my hand at Powershell instead of my usual goto of Python

PS is certainly more challenging...

 

 

@PhilipDAth  gave me a good direction to pursue, and made me think about the objects and output a lot more. 

 

After a lot of trial and error, I was still not able to expand objects, which was frustrating.

 

So, instead, i went back to the method I was using to get the data from the meraki device

 

I was using Invoke-RestMethod, however, changed this to Invoke-WebRequest, which provided all of the details I needed

 

 

 

 

Get notified when there are additional replies to this discussion.