Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'stream-prototype'

  • Loading branch information...
commit 73db733755dac6ace74aee18376215ef6e1c73b0 2 parents 83aeb34 + 77b3f20
@oldpatricka oldpatricka authored
Showing with 22 additions and 2 deletions.
  1. +6 −0 ceiclient/client.py
  2. +16 −2 ceiclient/commands.py
View
6 ceiclient/client.py
@@ -332,6 +332,12 @@ class PDClient(DashiCeiClient):
def set_system_boot(self, system_boot):
self.connection.call(self.dashi_name, 'set_system_boot', system_boot=system_boot)
+ def add_engine(self, engine_id, slots, **kwargs):
+ definition = dict(engine_id=engine_id, slots=slots)
+ for key, val in kwargs.iteritems():
+ definition[key] = val
+ return self.connection.call(self.dashi_name, 'add_engine', definition=definition)
+
def create_process_definition(self, process_definition=None, process_definition_id=None):
if process_definition is None:
raise CeiClientError("You must provide a process defintion")
View
18 ceiclient/commands.py
@@ -610,7 +610,8 @@ def _validate_process_definition(definition):
module = executable.get('module')
cls = executable.get('class')
- if not module or not cls:
+ execu = executable.get('exec')
+ if not execu and (not module or not cls):
raise ValueError("definition has invalid executable")
@@ -732,6 +733,19 @@ def __init__(self, subparsers):
def execute(client, opts):
return client.describe_process_definition(opts.process_definition_id)
+class PDNodeState(CeiCommand):
+
+ name = 'nodestate'
+
+ def __init__(self, subparsers):
+ parser = subparsers.add_parser(self.name)
+ parser.add_argument('node_id')
+ parser.add_argument('domain_id')
+ parser.add_argument('state')
+
+ @staticmethod
+ def execute(client, opts):
+ return client.node_state(opts.node_id, opts.domain_id, opts.state)
class PDUpdateProcessDefinition(CeiCommand):
@@ -2011,7 +2025,7 @@ class Process(CeiService):
commands = {}
for command in [PDScheduleProcess, PDDescribeProcess, PDDescribeProcesses,
- PDTerminateProcess, PDDump, PDRestartProcess, PDWaitProcess]:
+ PDTerminateProcess, PDDump, PDRestartProcess, PDWaitProcess, PDNodeState]:
commands[command.name] = command
@staticmethod
Please sign in to comment.
Something went wrong with that request. Please try again.