Skip to content
This repository has been archived by the owner on Sep 23, 2020. It is now read-only.

Commit

Permalink
Merge branch 'stream-prototype'
Browse files Browse the repository at this point in the history
  • Loading branch information
oldpatricka committed Jan 14, 2014
2 parents 83aeb34 + 77b3f20 commit 73db733
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
6 changes: 6 additions & 0 deletions ceiclient/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
18 changes: 16 additions & 2 deletions ceiclient/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")


Expand Down Expand Up @@ -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):

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 73db733

Please sign in to comment.