Module

environments

A Module to assist the interaction with an xMatters instance.

View Source environments.js, line 5

Methods

# inner copy(env) → {module:environments.xMattersEnvironment}

creates a new environment using existing environment.
Parameters:
Name Type Description
env module:environments.xMattersEnvironment The xmtoolbox representation of an xMatters instance.

View Source environments.js, line 211

# inner create(subdomain, user, pass, options) → {module:environments.xMattersEnvironment}

Create a representation of an xMatters instance with credentials, url, connection management, and logging. The returned object is used to perform other operations in xmtoolbox.
Parameters:
Name Type Description
subdomain string xMatters Instance subdomain. Example: https://SUBDOMAIN.xmatters.com
user string xMatters username or API Key from user with REST Web Service User Role
pass string Password for user, API key secret for API key, OR encryption key for .xmpw password file if file exists. File name: subdomain.xmpw in main directory of project. Password needs to be an xMatters password. No SSO/SAML passwords.
options module:environments.EnvironmentOptions

View Source environments.js, line 91

Type Definitions

# EnvironmentOptions

Properties:
Name Type Description
logLevel string The level of logging to output for this environment.

Default 'error'

Set to one of:
- 'silent': No console logging
- 'error': Only Errors
- 'warn': Errors and warnings.
- 'info': Errors, warnings, and information.
- 'debug': All console messages.
logPath string The file path where processing output can be written. Output is always appended.
readOnly boolean Whether or not writes and deletes are allowed in this environment.

Default: false

Note: util.post() does not abide by this option.
Set to one of:

- true: Deleting, Updating, and Creating data in xMatters is skipped. returns the intended object as if it was from xMatters.
- false: All operations are allowed in the xMatters instance.
* @property {boolean} proxy Enable proxy support by configuring this option.

Default: undefined

Example:

proxy: { port: 3123, host: '10.10.2.200' }
Default Value:
  • {logLevel: 'error', readOnly: false}

View Source environments.js, line 40

Object

# Log

Properties:
Name Type Description
error function implements the console.error function if logLevel allows.
info function implements the console.info function if logLevel allows.
log function implements the console.log function if logLevel allows.
warn function implements the console.warn function if logLevel allows.

View Source environments.js, line 10

object

# xMattersEnvironment

Properties:
Name Type Description
subdomain string xMatters Instance subdomain. Example: https://SUBDOMAIN.xmatters.com
auth string A request auth object.
baseUrl string The base url for the xMatters instance.
limiter string a task limiter for managing the concurrent connections with xMatters.
log module:environments.Log The logging object used to write to the console at the set loglevel only. More information is available here: https://github.com/pimterry/loglevel
errors Array.<Object> array of errors that are generated.
logErrors function function to write out errors to the [console] log.

View Source environments.js, line 20