UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

148 lines (147 loc) 6.74 kB
import * as pulumi from "@pulumi/pulumi"; /** * Manages a Grafana Assistant quickstart prompt shown to users. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const example = new grafana.assistant.Quickstart("example", { * scope: "tenant", * title: "SLO health", * prompt: "How healthy are my SLOs right now?", * }); * // A quickstart with a context item pre-attached. `context_items` is a * // JSON-encoded array of Assistant `ChatContextItem` objects. The example below * // attaches a Prometheus data source so the Assistant starts the conversation * // with that data source already in context. * // * // This is an advanced, internal-format field. The most reliable way to obtain a * // valid value is to create the quickstart with the desired context through the * // Assistant UI and copy the resulting `contextItems` JSON into `jsonencode(...)`. * const withContext = new grafana.assistant.Quickstart("with_context", { * scope: "tenant", * title: "Investigate Prometheus alerts", * prompt: "Which alerts are firing right now and why?", * contextItems: JSON.stringify([{ * node: { * id: "prometheus-uid", * name: "Prometheus", * icon: "database", * data: { * type: "datasource", * data: { * name: "Prometheus", * uid: "prometheus-uid", * type: "prometheus", * text: "Prometheus", * }, * }, * }, * }]), * }); * ``` * * ## Import * * ```sh * terraform import grafana_assistant_quickstart.name "{{ id }}" * ``` */ export declare class Quickstart extends pulumi.CustomResource { /** * Get an existing Quickstart resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: QuickstartState, opts?: pulumi.CustomResourceOptions): Quickstart; /** * Returns true if the given object is an instance of Quickstart. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Quickstart; /** * Optional JSON-encoded array of context items pre-attached to the quickstart. Each element is an Assistant `ChatContextItem`; only `node.id`, `node.name`, and `node.data` (`{"type": ..., "data": {...}}`) are required, e.g. `{"node": {"id": ..., "name": ..., "data": {"type": ..., "data": {...}}}}`. This is an advanced, internal-format field. The most reliable way to produce a valid value is to create a quickstart with the desired context through the Assistant UI, then copy the resulting `contextItems` JSON. Omit this field if no pre-attached context is needed. See the example for a typical datasource context item. */ readonly contextItems: pulumi.Output<string | undefined>; /** * Whether the resource is enabled. */ readonly enabled: pulumi.Output<boolean>; /** * The quickstart question text. */ readonly prompt: pulumi.Output<string>; /** * Whether the resource is visible to the whole tenant (`tenant`) or only the creating user (`user`). */ readonly scope: pulumi.Output<string>; /** * Optional title for the quickstart. */ readonly title: pulumi.Output<string | undefined>; /** * Create a Quickstart resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: QuickstartArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Quickstart resources. */ export interface QuickstartState { /** * Optional JSON-encoded array of context items pre-attached to the quickstart. Each element is an Assistant `ChatContextItem`; only `node.id`, `node.name`, and `node.data` (`{"type": ..., "data": {...}}`) are required, e.g. `{"node": {"id": ..., "name": ..., "data": {"type": ..., "data": {...}}}}`. This is an advanced, internal-format field. The most reliable way to produce a valid value is to create a quickstart with the desired context through the Assistant UI, then copy the resulting `contextItems` JSON. Omit this field if no pre-attached context is needed. See the example for a typical datasource context item. */ contextItems?: pulumi.Input<string>; /** * Whether the resource is enabled. */ enabled?: pulumi.Input<boolean>; /** * The quickstart question text. */ prompt?: pulumi.Input<string>; /** * Whether the resource is visible to the whole tenant (`tenant`) or only the creating user (`user`). */ scope?: pulumi.Input<string>; /** * Optional title for the quickstart. */ title?: pulumi.Input<string>; } /** * The set of arguments for constructing a Quickstart resource. */ export interface QuickstartArgs { /** * Optional JSON-encoded array of context items pre-attached to the quickstart. Each element is an Assistant `ChatContextItem`; only `node.id`, `node.name`, and `node.data` (`{"type": ..., "data": {...}}`) are required, e.g. `{"node": {"id": ..., "name": ..., "data": {"type": ..., "data": {...}}}}`. This is an advanced, internal-format field. The most reliable way to produce a valid value is to create a quickstart with the desired context through the Assistant UI, then copy the resulting `contextItems` JSON. Omit this field if no pre-attached context is needed. See the example for a typical datasource context item. */ contextItems?: pulumi.Input<string>; /** * Whether the resource is enabled. */ enabled?: pulumi.Input<boolean>; /** * The quickstart question text. */ prompt: pulumi.Input<string>; /** * Whether the resource is visible to the whole tenant (`tenant`) or only the creating user (`user`). */ scope: pulumi.Input<string>; /** * Optional title for the quickstart. */ title?: pulumi.Input<string>; }