@axway/axway-central-cli 2.12.2 → 2.12.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -133,14 +133,13 @@ ${defsManager.getDefsTableForHelpMsg()}`);
133
133
 
134
134
  (0, _utils.verifyScopeParam)(defsManager.getAllKindsList(), defs, scope);
135
135
  /**
136
- 1) Execute getByName or getList calls for every definition that match scope name/kind if a user provides -s
137
- param to the cli.
138
- 2) It is possible to execute list (get all) api calls for scoped resources without providing the scope in
139
- the path so api-server returns the entire list in all scopes, for example for "Document" kind calling
136
+ 1) If "scope" param provided: execute getByName or getList calls for every definition that match this scope name/kind.
137
+ 2) If "scope" param is not provided: execute list (get all) api calls for scoped resources without providing the scope in
138
+ the path so api-server returns the entire list in all scopes. For example, using "Document" kind and calling
140
139
  https://apicentral.axway.com/apis/catalog/v1alpha1/documents returns a list of documents in Asset and AssetRelease
141
- scopes in a single api call. So take the first resource definition + cli definition and do call, if user is
142
- not providing the "scope" param. Note: this logic might have some edge cases if same kind can be used for
143
- "scoped" and "scope" resources and api-server is not handling this case correctly anymore.
140
+ scopes in a single api call. So getting unique list of groups and finding first matching definitions to do a call
141
+ Note: this logic might have some edge cases if same kind can be used for "scoped" and "scope" resources and api-server is
142
+ not handling this case correctly anymore.
144
143
  */
145
144
 
146
145
  if (scope) {
@@ -158,10 +157,24 @@ ${defsManager.getDefsTableForHelpMsg()}`);
158
157
  });
159
158
  });
