blob: 88fb080889f2e4a906c316aeb3081e23cc990b14 [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:
102key: default-operation (string), value: merge|replace|none
103key: error-option (string), value: stop-on-error|continue-on-error|rollback-on-error
104
1056) NETCONF <copy-config>
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200106key: type (int), value: 9
Radek Krejci7bdb6772012-07-26 10:55:14 +0200107key: session (string), value: unique session identifier
108key: target (string), value: running|startup|candidate
109
110Alternating:
111key: source (string), value: running|startup|candidate
112key: config (string), value: new complete configuration data, if source not specified
113
1147) NETCONF <delete-config>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200115key: type (int), value: 10
116key: session (string), value: unique session identifier
117key: target (string), value: running|startup|candidate
118
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001198) NETCONF <lock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200120key: type (int), value: 11
121key: session (string), value: unique session identifier
122key: target (string), value: running|startup|candidate
123
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001249) NETCONF <unlock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200125key: type (int), value: 12
126key: session (string), value: unique session identifier
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200127key: target (string), value: running|startup|candidate
128
12910) NETCONF <kill-session>
130key: type (int), value: 13
131key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200132key: session-id (string), value: ID of the session to kill
133
Radek Krejci9e04c7b2012-07-26 15:54:25 +020013411) Provide information about NETCONF session
135key: type (int), value: 14
136key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200137
Radek Krejci80c10d92012-07-30 08:38:50 +020013812) Perform generic operation not included in base NETCONF
139key: type (int), value: 15
140key: session (string), value: unique session identifier
141key: content (string), value: XML data as content of the NETCONF's <rpc> envelope
Tomas Cejka0aeca8b2012-12-22 19:56:03 +0100142
14313) get-schema
144key: type (int), value: 16
145key: session (string), value: unique session identifier
146key: identifier (string), value: identifier of schema
Tomas Cejka814a5c62013-06-24 15:46:39 +0200147
14814) reloadhello Update hello message of NETCONF session
149key: type (int), value: 17
150key: session (string), value: unique session identifier
151
15215) notif_history Provide list of notifications from past.
153key: type (int), value: 18
154key: session (string), value: unique session identifier
155key: from (int64), value: start time in history
156key: to (int64), value: end time
157
Tomas Cejka92457722013-11-14 22:13:40 +010015816) validate Validate datastore or url
159key: type (int), value: 19
160key: session (string), value: unique session identifier
161key: target (string), value: running|startup|candidate|url
162Required when target is "url":
163key: url (string), value: URL of datastore to validate
164