@pulumi/ns1
Version:
A Pulumi package for creating and managing ns1 cloud resources.
137 lines • 5.43 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.MonitoringJob = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("./utilities");
/**
* Provides a NS1 Monitoring Job resource. This can be used to create, modify, and delete monitoring jobs.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as ns1 from "@pulumi/ns1";
*
* const uswestMonitor = new ns1.MonitoringJob("uswest_monitor", {
* name: "uswest",
* active: true,
* regions: [
* "lga",
* "sjc",
* "sin",
* ],
* jobType: "tcp",
* frequency: 60,
* rapidRecheck: true,
* policy: "quorum",
* mute: true,
* config: {
* ssl: "1",
* send: "HEAD / HTTP/1.0\\r\\n\\r\\n",
* port: "443",
* host: "example-elb-uswest.aws.amazon.com",
* },
* rules: [{
* value: "200 OK",
* comparison: "contains",
* key: "output",
* }],
* });
* ```
*
* ## NS1 Documentation
*
* [MonitoringJob Api Doc](https://ns1.com/api#monitoring-jobs)
*
* ## Import
*
* ```sh
* $ pulumi import ns1:index/monitoringJob:MonitoringJob <name> <monitoringjob_id>`
* ```
*/
class MonitoringJob extends pulumi.CustomResource {
/**
* Get an existing MonitoringJob 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 MonitoringJob(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of MonitoringJob. 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'] === MonitoringJob.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["active"] = state?.active;
resourceInputs["config"] = state?.config;
resourceInputs["frequency"] = state?.frequency;
resourceInputs["jobType"] = state?.jobType;
resourceInputs["mute"] = state?.mute;
resourceInputs["name"] = state?.name;
resourceInputs["notes"] = state?.notes;
resourceInputs["notifyDelay"] = state?.notifyDelay;
resourceInputs["notifyFailback"] = state?.notifyFailback;
resourceInputs["notifyList"] = state?.notifyList;
resourceInputs["notifyRegional"] = state?.notifyRegional;
resourceInputs["notifyRepeat"] = state?.notifyRepeat;
resourceInputs["policy"] = state?.policy;
resourceInputs["rapidRecheck"] = state?.rapidRecheck;
resourceInputs["regions"] = state?.regions;
resourceInputs["rules"] = state?.rules;
}
else {
const args = argsOrState;
if (args?.config === undefined && !opts.urn) {
throw new Error("Missing required property 'config'");
}
if (args?.frequency === undefined && !opts.urn) {
throw new Error("Missing required property 'frequency'");
}
if (args?.jobType === undefined && !opts.urn) {
throw new Error("Missing required property 'jobType'");
}
if (args?.regions === undefined && !opts.urn) {
throw new Error("Missing required property 'regions'");
}
resourceInputs["active"] = args?.active;
resourceInputs["config"] = args?.config;
resourceInputs["frequency"] = args?.frequency;
resourceInputs["jobType"] = args?.jobType;
resourceInputs["mute"] = args?.mute;
resourceInputs["name"] = args?.name;
resourceInputs["notes"] = args?.notes;
resourceInputs["notifyDelay"] = args?.notifyDelay;
resourceInputs["notifyFailback"] = args?.notifyFailback;
resourceInputs["notifyList"] = args?.notifyList;
resourceInputs["notifyRegional"] = args?.notifyRegional;
resourceInputs["notifyRepeat"] = args?.notifyRepeat;
resourceInputs["policy"] = args?.policy;
resourceInputs["rapidRecheck"] = args?.rapidRecheck;
resourceInputs["regions"] = args?.regions;
resourceInputs["rules"] = args?.rules;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(MonitoringJob.__pulumiType, name, resourceInputs, opts);
}
}
exports.MonitoringJob = MonitoringJob;
/** @internal */
MonitoringJob.__pulumiType = 'ns1:index/monitoringJob:MonitoringJob';
//# sourceMappingURL=monitoringJob.js.map