1 / 16

Unified Computing System

Unified Computing System. XML API Integration / Systems Management Standard Administration Tools. UCS API Integration. curl / xml Session Mgmt Example. curl / xml Session Example – continued. Login - Get a Cookie < aaaLogin inName ="admin" inPassword =" cisco123 " />

kiley
Télécharger la présentation

Unified Computing System

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Unified Computing System XML API Integration / Systems Management Standard Administration Tools

  2. UCS API Integration

  3. curl / xml Session Mgmt Example

  4. curl / xml Session Example – continued Login - Get a Cookie <aaaLogininName="admin" inPassword="cisco123" /> <aaaLogin cookie="" response="yes" outCookie="1237375605/d563f79e-5205-4240-b0bc-b65b7aac461d" outRefreshPeriod="600" outPriv="admin" outDomains="org-root" outChannel="noencssl" outEvtChannel="noencssl"> </aaaLogin> Stay Active - Refresh your Cookie • <aaaRefreshinName="admin" inPassword="cisco123" inCookie="1237375605/d563f79e-5205-4240-b0bc-b65b7aac461d" /> • <aaaRefresh cookie="" response="yes" outCookie="1237376246/e2012cdc-7072-486c-ab3a-7f8ba58516b4" outRefreshPeriod="600" outPriv="admin" outDomains="org-root" outChannel="noencssl" outEvtChannel="noencssl"> • </aaaRefresh> • Logout – Deactivate your Cookie • <aaaLogoutinCookie="1237375605/d563f79e-5205-4240-b0bc-b65b7aac461d" /> • <aaaLogout cookie="" response="yes" outStatus="success"> </aaaLogout>

  5. curl / xml Session Example – continuedaaaLogin curl -k – connect to SSL sites without certs -H – Custom header to pass to server -N – Disable buffering of the output -s – Silent mode. Don't output anything -d – HTTP POST data

  6. curl / xml Session Example – continuedaaaLogin xml fo – Format output sel – Select data or query XML -t – template named or default -m – match XPATH expression -v – print value of XPATH expression

  7. curl / xml Session Example – continuedaaaRefresh & aaaLogout

  8. curl / xml Query Example

  9. curl / xml Query Example – continuedconfigResolveClass • curl -k -H "Content-Type: text/xml" -N -s –d'<configResolveClassclassId="lsServer"inHierarchical="true" cookie="1251318687/d201cae3-059a-4c76-baa7-e85fbc0f8496" />' https://172.21.60.75/nuova |xml sel –t -m //lsServer[@assignState=\'assigned\'] -s A:T:U @dn -v "concat('SP: ',@dn,':',@assignState,':',@pnDn,':')" -m lsPower -v @state –b –n curl format remains the same xml has additional operators xpath query – [@assignState='assigned'] -s – sort A:T:U concat – concatenation function -b – break nesting -n – print newline

  10. curl / xml Query Example – continuedconfigResolveClass – lsServer object • <lsServeragentPolicyName="" assignState="assigned"assocState="associated" bootPolicyName="" childAction="deleteNonPresent" configQualifier="" configState="applied" descr="ESX 4 Cluster 01 Node 02" dn="org-root/org-tory_org/ls-esx4-cluster-01-node-02" dynamicConPolicyName="" fltAggr="0" hostFwPolicyName="101e_host_fw" identPoolName="" intId="138635" localDiskPolicyName="internal-RAID-1" mgmtAccessPolicyName="" mgmtFwPolicyName="101e_mgmt_fw" name="esx4-cluster-01-node-02" operState="ok" owner="management" pnDn="sys/chassis-1/blade-8" scrubPolicyName="" solPolicyName="default" srcTemplName="" statsPolicyName="default" type="instance" uuid="000025b5-0000-0000-0001-000000000002" uuidSuffix="0000-000000000000"> • <vnicEtheradaptorProfileName="" addr="00:25:B5:01:02:02" bootDev="disabled" childAction="deleteNonPresent" configState="applied" equipmentDn="sys/chassis-1/blade-8/adaptor-1/host-eth-1" fltAggr="0" identPoolName="" instType="manual" name="eth1" nwTemplName="vnic_b_esx_01" order="2" owner="logical" pinToGroupName="" qosPolicyName="" rn="ether-eth1" statsPolicyName="default" switchId="B" type="ether"> • <vnicEtherIfaddr="00:25:B5:01:02:02" childAction="deleteNonPresent" defaultNet="yes" name="default" operState="indeterminate" owner="logical" rn="if-default" switchId="B" type="ether" vnet="1"/> • <vnicEtherIfaddr="00:25:B5:01:02:02" childAction="deleteNonPresent" defaultNet="no" name="vlan700" operState="indeterminate" owner="logical" rn="if-vlan700" switchId="B" type="ether" vnet="700"/> • </vnicEther> • <vnicFcadaptorProfileName="" addr="20:00:00:25:B5:01:02:01" bootDev="enabled" childAction="deleteNonPresent" configState="applied" equipmentDn="sys/chassis-1/blade-8/adaptor-1/host-fc-1" fltAggr="0" identPoolName="" instType="manual" name="fc0" nodeAddr="20:00:00:25:B5:01:02:00" nwTemplName="vhba_a_esx_01" order="3" owner="logical" persBind="disabled" persBindClear="no" pinToGroupName="" rn="fc-fc0" statsPolicyName="default" switchId="B" type="fc"> • <vnicFcIfchildAction="deleteNonPresent" initiator="20:00:00:25:B5:01:02:01" name="vsan10" operState="indeterminate" owner="logical" rn="if-default" switchId="B" type="fc" vnet="10"/> • </vnicFc> • <lsPowerchildAction="deleteNonPresent" rn="power" state="up"/> • <lsBindingchildAction="deleteNonPresent" computeEpDn="fabric/server/compute-ep-ven-Cisco Systems Inc-mod-N20-B6620-1-ser-QCI125200GR" name="pn-binding" pnDn="sys/chassis-1/blade-8" rn="pn"/> • </lsServer>

  11. curl / xml Query Example – continuedconfigResolveClass Response: SP: org-root/ls-jefhillm-rhel:assigned:sys/chassis-1/blade-4:up SP: org-root/org-QuickStartRoot/org-Tests/org-Hypervisor/ls-esx4-local_disk:assigned:sys/chassis-1/blade-2:up SP: org-root/org-tory_org/ls-esx4-cluster-01-node-01:assigned:sys/chassis-1/blade-6:up SP: org-root/org-tory_org/ls-esx4-cluster-01-node-02:assigned:sys/chassis-1/blade-8:up Alternate UCS Query that pre filters lsServer based on assignState=assigned alleviates the need for [@assignedState='assigned'] as part of the XPATH expression <configResolveClass cookie="1251387546/3b3832e5-d066-40f3-a3b1-bb65789b8de0" inHierarchical="true" classId="lsServer"><inFilter><eq class="lsServer" property="assignState" value="assigned" /></inFilter> </configResolveClass>

  12. curl / xml Configuration Example

  13. curl / xml Config Example – continuedconfigConfMos – mgmtBackup object • <configConfMosinHierarchical="true" cookie="1251492362/1177b546-1da1-4f30-8410-6bc6d8c288f7"> • <inConfigs> • <pair key="sys/backup-10.98.47.74"> • <mgmtBackupadminState="enabled" descr="" dn="sys/backup-10.98.47.74" hostname="10.98.47.74" proto="tftp" pwd="" remoteFile="ucs-bk1-172.21.60.75-config-system-2009-08-28" status="created" type="config-system" user="" • /> • </pair> • </inConfigs> • </configConfMos> • <configConfMos cookie="1251492362/1177b546-1da1-4f30-8410-6bc6d8c288f7" response="yes"> • <outConfigs> • <pair key="sys/backup-10.98.47.74"> • <mgmtBackupadminState="enabled" childAction="deleteNonPresent" descr="" dn="sys/backup-10.98.47.74" fsmDescr="" fsmPrev="nop" fsmProgr="100" fsmRmtInvErrCode="none" fsmRmtInvErrDescr="" fsmRmtInvRslt="" fsmStageDescr="" fsmStamp="never" fsmStatus="backupBegin" fsmTry="0" hostname="10.98.47.74" intId="157607" job="immediate" name="" postAction="remove" proto="tftp" pwd="" remoteFile="ucs-bk1-172.21.60.75-config-system-2009-08-28" status="created" type="config-system" user="" • /> • </pair> • </outConfigs> • </configConfMos>

  14. curl / xml Config Example – continuedconfigConfMos

  15. XML API Potential Utilize the XML API to Extend UCS Functionality

More Related