160
159
  } else {
161
- let response = await getListOrByName(defs[0].resource, client, undefined, resourceName, undefined, query, progressListener);
162
- getResults.push({
163
- columns: defs[0].cli.spec.columns,
164
- response
160
+ const defsMatchingGroup = {};
161
+ defs.forEach(def => {
162
+ if (!defsMatchingGroup[def.resource.metadata.scope.name]) {
163
+ defsMatchingGroup[def.resource.metadata.scope.name] = def;
164
+ }
165
+ });
166
+ const results = await Promise.all(Object.values(defsMatchingGroup).map(async defs => ({
167
+ response: await getListOrByName(defs.resource, client, undefined, resourceName, undefined, query, progressListener),
168
+ cli: defs.cli
169
+ })));
170
+ results.forEach(({
171
+ response,
172
+ cli
173
+ }) => {
174
+ getResults.push({
175
+ columns: cli.spec.columns,
176
+ response
177
+ });
165
178
  });
166
179
  }
167
180
  } // resolve team guids
@@ -321,6 +321,8 @@ const completeInstall = async installConfig => {
321
321
  v7AgentValues.centralConfig = installConfig.centralConfig;
322
322
  v7AgentValues.traceabilityConfig = installConfig.traceabilityConfig;
323
323
  v7AgentValues.isGatewayOnly = installConfig.switches.isGatewayOnly;
324
+ v7AgentValues.daVersion = installConfig.daVersion;
325
+ v7AgentValues.taVersion = installConfig.taVersion;
324
326
 
325
327
  if (installConfig.switches.isHelmInstall) {
326
328
  if (v7AgentValues.namespace.isNew) {
@@ -50,6 +50,10 @@ class V7AgentValues {
50
50
 
51
51
  _defineProperty(this, "traceabilityConfig", void 0);
52
52
 
53
+ _defineProperty(this, "daVersion", void 0);
54
+
55
+ _defineProperty(this, "taVersion", void 0);
56
+
53
57
  this.amplifyAgentCreds = _.amplifyAgentsCredsSecret;
54
58
  this.amplifyAgentKeys = _.amplifyAgentsKeysSecret;
55
59
  this.apiGatewayAuthPass = '';
@@ -70,6 +74,8 @@ class V7AgentValues {
70
74
  };
71
75
  this.centralConfig = new _types.CentralAgentConfig();
72
76
  this.traceabilityConfig = new _types.TraceabilityConfig();
77
+ this.daVersion = '';
78
+ this.taVersion = '';
73
79
  }
74
80
 
75
81
  }
@@ -167,7 +173,7 @@ image:
167
173
  repository: axway.jfrog.io/ampc-public-docker-release/agent/v7-traceability-agent
168
174
  pullPolicy: Always
169
175
  # Overrides the image tag whose default is the chart appVersion.
170
- tag: "latest"
176
+ tag: "{{taVersion}}"
171
177
 
172
178
  imagePullSecrets: []
173
179
  nameOverride: ""
@@ -180,39 +186,66 @@ statusPort: 8990
180
186
  # https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_api_manager/agent-variables/index.html#common-variables-to-both-agents
181
187
  # https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_api_manager/agent-variables/index.html#specific-variables-for-traceability-agent
182
188
  env:
183
- APIGATEWAY_HEALTHCHECKPORT: 8090
184
- APIGATEWAY_HEALTHCHECKPROTOCOL: "https"
185
- APIGATEWAY_HEALTHCHECKURI: login
186
- APIGATEWAY_HOST: {{apiGatewayHost}}
187
- APIGATEWAY_PORT: {{apiGatewayPort}}
188
- APIMANAGER_HOST: {{apiManagerHost}}
189
- APIMANAGER_PORT: {{apiManagerPort}}
189
+ LOG_LEVEL: info
190
190
  CENTRAL_AGENTNAME: {{centralConfig.taAgentName}}
191
- CENTRAL_AUTH_CLIENTID: {{centralConfig.dosaAccount.clientId}}
191
+ CENTRAL_URL: {{centralConfig.url}}
192
192
  CENTRAL_AUTH_URL: {{centralConfig.authUrl}}
193
+ CENTRAL_SINGLEURL: {{centralConfig.singleEntryPointUrl}}
193
194
  CENTRAL_DEPLOYMENT: {{centralConfig.deployment}}
194
- CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
195
+ CENTRAL_AUTH_CLIENTID: {{centralConfig.dosaAccount.clientId}}
195
196
  CENTRAL_ORGANIZATIONID: "{{centralConfig.orgId}}"
196
- {{#compare . centralConfig.ampcTeamName "" operator="!=" }}
197
- CENTRAL_TEAM: {{centralConfig.ampcTeamName}}
198
- {{/compare}}
199
- CENTRAL_SINGLEURL={{centralConfig.singleEntryPointUrl}}
200
- CENTRAL_URL: {{centralConfig.url}}
201
- EVENT_LOG_FILE_PATHS: /events/*.log
202
- LOG_LEVEL: info
203
- LOG_FILE_PATH_INSTANCE: "axwayDemo"
197
+ CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
198
+ CENTRAL_TEAM: "{{centralConfig.ampcTeamName}}"
199
+ {{#if isOpenTraffic}}
200
+ # API Gateway open traffic logs
201
+ EVENT_LOG_INPUT: false
202
+ OPENTRAFFIC_LOG_INPUT: true
203
+ OPENTRAFFIC_LOG_PATHS: /events/*.log
204
+ {{else}}
205
+ # API Gateway event logs
206
+ EVENT_LOG_PATHS: /events/*.log
207
+ {{/if}}
204
208
  TRACEABILITY_HOST: {{traceabilityConfig.host}}
205
209
  TRACEABILITY_PROTOCOL: {{traceabilityConfig.protocol}}
206
210
  TRACEABILITY_SAMPLING_PERCENTAGE: {{traceabilityConfig.samplingPercentage}}
207
211
  TRACEABILITY_SAMPLING_REPORTALLERRORS: {{traceabilityConfig.samplingReportAllErrors}}
212
+
213
+ {{#if isGatewayOnly}}
214
+ APIGATEWAY_ONLY: {{isGatewayOnly}}
215
+ {{else}}
216
+ APIMANAGER_HOST: {{apiManagerHost}}
217
+ APIMANAGER_PORT: {{apiManagerPort}}
218
+ # flip to true if API manager is using a self signed certificate
219
+ APIMANAGER_SSL_INSECURESKIPVERIFY: false
220
+ {{/if}}
221
+ {{#if isOpenTraffic}}
222
+ {{else}}
223
+ APIGATEWAY_HOST: {{apiGatewayHost}}
224
+ APIGATEWAY_PORT: {{apiGatewayPort}}
225
+ # flip to true if API manager is using a self signed certificate
226
+ APIGATEWAY_SSL_INSECURESKIPVERIFY: false
227
+ APIGATEWAY_HEALTHCHECKPORT: 8090
228
+ APIGATEWAY_HEALTHCHECKPROTOCOL: "https"
229
+ APIGATEWAY_HEALTHCHECKURI: login
230
+ {{/if}}
208
231
 
209
232
  # The below secret are a pre-requisite. Please refer to the readme file for more info on it.
210
233
  secrets:
211
234
  credentials: {{amplifyAgentCreds}}
212
235
  keys: {{amplifyAgentKeys}}
213
236
 
237
+ podAnnotations:
238
+
239
+ podSecurityContext:
240
+ supplementalGroups: [ 2500 ]
241
+ fsGroupChangePolicy: "OnRootMismatch"
242
+
214
243
  securityContext:
215
244
 
245
+ tolerations:
246
+
247
+ affinity:
248
+
216
249
  nodeSelector: {}
217
250
 
218
251
  # Add additional labels to the agent deployment which may be required based on your configuration
@@ -243,6 +276,7 @@ persistentVolumeClaimConfig:
243
276
  storageClass: gp2-csi
244
277
  name: data-claim
245
278
  events:
279
+ # update this value to match the name of the volume claim that is used for the event logs
246
280
  name: events-claim
247
281
  `;
248
282
  };
@@ -299,7 +333,7 @@ image:
299
333
  repository: axway.jfrog.io/ampc-public-docker-release/agent/v7-discovery-agent
300
334
  pullPolicy: Always
301
335
  # Overrides the image tag whose default is the chart appVersion.
302
- tag: "latest"
336
+ tag: "{{daVersion}}"
303
337
 
304
338
  imagePullSecrets: []
305
339
  nameOverride: ""
@@ -312,27 +346,37 @@ statusPort: 8989
312
346
  # https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_api_manager/agent-variables/index.html#common-variables-to-both-agents
313
347
  # https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_api_manager/agent-variables/index.html#specific-variables-for-discovery-agent
314
348
  env:
315
- APIMANAGER_HOST: {{apiManagerHost}}
316
- APIMANAGER_PORT: {{apiManagerPort}}
349
+ LOG_LEVEL: info
317
350
  CENTRAL_AGENTNAME: {{centralConfig.daAgentName}}
318
- CENTRAL_AUTH_CLIENTID: {{centralConfig.dosaAccount.clientId}}
351
+ CENTRAL_URL: {{centralConfig.url}}
319
352
  CENTRAL_AUTH_URL: {{centralConfig.authUrl}}
320
- CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
353
+ CENTRAL_SINGLEURL: {{centralConfig.singleEntryPointUrl}}
354
+ CENTRAL_AUTH_CLIENTID: {{centralConfig.dosaAccount.clientId}}
321
355
  CENTRAL_ORGANIZATIONID: "{{centralConfig.orgId}}"
322
- {{#compare . centralConfig.ampcTeamName "" operator="!=" }}
323
- CENTRAL_TEAM: {{centralConfig.ampcTeamName}}
324
- {{/compare}}
325
- CENTRAL_SINGLEURL={{centralConfig.singleEntryPointUrl}}
326
- CENTRAL_URL: {{centralConfig.url}}
327
- LOG_LEVEL: info
356
+ CENTRAL_ENVIRONMENT: {{centralConfig.environment}}
357
+ CENTRAL_TEAM: "{{centralConfig.ampcTeamName}}"
358
+ APIMANAGER_HOST: {{apiManagerHost}}
359
+ APIMANAGER_PORT: {{apiManagerPort}}
360
+ # flip to true if API manager is using a self signed certificate
361
+ APIMANAGER_SSL_INSECURESKIPVERIFY: false
328
362
 
329
363
  # The below secret are a pre-requisite. Please refer to the readme file for more info on it.
330
364
  secrets:
331
365
  credentials: {{amplifyAgentCreds}}
332
366
  keys: {{amplifyAgentKeys}}
333
367
 
368
+ podAnnotations:
369
+
370
+ podSecurityContext:
371
+ supplementalGroups: [ 2500 ]
372
+ fsGroupChangePolicy: "OnRootMismatch"
373
+
334
374
  securityContext:
335
375
 
376
+ tolerations:
377
+
378
+ affinity:
379
+
336
380
  nodeSelector: {}
337
381
 
338
382
  # Add additional labels to the agent deployment which may be required based on your configuration
@@ -998,8 +998,6 @@ class ApiServerClient {
998
998
  } else {
999
999
  throw e;
1000
1000
  }
1001
-
1002
- ;
1003
1001
  }
1004
1002
  }
1005
1003
 
@@ -28,10 +28,10 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
28
28
  const {
29
29
  log
30
30
  } = (0, _snooplogg.default)('central:class.DefinitionsManager');
31
+
31
32
  /**
32
33
  * Get / fetch / set specs.
33
34
  */
34
-
35
35
  class DefinitionsManager {
36
36
  constructor(apiServerClient) {
37
37
  _defineProperty(this, "apiServerClient", void 0);
@@ -282,6 +282,22 @@ class DefinitionsManager {
282
282
  });
283
283
  return t.sort(['RESOURCE']).toString();
284
284
  }
285
+
286
+ findDefsByKind(kind) {
287
+ log('findDefsByKind: ', kind);
288
+ const res = [...this.resources].reduce((a, [_, def]) => {
289
+ if (def.spec.kind === kind) {
290
+ a.push({
291
+ resource: def,
292
+ cli: [...this.cli].find(([_, cliDef]) => cliDef.spec.resourceDefinition === def.name)[1],
293
+ scope: def.spec.scope ? [...this.resources].find(([_, resDef]) => resDef.spec.kind === def.spec.scope.kind)[1] : undefined
294
+ });
295
+ }
296
+
297
+ return a;
298
+ }, []);
299
+ return res.length ? res : null;
300
+ }
285
301
  /**
286
302
  * Returns set of related definitions if word is known.
287
303
  * @param word word to search for
@@ -307,12 +323,15 @@ class DefinitionsManager {
307
323
  var _cliDef$spec$names$sh;
308
324
 
309
325
  if (cliDef.spec.names.plural === word || cliDef.spec.names.singular === word || cliDef.spec.names.shortNames.includes(word) || (_cliDef$spec$names$sh = cliDef.spec.names.shortNamesAlias) !== null && _cliDef$spec$names$sh !== void 0 && _cliDef$spec$names$sh.includes(word)) {
326
+ var _this$findDefsByKind;
327
+
310
328
  // note: mind non-null assertion
311
329
  const resource = this.resources.get(cliDef.spec.resourceDefinition);
330
+ const scope = resource.spec.scope ? (_this$findDefsByKind = this.findDefsByKind(resource.spec.scope.kind)) === null || _this$findDefsByKind === void 0 ? void 0 : _this$findDefsByKind[0].resource : null;
312
331
  a.push({
313
332
  resource,
314
333
  cli: cliDef,
315
- scope: resource.spec.scope ? this.resources.get(resource === null || resource === void 0 ? void 0 : resource.spec.scope.kind.toLowerCase()) : undefined
334
+ scope: !!scope ? scope : undefined
316
335
  });
317
336
  }
318
337
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axway/axway-central-cli",
3
- "version": "2.12.2",
3
+ "version": "2.12.4",
4
4
  "description": "Manage APIs, services and publish to the Unified Catalog",
5
5
  "homepage": "https://platform.axway.com",
6
6
  "author": {