This API was created for automated generation of UCS Rack Layout pictures.
It can be used to incorporate UCS Layout images into other tools.
And it overcomes the issue of the regular UCS Layout tool not having the capability to save configurations for later reuse.
To start you have to create an XML file describing your configuration. The configuration must be valid and "making sense".
The API doesn't allow for "impossible" configurations or corner cases.
As the interactive UCS Layout, this API tool runs in either automatic or manual mode.
Here an example of the XML file for automatic mode configurations.
<?xml version="1.0" encoding="UTF-8"?> <layout mode="AUTO" src="API"> <fabint model="FI6248" qty="2"> <expmod model="E16UP" qty="0" /> <power qty="2" /> </fabint> <chassis model="UCS5108" cfg="1" qty="3"> <blade model="B200" qty="2" /> <blade model="B250" qty="3" /> <iomod model="IOM2208" qty="2" /> <power qty="4" /> </chassis> <fabext model="NX2232" qty="2" /> <rackmount> <server model="C240" qty="6" /> <server model="C460" qty="2" /> </rackmount> <params extra="0" face="FRONT" fill="LINEAR" size="MEDIUM" trans="NO"/> </layout> You can download api-auto.xml, which is the full version that tells you the do's and don'ts.
Total number of racks can't be higher than nine, although the tool doesn't check for that.
As said above, this API expect the user to provide "sensible" configurations.
<?xml version="1.0" encoding="UTF-8"?> <layout mode="MANUAL" src="API"> <chassis model="UCS5108" cfg="1" qty="1"> <blade model="B260" qty="2" /> <blade model="B460" qty="1" /> <iomod model="IOM2204" qty="2" /> <power qty="4" /> </chassis> <rack cfg="1" qty="1"> <device model="NX5548" qty="2" /> <device model="FI6296" qty="2" /> <device model="UCS-CH1" qty="6" /> </rack> <rack cfg="2" qty="3"> <device model="SPACE1" qty="4" /> <device model="NX2232" qty="2" /> <device model="C221" qty="6" /> <device model="C240" qty="6" /> <device model="C464" qty="4" /> </rack> <params extra="0" face="FRONT" load="HIGH" panels="YES" size="SMALL" /> </layout> You can download api-manual.xml for the more complete version. In file api-devices.txt you can see the list of allowed device names. To get started quickly you can also go into the rack layout tool, create a configuration using the GUI and then click the "Export" button. Use copy/paste to save the XML code into a file and use a text editor to modify the config to your liking. This is also the easiest way to create configs with odd quantities like 5, 11 or 20. When doing things this way it is best to clear the 4-digit number from the "seq" parameter in the second line of the XML.
There are a number of options for the client-side of things. This could be the beginning of adding UCS-Layout functionality – using the Rest API – to your own application.
In case you want to create a wiring diagram instead of a rack layout, the only thing you need to do is to modify the script you use from accessing "http://ucs4.us/ucs/engine/ucs-wiring.cgi" instead of "ucs-engine.cgi". Have fun with it. Happy hacking . . . .
auto & manual mode XML files
|