@@ -85,7 +85,7 @@ function isDeveloperMode() {
8585 }
8686}
8787
88- async function parseAPIManagerConfig ( pluginConfig ) {
88+ async function parseAPIManagerConfig ( pluginConfig , options ) {
8989 var configuredManagers = { } ;
9090 if ( ! pluginConfig . apimanager . username ) {
9191 throw new Error ( `Required parameter: apimanager.username is not set.` )
@@ -97,6 +97,7 @@ async function parseAPIManagerConfig(pluginConfig) {
9797 // If no API-Manager URL is given, use the Admin-Node-Manager URL
9898 const managerURL = new URL ( pluginConfig . apigateway . url ) ;
9999 managerURL . port = 8075 ;
100+ options . logger . info ( `Parameter API_MANAGER not set. Expect API-Manager on URL: ${ managerURL . toString ( ) } ` ) ;
100101 configuredManagers = {
101102 default : {
102103 url : managerURL . toString ( ) ,
@@ -108,23 +109,28 @@ async function parseAPIManagerConfig(pluginConfig) {
108109 // Check, if multiple API-Manager URLs based on the groupId and regions are given (Format: groupId|managerUrl or groupId|region|managerUrl)
109110 if ( pluginConfig . apimanager . url . indexOf ( '|' ) != - 1 ) {
110111 configuredManagers . perGroupAndRegion = true ;
112+ options . logger . info ( `Parse group/region based API_MANAGER: ${ pluginConfig . apimanager . url } .` ) ;
111113 // Looks like manager URLs are given based on groupIds and regions
112114 pluginConfig . apimanager . url . split ( ',' ) . forEach ( groupRegionAndURL => {
113115 groupRegionAndURL = groupRegionAndURL . trim ( ) . toLowerCase ( ) . split ( '|' ) ;
114116 if ( groupRegionAndURL . length == 1 ) {
115117 // The default API-Manager
118+ options . logger . debug ( `Found default API-Manager URL: ${ groupRegionAndURL [ 0 ] } ` ) ;
116119 configuredManagers . default = { url : groupRegionAndURL [ 0 ] , username : pluginConfig . apimanager . username , password : pluginConfig . apimanager . password }
117120 } else if ( groupRegionAndURL . length == 2 ) {
118121 // Only the Group-ID is given
122+ options . logger . debug ( `Found API-Manager URL: ${ groupRegionAndURL [ 1 ] } for group: ${ groupRegionAndURL [ 0 ] } ` ) ;
119123 configuredManagers [ groupRegionAndURL [ 0 ] ] = { url : groupRegionAndURL [ 1 ] , username : pluginConfig . apimanager . username , password : pluginConfig . apimanager . password }
120124 } else if ( groupRegionAndURL . length == 3 ) {
121125 // Group-ID and region is given (Just create a map with a special key)
126+ options . logger . debug ( `Found API-Manager URL: ${ groupRegionAndURL [ 2 ] } for group: ${ groupRegionAndURL [ 1 ] } and region: ${ groupRegionAndURL [ 1 ] } ` ) ;
122127 configuredManagers [ `${ groupRegionAndURL [ 0 ] } ###${ groupRegionAndURL [ 1 ] } ` ] = { url : groupRegionAndURL [ 2 ] , username : pluginConfig . apimanager . username , password : pluginConfig . apimanager . password }
123128 } else {
124129 return Promise . reject ( `Unexpected API-Manager format: ${ groupRegionAndURL } ` ) ;
125130 }
126131 } ) ;
127132 } else { // If not, create a default API-Manager
133+ options . logger . info ( `Using only default API_MANAGER: ${ pluginConfig . apimanager . url } .` ) ;
128134 configuredManagers = {
129135 default : {
130136 url : pluginConfig . apimanager . url ,
0 commit comments