UNPKG

@pulumiverse/grafana

Version:

A Pulumi package for creating and managing grafana.

114 lines 5.13 kB
"use strict"; // *** 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.OutgoingWebhook = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * * [HTTP API](https://grafana.com/docs/oncall/latest/oncall-api-reference/outgoing_webhooks/) * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as grafana from "@pulumiverse/grafana"; * * const myTeam = grafana.oss.getTeam({ * name: "my team", * }); * const myTeamGetTeam = myTeam.then(myTeam => grafana.onCall.getTeam({ * name: myTeam.name, * })); * const test_acc_outgoingWebhook = new grafana.oncall.OutgoingWebhook("test-acc-outgoing_webhook", { * name: "my outgoing webhook", * url: "https://example.com/", * teamId: myTeamGetTeam.then(myTeamGetTeam => myTeamGetTeam.id), * }); * const test_acc_outgoingWebhook_incident = new grafana.oncall.OutgoingWebhook("test-acc-outgoing_webhook-incident", { * name: "my outgoing incident webhook", * preset: "incident_webhook", * httpMethod: "POST", * url: "https://example.com/", * triggerType: "incident declared", * }); * ``` * * ## Import * * ```sh * terraform import grafana_oncall_outgoing_webhook.name "{{ id }}" * ``` */ class OutgoingWebhook extends pulumi.CustomResource { /** * Get an existing OutgoingWebhook 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 OutgoingWebhook(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of OutgoingWebhook. 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'] === OutgoingWebhook.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["authorizationHeader"] = state?.authorizationHeader; resourceInputs["data"] = state?.data; resourceInputs["forwardWholePayload"] = state?.forwardWholePayload; resourceInputs["headers"] = state?.headers; resourceInputs["httpMethod"] = state?.httpMethod; resourceInputs["integrationFilters"] = state?.integrationFilters; resourceInputs["isWebhookEnabled"] = state?.isWebhookEnabled; resourceInputs["name"] = state?.name; resourceInputs["password"] = state?.password; resourceInputs["preset"] = state?.preset; resourceInputs["teamId"] = state?.teamId; resourceInputs["triggerTemplate"] = state?.triggerTemplate; resourceInputs["triggerType"] = state?.triggerType; resourceInputs["url"] = state?.url; resourceInputs["user"] = state?.user; } else { const args = argsOrState; resourceInputs["authorizationHeader"] = args?.authorizationHeader ? pulumi.secret(args.authorizationHeader) : undefined; resourceInputs["data"] = args?.data; resourceInputs["forwardWholePayload"] = args?.forwardWholePayload; resourceInputs["headers"] = args?.headers; resourceInputs["httpMethod"] = args?.httpMethod; resourceInputs["integrationFilters"] = args?.integrationFilters; resourceInputs["isWebhookEnabled"] = args?.isWebhookEnabled; resourceInputs["name"] = args?.name; resourceInputs["password"] = args?.password ? pulumi.secret(args.password) : undefined; resourceInputs["preset"] = args?.preset; resourceInputs["teamId"] = args?.teamId; resourceInputs["triggerTemplate"] = args?.triggerTemplate; resourceInputs["triggerType"] = args?.triggerType; resourceInputs["url"] = args?.url; resourceInputs["user"] = args?.user; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["authorizationHeader", "password"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(OutgoingWebhook.__pulumiType, name, resourceInputs, opts); } } exports.OutgoingWebhook = OutgoingWebhook; /** @internal */ OutgoingWebhook.__pulumiType = 'grafana:onCall/outgoingWebhook:OutgoingWebhook'; //# sourceMappingURL=outgoingWebhook.js.map