tableau / server-client-python

A Python library for the Tableau Server REST API
https://tableau.github.io/server-client-python/
MIT License
655 stars 420 forks source link

[Type 1] Implement Tableau Cloud-specific requests for the Subscriptions endpoint #1373

Open zozi0406 opened 4 months ago

zozi0406 commented 4 months ago

Description:

The Subscriptions endpoint works somewhat differently for Tableau Cloud & Tableau Server, in that the subscription schedule needs to be defined as part of the request for Tableau Cloud. As of now, TSC only supports the request format for the Server endpoint, where a schedule id needs to be provided. This feature would implement the Tableau Cloud request format alongside the Tableau Server format. The subscriptions REST API documentation: https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref_subscriptions.htm#tableau-cloud-request

A "quick-and-dirty" implementation could allow the user to specify in the SubscriptionItem definition that instead of schedule_id, they'd like to set all the Tableau Cloud-specific fields. However, if it is expected that more API methods will have Tableau Server & Cloud versions, it could be beneficial to automatically detect Tableau Cloud vs Tableau Server during the construction of the Server object and pick the correct endpoint specs accordingly. TSC doesn't currently seem to have a way to distinguish between requests made to Tableau Cloud & Tableau Server, so this would need to be added first, potentially by checking the server URL for (online.tableau.com).