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 | |
| 9 | - Add following lines into the (appropriate parts of the ) Apache configuration: |
| 10 | LoadModule netconf_module /usr/lib64/apache2/mod_netconf.so |
Radek Krejci | 5350b78 | 2012-07-23 16:24:28 +0200 | [diff] [blame] | 11 | |
Radek Krejci | 8fd1f5e | 2012-07-24 17:33:36 +0200 | [diff] [blame] | 12 | - 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 Cejka | 50c076e | 2014-03-18 15:31:10 +0100 | [diff] [blame^] | 16 | communication socket (/tmp/mod_netconf.sock) to allow writing. |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 17 | |
| 18 | |
| 19 | mod_netconf Message Format |
| 20 | -------------------------- |
| 21 | |
| 22 | 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] | 23 | with mod_netconf daemon. Messages are formated using JSON and encoded using |
| 24 | Chunked Framing Mechanism described in RFC6242 (http://tools.ietf.org/html/rfc6242#section-4.2) |
| 25 | with the following content. |
| 26 | Client is free to send multiple requests when the communication socket |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 27 | to the mod_netconf daemon is opened. |
| 28 | |
| 29 | Replies |
| 30 | ~~~~~~~ |
| 31 | 1) OK |
| 32 | key: type (int), value: 0 |
| 33 | |
| 34 | Optional (for request type 3 - create NETCONF connection): |
| 35 | key: session (string), value: 40 unique characters of session identifier |
| 36 | |
| 37 | 2) DATA |
| 38 | key: type (int), value: 1 |
| 39 | key: data (string) |
| 40 | |
| 41 | 3) ERROR |
| 42 | key: type (int), value: 2 |
| 43 | key: error-message (string) |
| 44 | |
| 45 | Optional: |
| 46 | key: error-tag (string) |
| 47 | key: error-type (string) |
| 48 | key: error-severity (string) |
Radek Krejci | b6aeb48 | 2012-07-26 11:04:25 +0200 | [diff] [blame] | 49 | key: error-app-tag (string) |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 50 | key: error-path (string) |
| 51 | key: bad-attribute (string) |
| 52 | key: bad-element (string) |
| 53 | key: bad-namespace (string) |
| 54 | key: session-id (string) |
| 55 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 56 | 4) INFO |
| 57 | key: type (int), value: 3 |
| 58 | key: sid (string), value: session ID |
| 59 | key: version (string), value: NETCONF protocol version |
| 60 | key: host (string), value: hostname of the NETCONF server |
| 61 | key: port (string), value: port of the NETCONF server |
| 62 | key: user (string), value: username of the user holding the NETCONF session |
| 63 | key: capabilities (array of strings), value: list of supported capabilities |
| 64 | |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 65 | Requests |
| 66 | ~~~~~~~~ |
Tomas Cejka | 50c076e | 2014-03-18 15:31:10 +0100 | [diff] [blame^] | 67 | 1) Request to create NETCONF session (connect) |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 68 | key: type (int), value: 4 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 69 | key: user (string) |
| 70 | key: pass (string), value: plain text password |
| 71 | |
| 72 | Optional: |
| 73 | key: host (string), "localhost" if not specified |
| 74 | key: port (string), "830" if not specified |
| 75 | |
Tomas Cejka | 50c076e | 2014-03-18 15:31:10 +0100 | [diff] [blame^] | 76 | 2) Request to close NETCONF session (disconnect) |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 77 | key: type (int), value: 5 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 78 | key: session (string), value: unique session identifier |
| 79 | |
| 80 | 3) NETCONF <get> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 81 | key: type (int), value: 6 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 82 | key: session (string), value: unique session identifier |
| 83 | |
| 84 | Optional: |
| 85 | key: filter (string), value: xml subtree filter |
| 86 | |
| 87 | 4) NETCONF <get-config> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 88 | key: type (int), value: 7 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 89 | key: session (string), value: unique session identifier |
| 90 | key: source (string), value: running|startup|candidate |
| 91 | |
| 92 | Optional: |
| 93 | key: filter (string), value: xml subtree filter |
| 94 | |
| 95 | 5) NETCONF <edit-config> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 96 | key: type (int), value: 8 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 97 | key: session (string), value: unique session identifier |
| 98 | key: target (string), value: running|startup|candidate |
| 99 | key: config (string), value: editing configuration data according to NETCONF RFC |
| 100 | |
| 101 | Optional: |
Tomas Cejka | 8f3031e | 2014-02-14 23:15:08 +0100 | [diff] [blame] | 102 | key: source (string), value: config|url, default value: config |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 103 | key: default-operation (string), value: merge|replace|none |
| 104 | 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] | 105 | key: uri-source (string), required when "source" is "url", value: uri |
Tomas Cejka | 5ae8dfb | 2014-02-14 23:42:17 +0100 | [diff] [blame] | 106 | key: test-option (string), value: notset|testset|set|test, default value: testset |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 107 | |
| 108 | 6) NETCONF <copy-config> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 109 | key: type (int), value: 9 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 110 | key: session (string), value: unique session identifier |
Tomas Cejka | b4d0587 | 2014-02-14 22:44:38 +0100 | [diff] [blame] | 111 | key: source (string), value: running|startup|candidate|url |
| 112 | key: target (string), value: running|startup|candidate|url |
| 113 | Optional, required when "url" is used: |
Tomas Cejka | a70d303 | 2014-02-14 23:20:03 +0100 | [diff] [blame] | 114 | key: uri-source (string), required when "source" is "url", value: uri |
| 115 | key: uri-target (string), required when "target" is "url", value: uri |
Tomas Cejka | b4d0587 | 2014-02-14 22:44:38 +0100 | [diff] [blame] | 116 | |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 117 | |
| 118 | Alternating: |
| 119 | key: source (string), value: running|startup|candidate |
| 120 | key: config (string), value: new complete configuration data, if source not specified |
| 121 | |
| 122 | 7) NETCONF <delete-config> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 123 | key: type (int), value: 10 |
| 124 | key: session (string), value: unique session identifier |
| 125 | key: target (string), value: running|startup|candidate |
| 126 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 127 | 8) NETCONF <lock> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 128 | key: type (int), value: 11 |
| 129 | key: session (string), value: unique session identifier |
| 130 | key: target (string), value: running|startup|candidate |
| 131 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 132 | 9) NETCONF <unlock> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 133 | key: type (int), value: 12 |
| 134 | key: session (string), value: unique session identifier |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 135 | key: target (string), value: running|startup|candidate |
| 136 | |
| 137 | 10) NETCONF <kill-session> |
| 138 | key: type (int), value: 13 |
| 139 | key: session (string), value: unique session identifier |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 140 | key: session-id (string), value: ID of the session to kill |
| 141 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 142 | 11) Provide information about NETCONF session |
| 143 | key: type (int), value: 14 |
| 144 | key: session (string), value: unique session identifier |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 145 | |
Radek Krejci | 80c10d9 | 2012-07-30 08:38:50 +0200 | [diff] [blame] | 146 | 12) Perform generic operation not included in base NETCONF |
| 147 | key: type (int), value: 15 |
| 148 | key: session (string), value: unique session identifier |
| 149 | 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] | 150 | |
| 151 | 13) get-schema |
| 152 | key: type (int), value: 16 |
| 153 | key: session (string), value: unique session identifier |
| 154 | key: identifier (string), value: identifier of schema |
Tomas Cejka | 814a5c6 | 2013-06-24 15:46:39 +0200 | [diff] [blame] | 155 | |
| 156 | 14) reloadhello Update hello message of NETCONF session |
| 157 | key: type (int), value: 17 |
| 158 | key: session (string), value: unique session identifier |
| 159 | |
| 160 | 15) notif_history Provide list of notifications from past. |
| 161 | key: type (int), value: 18 |
| 162 | key: session (string), value: unique session identifier |
| 163 | key: from (int64), value: start time in history |
| 164 | key: to (int64), value: end time |
| 165 | |
Tomas Cejka | 9245772 | 2013-11-14 22:13:40 +0100 | [diff] [blame] | 166 | 16) validate Validate datastore or url |
| 167 | key: type (int), value: 19 |
| 168 | key: session (string), value: unique session identifier |
| 169 | key: target (string), value: running|startup|candidate|url |
| 170 | Required when target is "url": |
| 171 | key: url (string), value: URL of datastore to validate |
| 172 | |