@axway/axway-central-cli 2.5.1 → 2.6.1

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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Axway Central CLI package for managing Amplify Central resources and DevOps operations.
4
4
 
5
- **For more documentation and examples please visit [Amplify Central CLI documentation portal](https://docs.axway.com/bundle/axway-open-docs/page/docs/central/cli_central/index.html).**
5
+ **For more documentation and examples please visit [Amplify Central CLI documentation portal](https://docs.axway.com/bundle/amplify-central/page/docs/integrate_with_central/cli_central/index.html).**
6
6
 
7
7
  # Installation
8
8
 
@@ -250,7 +250,7 @@ PROXIES OPTIONS:
250
250
  --json Show JSON output
251
251
  ```
252
252
 
253
- CLI supports multiple versions of proxy definition file. For more details and examples visit our [docs portal](https://docs.axway.com/bundle/axway-open-docs/page/docs/central/cli_central/index.html) and [stoplight hub](https://d-api.docs.stoplight.io/).
253
+ CLI supports multiple versions of proxy definition file. For more details and examples visit our [docs portal](https://docs.axway.com/bundle/amplify-central/page/docs/integrate_with_central/cli_central/index.html) and [stoplight hub](https://d-api.docs.stoplight.io/).
254
254
 
255
255
  - **v0**
256
256
 
@@ -52,6 +52,7 @@ const get = {
52
52
  account,
53
53
  region,
54
54
  tag,
55
+ team,
55
56
  title
56
57
  } = argv; // will be set to true and exit 1 if any get result contains an error or args invalid
57
58
 
@@ -69,6 +70,7 @@ const get = {
69
70
  baseUrl,
70
71
  account,
71
72
  region,
73
+ team,
72
74
  useCache: cache
73
75
  });
74
76
  const defsManager = await new _DefinitionsManager.DefinitionsManager(client).init();
@@ -166,34 +168,28 @@ ${defsManager.getDefsTableForHelpMsg()}`);
166
168
  name: 'args',
167
169
  desc: 'Command arguments, run "axway central get" to see the examples',
168
170
  multiple: true,
169
- required: false,
170
- type: 'string'
171
+ required: false
171
172
  }],
172
173
  options: { ..._types.commonCmdArgsDescription,
173
174
  '-o, --output [value]': {
174
- desc: `Additional output formats. One of: ${_types.OutputTypes.yaml} | ${_types.OutputTypes.json}`,
175
- type: 'string'
175
+ desc: `Additional output formats. One of: ${_types.OutputTypes.yaml} | ${_types.OutputTypes.json}`
176
176
  },
177
- '-s, --scope [name|kind/name]"': {
178
- desc: `Scope name or kind/name for scoped resources`,
179
- type: 'string'
177
+ '-s, --scope [name|kind/name]': {
178
+ desc: 'Scope name or kind/name for scoped resources'
180
179
  },
181
180
  '-q, --query [RSQL query]': {
182
- desc: `RSQL-formatted query to search for filters that match specific parameters`,
183
- type: 'string'
181
+ desc: 'RSQL-formatted query to search for filters that match specific parameters'
184
182
  },
185
183
  '--title [title]': {
186
- desc: `Title of resource(s) to fetch`,
187
- type: 'string'
184
+ desc: 'Title of resource(s) to fetch'
188
185
  },
189
186
  '--attribute [key=value]': {
190
- desc: `Attribute in key=value pair format to filter by`,
191
- type: 'string'
187
+ desc: 'Attribute in key=value pair format to filter by'
192
188
  },
193
189
  '--tag [tag]': {
194
- desc: `Tag of resource(s) to fetch`,
195
- type: 'string'
196
- }
190
+ desc: 'Tag of resource(s) to fetch'
191
+ },
192
+ '--team [guid|name]': 'The team name or guid to use'
197
193
  }
198
194
  };
199
195
  exports.get = get;
@@ -9,8 +9,6 @@ var _chalk = _interopRequireDefault(require("chalk"));
9
9
 
10
10
  var _snooplogg = _interopRequireDefault(require("snooplogg"));
11
11
 
12
- var _ApiCentralClient = require("../../common/ApiCentralClient");
13
-
14
12
  var _ApiServerClient = require("../../common/ApiServerClient");
15
13
 
16
14
  var _basicPrompts = require("../../common/basicPrompts");
