UNPKG

@pulumi/juniper-mist

Version:

A Pulumi package for creating and managing Juniper Mist resources.

143 lines 7.5 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.Webhook = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * This resource manages Site Webhooks. * * A Site Webhook is a configuration that allows real-time events and data from a specific site to be pushed to a provided url.\ * It enables the collection of information about various topics such as device events, alarms, audits, client sessions and location updates at the site level.\ * The Webhook can be set up and customized using the Mist API, allowing users to receive and analyze specific data from a particular site. * * ## Example Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as junipermist from "@pulumi/juniper-mist"; * * const webhookOne = new junipermist.site.Webhook("webhook_one", { * siteId: terraformSite.id, * name: "webhook_one", * type: "http-post", * url: "https://myserver.com:4321/", * verifyCert: false, * enabled: true, * topics: [ * "device-events", * "alarms", * "audits", * "client-join", * "client-info", * "client-sessions", * "device-updowns", * "mxedge-events", * "nac-events", * "nac-accounting", * ], * }); * ``` * * ## Import * * Using `pulumi import`, import `mist_site_webhook` with: * * Site Webhook can be imported by specifying the site_id and the webhook_id * * ```sh * $ pulumi import junipermist:site/webhook:Webhook webhook_one 17b46405-3a6d-4715-8bb4-6bb6d06f316a.d3c42998-9012-4859-9743-6b9bee475309 * ``` */ class Webhook extends pulumi.CustomResource { /** * Get an existing Webhook 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 Webhook(name, state, Object.assign(Object.assign({}, opts), { id: id })); } /** * Returns true if the given object is an instance of Webhook. 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'] === Webhook.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["assetfilterIds"] = state ? state.assetfilterIds : undefined; resourceInputs["enabled"] = state ? state.enabled : undefined; resourceInputs["headers"] = state ? state.headers : undefined; resourceInputs["name"] = state ? state.name : undefined; resourceInputs["oauth2ClientId"] = state ? state.oauth2ClientId : undefined; resourceInputs["oauth2ClientSecret"] = state ? state.oauth2ClientSecret : undefined; resourceInputs["oauth2GrantType"] = state ? state.oauth2GrantType : undefined; resourceInputs["oauth2Password"] = state ? state.oauth2Password : undefined; resourceInputs["oauth2Scopes"] = state ? state.oauth2Scopes : undefined; resourceInputs["oauth2TokenUrl"] = state ? state.oauth2TokenUrl : undefined; resourceInputs["oauth2Username"] = state ? state.oauth2Username : undefined; resourceInputs["orgId"] = state ? state.orgId : undefined; resourceInputs["secret"] = state ? state.secret : undefined; resourceInputs["singleEventPerMessage"] = state ? state.singleEventPerMessage : undefined; resourceInputs["siteId"] = state ? state.siteId : undefined; resourceInputs["splunkToken"] = state ? state.splunkToken : undefined; resourceInputs["topics"] = state ? state.topics : undefined; resourceInputs["type"] = state ? state.type : undefined; resourceInputs["url"] = state ? state.url : undefined; resourceInputs["verifyCert"] = state ? state.verifyCert : undefined; } else { const args = argsOrState; if ((!args || args.siteId === undefined) && !opts.urn) { throw new Error("Missing required property 'siteId'"); } if ((!args || args.topics === undefined) && !opts.urn) { throw new Error("Missing required property 'topics'"); } if ((!args || args.url === undefined) && !opts.urn) { throw new Error("Missing required property 'url'"); } resourceInputs["assetfilterIds"] = args ? args.assetfilterIds : undefined; resourceInputs["enabled"] = args ? args.enabled : undefined; resourceInputs["headers"] = args ? args.headers : undefined; resourceInputs["name"] = args ? args.name : undefined; resourceInputs["oauth2ClientId"] = args ? args.oauth2ClientId : undefined; resourceInputs["oauth2ClientSecret"] = (args === null || args === void 0 ? void 0 : args.oauth2ClientSecret) ? pulumi.secret(args.oauth2ClientSecret) : undefined; resourceInputs["oauth2GrantType"] = args ? args.oauth2GrantType : undefined; resourceInputs["oauth2Password"] = (args === null || args === void 0 ? void 0 : args.oauth2Password) ? pulumi.secret(args.oauth2Password) : undefined; resourceInputs["oauth2Scopes"] = args ? args.oauth2Scopes : undefined; resourceInputs["oauth2TokenUrl"] = args ? args.oauth2TokenUrl : undefined; resourceInputs["oauth2Username"] = args ? args.oauth2Username : undefined; resourceInputs["secret"] = (args === null || args === void 0 ? void 0 : args.secret) ? pulumi.secret(args.secret) : undefined; resourceInputs["singleEventPerMessage"] = args ? args.singleEventPerMessage : undefined; resourceInputs["siteId"] = args ? args.siteId : undefined; resourceInputs["splunkToken"] = (args === null || args === void 0 ? void 0 : args.splunkToken) ? pulumi.secret(args.splunkToken) : undefined; resourceInputs["topics"] = args ? args.topics : undefined; resourceInputs["type"] = args ? args.type : undefined; resourceInputs["url"] = args ? args.url : undefined; resourceInputs["verifyCert"] = args ? args.verifyCert : undefined; resourceInputs["orgId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); const secretOpts = { additionalSecretOutputs: ["oauth2ClientSecret", "oauth2Password", "secret", "splunkToken"] }; opts = pulumi.mergeOptions(opts, secretOpts); super(Webhook.__pulumiType, name, resourceInputs, opts); } } exports.Webhook = Webhook; /** @internal */ Webhook.__pulumiType = 'junipermist:site/webhook:Webhook'; //# sourceMappingURL=webhook.js.map