1717module . exports = function ( RED ) {
1818
1919 const SERVICE_IDENTIFIER = 'discovery' ;
20- var discoveryutils = require ( './discovery-utils' ) ,
20+ var pkg = require ( '../../package.json' ) ,
21+ discoveryutils = require ( './discovery-utils' ) ,
2122 DiscoveryV1 = require ( 'watson-developer-cloud/discovery/v1' ) ,
2223 serviceutils = require ( '../../utilities/service-utils' ) ,
2324 dservice = serviceutils . getServiceCreds ( SERVICE_IDENTIFIER ) ,
@@ -40,7 +41,10 @@ module.exports = function (RED) {
4041 var discovery = new DiscoveryV1 ( {
4142 username : sUsername ? sUsername : req . query . un ,
4243 password : sPassword ? sPassword : req . query . pwd ,
43- version_date : '2017-04-27'
44+ version_date : '2017-04-27' ,
45+ headers : {
46+ 'User-Agent' : pkg . name + '-' + pkg . version
47+ }
4448 } ) ;
4549
4650 discovery . getEnvironments ( { } , function ( err , response ) {
@@ -57,7 +61,10 @@ module.exports = function (RED) {
5761 var discovery = new DiscoveryV1 ( {
5862 username : sUsername ? sUsername : req . query . un ,
5963 password : sPassword ? sPassword : req . query . pwd ,
60- version_date : '2017-04-27'
64+ version_date : '2017-04-27' ,
65+ headers : {
66+ 'User-Agent' : pkg . name + '-' + pkg . version
67+ }
6168 } ) ;
6269
6370 discovery . getCollections ( {
@@ -77,7 +84,10 @@ module.exports = function (RED) {
7784 var discovery = new DiscoveryV1 ( {
7885 username : sUsername ? sUsername : req . query . un ,
7986 password : sPassword ? sPassword : req . query . pwd ,
80- version_date : '2017-04-27'
87+ version_date : '2017-04-27' ,
88+ headers : {
89+ 'User-Agent' : pkg . name + '-' + pkg . version
90+ }
8191 } ) ;
8292
8393 discovery . query ( {
0 commit comments