当前位置: 首页>>编程示例 >>用法及示例精选 >>正文


Python Tableau jobs.get_by_id用法及代码示例

Tableau Server Client (TSC)jobs.get_by_id的用法。

用法

jobs.get_by_id(job_id)

获取有关指定作业的信息。

REST API:Query Job

参数

名字 说明
job_id job_id 指定从异步任务返回的作业的 ID,例如数据提取刷新,或使用 Active Directory 导入或更新组

异常

错误 说明
404018 Resource Not Found 如果找不到 job_id,则会引发错误。

返回

返回请求的JobItem

示例

#  Query a Job

# import tableauserverclient as TSC
# tableau_auth = TSC.TableauAuth('USERNAME', 'PASSWORD')
# server = TSC.Server('https://SERVERURL')

  with server.auth.sign_in(tableau_auth):

     # get the id of the job from response to extract refresh task,
     # or another asynchronous REST API call.
     # in this case, "576b616d-341a-4539-b32c-1ed0eb9db548"


    myJobId = '576b616d-341a-4539-b32c-1ed0eb9db548'
    jobinfo = server.jobs.get_by_id(myJobId)

    print(jobinfo)

    # <Job#576b616d-341a-4539-b32c-1ed0eb9db548 RefreshExtract created_at(2018-04-10T23:43:21Z) started_at(2018-04-10T23:43:25Z) completed_at(2018-04-10T23:43:26Z) finish_code(1)>






相关用法


注:本文由纯净天空筛选整理自tableau.github.io大神的英文原创作品 jobs.get_by_id。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。