def add_job(data, username=""): serializer = JobPostSerializer(data=data) if not serializer.is_valid(): raise IgniteException(serializer.errors) jb = job.add_job(serializer.data, username) serializer = JobDetailSerializer(jb) return serializer.data
def add_job(data, username=''): serializer = JobPostSerializer(data=data) if not serializer.is_valid(): raise IgniteException(serializer.errors) jb = job.add_job(serializer.data, username) serializer = JobDetailSerializer(jb) return serializer.data
def add_job( self, name=None, description="", tags=None, state=None, dependencies=None, parent_job=None, command="", entrypoint="", exitcodes="", restartable=True, datavolumes=None, environment=None, image=None, cron="", max_failures=3, delay=0, faildelay=5, port=None, created_by="" ): return job.add_job( name, description, tags, state, dependencies, parent_job, command, entrypoint, exitcodes, restartable, datavolumes, environment, image, cron, max_failures, delay, faildelay, port, created_by )
from SohukanHealth import settings setup_environ(settings) from job import add_job, read_job, user_total_job, \ bookmark_total_job, add_alarm_job, read_alarm_job, day_report_job, week_report_job, fix_ua_job, \ rabbitmq_queue_alarm_job, day_aggregation_job, shorturl_total_job, set_public_total_job, \ bookmark_email_job, fiction_total_job, conversion_job from alarm_job import nginx_tcp_check_job, web_alarm_job if __name__ == '__main__': if len(sys.argv) != 2: pass else: method_name = sys.argv[1] if method_name == 'add_job': add_job() elif method_name == 'read_job': read_job() elif method_name == 'add_alarm_job': add_alarm_job() elif method_name == 'read_alarm_job': read_alarm_job() elif method_name == 'user_total_job': user_total_job() elif method_name == 'bookmark_total_job': bookmark_total_job() elif method_name == 'fiction_total_job': fiction_total_job() elif method_name == 'bookmark_email_job': bookmark_email_job() elif method_name == 'shorturl_total_job': shorturl_total_job() elif method_name == 'set_public_total_job': set_public_total_job() elif method_name == 'day_report_job': day_report_job() elif method_name == 'week_report_job': week_report_job() elif method_name == 'fix_ua_job' : fix_ua_job() elif method_name == 'rabbitmq_queue_alarm_job' : rabbitmq_queue_alarm_job() elif method_name == 'day_aggregation_job' : day_aggregation_job() elif method_name == 'conversion_job': conversion_job()