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 |
| 23 | with mod_netconf daemon. Messages are formated using JSON with the following |
| 24 | content. Client is free to send multiple requests when the communication socket |
| 25 | to the mod_netconf daemon is opened. |
| 26 | |
| 27 | Replies |
| 28 | ~~~~~~~ |
| 29 | 1) OK |
| 30 | key: type (int), value: 0 |
| 31 | |
| 32 | Optional (for request type 3 - create NETCONF connection): |
| 33 | key: session (string), value: 40 unique characters of session identifier |
| 34 | |
| 35 | 2) DATA |
| 36 | key: type (int), value: 1 |
| 37 | key: data (string) |
| 38 | |
| 39 | 3) ERROR |
| 40 | key: type (int), value: 2 |
| 41 | key: error-message (string) |
| 42 | |
| 43 | Optional: |
| 44 | key: error-tag (string) |
| 45 | key: error-type (string) |
| 46 | key: error-severity (string) |
Radek Krejci | b6aeb48 | 2012-07-26 11:04:25 +0200 | [diff] [blame] | 47 | key: error-app-tag (string) |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 48 | key: error-path (string) |
| 49 | key: bad-attribute (string) |
| 50 | key: bad-element (string) |
| 51 | key: bad-namespace (string) |
| 52 | key: session-id (string) |
| 53 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame^] | 54 | 4) INFO |
| 55 | key: type (int), value: 3 |
| 56 | key: sid (string), value: session ID |
| 57 | key: version (string), value: NETCONF protocol version |
| 58 | key: host (string), value: hostname of the NETCONF server |
| 59 | key: port (string), value: port of the NETCONF server |
| 60 | key: user (string), value: username of the user holding the NETCONF session |
| 61 | key: capabilities (array of strings), value: list of supported capabilities |
| 62 | |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 63 | Requests |
| 64 | ~~~~~~~~ |
| 65 | 1) Request to create NETCONF session |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame^] | 66 | key: type (int), value: 4 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 67 | key: user (string) |
| 68 | key: pass (string), value: plain text password |
| 69 | |
| 70 | Optional: |
| 71 | key: host (string), "localhost" if not specified |
| 72 | key: port (string), "830" if not specified |
| 73 | |
| 74 | 2) Request to close NETCONF session |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame^] | 75 | key: type (int), value: 5 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 76 | key: session (string), value: unique session identifier |
| 77 | |
| 78 | 3) NETCONF <get> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame^] | 79 | key: type (int), value: 6 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 80 | key: session (string), value: unique session identifier |
| 81 | |
| 82 | Optional: |
| 83 | key: filter (string), value: xml subtree filter |
| 84 | |
| 85 | 4) NETCONF <get-config> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame^] | 86 | key: type (int), value: 7 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 87 | key: session (string), value: unique session identifier |
| 88 | key: source (string), value: running|startup|candidate |
| 89 | |
| 90 | Optional: |
| 91 | key: filter (string), value: xml subtree filter |
| 92 | |
| 93 | 5) NETCONF <edit-config> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame^] | 94 | key: type (int), value: 8 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 95 | key: session (string), value: unique session identifier |
| 96 | key: target (string), value: running|startup|candidate |
| 97 | key: config (string), value: editing configuration data according to NETCONF RFC |
| 98 | |
| 99 | Optional: |
| 100 | key: default-operation (string), value: merge|replace|none |
| 101 | key: error-option (string), value: stop-on-error|continue-on-error|rollback-on-error |
| 102 | |
| 103 | 6) NETCONF <copy-config> |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame^] | 104 | key: type (int), value: 9 |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 105 | key: session (string), value: unique session identifier |
| 106 | key: target (string), value: running|startup|candidate |
| 107 | |
| 108 | Alternating: |
| 109 | key: source (string), value: running|startup|candidate |
| 110 | key: config (string), value: new complete configuration data, if source not specified |
| 111 | |
| 112 | 7) NETCONF <delete-config> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 113 | key: type (int), value: 10 |
| 114 | key: session (string), value: unique session identifier |
| 115 | key: target (string), value: running|startup|candidate |
| 116 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame^] | 117 | 8) NETCONF <lock> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 118 | key: type (int), value: 11 |
| 119 | key: session (string), value: unique session identifier |
| 120 | key: target (string), value: running|startup|candidate |
| 121 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame^] | 122 | 9) NETCONF <unlock> |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 123 | key: type (int), value: 12 |
| 124 | key: session (string), value: unique session identifier |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame^] | 125 | key: target (string), value: running|startup|candidate |
| 126 | |
| 127 | 10) NETCONF <kill-session> |
| 128 | key: type (int), value: 13 |
| 129 | key: session (string), value: unique session identifier |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 130 | key: session-id (string), value: ID of the session to kill |
| 131 | |
Radek Krejci | 9e04c7b | 2012-07-26 15:54:25 +0200 | [diff] [blame^] | 132 | 11) Provide information about NETCONF session |
| 133 | key: type (int), value: 14 |
| 134 | key: session (string), value: unique session identifier |
Radek Krejci | 7bdb677 | 2012-07-26 10:55:14 +0200 | [diff] [blame] | 135 | |