Skip to content

Instantly share code, notes, and snippets.

View lundvall's full-sized avatar

Martin Lundvall lundvall

View GitHub Profile
ManagedObjectReference currentSnapshot;
public void printCurrentSnapshotName() {
VirtualMachineSnapshotInfo snapshotInfo = vm.getSnapshot();
if (snapshotInfo != null) {
currentSnapshot = snapshotInfo.currentSnapshot;
walkSnapshotTree(snapshotInfo.rootSnapshotList);
}
}
@lundvall
lundvall / UCS.groovy
Created November 15, 2011 12:31
Example usage of Groovy HTTPBuilder with Cisco UCS API
import groovyx.net.http.RESTClient
import static groovyx.net.http.ContentType.XML
def login(ip, username, password) {
String cookie = ""
def ucs = new RESTClient("http://${ip}/nuova")
def response = ucs.post(
contentType: XML,
requestContentType: XML,
body: {