@pulumi/ns1
Version:
A Pulumi package for creating and managing ns1 cloud resources.
137 lines • 6.11 kB
JavaScript
;
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** 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, Object.assign(Object.assign({}, 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 ? state.active : undefined;
resourceInputs["config"] = state ? state.config : undefined;
resourceInputs["frequency"] = state ? state.frequency : undefined;
resourceInputs["jobType"] = state ? state.jobType : undefined;
resourceInputs["mute"] = state ? state.mute : undefined;
resourceInputs["name"] = state ? state.name : undefined;
resourceInputs["notes"] = state ? state.notes : undefined;
resourceInputs["notifyDelay"] = state ? state.notifyDelay : undefined;
resourceInputs["notifyFailback"] = state ? state.notifyFailback : undefined;
resourceInputs["notifyList"] = state ? state.notifyList : undefined;
resourceInputs["notifyRegional"] = state ? state.notifyRegional : undefined;
resourceInputs["notifyRepeat"] = state ? state.notifyRepeat : undefined;
resourceInputs["policy"] = state ? state.policy : undefined;
resourceInputs["rapidRecheck"] = state ? state.rapidRecheck : undefined;
resourceInputs["regions"] = state ? state.regions : undefined;
resourceInputs["rules"] = state ? state.rules : undefined;
}
else {
const args = argsOrState;
if ((!args || args.config === undefined) && !opts.urn) {
throw new Error("Missing required property 'config'");
}
if ((!args || args.frequency === undefined) && !opts.urn) {
throw new Error("Missing required property 'frequency'");
}
if ((!args || args.jobType === undefined) && !opts.urn) {
throw new Error("Missing required property 'jobType'");
}
if ((!args || args.regions === undefined) && !opts.urn) {
throw new Error("Missing required property 'regions'");
}
resourceInputs["active"] = args ? args.active : undefined;
resourceInputs["config"] = args ? args.config : undefined;
resourceInputs["frequency"] = args ? args.frequency : undefined;
resourceInputs["jobType"] = args ? args.jobType : undefined;
resourceInputs["mute"] = args ? args.mute : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["notes"] = args ? args.notes : undefined;
resourceInputs["notifyDelay"] = args ? args.notifyDelay : undefined;
resourceInputs["notifyFailback"] = args ? args.notifyFailback : undefined;
resourceInputs["notifyList"] = args ? args.notifyList : undefined;
resourceInputs["notifyRegional"] = args ? args.notifyRegional : undefined;
resourceInputs["notifyRepeat"] = args ? args.notifyRepeat : undefined;
resourceInputs["policy"] = args ? args.policy : undefined;
resourceInputs["rapidRecheck"] = args ? args.rapidRecheck : undefined;
resourceInputs["regions"] = args ? args.regions : undefined;
resourceInputs["rules"] = args ? args.rules : undefined;
}
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