-
Notifications
You must be signed in to change notification settings - Fork 65
Expand file tree
/
Copy pathShowChassis.java
More file actions
34 lines (28 loc) · 914 Bytes
/
Copy pathShowChassis.java
File metadata and controls
34 lines (28 loc) · 914 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
/*
* Copyright (c) 2013 Juniper Networks, Inc.
* All Rights Reserved
*
* Use is subject to license terms.
*
*/
import net.juniper.netconf.Device;
import net.juniper.netconf.XML;
import org.xml.sax.SAXException;
import java.io.IOException;
public class ShowChassis {
public static void main(String[] args) throws
SAXException, IOException {
Device device = CreateDevice.createDevice();
device.connect();
//Send RPC and receive RPC Reply as XML
XML rpc_reply = device.executeRPC("get-chassis-inventory");
/* OR
* device.executeRPC("<get-chassis-inventory/>");
* OR
* device.executeRPC("<rpc><get-chassis-inventory/></rpc>");
*/
//Print the RPC-Reply and close the device.
System.out.println(rpc_reply.toString());
device.close();
}
}