Panorama Rest API - Add ae subinterface

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Please sign in to see details of an important advisory in our Customer Advisories area.

Panorama Rest API - Add ae subinterface

L1 Bithead

Hello everyone!

I am planning to create around 200 new subnets on my firewall managed by Panorama template. We plan to restructure our network.

I want to do this via the Rest API of Panorama. I was able to create a ae interface via the API, no problem. But I cannot create subinterfaces for this ae interface.

 

We are running Panorama 10.1.3-h1. 

 

The following is the JSON body I send to the AggregateEthernetInterfaces enpoint restapi/v10.1/Network/AggregateEthernetInterfaces?name=ae2.155&location=template&template=MyTemplate

 

{
    "entry": {
        "@name": "ae2.155",
        "ip": {
            "entry": [
                {
                    "@name": "10.10.155.1"
                }
            ]
        },
        "tag": "155"
    }
}

I am getting the following response:

{
    "code": 3,
    "message": "Invalid Object",
    "details": [
        {
            "@type": "CauseInfo",
            "causes": [
                {
                    "code": 12,
                    "module": "panui_mgmt",
                    "description": "Invalid Object:  ae2.155 'ae2.155' is not a valid reference."
                }
            ]
        }
    ]
}
 
I thought, maybe I am using the wrong API endpoint, so I also tested with the EthernetInterfaces endpoint /restapi/v10.1/Network/EthernetInterfaces?name=ae2.155&location=template&template=MyTemplate with the following JSON body:
{
    "entry": {
        "@name": "ae2.155",
        "ip": {
            "entry": [
                {
                    "@name": "10.10.12.12"
                }
            ]
        },
        "tag": "155"
    }
}
But even with this endpoint I am getting an error:
{
    "code": 9,
    "message": "Parent Interface Not Found: Parent interface ae2 does not exist.",
    "details": [
        {
            "@type": "CauseInfo",
            "causes": [
                {
                    "code": 200,
                    "module": "panui_restapi",
                    "description": "Parent Interface Not Found: Parent interface ae2 does not exist."
                }
            ]
        }
    ]
}
But the parent interface ae2 exists, I created it via API...
 
So my question is: How can I add a subinterface to an aggregate ethernet interface via API?
 
Thanks in advance,
Martin
Nothing lasts longer than a temporary solution.
2 REPLIES 2

L4 Transporter

Hello @MHuschenbett 

I guess you need to embrace your call with another layer holding the name of the ae interface. For us it is obvious that ae2.155 is below ae2, but how should the machine know this.

L1 Bithead

Hi Joerg,

 

Thank you for the answer.

The machine should know that ae2.155 is below ae2, because I can create a "normal" subinterface ethernet1/1.155 under ethernet1/1 without telling the API what the parent is (as you can see in the attached screenshots)

 

 

 

Also, in the mean time I was able to fullfill my task with the ansible panos collection.

 

But still, the question is how to do it via api...

 

Best Regards, 

Martin

Nothing lasts longer than a temporary solution.
  • 2769 Views
  • 2 replies
  • 0 Likes
Like what you see?

Show your appreciation!

Click Like if a post is helpful to you or if you just want to show your support.

Click Accept as Solution to acknowledge that the answer to your question has been provided.

The button appears next to the replies on topics you’ve started. The member who gave the solution and all future visitors to this topic will appreciate it!

These simple actions take just seconds of your time, but go a long way in showing appreciation for community members and the LIVEcommunity as a whole!

The LIVEcommunity thanks you for your participation!