Add A Virtual Machine To A Security Group - VMware VSHIELD APP 1.0 - API Programming Manual

Vshield api
Table of Contents

Advertisement

Adding a single security group with no network adapters
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"?>
You can add multiple security groups in one request.
Example 6-11. Adding Multiple Security Groups
Example:
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: 815
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

Add a Virtual Machine to a Security Group

You can add a virtual machine to a Security Group by specifying the node in which the Security Group resides. 
You use the vNIC identifier to identify the virtual machine. To get the <NIC-ID>
Properties from a Virtual Machine" on page 60.
Example 6-12. Adding a Virtual Machine to a Security Group
Request:
POST <vshield_manager-uri>/api/1.0/global/securityGroups/<base-node-moid>/nodes/<nic-id>
Example:
POST /api/1.0/global/securityGroups/dvportgroup-343/nodes/
502a7702-8936-be93-ec75-1f0d00abefdb.000 HTTP/1.1
authorization: Basic YWRtaW46ZGVmYXVsdA==
host: 10.112.196.127
Content-Type: application/xml
Content-Length: 207
<?xml version="1.0" encoding="UTF-8"
VMware, Inc.
<VsmGlobalConfig><SecurityGroups><SecurityGroup><SecurityGroupBaseNode>datacen
ter-7</SecurityGroupBaseNode><SecurityGroupName>Zone-5</SecurityGroupName></Se
curityGroup></SecurityGroups></VsmGlobalConfig>
<VsmGlobalConfig><SecurityGroups><SecurityGroup><SecurityGroupBaseNode>datacenter-
7</SecurityGroupBaseNode><SecurityGroupName>secgroup-1</SecurityGroupName><Securit
yGroupNodeList><Node><Id>502888cf-e08c-61dc-4523-a87e234d821a.000</Id></Node><Node
><Id>502a183c-715e-5e37-f413-aea57de1e884.000</Id></Node></SecurityGroupNodeList><
/SecurityGroup><SecurityGroup><SecurityGroupBaseNode>datacenter-7</SecurityGroupBa
seNode><SecurityGroupName>Zone-2</SecurityGroupName><SecurityGroupNodeList><Node><
Id>502a183c-715e-5e37-f413-aea57de1e884.000</Id></Node><Node><Id>5028300b-598f-1b5
0-f714-9f054027ff5a.000</Id></Node></SecurityGroupNodeList></SecurityGroup></Secur
ityGroups></VsmGlobalConfig>
standalone="yes"?><VsmGlobalConfig><SecurityGroups><SecurityGroupIdList><SecurityG
roupId>udz-1</SecurityGroupId></SecurityGroupIdList></SecurityGroups></VsmGlobalCo
nfig>
Chapter 6 vShield App Management
parameter, see "Get the 
59

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the VSHIELD APP 1.0 - API and is the answer not in the manual?

Questions and answers

Table of Contents