當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


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。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。