Ī disclaimer: I am very well aware, Postman experts reading this with arms folded and skeptical furrowed brow, that Postman does far more than what I am about to describe here. So if you don’t have Postman, go ahead and install it. You should have it as part of your standard Toolbox, along with an IDE Editor, Git, and nmap, among others. Let’s use it to see if an HPE Gen 10 Server is set to OptimalCooling through its iLO REST API. There are many tools for connecting to a REST API. The good news is that in most cases, I have found that the REST API documentation should have all of the information you need. Sometimes, the REST API in question will require these so that the output is formatted properly. One common header that I have found is Content-Type. You’ll have to read the documentation to find this information. An additional very common method is OAuth Token Based Authorization, but that goes beyond this post. The iLO supports Basic Auth, so that’s what we will use. In this case we want to use GET because we are simply reporting the output, not changing anything. The method: GET, POST, PUT, and so on.You need 4 things to connect to a REST API: Sifting through the documentation linked above, it looks like we want to perform a GET on /rest/v1/Systems/1/BIOS. Your knowledge of web servers will come in handy here, because, in my humble opinion, it’s all about hierarchical “subdirectories”. Like at all.įirst things first: Read the REST API documentation for what you are accessing. Without REST, as far as I know, we’d have to schedule a maintenance window and reboot the server. With REST, we can easily verify the Thermal settings without having to reboot the server. All you need to know is that it has to do with fan noise. REST API Documentation and BasicsĪt my work, we change the Thermal Configuration of some of our servers to “ Optimal Cooling” for reasons too numerous to go into here. Need a list of attributes or settings that need to be applied to a server? Pull them through a GET and then alter the settings, then POST the new settings onto the machine, or multiple machines in an automated way. One additional advantage is that input and output to and from REST is usually in the form of JSON. These are only some examples I have used REST APIs and Postman quite heavily for anything from performing actions on servers, to getting me out of bind, to just straight getting people information in a way they can actually use.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |