blob: 7e3c45ae10c3282e357a37b9d0c27d73af24d7f6 [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
Tomas Cejka457cb7e2015-04-29 12:45:22 +02009- Apache module should be installed by now, the following line is added into
10server's configuration:
Radek Krejci5350b782012-07-23 16:24:28 +020011LoadModule netconf_module /usr/lib64/apache2/mod_netconf.so
Radek Krejci5350b782012-07-23 16:24:28 +020012
Radek Krejci8fd1f5e2012-07-24 17:33:36 +020013- Start Apache
14
Tomas Cejka457cb7e2015-04-29 12:45:22 +020015- mod_netconf runs as the same user as Apache. It listens on the UNIX socket
16(/var/run/mod_netconf.sock) for communication with frontend and on TCP socket 8080
17for notifications over WebSocket.
Radek Krejci7bdb6772012-07-26 10:55:14 +020018
Tomas Cejka457cb7e2015-04-29 12:45:22 +020019If there is any problem with connection to the UNIX socket, please check file permissions.
20
21Alternatively, there is a possibility to run binary 'webgui-backend'. It is a standalone
22program independent on Apache. However, it still uses libapr1 etc.
23
24List of dependencies
25--------------------
26
27* json-c
28* libapr-1
29* libapr-util-1
30* libnetconf
31* libxml-2.0
32* httpd
33
34(with development packages)
35
36Optionally: libwebsockets
37
38
Radek Krejci7bdb6772012-07-26 10:55:14 +020039mod_netconf Message Format
40--------------------------
41
42UNIX socket (with default path /tmp/mod_netconf.sock) is used for communication
David Kupka1e3e4c82012-09-04 09:32:15 +020043with mod_netconf daemon. Messages are formated using JSON and encoded using
44Chunked Framing Mechanism described in RFC6242 (http://tools.ietf.org/html/rfc6242#section-4.2)
45with the following content.
46Client is free to send multiple requests when the communication socket
Radek Krejci7bdb6772012-07-26 10:55:14 +020047to the mod_netconf daemon is opened.
48
49Replies
50~~~~~~~
511) OK
52key: type (int), value: 0
53
54Optional (for request type 3 - create NETCONF connection):
55key: session (string), value: 40 unique characters of session identifier
56
572) DATA
58key: type (int), value: 1
59key: data (string)
60
613) ERROR
62key: type (int), value: 2
63key: error-message (string)
64
65Optional:
66key: error-tag (string)
67key: error-type (string)
68key: error-severity (string)
Radek Krejcib6aeb482012-07-26 11:04:25 +020069key: error-app-tag (string)
Radek Krejci7bdb6772012-07-26 10:55:14 +020070key: error-path (string)
71key: bad-attribute (string)
72key: bad-element (string)
73key: bad-namespace (string)
74key: session-id (string)
75
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200764) INFO
77key: type (int), value: 3
78key: sid (string), value: session ID
79key: version (string), value: NETCONF protocol version
80key: host (string), value: hostname of the NETCONF server
81key: port (string), value: port of the NETCONF server
82key: user (string), value: username of the user holding the NETCONF session
83key: capabilities (array of strings), value: list of supported capabilities
84
Radek Krejci7bdb6772012-07-26 10:55:14 +020085Requests
86~~~~~~~~
Tomas Cejka50c076e2014-03-18 15:31:10 +0100871) Request to create NETCONF session (connect)
Radek Krejci9e04c7b2012-07-26 15:54:25 +020088key: type (int), value: 4
Radek Krejci7bdb6772012-07-26 10:55:14 +020089key: user (string)
90key: pass (string), value: plain text password
91
92Optional:
93key: host (string), "localhost" if not specified
94key: port (string), "830" if not specified
95
Tomas Cejka50c076e2014-03-18 15:31:10 +0100962) Request to close NETCONF session (disconnect)
Radek Krejci9e04c7b2012-07-26 15:54:25 +020097key: type (int), value: 5
Radek Krejci7bdb6772012-07-26 10:55:14 +020098key: session (string), value: unique session identifier
99
1003) NETCONF <get>
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200101key: type (int), value: 6
Radek Krejci7bdb6772012-07-26 10:55:14 +0200102key: session (string), value: unique session identifier
103
104Optional:
105key: filter (string), value: xml subtree filter
106
1074) NETCONF <get-config>
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200108key: type (int), value: 7
Radek Krejci7bdb6772012-07-26 10:55:14 +0200109key: session (string), value: unique session identifier
110key: source (string), value: running|startup|candidate
111
112Optional:
113key: filter (string), value: xml subtree filter
114
1155) NETCONF <edit-config>
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200116key: type (int), value: 8
Radek Krejci7bdb6772012-07-26 10:55:14 +0200117key: session (string), value: unique session identifier
118key: target (string), value: running|startup|candidate
119key: config (string), value: editing configuration data according to NETCONF RFC
120
121Optional:
Tomas Cejka8f3031e2014-02-14 23:15:08 +0100122key: source (string), value: config|url, default value: config
Radek Krejci7bdb6772012-07-26 10:55:14 +0200123key: default-operation (string), value: merge|replace|none
124key: error-option (string), value: stop-on-error|continue-on-error|rollback-on-error
Tomas Cejka8f3031e2014-02-14 23:15:08 +0100125key: uri-source (string), required when "source" is "url", value: uri
Tomas Cejka5ae8dfb2014-02-14 23:42:17 +0100126key: test-option (string), value: notset|testset|set|test, default value: testset
Radek Krejci7bdb6772012-07-26 10:55:14 +0200127
1286) NETCONF <copy-config>
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200129key: type (int), value: 9
Radek Krejci7bdb6772012-07-26 10:55:14 +0200130key: session (string), value: unique session identifier
Tomas Cejkab4d05872014-02-14 22:44:38 +0100131key: source (string), value: running|startup|candidate|url
132key: target (string), value: running|startup|candidate|url
133Optional, required when "url" is used:
Tomas Cejkaa70d3032014-02-14 23:20:03 +0100134key: uri-source (string), required when "source" is "url", value: uri
135key: uri-target (string), required when "target" is "url", value: uri
Tomas Cejkab4d05872014-02-14 22:44:38 +0100136
Radek Krejci7bdb6772012-07-26 10:55:14 +0200137
138Alternating:
139key: source (string), value: running|startup|candidate
140key: config (string), value: new complete configuration data, if source not specified
141
1427) NETCONF <delete-config>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200143key: type (int), value: 10
144key: session (string), value: unique session identifier
145key: target (string), value: running|startup|candidate
146
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001478) NETCONF <lock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200148key: type (int), value: 11
149key: session (string), value: unique session identifier
150key: target (string), value: running|startup|candidate
151
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001529) NETCONF <unlock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200153key: type (int), value: 12
154key: session (string), value: unique session identifier
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200155key: target (string), value: running|startup|candidate
156
15710) NETCONF <kill-session>
158key: type (int), value: 13
159key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200160key: session-id (string), value: ID of the session to kill
161
Radek Krejci9e04c7b2012-07-26 15:54:25 +020016211) Provide information about NETCONF session
163key: type (int), value: 14
164key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200165
Radek Krejci80c10d92012-07-30 08:38:50 +020016612) Perform generic operation not included in base NETCONF
167key: type (int), value: 15
168key: session (string), value: unique session identifier
169key: content (string), value: XML data as content of the NETCONF's <rpc> envelope
Tomas Cejka0aeca8b2012-12-22 19:56:03 +0100170
17113) get-schema
172key: type (int), value: 16
173key: session (string), value: unique session identifier
174key: identifier (string), value: identifier of schema
Tomas Cejka814a5c62013-06-24 15:46:39 +0200175
17614) reloadhello Update hello message of NETCONF session
177key: type (int), value: 17
178key: session (string), value: unique session identifier
179
18015) notif_history Provide list of notifications from past.
181key: type (int), value: 18
182key: session (string), value: unique session identifier
183key: from (int64), value: start time in history
184key: to (int64), value: end time
185
Tomas Cejka92457722013-11-14 22:13:40 +010018616) validate Validate datastore or url
187key: type (int), value: 19
188key: session (string), value: unique session identifier
189key: target (string), value: running|startup|candidate|url
190Required when target is "url":
191key: url (string), value: URL of datastore to validate
192