VMware, Inc. 17
Chapter 1 Introducing the VMware vCloud API
Linksî ±provideî ±aî ±wayî ±forî ±theî ±serverî ±toî ±informî ±aî ±clientî ±aboutî ±objectî ±relationshipsî ±andî ±theî ±operationsî ±thatî ±objectsî ±
support.î ±Forî ±example,î ±aî ±containerî ±suchî ±asî ±anî ±organizationî ±orî ±catalogî ±canî ±returnî ±linksî ±toî ±theî ±objectsî ±itî ±contains,î ±
andî ±aî ±virtualî ±systemî ±(aî ±vAppî ±orî ±Vm)î ±canî ±containî ±actionî ±linksî ±
thatî ±enableî ±operationsî ±suchî ±asî ±powerî ±stateî ±changesî ±
orî ±virtualî ±deviceî ±reconfiguration.î ±Linksî ±toî ±actionsî ±andî ±containedî ±objectsî ±areî ±omittedî ±fromî ±responsesî ±ifî ±theî ±
requestî ±wasî ±madeî ±byî ±aî ±userî ±whoî ±hasî ±insufficientî ±privilegesî ±toî ±accessî ±theî ±objectî ±orî ±performî ±theî ±action.î ±Actionî ±
linksî ±areî ±alsoî ±omittedî ±whenî ±theî ±actionî ±cannot
î ±beî ±performedî ±(poweringî ±onî ±aî ±virtualî ±machineî ±thatî ±isî ±alreadyî ±
poweredî ±on,î ±forî ±example).
vCloud Client Workflow Overview
Clientsî ±ofî ±theî ±vCloudî ±APIî ±implementî ±aî ±RESTfulî ±workflow,î ±makingî ±HTTPî ±requestsî ±toî ±theî ±serverî ±andî ±retrievingî ±
theî ±informationî ±theyî ±needî ±fromî ±theî ±serverâsî ±responses.
Requests
Clientsî ±makeî ±HTTPî ±requestsî ±toî ±vCloudî ±URLs,î ±hrefî ±attributeî ±valuesî ±whichî ±areî ±typicallyî ±providedî ±byî ±theî ±serverî ±
inî ±responseî ±toî ±GETî ±requestsî ±byî ±theî ±client.î ±Everyî ±vCloudî ±hasî ±aî ±wellâknownî ±URLî ±fromî ±whichî ±aî ±clientî ±canî ±getî ±theî ±
serverâsî ±loginî ±URLî ±andî ±theî ±listî ±ofî ±vCloudî ±APIî ±versionsî ±thatî ±the
î ±serverî ±supports,î ±alongî ±withî ±additionalî ±
informationî ±(seeî ±âAP I î ±Versioningâî ±onî ±page 147).î ±Afterî ±aî ±clientî ±hasî ±loggedî ±in,î ±allî ±vCloudî ±APIî ±URLsî ±canî ±beî ±
discoveredî ±byî ±makingî ±GETî ±requestsî ±toî ±URLsî ±listedî ±inî ±theî ±loginî ±responseî ±andî ±theî ±URLsî ±containedî ±inî ±responsesî ±
toî ±thoseî ±requests.
Request Headers
Allî ±requestsî ±fromî ±authenticatedî ±clientsî ±mustî ±includeî ±anî ±authenticationî ±header.î ±Seeî ±âAuthenticationâî ±onî ±
page 18.
Requestsî ±thatî ±includeî ±aî ±documentî ±bodyî ±mustî ±startî ±withî ±theî ±appropriateî ±HTTPî ±ContentâTypeî ±header.î ±Theî ±typeî ±
attributeî ±ofî ±aî ±responseî ±bodyî ±indicatesî ±theî ±contentî ±typeî ±ofî ±theî ±document.î ±Forî ±example,î ±thisî ±responseî ±fragmentî ±
indicatesî ±thatî ±theî ±
contentî ±typeî ±associatedî ±withî ±aî ±CatalogItem entityî ±isî ±
application/vnd.vmware.vcloud.catalogItem+xml.
<CatalogItem type="application/vnd.vmware.vcloud.catalogItem+xml"
href="http://vcloud.example.com/api/v1.0/catalogItem/221" name="Ubuntu Template with
vsftpd"/>
Anyî ±requestî ±thatî ±includesî ±aî ±CatalogItemî ±requiresî ±theî ±followingî ±ContentâTypeî ±header:
Content-Type: application/vnd.vmware.vcloud.catalogItem+xml
Whenî ±itî ±appearsî ±as î ±theî ±valueî ±ofî ±aî ±ContentâTypeî ±headerî ±orî ±theî ±typeî ±attributeî ±ofî ±anî ±elementî ±inî ±theî ±vCloudî ±API,î ±
thisî ±stringî ±isî ±caseâinsensitiveî ±inî ±requests,î ±andî ±canî ±beî ±returnedî ±inî ±eitherî ±mixedî ±caseî ±orî ±lowercaseî ±charactersî ±inî ±
responses.î ±
Forî ±moreî ±information,î ±seeî ±âContentî ±Typeâî ±onî ±page 142.
Request Bodies
Thisî ±releaseî ±ofî ±Cloudî ±Directorî ±usesî ±aî ±validatingî ±XMLî ±parserî ±thatî ±requiresî ±elementsî ±inî ±aî ±requestî ±bodyî ±toî ±agreeî ±
inî ±bothî ±orderî ±andî ±numberî ±withî ±theî ±schema.î ±Requestî ±bodiesî ±areî ±rejectedî ±asî ±invalidî ±unlessî ±theyî ±meetî ±theî ±
followingî ±criteria:
ïź XMLî ±namespaceî ±attributesî ±mustî ±beî ±suppliedî ±forî ±allî ±namespacesî ±representedî ±byî ±elementsî ±inî ±theî ±request.î ±
Seeî ±âXMLî ±Namespaceî ±Identifiersâî ±onî ±page 145.î ±
ïź Ifî ±multipleî ±namespacesî ±areî ±representedî ±inî ±theî ±request,î ±XMLî ±namespaceî ±attributesî ±mustî ±includeî ±anî ±
identifyingî ±prefix,î ±andî ±thatî ±prefixî ±mustî ±beî ±usedî ±withî ±elementsî ±fromî ±thatî ±namespace.î ±Seeî ±âXMLî ±
Namespaceî ±Prefixesî ±inî ±Requestî ±andî ±Responseî ±Bodiesâî ±onî ±page 146.
N
OTEî ±î ±î ±Whenî ±aî ±clientî ±usesî ±aî ±linkî ±toî ±referenceî ±anî ±object,î ±onlyî ±theî ±hrefî ±attributeî ±isî ±required.î ±Theî ±nameî ±andî ±typeî ±
areî ±ignored.