1.5

vCenter Chargeback API Programming Guide
8 VMware, Inc.
Figure 1-1. REST Architecture in vCenter Chargeback
Requests
AnHTTPrequestsentbyaChargebackAPIcanbeofthefollowingtype:PUT,POST,GET,orDELETE.
Table 11showshoweachoftheserequesttypesmapstoastandardCRUDoperation.
AlongwiththeHTTPrequests,youcanpassrequestparametersbyusingXMLs.AnexamplerequestXML
for
theLoginAPIisprovidedhere.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Request xmlns="http://www.vmware.com/vcenter/chargeback/1.5.0">
<Users>
<User>
<Name>admin</Name>
<Password>ttt</Password>
<Type>local</Type>
</User>
</Users>
</Request>
Responses
WhenanAPItaskissuccessful,thevalueofthestatusparameterintheresponseXMLissettosuccessas
showninthefollowingexample.
<?xml version="1.0" encoding="UTF-8"?>
<Response status="success" isValidLicense="true"
xmlns="http://www.vmware.com/vcenter/chargeback/1.5.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Hierarchies>
<Hierarchy id="1">
...
</Hierarchy>
</Hierarchies>
</Response>
Table 1-1. Request Type Mapping
Request Type CRUD Operation
POST CREATE
GET READ
PUT UPDATE/CREATE
DELETE DELETE