Folder#
A Folder organizes dashboards within a project using a tree of folder and dashboard references.
It is defined as follows:
See the next sections for details about the folder specification and API endpoints.
Folder specification#
# Optional display name shown in the UI instead of metadata.name
display:
name: <string> # Optional
# Ordered tree of dashboards and subfolders
items:
- <FolderItem specification> # Optional
FolderItem specification#
Each item in spec.items describes either a subfolder or a dashboard reference:
# kind must be "Folder" or "Dashboard"
kind: <string>
# When kind is "Dashboard", name is the dashboard metadata.name in the same project.
# When kind is "Folder", name is the subfolder label in the tree.
name: <string>
# Nested items. Allowed only when kind is "Folder".
items:
- <FolderItem specification> # Optional
Validation rules#
When creating or updating a folder, Perses validates the tree:
- Each dashboard referenced in
spec.itemscan appear only once in that folder resource. - The same dashboard can be referenced in different folder resources within the same project.
- A
Dashboarditem cannot contain nesteditems. - Every item must have a non-empty
name. - Each item
kindmust beFolderorDashboard.
Example#
kind: "Folder"
metadata:
name: "platform"
project: "my-team"
spec:
display:
name: "Platform Monitoring"
items:
- kind: "Folder"
name: "kubernetes"
items:
- kind: "Dashboard"
name: "cluster-overview"
- kind: "Dashboard"
name: "global-health"
API definition#
Get a list of Folder#
You can also list folders across projects:
URL query parameters:
name=<string>: filters folders based onmetadata.name(prefix match).project=<string>: filters folders by project (available onGET /api/v1/folders).metadata_only=<boolean>: whentrue, returns only folder metadata without the fullspec.
Get a single Folder#
Create a single Folder#
You can also create a folder by posting to the global folders endpoint when metadata.project is set in the body:
Update a single Folder#
Delete a single Folder#
Deleting a folder removes the folder resource only. Referenced dashboards are not deleted.