blob: d7e0b207c43bc2d2e9f4ef6f6ac4d7742f74a3a3 [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
Tomas Cejka50c076e2014-03-18 15:31:10 +010016 communication socket (/tmp/mod_netconf.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~~~~~~~~
Tomas Cejka50c076e2014-03-18 15:31:10 +0100671) Request to create NETCONF session (connect)
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
Tomas Cejka50c076e2014-03-18 15:31:10 +0100762) Request to close NETCONF session (disconnect)
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
Tomas Cejka5ae8dfb2014-02-14 23:42:17 +0100106key: test-option (string), value: notset|testset|set|test, default value: testset
Radek Krejci7bdb6772012-07-26 10:55:14 +0200107
1086) NETCONF <copy-config>
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200109key: type (int), value: 9
Radek Krejci7bdb6772012-07-26 10:55:14 +0200110key: session (string), value: unique session identifier
Tomas Cejkab4d05872014-02-14 22:44:38 +0100111key: source (string), value: running|startup|candidate|url
112key: target (string), value: running|startup|candidate|url
113Optional, required when "url" is used:
Tomas Cejkaa70d3032014-02-14 23:20:03 +0100114key: uri-source (string), required when "source" is "url", value: uri
115key: uri-target (string), required when "target" is "url", value: uri
Tomas Cejkab4d05872014-02-14 22:44:38 +0100116
Radek Krejci7bdb6772012-07-26 10:55:14 +0200117
118Alternating:
119key: source (string), value: running|startup|candidate
120key: config (string), value: new complete configuration data, if source not specified
121
1227) NETCONF <delete-config>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200123key: type (int), value: 10
124key: session (string), value: unique session identifier
125key: target (string), value: running|startup|candidate
126
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001278) NETCONF <lock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200128key: type (int), value: 11
129key: session (string), value: unique session identifier
130key: target (string), value: running|startup|candidate
131
Radek Krejci9e04c7b2012-07-26 15:54:25 +02001329) NETCONF <unlock>
Radek Krejci7bdb6772012-07-26 10:55:14 +0200133key: type (int), value: 12
134key: session (string), value: unique session identifier
Radek Krejci9e04c7b2012-07-26 15:54:25 +0200135key: target (string), value: running|startup|candidate
136
13710) NETCONF <kill-session>
138key: type (int), value: 13
139key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200140key: session-id (string), value: ID of the session to kill
141
Radek Krejci9e04c7b2012-07-26 15:54:25 +020014211) Provide information about NETCONF session
143key: type (int), value: 14
144key: session (string), value: unique session identifier
Radek Krejci7bdb6772012-07-26 10:55:14 +0200145
Radek Krejci80c10d92012-07-30 08:38:50 +020014612) Perform generic operation not included in base NETCONF
147key: type (int), value: 15
148key: session (string), value: unique session identifier
149key: content (string), value: XML data as content of the NETCONF's <rpc> envelope
Tomas Cejka0aeca8b2012-12-22 19:56:03 +0100150
15113) get-schema
152key: type (int), value: 16
153key: session (string), value: unique session identifier
154key: identifier (string), value: identifier of schema
Tomas Cejka814a5c62013-06-24 15:46:39 +0200155
15614) reloadhello Update hello message of NETCONF session
157key: type (int), value: 17
158key: session (string), value: unique session identifier
159
16015) notif_history Provide list of notifications from past.
161key: type (int), value: 18
162key: session (string), value: unique session identifier
163key: from (int64), value: start time in history
164key: to (int64), value: end time
165
Tomas Cejka92457722013-11-14 22:13:40 +010016616) validate Validate datastore or url
167key: type (int), value: 19
168key: session (string), value: unique session identifier
169key: target (string), value: running|startup|candidate|url
170Required when target is "url":
171key: url (string), value: URL of datastore to validate
172