本文整理汇总了Python中Pegasus.service.monitoring.queries.StampedeWorkflowQueries类的典型用法代码示例。如果您正苦于以下问题:Python StampedeWorkflowQueries类的具体用法?Python StampedeWorkflowQueries怎么用?Python StampedeWorkflowQueries使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了StampedeWorkflowQueries类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_task_meta
def get_task_meta(username, m_wf_id, wf_id, task_id):
"""
Returns a collection of task's metadata.
:query int start-index: Return results starting from record <start-index> (0 indexed)
:query int max-results: Return a maximum of <max-results> records
:query string query: Search criteria
:query string order: Sorting criteria
:query boolean pretty-print: Return formatted JSON response
:statuscode 200: OK
:statuscode 204: No content; when no workflow metadata found.
:statuscode 400: Bad request
:statuscode 401: Authentication failure
:statuscode 403: Authorization failure
:return type: Collection
:return resource: TaskMeta
"""
queries = StampedeWorkflowQueries(g.stampede_db_url)
paged_response = queries.get_task_meta(task_id, **g.query_args)
if paged_response.total_records == 0:
log.debug("Total records is 0; returning HTTP 204 No content")
return make_response("", 204, JSON_HEADER)
#
# Generate JSON Response
#
response_json = jsonify(paged_response)
return make_response(response_json, 200, JSON_HEADER)
示例2: get_job_instance_states
def get_job_instance_states(username, m_wf_id, wf_id, job_id, job_instance_id, recent=False):
"""
Returns a collection of Job States.
:query int start-index: Return results starting from record <start-index> (0 indexed)
:query int max-results: Return a maximum of <max-results> records
:query string query: Search criteria
:query string order: Sorting criteria
:query boolean recent: Get most recent job state
:query boolean pretty-print: Return formatted JSON response
:statuscode 200: OK
:statuscode 204: No content; when no jobstates found.
:statuscode 400: Bad request
:statuscode 401: Authentication failure
:statuscode 403: Authorization failure
:return type: Collection
:return resource: JobState
"""
queries = StampedeWorkflowQueries(g.stampede_db_url)
paged_response = queries.get_job_instance_states(wf_id, job_id, job_instance_id, recent=recent, **g.query_args)
if paged_response.total_records == 0:
log.debug('Total records is 0; returning HTTP 204 No content')
return make_response('', 204, JSON_HEADER)
#
# Generate JSON Response
#
response_json = jsonify(paged_response)
return make_response(response_json, 200, JSON_HEADER)
示例3: get_job_instance_invocations
def get_job_instance_invocations(username, m_wf_id, wf_id, job_id, job_instance_id):
queries = StampedeWorkflowQueries(g.stampede_db_url)
paged_response = queries.get_job_instance_invocations(wf_id, job_id, job_instance_id,**g.query_args)
if paged_response.total_records == 0:
log.debug('Total records is 0; returning HTTP 204 No content')
return make_response('', 204, JSON_HEADER)
#
# Generate JSON Response
#
response_json = jsonify(paged_response)
return make_response(response_json, 200, JSON_HEADER)
示例4: get_task
def get_task(username, m_wf_id, wf_id, task_id):
"""
Returns task identified by m_wf_id, wf_id, task_id.
:query boolean pretty-print: Return formatted JSON response
:statuscode 200: OK
:statuscode 401: Authentication failure
:statuscode 403: Authorization failure
:statuscode 404: Not found
:return type: Record
:return resource: Task
"""
queries = StampedeWorkflowQueries(g.stampede_db_url)
record = queries.get_task(task_id)
#
# Generate JSON Response
#
response_json = jsonify(record)
return make_response(response_json, 200, JSON_HEADER)