Advanced Alerting APIs
Neustar Interface Reference

This is the main object in the alert policy script. It is put into the Javascript environment as the variable neustar. It contains these other objects: More...

List of all members.

Public Member Functions

void log (object message)
Template template (string templateName)
HttpClient httpClient ()
string toJSON (object object)
Leftronic leftronic (string apikey)
AWSCreds awsCreds (object credentials)
WPMCreds wpmCreds (object credentials)
EC2Client ec2Client (AWSCreds credentials)
S3Client s3Client (AWSCreds credentials)
RumClient rumClient (WPMCreds credentials)
SMSClient smsClient (object credentials)

Detailed Description

This is the main object in the alert policy script. It is put into the Javascript environment as the variable neustar. It contains these other objects:

  • neustar.email
  • neustar.alerts
  • neustar.scheduler
  • neustar.pagerDuty

Member Function Documentation

AWSCreds awsCreds ( object  credentials)

Create new AWS Credentials

Parameters:
credentialsa javascript object that must contain
  • awsKey The key
  • awsSecretKey The secret key
Returns:
an AWSCredential object.
EC2Client ec2Client ( AWSCreds  credentials)
Parameters:
credentialsan AWSCreds object
Returns:
an EC2Client object.

Returns a new HttpClient object.

Returns:
a new HttpClient
Leftronic leftronic ( string  apikey)

Returns a new Leftronic object.

Parameters:
apikeya string which is the Leftronic API key.
Returns:
a Leftronic object.
void log ( object  message)

Log a message. Use this function in your alert policy by calling neustar.log.

Parameters:
messageobjects are serialized to a string and written to the log. If the object is a javascript object it is serialized as JSON and logged.
RumClient rumClient ( WPMCreds  credentials)
Parameters:
credentialsa WPMCreds object.
Returns:
a rum client.
S3Client s3Client ( AWSCreds  credentials)
Parameters:
credentialsan AWSCreds object
Returns:
an S3Client object.
SMSClient smsClient ( object  credentials)
Parameters:
credentialsa Native object which must contains
  • type type must be set to twilio
  • account the twilio account id
  • token the twilio api token
Returns:
a SMSClient object
Template template ( string  templateName)

Returns a new Template object. Currently only returns a mustache template which is used to generate html for the alert emails. Use this function in your alert policy by calling neustar.template. You can provide the name of your own mustache template. The mustache template name must be one of your data files, or the three default email templates.

Parameters:
templateNameA string of the template name.
string toJSON ( object  object)

Returns a string which is a JSON representation of a javascript object

Parameters:
objecta javascript object to serialize
Returns:
a string of JSON
WPMCreds wpmCreds ( object  credentials)

Create new WPM Credentials

Parameters:
credentialsa javascript object that may contain
  • username The username which has the WPM Credential to use

    Alternatively, you can specify the credentials explicitly, using the following attributes.

  • key The key
  • secret The secret key
Returns:
an AWSCredential object.
 All Classes Functions