Zabbix is an open source monitoring software that can monitor pretty much everything like networks, servers, applications, etc. You may learn more about Zabbix at www.zabbix.com.
48 |
Zabbix-promise is a JavaScript package for Node.js runtime environment to interact with Zabbix APIs. The package is written to support JavaScript Promise and Async/await interfaces. Zabbix-promise implements Zabbix sender protocol in pure JavaScript code, and there are no other package dependencies, just the Node.js runtime.
const req = require('./wrapper')
30 | const util = require('util')
31 |
32 | const debug = util.debuglog('zp:api')
33 |
34 | /**
35 | * Zabbix class represents the Zabbix API Client to make JSON-RPC 2.0 protocol
36 | * compliant HTTP POST requests. You instantiate a class with an object that
37 | * includes the required properties listed below, and then you should call the
38 | * login method first to get the valid authentication token. Now you are ready
39 | * to make other Zabbix API calls and don't forget to call the logout method
40 | * when you are done.
41 | */
42 | class Zabbix {
43 | /**
44 | * The constructor creates an instance of Zabbix class.
45 | *
46 | * @param {object} opts - An object contains the details about Zabbix API
47 | * server like url, username, password and an optional object for any other
48 | * Node.js HTTP options the user may want to send with the request.
49 | * @property {string} url - The URL of the Zabbix API endpoint.
50 | * @property {string} user - The login name for authentication.
51 | * @property {string} password - The password for authentication.
52 | * @property {object} [options] - Any Nodejs HTTP request supported options.
53 | *
54 | * @example
55 | * new Zabbix({
56 | * url: 'https://127.0.0.1:8443/api_jsonrpc.php',
57 | * user: 'Admin',
58 | * password: 'zabbix',
59 | * options: {
60 | * rejectUnauthorized: false
61 | * }
62 | * })
63 | */
64 | constructor (opts) {
65 | this.url = opts.url
66 | this.user = opts.user
67 | this.password = opts.password
68 | this.options = opts.options || {}
69 | this.auth = null
70 |
71 | debug('Constructor options: %o', opts)
72 | }
73 |
74 | /**
75 | * A request method to make Zabbix API calls.
76 | *
77 | * @param {string} method - the Zabbix API method being called.
78 | * @param {object|array} params - The parameters that will be passed to the
79 | * Zabbix API method.
80 | *
81 | * @returns {Promise} - a promise which resolves to the http response from the
82 | * Zabbix server of string, object or array type.
83 | *
84 | * @example
85 | * Zabbix.request('host.get', { limit: 1 })
86 | */
87 | async request (method, params) {
88 | try {
89 | const res = await req.post({
90 | url: this.url,
91 | auth: this.auth,
92 | options: this.options,
93 | method,
94 | params
95 | })
96 | debug('API Request response: %o', res)
97 | if (res.result) {
98 | return res.result
99 | } else {
100 | throw JSON.stringify(res)
101 | }
102 | } catch (error) {
103 | throw error
104 | }
105 | }
106 |
107 | /**
108 | * A login method to authenticate with Zabbix.
109 | *
110 | * @returns {Promise} - a promise which resolves to the http response from the
111 | * Zabbix server of string type authentication token.
112 | *
113 | * @example
114 | * Zabbix.login()
115 | */
116 | async login () {
117 | try {
118 | const result = await this.request('user.login', {
119 | user: this.user,
120 | password: this.password
121 | })
122 | this.auth = result
123 | return result
124 | } catch (error) {
125 | throw error
126 | }
127 | }
128 |
129 | /**
130 | * A logout method to close the Zabbix server session.
131 | *
132 | * @returns {Promise} - a promise which resolves to the http response from the
133 | * Zabbix server of boolean truthy value.
134 | *
135 | * @example
136 | * Zabbix.logout()
137 | */
138 | async logout () {
139 | try {
140 | const result = await this.request('user.logout', [])
141 | this.auth = null
142 | return result
143 | } catch (error) {
144 | throw error
145 | } finally {
146 | this.auth = null
147 | }
148 | }
149 | }
150 |
151 | module.exports = Zabbix
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
164 |
165 |
166 |
167 |
170 |
171 |
172 |
173 |
174 |
175 |
--------------------------------------------------------------------------------
/lib/utils.js:
--------------------------------------------------------------------------------
1 | const net = require('net')
2 | const util = require('util')
3 | const Zabbix = require('./api')
4 |
5 | const debug = util.debuglog('zp:utils')
6 |
7 | /**
8 | * Class extending Zabbix APIs to useful utility methods.
9 | * @extends Zabbix
10 | */
11 | class Client extends Zabbix {
12 | /**
13 | * The sender method implements the Zabbix Sender protocol natively in
14 | * JavaScript. There is no need to authenticate with Zabbix to use sender
15 | * method. Just pass an object with server, host, key and value properties.
16 | *
17 | * @param {object} options - An object contains the payload to send to Zabbix
18 | * sender.
19 | * @property {integer} [port] - Zabbix server port to receive sender traffic.
20 | * Defaults to 10051.
21 | * @property {string} server - Zabbix server name or IP address
22 | * @property {string} host - Zabbix host as configured in frontend
23 | * @property {string} key - Zabbix host item key
24 | * @property {(string|number)} value - The value to send
25 | *
26 | * @example
27 | * Client.sender({
28 | * server: '127.0.0.1',
29 | * host: 'zabbix.host',
30 | * key: 'item.test.key',
31 | * value: 'Hey there!'
32 | * })
33 | */
34 | static async sender (options) {
35 | try {
36 | if (!options.server) throw new Error('"server" is missing')
37 | if (!options.host) throw new Error('"host" is missing')
38 | if (!options.key) throw new Error('"key" is missing')
39 | if (!options.value) throw new Error('"value" is missing')
40 |
41 | debug('Options received: %o', options)
42 |
43 | /**
44 | * Zabbix sender request message.
45 | * https://www.zabbix.com/documentation/4.0/manual/appendix/items/trapper
46 | */
47 | const payload = {
48 | request: 'sender data',
49 | data: [
50 | {
51 | host: options.host,
52 | key: options.key,
53 | value: options.value
54 | }
55 | ]
56 | }
57 |
58 | // Creates a new Buffer containing payload string.
59 | const payloadBuffer = Buffer.from(JSON.stringify(payload))
60 |
61 | /**
62 | * Returns the actual byte length of a string. This is not the same as
63 | * String.prototype.length since that returns the number of characters in
64 | * A string. When string is a Buffer, the actual byte length is returned.
65 | */
66 | const payloadByteLength = Buffer.byteLength(payloadBuffer)
67 |
68 | /*
69 | * Zabbix sender request and response messages must begin with header
70 | * And data length. Here is the link describing all the headers,
71 | * https://www.zabbix.com/documentation/4.0/manual/appendix/protocols/header_datalen
72 | *
73 | * The code below allocates a new Buffer of size 13 bytes and write the
74 | * header information.
75 | */
76 | const headerBuffer = Buffer.alloc(4 + 1 + 4 + 4)
77 | headerBuffer.write('ZBXD\x01')
78 | headerBuffer.writeUInt32LE(payloadByteLength, 5)
79 | headerBuffer.write('\x00\x00\x00\x00', 9)
80 |
81 | /*
82 | * Returns a new Buffer which is the result of concatenating the header and
83 | * Payload buffers.
84 | */
85 | const packet = Buffer.concat([headerBuffer, payloadBuffer])
86 |
87 | const serverResponse = await new Promise((resolve, reject) => {
88 | /**
89 | * Initiates connection to Zabbix server or proxy and sends the packet.
90 | */
91 | const client = net.connect({
92 | port: options.port || 10051,
93 | host: options.server
94 | }, () => {
95 | debug('Connected to server: %s', options.server)
96 | client.write(packet)
97 | })
98 |
99 | /**
100 | * Emitted when data is received. The argument data will be a Buffer or
101 | * String. By default, no encoding is assigned and stream data will be
102 | * returned as Buffer objects. Note that the data will be lost if there
103 | * is no listener when a Socket emits a 'data' event.
104 | */
105 | client.on('data', (data) => {
106 | debug('Server response raw: %s', data.toString())
107 | const jsonData = JSON.parse(data.slice(13).toString())
108 | debug('Server response parsed JSON: %j', jsonData)
109 | client.end()
110 |
111 | // Read the Zabbix server response and reject the promise with the
112 | // error message.
113 | const errorMessage = `${data.toString()}\n` + 'A few things to check,\n' +
114 | '- Double check the host and item key name in Zabbix\n' +
115 | '- Double check the item configuration e.g. item type, data type and etc.\n' +
116 | '- If using Zabbix proxy then ensure cache is updated.'
117 | const failed = jsonData.info.split(';')[1].slice(-1)
118 | if (failed !== '0') {
119 | reject(new Error(errorMessage))
120 | }
121 | resolve(jsonData)
122 | })
123 |
124 | /**
125 | * Emitted when an error occurs. The 'close' event will be called
126 | * directly following this event.
127 | */
128 | client.on('error', (error) => {
129 | debug('Server response: %o', error)
130 | reject(error)
131 | })
132 |
133 | /**
134 | * Emitted when the other end of the socket sends a FIN packet, thus
135 | * ending the readable side of the socket.
136 | */
137 | client.on('end', () => {
138 | debug('Connection closed.')
139 | })
140 | })
141 |
142 | return serverResponse
143 | } catch (error) {
144 | throw error
145 | }
146 | }
147 | }
148 |
149 | module.exports = Client
150 |
--------------------------------------------------------------------------------
/test/acceptance.test.js:
--------------------------------------------------------------------------------
1 | const Zabbix = require('../index')
2 | const t = require('tap')
3 | const test = t.test
4 |
5 | const zabbix = new Zabbix({
6 | url: 'http://127.0.0.1:8080/api_jsonrpc.php',
7 | user: 'Admin',
8 | password: 'zabbix'
9 | })
10 |
11 | // We need host group name to create a new host group and it will return the
12 | // group id that we will store in hostGroupId. We need host group id to create
13 | // a new host later.
14 | const hostGroupName = 'zabbix-promise-group'
15 | let hostGroupId = null
16 |
17 | // We need host name to create a new host and it will return the host id that we
18 | // will store in hostId. We need host id to create a new item later.
19 | const hostName = 'zabbix-promise-host'
20 | let hostId = null
21 |
22 | // We need item name and key to create Zabbix trapper item.
23 | const itemName = 'zabbix-promise-item'
24 | const itemKey = 'zabbix.promise.key'
25 |
26 | const main = async () => {
27 | await test('User login', async t => {
28 | await t.resolves(zabbix.login())
29 |
30 | t.type(await new Zabbix({
31 | url: 'http://127.0.0.1:8080/api_jsonrpc.php',
32 | user: 'Admin',
33 | password: 'zabbix'
34 | }).login(), 'string', 'return value type is string')
35 |
36 | // Wrong username
37 | t.rejects(new Zabbix({
38 | url: 'http://127.0.0.1:8080/api_jsonrpc.php',
39 | user: 'Admin1',
40 | password: 'zabbix'
41 | }).login(), 'expect rejected Promise for wrong username')
42 |
43 | // Wrong password
44 | t.rejects(new Zabbix({
45 | url: 'http://127.0.0.1:8080/api_jsonrpc.php',
46 | user: 'Admin',
47 | password: 'zabbix1'
48 | }).login(), 'expect rejected Promise for wrong password')
49 |
50 | // Wrong port
51 | t.rejects(new Zabbix({
52 | url: 'http://127.0.0.1:80801/api_jsonrpc.php',
53 | user: 'Admin',
54 | password: 'zabbix'
55 | }).login(), 'expect rejected Promise for wrong URL')
56 |
57 | // HTTPS URL
58 | t.rejects(new Zabbix({
59 | url: 'https://localhost:8080/api_jsonrpc.php',
60 | user: 'Admin',
61 | password: 'zabbix'
62 | }).login(), 'expect rejected Promise for HTTPS')
63 | })
64 |
65 | await test('Create hostgroup', async t => {
66 | const result = await zabbix.request('hostgroup.get', {
67 | filter: { name: hostGroupName }
68 | })
69 | if (result.length === 0) {
70 | const value = await zabbix.request('hostgroup.create', { name: hostGroupName })
71 | hostGroupId = value.groupids[0]
72 | t.match(hostGroupId, /[0-9]+/g, `${hostGroupName} created`)
73 | } else {
74 | hostGroupId = result[0].groupid
75 | t.match(hostGroupId, /[0-9]+/g, `${hostGroupName} already exists`)
76 | }
77 | })
78 |
79 | await test('Create host', async t => {
80 | const result = await zabbix.request('host.get', {
81 | filter: { host: hostName }
82 | })
83 | if (result.length === 0) {
84 | const value = await zabbix.request('host.create', {
85 | host: hostName,
86 | groups: [{ groupid: hostGroupId }],
87 | interfaces: [{
88 | type: 1,
89 | main: 1,
90 | useip: 1,
91 | ip: '127.0.0.1',
92 | dns: '',
93 | port: '10050'
94 | }]
95 | })
96 | hostId = value.hostids[0]
97 | t.match(hostId, /[0-9]+/g, `${hostName} created`)
98 | } else {
99 | hostId = result[0].hostid
100 | t.match(hostId, /[0-9]+/g, `${hostName} already exists`)
101 | }
102 | })
103 |
104 | await test('Create item', async t => {
105 | const result = await zabbix.request('item.get', {
106 | hostids: hostId,
107 | search: { key_: itemKey }
108 | })
109 | if (result.length === 0) {
110 | const value = await zabbix.request('item.create', {
111 | hostid: hostId,
112 | key_: itemKey,
113 | name: itemName,
114 | type: 2, // 2 - Zabbix trapper
115 | value_type: 0 // 0 - numeric float
116 | })
117 | t.match(value.itemids[0], /[0-9]+/g, `${itemName} created, please wait for 60 seconds.`)
118 | await new Promise(resolve => setTimeout(resolve, 60000))
119 | } else {
120 | t.match(result[0].itemid, /[0-9]+/g, `${itemName} already exists`)
121 | }
122 | })
123 |
124 | await test('Zabbix sender', async t => {
125 | t.resolves(Zabbix.sender({
126 | server: '127.0.0.1',
127 | host: hostName,
128 | key: itemKey,
129 | value: Math.random()
130 | }))
131 |
132 | // Wrong host name
133 | t.rejects(Zabbix.sender({
134 | server: '127.0.0.1',
135 | host: hostName + 'zabbix',
136 | key: itemKey,
137 | value: Math.random()
138 | }), 'expect rejected Promise for wrong host name')
139 |
140 | // Wrong port
141 | t.rejects(Zabbix.sender({
142 | server: '127.0.0.1',
143 | port: 1234,
144 | host: hostName,
145 | key: itemKey,
146 | value: Math.random()
147 | }), 'expect rejected Promise for wrong server port')
148 |
149 | // Missing server
150 | t.rejects(Zabbix.sender({
151 | host: hostName,
152 | key: itemKey,
153 | value: Math.random()
154 | }), 'expect rejected Promise for missing server')
155 |
156 | // Missing host
157 | t.rejects(Zabbix.sender({
158 | server: '127.0.0.1',
159 | key: itemKey,
160 | value: Math.random()
161 | }), 'expect rejected Promise for missing host')
162 |
163 | // Missing key
164 | t.rejects(Zabbix.sender({
165 | server: '127.0.0.1',
166 | host: hostName,
167 | value: Math.random()
168 | }), 'expect rejected Promise for missing key')
169 |
170 | // Missing value
171 | t.rejects(Zabbix.sender({
172 | server: '127.0.0.1',
173 | host: hostName,
174 | key: itemKey
175 | }), 'expect rejected Promise for missing value')
176 | })
177 |
178 | await test('User logout', async t => {
179 | await t.resolveMatch(zabbix.logout(), /true/g)
180 | t.rejects(zabbix.logout())
181 | })
182 | }
183 | main()
184 |
--------------------------------------------------------------------------------
/docs/utils.js.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | JSDoc: Source: utils.js
6 |
7 |
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
Source: utils.js
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
const net = require('net')
30 | const util = require('util')
31 | const Zabbix = require('./api')
32 |
33 | const debug = util.debuglog('zp:utils')
34 |
35 | /**
36 | * Class extending Zabbix APIs to useful utility methods.
37 | * @extends Zabbix
38 | */
39 | class Client extends Zabbix {
40 | /**
41 | * The sender method implements the Zabbix Sender protocol natively in
42 | * JavaScript. There is no need to authenticate with Zabbix to use sender
43 | * method. Just pass an object with server, host, key and value properties.
44 | *
45 | * @param {object} options - An object contains the payload to send to Zabbix
46 | * sender.
47 | * @property {integer} [port] - Zabbix server port to receive sender traffic.
48 | * Defaults to 10051.
49 | * @property {string} server - Zabbix server name or IP address
50 | * @property {string} host - Zabbix host as configured in frontend
51 | * @property {string} key - Zabbix host item key
52 | * @property {(string|number)} value - The value to send
53 | *
54 | * @example
55 | * Client.sender({
56 | * server: '127.0.0.1',
57 | * host: 'zabbix.host',
58 | * key: 'item.test.key',
59 | * value: 'Hey there!'
60 | * })
61 | */
62 | static async sender (options) {
63 | try {
64 | if (!options.server) throw new Error('"server" is missing')
65 | if (!options.host) throw new Error('"host" is missing')
66 | if (!options.key) throw new Error('"key" is missing')
67 | if (!options.value) throw new Error('"value" is missing')
68 |
69 | debug('Options received: %o', options)
70 |
71 | /**
72 | * Zabbix sender request message.
73 | * https://www.zabbix.com/documentation/4.0/manual/appendix/items/trapper
74 | */
75 | const payload = {
76 | request: 'sender data',
77 | data: [
78 | {
79 | host: options.host,
80 | key: options.key,
81 | value: options.value
82 | }
83 | ]
84 | }
85 |
86 | // Creates a new Buffer containing payload string.
87 | const payloadBuffer = Buffer.from(JSON.stringify(payload))
88 |
89 | /**
90 | * Returns the actual byte length of a string. This is not the same as
91 | * String.prototype.length since that returns the number of characters in
92 | * A string. When string is a Buffer, the actual byte length is returned.
93 | */
94 | const payloadByteLength = Buffer.byteLength(payloadBuffer)
95 |
96 | /*
97 | * Zabbix sender request and response messages must begin with header
98 | * And data length. Here is the link describing all the headers,
99 | * https://www.zabbix.com/documentation/4.0/manual/appendix/protocols/header_datalen
100 | *
101 | * The code below allocates a new Buffer of size 13 bytes and write the
102 | * header information.
103 | */
104 | const headerBuffer = Buffer.alloc(4 + 1 + 4 + 4)
105 | headerBuffer.write('ZBXD\x01')
106 | headerBuffer.writeUInt32LE(payloadByteLength, 5)
107 | headerBuffer.write('\x00\x00\x00\x00', 9)
108 |
109 | /*
110 | * Returns a new Buffer which is the result of concatenating the header and
111 | * Payload buffers.
112 | */
113 | const packet = Buffer.concat([headerBuffer, payloadBuffer])
114 |
115 | const serverResponse = await new Promise((resolve, reject) => {
116 | /**
117 | * Initiates connection to Zabbix server or proxy and sends the packet.
118 | */
119 | const client = net.connect({
120 | port: options.port || 10051,
121 | host: options.server
122 | }, () => {
123 | debug('Connected to server: %s', options.server)
124 | client.write(packet)
125 | })
126 |
127 | /**
128 | * Emitted when data is received. The argument data will be a Buffer or
129 | * String. By default, no encoding is assigned and stream data will be
130 | * returned as Buffer objects. Note that the data will be lost if there
131 | * is no listener when a Socket emits a 'data' event.
132 | */
133 | client.on('data', (data) => {
134 | debug('Server response raw: %s', data.toString())
135 | const jsonData = JSON.parse(data.slice(13).toString())
136 | debug('Server response parsed JSON: %j', jsonData)
137 | client.end()
138 |
139 | // Read the Zabbix server response and reject the promise with the
140 | // error message.
141 | const errorMessage = `${data.toString()}\n` + 'A few things to check,\n' +
142 | '- Double check the host and item key name in Zabbix\n' +
143 | '- Double check the item configuration e.g. item type, data type and etc.\n' +
144 | '- If using Zabbix proxy then ensure cache is updated.'
145 | const failed = jsonData.info.split(';')[1].slice(-1)
146 | if (failed !== '0') {
147 | reject(new Error(errorMessage))
148 | }
149 | resolve(jsonData)
150 | })
151 |
152 | /**
153 | * Emitted when an error occurs. The 'close' event will be called
154 | * directly following this event.
155 | */
156 | client.on('error', (error) => {
157 | debug('Server response: %o', error)
158 | reject(error)
159 | })
160 |
161 | /**
162 | * Emitted when the other end of the socket sends a FIN packet, thus
163 | * ending the readable side of the socket.
164 | */
165 | client.on('end', () => {
166 | debug('Connection closed.')
167 | })
168 | })
169 |
170 | return serverResponse
171 | } catch (error) {
172 | throw error
173 | }
174 | }
175 | }
176 |
177 | module.exports = Client
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
190 |
191 |
192 |
193 |
196 |
197 |
198 |
199 |
200 |
201 |
--------------------------------------------------------------------------------
/docs/styles/jsdoc-default.css:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: 'Open Sans';
3 | font-weight: normal;
4 | font-style: normal;
5 | src: url('../fonts/OpenSans-Regular-webfont.eot');
6 | src:
7 | local('Open Sans'),
8 | local('OpenSans'),
9 | url('../fonts/OpenSans-Regular-webfont.eot?#iefix') format('embedded-opentype'),
10 | url('../fonts/OpenSans-Regular-webfont.woff') format('woff'),
11 | url('../fonts/OpenSans-Regular-webfont.svg#open_sansregular') format('svg');
12 | }
13 |
14 | @font-face {
15 | font-family: 'Open Sans Light';
16 | font-weight: normal;
17 | font-style: normal;
18 | src: url('../fonts/OpenSans-Light-webfont.eot');
19 | src:
20 | local('Open Sans Light'),
21 | local('OpenSans Light'),
22 | url('../fonts/OpenSans-Light-webfont.eot?#iefix') format('embedded-opentype'),
23 | url('../fonts/OpenSans-Light-webfont.woff') format('woff'),
24 | url('../fonts/OpenSans-Light-webfont.svg#open_sanslight') format('svg');
25 | }
26 |
27 | html
28 | {
29 | overflow: auto;
30 | background-color: #fff;
31 | font-size: 14px;
32 | }
33 |
34 | body
35 | {
36 | font-family: 'Open Sans', sans-serif;
37 | line-height: 1.5;
38 | color: #4d4e53;
39 | background-color: white;
40 | }
41 |
42 | a, a:visited, a:active {
43 | color: #0095dd;
44 | text-decoration: none;
45 | }
46 |
47 | a:hover {
48 | text-decoration: underline;
49 | }
50 |
51 | header
52 | {
53 | display: block;
54 | padding: 0px 4px;
55 | }
56 |
57 | tt, code, kbd, samp {
58 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
59 | }
60 |
61 | .class-description {
62 | font-size: 130%;
63 | line-height: 140%;
64 | margin-bottom: 1em;
65 | margin-top: 1em;
66 | }
67 |
68 | .class-description:empty {
69 | margin: 0;
70 | }
71 |
72 | #main {
73 | float: left;
74 | width: 70%;
75 | }
76 |
77 | article dl {
78 | margin-bottom: 40px;
79 | }
80 |
81 | article img {
82 | max-width: 100%;
83 | }
84 |
85 | section
86 | {
87 | display: block;
88 | background-color: #fff;
89 | padding: 12px 24px;
90 | border-bottom: 1px solid #ccc;
91 | margin-right: 30px;
92 | }
93 |
94 | .variation {
95 | display: none;
96 | }
97 |
98 | .signature-attributes {
99 | font-size: 60%;
100 | color: #aaa;
101 | font-style: italic;
102 | font-weight: lighter;
103 | }
104 |
105 | nav
106 | {
107 | display: block;
108 | float: right;
109 | margin-top: 28px;
110 | width: 30%;
111 | box-sizing: border-box;
112 | border-left: 1px solid #ccc;
113 | padding-left: 16px;
114 | }
115 |
116 | nav ul {
117 | font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;
118 | font-size: 100%;
119 | line-height: 17px;
120 | padding: 0;
121 | margin: 0;
122 | list-style-type: none;
123 | }
124 |
125 | nav ul a, nav ul a:visited, nav ul a:active {
126 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
127 | line-height: 18px;
128 | color: #4D4E53;
129 | }
130 |
131 | nav h3 {
132 | margin-top: 12px;
133 | }
134 |
135 | nav li {
136 | margin-top: 6px;
137 | }
138 |
139 | footer {
140 | display: block;
141 | padding: 6px;
142 | margin-top: 12px;
143 | font-style: italic;
144 | font-size: 90%;
145 | }
146 |
147 | h1, h2, h3, h4 {
148 | font-weight: 200;
149 | margin: 0;
150 | }
151 |
152 | h1
153 | {
154 | font-family: 'Open Sans Light', sans-serif;
155 | font-size: 48px;
156 | letter-spacing: -2px;
157 | margin: 12px 24px 20px;
158 | }
159 |
160 | h2, h3.subsection-title
161 | {
162 | font-size: 30px;
163 | font-weight: 700;
164 | letter-spacing: -1px;
165 | margin-bottom: 12px;
166 | }
167 |
168 | h3
169 | {
170 | font-size: 24px;
171 | letter-spacing: -0.5px;
172 | margin-bottom: 12px;
173 | }
174 |
175 | h4
176 | {
177 | font-size: 18px;
178 | letter-spacing: -0.33px;
179 | margin-bottom: 12px;
180 | color: #4d4e53;
181 | }
182 |
183 | h5, .container-overview .subsection-title
184 | {
185 | font-size: 120%;
186 | font-weight: bold;
187 | letter-spacing: -0.01em;
188 | margin: 8px 0 3px 0;
189 | }
190 |
191 | h6
192 | {
193 | font-size: 100%;
194 | letter-spacing: -0.01em;
195 | margin: 6px 0 3px 0;
196 | font-style: italic;
197 | }
198 |
199 | table
200 | {
201 | border-spacing: 0;
202 | border: 0;
203 | border-collapse: collapse;
204 | }
205 |
206 | td, th
207 | {
208 | border: 1px solid #ddd;
209 | margin: 0px;
210 | text-align: left;
211 | vertical-align: top;
212 | padding: 4px 6px;
213 | display: table-cell;
214 | }
215 |
216 | thead tr
217 | {
218 | background-color: #ddd;
219 | font-weight: bold;
220 | }
221 |
222 | th { border-right: 1px solid #aaa; }
223 | tr > th:last-child { border-right: 1px solid #ddd; }
224 |
225 | .ancestors, .attribs { color: #999; }
226 | .ancestors a, .attribs a
227 | {
228 | color: #999 !important;
229 | text-decoration: none;
230 | }
231 |
232 | .clear
233 | {
234 | clear: both;
235 | }
236 |
237 | .important
238 | {
239 | font-weight: bold;
240 | color: #950B02;
241 | }
242 |
243 | .yes-def {
244 | text-indent: -1000px;
245 | }
246 |
247 | .type-signature {
248 | color: #aaa;
249 | }
250 |
251 | .name, .signature {
252 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
253 | }
254 |
255 | .details { margin-top: 14px; border-left: 2px solid #DDD; }
256 | .details dt { width: 120px; float: left; padding-left: 10px; padding-top: 6px; }
257 | .details dd { margin-left: 70px; }
258 | .details ul { margin: 0; }
259 | .details ul { list-style-type: none; }
260 | .details li { margin-left: 30px; padding-top: 6px; }
261 | .details pre.prettyprint { margin: 0 }
262 | .details .object-value { padding-top: 0; }
263 |
264 | .description {
265 | margin-bottom: 1em;
266 | margin-top: 1em;
267 | }
268 |
269 | .code-caption
270 | {
271 | font-style: italic;
272 | font-size: 107%;
273 | margin: 0;
274 | }
275 |
276 | .source
277 | {
278 | border: 1px solid #ddd;
279 | width: 80%;
280 | overflow: auto;
281 | }
282 |
283 | .prettyprint.source {
284 | width: inherit;
285 | }
286 |
287 | .source code
288 | {
289 | font-size: 100%;
290 | line-height: 18px;
291 | display: block;
292 | padding: 4px 12px;
293 | margin: 0;
294 | background-color: #fff;
295 | color: #4D4E53;
296 | }
297 |
298 | .prettyprint code span.line
299 | {
300 | display: inline-block;
301 | }
302 |
303 | .prettyprint.linenums
304 | {
305 | padding-left: 70px;
306 | -webkit-user-select: none;
307 | -moz-user-select: none;
308 | -ms-user-select: none;
309 | user-select: none;
310 | }
311 |
312 | .prettyprint.linenums ol
313 | {
314 | padding-left: 0;
315 | }
316 |
317 | .prettyprint.linenums li
318 | {
319 | border-left: 3px #ddd solid;
320 | }
321 |
322 | .prettyprint.linenums li.selected,
323 | .prettyprint.linenums li.selected *
324 | {
325 | background-color: lightyellow;
326 | }
327 |
328 | .prettyprint.linenums li *
329 | {
330 | -webkit-user-select: text;
331 | -moz-user-select: text;
332 | -ms-user-select: text;
333 | user-select: text;
334 | }
335 |
336 | .params .name, .props .name, .name code {
337 | color: #4D4E53;
338 | font-family: Consolas, Monaco, 'Andale Mono', monospace;
339 | font-size: 100%;
340 | }
341 |
342 | .params td.description > p:first-child,
343 | .props td.description > p:first-child
344 | {
345 | margin-top: 0;
346 | padding-top: 0;
347 | }
348 |
349 | .params td.description > p:last-child,
350 | .props td.description > p:last-child
351 | {
352 | margin-bottom: 0;
353 | padding-bottom: 0;
354 | }
355 |
356 | .disabled {
357 | color: #454545;
358 | }
359 |
--------------------------------------------------------------------------------
/docs/scripts/prettify/Apache-License-2.0.txt:
--------------------------------------------------------------------------------
1 |
2 | Apache License
3 | Version 2.0, January 2004
4 | http://www.apache.org/licenses/
5 |
6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7 |
8 | 1. Definitions.
9 |
10 | "License" shall mean the terms and conditions for use, reproduction,
11 | and distribution as defined by Sections 1 through 9 of this document.
12 |
13 | "Licensor" shall mean the copyright owner or entity authorized by
14 | the copyright owner that is granting the License.
15 |
16 | "Legal Entity" shall mean the union of the acting entity and all
17 | other entities that control, are controlled by, or are under common
18 | control with that entity. For the purposes of this definition,
19 | "control" means (i) the power, direct or indirect, to cause the
20 | direction or management of such entity, whether by contract or
21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
22 | outstanding shares, or (iii) beneficial ownership of such entity.
23 |
24 | "You" (or "Your") shall mean an individual or Legal Entity
25 | exercising permissions granted by this License.
26 |
27 | "Source" form shall mean the preferred form for making modifications,
28 | including but not limited to software source code, documentation
29 | source, and configuration files.
30 |
31 | "Object" form shall mean any form resulting from mechanical
32 | transformation or translation of a Source form, including but
33 | not limited to compiled object code, generated documentation,
34 | and conversions to other media types.
35 |
36 | "Work" shall mean the work of authorship, whether in Source or
37 | Object form, made available under the License, as indicated by a
38 | copyright notice that is included in or attached to the work
39 | (an example is provided in the Appendix below).
40 |
41 | "Derivative Works" shall mean any work, whether in Source or Object
42 | form, that is based on (or derived from) the Work and for which the
43 | editorial revisions, annotations, elaborations, or other modifications
44 | represent, as a whole, an original work of authorship. For the purposes
45 | of this License, Derivative Works shall not include works that remain
46 | separable from, or merely link (or bind by name) to the interfaces of,
47 | the Work and Derivative Works thereof.
48 |
49 | "Contribution" shall mean any work of authorship, including
50 | the original version of the Work and any modifications or additions
51 | to that Work or Derivative Works thereof, that is intentionally
52 | submitted to Licensor for inclusion in the Work by the copyright owner
53 | or by an individual or Legal Entity authorized to submit on behalf of
54 | the copyright owner. For the purposes of this definition, "submitted"
55 | means any form of electronic, verbal, or written communication sent
56 | to the Licensor or its representatives, including but not limited to
57 | communication on electronic mailing lists, source code control systems,
58 | and issue tracking systems that are managed by, or on behalf of, the
59 | Licensor for the purpose of discussing and improving the Work, but
60 | excluding communication that is conspicuously marked or otherwise
61 | designated in writing by the copyright owner as "Not a Contribution."
62 |
63 | "Contributor" shall mean Licensor and any individual or Legal Entity
64 | on behalf of whom a Contribution has been received by Licensor and
65 | subsequently incorporated within the Work.
66 |
67 | 2. Grant of Copyright License. Subject to the terms and conditions of
68 | this License, each Contributor hereby grants to You a perpetual,
69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70 | copyright license to reproduce, prepare Derivative Works of,
71 | publicly display, publicly perform, sublicense, and distribute the
72 | Work and such Derivative Works in Source or Object form.
73 |
74 | 3. Grant of Patent License. Subject to the terms and conditions of
75 | this License, each Contributor hereby grants to You a perpetual,
76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77 | (except as stated in this section) patent license to make, have made,
78 | use, offer to sell, sell, import, and otherwise transfer the Work,
79 | where such license applies only to those patent claims licensable
80 | by such Contributor that are necessarily infringed by their
81 | Contribution(s) alone or by combination of their Contribution(s)
82 | with the Work to which such Contribution(s) was submitted. If You
83 | institute patent litigation against any entity (including a
84 | cross-claim or counterclaim in a lawsuit) alleging that the Work
85 | or a Contribution incorporated within the Work constitutes direct
86 | or contributory patent infringement, then any patent licenses
87 | granted to You under this License for that Work shall terminate
88 | as of the date such litigation is filed.
89 |
90 | 4. Redistribution. You may reproduce and distribute copies of the
91 | Work or Derivative Works thereof in any medium, with or without
92 | modifications, and in Source or Object form, provided that You
93 | meet the following conditions:
94 |
95 | (a) You must give any other recipients of the Work or
96 | Derivative Works a copy of this License; and
97 |
98 | (b) You must cause any modified files to carry prominent notices
99 | stating that You changed the files; and
100 |
101 | (c) You must retain, in the Source form of any Derivative Works
102 | that You distribute, all copyright, patent, trademark, and
103 | attribution notices from the Source form of the Work,
104 | excluding those notices that do not pertain to any part of
105 | the Derivative Works; and
106 |
107 | (d) If the Work includes a "NOTICE" text file as part of its
108 | distribution, then any Derivative Works that You distribute must
109 | include a readable copy of the attribution notices contained
110 | within such NOTICE file, excluding those notices that do not
111 | pertain to any part of the Derivative Works, in at least one
112 | of the following places: within a NOTICE text file distributed
113 | as part of the Derivative Works; within the Source form or
114 | documentation, if provided along with the Derivative Works; or,
115 | within a display generated by the Derivative Works, if and
116 | wherever such third-party notices normally appear. The contents
117 | of the NOTICE file are for informational purposes only and
118 | do not modify the License. You may add Your own attribution
119 | notices within Derivative Works that You distribute, alongside
120 | or as an addendum to the NOTICE text from the Work, provided
121 | that such additional attribution notices cannot be construed
122 | as modifying the License.
123 |
124 | You may add Your own copyright statement to Your modifications and
125 | may provide additional or different license terms and conditions
126 | for use, reproduction, or distribution of Your modifications, or
127 | for any such Derivative Works as a whole, provided Your use,
128 | reproduction, and distribution of the Work otherwise complies with
129 | the conditions stated in this License.
130 |
131 | 5. Submission of Contributions. Unless You explicitly state otherwise,
132 | any Contribution intentionally submitted for inclusion in the Work
133 | by You to the Licensor shall be under the terms and conditions of
134 | this License, without any additional terms or conditions.
135 | Notwithstanding the above, nothing herein shall supersede or modify
136 | the terms of any separate license agreement you may have executed
137 | with Licensor regarding such Contributions.
138 |
139 | 6. Trademarks. This License does not grant permission to use the trade
140 | names, trademarks, service marks, or product names of the Licensor,
141 | except as required for reasonable and customary use in describing the
142 | origin of the Work and reproducing the content of the NOTICE file.
143 |
144 | 7. Disclaimer of Warranty. Unless required by applicable law or
145 | agreed to in writing, Licensor provides the Work (and each
146 | Contributor provides its Contributions) on an "AS IS" BASIS,
147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148 | implied, including, without limitation, any warranties or conditions
149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150 | PARTICULAR PURPOSE. You are solely responsible for determining the
151 | appropriateness of using or redistributing the Work and assume any
152 | risks associated with Your exercise of permissions under this License.
153 |
154 | 8. Limitation of Liability. In no event and under no legal theory,
155 | whether in tort (including negligence), contract, or otherwise,
156 | unless required by applicable law (such as deliberate and grossly
157 | negligent acts) or agreed to in writing, shall any Contributor be
158 | liable to You for damages, including any direct, indirect, special,
159 | incidental, or consequential damages of any character arising as a
160 | result of this License or out of the use or inability to use the
161 | Work (including but not limited to damages for loss of goodwill,
162 | work stoppage, computer failure or malfunction, or any and all
163 | other commercial damages or losses), even if such Contributor
164 | has been advised of the possibility of such damages.
165 |
166 | 9. Accepting Warranty or Additional Liability. While redistributing
167 | the Work or Derivative Works thereof, You may choose to offer,
168 | and charge a fee for, acceptance of support, warranty, indemnity,
169 | or other liability obligations and/or rights consistent with this
170 | License. However, in accepting such obligations, You may act only
171 | on Your own behalf and on Your sole responsibility, not on behalf
172 | of any other Contributor, and only if You agree to indemnify,
173 | defend, and hold each Contributor harmless for any liability
174 | incurred by, or claims asserted against, such Contributor by reason
175 | of your accepting any such warranty or additional liability.
176 |
177 | END OF TERMS AND CONDITIONS
178 |
179 | APPENDIX: How to apply the Apache License to your work.
180 |
181 | To apply the Apache License to your work, attach the following
182 | boilerplate notice, with the fields enclosed by brackets "[]"
183 | replaced with your own identifying information. (Don't include
184 | the brackets!) The text should be enclosed in the appropriate
185 | comment syntax for the file format. We also recommend that a
186 | file or class name and description of purpose be included on the
187 | same "printed page" as the copyright notice for easier
188 | identification within third-party archives.
189 |
190 | Copyright [yyyy] [name of copyright owner]
191 |
192 | Licensed under the Apache License, Version 2.0 (the "License");
193 | you may not use this file except in compliance with the License.
194 | You may obtain a copy of the License at
195 |
196 | http://www.apache.org/licenses/LICENSE-2.0
197 |
198 | Unless required by applicable law or agreed to in writing, software
199 | distributed under the License is distributed on an "AS IS" BASIS,
200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201 | See the License for the specific language governing permissions and
202 | limitations under the License.
203 |
--------------------------------------------------------------------------------
/docs/scripts/prettify/prettify.js:
--------------------------------------------------------------------------------
1 | var q=null;window.PR_SHOULD_USE_CONTINUATION=!0;
2 | (function(){function L(a){function m(a){var f=a.charCodeAt(0);if(f!==92)return f;var b=a.charAt(1);return(f=r[b])?f:"0"<=b&&b<="7"?parseInt(a.substring(1),8):b==="u"||b==="x"?parseInt(a.substring(2),16):a.charCodeAt(1)}function e(a){if(a<32)return(a<16?"\\x0":"\\x")+a.toString(16);a=String.fromCharCode(a);if(a==="\\"||a==="-"||a==="["||a==="]")a="\\"+a;return a}function h(a){for(var f=a.substring(1,a.length-1).match(/\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\[0-3][0-7]{0,2}|\\[0-7]{1,2}|\\[\S\s]|[^\\]/g),a=
3 | [],b=[],o=f[0]==="^",c=o?1:0,i=f.length;c122||(d<65||j>90||b.push([Math.max(65,j)|32,Math.min(d,90)|32]),d<97||j>122||b.push([Math.max(97,j)&-33,Math.min(d,122)&-33]))}}b.sort(function(a,f){return a[0]-f[0]||f[1]-a[1]});f=[];j=[NaN,NaN];for(c=0;ci[0]&&(i[1]+1>i[0]&&b.push("-"),b.push(e(i[1])));b.push("]");return b.join("")}function y(a){for(var f=a.source.match(/\[(?:[^\\\]]|\\[\S\s])*]|\\u[\dA-Fa-f]{4}|\\x[\dA-Fa-f]{2}|\\\d+|\\[^\dux]|\(\?[!:=]|[()^]|[^()[\\^]+/g),b=f.length,d=[],c=0,i=0;c=2&&a==="["?f[c]=h(j):a!=="\\"&&(f[c]=j.replace(/[A-Za-z]/g,function(a){a=a.charCodeAt(0);return"["+String.fromCharCode(a&-33,a|32)+"]"}));return f.join("")}for(var t=0,s=!1,l=!1,p=0,d=a.length;p=5&&"lang-"===b.substring(0,5))&&!(o&&typeof o[1]==="string"))c=!1,b="src";c||(r[f]=b)}i=d;d+=f.length;if(c){c=o[1];var j=f.indexOf(c),k=j+c.length;o[2]&&(k=f.length-o[2].length,j=k-c.length);b=b.substring(5);B(l+i,f.substring(0,j),e,p);B(l+i+j,c,C(b,c),p);B(l+i+k,f.substring(k),e,p)}else p.push(l+i,b)}a.e=p}var h={},y;(function(){for(var e=a.concat(m),
9 | l=[],p={},d=0,g=e.length;d=0;)h[n.charAt(k)]=r;r=r[1];n=""+r;p.hasOwnProperty(n)||(l.push(r),p[n]=q)}l.push(/[\S\s]/);y=L(l)})();var t=m.length;return e}function u(a){var m=[],e=[];a.tripleQuotedStrings?m.push(["str",/^(?:'''(?:[^'\\]|\\[\S\s]|''?(?=[^']))*(?:'''|$)|"""(?:[^"\\]|\\[\S\s]|""?(?=[^"]))*(?:"""|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$))/,q,"'\""]):a.multiLineStrings?m.push(["str",/^(?:'(?:[^'\\]|\\[\S\s])*(?:'|$)|"(?:[^"\\]|\\[\S\s])*(?:"|$)|`(?:[^\\`]|\\[\S\s])*(?:`|$))/,
10 | q,"'\"`"]):m.push(["str",/^(?:'(?:[^\n\r'\\]|\\.)*(?:'|$)|"(?:[^\n\r"\\]|\\.)*(?:"|$))/,q,"\"'"]);a.verbatimStrings&&e.push(["str",/^@"(?:[^"]|"")*(?:"|$)/,q]);var h=a.hashComments;h&&(a.cStyleComments?(h>1?m.push(["com",/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,q,"#"]):m.push(["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\n\r]*)/,q,"#"]),e.push(["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,q])):m.push(["com",/^#[^\n\r]*/,
11 | q,"#"]));a.cStyleComments&&(e.push(["com",/^\/\/[^\n\r]*/,q]),e.push(["com",/^\/\*[\S\s]*?(?:\*\/|$)/,q]));a.regexLiterals&&e.push(["lang-regex",/^(?:^^\.?|[!+-]|!=|!==|#|%|%=|&|&&|&&=|&=|\(|\*|\*=|\+=|,|-=|->|\/|\/=|:|::|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|[?@[^]|\^=|\^\^|\^\^=|{|\||\|=|\|\||\|\|=|~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\s*(\/(?=[^*/])(?:[^/[\\]|\\[\S\s]|\[(?:[^\\\]]|\\[\S\s])*(?:]|$))+\/)/]);(h=a.types)&&e.push(["typ",h]);a=(""+a.keywords).replace(/^ | $/g,
12 | "");a.length&&e.push(["kwd",RegExp("^(?:"+a.replace(/[\s,]+/g,"|")+")\\b"),q]);m.push(["pln",/^\s+/,q," \r\n\t\xa0"]);e.push(["lit",/^@[$_a-z][\w$@]*/i,q],["typ",/^(?:[@_]?[A-Z]+[a-z][\w$@]*|\w+_t\b)/,q],["pln",/^[$_a-z][\w$@]*/i,q],["lit",/^(?:0x[\da-f]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+-]?\d+)?)[a-z]*/i,q,"0123456789"],["pln",/^\\[\S\s]?/,q],["pun",/^.[^\s\w"-$'./@\\`]*/,q]);return x(m,e)}function D(a,m){function e(a){switch(a.nodeType){case 1:if(k.test(a.className))break;if("BR"===a.nodeName)h(a),
13 | a.parentNode&&a.parentNode.removeChild(a);else for(a=a.firstChild;a;a=a.nextSibling)e(a);break;case 3:case 4:if(p){var b=a.nodeValue,d=b.match(t);if(d){var c=b.substring(0,d.index);a.nodeValue=c;(b=b.substring(d.index+d[0].length))&&a.parentNode.insertBefore(s.createTextNode(b),a.nextSibling);h(a);c||a.parentNode.removeChild(a)}}}}function h(a){function b(a,d){var e=d?a.cloneNode(!1):a,f=a.parentNode;if(f){var f=b(f,1),g=a.nextSibling;f.appendChild(e);for(var h=g;h;h=g)g=h.nextSibling,f.appendChild(h)}return e}
14 | for(;!a.nextSibling;)if(a=a.parentNode,!a)return;for(var a=b(a.nextSibling,0),e;(e=a.parentNode)&&e.nodeType===1;)a=e;d.push(a)}var k=/(?:^|\s)nocode(?:\s|$)/,t=/\r\n?|\n/,s=a.ownerDocument,l;a.currentStyle?l=a.currentStyle.whiteSpace:window.getComputedStyle&&(l=s.defaultView.getComputedStyle(a,q).getPropertyValue("white-space"));var p=l&&"pre"===l.substring(0,3);for(l=s.createElement("LI");a.firstChild;)l.appendChild(a.firstChild);for(var d=[l],g=0;g=0;){var h=m[e];A.hasOwnProperty(h)?window.console&&console.warn("cannot override language handler %s",h):A[h]=a}}function C(a,m){if(!a||!A.hasOwnProperty(a))a=/^\s*=o&&(h+=2);e>=c&&(a+=2)}}catch(w){"console"in window&&console.log(w&&w.stack?w.stack:w)}}var v=["break,continue,do,else,for,if,return,while"],w=[[v,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],
18 | "catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],F=[w,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],G=[w,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"],
19 | H=[G,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"],w=[w,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"],I=[v,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],
20 | J=[v,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],v=[v,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],K=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/,N=/\S/,O=u({keywords:[F,H,w,"caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END"+
21 | I,J,v],hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0}),A={};k(O,["default-code"]);k(x([],[["pln",/^[^]+/],["dec",/^]*(?:>|$)/],["com",/^<\!--[\S\s]*?(?:--\>|$)/],["lang-",/^<\?([\S\s]+?)(?:\?>|$)/],["lang-",/^<%([\S\s]+?)(?:%>|$)/],["pun",/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\S\s]+?)<\/xmp\b[^>]*>/i],["lang-js",/^
8 |
9 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
Zabbix class represents the Zabbix API Client to make JSON-RPC 2.0 protocol
34 | compliant HTTP POST requests. You instantiate a class with an object that
35 | includes the required properties listed below, and then you should call the
36 | login method first to get the valid authentication token. Now you are ready
37 | to make other Zabbix API calls and don't forget to call the logout method
38 | when you are done.
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
Constructor
50 |
51 |
52 |
53 |
new Zabbix(opts)
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 | The constructor creates an instance of Zabbix class.
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
Parameters:
73 |
74 |
75 |
76 |
77 |
78 |
79 |
Name
80 |
81 |
82 |
Type
83 |
84 |
85 |
86 |
87 |
88 |
Description
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
opts
98 |
99 |
100 |
101 |
102 |
103 | object
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
An object contains the details about Zabbix API
114 | server like url, username, password and an optional object for any other
115 | Node.js HTTP options the user may want to send with the request.