@@ -84,12 +82,7 @@ const agents = {
84
82
  const render = new _Renderer.default(console);
85
83
 
86
84
  try {
87
- // initiate clients
88
- const apiCentralClient = new _ApiCentralClient.ApiCentralClient({
89
- baseUrl,
90
- account,
91
- region
92
- });
85
+ // initialize clients
93
86
  const apiServerClient = new _ApiServerClient.ApiServerClient({
94
87
  baseUrl,
95
88
  account,
@@ -144,7 +137,7 @@ const agents = {
144
137
  } // get platform connectivity
145
138
 
146
139
 
147
- installConfig.centralConfig = await platform.getCentralConfig(apiCentralClient, apiServerClient, platformClient, defsManager, apicDeployment, installConfig); // Create the object of GatewayTypes -> GatewayConnectivity functions
140
+ installConfig.centralConfig = await platform.getCentralConfig(apiServerClient, platformClient, defsManager, apicDeployment, installConfig); // Create the object of GatewayTypes -> GatewayConnectivity functions
148
141
 
149
142
  installConfig.gatewayConfig = await agentInstallFlow.AskGatewayQuestions(installConfig, apiServerClient, defsManager); // traceability options
150
143
 
@@ -157,7 +150,7 @@ const agents = {
157
150
 
158
151
  if (agentInstallFlow.InstallPreprocess) installConfig = await agentInstallFlow.InstallPreprocess(installConfig); // finalize platform setup
159
152
 
160
- installConfig = await platform.finalizeCentralInstall(apiCentralClient, apiServerClient, platformClient, defsManager, installConfig); // finalize gateway setup and output
153
+ installConfig = await platform.finalizeCentralInstall(apiServerClient, platformClient, defsManager, installConfig); // finalize gateway setup and output
161
154
 
162
155
  await agentInstallFlow.FinalizeGatewayInstall(installConfig, apiServerClient, defsManager);
163
156
  } catch (e) {
@@ -317,7 +317,7 @@ const completeInstall = async installConfig => {
317
317
 
318
318
  await helpers.createSecret(v7AgentValues.namespace.name, helpers.amplifyAgentsKeysSecret, async () => {
319
319
  if (installConfig.centralConfig.ampcDosaInfo.isNew) {
320
- console.log(_cliKit.chalk.yellow(`The secret '${helpers.amplifyAgentsKeysSecret}' will be created with the same "private_key.pem" and "public_key.pem" that was auto generated to create the DOSA Account.`));
320
+ console.log(_cliKit.chalk.yellow(`The secret '${helpers.amplifyAgentsKeysSecret}' will be created with the same "private_key.pem" and "public_key.pem" that was auto generated to create the Service Account.`));
321
321
  }
322
322
 
323
323
  await helpers.createAmplifyAgentKeysSecret(v7AgentValues.namespace.name, helpers.amplifyAgentsKeysSecret, 'public_key', v7AgentValues.centralConfig.dosaAccount.publicKey, 'private_key', v7AgentValues.centralConfig.dosaAccount.privateKey);
@@ -13,6 +13,8 @@ var _bashCommands = require("../../../common/bashCommands");
13
13
 
14
14
  var _Kubectl = require("../../../common/Kubectl");
15
15
 
16
+ var _PlatformClient = require("../../../common/PlatformClient");
17
+
16
18
  var _types = require("../../../common/types");
17
19
 
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -48,18 +50,15 @@ const createDosaAndCerts = async (client, name) => {
48
50
 
49
51
  const publicCert = _fsExtra.default.readFileSync(publicKey).toString();
50
52
 
51
- const result = await client.createDOSAAccount(name, publicCert);
52
-
53
- if (!result.data) {
54
- var _result$error;
55
-
56
- throw Error(`Cannot create service account${(_result$error = result.error) !== null && _result$error !== void 0 && _result$error.length ? `: ${result.error[0].title}` : '.'}`);
57
- } else {
58
- console.log(_chalk.default.green(`New service account "${result.data.name}" with clientId "${result.data.clientId}" has been successfully created.`));
59
- console.log(_chalk.default.green(`The private key has been placed at ${privateKey}\nThe public key has been placed at ${publicKey}`));
60
- }
61
-
62
- return new _types.DosaAccount(result.data.clientId, publicKey, privateKey);
53
+ const account = await client.createServiceAccount({
54
+ name: name,
55
+ desc: name,
56
+ publicKey: publicCert,
57
+ roles: [_PlatformClient.PlatformServiceAccountRole.ApiCentralAdmin]
58
+ });
59
+ console.log(_chalk.default.green(`New service account "${account.name}" with clientId "${account.client_id}" has been successfully created.`));
60
+ console.log(_chalk.default.green(`The private key has been placed at ${privateKey}\nThe public key has been placed at ${publicKey}`));
61
+ return new _types.DosaAccount(account.client_id, publicKey, privateKey);
63
62
  };
64
63
 
65
64
  exports.createDosaAndCerts = createDosaAndCerts;
@@ -85,9 +84,9 @@ const createByResourceType = async (client, defsManager, name, resourceType, res
85
84
  });
86
85
 
87
86
  if (!result.data) {
88
- var _result$error2;
87
+ var _result$error;
89
88
 
90
- throw Error(`Cannot create a new ${resourceType.toLowerCase()}${(_result$error2 = result.error) !== null && _result$error2 !== void 0 && _result$error2.length ? `: ${result.error[0].detail}` : '.'}`);
89
+ throw Error(`Cannot create a new ${resourceType.toLowerCase()}${(_result$error = result.error) !== null && _result$error !== void 0 && _result$error.length ? `: ${result.error[0].detail}` : '.'}`);
91
90
  } else {
92
91
  console.log(`New ${resourceType.toLowerCase()} "${result.data.name}" has been successfully created.`);
93
92
  }
@@ -123,9 +122,9 @@ const createNewAgentResource = async (client, defsManager, envName, dataPlaneTyp
123
122
  });
124
123
 
125
124
  if (!result.data) {
126
- var _result$error3;
125
+ var _result$error2;
127
126
 
128
- throw Error(`Cannot create a new agent ${(_result$error3 = result.error) !== null && _result$error3 !== void 0 && _result$error3.length ? `: ${result.error[0].detail}` : '.'}`);
127
+ throw Error(`Cannot create a new agent ${(_result$error2 = result.error) !== null && _result$error2 !== void 0 && _result$error2.length ? `: ${result.error[0].detail}` : '.'}`);
129
128
  } else {
130
129
  console.log(`New agent of type "${defs[0].resource.name}" named "${result.data.name}" has been successfully created.`);
131
130
  }
@@ -174,10 +174,10 @@ const configFiles = {
174
174
  };
175
175
  exports.configFiles = configFiles;
176
176
  const agentsDocsUrl = {
177
- V7: 'https://docs.axway.com/bundle/axway-open-docs/page/docs/central/connect-api-manager/gateway-administation/index.html',
178
- AWS: 'https://docs.axway.com/bundle/axway-open-docs/page/docs/central/connect-aws-gateway/cloud-administration-operation/index.html',
179
- AZURE: 'https://docs.axway.com/bundle/axway-open-docs/page/docs/central/connect-azure-gateway/index.html',
180
- ISTIO: 'https://docs.axway.com/bundle/axway-open-docs/page/docs/central/mesh_management/index.html'
177
+ V7: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_api_manager/index.html',
178
+ AWS: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_aws_gateway/index.html',
179
+ AZURE: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_azure_gateway/index.html',
180
+ ISTIO: 'https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/mesh_management/index.html'
181
181
  }; // export * from './updaters';
182
182
 
183
183
  exports.agentsDocsUrl = agentsDocsUrl;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.transactionLoggingMessages = exports.serviceAccountNameAlreadyExists = exports.selectServiceAccount = exports.selectIngestionProtocol = exports.secretAlreadyExists = exports.namespaceAlreadyExists = exports.k8sClusterMessages = exports.fetchServiceAccount = exports.envMessages = exports.enterServiceAccountName = exports.enterPublicKeyPath = exports.enterPrivateKeyPath = exports.enterNamespaceName = exports.createNamespace = exports.createGatewayAgentCredsSecret = exports.createAmplifyAgentKeysSecret = exports.askToEnableTransactionLogging = exports.askServiceAccountName = exports.askPublicKeyPath = exports.askPublicAndPrivateKeysPath = exports.askPrivateKeyPath = exports.askNamespace = exports.askK8sClusterName = exports.askIngestionProtocol = exports.askForSecretName = exports.askEnvironmentName = exports.askDosaClientId = exports.askBundleType = exports.askAgentName = exports.agentMessages = void 0;
6
+ exports.transactionLoggingMessages = exports.serviceAccountNameAlreadyExists = exports.selectServiceAccount = exports.selectIngestionProtocol = exports.secretAlreadyExists = exports.namespaceAlreadyExists = exports.k8sClusterMessages = exports.envMessages = exports.enterServiceAccountName = exports.enterPublicKeyPath = exports.enterPrivateKeyPath = exports.enterNamespaceName = exports.createNamespace = exports.createGatewayAgentCredsSecret = exports.createAmplifyAgentKeysSecret = exports.askToEnableTransactionLogging = exports.askServiceAccountName = exports.askPublicKeyPath = exports.askPublicAndPrivateKeysPath = exports.askPrivateKeyPath = exports.askNamespace = exports.askK8sClusterName = exports.askIngestionProtocol = exports.askForSecretName = exports.askEnvironmentName = exports.askDosaClientId = exports.askBundleType = exports.askAgentName = exports.agentMessages = void 0;
7
7
 
8
8
  var _chalk = _interopRequireDefault(require("chalk"));
9
9
 
@@ -61,7 +61,7 @@ const secretAlreadyExists = 'Secret already exists. Please enter a new name.';
61
61
  exports.secretAlreadyExists = secretAlreadyExists;
62
62
  const enterNamespaceName = 'Enter a new namespace name';
63
63
  exports.enterNamespaceName = enterNamespaceName;
64
- const selectServiceAccount = 'Select a service account (DOSA)';
64
+ const selectServiceAccount = 'Select a service account';
65
65
  exports.selectServiceAccount = selectServiceAccount;
66
66
  const enterServiceAccountName = 'Enter a new service account name';
67
67
  exports.enterServiceAccountName = enterServiceAccountName;
@@ -74,10 +74,8 @@ exports.selectIngestionProtocol = selectIngestionProtocol;
74
74
  const serviceAccountNameAlreadyExists = 'Service account already exists. Please enter a new name.';
75
75
  exports.serviceAccountNameAlreadyExists = serviceAccountNameAlreadyExists;
76
76
 
77
- const askServiceAccountName = async serviceAccounts => {
78
- console.warn(_chalk.default.yellow(`WARNING: Creating a new DOSA account will overwrite any existing "private_key.pem" and "public_key.pem" files in this directory`)); // map to get sa names
79
-
80
- const serviceAccountNames = serviceAccounts.map(a => a.name);
77
+ const askServiceAccountName = async serviceAccountNames => {
78
+ console.warn(_chalk.default.yellow(`WARNING: Creating a new service account will overwrite any existing "private_key.pem" and "public_key.pem" files in this directory`));
81
79
  const name = await (0, _basicPrompts.askInput)({
82
80
  msg: enterServiceAccountName,
83
81
  defaultValue: cliNowString,
@@ -88,41 +86,38 @@ const askServiceAccountName = async serviceAccounts => {
88
86
 
89
87
  exports.askServiceAccountName = askServiceAccountName;
90
88
 
91
- const fetchServiceAccount = async client => {
92
- const res = await client.getServiceAccounts();
93
- if (!res.data) throw Error('Get service accounts error.');
94
- return res.data;
95
- };
96
-
97
- exports.fetchServiceAccount = fetchServiceAccount;
98
-
99
89
  const askDosaClientId = async (client, showWarning = true) => {
100
- const serviceAccounts = await fetchServiceAccount(client);
101
- const answer = await (0, _basicPrompts.askList)({
90
+ // Fetch all existing service accounts.
91
+ const serviceAccounts = await client.getServiceAccounts();
92
+ const serviceAccountNames = serviceAccounts.map(nextAccount => nextAccount.name); // Ask user to select an existing service account or create a new one.
93
+
94
+ const selectedName = await (0, _basicPrompts.askList)({
102
95
  msg: selectServiceAccount,
103
96
  choices: [{
104
- name: 'Create a new account',
97
+ name: 'Create a new service account',
105
98
  value: 'CREATE_NEW'
106
- }, new _inquirer.default.Separator(), ...serviceAccounts.map(a => a.name), new _inquirer.default.Separator()]
99
+ }, new _inquirer.default.Separator(), ...serviceAccountNames, new _inquirer.default.Separator()]
107
100
  });
108
101
 
109
- if (answer === 'CREATE_NEW') {
110
- const name = await askServiceAccountName(serviceAccounts);
102
+ if (selectedName === 'CREATE_NEW') {
103
+ // We're going to create a new service account. Ask for a unique name. (We'll create it later.)
104
+ const name = await askServiceAccountName(serviceAccountNames);
111
105
  return {
112
106
  clientId: null,
113
107
  name,
114
108
  isNew: true
115
109
  };
116
110
  } else {
117
- const dosa = serviceAccounts.find(a => a.name === answer);
118
-
111
+ // We're using an existing service account. Notify user to make its keys available to the agents.
119
112
  if (showWarning) {
120
113
  console.log(_chalk.default.yellow('Please make sure your "private_key.pem" and "public_key.pem" files for the selected service account are copied to the folder location of the agents.'));
121
- }
114
+ } // Fetch selected service account's client ID and return info about it.
115
+
122
116
 
117
+ const selectedAccount = serviceAccounts.find(nextAccount => nextAccount.name === selectedName);
123
118
  return {
124
- clientId: dosa.clientId,
125
- name: dosa.name,
119
+ clientId: selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.client_id,
120
+ name: selectedName,
126
121
  isNew: false
127
122
  };
128
123
  }
@@ -244,7 +239,7 @@ const askEnvironmentName = async (client, defsManager, isAxwayManaged = null) =>
244
239
  choices: [{
245
240
  name: envMessages.createNewEnvironment,
246
241
  value: 'CREATE_NEW'
247
- }, new _inquirer.default.Separator(), ...envs.map(e => e.name), new _inquirer.default.Separator()]
242
+ }, new _inquirer.default.Separator(), ...envs.map(e => e.name).sort((name1, name2) => name1.localeCompare(name2)), new _inquirer.default.Separator()]
248
243
  });
249
244
 
250
245
  if (answer === 'CREATE_NEW') {
@@ -332,11 +327,11 @@ const askAgentName = async (client, defsManager, agentType, scopeName) => {
332
327
  };
333
328
  /**
334
329
  * @description Create a secret that contains a public & private key pair for agents to connect to central.
335
- * If a user is creating a new DOSA account, then the keys should be passed in as args.
336
- * If they are using an existing account, then the user will be prompted for the keys that created the DOSA account.
330
+ * If a user is creating a new service account, then the keys should be passed in as args.
331
+ * If they are using an existing account, then the user will be prompted for the keys that created the service account.
337
332
  * @param namespace The namespace to create the secret in.
338
333
  * @param secretName The name of the secret.
339
- * @param publicKey The file path to the public key attached to the chosen DOSA.
334
+ * @param publicKey The file path to the public key attached to the chosen service account.
340
335
  * @param privateKey The file path to the corresponding private key.
341
336
  */
342
337
 
@@ -395,7 +390,7 @@ const askPrivateKeyPath = async () => await (0, _basicPrompts.askInput)({
395
390
  exports.askPrivateKeyPath = askPrivateKeyPath;
396
391
 
397
392
  const askPublicAndPrivateKeysPath = async () => {
398
- console.log(_chalk.default.yellow('Please provide the same "private_key.pem" and "public_key.pem" that was used to create the selected DOSA Account.'));
393
+ console.log(_chalk.default.yellow('Please provide the same "private_key.pem" and "public_key.pem" that was used to create the selected Service Account.'));
399
394
  const publicKey = await askPublicKeyPath();
400
395
  const privateKey = await askPrivateKeyPath();
401
396
  return [publicKey, privateKey];
@@ -178,9 +178,9 @@ fullnameOverride: ""
178
178
  # Health Check port
179
179
  statusPort: 8990
180
180
 
181
- # Info on how to fetch the values for the env parameters can ve found in the below doc.
182
- # https://docs.axway.com/bundle/axway-open-docs/page/docs/central/connect-api-manager/gateway-administation/index.html#customizing-the-traceability-agent-environment-variable-file
183
- # More environment value: https://docs.axway.com/bundle/axway-open-docs/page/docs/central/connect-api-manager/agent-variables/index.html#common-variables-to-both-agents
181
+ # The following links document the environment variables for traceability.
182
+ # https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_api_manager/agent-variables/index.html#common-variables-to-both-agents
183
+ # https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_api_manager/agent-variables/index.html#specific-variables-for-traceability-agent
184
184
  env:
185
185
  APIGATEWAY_HEALTHCHECKPORT: 8090
186
186
  APIGATEWAY_HEALTHCHECKPROTOCOL: "https"
@@ -304,9 +304,9 @@ fullnameOverride: ""
304
304
  # Health Check port
305
305
  statusPort: 8989
306
306
 
307
- # Info on how to fetch the values for the env parameters can ve found in the below doc.
308
- # https://docs.axway.com/bundle/axway-open-docs/page/docs/central/connect-api-manager/gateway-administation/index.html#customizing-the-discovery-agent-environment-variable-file
309
- # More environment value: https://docs.axway.com/bundle/axway-open-docs/page/docs/central/connect-api-manager/agent-variables/index.html#common-variables-to-both-agents
307
+ # The following links document the environment variables for discovery.
308
+ # https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_api_manager/agent-variables/index.html#common-variables-to-both-agents
309
+ # https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/connect_api_manager/agent-variables/index.html#specific-variables-for-discovery-agent
310
310
  env:
311
311
  APIMANAGER_HOST: {{apiManagerHost}}
312
312
  APIMANAGER_PORT: {{apiManagerPort}}
@@ -71,7 +71,7 @@ als:
71
71
  # distinguishes events between apic deployments
72
72
  apicDeployment: {{centralConfig.deployment}}
73
73
 
74
- # DOSA client ID
74
+ # service account client ID
75
75
  clientID: {{centralConfig.dosaAccount.clientId}}
76
76
 
77
77
  # condor ingestion endpoint
@@ -85,7 +85,7 @@ als:
85
85
  per_api: true
86
86
  reportAllErrors: {{traceabilityConfig.samplingReportAllErrors}}
87
87
 
88
- # name of the secret containing the public & private keys used by the provided DOSA client ID
88
+ # name of the secret containing the public & private keys used by the provided service account client ID
89
89
  keysSecretName: {{istioAgentValues.keysSecretName}}
90
90
  publishHeaders: true
91
91
 
@@ -93,7 +93,7 @@ als:
93
93
 
94
94
  # discovers API Documentation
95
95
  ada:
96
- # DOSA client ID
96
+ # service account client ID
97
97
  clientID: {{centralConfig.dosaAccount.clientId}}
98
98
 
99
99
  # name of the K8SCluster the agent is connected to
@@ -101,12 +101,12 @@ ada:
101
101
  command: apis
102
102
  enabled: {{istioAgentValues.discoveryEnabled}}
103
103
 
104
- # name of the secret containing the public & private keys used by the provided DOSA client ID
104
+ # name of the secret containing the public & private keys used by the provided service account client ID
105
105
  keysSecretName: {{istioAgentValues.keysSecretName}}
106
106
 
107
107
  # discovers running pods/services
108
108
  rda:
109
- # DOSA client ID
109
+ # service account client ID
110
110
  clientID: {{centralConfig.dosaAccount.clientId}}
111
111
 
112
112
  # name of the connected K8SCluster
@@ -114,7 +114,7 @@ rda:
114
114
  command: resources
115
115
  enabled: {{istioAgentValues.discoveryEnabled}}
116
116
 
117
- # name of the secret containing the public & private keys used by the provided DOSA client ID
117
+ # name of the secret containing the public & private keys used by the provided service account client ID
118
118
  keysSecretName: {{istioAgentValues.keysSecretName}}
119
119
 
120
120
  # to enable deployment of demo list service with agent installation. Set to true to install the demo service
@@ -100,7 +100,7 @@ const gatewayConnectivity = async (installConfig, apiServerClient, defsManager)
100
100
  The Amplify Istio Traceability Agent needs to be deployed to your Kubernetes cluster to collect transaction telemetry to send to the Amplify Central Observer and Visibility Dashboard.`));
101
101
  console.log(`
102
102
  For more details on client prerequesites or Kubernetes preparation refer to the documentation here:
103
- https://docs.axway.com/bundle/axway-open-docs/page/docs/central/mesh_management/build_hybrid_env/index.html
103
+ https://docs.axway.com/bundle/amplify-central/page/docs/connect_manage_environ/mesh_management/build_hybrid_env/index.html
104
104
  `);
105
105
  const {
106
106
  error
@@ -398,11 +398,11 @@ const createHybridOverride = overrides => {
398
398
  exports.createHybridOverride = createHybridOverride;
399
399
 
400
400
  const installPreprocess = async installConfig => {
401
- // name of the dosa account, and if it is new or not
401
+ // name of the service account, and if it is new or not
402
402
  if (!installConfig.centralConfig.ampcDosaInfo.isNew) {
403
403
  [installConfig.centralConfig.dosaAccount.publicKey, installConfig.centralConfig.dosaAccount.privateKey] = await helpers.askPublicAndPrivateKeysPath();
404
404
  } else {
405
- console.log(_chalk.default.yellow(`The secret will be created with the same "private_key.pem" and "public_key.pem" that will be auto generated to create the DOSA Account, following the completion of these prompts.`));
405
+ console.log(_chalk.default.yellow(`The secret will be created with the same "private_key.pem" and "public_key.pem" that will be auto generated to create the Service Account, following the completion of these prompts.`));
406
406
  }
407
407
 
408
408
  return installConfig;
@@ -424,7 +424,7 @@ const completeInstall = async (installConfig, apiServerClient, defsManager) => {
424
424
 
425
425
  await helpers.createSecret(istioValues.istioAgentValues.namespace.name, helpers.amplifyAgentsKeysSecret, async () => {
426
426
  if (installConfig.centralConfig.ampcDosaInfo.isNew) {
427
- console.log(_chalk.default.yellow(`The secret '${helpers.amplifyAgentsKeysSecret}' will be created with the same "private_key.pem" and "public_key.pem" that was auto generated to create the DOSA Account.`));
427
+ console.log(_chalk.default.yellow(`The secret '${helpers.amplifyAgentsKeysSecret}' will be created with the same "private_key.pem" and "public_key.pem" that was auto generated to create the Service Account.`));
428
428
  }
429
429
 
430
430
  await helpers.createAmplifyAgentKeysSecret(istioValues.istioAgentValues.namespace.name, helpers.amplifyAgentsKeysSecret, 'publicKey', istioValues.centralConfig.dosaAccount.publicKey, 'privateKey', istioValues.centralConfig.dosaAccount.privateKey);
@@ -31,14 +31,18 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
31
31
  // Complex prompts
32
32
  //
33
33
  const askTeamName = async client => {
34
- var _res$data$result$find;
34
+ var _teams$find;
35
+
36
+ const teams = await client.getTeams();
37
+
38
+ if (!(teams !== null && teams !== void 0 && teams.length)) {
39
+ throw new Error('Account has no teams!');
40
+ }
35
41
 
36
- const res = await client.getTeams();
37
- if (!res.data) throw Error('Get teams error.');
38
42
  return (0, _basicPrompts.askList)({
39
43
  msg: helpers.envMessages.selectTeam,
40
- choices: res.data.result.map(t => t.name),
41
- default: (_res$data$result$find = res.data.result.find(t => t.default)) === null || _res$data$result$find === void 0 ? void 0 : _res$data$result$find.name
44
+ choices: teams.map(t => t.name).sort((name1, name2) => name1.localeCompare(name2)),
45
+ default: (_teams$find = teams.find(t => t.default)) === null || _teams$find === void 0 ? void 0 : _teams$find.name
42
46
  });
43
47
  };
44
48
 
@@ -82,12 +86,12 @@ const getTraceabilityConfig = async installConfig => {
82
86
 
83
87
  exports.getTraceabilityConfig = getTraceabilityConfig;
84
88
 
85
- const getCentralConfig = async (apiCentralClient, apiServerClient, platformClient, defsManager, apicDeployment, installConfig) => {
89
+ const getCentralConfig = async (apiServerClient, platformClient, defsManager, apicDeployment, installConfig) => {
86
90
  // initiate CentralAgentConfig
87
91
  let centralConfig = installConfig.centralConfig;
88
92
  await centralConfig.setBaseHost();
89
93
  centralConfig.authUrl = `${_CoreConfigController.CoreConfigController.getAuthUrl()}/auth`;
90
- centralConfig.region = String(apiCentralClient.region || (await (0, _utils.getConfig)())[_types.ConfigTypes.REGION] || _types.Regions.US).toUpperCase();
94
+ centralConfig.region = String(apiServerClient.region || (await (0, _utils.getConfig)())[_types.ConfigTypes.REGION] || _types.Regions.US).toUpperCase();
91
95
  centralConfig.deployment = apicDeployment || getApicDeployment(centralConfig.region, _CoreConfigController.CoreConfigController.getEnv()); // apic config
92
96
 
93
97
  console.log('\nCONNECTION TO AMPLIFY PLATFORM:');
@@ -104,7 +108,7 @@ const getCentralConfig = async (apiCentralClient, apiServerClient, platformClien
104
108
  };
105
109
 
106
110
  if (installConfig.bundleType !== _types.BundleType.TRACEABILITY_OFFLINE) {
107
- centralConfig.ampcDosaInfo = await helpers.askDosaClientId(apiCentralClient);
111
+ centralConfig.ampcDosaInfo = await helpers.askDosaClientId(platformClient);
108
112
  } // Get the DA Agent name
109
113
 
110
114
 
@@ -126,14 +130,14 @@ const getCentralConfig = async (apiCentralClient, apiServerClient, platformClien
126
130
 
127
131
  exports.getCentralConfig = getCentralConfig;
128
132
 
129
- const finalizeCentralInstall = async (apiCentralClient, apiServerClient, platformClient, defsManager, installConfig) => {
133
+ const finalizeCentralInstall = async (apiServerClient, platformClient, defsManager, installConfig) => {
130
134
  /**
131
135
  * Create agent resources
132
136
  */
133
137
  console.log('Creating agent resources');
134
138
 
135
139
  if (installConfig.centralConfig.ampcDosaInfo.isNew) {
136
- installConfig.centralConfig.dosaAccount = await helpers.createDosaAndCerts(apiCentralClient, installConfig.centralConfig.ampcDosaInfo.name);
140
+ installConfig.centralConfig.dosaAccount = await helpers.createDosaAndCerts(platformClient, installConfig.centralConfig.ampcDosaInfo.name);
137
141
  } else {
138
142
  installConfig.centralConfig.dosaAccount.clientId = installConfig.centralConfig.ampcDosaInfo.clientId;
139
143
  }
@@ -48,7 +48,8 @@ class ApiServerClient {
48
48
  baseUrl,
49
49
  region,
50
50
  account,
51
- useCache
51
+ useCache,
52
+ team
52
53
  } = {}) {
53
54
  _defineProperty(this, "baseUrl", void 0);
54
55
 
@@ -58,11 +59,15 @@ class ApiServerClient {
58
59
 
59
60
  _defineProperty(this, "account", void 0);
60
61
 
61
- log(`initializing client with params: baseUrl = ${baseUrl}, region = ${region}, account = ${account}, useCache = ${useCache}`);
62
+ _defineProperty(this, "team", void 0);
63
+
64
+ log(`initializing client with params: baseUrl = ${baseUrl}, region = ${region}, account = ${account}, useCache = ${useCache}, team = ${team}`);
62
65
  this.baseUrl = baseUrl;
63
66
  this.account = account;
64
67
  this.region = region;
65
68
  this.useCache = useCache === undefined ? true : useCache; // using cache by default
69
+
70
+ this.team = team;
66
71
  }
67
72
  /**
68
73
  * Build resource url based on its ResourceDefinition and passed scope def and name.
@@ -111,7 +116,8 @@ class ApiServerClient {
111
116
  const service = await (0, _dataService.dataService)({
112
117
  baseUrl: this.baseUrl,
113
118
  region: this.region,
114
- account: this.account
119
+ account: this.account,
120
+ team: this.team
115
121
  });
116
122
  const baseUrl = this.buildResourceBaseUrl({
117
123
  resourceDef,
@@ -238,7 +244,8 @@ class ApiServerClient {
238
244
  const service = await (0, _dataService.dataService)({
239
245
  baseUrl: this.baseUrl,
240
246
  region: this.region,
241
- account: this.account
247
+ account: this.account,
248
+ team: this.team
242
249
  });
243
250
  const url = this.buildResourceBaseUrl({
244
251
  resourceDef,
@@ -311,7 +318,8 @@ class ApiServerClient {
311
318
  const service = await (0, _dataService.dataService)({
312
319
  baseUrl: this.baseUrl,
313
320
  region: this.region,
314
- account: this.account
321
+ account: this.account,
322
+ team: this.team
315
323
  });
316
324
  const url = this.buildResourceBaseUrl({
317
325
  resourceDef,
@@ -384,7 +392,8 @@ class ApiServerClient {
384
392
  const service = await (0, _dataService.dataService)({
385
393
  baseUrl: this.baseUrl,
386
394
  region: this.region,
387
- account: this.account
395
+ account: this.account,
396
+ team: this.team
388
397
  });
389
398
  const url = this.buildResourceBaseUrl({
390
399
  resourceDef,
@@ -463,7 +472,8 @@ class ApiServerClient {
463
472
  const service = await (0, _dataService.dataService)({
464
473
  baseUrl: this.baseUrl,
465
474
  region: this.region,
466
- account: this.account
475
+ account: this.account,
476
+ team: this.team
467
477
  });
468
478
  const url = this.buildResourceBaseUrl({
469
479
  resourceDef,
@@ -513,7 +523,8 @@ class ApiServerClient {
513
523
  const service = await (0, _dataService.dataService)({
514
524
  baseUrl: this.baseUrl,
515
525
  region: this.region,
516
- account: this.account
526
+ account: this.account,
527
+ team: this.team
517
528
  });
518
529
  const url = this.buildResourceBaseUrl({
519
530
  resourceDef,