Radek Krejci | 5350b78 | 2012-07-23 16:24:28 +0200 | [diff] [blame] | 1 | How To Setup Apache Server |
| 2 | -------------------------- |
Radek Krejci | 8fd1f5e | 2012-07-24 17:33:36 +0200 | [diff] [blame] | 3 | - mod_netconf compilation requires apache2-devel and libjson-devel packages. |
Radek Krejci | 5350b78 | 2012-07-23 16:24:28 +0200 | [diff] [blame] | 4 | |
| 5 | - run following commands in this directory |
| 6 | $ make |
| 7 | # make install |
| 8 | |
Tomas Cejka | 457cb7e | 2015-04-29 12:45:22 +0200 | [diff] [blame] | 9 | - Apache module should be installed by now, the following line is added into |
| 10 | server's configuration: |
Radek Krejci | 5350b78 | 2012-07-23 16:24:28 +0200 | [diff] [blame] | 11 | LoadModule netconf_module /usr/lib64/apache2/mod_netconf.so |
Radek Krejci | 5350b78 | 2012-07-23 16:24:28 +0200 | [diff] [blame] | 12 | |
Radek Krejci | 8fd1f5e | 2012-07-24 17:33:36 +0200 | [diff] [blame] | 13 | - Start Apache |
| 14 | |
Tomas Cejka | 457cb7e | 2015-04-29 12:45:22 +0200 | [diff] [blame] | 15 | - 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 |
| 17 | for notifications over WebSocket. |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 18 | |
Tomas Cejka | 457cb7e | 2015-04-29 12:45:22 +0200 | [diff] [blame] | 19 | If there is any problem with connection to the UNIX socket, please check file permissions. |
| 20 | |
| 21 | Alternatively, there is a possibility to run binary 'webgui-backend'. It is a standalone |
| 22 | program independent on Apache. However, it still uses libapr1 etc. |
| 23 | |
| 24 | List 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 | |
| 36 | Optionally: libwebsockets |
| 37 | |
| 38 | |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 39 | mod_netconf Message Format |
| 40 | -------------------------- |
| 41 | |
| 42 | UNIX socket (with default path /tmp/mod_netconf.sock) is used for communication |
David Kupka | 1e3e4c8 | 2012-09-04 09:32:15 +0200 | [diff] [blame] | 43 | with mod_netconf daemon. Messages are formated using JSON and encoded using |
| 44 | Chunked Framing Mechanism described in RFC6242 (http://tools.ietf.org/html/rfc6242#section-4.2) |
| 45 | with the following content. |
| 46 | Client is free to send multiple requests when the communication socket |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 47 | to the mod_netconf daemon is opened. |
| 48 | |
| 49 | Replies |
| 50 | ~~~~~~~ |
| 51 | 1) OK |
| 52 | key: type (int), value: 0 |
| 53 | |
| 54 | Optional (for request type 3 - create NETCONF connection): |
| 55 | key: session (string), value: 40 unique characters of session identifier |
| 56 | |
| 57 | 2) DATA |
| 58 | key: type (int), value: 1 |
| 59 | key: data (string) |
| 60 | |
| 61 | 3) ERROR |
| 62 | key: type (int), value: 2 |
| 63 | key: error-message (string) |
| 64 | |
| 65 | Optional: |
| 66 | key: error-tag (string) |
| 67 | key: error-type (string) |
| 68 | key: error-severity (string) |
Radek Krejci | b6aeb48 | 2012-07-26 11:04:25 +0200 | [diff] [blame] | 69 | key: error-app-tag (string) |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 70 | key: error-path (string) |
| 71 | key: bad-attribute (string) |
| 72 | key: bad-element (string) |
| 73 | key: bad-namespace (string) |
| 74 | key: session-id (string) |
| 75 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 76 | 4) INFO |
| 77 | key: type (int), value: 3 |
| 78 | key: sid (string), value: session ID |
| 79 | key: version (string), value: NETCONF protocol version |
| 80 | key: host (string), value: hostname of the NETCONF server |
| 81 | key: port (string), value: port of the NETCONF server |
| 82 | key: user (string), value: username of the user holding the NETCONF session |
| 83 | key: capabilities (array of strings), value: list of supported capabilities |
| 84 | |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 85 | Requests |
| 86 | ~~~~~~~~ |
Tomas Cejka | 50c076e | 2014-03-18 15:31:10 +0100 | [diff] [blame] | 87 | 1) Request to create NETCONF session (connect) |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 88 | key: type (int), value: 4 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 89 | key: user (string) |
| 90 | key: pass (string), value: plain text password |
| 91 | |
| 92 | Optional: |
| 93 | key: host (string), "localhost" if not specified |
| 94 | key: port (string), "830" if not specified |
| 95 | |
Tomas Cejka | 50c076e | 2014-03-18 15:31:10 +0100 | [diff] [blame] | 96 | 2) Request to close NETCONF session (disconnect) |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 97 | key: type (int), value: 5 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 98 | key: session (string), value: unique session identifier |
| 99 | |
| 100 | 3) NETCONF <get> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 101 | key: type (int), value: 6 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 102 | key: session (string), value: unique session identifier |
| 103 | |
| 104 | Optional: |
| 105 | key: filter (string), value: xml subtree filter |
| 106 | |
| 107 | 4) NETCONF <get-config> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 108 | key: type (int), value: 7 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 109 | key: session (string), value: unique session identifier |
| 110 | key: source (string), value: running|startup|candidate |
| 111 | |
| 112 | Optional: |
| 113 | key: filter (string), value: xml subtree filter |
| 114 | |
| 115 | 5) NETCONF <edit-config> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 116 | key: type (int), value: 8 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 117 | key: session (string), value: unique session identifier |
| 118 | key: target (string), value: running|startup|candidate |
| 119 | key: config (string), value: editing configuration data according to NETCONF RFC |
| 120 | |
| 121 | Optional: |
Tomas Cejka | 8f3031e | 2014-02-14 23:15:08 +0100 | [diff] [blame] | 122 | key: source (string), value: config|url, default value: config |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 123 | key: default-operation (string), value: merge|replace|none |
| 124 | key: error-option (string), value: stop-on-error|continue-on-error|rollback-on-error |
Tomas Cejka | 8f3031e | 2014-02-14 23:15:08 +0100 | [diff] [blame] | 125 | key: uri-source (string), required when "source" is "url", value: uri |
Tomas Cejka | 5ae8dfb | 2014-02-14 23:42:17 +0100 | [diff] [blame] | 126 | key: test-option (string), value: notset|testset|set|test, default value: testset |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 127 | |
| 128 | 6) NETCONF <copy-config> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 129 | key: type (int), value: 9 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 130 | key: session (string), value: unique session identifier |
Tomas Cejka | b4d0587 | 2014-02-14 22:44:38 +0100 | [diff] [blame] | 131 | key: source (string), value: running|startup|candidate|url |
| 132 | key: target (string), value: running|startup|candidate|url |
| 133 | Optional, required when "url" is used: |
Tomas Cejka | a70d303 | 2014-02-14 23:20:03 +0100 | [diff] [blame] | 134 | key: uri-source (string), required when "source" is "url", value: uri |
| 135 | key: uri-target (string), required when "target" is "url", value: uri |
Tomas Cejka | b4d0587 | 2014-02-14 22:44:38 +0100 | [diff] [blame] | 136 | |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 137 | |
| 138 | Alternating: |
| 139 | key: source (string), value: running|startup|candidate |
| 140 | key: config (string), value: new complete configuration data, if source not specified |
| 141 | |
| 142 | 7) NETCONF <delete-config> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 143 | key: type (int), value: 10 |
| 144 | key: session (string), value: unique session identifier |
| 145 | key: target (string), value: running|startup|candidate |
| 146 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 147 | 8) NETCONF <lock> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 148 | key: type (int), value: 11 |
| 149 | key: session (string), value: unique session identifier |
| 150 | key: target (string), value: running|startup|candidate |
| 151 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 152 | 9) NETCONF <unlock> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 153 | key: type (int), value: 12 |
| 154 | key: session (string), value: unique session identifier |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 155 | key: target (string), value: running|startup|candidate |
| 156 | |
| 157 | 10) NETCONF <kill-session> |
| 158 | key: type (int), value: 13 |
| 159 | key: session (string), value: unique session identifier |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 160 | key: session-id (string), value: ID of the session to kill |
| 161 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 162 | 11) Provide information about NETCONF session |
| 163 | key: type (int), value: 14 |
| 164 | key: session (string), value: unique session identifier |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 165 | |
Radek Krejci | 80c10d9 | 2012-07-30 08:38:50 +0200 | [diff] [blame] | 166 | 12) Perform generic operation not included in base NETCONF |
| 167 | key: type (int), value: 15 |
| 168 | key: session (string), value: unique session identifier |
| 169 | key: content (string), value: XML data as content of the NETCONF's <rpc> envelope |
Tomas Cejka | 0aeca8b | 2012-12-22 19:56:03 +0100 | [diff] [blame] | 170 | |
| 171 | 13) get-schema |
| 172 | key: type (int), value: 16 |
| 173 | key: session (string), value: unique session identifier |
| 174 | key: identifier (string), value: identifier of schema |
Tomas Cejka | 814a5c6 | 2013-06-24 15:46:39 +0200 | [diff] [blame] | 175 | |
| 176 | 14) reloadhello Update hello message of NETCONF session |
| 177 | key: type (int), value: 17 |
| 178 | key: session (string), value: unique session identifier |
| 179 | |
| 180 | 15) notif_history Provide list of notifications from past. |
| 181 | key: type (int), value: 18 |
| 182 | key: session (string), value: unique session identifier |
| 183 | key: from (int64), value: start time in history |
| 184 | key: to (int64), value: end time |
| 185 | |
Tomas Cejka | 9245772 | 2013-11-14 22:13:40 +0100 | [diff] [blame] | 186 | 16) validate Validate datastore or url |
| 187 | key: type (int), value: 19 |
| 188 | key: session (string), value: unique session identifier |
| 189 | key: target (string), value: running|startup|candidate|url |
| 190 | Required when target is "url": |
| 191 | key: url (string), value: URL of datastore to validate |
| 192 | |