Panorama REST API policy creation error with ' 'message': 'Invalid Body',

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 policy creation error with ' 'message': 'Invalid Body',

L0 Member
{'code': 3,
 'message': 'Invalid Body',
 'details': [{'@type': 'CauseInfo',
   'causes': [{'code': 9,
     'module': 'pan_api',
     'description': 'Invalid Body'}]}]}

 I m able to create policy with POST method  in panoram , however API doc for relase did not help as well.

Url:

https://192.168.1.1/restapi/v10.1/Policies/SecurityPreRules?location=device-group&device-group=FW_ru...

 data sending:

{"entry":{'name': '1',
'location': 'device-group',
'device-group': 'FW_rules',
'to': {'member': ['any']},
'from': {'member': ['any']},
'source': {'member': ['any']},
'destination': {'member': ['any']},
'application': {'member': ['any']},
'service': {'member': ['application-default']},
'action': 'allow'}}

 

 

API DOC:

The security pre-rule you want to create

entry
object (policies-security-pre-rules)
 
@name
required
string <object-name> <= 63 characters

Alphanumeric string [ 0-9a-zA-Z._-]

target
object
 
devices
object
 
tags
object
 
negate
string
Enum: "yes" "no"

Target to all but these specified devices and tags

from
required
object
 
to
required
object
 
source
required
object
 
member
Array of strings
 
source-user
object
 
destination
required
object
 
member
Array of strings
 
service
required
object
 
member
Array of strings
 
category
object
 
application
required
object
 
member
Array of strings
 
source-imsi
object

IMSI (14-15 digits) or 6 digit prefix or a range

source-imei
object

Prefix[NNNNNNNN*] or IMEI [15-16 digits]

source-nw-slice
object

NSSAI ST only

source-hip
object
 
destination-hip
object
 
schedule
string
 
tag
object
 
negate-source
string
Default: "no"
Enum: "yes" "no"
 
negate-destination
string
Default: "no"
Enum: "yes" "no"
 
disabled
string
Default: "no"
Enum: "yes" "no"

Disable the rule

description
string [ 0 .. 1024 ] characters
 
group-tag
string <= 127 characters
 
action
required
string
Default: "allow"
Enum: "deny" "allow" "drop" "reset-client" "reset-server" "reset-both"
 
icmp-unreachable
string
Default: "no"
Enum: "yes" "no"

Send ICMP unreachable error when action is drop or reset

rule-type
string
Default: "universal"
Enum: "universal" "intrazone" "interzone"
 
option
object
 
log-setting
string <= 63 characters

Name of a Log Forwarding object

log-start
string
Default: "no"
Enum: "yes" "no"

Log at session start

log-end
string
Default: "yes"
Enum: "yes" "no"

Log at session end (required for certain ACC tables)

profile-setting
profiles (object) or group (object)
 
qos
object
QUERY PARAMETERS
name
required
string

The name of the entry

location
required
string
Enum: "shared" "device-group"

The location of the entry

device-group
string

The name of the Panorama device group to which you have assigned the firewalls, when location is device-group

input-format
string
Default: "json"
Enum: "json" "xml"

Specify the input format to be JSON or XML. It is equivalent to set Content-Type header to application/json or application/xml. If both input-format and Content-Type header are presented, the value of input-format will override the header.

output-format
string
Default: "json"
Enum: "json" "xml"

Specify the output format to be JSON or XML. It is equivalent to set Accept header to application/json or application/xml. If both output-format and Accept header are presented, the value of output-format will override the header.

0 REPLIES 0
  • 186 Views
  • 0 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!