Palo Alto | Create a Security Zone on a Template using PANORAMA REST API call

## REST API POST call that creates a new Security Zone in an target Template in Panorama ##


import requests
import urllib3
import json


urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)

url = "https://{panoramaIP}/restapi/v10.2/Network/Zones?name={name_new_ZONE}&location=template&template={target_template}&vsys=vsys1"


payload = json.dumps({
"entry": {
"@name": "{name_new_ZONE}",
"@location": "template",
"@template": "{target_template}",
"@vsys": "vsys1",
"network": {
"layer3": {},
"log-setting": "default"
}
}
})

headers = {
'Content-Type': 'application/json',
'X-PAN-KEY': '{PANORAMA_API_KEY}'
}

response = requests.request("POST", url, headers=headers, data=payload, verify=False)
print(response.text)

Comentarios

Entradas populares de este blog

EVE-NG: Instalación de EVE-NG

Fortigate: Capturar paquetes (Packet capture/sniffer)

Cisco ISE | Certificados SSL públicos para Guest Portal