@pulumiverse/grafana
Version:
A Pulumi package for creating and managing grafana.
119 lines • 4.69 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.Route = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/routes/)
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as grafana from "@pulumiverse/grafana";
*
* const exampleSlackChannel = grafana.onCall.getSlackChannel({
* name: "example_slack_channel",
* });
* const _default = new grafana.oncall.EscalationChain("default", {name: "default"});
* const exampleIntegration = new grafana.oncall.Integration("example_integration", {
* name: "Grafana Integration",
* type: "grafana",
* defaultRoute: {},
* });
* const exampleRoute = new grafana.oncall.Route("example_route", {
* integrationId: exampleIntegration.id,
* escalationChainId: _default.id,
* routingRegex: "us-(east|west)",
* position: 0,
* slack: {
* channelId: exampleSlackChannel.then(exampleSlackChannel => exampleSlackChannel.slackId),
* enabled: true,
* },
* telegram: {
* id: "ONCALLTELEGRAMID",
* enabled: true,
* },
* msteams: {
* id: "ONCALLMSTEAMSID",
* enabled: false,
* },
* });
* ```
*
* ## Import
*
* ```sh
* terraform import grafana_oncall_route.name "{{ id }}"
* ```
*/
class Route extends pulumi.CustomResource {
/**
* Get an existing Route 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 Route(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Route. 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'] === Route.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["escalationChainId"] = state?.escalationChainId;
resourceInputs["integrationId"] = state?.integrationId;
resourceInputs["msteams"] = state?.msteams;
resourceInputs["position"] = state?.position;
resourceInputs["routingRegex"] = state?.routingRegex;
resourceInputs["routingType"] = state?.routingType;
resourceInputs["slack"] = state?.slack;
resourceInputs["telegram"] = state?.telegram;
}
else {
const args = argsOrState;
if (args?.escalationChainId === undefined && !opts.urn) {
throw new Error("Missing required property 'escalationChainId'");
}
if (args?.integrationId === undefined && !opts.urn) {
throw new Error("Missing required property 'integrationId'");
}
if (args?.position === undefined && !opts.urn) {
throw new Error("Missing required property 'position'");
}
if (args?.routingRegex === undefined && !opts.urn) {
throw new Error("Missing required property 'routingRegex'");
}
resourceInputs["escalationChainId"] = args?.escalationChainId;
resourceInputs["integrationId"] = args?.integrationId;
resourceInputs["msteams"] = args?.msteams;
resourceInputs["position"] = args?.position;
resourceInputs["routingRegex"] = args?.routingRegex;
resourceInputs["routingType"] = args?.routingType;
resourceInputs["slack"] = args?.slack;
resourceInputs["telegram"] = args?.telegram;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Route.__pulumiType, name, resourceInputs, opts);
}
}
exports.Route = Route;
/** @internal */
Route.__pulumiType = 'grafana:onCall/route:Route';
//# sourceMappingURL=route.js.map