blob: 0033fb479e57377b9d8f236f7a79995f13d54071 [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
23with mod_netconf daemon. Messages are formated using JSON with the following
24content. Client is free to send multiple requests when the communication socket
25to the mod_netconf daemon is opened.
26
27Replies
28~~~~~~~
291) OK
30key: type (int), value: 0
31
32Optional (for request type 3 - create NETCONF connection):
33key: session (string), value: 40 unique characters of session identifier
34
352) DATA
36key: type (int), value: 1
37key: data (string)
38
393) ERROR
40key: type (int), value: 2
41key: error-message (string)
42
43Optional:
44key: error-tag (string)
45key: error-type (string)
46key: error-severity (string)
Radek Krejcib6aeb482012-07-26 11:04:25 +020047key: error-app-tag (string)
Radek Krejci7bdb6772012-07-26 10:55:14 +020048key: error-path (string)
49key: bad-attribute (string)
50key: bad-element (string)
51key: bad-namespace (string)
52key: session-id (string)
53
54Requests
55~~~~~~~~
561) Request to create NETCONF session
57key: type (int), value: 3
58key: user (string)
59key: pass (string), value: plain text password
60
61Optional:
62key: host (string), "localhost" if not specified
63key: port (string), "830" if not specified
64
652) Request to close NETCONF session
66key: type (int), value: 4
67key: session (string), value: unique session identifier
68
693) NETCONF <get>
70key: type (int), value: 5
71key: session (string), value: unique session identifier
72
73Optional:
74key: filter (string), value: xml subtree filter
75
764) NETCONF <get-config>
77key: type (int), value: 6
78key: session (string), value: unique session identifier
79key: source (string), value: running|startup|candidate
80
81Optional:
82key: filter (string), value: xml subtree filter
83
845) NETCONF <edit-config>
85key: type (int), value: 7
86key: session (string), value: unique session identifier
87key: target (string), value: running|startup|candidate
88key: config (string), value: editing configuration data according to NETCONF RFC
89
90Optional:
91key: default-operation (string), value: merge|replace|none
92key: error-option (string), value: stop-on-error|continue-on-error|rollback-on-error
93
946) NETCONF <copy-config>
95key: type (int), value: 8
96key: session (string), value: unique session identifier
97key: target (string), value: running|startup|candidate
98
99Alternating:
100key: source (string), value: running|startup|candidate
101key: config (string), value: new complete configuration data, if source not specified
102
1037) NETCONF <delete-config>
104key: type (int), value: 9
105key: session (string), value: unique session identifier
106key: target (string), value: running|startup|candidate
107
1088) NETCONF <lock>
109key: type (int), value: 10
110key: session (string), value: unique session identifier
111key: target (string), value: running|startup|candidate
112
1139) NETCONF <unlock>
114key: type (int), value: 11
115key: session (string), value: unique session identifier
116key: target (string), value: running|startup|candidate
117
11810) NETCONF <kill-session>
119key: type (int), value: 12
120key: session (string), value: unique session identifier
121key: session-id (string), value: ID of the session to kill
122
123