Retrieve a list of all schedules for automated fleet deployments.
Schedules allow you to automate package upgrades by defining maintenance windows
and recurrence rules. Each schedule automatically creates deployments based on its
configuration.
Unix timestamp (seconds since epoch) when the schedule was created.
created_by
string
User handle of the person who created the schedule.
name
string
Human-readable name for the schedule.
query
string
Query used to filter and select target hosts for scheduled deployments. Uses the Datadog query syntax.
rule
object
Defines the recurrence pattern for the schedule. Specifies when deployments should be
automatically triggered based on maintenance windows.
days_of_week [required]
[string]
List of days of the week when the schedule should trigger. Valid values are:
"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun".
maintenance_window_duration [required]
int64
Duration of the maintenance window in minutes.
start_maintenance_window [required]
string
Start time of the maintenance window in 24-hour clock format (HH:MM).
Deployments will be triggered at this time on the specified days.
timezone [required]
string
Timezone for the schedule in IANA Time Zone Database format (e.g., "America/New_York", "UTC").
status
enum
The status of the schedule.
active: The schedule is active and will create deployments according to its recurrence rule.
inactive: The schedule is inactive and will not create any deployments.
Allowed enum values: active,inactive
updated_at_unix
int64
Unix timestamp (seconds since epoch) when the schedule was last updated.
updated_by
string
User handle of the person who last updated the schedule.
version_to_latest
int64
Number of major versions behind the latest to target for upgrades.
0: Always upgrade to the latest version
1: Upgrade to latest minus 1 major version
2: Upgrade to latest minus 2 major versions
Maximum value is 2.
id [required]
string
Unique identifier for the schedule.
type [required]
enum
The type of schedule resource.
Allowed enum values: schedule
default: schedule
{"data":[{"attributes":{"created_at_unix":1699999999,"created_by":"user@example.com","name":"Weekly Production Agent Updates","query":"env:prod AND service:web","rule":{"days_of_week":["Mon","Wed","Fri"],"maintenance_window_duration":1200,"start_maintenance_window":"02:00","timezone":"America/New_York"},"status":"active","updated_at_unix":1699999999,"updated_by":"user@example.com","version_to_latest":0},"id":"abc-def-ghi-123","type":"schedule"}]}
"""
List all schedules returns "OK" response
"""fromdatadog_api_clientimportApiClient,Configurationfromdatadog_api_client.v2.api.fleet_automation_apiimportFleetAutomationApiconfiguration=Configuration()configuration.unstable_operations["list_fleet_schedules"]=TruewithApiClient(configuration)asapi_client:api_instance=FleetAutomationApi(api_client)response=api_instance.list_fleet_schedules()print(response)
# List all schedules returns "OK" responserequire"datadog_api_client"DatadogAPIClient.configuredo|config|config.unstable_operations["v2.list_fleet_schedules".to_sym]=trueendapi_instance=DatadogAPIClient::V2::FleetAutomationAPI.newpapi_instance.list_fleet_schedules()
// List all schedules returns "OK" responsepackagemainimport("context""encoding/json""fmt""os""github.com/DataDog/datadog-api-client-go/v2/api/datadog""github.com/DataDog/datadog-api-client-go/v2/api/datadogV2")funcmain(){ctx:=datadog.NewDefaultContext(context.Background())configuration:=datadog.NewConfiguration()configuration.SetUnstableOperationEnabled("v2.ListFleetSchedules",true)apiClient:=datadog.NewAPIClient(configuration)api:=datadogV2.NewFleetAutomationApi(apiClient)resp,r,err:=api.ListFleetSchedules(ctx)iferr!=nil{fmt.Fprintf(os.Stderr,"Error when calling `FleetAutomationApi.ListFleetSchedules`: %v\n",err)fmt.Fprintf(os.Stderr,"Full HTTP response: %v\n",r)}responseContent,_:=json.MarshalIndent(resp,""," ")fmt.Fprintf(os.Stdout,"Response from `FleetAutomationApi.ListFleetSchedules`:\n%s\n",responseContent)}
// List all schedules returns "OK" responseimportcom.datadog.api.client.ApiClient;importcom.datadog.api.client.ApiException;importcom.datadog.api.client.v2.api.FleetAutomationApi;importcom.datadog.api.client.v2.model.FleetSchedulesResponse;publicclassExample{publicstaticvoidmain(String[]args){ApiClientdefaultClient=ApiClient.getDefaultApiClient();defaultClient.setUnstableOperationEnabled("v2.listFleetSchedules",true);FleetAutomationApiapiInstance=newFleetAutomationApi(defaultClient);try{FleetSchedulesResponseresult=apiInstance.listFleetSchedules();System.out.println(result);}catch(ApiExceptione){System.err.println("Exception when calling FleetAutomationApi#listFleetSchedules");System.err.println("Status code: "+e.getCode());System.err.println("Reason: "+e.getResponseBody());System.err.println("Response headers: "+e.getResponseHeaders());e.printStackTrace();}}}
// List all schedules returns "OK" response
usedatadog_api_client::datadog;usedatadog_api_client::datadogV2::api_fleet_automation::FleetAutomationAPI;#[tokio::main]asyncfnmain(){letmutconfiguration=datadog::Configuration::new();configuration.set_unstable_operation_enabled("v2.ListFleetSchedules",true);letapi=FleetAutomationAPI::with_config(configuration);letresp=api.list_fleet_schedules().await;ifletOk(value)=resp{println!("{:#?}",value);}else{println!("{:#?}",resp.unwrap_err());}}
DD_SITE="datadoghq.comus3.datadoghq.comus5.datadoghq.comdatadoghq.euap1.datadoghq.comap2.datadoghq.comddog-gov.comus2.ddog-gov.com"DD_API_KEY="<DD_API_KEY>"DD_APP_KEY="<DD_APP_KEY>"cargo run
/**
* List all schedules returns "OK" response
*/import{client,v2}from"@datadog/datadog-api-client";constconfiguration=client.createConfiguration();configuration.unstableOperations["v2.listFleetSchedules"]=true;constapiInstance=newv2.FleetAutomationApi(configuration);apiInstance.listFleetSchedules().then((data: v2.FleetSchedulesResponse)=>{console.log("API called successfully. Returned data: "+JSON.stringify(data));}).catch((error: any)=>console.error(error));