blob: c7f5c8d29084a231509ed3babc7bbb1107789e1c [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
David Kupka1e3e4c82012-09-04 09:32:15 +020023with mod_netconf daemon. Messages are formated using JSON and encoded using
24Chunked Framing Mechanism described in RFC6242 (http://tools.ietf.org/html/rfc6242#section-4.2)
25with the following content.
26Client is free to send multiple requests when the communication socket
Radek Krejci7bdb6772012-07-26 10:55:14 +020027to the mod_netconf daemon is opened.
28
29Replies
30~~~~~~~
311) OK
32key: type (int), value: 0
33
34Optional (for request type 3 - create NETCONF connection):
35key: session (string), value: 40 unique characters of session identifier
36
372) DATA
38key: type (int), value: 1
39key: data (string)
40
413) ERROR
42key: type (int), value: 2
43key: error-message (string)
44
45Optional:
46key: error-tag (string)
47key: error-type (string)
48key: error-severity (string)
Radek Krejcib6aeb482012-07-26 11:04:25 +020049key: error-app-tag (string)
Radek Krejci7bdb6772012-07-26 10:55:14 +020050key: error-path (string)
51key: bad-attribute (string)
52key: bad-element (string)
53key: bad-namespace (string)
54key: session-id (string)
55
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200564) INFO
57key: type (int), value: 3
58key: sid (string), value: session ID
59key: version (string), value: NETCONF protocol version
60key: host (string), value: hostname of the NETCONF server
61key: port (string), value: port of the NETCONF server
62key: user (string), value: username of the user holding the NETCONF session
63key: capabilities (array of strings), value: list of supported capabilities
64
Radek Krejci7bdb6772012-07-26 10:55:14 +020065Requests
66~~~~~~~~
671) Request to create NETCONF session
Radek Krejci9e04c7b2012-07-26 15:54:25 +020068key: type (int), value: 4
Radek Krejci7bdb6772012-07-26 10:55:14 +020069key: user (string)
70key: pass (string), value: plain text password
71
72Optional:
73key: host (string), "localhost" if not specified
74key: port (string), "830" if not specified
75
762) Request to close NETCONF session
Radek Krejci9e04c7b2012-07-26 15:54:25 +020077key: type (int), value: 5
Radek Krejci7bdb6772012-07-26 10:55:14 +020078key: session (string), value: unique session identifier
79
803) NETCONF <get>
Radek Krejci9e04c7b2012-07-26 15:54:25 +020081key: type (int), value: 6
Radek Krejci7bdb6772012-07-26 10:55:14 +020082key: session (string), value: unique session identifier
83
84Optional:
85key: filter (string), value: xml subtree filter
86
874) NETCONF <get-config>
Radek Krejci9e04c7b2012-07-26 15:54:25 +020088key: type (int), value: 7
Radek Krejci7bdb6772012-07-26 10:55:14 +020089key: session (string), value: unique session identifier
90key: source (string), value: running|startup|candidate
91
92Optional:
93key: filter (string), value: xml subtree filter
94
955) NETCONF <edit-config>
Radek Krejci9e04c7b2012-07-26 15:54:25 +020096key: type (int), value: 8
Radek Krejci7bdb6772012-07-26 10:55:14 +020097key: session (string), value: unique session identifier
98key: target (string), value: running|startup|candidate
99key: config (string), value: editing configuration data according to NETCONF RFC
100
101Optional:
Tomas Cejka8f3031e2014-02-14 23:15:08 +0100102key: source (string), value: config|url, default value: config
Radek Krejci7bdb6772012-07-26 10:55:14 +0200103key: default-operation (string), value: merge|replace|none
104key: error-option (string), value: stop-on-error|continue-on-error|rollback-on-error
Tomas Cejka8f3031e2014-02-14 23:15:08 +0100105key: uri-source (string), required when "source" is "url", value: uri
Radek Krejci7bdb6772012-07-26 10:55:14 +0200106
1076) NETCONF <copy-config>
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200108key: type (int), value: 9
Radek Krejci7bdb6772012-07-26 10:55:14 +0200109key: session (string), value: unique session identifier
Tomas Cejkab4d05872014-02-14 22:44:38 +0100110key: source (string), value: running|startup|candidate|url
111key: target (string), value: running|startup|candidate|url
112Optional, required when "url" is used:
Tomas Cejkaa70d3032014-02-14 23:20:03 +0100113key: uri-source (string), required when "source" is "url", value: uri
114key: uri-target (string), required when "target" is "url", value: uri
Tomas Cejkab4d05872014-02-14 22:44:38 +0100115
Radek Krejci7bdb6772012-07-26 10:55:14 +0200116
117Alternating:
118key: source (string), value: running|startup|candidate
119key: config (string), value: new complete configuration data, if source not specified
120
1217) NETCONF <delete-config>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200122key: type (int), value: 10
123key: session (string), value: unique session identifier
124key: target (string), value: running|startup|candidate
125
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001268) NETCONF <lock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200127key: type (int), value: 11
128key: session (string), value: unique session identifier
129key: target (string), value: running|startup|candidate
130
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001319) NETCONF <unlock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200132key: type (int), value: 12
133key: session (string), value: unique session identifier
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200134key: target (string), value: running|startup|candidate
135
13610) NETCONF <kill-session>
137key: type (int), value: 13
138key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200139key: session-id (string), value: ID of the session to kill
140
Radek Krejci9e04c7b2012-07-26 15:54:25 +020014111) Provide information about NETCONF session
142key: type (int), value: 14
143key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200144
Radek Krejci80c10d92012-07-30 08:38:50 +020014512) Perform generic operation not included in base NETCONF
146key: type (int), value: 15
147key: session (string), value: unique session identifier
148key: content (string), value: XML data as content of the NETCONF's <rpc> envelope
Tomas Cejka0aeca8b2012-12-22 19:56:03 +0100149
15013) get-schema
151key: type (int), value: 16
152key: session (string), value: unique session identifier
153key: identifier (string), value: identifier of schema
Tomas Cejka814a5c62013-06-24 15:46:39 +0200154
15514) reloadhello Update hello message of NETCONF session
156key: type (int), value: 17
157key: session (string), value: unique session identifier
158
15915) notif_history Provide list of notifications from past.
160key: type (int), value: 18
161key: session (string), value: unique session identifier
162key: from (int64), value: start time in history
163key: to (int64), value: end time
164
Tomas Cejka92457722013-11-14 22:13:40 +010016516) validate Validate datastore or url
166key: type (int), value: 19
167key: session (string), value: unique session identifier
168key: target (string), value: running|startup|candidate|url
169Required when target is "url":
170key: url (string), value: URL of datastore to validate
171