@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
88 lines • 3.58 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.Annotation = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Manages Grafana annotations.
*
* * [Official documentation](https://grafana.com/docs/grafana/latest/dashboards/build-dashboards/annotate-visualizations/)
* * [HTTP API](https://grafana.com/docs/grafana/latest/developer-resources/api-reference/http-api/api-legacy/annotations/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const test = new grafana.oss.Annotation("test", {text: "basic text"});
* ```
*
* ## Import
*
* ```sh
* terraform import grafana_annotation.name "{{ id }}"
* terraform import grafana_annotation.name "{{ orgID }}:{{ id }}"
* ```
*/
class Annotation extends pulumi.CustomResource {
/**
* Get an existing Annotation 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, id, state, opts) {
return new Annotation(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Annotation. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === Annotation.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["dashboardUid"] = state?.dashboardUid;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["panelId"] = state?.panelId;
resourceInputs["tags"] = state?.tags;
resourceInputs["text"] = state?.text;
resourceInputs["time"] = state?.time;
resourceInputs["timeEnd"] = state?.timeEnd;
}
else {
const args = argsOrState;
if (args?.text === undefined && !opts.urn) {
throw new Error("Missing required property 'text'");
}
resourceInputs["dashboardUid"] = args?.dashboardUid;
resourceInputs["orgId"] = args?.orgId;
resourceInputs["panelId"] = args?.panelId;
resourceInputs["tags"] = args?.tags;
resourceInputs["text"] = args?.text;
resourceInputs["time"] = args?.time;
resourceInputs["timeEnd"] = args?.timeEnd;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const aliasOpts = { aliases: [{ type: "grafana:index/annotation:Annotation" }] };
opts = pulumi.mergeOptions(opts, aliasOpts);
super(Annotation.__pulumiType, name, resourceInputs, opts);
}
}
exports.Annotation = Annotation;
/** @internal */
Annotation.__pulumiType = 'grafana:oss/annotation:Annotation';
//# sourceMappingURL=annotation.js.map