From 1bb48b31fd56969b5b40c71d520577ffe82d7bda Mon Sep 17 00:00:00 2001 From: GideonLeGrange Date: Mon, 30 Dec 2013 13:54:29 +0200 Subject: [PATCH] Added add, modify and delete examples --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 94db6e6..baadc3c 100644 --- a/README.md +++ b/README.md @@ -51,11 +51,39 @@ The same query, but we only want certain result fields names Print all interface List> rs = con.execute("/interface/print where type=vlan return name"); ``` +Writing data +------------ + +Creating, modifying and deleting configuration objects is of course possible. + +### Creating an object + +This example shows how to create a new GRE interface: + +```java +con.execute("/interface/gre/add remote-address=192.168.1.1 name=gre1 keepalive=10"); +``` + +### Modify an existing object + +Change the IP address in the object created by the above example: + +```java +con.execute("/interface/gre/set .id=gre1 remote-address=10.0.1.1"); +``` + +### Remove an existing object + +And now remove the object: + +```java +con.execute("/interface/gre/remove .id=gre1"); +``` Asynchronous commands --------------------- -We can run asynchronous commands: +We can run some commands asynchronously in order to continue receiving updates: This example shows how to run '/interface wireless monitor' and have the result sent to a listener object, which prints it