
vShield API Programming Guide
56 VMware, Inc.
Example:
DELETE /api/1.0/zones/datacenter-4361/firewall/rules HTTP/1.1
Host: localhost
Authorization: Basic YWRtaW46ZGVmYXVsdA==
Managing Security Groups
AsecuritygroupisatrustzonethatyoucreateandassignresourcestoforvShieldAppfirewallprotection.
Securitygroupsarecontainers,likeavApporacluster.Typically ,containersarecreatedinthevCenterand
viewedinthevShieldManageruserinterface.
Securitygroupsenablesyoutocreatecustom
containersfromwithinvShield.Youarbitrarilyassignresources,
suchasvirtualmachinesandnetworkadapters,toasecuritygroup.Afterthegroupisdefined,youaddthe
grouptoanvShieldAppfirewallruleforprotection.See“ConfiguringFirewallRulesforavCenterContainer”
onpage 51.
Allsecuritygroupsconfiguredby
usingRESTrequestsappearundertheSecurityGroupstabforth e
appropriatenodein thevShieldManageruserinterfaceandvSphereClientplug‐in .
Forthesecuritygroupsschema,see“SecurityGroupsSchema”onpage 67.
Add a Security Group
Example 6-10. Adding a Security Group
Request:
POST <vshield_manager-uri>/api/1.0/global/securityGroups/<base-node-moref-id>/groups
Example:
Addingasinglesecuritygroup
POST /api/1.0/global/securityGroups/datacenter-7/groups/ HTTP/1.1
authorization: Basic YWRtaW46ZGVmYXVsdA==
host: 10.112.196.127
Content-Type: application/xml
Content-Length: 474
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<VsmGlobalConfig><SecurityGroups><SecurityGroup><SecurityGroupBaseNode>
datacenter-7</SecurityGroupBaseNode><SecurityGroupName>Zone-3
</SecurityGroupName><SecurityGroupNodeList><Node><Id>502888cf-e08c-61dc-4523-a
87e234d821a.000</Id></Node><Node><Id>502a183c-715e-5e37-f413-aea57de1e884.000
</Id></Node></SecurityGroupNodeList></SecurityGroup></SecurityGroups>
</VsmGlobalConfig>
Addingasinglesecuritygroupwithnonetworkadapters
POST /api/1.0/global/securityGroups/datacenter-7/groups/ HTTP/1.1
authorization: Basic YWRtaW46ZGVmYXVsdA==
host: 10.112.196.127
Content-Type: application/xml
Content-Length: 299
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<VsmGlobalConfig><SecurityGroups><SecurityGroup><SecurityGroupBaseNode>
datacenter-7</SecurityGroupBaseNode><SecurityGroupName>Zone-5
</SecurityGroupName></SecurityGroup></SecurityGroups></VsmGlobalConfig>
Comentários a estes Manuais