• /
  • EnglishEspañolFrançais日本語한국어Português
  • Se connecterDémarrer

NerdGraph tutorial: Manage service level maintenance windows

Create a maintenance window

Use the maintenanceWindowCreate mutation to create a new maintenance window for your service levels.

Parameters

ParameterData typeDescription
nameString(Required) The name of the maintenance window.
descriptionString(Optional) A description of the maintenance window.
scopeScopedReferenceInput(Required) The scope the maintenance window belongs to. Contains id (the account ID) and type (the entity scope — use ACCOUNT for service level maintenance windows).
startTimeNaiveDateTime(Required) The start time of the maintenance window in ISO 8601 format. This time should be interpreted in the timezone specified in the timezone parameter.
durationDuration(Required) The duration of the maintenance window in ISO 8601 duration format (for example, PT2H for 2 hours, PT30M for 30 minutes).
rruleString(Optional) The recurrence rule of the maintenance window in iCalendar format (RFC 5545). Use this to create recurring maintenance windows.
timezoneString(Required) The timezone of the maintenance window (for example, America/New_York, Europe/London).
affectedEntityTypeString(Required) The type of the affected entities. Use SERVICE_LEVEL for service level maintenance windows.
affectedEntities[ID](Optional) The list of entity GUIDs affected by the maintenance window.

Sample mutation

mutation {
maintenanceWindowCreate(
maintenanceWindow: {
name: "Monthly System Upgrade"
description: "Scheduled maintenance for system upgrades"
scope: { id: "INSERT_YOUR_ACCOUNT_ID", type: ACCOUNT }
startTime: "2025-12-15T02:00:00"
duration: "PT4H"
rrule: "FREQ=MONTHLY;BYMONTHDAY=15"
timezone: "America/New_York"
affectedEntityType: "SERVICE_LEVEL"
affectedEntities: ["INSERT_ENTITY_GUID_1", "INSERT_ENTITY_GUID_2"]
}
) {
id
name
description
startTime
duration
rrule
timezone
affectedEntityType
affectedEntities
}
}

Update a maintenance window

Use the maintenanceWindowUpdate mutation to update an existing maintenance window.

Parameters

ParameterData typeDescription
idID(Required) The unique identifier of the maintenance window to update.
nameString(Optional) The new name of the maintenance window.
descriptionString(Optional) The new description of the maintenance window.
startTimeNaiveDateTime(Optional) The new start time in ISO 8601 format.
durationDuration(Optional) The new duration in ISO 8601 duration format.
rruleString(Optional) The new recurrence rule in iCalendar format.
timezoneString(Optional) The new timezone.
affectedEntities[ID](Optional) The new list of entity GUIDs affected by the maintenance window.

Sample mutation

mutation {
maintenanceWindowUpdate(
id: "INSERT_MAINTENANCE_WINDOW_ID"
maintenanceWindow: {
name: "Updated System Upgrade Window"
duration: "PT6H"
affectedEntities: [
"INSERT_ENTITY_GUID_1"
"INSERT_ENTITY_GUID_2"
"INSERT_ENTITY_GUID_3"
]
}
) {
id
name
description
startTime
duration
rrule
timezone
affectedEntityType
affectedEntities
}
}

Delete a maintenance window

Use the maintenanceWindowDelete mutation to delete a maintenance window.

Sample mutation

mutation {
maintenanceWindowDelete(id: "INSERT_MAINTENANCE_WINDOW_ID") {
id
name
}
}

Query maintenance windows by IDs

Use the listByIds query to retrieve specific maintenance windows by their IDs.

Sample query

query {
actor {
maintenanceWindow {
listByIds(
ids: [
"INSERT_MAINTENANCE_WINDOW_ID_1"
"INSERT_MAINTENANCE_WINDOW_ID_2"
]
) {
maintenanceWindows {
id
name
description
startTime
duration
rrule
timezone
affectedEntityType
affectedEntities
scope {
id
type
}
metadata {
createdAt
createdBy
updatedAt
updatedBy
}
}
}
}
}
}

Query maintenance windows by affected entity

Use the listByAffectedEntityId query to retrieve all maintenance windows that affect a specific entity.

Sample query

query {
actor {
maintenanceWindow {
listByAffectedEntityId(affectedEntityId: "INSERT_ENTITY_GUID") {
maintenanceWindows {
id
name
description
startTime
duration
rrule
timezone
affectedEntityType
affectedEntities
}
}
}
}
}

Service level maintenance windows

Learn what maintenance windows are and how they work.

Schedule and manage maintenance windows

Learn how to create, edit, and delete maintenance windows in the UI.

NerdGraph tutorial: Configure service levels

Learn how to create and manage SLIs and SLOs with NerdGraph.

Droits d'auteur © 2026 New Relic Inc.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.