Tableau Server Client (TSC)
中subscription.create
的用法。
用法
subscription.create(subscription_item)
按特定計劃為特定用戶創建對視圖或工作簿的訂閱。當用戶訂閱內容時,Tableau Server 會按照在 Tableau Server 上定義並在 subscription_item
中指定的計劃通過電子郵件將內容發送給用戶。
要創建新訂閱,您需要首先創建一個新的 subscription_item
(來自 SubscriptionItem
類)。
REST API:Create Subscription
參數
名字 | 說明 |
---|---|
subscription_item |
指定要訂閱的用戶、要訂閱的內容、與訂閱相關聯的計劃以及訂閱的其他元數據。 |
返回
返回新的 SubscriptionItem
對象。
示例
# Create the target (content) of the subscription with its ID and type.
# ID can be obtained by calling workbooks.get() or views.get().
target = TSC.Target('c7a9327e-1cda-4504-b026-ddb43b976d1d', 'workbook')
# Store the schedule ID and user ID.
# IDs can be obtained by calling schedules.get() and users.get().
schedule_id = 'b60b4efd-a6f7-4599-beb3-cb677e7abac1'
user_id = '28ce5884-ed38-49a9-aa10-8f5fbd59bbf6'
# Create the new SubscriptionItem object with variables from above.
new_sub = TSC.SubscriptionItem('My Subscription', schedule_id, user_id, target)
# (Optional) Set other fields. Any of these can be added or removed.
new_sub.attach_image = False
new_sub.attach_pdf = True
new_sub.message = "You have an alert!"
new_sub.page_orientation = TSC.PDFRequestOptions.Orientation.Landscape
new_sub.page_size_option = TSC.PDFRequestOptions.PageType.B4
new_sub.send_if_view_empty = True
# Create the new subscription on the site you are logged in.
new_sub = server.subscriptions.create(new_sub)
print(new_sub.subject)
相關用法
- Python Tableau subscription.get_by_id用法及代碼示例
- Python Tableau subscription.update用法及代碼示例
- Python Tableau subscriptions.delete用法及代碼示例
- Python subprocess.run用法及代碼示例
- Python subprocess.Popen用法及代碼示例
- Python subprocess.check_output用法及代碼示例
- Python subprocess.getstatusoutput用法及代碼示例
- Python subprocess.Popen.communicate用法及代碼示例
- Python super()用法及代碼示例
- Python sum()用法及代碼示例
- Python super用法及代碼示例
- Python sklearn.cluster.MiniBatchKMeans用法及代碼示例
- Python scipy.ndimage.binary_opening用法及代碼示例
- Python scipy.signal.windows.tukey用法及代碼示例
- Python scipy.stats.mood用法及代碼示例
- Python str.isidentifier用法及代碼示例
- Python sklearn.metrics.fbeta_score用法及代碼示例
- Python scipy.fft.ihfftn用法及代碼示例
- Python scipy.stats.normaltest用法及代碼示例
- Python scipy.ndimage.convolve1d用法及代碼示例
- Python scipy.stats.arcsine用法及代碼示例
- Python scipy.interpolate.UnivariateSpline.antiderivative用法及代碼示例
- Python scipy.linalg.hadamard用法及代碼示例
- Python socket.create_server用法及代碼示例
- Python sklearn.linear_model.PassiveAggressiveRegressor用法及代碼示例
注:本文由純淨天空篩選整理自tableau.github.io大神的英文原創作品 subscription.create。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。