@pulumi/juniper-mist
Version:
A Pulumi package for creating and managing Juniper Mist resources.
161 lines • 7.38 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! ***
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Webhook = void 0;
const pulumi = __importStar(require("@pulumi/pulumi"));
const utilities = __importStar(require("../utilities"));
/**
* This resource manages Org Webhooks.
*
* A Webhook is a configuration that allows real-time events and data from the Org to be pushed to a provided url.\
* It enables the collection of information about various topics such as device events, alarms, and audits updates at the org 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.org.Webhook("webhook_one", {
* siteId: terraformTest.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 `junipermist.org.Webhook` with:
* Org Webhook can be imported by specifying the orgId and the webhookId
*
* ```sh
* $ pulumi import junipermist:org/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 });
}
/** @internal */
static __pulumiType = 'junipermist:org/webhook:Webhook';
/**
* 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["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["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?.orgId === undefined && !opts.urn) {
throw new Error("Missing required property 'orgId'");
}
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["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["orgId"] = args?.orgId;
resourceInputs["secret"] = args?.secret ? pulumi.secret(args.secret) : undefined;
resourceInputs["singleEventPerMessage"] = args?.singleEventPerMessage;
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;
}
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;
//# sourceMappingURL=webhook.js.map