cancel
Showing results for 
Search instead for 
Did you mean: 

Who rated this post

L4 Transporter

Hi @jkostic1,

 

I can't help much on the PowerShell side, but the final line in your script needs to have a request that looks something like this:

 

https://{{host}}/restapi/v10.0/Objects/Addresses?name={{object-name}}&location=vsys&vsys=vsys1

 

 

Then the body you pass in needs to look something like this (you didn't share what's in the $body variable):

 

{
    "entry": {
        "@name": "My-Address",
        "ip-netmask": "8.8.8.8",
        "description": "My test address"
    }
}

 

 

POSTing my REST API call above with Postman works fine, so you just need to translate that into your PowerShell script with the variable names you're using.

 

Maybe it's the shared part in your location, are you on single-vsys or multi-vsys firewall?

 

Or the version? These are the acceptable versions in the API endpoint URI (obvisouly you can only go up to the version which matches the PAN-OS version your firewall is currently running, you can't target v10.0 on a v9.1 firewall, etc):

 

https://{{host}}/restapi/9.0/...
https://{{host}}/restapi/v9.1/...
https://{{host}}/restapi/v10.0/...

 

 

Hope that helps!

Help the community: "Like" helpful comments, and click "Accept as Solution" if you found your answer :-)

View solution in original post

Who rated this post