UNPKG

@pulumi/ns1

Version:

A Pulumi package for creating and managing ns1 cloud resources.

280 lines (279 loc) 11.9 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "./types/input"; import * as outputs from "./types/output"; /** * 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>` * ``` */ export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: MonitoringJobState, opts?: pulumi.CustomResourceOptions): MonitoringJob; /** * 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: any): obj is MonitoringJob; /** * Indicates if the job is active or temporarily disabled. */ readonly active: pulumi.Output<boolean | undefined>; /** * A configuration dictionary with keys and values depending on the job_type. Configuration details for each jobType are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes. */ readonly config: pulumi.Output<{ [key: string]: string; }>; /** * The frequency, in seconds, at which to run the monitoring job in each region. */ readonly frequency: pulumi.Output<number>; /** * The type of monitoring job to be run. Refer to the NS1 API documentation (https://ns1.com/api#monitoring-jobs) for supported values which include ping, tcp, dns, http. */ readonly jobType: pulumi.Output<string>; /** * turn off the notifications for the monitoring job. */ readonly mute: pulumi.Output<boolean | undefined>; /** * The free-form display name for the monitoring job. */ readonly name: pulumi.Output<string>; /** * Freeform notes to be included in any notifications about this job. */ readonly notes: pulumi.Output<string | undefined>; /** * The time in seconds after a failure to wait before sending a notification. */ readonly notifyDelay: pulumi.Output<number | undefined>; /** * If true, a notification is sent when a job returns to an "up" state. */ readonly notifyFailback: pulumi.Output<boolean | undefined>; readonly notifyList: pulumi.Output<string | undefined>; /** * If true, notifications are sent for any regional failure (and failback if desired), in addition to global state notifications. */ readonly notifyRegional: pulumi.Output<boolean | undefined>; /** * The time in seconds between repeat notifications of a failed job. */ readonly notifyRepeat: pulumi.Output<number | undefined>; /** * The policy for determining the monitor's global status * based on the status of the job in all regions. See NS1 API docs for supported values. */ readonly policy: pulumi.Output<string | undefined>; /** * If true, on any apparent state change, the job is quickly re-run after one second to confirm the state change before notification. */ readonly rapidRecheck: pulumi.Output<boolean | undefined>; /** * The list of region codes in which to run the monitoring * job. See NS1 API docs for supported values. */ readonly regions: pulumi.Output<string[]>; /** * A list of rules for determining failure conditions. Each rule acts on one of the outputs from the monitoring job. You must specify key (the output key); comparison (a comparison to perform on the the output); and value (the value to compare to). For example, {"key":"rtt", "comparison":"<", "value":100} is a rule requiring the rtt from a job to be under 100ms, or the job will be marked failed. Available output keys, comparators, and value types are are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes. */ readonly rules: pulumi.Output<outputs.MonitoringJobRule[] | undefined>; /** * Create a MonitoringJob resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: MonitoringJobArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering MonitoringJob resources. */ export interface MonitoringJobState { /** * Indicates if the job is active or temporarily disabled. */ active?: pulumi.Input<boolean>; /** * A configuration dictionary with keys and values depending on the job_type. Configuration details for each jobType are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes. */ config?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The frequency, in seconds, at which to run the monitoring job in each region. */ frequency?: pulumi.Input<number>; /** * The type of monitoring job to be run. Refer to the NS1 API documentation (https://ns1.com/api#monitoring-jobs) for supported values which include ping, tcp, dns, http. */ jobType?: pulumi.Input<string>; /** * turn off the notifications for the monitoring job. */ mute?: pulumi.Input<boolean>; /** * The free-form display name for the monitoring job. */ name?: pulumi.Input<string>; /** * Freeform notes to be included in any notifications about this job. */ notes?: pulumi.Input<string>; /** * The time in seconds after a failure to wait before sending a notification. */ notifyDelay?: pulumi.Input<number>; /** * If true, a notification is sent when a job returns to an "up" state. */ notifyFailback?: pulumi.Input<boolean>; notifyList?: pulumi.Input<string>; /** * If true, notifications are sent for any regional failure (and failback if desired), in addition to global state notifications. */ notifyRegional?: pulumi.Input<boolean>; /** * The time in seconds between repeat notifications of a failed job. */ notifyRepeat?: pulumi.Input<number>; /** * The policy for determining the monitor's global status * based on the status of the job in all regions. See NS1 API docs for supported values. */ policy?: pulumi.Input<string>; /** * If true, on any apparent state change, the job is quickly re-run after one second to confirm the state change before notification. */ rapidRecheck?: pulumi.Input<boolean>; /** * The list of region codes in which to run the monitoring * job. See NS1 API docs for supported values. */ regions?: pulumi.Input<pulumi.Input<string>[]>; /** * A list of rules for determining failure conditions. Each rule acts on one of the outputs from the monitoring job. You must specify key (the output key); comparison (a comparison to perform on the the output); and value (the value to compare to). For example, {"key":"rtt", "comparison":"<", "value":100} is a rule requiring the rtt from a job to be under 100ms, or the job will be marked failed. Available output keys, comparators, and value types are are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes. */ rules?: pulumi.Input<pulumi.Input<inputs.MonitoringJobRule>[]>; } /** * The set of arguments for constructing a MonitoringJob resource. */ export interface MonitoringJobArgs { /** * Indicates if the job is active or temporarily disabled. */ active?: pulumi.Input<boolean>; /** * A configuration dictionary with keys and values depending on the job_type. Configuration details for each jobType are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes. */ config: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The frequency, in seconds, at which to run the monitoring job in each region. */ frequency: pulumi.Input<number>; /** * The type of monitoring job to be run. Refer to the NS1 API documentation (https://ns1.com/api#monitoring-jobs) for supported values which include ping, tcp, dns, http. */ jobType: pulumi.Input<string>; /** * turn off the notifications for the monitoring job. */ mute?: pulumi.Input<boolean>; /** * The free-form display name for the monitoring job. */ name?: pulumi.Input<string>; /** * Freeform notes to be included in any notifications about this job. */ notes?: pulumi.Input<string>; /** * The time in seconds after a failure to wait before sending a notification. */ notifyDelay?: pulumi.Input<number>; /** * If true, a notification is sent when a job returns to an "up" state. */ notifyFailback?: pulumi.Input<boolean>; notifyList?: pulumi.Input<string>; /** * If true, notifications are sent for any regional failure (and failback if desired), in addition to global state notifications. */ notifyRegional?: pulumi.Input<boolean>; /** * The time in seconds between repeat notifications of a failed job. */ notifyRepeat?: pulumi.Input<number>; /** * The policy for determining the monitor's global status * based on the status of the job in all regions. See NS1 API docs for supported values. */ policy?: pulumi.Input<string>; /** * If true, on any apparent state change, the job is quickly re-run after one second to confirm the state change before notification. */ rapidRecheck?: pulumi.Input<boolean>; /** * The list of region codes in which to run the monitoring * job. See NS1 API docs for supported values. */ regions: pulumi.Input<pulumi.Input<string>[]>; /** * A list of rules for determining failure conditions. Each rule acts on one of the outputs from the monitoring job. You must specify key (the output key); comparison (a comparison to perform on the the output); and value (the value to compare to). For example, {"key":"rtt", "comparison":"<", "value":100} is a rule requiring the rtt from a job to be under 100ms, or the job will be marked failed. Available output keys, comparators, and value types are are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes. */ rules?: pulumi.Input<pulumi.Input<inputs.MonitoringJobRule>[]>; }