Update README.md

This commit is contained in:
Gideon le Grange 2013-07-12 09:35:03 +02:00
parent 473f303add
commit 8776d15405
1 changed files with 2 additions and 4 deletions

View File

@ -24,21 +24,19 @@ A simple example that returns a result: Print all interfaces.
```java ```java
ApiConnection con = ApiConnection.connect("10.0.1.1");
con.login("admin","password");
List<Result> rs = con.execute("/interface/print"); List<Result> rs = con.execute("/interface/print");
for (Result r : rs) { for (Result r : rs) {
System.out.println(r); System.out.println(r);
} }
``` ```
The same query, but with the results filtered: Print all interfaces of type 'vlan' The same query, but with the results filtered: Print all interfaces of type 'vlan'.
```java ```java
List<Result> rs = con.execute("/interface/print where type=vlan"); List<Result> rs = con.execute("/interface/print where type=vlan");
``` ```
The same query, but we only want certain result fields names Print all interfaces of type 'vlan' and return their name The same query, but we only want certain result fields names Print all interfaces of type 'vlan' and return their name.
```java ```java
List<Result> rs = con.execute("/interface/print where type=vlan return name"); List<Result> rs = con.execute("/interface/print where type=vlan return name");