UNPKG

synergia-jira-connector

Version:

Easy to use NodeJS wrapper for the Jira REST API.

35 lines (31 loc) 982 B
"use strict"; module.exports = ServerInfoClient; /** * Used to access Jira REST endpoints in '/rest/api/2/serverInfo' * @param {JiraClient} jiraClient * @constructor ServerInfoClient */ function ServerInfoClient (jiraClient) { this.jiraClient = jiraClient; /** * Returns general information about the current JIRA server. * * @method getServerInfo * @memberOf ServerInfoClient# * @param opts The request options sent to the Jira API. * @param {boolean} [opts.doHealthCheck] Whether to perform a health check on the server. * @param callback Called when the server info has been retrieved. */ this.getServerInfo = function (opts, callback) { var options = { uri: this.jiraClient.buildURL('/serverInfo'), method: 'GET', json: true, followAllRedirects: true, qs: { doHealthCheck: opts.doHealthCheck } }; this.jiraClient.makeRequest(options, callback); } }