blob: 08ea6b461aa7194d62a7ac2c7cc0019609e56e94 [file] [log] [blame]
Radek Krejci5350b782012-07-23 16:24:28 +02001How To Setup Apache Server
2--------------------------
Radek Krejci8fd1f5e2012-07-24 17:33:36 +02003- mod_netconf compilation requires apache2-devel and libjson-devel packages.
Radek Krejci5350b782012-07-23 16:24:28 +02004
5- run following commands in this directory
6$ make
7# make install
8
9- Add following lines into the (appropriate parts of the ) Apache configuration:
10LoadModule netconf_module /usr/lib64/apache2/mod_netconf.so
Radek Krejci5350b782012-07-23 16:24:28 +020011
Radek Krejci8fd1f5e2012-07-24 17:33:36 +020012- Start Apache
13
14- For testing, you can run test-client
15 - run under the same user as Apache, or change access rights of the
16 communication socket (/tmp/pconn.sock) to allow writing.
Radek Krejci7bdb6772012-07-26 10:55:14 +020017
18
19mod_netconf Message Format
20--------------------------
21
22UNIX socket (with default path /tmp/mod_netconf.sock) is used for communication
23with mod_netconf daemon. Messages are formated using JSON with the following
24content. Client is free to send multiple requests when the communication socket
25to the mod_netconf daemon is opened.
26
27Replies
28~~~~~~~
291) OK
30key: type (int), value: 0
31
32Optional (for request type 3 - create NETCONF connection):
33key: session (string), value: 40 unique characters of session identifier
34
352) DATA
36key: type (int), value: 1
37key: data (string)
38
393) ERROR
40key: type (int), value: 2
41key: error-message (string)
42
43Optional:
44key: error-tag (string)
45key: error-type (string)
46key: error-severity (string)
Radek Krejcib6aeb482012-07-26 11:04:25 +020047key: error-app-tag (string)
Radek Krejci7bdb6772012-07-26 10:55:14 +020048key: error-path (string)
49key: bad-attribute (string)
50key: bad-element (string)
51key: bad-namespace (string)
52key: session-id (string)
53
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200544) INFO
55key: type (int), value: 3
56key: sid (string), value: session ID
57key: version (string), value: NETCONF protocol version
58key: host (string), value: hostname of the NETCONF server
59key: port (string), value: port of the NETCONF server
60key: user (string), value: username of the user holding the NETCONF session
61key: capabilities (array of strings), value: list of supported capabilities
62
Radek Krejci7bdb6772012-07-26 10:55:14 +020063Requests
64~~~~~~~~
651) Request to create NETCONF session
Radek Krejci9e04c7b2012-07-26 15:54:25 +020066key: type (int), value: 4
Radek Krejci7bdb6772012-07-26 10:55:14 +020067key: user (string)
68key: pass (string), value: plain text password
69
70Optional:
71key: host (string), "localhost" if not specified
72key: port (string), "830" if not specified
73
742) Request to close NETCONF session
Radek Krejci9e04c7b2012-07-26 15:54:25 +020075key: type (int), value: 5
Radek Krejci7bdb6772012-07-26 10:55:14 +020076key: session (string), value: unique session identifier
77
783) NETCONF <get>
Radek Krejci9e04c7b2012-07-26 15:54:25 +020079key: type (int), value: 6
Radek Krejci7bdb6772012-07-26 10:55:14 +020080key: session (string), value: unique session identifier
81
82Optional:
83key: filter (string), value: xml subtree filter
84
854) NETCONF <get-config>
Radek Krejci9e04c7b2012-07-26 15:54:25 +020086key: type (int), value: 7
Radek Krejci7bdb6772012-07-26 10:55:14 +020087key: session (string), value: unique session identifier
88key: source (string), value: running|startup|candidate
89
90Optional:
91key: filter (string), value: xml subtree filter
92
935) NETCONF <edit-config>
Radek Krejci9e04c7b2012-07-26 15:54:25 +020094key: type (int), value: 8
Radek Krejci7bdb6772012-07-26 10:55:14 +020095key: session (string), value: unique session identifier
96key: target (string), value: running|startup|candidate
97key: config (string), value: editing configuration data according to NETCONF RFC
98
99Optional:
100key: default-operation (string), value: merge|replace|none
101key: error-option (string), value: stop-on-error|continue-on-error|rollback-on-error
102
1036) NETCONF <copy-config>
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200104key: type (int), value: 9
Radek Krejci7bdb6772012-07-26 10:55:14 +0200105key: session (string), value: unique session identifier
106key: target (string), value: running|startup|candidate
107
108Alternating:
109key: source (string), value: running|startup|candidate
110key: config (string), value: new complete configuration data, if source not specified
111
1127) NETCONF <delete-config>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200113key: type (int), value: 10
114key: session (string), value: unique session identifier
115key: target (string), value: running|startup|candidate
116
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001178) NETCONF <lock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200118key: type (int), value: 11
119key: session (string), value: unique session identifier
120key: target (string), value: running|startup|candidate
121
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001229) NETCONF <unlock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200123key: type (int), value: 12
124key: session (string), value: unique session identifier
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200125key: target (string), value: running|startup|candidate
126
12710) NETCONF <kill-session>
128key: type (int), value: 13
129key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200130key: session-id (string), value: ID of the session to kill
131
Radek Krejci9e04c7b2012-07-26 15:54:25 +020013211) Provide information about NETCONF session
133key: type (int), value: 14
134key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200135
Radek Krejci80c10d92012-07-30 08:38:50 +020013612) Perform generic operation not included in base NETCONF
137key: type (int), value: 15
138key: session (string), value: unique session identifier
139key: content (string), value: XML data as content of the NETCONF's <rpc> envelope