dashboard.new(name, dashboardObject, folderResource)
PARAMETERS:
- name (
string
) - dashboardObject (
object
) - folderResource (
object
)
new
creates a dashboard.
name
is the Kubernetes object namedashboardObject
is the actual JSON object of the dashboardfolderResource
can be created byfolder.new()
datasource.new(name, type)
PARAMETERS:
- name (
string
) - type (
string
)
new
configures a datasource.
datasource.withBasicAuth(username)
PARAMETERS:
- username (
string
)
withBasicAuth
enables basic authentication for the data source, not that this'll likely expect secret referenced with withSecureJsonDataSecretRef()
that has a key basicAuthPassword
.
datasource.withExternalName(externalName)
PARAMETERS:
- externalName (
string
)
withExternalName
can be used to import an existing datasource.
datasource.withJsonData(configObject)
PARAMETERS:
- configObject (
object
)
withJsonData
configures options for the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
datasource.withSecureJsonDataSecretRef(name, namespace, key)
PARAMETERS:
- name (
string
) - namespace (
string
) - key (
string
)
withSecureJsonDataSecretRef
references a secret that configures sensitive options for the data source. To figure out what options a datasource has available, see its docs or inspect the network data when saving it from the Grafana UI. Note that keys in this map are usually camelCased.
folder.new(title)
PARAMETERS:
- title (
string
)
new
creates a folder.
folder.withDestroyIfNotEmpty(value=true)
PARAMETERS:
- value (
bool
)- default value:
true
- default value:
withDestroyIfNotEmpty
will turn off the protection that prevents a folder from being deleted when it still has dashboards in it. Turning it off will remove the folder regardless if it still contains dashboards.
folder.withExternalName(externalName)
PARAMETERS:
- externalName (
string
)
withExternalName
can be used to import an existing folder, it can be either a UID or a numeric ID.
folder.withName(name)
PARAMETERS:
- name (
string
)
withName
sets Kubernetes object name
folder.withParentFolder(folderResource)
PARAMETERS:
- folderResource (
object
)
withParentFolder
sets the parent folder. folderResource
can be created by folder.new()
folder.withTitle(title)
PARAMETERS:
- title (
string
)
withTitle
sets the human readable title in the UI
folder.withUid(uid)
PARAMETERS:
- uid (
string
)
withUid
sets the identifier visible in the URL
folderPermission.forFolder(folderResource)
PARAMETERS:
- folderResource (
object
)
forFolder
configures the permission for a folder. folderResource
can be created by folder.new()
.
folderPermission.withPermissions(permissions)
PARAMETERS:
- permissions (
array
)
withPermissions
sets the permission items to add/update. Items that are omitted from the list will be removed.
folderPermission.withPermissionsMixin(permissions)
PARAMETERS:
- permissions (
array
)
withPermissionsMixin
adds permission items to add/update. Items that are omitted from the list will be removed.
folderPermission.withTeamPermission(permissions)
PARAMETERS:
- permissions (
array
)
withTeamPermission
adds the permission for a team resource to a folder. teamResource
can be created by team.new()
team.new(name)
PARAMETERS:
- name (
string
)
new
creates a team.
team.withExternalName(externalName)
PARAMETERS:
- externalName (
string
)
withExternalName
can be used to import an existing team.
team.withMembers(members)
PARAMETERS:
- members (
array
)
withMembers
configures the team members, it expects a set of email addresses corresponding to users who should be given membership to the team.
Note: users specified here must already exist in Grafana.