-
Notifications
You must be signed in to change notification settings - Fork 444
Closed
Labels
help wantedA user needs help, may be a mistake, a bug or a feature requestA user needs help, may be a mistake, a bug or a feature request
Description
Hi there! I would like to ask how can I able to extract all the job IDs for a particular workbook. I can able to access all the jobs but am unable to figure out how to get only the job IDs of a particular workbook.
import tableauserverclient as TSC
import sys
import os
import pandas as pd
import win32com.client
from PyPDF2 import PdfMerger, PdfWriter, PdfFileReader
from datetime import datetime, time, date
import tempfile
import numpy as np
from notifypy import Notify
import shutil
from datetime import timedelta
import pytz
tableau_auth = TSC.TableauAuth('user', 'password', 'site name')
server = TSC.Server('url', use_server_version=True)
timeout_minutes = 300
server.add_http_options({'timeout': timeout_minutes*60})
conn = server.auth.sign_in(tableau_auth)
for i in server.jobs.all():
if i.created_at!=None and i.started_at!=None and i.ended_at!=None:
print(i.type,i.id,
datetime.strptime(str(i.created_at), "%Y-%m-%d %H:%M:%S%z").astimezone(pytz.timezone("Asia/Kolkata")).strftime("%Y-%m-%d %H:%M:%S %Z%z"),
datetime.strptime(str(i.started_at), "%Y-%m-%d %H:%M:%S%z").astimezone(pytz.timezone("Asia/Kolkata")).strftime("%Y-%m-%d %H:%M:%S %Z%z"),
datetime.strptime(str(i.ended_at), "%Y-%m-%d %H:%M:%S%z").astimezone(pytz.timezone("Asia/Kolkata")).strftime("%Y-%m-%d %H:%M:%S %Z%z")
,i.status)
Metadata
Metadata
Assignees
Labels
help wantedA user needs help, may be a mistake, a bug or a feature requestA user needs help, may be a mistake, a bug or a feature request