<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Batch execute APIs in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Batch-execute-APIs/m-p/119511#M1950</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking for a way to execute a batch of API commands at once, as oposed to sending each one at a time. For example zexplore generates the following code:&lt;/P&gt;&lt;PRE&gt;import java.io.IOException;
import java.net.UnknownHostException;
import java.util.List;

import netapp.manage.NaElement;
import netapp.manage.NaException;
import netapp.manage.NaServer;

public class ApiClient {

	public static void main(String[] args) {
		try {
			NaServer s = new NaServer("&amp;lt;server name or IP address&amp;gt;", 1 , 21);
			s.setServerType(NaServer.SERVER_TYPE_FILER);
			s.setTransportType(NaServer.TRANSPORT_TYPE_HTTPS);
			s.setPort(443);
			s.setStyle(NaServer.STYLE_LOGIN_PASSWORD);
			s.setAdminUser("&amp;lt;user name&amp;gt;", "&amp;lt;password&amp;gt;");


			NaElement api = new NaElement("snapshot-delete");
			api.addNewChild("ignore-owners","&amp;lt;ignore-owners&amp;gt;");
			api.addNewChild("snapshot","&amp;lt;snapshot&amp;gt;");
			api.addNewChild("snapshot-instance-uuid","&amp;lt;snapshot-instance-uuid&amp;gt;");
			api.addNewChild("volume","&amp;lt;volume&amp;gt;");

			NaElement xo = s.invokeElem(api);
			System.out.println(xo.toPrettyString(""));


			NaElement api1 = new NaElement("snapshot-delete");
			api1.addNewChild("ignore-owners","&amp;lt;ignore-owners&amp;gt;");
			api1.addNewChild("snapshot","&amp;lt;snapshot&amp;gt;");
			api1.addNewChild("snapshot-instance-uuid","&amp;lt;snapshot-instance-uuid&amp;gt;");
			api1.addNewChild("volume","&amp;lt;volume&amp;gt;");

			NaElement xo1 = s.invokeElem(api1);
			System.out.println(xo1.toPrettyString(""));


			NaElement api2 = new NaElement("snapshot-delete");
			api2.addNewChild("ignore-owners","&amp;lt;ignore-owners&amp;gt;");
			api2.addNewChild("snapshot","&amp;lt;snapshot&amp;gt;");
			api2.addNewChild("snapshot-instance-uuid","&amp;lt;snapshot-instance-uuid&amp;gt;");
			api2.addNewChild("volume","&amp;lt;volume&amp;gt;");

			NaElement xo2 = s.invokeElem(api2);
			System.out.println(xo2.toPrettyString(""));


			NaElement api3 = new NaElement("snapshot-delete");
			api3.addNewChild("ignore-owners","&amp;lt;ignore-owners&amp;gt;");
			api3.addNewChild("snapshot","&amp;lt;snapshot&amp;gt;");
			api3.addNewChild("snapshot-instance-uuid","&amp;lt;snapshot-instance-uuid&amp;gt;");
			api3.addNewChild("volume","&amp;lt;volume&amp;gt;");

			NaElement xo3 = s.invokeElem(api3);
			System.out.println(xo3.toPrettyString(""));


		} catch (NaException e) {
			handleException(e);
		} catch (UnknownHostException e) {
			handleException(e);
		} catch (IOException e) {
			handleException(e);
		}
	}

	private static void handleException(Exception e) {
		System.out.println(e.getMessage());
		e.printStackTrace();		
	}
}&lt;/PRE&gt;&lt;P&gt;This just reaches out to the filer each time you call an invokeEmem. I would like to minimize the times I have to do this and wait for a response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unless I'm mistaken, you can't set a &amp;gt;x variable&amp;nbsp;in the query fields, otherwise I could use that. So for now I'm getting a result, filtering it on my end and then generating a new NaElement for each volume or snapshot I want to change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of calling a bunch of.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NaElement xo3 = s.invokeElem(api3);&lt;/PRE&gt;&lt;P&gt;I'd like to do something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
... construct NaElements
}

NaBatch x = s.getBatch();
x.addNaElement(api);
x.addNaElement(api);
x.addNaElement(api);
x.addNaElement(api);
s.invokeBatch(x);

&lt;/PRE&gt;&lt;P&gt;Is there some way to do something like this, or is there a way to add this feature?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 04 Jun 2025 20:50:34 GMT</pubDate>
    <dc:creator>jmane1980</dc:creator>
    <dc:date>2025-06-04T20:50:34Z</dc:date>
    <item>
      <title>Batch execute APIs</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Batch-execute-APIs/m-p/119511#M1950</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm looking for a way to execute a batch of API commands at once, as oposed to sending each one at a time. For example zexplore generates the following code:&lt;/P&gt;&lt;PRE&gt;import java.io.IOException;
