I'm no using APIRunner but here are a couple of code snippets for you:
Aggregate List (needs to be done at the cluster level)
private NaElement request, response;
NaServer server = new NaServer("cluster_ip");
server.setTransportType(NaServer.TRANSPORT_TYPE_HTTPS);
server.setPort(443);
server.setStyle(NaServer.STYLE_LOGIN_PASSWORD);
server.setAdminUser("username", "password");
request = new NaElement("aggr-get-iter");
response = server.invokeElem(request);
NaElement aggrAttributes = response.getChildByName("attributes-list");
@SuppressWarnings("unchecked")
List<NaElement> aggrList = aggrAttributes.getChildren();
for (NaElement aggr : aggrList) {
String aggrName = aggr.getChildContent("aggregate-name");
}
Volume List (needs to be done at the vserver level)
private NaElement request, response;
NaServer server = new NaServer("vserver_ip");
server.setTransportType(NaServer.TRANSPORT_TYPE_HTTPS);
server.setPort(443);
server.setStyle(NaServer.STYLE_LOGIN_PASSWORD);
server.setAdminUser("username", "password");
ArrayList<String> volumeList = new ArrayList<String>();
request = new NaElement("volume-get-iter");
request.addNewChild("max-records", "4294967295");
NaElement desiredAttributes = new NaElement("desired-attributes");
NaElement volAttributes = new NaElement("volume-attributes");
NaElement volIDAttributes = new NaElement("volume-id-attributes");
NaElement name = new NaElement("name");
volIDAttributes.addChildElem(name);
volAttributes.addChildElem(volIDAttributes);
desiredAttributes.addChildElem(volAttributes);
request.addChildElem(desiredAttributes);
response = server.invokeElem(request);
@SuppressWarnings("unchecked")
List<NaElement> attributes = response.getChildByName("attributes-list").getChildren();
for (NaElement attribute : attributes) {
// because the response is nested within volume-id-attributes, we need to get children again
@SuppressWarnings("unchecked")
List<NaElement> volIDs = attribute.getChildren();
for (NaElement id : volIDs) {
volumeList.add(id.getChildContent("name"));
}
}
I'm splicing those together from other bits of code so no promises it'll just run but it should be close.