blob: 71b62db6f73c7a31e9dbde0206230d239ee38171 [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
Tomas Cejkab4d05872014-02-14 22:44:38 +0100108key: source (string), value: running|startup|candidate|url
109key: target (string), value: running|startup|candidate|url
110Optional, required when "url" is used:
111key: uri_source (string), required when "source" is "url", value: uri
112key: uri_target (string), required when "target" is "url", value: uri
113
Radek Krejci7bdb6772012-07-26 10:55:14 +0200114
115Alternating:
116key: source (string), value: running|startup|candidate
117key: config (string), value: new complete configuration data, if source not specified
118
1197) NETCONF <delete-config>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200120key: type (int), value: 10
121key: session (string), value: unique session identifier
122key: target (string), value: running|startup|candidate
123
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001248) NETCONF <lock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200125key: type (int), value: 11
126key: session (string), value: unique session identifier
127key: target (string), value: running|startup|candidate
128
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001299) NETCONF <unlock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200130key: type (int), value: 12
131key: session (string), value: unique session identifier
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200132key: target (string), value: running|startup|candidate
133
13410) NETCONF <kill-session>
135key: type (int), value: 13
136key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200137key: session-id (string), value: ID of the session to kill
138
Radek Krejci9e04c7b2012-07-26 15:54:25 +020013911) Provide information about NETCONF session
140key: type (int), value: 14
141key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200142
Radek Krejci80c10d92012-07-30 08:38:50 +020014312) Perform generic operation not included in base NETCONF
144key: type (int), value: 15
145key: session (string), value: unique session identifier
146key: content (string), value: XML data as content of the NETCONF's <rpc> envelope
Tomas Cejka0aeca8b2012-12-22 19:56:03 +0100147
14813) get-schema
149key: type (int), value: 16
150key: session (string), value: unique session identifier
151key: identifier (string), value: identifier of schema
Tomas Cejka814a5c62013-06-24 15:46:39 +0200152
15314) reloadhello Update hello message of NETCONF session
154key: type (int), value: 17
155key: session (string), value: unique session identifier
156
15715) notif_history Provide list of notifications from past.
158key: type (int), value: 18
159key: session (string), value: unique session identifier
160key: from (int64), value: start time in history
161key: to (int64), value: end time
162
Tomas Cejka92457722013-11-14 22:13:40 +010016316) validate Validate datastore or url
164key: type (int), value: 19
165key: session (string), value: unique session identifier
166key: target (string), value: running|startup|candidate|url
167Required when target is "url":
168key: url (string), value: URL of datastore to validate
169