Repository URL to install this package:
|
Version:
5.1.2 ▾
|
# Copyright 2013 TrilioData Inc.
# All Rights Reserved.
"""
Client side of the wlm-cron manager RPC API.
"""
from workloadmgr import flags
from workloadmgr.openstack.common import jsonutils
from workloadmgr import rpc
import oslo_messaging as messaging
FLAGS = flags.FLAGS
class CronAPI():
'''Client side of the wlm-cron rpc API.
'''
RPC_API_VERSION = '2.0'
def __init__(self):
target = messaging.Target(topic=FLAGS.wlm_cron_topic,
version=self.RPC_API_VERSION)
self.client = rpc.get_client(target, self.RPC_API_VERSION)
def workload_add_scheduler_job(self, ctxt, jobschedule, workload,
request_spec=None, filter_properties=None):
cctxt = self.client.prepare(version=self.RPC_API_VERSION)
request_spec_p = jsonutils.to_primitive(request_spec)
return cctxt.cast(ctxt, 'workload_add_scheduler_job', jobschedule=jobschedule,
workload=workload)
def workload_pause(self, ctxt, workload_id, request_spec=None, filter_properties=None):
cctxt = self.client.prepare(version=self.RPC_API_VERSION)
request_spec_p = jsonutils.to_primitive(request_spec)
return cctxt.cast(ctxt, 'workload_pause', workload_id=workload_id,
request_spec=request_spec_p,
filter_properties=filter_properties)
def workload_ensure_global_job_scheduler(self, ctxt, request_spec=None, filter_properties=None):
cctxt = self.client.prepare(version=self.RPC_API_VERSION)
request_spec_p = jsonutils.to_primitive(request_spec)
return cctxt.cast(ctxt, 'workload_ensure_global_job_scheduler')
def workload_get_global_job_scheduler(self, ctxt, request_spec=None, filter_properties=None):
cctxt = self.client.prepare(version=self.RPC_API_VERSION)
request_spec_p = jsonutils.to_primitive(request_spec)
return cctxt.call(ctxt, 'workload_get_global_job_scheduler',
request_spec=request_spec_p,
filter_properties=filter_properties)
def workload_enable_global_job_scheduler(self, ctxt, request_spec=None, filter_properties=None):
cctxt = self.client.prepare(version=self.RPC_API_VERSION)
request_spec_p = jsonutils.to_primitive(request_spec)
return cctxt.cast(ctxt, 'workload_enable_global_job_scheduler',
request_spec=request_spec_p,
filter_properties=filter_properties)
def workload_disable_global_job_scheduler(self, ctxt, request_spec=None, filter_properties=None):
cctxt = self.client.prepare(version=self.RPC_API_VERSION)
request_spec_p = jsonutils.to_primitive(request_spec)
return cctxt.cast(ctxt, 'workload_disable_global_job_scheduler',
request_spec=request_spec_p,
filter_properties=filter_properties)