Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change EPU references to Domain

  • Loading branch information...
commit 3dc53ed9618e66849b9667d376418c93dae76b20 1 parent a47dc5b
@priteau priteau authored labisso committed
14 README.rst
@@ -59,20 +59,20 @@ To terminate all nodes and shut down the provisioner:
EPU Manager
-----------
-To control the EPU manager, use the ``epu`` service name.
+To control the EPU manager, use the ``domain`` service name.
-To list all EPUs:
+To list all domains:
- ``ceictl epu list``
+ ``ceictl domain list``
-To describe the EPU named `epu1`:
+To describe the domain named `domain1`:
- ``ceictl epu describe epu1``
+ ``ceictl domain describe domain1``
-To reconfigure the EPU named `epu1` and change its engine configuration
+To reconfigure the domain named `domain1` and change its engine configuration
parameter `preserve_n` to the integer value 2:
- ``ceictl epu reconfigure --int engine_conf.preserve_n=2 epu1``
+ ``ceictl domain reconfigure --int engine_conf.preserve_n=2 domain1``
Boolean and string values can also be provided with the ``--bool`` and
``--string`` options.
View
22 ceiclient/client.py
@@ -110,7 +110,7 @@ def update_credentials(self, caller, site_name, site_credentials):
class EPUMClient(CeiClient):
dashi_name = 'epu_management_service'
- name = 'epu'
+ name = 'domain'
help = 'Control the EPU Management Service'
def __init__(self, connection, dashi_name=None):
@@ -118,20 +118,20 @@ def __init__(self, connection, dashi_name=None):
self.dashi_name = dashi_name
self._connection = connection
- def describe_epu(self, name, caller=None):
- return self._connection.call(self.dashi_name, 'describe_epu', epu_name=name, caller=caller)
+ def describe_domain(self, name, caller=None):
+ return self._connection.call(self.dashi_name, 'describe_domain', domain_id=name, caller=caller)
- def list_epus(self, caller=None):
- return self._connection.call(self.dashi_name, 'list_epus', caller=caller)
+ def list_domains(self, caller=None):
+ return self._connection.call(self.dashi_name, 'list_domains', caller=caller)
- def reconfigure_epu(self, name, config, caller=None):
- return self._connection.call(self.dashi_name, 'reconfigure_epu', epu_name=name, epu_config=config, caller=caller)
+ def reconfigure_domain(self, name, config, caller=None):
+ return self._connection.call(self.dashi_name, 'reconfigure_domain', domain_id=name, config=config, caller=caller)
- def add_epu(self, name, config, caller=None):
- return self._connection.call(self.dashi_name, 'add_epu', epu_name=name, epu_config=config, caller=caller)
+ def add_domain(self, name, config, caller=None):
+ return self._connection.call(self.dashi_name, 'add_domain', domain_id=name, config=config, caller=caller)
- def remove_epu(self, name, caller=None):
- return self._connection.call(self.dashi_name, 'remove_epu', epu_name=name, caller=caller)
+ def remove_domain(self, name, caller=None):
+ return self._connection.call(self.dashi_name, 'remove_domain', domain_id=name, caller=caller)
commands = {}
for command in [EPUMDescribe, EPUMList, EPUMReconfigure, EPUMAdd, EPUMRemove]:
View
28 ceiclient/commands.py
@@ -239,7 +239,7 @@ class EPUMAdd(CeiCommand):
def __init__(self, subparsers):
parser = subparsers.add_parser(self.name)
- parser.add_argument('epu_name', action='store', help='The name of the EPU to be added.')
+ parser.add_argument('domain_id', action='store', help='The name of the domain to be added.')
parser.add_argument('--conf', dest='de_conf', action='store', help='Set the type of decision engine to use.')
@staticmethod
@@ -247,7 +247,7 @@ def execute(client, opts):
stream = open(opts.de_conf, 'r')
conf = yaml.load(stream)
stream.close()
- return client.add_epu(opts.epu_name, conf, caller=opts.caller)
+ return client.add_domain(opts.domain_id, conf, caller=opts.caller)
class EPUMRemove(CeiCommand):
@@ -255,11 +255,11 @@ class EPUMRemove(CeiCommand):
def __init__(self, subparsers):
parser = subparsers.add_parser(self.name)
- parser.add_argument('epu_name', action='store', help='The EPU to remove')
+ parser.add_argument('domain_id', action='store', help='The domain to remove')
@staticmethod
def execute(client, opts):
- return client.remove_epu(opts.epu_name, caller=opts.caller)
+ return client.remove_domain(opts.domain_id, caller=opts.caller)
class EPUMDescribe(CeiCommand):
@@ -273,11 +273,11 @@ class EPUMDescribe(CeiCommand):
def __init__(self, subparsers):
parser = subparsers.add_parser(self.name)
- parser.add_argument('epu_name', action='store', help='The EPU to describe')
+ parser.add_argument('domain_id', action='store', help='The domain to describe')
@staticmethod
def execute(client, opts):
- return client.describe_epu(opts.epu_name, caller=opts.caller)
+ return client.describe_domain(opts.domain_id, caller=opts.caller)
@staticmethod
def output(result):
@@ -293,12 +293,12 @@ def __init__(self, subparsers):
@staticmethod
def execute(client, opts):
- return client.list_epus(caller=opts.caller)
+ return client.list_domains(caller=opts.caller)
@staticmethod
def output(result):
- for epu_name in result:
- print epu_name
+ for domain_id in result:
+ print domain_id
class EPUMReconfigure(CeiCommand):
@@ -306,10 +306,10 @@ class EPUMReconfigure(CeiCommand):
def __init__(self, subparsers):
parser = subparsers.add_parser(self.name)
- parser.add_argument('epu_name', action='store', help='The EPU to reconfigure')
- parser.add_argument('--bool', dest='updated_kv_bool', action='append', help='Key to modify in the EPU configuration with a boolean value')
- parser.add_argument('--int', dest='updated_kv_int', action='append', help='Key to modify in the EPU configuration with a integer value')
- parser.add_argument('--string', dest='updated_kv_string', action='append', help='Key to modify in the EPU configuration with a string value')
+ parser.add_argument('domain_id', action='store', help='The domain to reconfigure')
+ parser.add_argument('--bool', dest='updated_kv_bool', action='append', help='Key to modify in the domain configuration with a boolean value')
+ parser.add_argument('--int', dest='updated_kv_int', action='append', help='Key to modify in the domain configuration with a integer value')
+ parser.add_argument('--string', dest='updated_kv_string', action='append', help='Key to modify in the domain configuration with a string value')
@staticmethod
def format_reconfigure(bool_reconfs=[], int_reconfs=[], string_reconfs=[]):
@@ -359,7 +359,7 @@ def format_reconfigure(bool_reconfs=[], int_reconfs=[], string_reconfs=[]):
@staticmethod
def execute(client, opts):
updated_kvs = EPUMReconfigure.format_reconfigure(bool_reconfs=opts.updated_kv_bool, int_reconfs=opts.updated_kv_int, string_reconfs=opts.updated_kv_string)
- return client.reconfigure_epu(opts.epu_name, updated_kvs, caller=opts.caller)
+ return client.reconfigure_domain(opts.domain_id, updated_kvs, caller=opts.caller)
class PDDispatch(CeiCommand):
View
24 ceiclient/tests/test_commands.py
@@ -14,26 +14,26 @@ def setUp(self):
def test_command_parsing_epum_describe_ok(self):
EPUMDescribe(self.subparsers)
- opts = self.parser.parse_args(['describe', 'epu1'])
+ opts = self.parser.parse_args(['describe', 'domain1'])
assert opts.command == 'describe'
- assert opts.epu_name == 'epu1'
+ assert opts.domain_id == 'domain1'
def test_command_parsing_epum_add_ok(self):
EPUMAdd(self.subparsers)
de_conf = "XXX"
- opts = self.parser.parse_args(['add', 'epu2', "--conf", de_conf])
+ opts = self.parser.parse_args(['add', 'domain2', "--conf", de_conf])
assert opts.de_conf == "XXX"
- assert opts.epu_name == 'epu2'
+ assert opts.domain_id == 'domain2'
def test_command_parsing_epum_remove_ok(self):
EPUMRemove(self.subparsers)
- opts = self.parser.parse_args(['remove', 'epu2'])
- assert opts.epu_name == 'epu2'
+ opts = self.parser.parse_args(['remove', 'domain2'])
+ assert opts.domain_id == 'domain2'
@raises(SystemExit)
def test_command_parsing_epum_describe_failing_wrong_command(self):
EPUMDescribe(self.subparsers)
- opts = self.parser.parse_args(['list', 'epu1'])
+ opts = self.parser.parse_args(['list', 'domain1'])
@raises(SystemExit)
def test_command_parsing_epum_describe_failing_missing_argument(self):
@@ -58,13 +58,13 @@ def test_command_parsing_epum_reconfigure_ok(self):
intkvpair2 = 'another.key=24'
stringkvpair1 = 'a.string=a_string'
stringkvpair2 = 'a.string_again=another_string'
- opts = self.parser.parse_args(['reconfigure', 'epu1', '--bool',
+ opts = self.parser.parse_args(['reconfigure', 'domain1', '--bool',
boolkvpair1, '--int', intkvpair1, '--bool', boolkvpair2,
'--string', stringkvpair1, '--string', stringkvpair2, '--int',
intkvpair2])
assert opts.command == 'reconfigure'
- assert opts.epu_name == 'epu1'
+ assert opts.domain_id == 'domain1'
assert opts.updated_kv_bool == [boolkvpair1, boolkvpair2]
assert opts.updated_kv_int == [intkvpair1, intkvpair2]
assert opts.updated_kv_string == [stringkvpair1, stringkvpair2]
@@ -93,14 +93,14 @@ def test_command_parsing_epum_reconfigure_ok(self):
@raises(SystemExit)
def test_command_parsing_epum_reconfigure_failing_wrong_command(self):
EPUMReconfigure(self.subparsers)
- opts = self.parser.parse_args(['describe', 'epu1', '42'])
+ opts = self.parser.parse_args(['describe', 'domain1', '42'])
@raises(SystemExit)
def test_command_parsing_epum_reconfigure_failing_not_enough_arguments(self):
EPUMReconfigure(self.subparsers)
- opts = self.parser.parse_args(['describe', 'epu1'])
+ opts = self.parser.parse_args(['describe', 'domain1'])
@raises(SystemExit)
def test_command_parsing_epum_reconfigure_failing_wrong_arguments(self):
EPUMReconfigure(self.subparsers)
- opts = self.parser.parse_args(['describe', 'epu1', 'notanumber'])
+ opts = self.parser.parse_args(['describe', 'domain1', 'notanumber'])
Please sign in to comment.
Something went wrong with that request. Please try again.