Cisco UCS Director REST API Cookbook, Release 6.5 First Published: 2017-07-11 Americas Headquarters Cisco Systems, Inc. 170 West Tasman Drive San Jose, CA 95134-1706 USA http://www.cisco.com Tel: 408 526-4000 800 553-NETS (6387) Fax: 408 527-0883 THESPECIFICATIONSANDINFORMATIONREGARDINGTHEPRODUCTSINTHISMANUALARESUBJECTTOCHANGEWITHOUTNOTICE.ALLSTATEMENTS, INFORMATION,ANDRECOMMENDATIONSINTHISMANUALAREBELIEVEDTOBEACCURATEBUTAREPRESENTEDWITHOUTWARRANTYOFANYKIND, EXPRESSORIMPLIED.USERSMUSTTAKEFULLRESPONSIBILITYFORTHEIRAPPLICATIONOFANYPRODUCTS. THESOFTWARELICENSEANDLIMITEDWARRANTYFORTHEACCOMPANYINGPRODUCTARESETFORTHINTHEINFORMATIONPACKETTHATSHIPPEDWITH THEPRODUCTANDAREINCORPORATEDHEREINBYTHISREFERENCE.IFYOUAREUNABLETOLOCATETHESOFTWARELICENSEORLIMITEDWARRANTY, CONTACTYOURCISCOREPRESENTATIVEFORACOPY. TheCiscoimplementationofTCPheadercompressionisanadaptationofaprogramdevelopedbytheUniversityofCalifornia,Berkeley(UCB)aspartofUCB'spublicdomainversion oftheUNIXoperatingsystem.Allrightsreserved.Copyright©1981,RegentsoftheUniversityofCalifornia. NOTWITHSTANDINGANYOTHERWARRANTYHEREIN,ALLDOCUMENTFILESANDSOFTWAREOFTHESESUPPLIERSAREPROVIDED“ASIS"WITHALLFAULTS. CISCOANDTHEABOVE-NAMEDSUPPLIERSDISCLAIMALLWARRANTIES,EXPRESSEDORIMPLIED,INCLUDING,WITHOUTLIMITATION,THOSEOF MERCHANTABILITY,FITNESSFORAPARTICULARPURPOSEANDNONINFRINGEMENTORARISINGFROMACOURSEOFDEALING,USAGE,ORTRADEPRACTICE. INNOEVENTSHALLCISCOORITSSUPPLIERSBELIABLEFORANYINDIRECT,SPECIAL,CONSEQUENTIAL,ORINCIDENTALDAMAGES,INCLUDING,WITHOUT LIMITATION,LOSTPROFITSORLOSSORDAMAGETODATAARISINGOUTOFTHEUSEORINABILITYTOUSETHISMANUAL,EVENIFCISCOORITSSUPPLIERS HAVEBEENADVISEDOFTHEPOSSIBILITYOFSUCHDAMAGES. AnyInternetProtocol(IP)addressesandphonenumbersusedinthisdocumentarenotintendedtobeactualaddressesandphonenumbers.Anyexamples,commanddisplayoutput,network topologydiagrams,andotherfiguresincludedinthedocumentareshownforillustrativepurposesonly.AnyuseofactualIPaddressesorphonenumbersinillustrativecontentisunintentional andcoincidental. CiscoandtheCiscologoaretrademarksorregisteredtrademarksofCiscoand/oritsaffiliatesintheU.S.andothercountries.ToviewalistofCiscotrademarks,gotothisURL:http:// www.cisco.com/go/trademarks.Third-partytrademarksmentionedarethepropertyoftheirrespectiveowners.Theuseofthewordpartnerdoesnotimplyapartnership relationshipbetweenCiscoandanyothercompany.(1110R) ©2016CiscoSystems,Inc.Allrightsreserved. CONTENTS Preface Preface vii Audience vii Conventions vii RelatedDocumentation ix DocumentationFeedback ix ObtainingDocumentationandSubmittingaServiceRequest ix CHAPTER 1 NewandChangedInformationforthisRelease 1 NewandChangedInformation 1 CHAPTER 2 Overview 3 GettingStartedwithCiscoUCSDirectorRESTAPI 3 StructureofanExample 3 HowtoUsetheExamples 4 Example:Self-ServiceProvisioningofVirtualMachines 4 Example:RollbackaProvisionedVM 8 RequestingJSONAPIusingHTTP/HTTPSPOST 8 HowtouseGlobalVariablesinRESTAPI 9 CHAPTER 3 Examples 11 ManagingGroups 12 CreatingaGroup 12 ListingAllGroups 16 ModifyingaGroup 17 DeletingaGroup 19 ManagingUsers 20 ResettingthePasswordofaLogged-inUser 20 Cisco UCS Director REST API Cookbook, Release 6.5 iii Contents ResettingthePasswordofaUser 22 ManagingCatalogs 24 CreatingaCatalogItem 24 RetrievingCatalogDetails 27 DeletingaCatalogItem 28 ManagingPhysicalAccounts 29 CreatingaPhysicalAccount 29 ListingtheAccounts 34 DeletingaPhysicalAccount 35 ManagingVirtualDataCenters 36 CreatingaVDC 36 ListingtheVDCs 38 ExportingaVDC 39 ImportingaVDC 40 RetrievingVDCResourceLimits 41 RetrievingaCostModel 42 DeletingaVDC 45 ManagingVirtualInfrastructurePolicies 46 CreatingaVirtualInfrastructurePolicy 46 RetrievingaVirtualInfrastructurePolicy 48 ModifyingaVirtualInfrastructurePolicy 49 DeletingaVirtualInfrastructurePolicy 51 ManagingAPICVirtualInfrastructurePolicies 52 CreatinganAPICVirtualInfrastructurePolicy 52 ListingAllAPICVirtualInfrastructurePolicy 53 RetrievinganAPICVirtualInfrastructurePolicy 55 ModifyinganAPICVirtualInfrastructurePolicy 56 DeletinganAPICVirtualInfrastructurePolicy 57 ManagingServiceContainers 58 CreatingaServiceContainerwithTemplate 58 RetrievingaServiceContainer 60 RetrievingaServiceContainerwithCatalog 61 ListingallServiceContainersinCiscoUCSDirector 63 AddingaTiertoaContainerVM 66 AddingaTiertoanAPICContainer 68 Cisco UCS Director REST API Cookbook, Release 6.5 iv Contents AddingaVirtualNetworkInterfaceCardtoaContainerVM 69 DeletingaServiceContainer 71 ManagingContracts 72 CreatingaContract 72 DeletingaContract 74 ManagingVirtualMachines 76 ProvisioningaVM 76 PoweringOnaVM 81 RebootingaVM 82 AddingaVirtualNetworkInterfaceCardtoaVM 83 PoweringOffaVM 86 SettingupaVMwareVMGuestandExecutingVIXScript 87 ManagingVMwareSystemPolicy 88 CreatingaVMwareSystemPolicy 88 RetrievingtheVMwareSystemPolicyDetails 90 ModifyingaVMwareSystemPolicy 94 DeletingaVMwareSystemPolicy 95 DeletingaVMwareSnapshot 97 ManagingWorkflowOrchestration 98 SubmittingaServiceRequest 98 SubmittingaVAppRequest 99 RetrievingOutputofaServiceRequest 100 RollbackaWorkflow 102 RetrievingLogEntriesofaServiceRequest 103 RetrievingWorkflowFields 105 RetrievingInputFieldsofaWorkflowAssociatedwithaCatalog 105 RetrievingOutputFieldsofaWorkflowAssociatedwithaCatalog 107 RetrievingWorkflowInputFields 109 RetrievingWorkflowOutputFields 111 ManagingMSP 113 TogglingMSPMode 113 ManagingDataStores 114 RetrievinganEligibleListofDataStoreClusters 114 RetrievinganEligibleListofDataStores 116 ManagingReports 117 Cisco UCS Director REST API Cookbook, Release 6.5 v Contents ViewingAvailableReportsDefinition 117 ViewingHistoricalReport 121 ViewingResourceUsageReport 123 ViewingSnapshotReport 129 ViewingTabularReports 131 Cisco UCS Director REST API Cookbook, Release 6.5 vi Preface • Audience, page vii • Conventions, page vii • RelatedDocumentation, page ix • DocumentationFeedback, page ix • ObtainingDocumentationandSubmittingaServiceRequest, page ix Audience ThisguideisintendedforsoftwareengineerswithexpertiseusingAPIstodevelopandextendapplications. TheseengineersshouldunderstandCiscoUCSandrelatednetworkingandstorageprotocols,andhave experienceworkingwithJSON,XML,andJava. Conventions Text Type Indication GUIelements GUIelementssuchastabtitles,areanames,andfieldlabelsappearinthisfont. Maintitlessuchaswindow,dialogbox,andwizardtitlesappearinthisfont. Documenttitles Documenttitlesappearinthisfont. TUIelements InaText-basedUserInterface,textthesystemdisplaysappearsinthis font. Systemoutput Terminalsessionsandinformationthatthesystemdisplaysappearinthis font. CLIcommands CLIcommandkeywordsappearinthisfont. VariablesinaCLIcommandappearinthisfont. [] Elementsinsquarebracketsareoptional. Cisco UCS Director REST API Cookbook, Release 6.5 vii Preface Conventions Text Type Indication {x|y|z} Requiredalternativekeywordsaregroupedinbracesandseparatedbyvertical bars. [x|y|z] Optionalalternativekeywordsaregroupedinbracketsandseparatedbyvertical bars. string Anonquotedsetofcharacters.Donotusequotationmarksaroundthestringor thestringwillincludethequotationmarks. <> Nonprintingcharacterssuchaspasswordsareinanglebrackets. [] Defaultresponsestosystempromptsareinsquarebrackets. !,# Anexclamationpoint(!)orapoundsign(#)atthebeginningofalineofcode indicatesacommentline. Note Meansreadertakenote.Notescontainhelpfulsuggestionsorreferencestomaterialnotcoveredinthe document. Caution Meansreaderbecareful.Inthissituation,youmightperformanactionthatcouldresultinequipment damageorlossofdata. Tip Meansthefollowinginformationwillhelpyousolveaproblem.Thetipsinformationmightnotbe troubleshootingorevenanaction,butcouldbeusefulinformation,similartoaTimesaver. Timesaver Meansthedescribedactionsavestime.Youcansavetimebyperformingtheactiondescribedinthe paragraph. Warning IMPORTANTSAFETYINSTRUCTIONS Thiswarningsymbolmeansdanger.Youareinasituationthatcouldcausebodilyinjury.Beforeyou workonanyequipment,beawareofthehazardsinvolvedwithelectricalcircuitryandbefamiliarwith standardpracticesforpreventingaccidents.Usethestatementnumberprovidedattheendofeachwarning tolocateitstranslationinthetranslatedsafetywarningsthataccompaniedthisdevice. SAVETHESEINSTRUCTIONS Cisco UCS Director REST API Cookbook, Release 6.5 viii Preface Related Documentation Related Documentation Cisco UCS Director Documentation Roadmap ForacompletelistofCiscoUCSDirectordocumentation,seetheCiscoUCSDirectorDocumentation RoadmapavailableatthefollowingURL:http://www.cisco.com/en/US/docs/unified_computing/ucs/ ucs-director/doc-roadmap/b_UCSDirectorDocRoadmap.html. Cisco UCS Documentation Roadmaps ForacompletelistofallB-Seriesdocumentation,seetheCiscoUCSB-SeriesServersDocumentationRoadmap availableatthefollowingURL: http://www.cisco.com/go/unifiedcomputing/b-series-doc. ForacompletelistofallC-Seriesdocumentation,seetheCiscoUCSC-SeriesServersDocumentationRoadmap availableatthefollowingURL:http://www.cisco.com/go/unifiedcomputing/c-series-doc. Note TheCiscoUCSB-SeriesServersDocumentationRoadmapincludeslinkstodocumentationforCisco UCSManagerandCiscoUCSCentral.TheCiscoUCSC-SeriesServersDocumentationRoadmapincludes linkstodocumentationforCiscoIntegratedManagementController. Documentation Feedback Toprovidetechnicalfeedbackonthisdocument,ortoreportanerrororomission,pleasesendyourcomments [email protected]. Obtaining Documentation and Submitting a Service Request Forinformationonobtainingdocumentation,usingtheCiscoBugSearchTool(BST),submittingaservice request,andgatheringadditionalinformation,seeWhat'sNewinCiscoProductDocumentation. ToreceivenewandrevisedCiscotechnicalcontentdirectlytoyourdesktop,youcansubscribetotheWhat's NewinCiscoProductDocumentationRSSfeed.RSSfeedsareafreeservice. Cisco UCS Director REST API Cookbook, Release 6.5 ix Preface Obtaining Documentation and Submitting a Service Request Cisco UCS Director REST API Cookbook, Release 6.5 x
Description: