vCloud API Programming Guide
72
VMware, Inc.
A
set
of
FirewallRules
that
allow
TCP
traffic
to
ports
21
and
22.
Because
these
rules
require
you
to
specify
a
single
IP
address
on
the
inside
of
the
firewall,
the
IpScope
element
is
modified
to
limit
the
range
of
IP
addresses
available
on
the
vApp
network
to
a
single
address.
Any
Vm
that
connects
to
the
vApp
network
defined
in
this
NetworkConfigSection
is
given
this
address.
A
NatService
element
that
maps
a
routable
external
IP
address
to
the
internal
IP
address
allocated
to
the
Vm
by
the
vApp
network.
The
VAppScopedVmId
value
in
this
element
is
taken
from
the
VAppScopedLocalId
element
of
the
Vm
and
the
VmNicId
value
is
taken
from
its
PrimaryNetworkConnectionIndex
.
See
Example 5
‐
12
on
page 75
.
Whenever
you
modify
a
vApp
network,
as
we
do
in
this
example,
you
must
be
sure
that
the
modifications
are
consistent
with
the
network
connection
requirements
of
the
virtual
machines
that
connect
to
the
network.
The
vApp
in
this
example
contains
a
single
Vm.
As
shown
in
Example 5
‐
12
on
page 75
,
that
virtual
machine’s
NetworkConnection
element
specifies
an
IP
address
that
will
not
be
available
after
the
vApp
network
has
been
reconfigured
as
shown
in
Example 5
‐
11
.
Example 5
‐
14
on
page 77
corrects
this
problem.
While
Example 5
‐
11
uses
the
IpScope
element
to
restrict
the
IP
addresses
available
on
a
vApp
network,
it
is
usually
more
practical
to
keep
the
range
of
addresses
available
on
a
vApp
network
somewhat
wider,
and
apply
any
firewall
‐
related
IP
address
restrictions
by
modifying
the
NetworkConnection
of
the
Vm
to
which
the
FirewallRules
apply,
as
we
do
in
Example 5
‐
14
.
A
wider
range
of
IP
addresses
would
allow
this
vApp
to
be
modified
to
include
additional
virtual
machines,
and
the
IP
address
restriction
applied
in
Example 5
‐
14
would
allow
the
FirewallRules
in
Example 5
‐
14
to
remain
valid.
This
request,
like
all
request
bodies
derived
from
a
response,
omits
the
Link
elements
and
href
attributes
that
were
part
of
the
response.
It
also
omits
the
IsDeployed
element
of
the
NetworkConfig
.
These
elements
and
attributes
are
created
by
the
server
and
are
read
‐
only.
They
are
ignored
if
you
include
them
in
a
request.
Example 5-11.
Modify vApp Network Configuration
Request:
PUT http://vcloud.example.com/api/v1.0/vApp/vapp-7/networkConfigSection/
Content-type: application/vnd.vmware.vcloud.networkConfigxml
...
<NetworkConfigSection>
<ovf:Info>Configuration parameters for logical networks</ovf:Info>
<NetworkConfig networkName="vAppNetwork">
<Configuration>
<IpScope>
<IsInherited>false</IsInherited>
<Gateway>10.147.56.253</Gateway>
<Netmask>255.255.255.0</Netmask>
<Dns1>10.147.115.1</Dns1>
<Dns2>10.147.115.2</Dns2>
<DnsSuffix>example.com</DnsSuffix>
<IpRanges>
<IpRange>
<StartAddress>10.147.56.1</StartAddress>
<EndAddress>10.147.56.1</EndAddress>
</IpRange>
</IpRanges>
</IpScope>
<ParentNetwork type="application/vnd.vmware.vcloud.xml" name="Internet"
href="http://vcloud.example.com/api/v1.0/network/54"/>
<FenceMode>natRouted</FenceMode>
<Features>
<FirewallService>
<IsEnabled>true</IsEnabled>
<FirewallRule>
<IsEnabled>true</IsEnabled>
<Description>FTP Rule</Description>
<Policy>allow</Policy>
<Protocols>
<Tcp>true</Tcp>
</Protocols>
<Port>21</Port>
Summary of Contents for VCLOUD API 1.0 - TECHNICAL NOTE
Page 10: ...vCloud API Programming Guide 10 VMware Inc...
Page 20: ...vCloud API Programming Guide 20 VMware Inc...
Page 32: ...vCloud API Programming Guide 32 VMware Inc...
Page 90: ...vCloud API Programming Guide 90 VMware Inc...
Page 150: ...vCloud API Programming Guide 150 VMware Inc...
Page 170: ...vCloud API Programming Guide 170 VMware Inc...