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 |
| 16 | communication socket (/tmp/pconn.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 | ~~~~~~~~ |
| 67 | 1) Request to create NETCONF session |
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 | |
| 76 | 2) Request to close NETCONF session |
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: |
| 102 | key: default-operation (string), value: merge|replace|none |
| 103 | key: error-option (string), value: stop-on-error|continue-on-error|rollback-on-error |
| 104 | |
| 105 | 6) NETCONF <copy-config> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 106 | key: type (int), value: 9 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 107 | key: session (string), value: unique session identifier |
| 108 | key: target (string), value: running|startup|candidate |
| 109 | |
| 110 | Alternating: |
| 111 | key: source (string), value: running|startup|candidate |
| 112 | key: config (string), value: new complete configuration data, if source not specified |
| 113 | |
| 114 | 7) NETCONF <delete-config> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 115 | key: type (int), value: 10 |
| 116 | key: session (string), value: unique session identifier |
| 117 | key: target (string), value: running|startup|candidate |
| 118 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 119 | 8) NETCONF <lock> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 120 | key: type (int), value: 11 |
| 121 | key: session (string), value: unique session identifier |
| 122 | key: target (string), value: running|startup|candidate |
| 123 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 124 | 9) NETCONF <unlock> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 125 | key: type (int), value: 12 |
| 126 | key: session (string), value: unique session identifier |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 127 | key: target (string), value: running|startup|candidate |
| 128 | |
| 129 | 10) NETCONF <kill-session> |
| 130 | key: type (int), value: 13 |
| 131 | key: session (string), value: unique session identifier |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 132 | key: session-id (string), value: ID of the session to kill |
| 133 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame] | 134 | 11) Provide information about NETCONF session |
| 135 | key: type (int), value: 14 |
| 136 | key: session (string), value: unique session identifier |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 137 | |
Radek Krejci | 80c10d9 | 2012-07-30 08:38:50 +0200 | [diff] [blame] | 138 | 12) Perform generic operation not included in base NETCONF |
| 139 | key: type (int), value: 15 |
| 140 | key: session (string), value: unique session identifier |
| 141 | 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] | 142 | |
| 143 | 13) get-schema |
| 144 | key: type (int), value: 16 |
| 145 | key: session (string), value: unique session identifier |
| 146 | key: identifier (string), value: identifier of schema |
Tomas Cejka | 814a5c6 | 2013-06-24 15:46:39 +0200 | [diff] [blame] | 147 | |
| 148 | 14) reloadhello Update hello message of NETCONF session |
| 149 | key: type (int), value: 17 |
| 150 | key: session (string), value: unique session identifier |
| 151 | |
| 152 | 15) notif_history Provide list of notifications from past. |
| 153 | key: type (int), value: 18 |
| 154 | key: session (string), value: unique session identifier |
| 155 | key: from (int64), value: start time in history |
| 156 | key: to (int64), value: end time |
| 157 | |
Tomas Cejka | 9245772 | 2013-11-14 22:13:40 +0100 | [diff] [blame^] | 158 | 16) validate Validate datastore or url |
| 159 | key: type (int), value: 19 |
| 160 | key: session (string), value: unique session identifier |
| 161 | key: target (string), value: running|startup|candidate|url |
| 162 | Required when target is "url": |
| 163 | key: url (string), value: URL of datastore to validate |
| 164 | |