Skip to main content

schedules

Creates, updates, deletes, gets or lists a schedules resource.

Overview

Nameschedules
TypeResource
Iddatadog.fleet.schedules

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
idstringUnique identifier for the schedule. (example: abc-def-ghi-123)
attributesobjectAttributes of a fleet schedule in the v2 API response.
typestringThe type of schedule resource. (schedule) (default: schedule, example: schedule)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_fleet_schedule_v2selectidRetrieve detailed information about a specific schedule by its unique identifier.
list_fleet_schedules_v2selectRetrieve all upgrade schedules for the organization.<br /><br />Schedules automate package upgrades by defining maintenance windows and recurrence rules.<br />Each schedule automatically creates deployments based on its configuration.
create_fleet_scheduleinsertdataCreate a new schedule for automated package upgrades.<br /><br />Schedules define when and how often to automatically deploy package upgrades to a fleet<br />of hosts. Each schedule includes:<br />- A filter query to select target hosts<br />- A recurrence rule defining maintenance windows<br />- A version strategy (e.g., always latest, or N versions behind latest)<br /><br />When the schedule triggers during a maintenance window, it automatically creates a<br />deployment that upgrades the Datadog Agent to the specified version on all matching hosts.
update_fleet_scheduleupdateid, dataPartially update a schedule by providing only the fields you want to change.<br /><br />This endpoint allows you to modify specific attributes of a schedule without<br />affecting other fields. Common use cases include:<br />- Changing the schedule status between active and inactive<br />- Updating the maintenance window times<br />- Modifying the filter query to target different hosts<br />- Adjusting the version strategy<br /><br />Only include the fields you want to update in the request body. All fields<br />are optional in a PATCH request.
delete_fleet_scheduledeleteidDelete a schedule permanently.<br /><br />When you delete a schedule:<br />- The schedule is permanently removed and will no longer create deployments<br />- Any deployments already created by this schedule are not affected<br />- This action cannot be undone<br /><br />If you want to temporarily stop a schedule from creating deployments, consider<br />updating its status to "inactive" instead of deleting it.
trigger_fleet_scheduleexecidManually trigger a schedule to immediately create and start a deployment.<br /><br />This endpoint allows you to manually initiate a deployment using the schedule's<br />configuration, without waiting for the next scheduled maintenance window. This is<br />useful for:<br />- Testing a schedule before it runs automatically<br />- Performing an emergency update outside the regular maintenance window<br />- Creating an ad-hoc deployment with the same settings as a schedule<br /><br />The deployment is created immediately with:<br />- The same filter query as the schedule<br />- The package version determined by the schedule's version strategy<br />- All matching hosts as targets<br /><br />The manually triggered deployment is independent of the schedule and does not<br />affect the schedule's normal recurrence pattern.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
idstringThe unique identifier of the schedule to trigger. (example: abc-def-ghi-123)
sitestringThe Datadog site (region) for your organization, for example datadoghq.com, us3.datadoghq.com, us5.datadoghq.com, ap1.datadoghq.com, ap2.datadoghq.com, datadoghq.eu, ddog-gov.com. Resolved from the DD_SITE environment variable when set. Optional: defaults to datadoghq.com, or the value of the DD_SITE environment variable when set; a WHERE value overrides both.

SELECT examples

Retrieve detailed information about a specific schedule by its unique identifier.

SELECT
id,
attributes,
type
FROM datadog.fleet.schedules
WHERE id = '{{ id }}' -- required
;

INSERT examples

Create a new schedule for automated package upgrades.<br /><br />Schedules define when and how often to automatically deploy package upgrades to a fleet<br />of hosts. Each schedule includes:<br />- A filter query to select target hosts<br />- A recurrence rule defining maintenance windows<br />- A version strategy (e.g., always latest, or N versions behind latest)<br /><br />When the schedule triggers during a maintenance window, it automatically creates a<br />deployment that upgrades the Datadog Agent to the specified version on all matching hosts.

INSERT INTO datadog.fleet.schedules (
data
)
SELECT
'{{ data }}' /* required */
RETURNING
data
;

UPDATE examples

Partially update a schedule by providing only the fields you want to change.<br /><br />This endpoint allows you to modify specific attributes of a schedule without<br />affecting other fields. Common use cases include:<br />- Changing the schedule status between active and inactive<br />- Updating the maintenance window times<br />- Modifying the filter query to target different hosts<br />- Adjusting the version strategy<br /><br />Only include the fields you want to update in the request body. All fields<br />are optional in a PATCH request.

UPDATE datadog.fleet.schedules
SET
data = '{{ data }}'
WHERE
id = '{{ id }}' --required
AND data = '{{ data }}' --required
RETURNING
data;

DELETE examples

Delete a schedule permanently.<br /><br />When you delete a schedule:<br />- The schedule is permanently removed and will no longer create deployments<br />- Any deployments already created by this schedule are not affected<br />- This action cannot be undone<br /><br />If you want to temporarily stop a schedule from creating deployments, consider<br />updating its status to "inactive" instead of deleting it.

DELETE FROM datadog.fleet.schedules
WHERE id = '{{ id }}' --required
;

Lifecycle Methods

EXEC variables use wire (API) names.

Manually trigger a schedule to immediately create and start a deployment.<br /><br />This endpoint allows you to manually initiate a deployment using the schedule's<br />configuration, without waiting for the next scheduled maintenance window. This is<br />useful for:<br />- Testing a schedule before it runs automatically<br />- Performing an emergency update outside the regular maintenance window<br />- Creating an ad-hoc deployment with the same settings as a schedule<br /><br />The deployment is created immediately with:<br />- The same filter query as the schedule<br />- The package version determined by the schedule's version strategy<br />- All matching hosts as targets<br /><br />The manually triggered deployment is independent of the schedule and does not<br />affect the schedule's normal recurrence pattern.

EXEC datadog.fleet.schedules.trigger_fleet_schedule
@id='{{ id }}' --required
;