Welcome to Pulumi Registry, your window into the cloud. Read the announcement.

MonitoringJob

Provides a NS1 Monitoring Job resource. This can be used to create, modify, and delete monitoring jobs.

NS1 Documentation

MonitoringJob Api Doc

Example Usage

using Pulumi;
using Ns1 = Pulumi.Ns1;

class MyStack : Stack
{
    public MyStack()
    {
        var uswestMonitor = new Ns1.MonitoringJob("uswestMonitor", new Ns1.MonitoringJobArgs
        {
            Active = true,
            Config = 
            {
                { "host", "example-elb-uswest.aws.amazon.com" },
                { "port", 443 },
                { "send", @"HEAD / HTTP/1.0


" },
                { "ssl", 1 },
            },
            Frequency = 60,
            JobType = "tcp",
            Mute = true,
            Policy = "quorum",
            RapidRecheck = true,
            Regions = 
            {
                "sjc",
                "sin",
                "lga",
            },
            Rules = 
            {
                new Ns1.Inputs.MonitoringJobRuleArgs
                {
                    Comparison = "contains",
                    Key = "output",
                    Value = "200 OK",
                },
            },
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-ns1/sdk/v2/go/ns1"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := ns1.NewMonitoringJob(ctx, "uswestMonitor", &ns1.MonitoringJobArgs{
			Active: pulumi.Bool(true),
			Config: pulumi.AnyMap{
				"host": pulumi.Any("example-elb-uswest.aws.amazon.com"),
				"port": pulumi.Any(443),
				"send": pulumi.Any(fmt.Sprintf("%v%v%v", "HEAD / HTTP/1.0
\n", "
\n", "\n")),
				"ssl": pulumi.Any(1),
			},
			Frequency:    pulumi.Int(60),
			JobType:      pulumi.String("tcp"),
			Mute:         pulumi.Bool(true),
			Policy:       pulumi.String("quorum"),
			RapidRecheck: pulumi.Bool(true),
			Regions: pulumi.StringArray{
				pulumi.String("sjc"),
				pulumi.String("sin"),
				pulumi.String("lga"),
			},
			Rules: MonitoringJobRuleArray{
				&MonitoringJobRuleArgs{
					Comparison: pulumi.String("contains"),
					Key:        pulumi.String("output"),
					Value:      pulumi.String("200 OK"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
import pulumi
import pulumi_ns1 as ns1

uswest_monitor = ns1.MonitoringJob("uswestMonitor",
    active=True,
    config={
        "host": "example-elb-uswest.aws.amazon.com",
        "port": 443,
        "send": """HEAD / HTTP/1.0


""",
        "ssl": 1,
    },
    frequency=60,
    job_type="tcp",
    mute=True,
    policy="quorum",
    rapid_recheck=True,
    regions=[
        "sjc",
        "sin",
        "lga",
    ],
    rules=[ns1.MonitoringJobRuleArgs(
        comparison="contains",
        key="output",
        value="200 OK",
    )])
import * as pulumi from "@pulumi/pulumi";
import * as ns1 from "@pulumi/ns1";

const uswestMonitor = new ns1.MonitoringJob("uswest_monitor", {
    active: true,
    config: {
        host: "example-elb-uswest.aws.amazon.com",
        port: 443,
        send: `HEAD / HTTP/1.0

`,
        ssl: 1,
    },
    frequency: 60,
    jobType: "tcp",
    mute: true,
    policy: "quorum",
    rapidRecheck: true,
    regions: [
        "sjc",
        "sin",
        "lga",
    ],
    rules: [{
        comparison: "contains",
        key: "output",
        value: "200 OK",
    }],
});

Create a MonitoringJob Resource

new MonitoringJob(name: string, args: MonitoringJobArgs, opts?: CustomResourceOptions);
@overload
def MonitoringJob(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  active: Optional[bool] = None,
                  config: Optional[Mapping[str, Any]] = None,
                  frequency: Optional[int] = None,
                  job_type: Optional[str] = None,
                  mute: Optional[bool] = None,
                  name: Optional[str] = None,
                  notes: Optional[str] = None,
                  notify_delay: Optional[int] = None,
                  notify_failback: Optional[bool] = None,
                  notify_list: Optional[str] = None,
                  notify_regional: Optional[bool] = None,
                  notify_repeat: Optional[int] = None,
                  policy: Optional[str] = None,
                  rapid_recheck: Optional[bool] = None,
                  regions: Optional[Sequence[str]] = None,
                  rules: Optional[Sequence[MonitoringJobRuleArgs]] = None)
@overload
def MonitoringJob(resource_name: str,
                  args: MonitoringJobArgs,
                  opts: Optional[ResourceOptions] = None)
func NewMonitoringJob(ctx *Context, name string, args MonitoringJobArgs, opts ...ResourceOption) (*MonitoringJob, error)
public MonitoringJob(string name, MonitoringJobArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args MonitoringJobArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args MonitoringJobArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args MonitoringJobArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args MonitoringJobArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

MonitoringJob Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The MonitoringJob resource accepts the following input properties:

Config Dictionary<string, object>
A configuration dictionary with keys and values depending on the job_type. Configuration details for each job_type are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes.
Frequency int
The frequency, in seconds, at which to run the monitoring job in each region.
JobType string
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.
Regions List<string>
The list of region codes in which to run the monitoring job. See NS1 API docs for supported values.
Active bool
Indicates if the job is active or temporarily disabled.
Mute bool
turn off the notifications for the monitoring job.
Name string
The free-form display name for the monitoring job.
Notes string
Freeform notes to be included in any notifications about this job.
NotifyDelay int
The time in seconds after a failure to wait before sending a notification.
NotifyFailback bool
If true, a notification is sent when a job returns to an “up” state.
NotifyList string
NotifyRegional bool
If true, notifications are sent for any regional failure (and failback if desired), in addition to global state notifications.
NotifyRepeat int
The time in seconds between repeat notifications of a failed job.
Policy string
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.
RapidRecheck bool
If true, on any apparent state change, the job is quickly re-run after one second to confirm the state change before notification.
Rules List<MonitoringJobRuleArgs>
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.
Config map[string]interface{}
A configuration dictionary with keys and values depending on the job_type. Configuration details for each job_type are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes.
Frequency int
The frequency, in seconds, at which to run the monitoring job in each region.
JobType string
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.
Regions []string
The list of region codes in which to run the monitoring job. See NS1 API docs for supported values.
Active bool
Indicates if the job is active or temporarily disabled.
Mute bool
turn off the notifications for the monitoring job.
Name string
The free-form display name for the monitoring job.
Notes string
Freeform notes to be included in any notifications about this job.
NotifyDelay int
The time in seconds after a failure to wait before sending a notification.
NotifyFailback bool
If true, a notification is sent when a job returns to an “up” state.
NotifyList string
NotifyRegional bool
If true, notifications are sent for any regional failure (and failback if desired), in addition to global state notifications.
NotifyRepeat int
The time in seconds between repeat notifications of a failed job.
Policy string
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.
RapidRecheck bool
If true, on any apparent state change, the job is quickly re-run after one second to confirm the state change before notification.
Rules []MonitoringJobRuleArgs
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.
config {[key: string]: any}
A configuration dictionary with keys and values depending on the job_type. Configuration details for each job_type are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes.
frequency number
The frequency, in seconds, at which to run the monitoring job in each region.
jobType string
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.
regions string[]
The list of region codes in which to run the monitoring job. See NS1 API docs for supported values.
active boolean
Indicates if the job is active or temporarily disabled.
mute boolean
turn off the notifications for the monitoring job.
name string
The free-form display name for the monitoring job.
notes string
Freeform notes to be included in any notifications about this job.
notifyDelay number
The time in seconds after a failure to wait before sending a notification.
notifyFailback boolean
If true, a notification is sent when a job returns to an “up” state.
notifyList string
notifyRegional boolean
If true, notifications are sent for any regional failure (and failback if desired), in addition to global state notifications.
notifyRepeat number
The time in seconds between repeat notifications of a failed job.
policy string
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.
rapidRecheck boolean
If true, on any apparent state change, the job is quickly re-run after one second to confirm the state change before notification.
rules MonitoringJobRuleArgs[]
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.
config Mapping[str, Any]
A configuration dictionary with keys and values depending on the job_type. Configuration details for each job_type are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes.
frequency int
The frequency, in seconds, at which to run the monitoring job in each region.
job_type str
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.
regions Sequence[str]
The list of region codes in which to run the monitoring job. See NS1 API docs for supported values.
active bool
Indicates if the job is active or temporarily disabled.
mute bool
turn off the notifications for the monitoring job.
name str
The free-form display name for the monitoring job.
notes str
Freeform notes to be included in any notifications about this job.
notify_delay int
The time in seconds after a failure to wait before sending a notification.
notify_failback bool
If true, a notification is sent when a job returns to an “up” state.
notify_list str
notify_regional bool
If true, notifications are sent for any regional failure (and failback if desired), in addition to global state notifications.
notify_repeat int
The time in seconds between repeat notifications of a failed job.
policy str
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.
rapid_recheck bool
If true, on any apparent state change, the job is quickly re-run after one second to confirm the state change before notification.
rules Sequence[MonitoringJobRuleArgs]
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.

Outputs

All input properties are implicitly available as output properties. Additionally, the MonitoringJob resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
Id string
The provider-assigned unique ID for this managed resource.
id string
The provider-assigned unique ID for this managed resource.
id str
The provider-assigned unique ID for this managed resource.

Look up an Existing MonitoringJob Resource

Get an existing MonitoringJob resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: MonitoringJobState, opts?: CustomResourceOptions): MonitoringJob
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        active: Optional[bool] = None,
        config: Optional[Mapping[str, Any]] = None,
        frequency: Optional[int] = None,
        job_type: Optional[str] = None,
        mute: Optional[bool] = None,
        name: Optional[str] = None,
        notes: Optional[str] = None,
        notify_delay: Optional[int] = None,
        notify_failback: Optional[bool] = None,
        notify_list: Optional[str] = None,
        notify_regional: Optional[bool] = None,
        notify_repeat: Optional[int] = None,
        policy: Optional[str] = None,
        rapid_recheck: Optional[bool] = None,
        regions: Optional[Sequence[str]] = None,
        rules: Optional[Sequence[MonitoringJobRuleArgs]] = None) -> MonitoringJob
func GetMonitoringJob(ctx *Context, name string, id IDInput, state *MonitoringJobState, opts ...ResourceOption) (*MonitoringJob, error)
public static MonitoringJob Get(string name, Input<string> id, MonitoringJobState? state, CustomResourceOptions? opts = null)
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.

The following state arguments are supported:

Active bool
Indicates if the job is active or temporarily disabled.
Config Dictionary<string, object>
A configuration dictionary with keys and values depending on the job_type. Configuration details for each job_type are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes.
Frequency int
The frequency, in seconds, at which to run the monitoring job in each region.
JobType string
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.
Mute bool
turn off the notifications for the monitoring job.
Name string
The free-form display name for the monitoring job.
Notes string
Freeform notes to be included in any notifications about this job.
NotifyDelay int
The time in seconds after a failure to wait before sending a notification.
NotifyFailback bool
If true, a notification is sent when a job returns to an “up” state.
NotifyList string
NotifyRegional bool
If true, notifications are sent for any regional failure (and failback if desired), in addition to global state notifications.
NotifyRepeat int
The time in seconds between repeat notifications of a failed job.
Policy string
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.
RapidRecheck bool
If true, on any apparent state change, the job is quickly re-run after one second to confirm the state change before notification.
Regions List<string>
The list of region codes in which to run the monitoring job. See NS1 API docs for supported values.
Rules List<MonitoringJobRuleArgs>
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.
Active bool
Indicates if the job is active or temporarily disabled.
Config map[string]interface{}
A configuration dictionary with keys and values depending on the job_type. Configuration details for each job_type are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes.
Frequency int
The frequency, in seconds, at which to run the monitoring job in each region.
JobType string
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.
Mute bool
turn off the notifications for the monitoring job.
Name string
The free-form display name for the monitoring job.
Notes string
Freeform notes to be included in any notifications about this job.
NotifyDelay int
The time in seconds after a failure to wait before sending a notification.
NotifyFailback bool
If true, a notification is sent when a job returns to an “up” state.
NotifyList string
NotifyRegional bool
If true, notifications are sent for any regional failure (and failback if desired), in addition to global state notifications.
NotifyRepeat int
The time in seconds between repeat notifications of a failed job.
Policy string
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.
RapidRecheck bool
If true, on any apparent state change, the job is quickly re-run after one second to confirm the state change before notification.
Regions []string
The list of region codes in which to run the monitoring job. See NS1 API docs for supported values.
Rules []MonitoringJobRuleArgs
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.
active boolean
Indicates if the job is active or temporarily disabled.
config {[key: string]: any}
A configuration dictionary with keys and values depending on the job_type. Configuration details for each job_type are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes.
frequency number
The frequency, in seconds, at which to run the monitoring job in each region.
jobType string
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.
mute boolean
turn off the notifications for the monitoring job.
name string
The free-form display name for the monitoring job.
notes string
Freeform notes to be included in any notifications about this job.
notifyDelay number
The time in seconds after a failure to wait before sending a notification.
notifyFailback boolean
If true, a notification is sent when a job returns to an “up” state.
notifyList string
notifyRegional boolean
If true, notifications are sent for any regional failure (and failback if desired), in addition to global state notifications.
notifyRepeat number
The time in seconds between repeat notifications of a failed job.
policy string
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.
rapidRecheck boolean
If true, on any apparent state change, the job is quickly re-run after one second to confirm the state change before notification.
regions string[]
The list of region codes in which to run the monitoring job. See NS1 API docs for supported values.
rules MonitoringJobRuleArgs[]
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.
active bool
Indicates if the job is active or temporarily disabled.
config Mapping[str, Any]
A configuration dictionary with keys and values depending on the job_type. Configuration details for each job_type are found by submitting a GET request to https://api.nsone.net/v1/monitoring/jobtypes.
frequency int
The frequency, in seconds, at which to run the monitoring job in each region.
job_type str
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.
mute bool
turn off the notifications for the monitoring job.
name str
The free-form display name for the monitoring job.
notes str
Freeform notes to be included in any notifications about this job.
notify_delay int
The time in seconds after a failure to wait before sending a notification.
notify_failback bool
If true, a notification is sent when a job returns to an “up” state.
notify_list str
notify_regional bool
If true, notifications are sent for any regional failure (and failback if desired), in addition to global state notifications.
notify_repeat int
The time in seconds between repeat notifications of a failed job.
policy str
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.
rapid_recheck bool
If true, on any apparent state change, the job is quickly re-run after one second to confirm the state change before notification.
regions Sequence[str]
The list of region codes in which to run the monitoring job. See NS1 API docs for supported values.
rules Sequence[MonitoringJobRuleArgs]
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.

Supporting Types

MonitoringJobRule

Comparison string
Key string
Value string
Comparison string
Key string
Value string
comparison string
key string
value string
comparison str
key str
value str

Package Details

Repository
https://github.com/pulumi/pulumi-ns1
License
Apache-2.0
Notes
This Pulumi package is based on the ns1 Terraform Provider.