summaryrefslogtreecommitdiffstats
path: root/src/bin/shell/kea_conn.py
diff options
context:
space:
mode:
authorWlodek Wencel <wlodek@isc.org>2017-04-25 20:53:52 +0200
committerWlodek Wencel <wlodek@isc.org>2017-04-25 20:53:52 +0200
commit92d6db67e3c8aa649a043d6efcaba1b82e27bcb6 (patch)
tree6e2fd10ab813b68cb74a3f5326c8836ff1dafab2 /src/bin/shell/kea_conn.py
parent[master] ChangeLog updated after 5208a merge. (diff)
downloadkea-92d6db67e3c8aa649a043d6efcaba1b82e27bcb6.tar.xz
kea-92d6db67e3c8aa649a043d6efcaba1b82e27bcb6.zip
[trac5262] kea-shell extended with target service support
Diffstat (limited to 'src/bin/shell/kea_conn.py')
-rw-r--r--src/bin/shell/kea_conn.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/bin/shell/kea_conn.py b/src/bin/shell/kea_conn.py
index 45bd9b7490..ca4aafc8ae 100644
--- a/src/bin/shell/kea_conn.py
+++ b/src/bin/shell/kea_conn.py
@@ -16,6 +16,7 @@ class CARequest:
- http_host - hostname of the CA
- http-port - TCP port of the CA
- command - specifies the command to send (e.g. list-commands)
+ - service - specifies service that is target for the command (e.g. dhcp4)
- timeout - timeout (in ms)
- args - extra arguments my be added here
- headers - extra HTTP headers may be added here
@@ -25,6 +26,7 @@ class CARequest:
http_host = ''
http_port = 0
command = ''
+ service = ''
timeout = 0
args = ''
headers = {}
@@ -39,6 +41,10 @@ class CARequest:
this stores the output in self.content
"""
self.content = '{ "command": "' + self.command + '"'
+ if self.service is not None:
+ self.service = [x for x in self.service if x]
+ if len(self.service) > 0:
+ self.content += ', "service": ["' + '","'.join(self.service) + '"]'
if len(self.args) > 1:
self.content += ', "arguments": { ' + self.args + ' }'
self.content += ' }'