All Downloads are FREE. Search and download functionalities are using the official Maven repository.

examples.SimpleCommandWithResults Maven / Gradle / Ivy

There is a newer version: 3.0.8
Show newest version
package examples;

import java.util.List;
import java.util.Map;
import me.legrange.mikrotik.MikrotikApiException;

/**
 * Example 2: A command that returns results. Print all interfaces
 *
 * @author gideon
 */
public class SimpleCommandWithResults extends Example {

    public static void main(String... args) throws Exception {
        SimpleCommandWithResults ex = new SimpleCommandWithResults();
        ex.connect();
        ex.test();
        ex.disconnect();
    }

    private void test() throws MikrotikApiException {
        List> results =  con.execute("/interface/print");
        for (Map result : results) {
            System.out.println(result);
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy