schedules
Creates, updates, deletes, gets or lists a schedules resource.
Overview
| Name | schedules |
| Type | Resource |
| Id | datadog.fleet.schedules |
Fields
The following fields are returned by SELECT queries:
- get_fleet_schedule_v2
- list_fleet_schedules_v2
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the schedule. (example: abc-def-ghi-123) |
attributes | object | Attributes of a fleet schedule in the v2 API response. |
type | string | The type of schedule resource. (schedule) (default: schedule, example: schedule) |
| Name | Datatype | Description |
|---|---|---|
id | string | Unique identifier for the schedule. (example: abc-def-ghi-123) |
attributes | object | Attributes of a fleet schedule in the v2 API response. |
type | string | The type of schedule resource. (schedule) (default: schedule, example: schedule) |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_fleet_schedule_v2 | select | id | Retrieve detailed information about a specific schedule by its unique identifier. | |
list_fleet_schedules_v2 | select | Retrieve 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_schedule | insert | data | 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. | |
update_fleet_schedule | update | id, data | 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. | |
delete_fleet_schedule | delete | id | 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. | |
trigger_fleet_schedule | exec | id | 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. |
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.
| Name | Datatype | Description |
|---|---|---|
id | string | The unique identifier of the schedule to trigger. (example: abc-def-ghi-123) |
site | string | The 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
- get_fleet_schedule_v2
- list_fleet_schedules_v2
Retrieve detailed information about a specific schedule by its unique identifier.
SELECT
id,
attributes,
type
FROM datadog.fleet.schedules
WHERE id = '{{ id }}' -- required
;
Retrieve 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.
SELECT
id,
attributes,
type
FROM datadog.fleet.schedules
;
INSERT examples
- create_fleet_schedule
- Manifest
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
;
# Description fields are for documentation purposes
- name: schedules
props:
- name: data
description: |
Data for creating a new schedule.
value:
attributes:
name: "{{ name }}"
query: "{{ query }}"
rule:
days_of_week:
- "{{ days_of_week }}"
maintenance_window_duration: {{ maintenance_window_duration }}
start_maintenance_window: "{{ start_maintenance_window }}"
timezone: "{{ timezone }}"
status: "{{ status }}"
version_to_latest: {{ version_to_latest }}
type: "{{ type }}"
UPDATE examples
- update_fleet_schedule
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_fleet_schedule
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.
- trigger_fleet_schedule
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
;