@@ -2747,7 +2747,7 @@ REST API: [Create Schedule](https://help.tableau.com/current/api/rest_api/en-us/
2747
2747
2748
2748
Name | Description
2749
2749
:--- | :---
2750
- ` schedule_item ` | The settings for the schedule that you want to create. You need to create an instance of ` schedule_item ` and pass it to the ` create ` method. The ` schedule_item ` includes the ` interval_item ` which specifies the frequency, or interval, that the schedule should run. See ` ScheduleItem ` and ` IntervalItem ` .
2750
+ ` schedule_item ` | The settings for the schedule that you want to create. You need to create an instance of ` ScheduleItem ` and pass it to the ` create ` method. The ` ScheduleItem ` includes the ` IntervalItem ` which specifies the frequency, or interval, that the schedule should run.
2751
2751
2752
2752
2753
2753
** Returns**
@@ -2765,15 +2765,21 @@ Error | Description
2765
2765
2766
2766
``` py
2767
2767
import tableauserverclient as TSC
2768
+ from datetime import time
2769
+
2768
2770
# sign in, etc.
2769
- # Create an interval to run every 2 hours between 2:30AM and 11:00PM
2770
- hourly_interval = TSC .HourlyInterval(start_time = time(2 , 30 ),
2771
- end_time = time(23 , 0 ),
2772
- interval_value = 2 )
2773
- # Create schedule item
2774
- hourly_schedule = TSC .ScheduleItem(" Hourly-Schedule" , 50 , TSC .ScheduleItem.Type.Extract, TSC .ScheduleItem.ExecutionOrder.Parallel, hourly_interval)
2775
- # Create schedule
2776
- hourly_schedule = server.schedules.create(hourly_schedule)
2771
+ # Create an interval to run every 2 hours between 2:30AM and 11:00PM
2772
+ hourly_interval = TSC .HourlyInterval(start_time = time(2 , 30 ),
2773
+ end_time = time(23 , 0 ),
2774
+ interval_value = 2 )
2775
+ # Create schedule item
2776
+ hourly_schedule = TSC .ScheduleItem(" Hourly-Schedule" ,
2777
+ 50 ,
2778
+ TSC .ScheduleItem.Type.Extract,
2779
+ TSC .ScheduleItem.ExecutionOrder.Parallel,
2780
+ hourly_interval)
2781
+ # Create schedule
2782
+ hourly_schedule = server.schedules.create(hourly_schedule)
2777
2783
```
2778
2784
<br >
2779
2785
<br >
@@ -2813,7 +2819,7 @@ Error | Description
2813
2819
#### schedules.get
2814
2820
2815
2821
``` py
2816
- schedules.get([req_options= None ] )
2822
+ schedules.get()
2817
2823
```
2818
2824
2819
2825
Returns all schedule items from the server.
@@ -2822,6 +2828,18 @@ Returns all schedule items from the server.
2822
2828
REST API: [ Query Schedules] ( https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#query_schedules )
2823
2829
2824
2830
2831
+ #### schedules.get_by_id
2832
+
2833
+ ``` py
2834
+ schedules.get_by_id(schedule_id)
2835
+ ```
2836
+
2837
+ Returns the specified schedule.
2838
+
2839
+
2840
+ REST API: [ Get Schedule] ( https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#get-schedule )
2841
+
2842
+
2825
2843
2826
2844
** Parameters**
2827
2845
@@ -2831,68 +2849,101 @@ Name | Description
2831
2849
2832
2850
#### schedules.update
2833
2851
2852
+ ``` py
2853
+ schedules.update(schedule_item)
2854
+ ```
2855
+
2856
+ ** Parameters**
2857
+
2858
+ Name | Description
2859
+ :--- | :---
2860
+ ` schedule_item ` | The settings for the schedule that you want to update. You need to fetch an existing instance of ` ScheduleItem ` from the ` get ` method, make your changes, and then pass it to the ` update ` method to update the schedule on the server. The ` ScheduleItem ` includes the ` IntervalItem ` which specifies the frequency, or interval, that the schedule should run.
2861
+
2862
+
2863
+ REST API: [ Update Schedules] ( https://help.tableau.com/current/api/rest_api/en-us/REST/rest_api_ref.htm#update_schedule )
2864
+
2834
2865
<br >
2835
2866
<br >
2836
2867
2837
2868
2838
2869
** Hourly schedule example**
2839
2870
``` py
2840
2871
import tableauserverclient as TSC
2872
+ from datetime import time
2841
2873
# sign in, etc.
2842
- # Create an interval to run every 2 hours between 2:30AM and 11:00PM
2843
- hourly_interval = TSC .HourlyInterval(start_time = time(2 , 30 ),
2844
- end_time = time(23 , 0 ),
2845
- interval_value = 2 )
2846
- # Create schedule item
2847
- hourly_schedule = TSC .ScheduleItem(" Hourly-Schedule" , 50 , TSC .ScheduleItem.Type.Extract, TSC .ScheduleItem.ExecutionOrder.Parallel, hourly_interval)
2848
- # Create schedule
2849
- hourly_schedule = server.schedules.create(hourly_schedule)
2874
+
2875
+ # Create an interval to run every 2 hours between 2:30AM and 11:00PM
2876
+ hourly_interval = TSC .HourlyInterval(start_time = time(2 , 30 ),
2877
+ end_time = time(23 , 0 ),
2878
+ interval_value = 2 )
2879
+
2880
+ # Create schedule item
2881
+ hourly_schedule = TSC .ScheduleItem(" Hourly-Schedule" ,
2882
+ 50 ,
2883
+ TSC .ScheduleItem.Type.Extract,
2884
+ TSC .ScheduleItem.ExecutionOrder.Parallel,
2885
+ hourly_interval)
2886
+
2887
+ # Create schedule
2888
+ hourly_schedule = server.schedules.create(hourly_schedule)
2850
2889
```
2851
2890
2852
2891
** Daily schedule example**
2853
2892
``` py
2854
2893
import tableauserverclient as TSC
2894
+ from datetime import time
2855
2895
# sign in, etc.
2856
- # Create a daily interval to run every day at 12:30AM
2857
- Daily_interval = TSC .DailyInterval(start_time = time(0 , 30 ))
2858
- # Create schedule item using daily interval
2859
- daily_schedule = TSC .ScheduleItem(" Daily-Schedule" , 60 , TSC .ScheduleItem.Type.Subscription, TSC .ScheduleItem.ExecutionOrder.Serial, daily_interval)
2860
- # Create daily schedule
2861
- daily_schedule = server.schedules.create(daily_schedule)
2862
2896
2897
+ # Create a daily interval to run every day at 12:30AM
2898
+ daily_interval = TSC .DailyInterval(start_time = time(0 , 30 ))
2899
+
2900
+ # Create schedule item using daily interval
2901
+ daily_schedule = TSC .ScheduleItem(" Daily-Schedule" ,
2902
+ 60 ,
2903
+ TSC .ScheduleItem.Type.Subscription,
2904
+ TSC .ScheduleItem.ExecutionOrder.Serial,
2905
+ daily_interval)
2906
+
2907
+ # Create daily schedule
2908
+ daily_schedule = server.schedules.create(daily_schedule)
2863
2909
```
2864
2910
2865
2911
** Weekly schedule example**
2866
2912
``` py
2867
2913
import tableauserverclient as TSC
2914
+ from datetime import time
2868
2915
# sign in, etc.
2869
- # Create a weekly interval to run every Monday, Wednesday, and Friday at 7:15PM
2870
- weekly_interval = TSC .WeeklyInterval(time(19 , 15 ),
2871
- TSC .IntervalItem.Day.Monday,
2872
- TSC .IntervalItem.Day.Wednesday,
2873
- TSC .IntervalItem.Day.Friday)
2874
- # Create schedule item using weekly interval
2875
- weekly_schedule = TSC .ScheduleItem(" Weekly-Schedule" , 70 ,
2876
- TSC .ScheduleItem.Type.Extract,
2877
- TSC .ScheduleItem.ExecutionOrder.Serial, weekly_interval)
2878
- # Create weekly schedule
2879
- weekly_schedule = server.schedules.create(weekly_schedule)
2880
2916
2917
+ # Create a weekly interval to run every Monday, Wednesday, and Friday at 7:15PM
2918
+ weekly_interval = TSC .WeeklyInterval(time(19 , 15 ),
2919
+ TSC .IntervalItem.Day.Monday,
2920
+ TSC .IntervalItem.Day.Wednesday,
2921
+ TSC .IntervalItem.Day.Friday)
2922
+ # Create schedule item using weekly interval
2923
+ weekly_schedule = TSC .ScheduleItem(" Weekly-Schedule" , 70 ,
2924
+ TSC .ScheduleItem.Type.Extract,
2925
+ TSC .ScheduleItem.ExecutionOrder.Serial,
2926
+ weekly_interval)
2927
+ # Create weekly schedule
2928
+ weekly_schedule = server.schedules.create(weekly_schedule)
2881
2929
```
2882
2930
2883
2931
** Monthly schedule example**
2884
2932
``` py
2885
2933
import tableauserverclient as TSC
2934
+ from datetime import time
2886
2935
# sign in, etc.
2887
- # Create a monthly interval to run on the 15th of every month at 11:30PM
2888
- monthly_interval = TSC .MonthlyInterval(start_time = time(23 , 30 ),
2889
- interval_value = 15 )
2890
- # Create schedule item using monthly interval
2891
- monthly_schedule = TSC .ScheduleItem(" Monthly-Schedule" , 80 ,
2892
- TSC .ScheduleItem.Type.Subscription
2893
- TSC .ScheduleItem.ExecutionOrder.Parallel, monthly_interval)
2894
- # Create monthly schedule
2895
- monthly_schedule = server.schedules.create(monthly_schedule)
2936
+
2937
+ # Create a monthly interval to run on the 15th of every month at 11:30PM
2938
+ monthly_interval = TSC .MonthlyInterval(start_time = time(23 , 30 ),
2939
+ interval_value = 15 )
2940
+ # Create schedule item using monthly interval
2941
+ monthly_schedule = TSC .ScheduleItem(" Monthly-Schedule" ,
2942
+ 80 ,
2943
+ TSC .ScheduleItem.Type.Subscription
2944
+ TSC .ScheduleItem.ExecutionOrder.Parallel, monthly_interval)
2945
+ # Create monthly schedule
2946
+ monthly_schedule = server.schedules.create(monthly_schedule)
2896
2947
```
2897
2948
2898
2949
0 commit comments