@pulumi/juniper-mist
Version:
A Pulumi package for creating and managing Juniper Mist resources.
143 lines • 6.61 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.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, { ...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?.assetfilterIds;
resourceInputs["enabled"] = state?.enabled;
resourceInputs["headers"] = state?.headers;
resourceInputs["name"] = state?.name;
resourceInputs["oauth2ClientId"] = state?.oauth2ClientId;
resourceInputs["oauth2ClientSecret"] = state?.oauth2ClientSecret;
resourceInputs["oauth2GrantType"] = state?.oauth2GrantType;
resourceInputs["oauth2Password"] = state?.oauth2Password;
resourceInputs["oauth2Scopes"] = state?.oauth2Scopes;
resourceInputs["oauth2TokenUrl"] = state?.oauth2TokenUrl;
resourceInputs["oauth2Username"] = state?.oauth2Username;
resourceInputs["orgId"] = state?.orgId;
resourceInputs["secret"] = state?.secret;
resourceInputs["singleEventPerMessage"] = state?.singleEventPerMessage;
resourceInputs["siteId"] = state?.siteId;
resourceInputs["splunkToken"] = state?.splunkToken;
resourceInputs["topics"] = state?.topics;
resourceInputs["type"] = state?.type;
resourceInputs["url"] = state?.url;
resourceInputs["verifyCert"] = state?.verifyCert;
}
else {
const args = argsOrState;
if (args?.siteId === undefined && !opts.urn) {
throw new Error("Missing required property 'siteId'");
}
if (args?.topics === undefined && !opts.urn) {
throw new Error("Missing required property 'topics'");
}
if (args?.url === undefined && !opts.urn) {
throw new Error("Missing required property 'url'");
}
resourceInputs["assetfilterIds"] = args?.assetfilterIds;
resourceInputs["enabled"] = args?.enabled;
resourceInputs["headers"] = args?.headers;
resourceInputs["name"] = args?.name;
resourceInputs["oauth2ClientId"] = args?.oauth2ClientId;
resourceInputs["oauth2ClientSecret"] = args?.oauth2ClientSecret ? pulumi.secret(args.oauth2ClientSecret) : undefined;
resourceInputs["oauth2GrantType"] = args?.oauth2GrantType;
resourceInputs["oauth2Password"] = args?.oauth2Password ? pulumi.secret(args.oauth2Password) : undefined;
resourceInputs["oauth2Scopes"] = args?.oauth2Scopes;
resourceInputs["oauth2TokenUrl"] = args?.oauth2TokenUrl;
resourceInputs["oauth2Username"] = args?.oauth2Username;
resourceInputs["secret"] = args?.secret ? pulumi.secret(args.secret) : undefined;
resourceInputs["singleEventPerMessage"] = args?.singleEventPerMessage;
resourceInputs["siteId"] = args?.siteId;
resourceInputs["splunkToken"] = args?.splunkToken ? pulumi.secret(args.splunkToken) : undefined;
resourceInputs["topics"] = args?.topics;
resourceInputs["type"] = args?.type;
resourceInputs["url"] = args?.url;
resourceInputs["verifyCert"] = args?.verifyCert;
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