vCloud API Programming Guide
100
VMware, Inc.
Add a Network to an Organization
An
administrator
can
use
the
rel="add"
link
for
networks
in
an
AdminOrg
body
to
add
a
network
to
the
organization.
Example 6
‐
10
does
this
by
making
a
POST
request
to
the
networks
link
returned
in
Example 6
‐
4
.
The
content
of
the
FenceMode
element
in
the
request
body
specifies
that
organization
network
is
bridged
to
its
ParentNetwork
,
whose
href
value
was
retrieved
from
one
of
the
Network
elements
in
the
response
in
Example 6
‐
2
.
Example 6-10.
Add a Network to an Organization
Request:
POST http://vcloud.example.com/api/v1.0/admin/org/26/networks
Content-Type: application/vnd.vmware.admin.xml
...
<OrgNetwork name="Internet" xmlns="http://www.vmware.com/vcloud/v1">
<Description>Bridged to the public Internet</Description>
<Configuration>
<ParentNetwork type="application/vnd.vmware.admin.xml"
name="ExternalNetwork-VC1"
href="http://vcloud.example.com/api/v1.0/admin/network/7"/>
<FenceMode>bridged</FenceMode>
</Configuration>
</OrgNetwork>
Response:
201 Created
Content-Type: application/vnd.vmware.admin.xm
...
<OrgNetwork xmlns="http://www.vmware.com/vcloud/v1" name="Internet"
type="application/vnd.vmware.admin.xml"
href="http://vcloud.example.com/api/v1.0/admin/network/54" ...>
<Link rel="alternate" type="application/vnd.vmware.vcloud.xml"
href="http://vcloud.example.com/api/v1.0/network/54"/>
<Link rel="edit" type="application/vnd.vmware.admin.xml"
href="http://vcloud.example.com/api/v1.0/admin/network/54"/>
<Link rel="remove" href="http://vcloud.example.com/api/v1.0/admin/network/54"/>
<Link rel="up" type="application/vnd.vmware.admin.organxml"
href="http://vcloud.example.com/api/v1.0//org/26"/>
<Description>Bridged to the public Internet</Description>
<Tasks>
<Task ... operation="Creating Network Internet (2)" ... >
...
</Task>
</Tasks>
<Configuration>
<IpScope>
<IsInherited>true</IsInherited>
<Gateway>10.147.122.190</Gateway>
<Netmask>255.255.255.192</Netmask>
<Dns1>10.115.120.71</Dns1>
<DnsSuffix>example.com</DnsSuffix>
<IpRanges>
<IpRange>
<StartAddress>10.147.122.129</StartAddress>
<EndAddress>10.147.122.189</EndAddress>
</IpRange>
</IpRanges>
<AllocatedIpAddresses/>
</IpScope>
N
OTE
A
NetworkPool
element
must
be
included
in
the
request
when
creating
network
whose
FenceMode
is
natRouted
or
isolated
.
Содержание VCLOUD API 1.0 - TECHNICAL NOTE
Страница 10: ...vCloud API Programming Guide 10 VMware Inc...
Страница 20: ...vCloud API Programming Guide 20 VMware Inc...
Страница 32: ...vCloud API Programming Guide 32 VMware Inc...
Страница 90: ...vCloud API Programming Guide 90 VMware Inc...
Страница 150: ...vCloud API Programming Guide 150 VMware Inc...
Страница 170: ...vCloud API Programming Guide 170 VMware Inc...
Страница 202: ...vCloud API Programming Guide 202 VMware Inc...
Страница 212: ...vCloud API Programming Guide 212 VMware Inc...