Quantcast
Channel: VMware Communities : All Content - vCloud Networking and Security
Viewing all articles
Browse latest Browse all 890

Error configuring/adding firewall rules using vShield (REST) API

$
0
0

Hello all:

I'd appreciate any and all information anyone could provide about the following:

 

Using the rest API I can get the current rules.  However when I attempt to add a new rule I'm getting the error:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?><Errors><Error><code>100030</code><description>Precondition failed.Please update the current configuration.</description></Error></Errors>

 

Here's the curl command line:

curl -X POST -v -H "Content-Type: application/xml" -k -u "admin:<pwd>"  "https://192.168.8.100/api/2.0/app/firewall/datacenter-2/config" -T myNewRule.xml

 

And here's the contents of myNewRule.xml:

 

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<VshieldAppConfiguration>
    <firewallConfiguration contextId="datacenter-2" provisioned="true">
        <layer3FirewallRule disabled="false" precedence="high" id="1024">
            <action>allow</action>
            <logged>false</logged>
            <notes></notes>
            <source>
                <address exclude="false">
                    <containerId>securitygroup-195</containerId>
                </address>
            </source>
            <destination>
                <address exclude="false">
                    <containerId>securitygroup-196</containerId>
                </address>
                <application>
                    <portInfo>9999</portInfo>
                    <protocol>6</protocol>
                    <protocolName>TCP</protocolName>
                </application>
            </destination>
        </layer3FirewallRule>
        <layer3FirewallRule disabled="false" precedence="high" id="1023">
            <action>allow</action>
            <logged>false</logged>
            <notes>Kids need to pray</notes>
            <source>
                <address exclude="false">
                    <containerId>securitygroup-195</containerId>
                </address>
            </source>
            <destination>
                <address exclude="false">
                    <containerId>securitygroup-196</containerId>
                </address>
                <application>
                    <portInfo>4444</portInfo>
                    <protocol>17</protocol>
                    <protocolName>UDP</protocolName>
                </application>
            </destination>
        </layer3FirewallRule>
        <layer3FirewallRule disabled="false" precedence="default" id="1008">
            <action>allow</action>
            <logged>false</logged>
            <notes></notes>
            <source />
            <destination />
        </layer3FirewallRule>
        <layer2FirewallRule disabled="false" precedence="default" id="1009">
            <action>allow</action>
            <logged>false</logged>
            <notes></notes>
            <destination />
        </layer2FirewallRule>
    </firewallConfiguration>
</VshieldAppConfiguration>

Viewing all articles
Browse latest Browse all 890

Trending Articles