EasyManua.ls Logo

VMware VCLOUD API 1.0 - API - Page 25

VMware VCLOUD API 1.0 - API
212 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
VMware, Inc. 25
Chapter 2 Hello vCloud: A Structured REST Workflow Example
CreationparametersforavAppnetwork.AvAppnetworkdefineshowthevAppconnectstoan
organizationnetworkavailableinthetargetvDC.Formoreinformation,see“A b o u t vAppNetworks”on
page 62.
TheinstantiateVAppTemplaterequestinExample 2‐6suppliestheseparametersinthefollowingplaces:
ThenameissuppliedinthenameattributeoftheInstantiateVAppTemplateParamsrequest.(This
requestalsoprovidesadescription,whichisoptionalbutagoodpractice.)
ThetemplateURLissuppledintheSourceelement
ThevAppnetworkisspecifiedintheNetworkConfigSectionelement.Thisspecificationincludesthree
parameters:
Anameforthenetwork,suppliedinthenameattributeoftheNetworkConfigSectionelement.If
thevApptemplateincludesanovf:Networkelement,thenameyouspecifyforthevAppnetwork
mustmatchthenamespecifiedinthatelement’sovf:nameattribute.
AreferencetotheorganizationnetworktowhichthevAppnetworkconnects,specifiedinthe
ParentNetworkelement.TheURLusedhereisonereturnedinExample 2‐5,inthe
AvailableNetworkselementofthevDC.
Afencemode,specifiedintheFenceModeelement.AvalueofbridgedindicatesthatthevApp
networkisconnecteddirectlytotheorganizationnetwork.
ThetargetoftherequestistheinstantiateVAppTemplateURLofthisvDC(seeExample 2‐5).Becausethe
operationcreatesanewobject(avApp),theHTTPrequest
typeisPOST.
Example 2-6. Instantiating a vApp Template
Request:
POST http://vcloud.example.com/api/v1.0/vdc/5/action/instantiateVAppTemplate
Content-Type: application/vnd.vmware.vcloud.instantiateVAppTemplateParams+xml
...
<InstantiateVAppTemplateParams name="Linux FTP server" xmlns="http://www.vmware.com/vcloud/v1"
xmlns:ovf="http://schemas.dmtf.org/ovf/envelope/1" >
<Description>Example FTP Server vApp</Description>
<InstantiationParams>
<NetworkConfigSection>
<ovf:Info>Configuration parameters for vAppNetwork</ovf:Info>
<NetworkConfig networkName="vAppNetwork">
<Configuration>
<ParentNetwork href="http://vcloud.example.com/api/v1.0/network/54"/>
<FenceMode>bridged</FenceMode>
</Configuration>
</NetworkConfig>
</NetworkConfigSection>
</InstantiationParams>
<Source href="http://vcloud.example.com/api/v1.0/vAppTemplate/vappTemplate-111"/>
</InstantiateVAppTemplateParams>
Response:
201 Created
Content-Type: application/vnd.vmware.vcloud.vApp+xml
<VApp deployed=”false” status="0" name="Linux FTP server"
type="application/vnd.vmware.vcloud.vApp+xml"
href="http://vcloud.example.com/api/v1.0/vApp/vapp-7" ...>
<Link rel="up" type="application/vnd.vmware.vcloud.vdc+xml"
href="http://vcloud.example.com/api/v1.0/vdc/5"/>
<Description>Example FTP Server vApp</Description>
<Tasks>

Table of Contents