
VMware, Inc. 55
Chapter 6 vShield App Management
consolidatedforcombinedconfigurationincludingallrulesapplicableinthecontext/
<P>istheruleprecedence,eitherHIGH,LOW,DEFAULT,orNONE.
<R>canbeLAYER3orLAYER2tofiltertheconfigurationrulesforlayer3orlayer2.
<C>istheconfigurationIDusedinconjunctionwiththehistorylistingtype.
Example 6-3. Queries for firewall configuration
Getquickstatus:
GET https://<vsm-ip>/api/2.0/app/firewall/dvportgroup-63/config?list=status
Getconfigurationofonlyhighprecedencerules:
GET https://<vsm-ip>/api/2.0/app/firewall/dvportgroup-63/config?list=config&precedence=HIGH
Getconfigurationofonlylayer2firewallrules:
GET https://<vsm-ip>/api/2.0/app/firewall/dvportgroup-63/config?list=config&rulesType=LAYER3
Getconsolidatedconfigurationsforthecontext:
GET https://<vsm-ip>/api/2.0/app/firewall/datacenter-2/config?list=consolidated
Getaparticularconfigurationhistoryforagivencontext:
GET https://<vsm-ip>/api/2.0/app/firewall/datacenter-2/config?list=history&configID=241
ConfigurationisreturnedasformattedXML.
Change the Firewall Configuration
Youshouldquerythecurrentfirewallconfigurationforthedesiredcontextbeforemodifyinganyfirewall
settings.TheresponseofthequeryAPIcallhasanEtagheader.YoumustspecifytheEtagheadervalueinthe
If‐MatchheaderofthePOSTcommandwithindoublequotes.Thishandleshandlesimultaneous
configuration
changerequestsfrommultipleusers.
Example 6-4. Change firewall configuration
Request:
POST https://<vsm-ip>/api/2.0/app/firewall/dvportgroup-63/config
RequestBody:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<VshieldAppConfiguration>
<firewallConfiguration contextId="datacenter-2">
<layer3FirewallRule disabled="false" precedence="default" id="1001">
<action>allow</action>
<logged>false</logged>
<notes/>
<source/>
<destination/>
</layer3FirewallRule>
<layer2FirewallRule disabled="false" precedence="default" id="1002">
<action>allow</action>
<logged>false</logged>
<notes/>
<destination/>
</layer2FirewallRule>
</firewallConfiguration>
</VshieldAppConfiguration>
Komentáře k této Příručce