import java.net.UnknownHostException;
import java.util.List;

import netapp.manage.NaElement;
import netapp.manage.NaException;
import netapp.manage.NaServer;

public class ApiClient {

	public static void main(String[] args) {
		try {
			NaServer s = new NaServer("&amp;lt;server name or IP address&amp;gt;", 1 , 21);
			s.setServerType(NaServer.SERVER_TYPE_FILER);
			s.setTransportType(NaServer.TRANSPORT_TYPE_HTTPS);
			s.setPort(443);
			s.setStyle(NaServer.STYLE_LOGIN_PASSWORD);
			s.setAdminUser("&amp;lt;user name&amp;gt;", "&amp;lt;password&amp;gt;");


			NaElement api = new NaElement("snapshot-delete");
			api.addNewChild("ignore-owners","&amp;lt;ignore-owners&amp;gt;");
			api.addNewChild("snapshot","&amp;lt;snapshot&amp;gt;");
			api.addNewChild("snapshot-instance-uuid","&amp;lt;snapshot-instance-uuid&amp;gt;");
			api.addNewChild("volume","&amp;lt;volume&amp;gt;");

			NaElement xo = s.invokeElem(api);
			System.out.println(xo.toPrettyString(""));


			NaElement api1 = new NaElement("snapshot-delete");
			api1.addNewChild("ignore-owners","&amp;lt;ignore-owners&amp;gt;");
			api1.addNewChild("snapshot","&amp;lt;snapshot&amp;gt;");
			api1.addNewChild("snapshot-instance-uuid","&amp;lt;snapshot-instance-uuid&amp;gt;");
			api1.addNewChild("volume","&amp;lt;volume&amp;gt;");

			NaElement xo1 = s.invokeElem(api1);
			System.out.println(xo1.toPrettyString(""));


			NaElement api2 = new NaElement("snapshot-delete");
			api2.addNewChild("ignore-owners","&amp;lt;ignore-owners&amp;gt;");
			api2.addNewChild("snapshot","&amp;lt;snapshot&amp;gt;");
			api2.addNewChild("snapshot-instance-uuid","&amp;lt;snapshot-instance-uuid&amp;gt;");
			api2.addNewChild("volume","&amp;lt;volume&amp;gt;");

			NaElement xo2 = s.invokeElem(api2);
			System.out.println(xo2.toPrettyString(""));


			NaElement api3 = new NaElement("snapshot-delete");
			api3.addNewChild("ignore-owners","&amp;lt;ignore-owners&amp;gt;");
			api3.addNewChild("snapshot","&amp;lt;snapshot&amp;gt;");
			api3.addNewChild("snapshot-instance-uuid","&amp;lt;snapshot-instance-uuid&amp;gt;");
			api3.addNewChild("volume","&amp;lt;volume&amp;gt;");

			NaElement xo3 = s.invokeElem(api3);
			System.out.println(xo3.toPrettyString(""));


		} catch (NaException e) {
			handleException(e);
		} catch (UnknownHostException e) {
			handleException(e);
		} catch (IOException e) {
			handleException(e);
		}
	}

	private static void handleException(Exception e) {
		System.out.println(e.getMessage());
		e.printStackTrace();		
	}
}&lt;/PRE&gt;&lt;P&gt;This just reaches out to the filer each time you call an invokeEmem. I would like to minimize the times I have to do this and wait for a response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unless I'm mistaken, you can't set a &amp;gt;x variable&amp;nbsp;in the query fields, otherwise I could use that. So for now I'm getting a result, filtering it on my end and then generating a new NaElement for each volume or snapshot I want to change.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Instead of calling a bunch of.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;NaElement xo3 = s.invokeElem(api3);&lt;/PRE&gt;&lt;P&gt;I'd like to do something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;{
... construct NaElements
}

NaBatch x = s.getBatch();
x.addNaElement(api);
x.addNaElement(api);
x.addNaElement(api);
x.addNaElement(api);
s.invokeBatch(x);

&lt;/PRE&gt;&lt;P&gt;Is there some way to do something like this, or is there a way to add this feature?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jun 2025 20:50:34 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Batch-execute-APIs/m-p/119511#M1950</guid>
      <dc:creator>jmane1980</dc:creator>
      <dc:date>2025-06-04T20:50:34Z</dc:date>
    </item>
  </channel>
</rss>

