<?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 Re: Error when updating L3 Firewall rules in Network Platform API</title>
    <link>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421530#M3518</link>
    <description>&lt;P&gt;The \" is telling Python that I want the " character, since " can be used to indicate the beginning or ending of a string in Python. If I use the other string character (') to start and end the string and just use the " around the rules tag:&lt;/P&gt;&lt;P&gt;'{"rules":[]}'&lt;/P&gt;&lt;P&gt;I get the same message.&lt;/P&gt;</description>
    <pubDate>Mon, 26 Aug 2019 15:34:54 GMT</pubDate>
    <dc:creator>CBurkhead</dc:creator>
    <dc:date>2019-08-26T15:34:54Z</dc:date>
    <item>
      <title>Error when updating L3 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421526#M3514</link>
      <description>&lt;P&gt;I wrote a Python script a number of months ago that allowed you to copy layer 3 firewall rules from one network to another. It worked just fine. I ran it today and I am getting an error 400 with a message that the "rules" parameter is required. Below is the data that I am submitting to the PUT. The API endpoint is PUT /networks/[networkId]/l3FirewallRules&lt;/P&gt;&lt;P&gt;"{\"rules\":[{'comment': 'Crypto', 'policy': 'deny', 'protocol': 'any', 'srcPort': 'Any', 'srcCidr': 'Any', 'destPort': 'Any', 'destCidr': '93.174.89.116/32', 'syslogEnabled': False}, {'comment': 'Back Orifice', 'policy': 'deny', 'protocol': 'any', 'srcPort': 'Any', 'srcCidr': 'Any', 'destPort': 'Any', 'destCidr': '63.241.38.212/32', 'syslogEnabled': False}]}"&lt;/P&gt;&lt;P&gt;The "rules" parameter seems to be there from what I can tell. The sample code on documenter.getpostman.com does not shed any light on this, either. Has anyone use this endpoint recently with success? Does anyone see anything that looks wrong in the data I am trying to submit?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 14:41:09 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421526#M3514</guid>
      <dc:creator>CBurkhead</dc:creator>
      <dc:date>2019-08-26T14:41:09Z</dc:date>
    </item>
    <item>
      <title>Re: Error when updating L3 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421527#M3515</link>
      <description>&lt;P&gt;As an addendum, I tried passing the following data and still received the message, "Missing parameter - the "rules" parameter is required".&lt;/P&gt;&lt;P&gt;"{\"rules\":[]}"&lt;/P&gt;&lt;P&gt;From what I can see, the endpoint seems to be broken. Meraki, any thoughts?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 15:21:46 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421527#M3515</guid>
      <dc:creator>CBurkhead</dc:creator>
      <dc:date>2019-08-26T15:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: Error when updating L3 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421528#M3516</link>
      <description>Shouldn't it be " be after the 's' in rules&lt;BR /&gt;&lt;BR /&gt;"rules" where you have "rules\"&lt;BR /&gt;&lt;BR /&gt;Not a python guy really, just looking at how it looks in Postman</description>
      <pubDate>Mon, 26 Aug 2019 15:26:44 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421528#M3516</guid>
      <dc:creator>Nolan H.</dc:creator>
      <dc:date>2019-08-26T15:26:44Z</dc:date>
    </item>
    <item>
      <title>Re: Error when updating L3 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421529#M3517</link>
      <description>&lt;P&gt;The syslog parameter is only used if you actually have one configured I believe. You might try removing that.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 15:34:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421529#M3517</guid>
      <dc:creator>SoCalRacer</dc:creator>
      <dc:date>2019-08-26T15:34:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error when updating L3 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421530#M3518</link>
      <description>&lt;P&gt;The \" is telling Python that I want the " character, since " can be used to indicate the beginning or ending of a string in Python. If I use the other string character (') to start and end the string and just use the " around the rules tag:&lt;/P&gt;&lt;P&gt;'{"rules":[]}'&lt;/P&gt;&lt;P&gt;I get the same message.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 15:34:54 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421530#M3518</guid>
      <dc:creator>CBurkhead</dc:creator>
      <dc:date>2019-08-26T15:34:54Z</dc:date>
    </item>
    <item>
      <title>Re: Error when updating L3 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421531#M3519</link>
      <description>&lt;P&gt;I did not need to remove it previously, but I gave that a try. It did not make a difference. It still tells me that I am missing the rules parameter.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 16:00:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421531#M3519</guid>
      <dc:creator>CBurkhead</dc:creator>
      <dc:date>2019-08-26T16:00:02Z</dc:date>
    </item>
    <item>
      <title>Re: Error when updating L3 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421532#M3520</link>
      <description>&lt;P&gt;OK, I have found the problem. It was my own fault. Somewhere along the line, I made a change so that I was building a string for the data that would be used in the PUT, instead of a dictionary, and then running it through json.dumps() to convert it to a JSON compatible string. This conversion made data that is not JSON compatible, and thus is errored out. &lt;/P&gt;&lt;P&gt;That being said, the error message from the endpoint was not at all helpful in figuring out what the actual problem was.&lt;/P&gt;&lt;P&gt;Thanks for the suggestions and I'm sorry I took up your time with something that I should have found on my own, relating to a change I never should have made.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 16:54:25 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421532#M3520</guid>
      <dc:creator>CBurkhead</dc:creator>
      <dc:date>2019-08-26T16:54:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error when updating L3 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421533#M3521</link>
      <description>No worries, glad you got it fixed</description>
      <pubDate>Mon, 26 Aug 2019 18:09:12 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421533#M3521</guid>
      <dc:creator>Nolan H.</dc:creator>
      <dc:date>2019-08-26T18:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Error when updating L3 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421534#M3522</link>
      <description>&lt;P&gt;Do you mind sharing your source code or a part of it. &lt;/P&gt;&lt;P&gt;I'm having the same exact issue as you and it was working in the past. I was so close to open a ticket / post here about this issue , but I figured out that my code might be in cause , although it was working in the past... &lt;/P&gt;&lt;P&gt;Thanks &lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 18:35:18 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421534#M3522</guid>
      <dc:creator>Raphael_L</dc:creator>
      <dc:date>2019-08-26T18:35:18Z</dc:date>
    </item>
    <item>
      <title>Re: Error when updating L3 Firewall rules</title>
      <link>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421535#M3523</link>
      <description>&lt;P&gt;I can easily share the function that is taking the data and then making the API call. The whole program is pretty large. This where my coding problem was. You will be able to see where I am building the dictionary with the "rules" tag in the dictionary and then the conversion to a JSON string and the API call. If you have any question about this, let me know. &lt;/P&gt;&lt;P&gt;def SetL3Rules(Id,ruleslist):&lt;BR /&gt;# Copy the global header and add the content information.&lt;BR /&gt;   header = g_header&lt;BR /&gt;   header.update({'Content-Type':'application/json'})&lt;BR /&gt;   url = g_baseURL+'networks/'+Id+'/l3FirewallRules'&lt;BR /&gt;# Add the "rules" key to make a dictionary with the L3 rules as the data.&lt;BR /&gt;   L3rules = {'rules':ruleslist}&lt;BR /&gt;# Convert the dictionary to JSON. This will replace False with false, True with true, and the ' with ".&lt;BR /&gt;   payload = json.dumps(L3rules)&lt;BR /&gt;   try:&lt;BR /&gt;      ret = requests.request("PUT", url, data=payload, headers=header)&lt;BR /&gt;   except requests.exceptions.ConnectionError:&lt;BR /&gt;      print('A connection error has occurred while writing the layer 3 information.')&lt;BR /&gt;      print('The layer 3 rules were NOT updated.\n')&lt;BR /&gt;      return None&lt;BR /&gt;   rules = ErrorCheck(ret)&lt;BR /&gt;   return rules&lt;/P&gt;</description>
      <pubDate>Mon, 26 Aug 2019 18:43:41 GMT</pubDate>
      <guid>https://community.cisco.com/t5/network-platform-api/error-when-updating-l3-firewall-rules/m-p/5421535#M3523</guid>
      <dc:creator>CBurkhead</dc:creator>
      <dc:date>2019-08-26T18:43:41Z</dc:date>
    </item>
  </channel>
</rss>

