<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Getting 400 Bad Request when trying to create security policy rule in Automation/API Discussions</title>
    <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/getting-400-bad-request-when-trying-to-create-security-policy/m-p/356041#M2477</link>
    <description>&lt;P&gt;I'm trying to create a security policy rule using the REST API but I keep getting an empty response with 400 status.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;URL:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;https://&amp;lt;PANORAMA_IP&amp;gt;/restapi/9.0/Policies/SecurityPreRules&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Headers:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Content-Type: application/json&lt;BR /&gt;X-PAN-KEY: &amp;lt;KEY&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
	"entry": [{
		"target": {
			"devices": [{
				"@name": "001801020796",
				"vsys": {
					"entry": [{
						"@name": "vsys5"
					}]
				}
			}]
		},
		"source": {
			"member": ["1.1.1.1"]
		},
		"destination": {
			"member": ["2.2.2.2"]
		},
		"service": {
			"member": ["TCP_18207"]
		},
		"action": "allow",
		"@name": "new-rule-1",
		"@location": "device-group",
		"@device-group": "ST_DG1.1.1.1",
		"to": {
			"member": ["any"]
		},
		"from": {
			"member": ["any"]
		},
		"application": {
			"member": ["any"]
		}
	}]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried adding ?location=device-group&amp;amp;device-group=ST_DG1.1.1.1 to the URL but it did not make any change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting back an empty response with status code 400. I tried to find it in &lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;PANORAMA_IP&amp;gt;/debug&lt;/A&gt;&amp;nbsp;but it wasn't logged.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My end goal is to create a policy rule that contains a specific vsys of a specific firewall as "target". I'm using the panos Python library and for now there seems to be a bug with this functionality (&lt;A href="https://github.com/PaloAltoNetworks/pan-os-python/issues/273" target="_blank"&gt;https://github.com/PaloAltoNetworks/pan-os-python/issues/273&lt;/A&gt;) so I resorted to making direct API calls.&lt;/P&gt;</description>
    <pubDate>Tue, 13 Oct 2020 09:43:12 GMT</pubDate>
    <dc:creator>DeepSpace</dc:creator>
    <dc:date>2020-10-13T09:43:12Z</dc:date>
    <item>
      <title>Getting 400 Bad Request when trying to create security policy rule</title>
      <link>https://live.paloaltonetworks.com/t5/automation-api-discussions/getting-400-bad-request-when-trying-to-create-security-policy/m-p/356041#M2477</link>
      <description>&lt;P&gt;I'm trying to create a security policy rule using the REST API but I keep getting an empty response with 400 status.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;URL:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;https://&amp;lt;PANORAMA_IP&amp;gt;/restapi/9.0/Policies/SecurityPreRules&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;Headers:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;Content-Type: application/json&lt;BR /&gt;X-PAN-KEY: &amp;lt;KEY&amp;gt;&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;{
	"entry": [{
		"target": {
			"devices": [{
				"@name": "001801020796",
				"vsys": {
					"entry": [{
						"@name": "vsys5"
					}]
				}
			}]
		},
		"source": {
			"member": ["1.1.1.1"]
		},
		"destination": {
			"member": ["2.2.2.2"]
		},
		"service": {
			"member": ["TCP_18207"]
		},
		"action": "allow",
		"@name": "new-rule-1",
		"@location": "device-group",
		"@device-group": "ST_DG1.1.1.1",
		"to": {
			"member": ["any"]
		},
		"from": {
			"member": ["any"]
		},
		"application": {
			"member": ["any"]
		}
	}]
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I also tried adding ?location=device-group&amp;amp;device-group=ST_DG1.1.1.1 to the URL but it did not make any change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm getting back an empty response with status code 400. I tried to find it in &lt;A target="_blank" rel="noopener"&gt;https://&amp;lt;PANORAMA_IP&amp;gt;/debug&lt;/A&gt;&amp;nbsp;but it wasn't logged.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My end goal is to create a policy rule that contains a specific vsys of a specific firewall as "target". I'm using the panos Python library and for now there seems to be a bug with this functionality (&lt;A href="https://github.com/PaloAltoNetworks/pan-os-python/issues/273" target="_blank"&gt;https://github.com/PaloAltoNetworks/pan-os-python/issues/273&lt;/A&gt;) so I resorted to making direct API calls.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Oct 2020 09:43:12 GMT</pubDate>
      <guid>https://live.paloaltonetworks.com/t5/automation-api-discussions/getting-400-bad-request-when-trying-to-create-security-policy/m-p/356041#M2477</guid>
      <dc:creator>DeepSpace</dc:creator>
      <dc:date>2020-10-13T09:43:12Z</dc:date>
    </item>
  </channel>
</rss>

