mas-cli 10.0.6__py3-none-any.whl → 10.1.0__py3-none-any.whl

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.

Potentially problematic release.


This version of mas-cli might be problematic. Click here for more details.

mas/cli/__init__.py CHANGED
@@ -8,4 +8,4 @@
8
8
  #
9
9
  # *****************************************************************************
10
10
 
11
- __version__ = "10.0.6"
11
+ __version__ = "10.1.0"
mas/cli/cli.py CHANGED
@@ -124,9 +124,7 @@ class BaseApp(PrintMixin, PromptMixin):
124
124
  self.printTitle(f"\nIBM Maximo Application Suite Admin CLI v{self.version}")
125
125
  print_formatted_text(HTML("Powered by <DarkGoldenRod><u>https://github.com/ibm-mas/ansible-devops/</u></DarkGoldenRod> and <DarkGoldenRod><u>https://tekton.dev/</u></DarkGoldenRod>\n"))
126
126
  if which("kubectl") is None:
127
- logger.error("Could not find kubectl on the path")
128
- print_formatted_text(HTML("\n<Red>Error: Could not find kubectl on the path, see <u>https://kubernetes.io/docs/tasks/tools/#kubectl</u> for installation instructions</Red>\n"))
129
- exit(1)
127
+ self.fatalError("Could not find kubectl on the path, see <u>https://kubernetes.io/docs/tasks/tools/#kubectl</u> for installation instructions")
130
128
 
131
129
  def getCompatibleVersions(self, coreChannel: str, appId: str) -> list:
132
130
  if coreChannel in self.compatibilityMatrix:
@@ -136,8 +134,11 @@ class BaseApp(PrintMixin, PromptMixin):
136
134
 
137
135
  def fatalError(self, message: str, exception: Exception=None) -> None:
138
136
  if exception is not None:
137
+ logger.error(message)
138
+ logger.exception(exception, stack_info=True)
139
139
  print_formatted_text(HTML(f"<Red>Fatal Exception: {message.replace(' & ', ' &amp; ')}: {exception}</Red>"))
140
140
  else:
141
+ logger.error(message)
141
142
  print_formatted_text(HTML(f"<Red>Fatal Error: {message.replace(' & ', ' &amp; ')}</Red>"))
142
143
  exit(1)
143
144
 
@@ -7,3 +7,5 @@
7
7
  # http://www.eclipse.org/legal/epl-v10.html
8
8
  #
9
9
  # *****************************************************************************
10
+
11
+ from ..cli import BaseApp
@@ -1,4 +1,4 @@
1
- #!python
1
+ #!/usr/bin/env python
2
2
  # *****************************************************************************
3
3
  # Copyright (c) 2024 IBM Corporation and other Contributors.
4
4
  #
@@ -18,20 +18,16 @@ import re
18
18
  from openshift.dynamic.exceptions import NotFoundError
19
19
 
20
20
  from prompt_toolkit import prompt, print_formatted_text, HTML
21
- from urllib3.exceptions import MaxRetryError
22
- from jinja2.exceptions import TemplateNotFound
23
- from kubeconfig.exceptions import KubectlCommandError
24
- from kubernetes.client.exceptions import ApiException
25
21
 
26
22
  from tabulate import tabulate
27
23
 
28
24
  from halo import Halo
29
25
 
30
- from mas.cli.cli import BaseApp
31
- from mas.cli.gencfg import ConfigGeneratorMixin
32
- from mas.cli.install.argParser import installArgParser
33
- from mas.cli.install.settings import InstallSettingsMixin
34
- from mas.cli.install.summarizer import InstallSummarizerMixin
26
+ from ..cli import BaseApp
27
+ from ..gencfg import ConfigGeneratorMixin
28
+ from .argParser import installArgParser
29
+ from .settings import InstallSettingsMixin
30
+ from .summarizer import InstallSummarizerMixin
35
31
 
36
32
  from mas.cli.validators import (
37
33
  InstanceIDFormatValidator,
@@ -47,7 +43,7 @@ from mas.devops.tekton import installOpenShiftPipelines, updateTektonDefinitions
47
43
  logger = logging.getLogger(__name__)
48
44
 
49
45
 
50
- class App(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGeneratorMixin):
46
+ class InstallApp(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGeneratorMixin):
51
47
  def validateCatalogSource(self):
52
48
  catalogsAPI = self.dynamicClient.resources.get(api_version="operators.coreos.com/v1alpha1", kind="CatalogSource")
53
49
  try:
@@ -667,7 +663,7 @@ class App(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGenerator
667
663
  "mas_arcgis_channel"
668
664
  ]
669
665
 
670
- for key, value in vars(args).items():
666
+ for key, value in vars(self.args).items():
671
667
  # These fields we just pass straight through to the parameters and fail if they are not set
672
668
  if key in requiredParams:
673
669
  if value is None:
@@ -778,10 +774,12 @@ class App(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGenerator
778
774
  self.validateCatalogSource()
779
775
  self.licensePrompt()
780
776
 
781
- def install(self, args):
777
+ def install(self, argv):
782
778
  """
783
779
  Install MAS instance
784
780
  """
781
+ args = installArgParser.parse_args(args=argv)
782
+
785
783
  # We use the presence of --mas-instance-id to determine whether
786
784
  # the CLI is being started in interactive mode or not
787
785
  instanceId = args.mas_instance_id
@@ -967,25 +965,3 @@ class App(BaseApp, InstallSettingsMixin, InstallSummarizerMixin, ConfigGenerator
967
965
  else:
968
966
  h.stop_and_persist(symbol=self.failureIcon, text=f"Failed to submit PipelineRun for {self.getParam('mas_instance_id')} install, see log file for details")
969
967
  print()
970
-
971
-
972
- if __name__ == '__main__':
973
- args = installArgParser.parse_args()
974
-
975
- try:
976
- app = App()
977
- app.install(args)
978
- except KeyboardInterrupt as e:
979
- pass
980
- except ApiException as e:
981
- logger.exception(e, stack_info=True)
982
- app.fatalError(message=f"An error occured communicating with the target server: {e.reason} ({e.status})")
983
- except MaxRetryError as e:
984
- logger.exception(e, stack_info=True)
985
- app.fatalError(message="Unable to connect to API server", exception=e)
986
- except TemplateNotFound as e:
987
- logger.exception(e, stack_info=True)
988
- app.fatalError("Could not find template", exception=e)
989
- except KubectlCommandError as e:
990
- logger.exception(e, stack_info=True)
991
- app.fatalError("Could not execute kubectl command", exception=e)
@@ -21,7 +21,7 @@ def isValidFile(parser, arg) -> str:
21
21
  return arg
22
22
 
23
23
  installArgParser = argparse.ArgumentParser(
24
- prog="mas uninstall",
24
+ prog="mas install",
25
25
  description="\n".join([
26
26
  f"IBM Maximo Application Suite Admin CLI v{packageVersion}",
27
27
  "Install MAS by configuring and launching the MAS Uninstall Tekton Pipeline.\n",
@@ -108,7 +108,7 @@ spec:
108
108
  command:
109
109
  - /opt/app-root/src/run-role.sh
110
110
  - appconnect
111
- image: quay.io/ibmmas/cli:10.0.6
111
+ image: quay.io/ibmmas/cli:10.1.0
112
112
  imagePullPolicy: $(params.image_pull_policy)
113
113
  workingDir: /workspace/configs
114
114
 
@@ -226,7 +226,7 @@ spec:
226
226
  command:
227
227
  - /opt/app-root/src/run-role.sh
228
228
  - arcgis
229
- image: quay.io/ibmmas/cli:10.0.6
229
+ image: quay.io/ibmmas/cli:10.1.0
230
230
  imagePullPolicy: $(params.image_pull_policy)
231
231
  # --------------------------------------------------------------------------------
232
232
  # /home/runner/work/cli/cli/tekton/target/tasks/cert-manager.yaml
@@ -296,7 +296,7 @@ spec:
296
296
  command:
297
297
  - /opt/app-root/src/run-role.sh
298
298
  - cert_manager
299
- image: quay.io/ibmmas/cli:10.0.6
299
+ image: quay.io/ibmmas/cli:10.1.0
300
300
  imagePullPolicy: $(params.image_pull_policy)
301
301
  workingDir: /workspace/configs
302
302
  # --------------------------------------------------------------------------------
@@ -359,7 +359,7 @@ spec:
359
359
  command:
360
360
  - /opt/app-root/src/run-role.sh
361
361
  - common_services
362
- image: quay.io/ibmmas/cli:10.0.6
362
+ image: quay.io/ibmmas/cli:10.1.0
363
363
  imagePullPolicy: $(params.image_pull_policy)
364
364
  workingDir: /workspace/configs
365
365
  # --------------------------------------------------------------------------------
@@ -454,7 +454,7 @@ spec:
454
454
  command:
455
455
  - /opt/app-root/src/run-role.sh
456
456
  - cos
457
- image: quay.io/ibmmas/cli:10.0.6
457
+ image: quay.io/ibmmas/cli:10.1.0
458
458
  imagePullPolicy: $(params.image_pull_policy)
459
459
  workingDir: /workspace/configs
460
460
  # --------------------------------------------------------------------------------
@@ -569,7 +569,7 @@ spec:
569
569
  command:
570
570
  - /opt/app-root/src/run-role.sh
571
571
  - cos
572
- image: quay.io/ibmmas/cli:10.0.6
572
+ image: quay.io/ibmmas/cli:10.1.0
573
573
  imagePullPolicy: $(params.image_pull_policy)
574
574
  workingDir: /workspace/configs
575
575
 
@@ -689,7 +689,7 @@ spec:
689
689
  command:
690
690
  - /opt/app-root/src/run-role.sh
691
691
  - cp4d_service
692
- image: quay.io/ibmmas/cli:10.0.6
692
+ image: quay.io/ibmmas/cli:10.1.0
693
693
  imagePullPolicy: $(params.image_pull_policy)
694
694
  workingDir: /workspace/configs
695
695
  # --------------------------------------------------------------------------------
@@ -806,7 +806,7 @@ spec:
806
806
  command:
807
807
  - /opt/app-root/src/run-role.sh
808
808
  - cp4d_service
809
- image: quay.io/ibmmas/cli:10.0.6
809
+ image: quay.io/ibmmas/cli:10.1.0
810
810
  imagePullPolicy: $(params.image_pull_policy)
811
811
  workingDir: /workspace/configs
812
812
 
@@ -912,7 +912,7 @@ spec:
912
912
  command:
913
913
  - /opt/app-root/src/run-role.sh
914
914
  - cp4d
915
- image: quay.io/ibmmas/cli:10.0.6
915
+ image: quay.io/ibmmas/cli:10.1.0
916
916
  imagePullPolicy: $(params.image_pull_policy)
917
917
  # --------------------------------------------------------------------------------
918
918
  # /home/runner/work/cli/cli/tekton/target/tasks/db2.yaml
@@ -1234,7 +1234,7 @@ spec:
1234
1234
  command:
1235
1235
  - /opt/app-root/src/run-role.sh
1236
1236
  - db2
1237
- image: quay.io/ibmmas/cli:10.0.6
1237
+ image: quay.io/ibmmas/cli:10.1.0
1238
1238
  imagePullPolicy: $(params.image_pull_policy)
1239
1239
  workingDir: /workspace/configs
1240
1240
 
@@ -1337,7 +1337,7 @@ spec:
1337
1337
  command:
1338
1338
  - /opt/app-root/src/run-role.sh
1339
1339
  - eck
1340
- image: quay.io/ibmmas/cli:10.0.6
1340
+ image: quay.io/ibmmas/cli:10.1.0
1341
1341
  imagePullPolicy: $(params.image_pull_policy)
1342
1342
  # --------------------------------------------------------------------------------
1343
1343
  # /home/runner/work/cli/cli/tekton/target/tasks/gencfg-workspace.yaml
@@ -1426,7 +1426,7 @@ spec:
1426
1426
  command:
1427
1427
  - /opt/app-root/src/run-role.sh
1428
1428
  - gencfg_workspace
1429
- image: quay.io/ibmmas/cli:10.0.6
1429
+ image: quay.io/ibmmas/cli:10.1.0
1430
1430
  imagePullPolicy: $(params.image_pull_policy)
1431
1431
  workingDir: /workspace/configs
1432
1432
 
@@ -1478,7 +1478,7 @@ spec:
1478
1478
 
1479
1479
  steps:
1480
1480
  - name: grafana
1481
- image: quay.io/ibmmas/cli:10.0.6
1481
+ image: quay.io/ibmmas/cli:10.1.0
1482
1482
  imagePullPolicy: $(params.image_pull_policy)
1483
1483
  command:
1484
1484
  - /opt/app-root/src/run-role.sh
@@ -1612,7 +1612,7 @@ spec:
1612
1612
  command:
1613
1613
  - /opt/app-root/src/run-role.sh
1614
1614
  - ibm_catalogs
1615
- image: quay.io/ibmmas/cli:10.0.6
1615
+ image: quay.io/ibmmas/cli:10.1.0
1616
1616
  imagePullPolicy: $(params.image_pull_policy)
1617
1617
  workingDir: /workspace/configs
1618
1618
  # --------------------------------------------------------------------------------
@@ -1719,7 +1719,7 @@ spec:
1719
1719
  command:
1720
1720
  - /opt/app-root/src/run-role.sh
1721
1721
  - kafka
1722
- image: quay.io/ibmmas/cli:10.0.6
1722
+ image: quay.io/ibmmas/cli:10.1.0
1723
1723
  imagePullPolicy: $(params.image_pull_policy)
1724
1724
  workingDir: /workspace/configs
1725
1725
  # --------------------------------------------------------------------------------
@@ -1961,7 +1961,7 @@ spec:
1961
1961
  command:
1962
1962
  - /opt/app-root/src/run-role.sh
1963
1963
  - kafka
1964
- image: quay.io/ibmmas/cli:10.0.6
1964
+ image: quay.io/ibmmas/cli:10.1.0
1965
1965
  imagePullPolicy: $(params.image_pull_policy)
1966
1966
  workingDir: /workspace/configs
1967
1967
 
@@ -1988,7 +1988,7 @@ spec:
1988
1988
 
1989
1989
  steps:
1990
1990
  - name: start-pipelinerun
1991
- image: quay.io/ibmmas/cli:10.0.6
1991
+ image: quay.io/ibmmas/cli:10.1.0
1992
1992
  imagePullPolicy: $(params.image_pull_policy)
1993
1993
  command:
1994
1994
  - ansible-playbook
@@ -2093,7 +2093,7 @@ spec:
2093
2093
  optional: false
2094
2094
 
2095
2095
  - name: wait-for-pipelinerun
2096
- image: quay.io/ibmmas/cli:10.0.6
2096
+ image: quay.io/ibmmas/cli:10.1.0
2097
2097
  imagePullPolicy: $(params.image_pull_policy)
2098
2098
  # 50 retries at 10 minute intervals = just over 8 hours
2099
2099
  command:
@@ -2287,7 +2287,7 @@ spec:
2287
2287
  command:
2288
2288
  - /opt/app-root/src/run-role.sh
2289
2289
  - mongodb
2290
- image: quay.io/ibmmas/cli:10.0.6
2290
+ image: quay.io/ibmmas/cli:10.1.0
2291
2291
  imagePullPolicy: $(params.image_pull_policy)
2292
2292
  workingDir: /workspace/configs
2293
2293
 
@@ -2330,7 +2330,7 @@ spec:
2330
2330
  - $(params.base_output_dir)
2331
2331
  - --extra-namespaces
2332
2332
  - selenium
2333
- image: quay.io/ibmmas/cli:10.0.6
2333
+ image: quay.io/ibmmas/cli:10.1.0
2334
2334
  imagePullPolicy: $(params.image_pull_policy)
2335
2335
  env:
2336
2336
  - name: DEVOPS_MONGO_URI
@@ -2447,7 +2447,7 @@ spec:
2447
2447
  command:
2448
2448
  - /opt/app-root/src/run-role.sh
2449
2449
  - nvidia_gpu
2450
- image: quay.io/ibmmas/cli:10.0.6
2450
+ image: quay.io/ibmmas/cli:10.1.0
2451
2451
  imagePullPolicy: $(params.image_pull_policy)
2452
2452
  workingDir: /workspace/configs
2453
2453
 
@@ -2526,7 +2526,7 @@ spec:
2526
2526
  command:
2527
2527
  - /opt/app-root/src/run-role.sh
2528
2528
  - ocp_deprovision
2529
- image: quay.io/ibmmas/cli:10.0.6
2529
+ image: quay.io/ibmmas/cli:10.1.0
2530
2530
  imagePullPolicy: $(params.image_pull_policy)
2531
2531
  # --------------------------------------------------------------------------------
2532
2532
  # /home/runner/work/cli/cli/tekton/target/tasks/ocp-verify-all.yaml
@@ -2558,7 +2558,7 @@ spec:
2558
2558
  # Verify Cluster
2559
2559
  # -------------------------------------------------------------------------
2560
2560
  - name: ocp-verify-cluster
2561
- image: quay.io/ibmmas/cli:10.0.6
2561
+ image: quay.io/ibmmas/cli:10.1.0
2562
2562
  imagePullPolicy: $(params.image_pull_policy)
2563
2563
  command:
2564
2564
  - /opt/app-root/src/run-role.sh
@@ -2600,7 +2600,7 @@ spec:
2600
2600
  # Verify Catalogs
2601
2601
  # -------------------------------------------------------------------------
2602
2602
  - name: ocp-verify-catalogs
2603
- image: quay.io/ibmmas/cli:10.0.6
2603
+ image: quay.io/ibmmas/cli:10.1.0
2604
2604
  imagePullPolicy: $(params.image_pull_policy)
2605
2605
  command:
2606
2606
  - /opt/app-root/src/run-role.sh
@@ -2642,7 +2642,7 @@ spec:
2642
2642
  # Verify Subscriptions
2643
2643
  # -------------------------------------------------------------------------
2644
2644
  - name: ocp-verify-subscriptions
2645
- image: quay.io/ibmmas/cli:10.0.6
2645
+ image: quay.io/ibmmas/cli:10.1.0
2646
2646
  imagePullPolicy: $(params.image_pull_policy)
2647
2647
  command:
2648
2648
  - /opt/app-root/src/run-role.sh
@@ -2684,7 +2684,7 @@ spec:
2684
2684
  # Verify Workloads
2685
2685
  # -------------------------------------------------------------------------
2686
2686
  - name: ocp-verify-workloads
2687
- image: quay.io/ibmmas/cli:10.0.6
2687
+ image: quay.io/ibmmas/cli:10.1.0
2688
2688
  imagePullPolicy: $(params.image_pull_policy)
2689
2689
  command:
2690
2690
  - /opt/app-root/src/run-role.sh
@@ -2726,7 +2726,7 @@ spec:
2726
2726
  # Verify Catalogs - Ingress TLS
2727
2727
  # -------------------------------------------------------------------------
2728
2728
  - name: ocp-verify-ingress
2729
- image: quay.io/ibmmas/cli:10.0.6
2729
+ image: quay.io/ibmmas/cli:10.1.0
2730
2730
  imagePullPolicy: $(params.image_pull_policy)
2731
2731
  command:
2732
2732
  - /opt/app-root/src/run-role.sh
@@ -2852,7 +2852,7 @@ spec:
2852
2852
  command:
2853
2853
  - /opt/app-root/src/run-role.sh
2854
2854
  - ocp_verify
2855
- image: quay.io/ibmmas/cli:10.0.6
2855
+ image: quay.io/ibmmas/cli:10.1.0
2856
2856
  imagePullPolicy: $(params.image_pull_policy)
2857
2857
  workingDir: /workspace/configs
2858
2858
  # --------------------------------------------------------------------------------
@@ -2920,7 +2920,7 @@ spec:
2920
2920
  command:
2921
2921
  - /opt/app-root/src/run-role.sh
2922
2922
  - ocs
2923
- image: quay.io/ibmmas/cli:10.0.6
2923
+ image: quay.io/ibmmas/cli:10.1.0
2924
2924
  imagePullPolicy: $(params.image_pull_policy)
2925
2925
  workingDir: /workspace/configs
2926
2926
 
@@ -3101,7 +3101,7 @@ spec:
3101
3101
  command:
3102
3102
  - /opt/app-root/src/run-role.sh
3103
3103
  - sls
3104
- image: quay.io/ibmmas/cli:10.0.6
3104
+ image: quay.io/ibmmas/cli:10.1.0
3105
3105
  imagePullPolicy: $(params.image_pull_policy)
3106
3106
  workingDir: /workspace/configs
3107
3107
 
@@ -3476,12 +3476,12 @@ spec:
3476
3476
  command:
3477
3477
  - /opt/app-root/src/run-role.sh
3478
3478
  - suite_app_config
3479
- image: quay.io/ibmmas/cli:10.0.6
3479
+ image: quay.io/ibmmas/cli:10.1.0
3480
3480
  imagePullPolicy: $(params.image_pull_policy)
3481
3481
 
3482
3482
  # If configmap/approval-app-cfg-$(params.mas_app_id) exists then set CONFIGMAP_KEY=pending and wait for it to be changed to "approved"
3483
3483
  - name: app-cfg-post-verify
3484
- image: quay.io/ibmmas/cli:10.0.6
3484
+ image: quay.io/ibmmas/cli:10.1.0
3485
3485
  imagePullPolicy: $(params.image_pull_policy)
3486
3486
  command:
3487
3487
  - /opt/app-root/src/wait-for-configmap.sh
@@ -3682,7 +3682,7 @@ spec:
3682
3682
  command:
3683
3683
  - /opt/app-root/src/run-role.sh
3684
3684
  - suite_app_install
3685
- image: quay.io/ibmmas/cli:10.0.6
3685
+ image: quay.io/ibmmas/cli:10.1.0
3686
3686
  imagePullPolicy: $(params.image_pull_policy)
3687
3687
 
3688
3688
  workspaces:
@@ -3771,7 +3771,7 @@ spec:
3771
3771
  command:
3772
3772
  - /opt/app-root/src/run-role.sh
3773
3773
  - suite_app_rollback
3774
- image: quay.io/ibmmas/cli:10.0.6
3774
+ image: quay.io/ibmmas/cli:10.1.0
3775
3775
  imagePullPolicy: $(params.image_pull_policy)
3776
3776
  # --------------------------------------------------------------------------------
3777
3777
  # /home/runner/work/cli/cli/tekton/target/tasks/suite-app-uninstall.yaml
@@ -3834,7 +3834,7 @@ spec:
3834
3834
  command:
3835
3835
  - /opt/app-root/src/run-role.sh
3836
3836
  - suite_app_uninstall
3837
- image: quay.io/ibmmas/cli:10.0.6
3837
+ image: quay.io/ibmmas/cli:10.1.0
3838
3838
  imagePullPolicy: $(params.image_pull_policy)
3839
3839
  # --------------------------------------------------------------------------------
3840
3840
  # /home/runner/work/cli/cli/tekton/target/tasks/suite-app-upgrade.yaml
@@ -3909,7 +3909,7 @@ spec:
3909
3909
  command:
3910
3910
  - /opt/app-root/src/run-role.sh
3911
3911
  - suite_app_upgrade
3912
- image: quay.io/ibmmas/cli:10.0.6
3912
+ image: quay.io/ibmmas/cli:10.1.0
3913
3913
  imagePullPolicy: $(params.image_pull_policy)
3914
3914
  # --------------------------------------------------------------------------------
3915
3915
  # /home/runner/work/cli/cli/tekton/target/tasks/suite-app-verify.yaml
@@ -4010,7 +4010,7 @@ spec:
4010
4010
  command:
4011
4011
  - /opt/app-root/src/run-role.sh
4012
4012
  - suite_app_verify
4013
- image: quay.io/ibmmas/cli:10.0.6
4013
+ image: quay.io/ibmmas/cli:10.1.0
4014
4014
  imagePullPolicy: $(params.image_pull_policy)
4015
4015
  # --------------------------------------------------------------------------------
4016
4016
  # /home/runner/work/cli/cli/tekton/target/tasks/suite-certs.yaml
@@ -4153,7 +4153,7 @@ spec:
4153
4153
  command:
4154
4154
  - /opt/app-root/src/run-role.sh
4155
4155
  - suite_certs
4156
- image: quay.io/ibmmas/cli:10.0.6
4156
+ image: quay.io/ibmmas/cli:10.1.0
4157
4157
  imagePullPolicy: $(params.image_pull_policy)
4158
4158
 
4159
4159
  workspaces:
@@ -4220,7 +4220,7 @@ spec:
4220
4220
  command:
4221
4221
  - /opt/app-root/src/run-role.sh
4222
4222
  - suite_config
4223
- image: quay.io/ibmmas/cli:10.0.6
4223
+ image: quay.io/ibmmas/cli:10.1.0
4224
4224
  imagePullPolicy: $(params.image_pull_policy)
4225
4225
  workingDir: /workspace/configs
4226
4226
 
@@ -4291,7 +4291,7 @@ spec:
4291
4291
  command:
4292
4292
  - /opt/app-root/src/run-role.sh
4293
4293
  - suite_db2_setup_for_manage
4294
- image: quay.io/ibmmas/cli:10.0.6
4294
+ image: quay.io/ibmmas/cli:10.1.0
4295
4295
  imagePullPolicy: $(params.image_pull_policy)
4296
4296
  # --------------------------------------------------------------------------------
4297
4297
  # /home/runner/work/cli/cli/tekton/target/tasks/suite-dns.yaml
@@ -4481,7 +4481,7 @@ spec:
4481
4481
  command:
4482
4482
  - /opt/app-root/src/run-role.sh
4483
4483
  - suite_dns
4484
- image: quay.io/ibmmas/cli:10.0.6
4484
+ image: quay.io/ibmmas/cli:10.1.0
4485
4485
  imagePullPolicy: $(params.image_pull_policy)
4486
4486
  # --------------------------------------------------------------------------------
4487
4487
  # /home/runner/work/cli/cli/tekton/target/tasks/suite-install.yaml
@@ -4661,7 +4661,7 @@ spec:
4661
4661
  command:
4662
4662
  - /opt/app-root/src/run-role.sh
4663
4663
  - suite_install
4664
- image: quay.io/ibmmas/cli:10.0.6
4664
+ image: quay.io/ibmmas/cli:10.1.0
4665
4665
  imagePullPolicy: $(params.image_pull_policy)
4666
4666
  workingDir: /workspace/configs
4667
4667
 
@@ -4749,7 +4749,7 @@ spec:
4749
4749
  command:
4750
4750
  - /opt/app-root/src/run-role.sh
4751
4751
  - suite_rollback
4752
- image: quay.io/ibmmas/cli:10.0.6
4752
+ image: quay.io/ibmmas/cli:10.1.0
4753
4753
  imagePullPolicy: $(params.image_pull_policy)
4754
4754
  # --------------------------------------------------------------------------------
4755
4755
  # /home/runner/work/cli/cli/tekton/target/tasks/suite-uninstall.yaml
@@ -4814,7 +4814,7 @@ spec:
4814
4814
  command:
4815
4815
  - /opt/app-root/src/run-role.sh
4816
4816
  - suite_uninstall
4817
- image: quay.io/ibmmas/cli:10.0.6
4817
+ image: quay.io/ibmmas/cli:10.1.0
4818
4818
  imagePullPolicy: $(params.image_pull_policy)
4819
4819
  # --------------------------------------------------------------------------------
4820
4820
  # /home/runner/work/cli/cli/tekton/target/tasks/suite-upgrade.yaml
@@ -4884,7 +4884,7 @@ spec:
4884
4884
  command:
4885
4885
  - /opt/app-root/src/run-role.sh
4886
4886
  - suite_upgrade
4887
- image: quay.io/ibmmas/cli:10.0.6
4887
+ image: quay.io/ibmmas/cli:10.1.0
4888
4888
  imagePullPolicy: $(params.image_pull_policy)
4889
4889
  # --------------------------------------------------------------------------------
4890
4890
  # /home/runner/work/cli/cli/tekton/target/tasks/suite-verify.yaml
@@ -4946,12 +4946,12 @@ spec:
4946
4946
  command:
4947
4947
  - /opt/app-root/src/run-role.sh
4948
4948
  - suite_verify
4949
- image: quay.io/ibmmas/cli:10.0.6
4949
+ image: quay.io/ibmmas/cli:10.1.0
4950
4950
  imagePullPolicy: $(params.image_pull_policy)
4951
4951
 
4952
4952
  # If configmap/approval-suite-verify exists then set CONFIGMAP_KEY=pending and wait for it to be changed to "approved"
4953
4953
  - name: suite-post-verify
4954
- image: quay.io/ibmmas/cli:10.0.6
4954
+ image: quay.io/ibmmas/cli:10.1.0
4955
4955
  imagePullPolicy: $(params.image_pull_policy)
4956
4956
  command:
4957
4957
  - /opt/app-root/src/wait-for-configmap.sh
@@ -5080,7 +5080,7 @@ spec:
5080
5080
  command:
5081
5081
  - /opt/app-root/src/run-role.sh
5082
5082
  - turbonomic
5083
- image: quay.io/ibmmas/cli:10.0.6
5083
+ image: quay.io/ibmmas/cli:10.1.0
5084
5084
  imagePullPolicy: $(params.image_pull_policy)
5085
5085
  # --------------------------------------------------------------------------------
5086
5086
  # /home/runner/work/cli/cli/tekton/target/tasks/uds.yaml
@@ -5161,7 +5161,7 @@ spec:
5161
5161
  # IBM User Data Services (UDS)
5162
5162
  # -------------------------------------------------------------------------
5163
5163
  - name: uds
5164
- image: quay.io/ibmmas/cli:10.0.6
5164
+ image: quay.io/ibmmas/cli:10.1.0
5165
5165
  imagePullPolicy: $(params.image_pull_policy)
5166
5166
  workingDir: /workspace/configs
5167
5167
  command:
@@ -5224,7 +5224,7 @@ spec:
5224
5224
  # IBM Data Reporter Operator (DRO)
5225
5225
  # -------------------------------------------------------------------------
5226
5226
  - name: dro
5227
- image: quay.io/ibmmas/cli:10.0.6
5227
+ image: quay.io/ibmmas/cli:10.1.0
5228
5228
  imagePullPolicy: $(params.image_pull_policy)
5229
5229
  workingDir: /workspace/configs
5230
5230
  command:
@@ -5310,7 +5310,7 @@ spec:
5310
5310
 
5311
5311
  steps:
5312
5312
  - name: update-configmap
5313
- image: quay.io/ibmmas/cli:10.0.6
5313
+ image: quay.io/ibmmas/cli:10.1.0
5314
5314
  command:
5315
5315
  - /opt/app-root/src/update-configmap.sh
5316
5316
  env:
@@ -5372,7 +5372,7 @@ spec:
5372
5372
 
5373
5373
  steps:
5374
5374
  - name: wait-for-configmap
5375
- image: quay.io/ibmmas/cli:10.0.6
5375
+ image: quay.io/ibmmas/cli:10.1.0
5376
5376
  command:
5377
5377
  - /opt/app-root/src/wait-for-configmap.sh
5378
5378
  env:
@@ -5436,7 +5436,7 @@ spec:
5436
5436
 
5437
5437
  steps:
5438
5438
  - name: wait
5439
- image: quay.io/ibmmas/cli:10.0.6
5439
+ image: quay.io/ibmmas/cli:10.1.0
5440
5440
  command:
5441
5441
  - /opt/app-root/src/wait-for-tekton.sh
5442
5442
  env:
@@ -0,0 +1,11 @@
1
+ # *****************************************************************************
2
+ # Copyright (c) 2024 IBM Corporation and other Contributors.
3
+ #
4
+ # All rights reserved. This program and the accompanying materials
5
+ # are made available under the terms of the Eclipse Public License v1.0
6
+ # which accompanies this distribution, and is available at
7
+ # http://www.eclipse.org/legal/epl-v10.html
8
+ #
9
+ # *****************************************************************************
10
+
11
+ from ..cli import BaseApp
@@ -1,4 +1,4 @@
1
- #!python
1
+ #!/usr/bin/env python
2
2
  # *****************************************************************************
3
3
  # Copyright (c) 2024 IBM Corporation and other Contributors.
4
4
  #
@@ -9,23 +9,17 @@
9
9
  #
10
10
  # *****************************************************************************
11
11
 
12
- import argparse
13
- import sys
14
12
  import logging
15
13
  import logging.handlers
16
14
  from halo import Halo
17
15
  from prompt_toolkit import print_formatted_text, HTML
18
16
  from prompt_toolkit.completion import WordCompleter
19
17
 
20
- from jinja2.exceptions import TemplateNotFound
21
- from urllib3.exceptions import MaxRetryError
22
18
  from openshift.dynamic.exceptions import NotFoundError, ResourceNotFoundError
23
- from kubeconfig.exceptions import KubectlCommandError
24
- from kubernetes.client.exceptions import ApiException
25
19
 
26
- from mas.cli import __version__ as packageVersion
27
- from mas.cli.cli import BaseApp, getHelpFormatter
28
- from mas.cli.validators import InstanceIDValidator
20
+ from ..cli import BaseApp
21
+ from ..validators import InstanceIDValidator
22
+ from .argParser import uninstallArgParser
29
23
 
30
24
  from mas.devops.ocp import createNamespace
31
25
  from mas.devops.mas import listMasInstances, verifyMasInstance
@@ -34,12 +28,13 @@ from mas.devops.tekton import installOpenShiftPipelines, updateTektonDefinitions
34
28
 
35
29
  logger = logging.getLogger(__name__)
36
30
 
37
- class App(BaseApp):
38
- def uninstall(self, args):
31
+ class UninstallApp(BaseApp):
32
+ def uninstall(self, argv):
39
33
  """
40
34
  Uninstall MAS instance
41
35
  """
42
- instanceId = args.instance_id
36
+ args = uninstallArgParser.parse_args(args=argv)
37
+ instanceId = args.mas_instance_id
43
38
  self.noConfirm = args.no_confirm
44
39
 
45
40
  if args.uninstall_all_deps:
@@ -195,118 +190,3 @@ class App(BaseApp):
195
190
  else:
196
191
  h.stop_and_persist(symbol=self.failureIcon, text=f"Failed to submit PipelineRun for {instanceId} uninstall, see log file for details")
197
192
  print()
198
-
199
- if __name__ == '__main__':
200
- parser = argparse.ArgumentParser(
201
- prog='mas uninstall',
202
- description="\n".join([
203
- f"IBM Maximo Application Suite Admin CLI v{packageVersion}",
204
- "Uninstall MAS by configuring and launching the MAS Uninstall Tekton Pipeline.\n",
205
- "Interactive Mode:",
206
- "Omitting the --instance-id option will trigger an interactive prompt"
207
- ]),
208
- epilog="Refer to the online documentation for more information: https://ibm-mas.github.io/cli/",
209
- formatter_class=getHelpFormatter(),
210
- add_help=False
211
- )
212
-
213
- masArgGroup = parser.add_argument_group('MAS Instance Selection')
214
- masArgGroup.add_argument(
215
- '--instance-id',
216
- required=False,
217
- help="The MAS instance ID to be uninstalled"
218
- )
219
-
220
- depsArgGroup = parser.add_argument_group('MAS Dependencies Selection')
221
- depsArgGroup.add_argument(
222
- '--uninstall-all-deps',
223
- required=False,
224
- action='store_true',
225
- default=False,
226
- help="Uninstall all MAS-related dependencies from the target cluster",
227
- )
228
-
229
- depsArgGroup.add_argument(
230
- '--uninstall-cert-manager',
231
- required=False,
232
- action='store_true',
233
- default=False,
234
- help="Uninstall Certificate Manager from the target cluster",
235
- )
236
- depsArgGroup.add_argument(
237
- '--uninstall-common-services',
238
- required=False,
239
- action='store_true',
240
- default=False,
241
- help="Uninstall IBM Common Services from the target cluster",
242
- )
243
- depsArgGroup.add_argument(
244
- '--uninstall-grafana',
245
- required=False,
246
- action='store_true',
247
- default=False,
248
- help="Uninstall Grafana from the target cluster",
249
- )
250
- depsArgGroup.add_argument(
251
- '--uninstall-ibm-catalog',
252
- required=False,
253
- action='store_true',
254
- default=False,
255
- help="Uninstall the IBM Maximo Operator Catalog Source (ibm-operator-catalog) from the target cluster",
256
- )
257
- depsArgGroup.add_argument(
258
- '--uninstall-mongodb',
259
- required=False,
260
- action='store_true',
261
- default=False,
262
- help="Uninstall MongoDb from the target cluster",
263
- )
264
- depsArgGroup.add_argument(
265
- '--uninstall-sls',
266
- required=False,
267
- action='store_true',
268
- default=False,
269
- help="Uninstall IBM Suite License Service from the target cluster",
270
- )
271
- depsArgGroup.add_argument(
272
- '--uninstall-uds',
273
- required=False,
274
- action='store_true',
275
- default=False,
276
- help="Uninstall IBM User Data Services from the target cluster",
277
- )
278
-
279
- otherArgGroup = parser.add_argument_group('More')
280
- otherArgGroup.add_argument(
281
- '--no-confirm',
282
- required=False,
283
- action='store_true',
284
- default=False,
285
- help="Launch the upgrade without prompting for confirmation",
286
- )
287
- otherArgGroup.add_argument(
288
- '-h', "--help",
289
- action='help',
290
- default=False,
291
- help="Show this help message and exit",
292
- )
293
-
294
- args = parser.parse_args()
295
-
296
- try:
297
- app = App()
298
- app.uninstall(args)
299
- except KeyboardInterrupt as e:
300
- pass
301
- except ApiException as e:
302
- logger.exception(e, stack_info=True)
303
- app.fatalError(message=f"An error occured communicating with the target server: {e.reason} ({e.status})")
304
- except MaxRetryError as e:
305
- logger.exception(e, stack_info=True)
306
- app.fatalError(message="Unable to connect to API server", exception=e)
307
- except TemplateNotFound as e:
308
- logger.exception(e, stack_info=True)
309
- app.fatalError("Could not find template", exception=e)
310
- except KubectlCommandError as e:
311
- logger.exception(e, stack_info=True)
312
- app.fatalError("Could not execute kubectl command", exception=e)
@@ -0,0 +1,108 @@
1
+ # *****************************************************************************
2
+ # Copyright (c) 2024 IBM Corporation and other Contributors.
3
+ #
4
+ # All rights reserved. This program and the accompanying materials
5
+ # are made available under the terms of the Eclipse Public License v1.0
6
+ # which accompanies this distribution, and is available at
7
+ # http://www.eclipse.org/legal/epl-v10.html
8
+ #
9
+ # *****************************************************************************
10
+
11
+ import argparse
12
+
13
+ from .. import __version__ as packageVersion
14
+ from ..cli import getHelpFormatter
15
+
16
+ uninstallArgParser = argparse.ArgumentParser(
17
+ prog='mas uninstall',
18
+ description="\n".join([
19
+ f"IBM Maximo Application Suite Admin CLI v{packageVersion}",
20
+ "Uninstall MAS by configuring and launching the MAS Uninstall Tekton Pipeline.\n",
21
+ "Interactive Mode:",
22
+ "Omitting the --instance-id option will trigger an interactive prompt"
23
+ ]),
24
+ epilog="Refer to the online documentation for more information: https://ibm-mas.github.io/cli/",
25
+ formatter_class=getHelpFormatter(),
26
+ add_help=False
27
+ )
28
+
29
+ masArgGroup = uninstallArgParser.add_argument_group('MAS Instance Selection')
30
+ masArgGroup.add_argument(
31
+ '--mas-instance-id',
32
+ required=False,
33
+ help="The MAS instance ID to be uninstalled"
34
+ )
35
+
36
+ depsArgGroup = uninstallArgParser.add_argument_group('MAS Dependencies Selection')
37
+ depsArgGroup.add_argument(
38
+ '--uninstall-all-deps',
39
+ required=False,
40
+ action='store_true',
41
+ default=False,
42
+ help="Uninstall all MAS-related dependencies from the target cluster",
43
+ )
44
+
45
+ depsArgGroup.add_argument(
46
+ '--uninstall-cert-manager',
47
+ required=False,
48
+ action='store_true',
49
+ default=False,
50
+ help="Uninstall Certificate Manager from the target cluster",
51
+ )
52
+ depsArgGroup.add_argument(
53
+ '--uninstall-common-services',
54
+ required=False,
55
+ action='store_true',
56
+ default=False,
57
+ help="Uninstall IBM Common Services from the target cluster",
58
+ )
59
+ depsArgGroup.add_argument(
60
+ '--uninstall-grafana',
61
+ required=False,
62
+ action='store_true',
63
+ default=False,
64
+ help="Uninstall Grafana from the target cluster",
65
+ )
66
+ depsArgGroup.add_argument(
67
+ '--uninstall-ibm-catalog',
68
+ required=False,
69
+ action='store_true',
70
+ default=False,
71
+ help="Uninstall the IBM Maximo Operator Catalog Source (ibm-operator-catalog) from the target cluster",
72
+ )
73
+ depsArgGroup.add_argument(
74
+ '--uninstall-mongodb',
75
+ required=False,
76
+ action='store_true',
77
+ default=False,
78
+ help="Uninstall MongoDb from the target cluster",
79
+ )
80
+ depsArgGroup.add_argument(
81
+ '--uninstall-sls',
82
+ required=False,
83
+ action='store_true',
84
+ default=False,
85
+ help="Uninstall IBM Suite License Service from the target cluster",
86
+ )
87
+ depsArgGroup.add_argument(
88
+ '--uninstall-uds',
89
+ required=False,
90
+ action='store_true',
91
+ default=False,
92
+ help="Uninstall IBM User Data Services from the target cluster",
93
+ )
94
+
95
+ otherArgGroup = uninstallArgParser.add_argument_group('More')
96
+ otherArgGroup.add_argument(
97
+ '--no-confirm',
98
+ required=False,
99
+ action='store_true',
100
+ default=False,
101
+ help="Launch the upgrade without prompting for confirmation",
102
+ )
103
+ otherArgGroup.add_argument(
104
+ '-h', "--help",
105
+ action='help',
106
+ default=False,
107
+ help="Show this help message and exit",
108
+ )
@@ -0,0 +1,11 @@
1
+ # *****************************************************************************
2
+ # Copyright (c) 2024 IBM Corporation and other Contributors.
3
+ #
4
+ # All rights reserved. This program and the accompanying materials
5
+ # are made available under the terms of the Eclipse Public License v1.0
6
+ # which accompanies this distribution, and is available at
7
+ # http://www.eclipse.org/legal/epl-v10.html
8
+ #
9
+ # *****************************************************************************
10
+
11
+ from ..cli import BaseApp
@@ -1,4 +1,4 @@
1
- #!python
1
+ #!/usr/bin/env python
2
2
  # *****************************************************************************
3
3
  # Copyright (c) 2024 IBM Corporation and other Contributors.
4
4
  #
@@ -9,7 +9,6 @@
9
9
  #
10
10
  # *****************************************************************************
11
11
 
12
- import argparse
13
12
  import sys
14
13
  import logging
15
14
  import logging.handlers
@@ -18,21 +17,25 @@ from prompt_toolkit.completion import WordCompleter
18
17
 
19
18
  from halo import Halo
20
19
 
21
- from mas.cli import __version__ as packageVersion
22
- from mas.cli.cli import BaseApp, getHelpFormatter
23
- from mas.cli.validators import InstanceIDValidator, YesNoValidator
20
+ from ..cli import BaseApp, getHelpFormatter
21
+ from ..validators import InstanceIDValidator, YesNoValidator
22
+ from .argParser import upgradeArgParser
23
+
24
24
  from mas.devops.ocp import createNamespace
25
25
  from mas.devops.mas import listMasInstances, verifyMasInstance
26
26
  from mas.devops.tekton import installOpenShiftPipelines, updateTektonDefinitions, launchUpgradePipeline
27
27
 
28
28
  logger = logging.getLogger(__name__)
29
29
 
30
- class App(BaseApp):
31
- def upgrade(self, instanceId, skipPreCheck, noConfirm):
30
+ class UpgradeApp(BaseApp):
31
+ def upgrade(self, argv):
32
32
  """
33
33
  Upgrade MAS instance
34
34
  """
35
- self.noConfirm = noConfirm
35
+ args = upgradeArgParser.parse_args(args=argv)
36
+ instanceId = args.mas_instance_id
37
+ self.noConfirm = args.no_confirm
38
+ self.skipPreCheck = args.skip_pre_check
36
39
 
37
40
  if instanceId is None:
38
41
  self.printH1("Set Target OpenShift Cluster")
@@ -71,7 +74,7 @@ class App(BaseApp):
71
74
 
72
75
  self.printH1("Review Settings")
73
76
  print_formatted_text(HTML(f"<LightSlateGrey>Instance ID ..................... {instanceId}</LightSlateGrey>"))
74
- print_formatted_text(HTML(f"<LightSlateGrey>Skip Pre-Upgrade Checks ......... {skipPreCheck}</LightSlateGrey>"))
77
+ print_formatted_text(HTML(f"<LightSlateGrey>Skip Pre-Upgrade Checks ......... {self.skipPreCheck}</LightSlateGrey>"))
75
78
 
76
79
  if not self.noConfirm:
77
80
  print()
@@ -94,65 +97,10 @@ class App(BaseApp):
94
97
  h.stop_and_persist(symbol=self.successIcon, text=f"Latest Tekton definitions are installed (v{self.version})")
95
98
 
96
99
  with Halo(text='Submitting PipelineRun for {instanceId} upgrade', spinner=self.spinner) as h:
97
- pipelineURL = launchUpgradePipeline(self.dynamicClient, instanceId, skipPreCheck)
100
+ pipelineURL = launchUpgradePipeline(self.dynamicClient, instanceId, self.skipPreCheck)
98
101
  if pipelineURL is not None:
99
102
  h.stop_and_persist(symbol=self.successIcon, text=f"PipelineRun for {instanceId} upgrade submitted")
100
103
  print_formatted_text(HTML(f"\nView progress:\n <Cyan><u>{pipelineURL}</u></Cyan>\n"))
101
104
  else:
102
105
  h.stop_and_persist(symbol=self.failureIcon, text=f"Failed to submit PipelineRun for {instanceId} upgrade, see log file for details")
103
106
  print()
104
-
105
- if __name__ == '__main__':
106
- parser = argparse.ArgumentParser(
107
- prog='mas upgrade',
108
- description="\n".join([
109
- f"IBM Maximo Application Suite Admin CLI v{packageVersion}",
110
- "Upgrade MAS by configuring and launching the MAS Upgrade Tekton Pipeline.\n",
111
- "Interactive Mode:",
112
- "Omitting the --instance-id option will trigger an interactive prompt"
113
- ]),
114
- epilog="Refer to the online documentation for more information: https://ibm-mas.github.io/cli/",
115
- formatter_class=getHelpFormatter(),
116
- add_help=False
117
- )
118
-
119
- masArgGroup = parser.add_argument_group('MAS Instance Selection')
120
- masArgGroup.add_argument(
121
- '--instance-id',
122
- required=False,
123
- help="The MAS instance ID to be upgraded"
124
- )
125
-
126
- otherArgGroup = parser.add_argument_group('More')
127
- otherArgGroup.add_argument(
128
- '--skip-pre-check',
129
- required=False,
130
- action='store_true',
131
- default=False,
132
- help="Disable the 'pre-upgrade-check' and 'post-upgrade-verify' tasks in the upgrade pipeline"
133
- )
134
- otherArgGroup.add_argument(
135
- '--no-confirm',
136
- required=False,
137
- action='store_true',
138
- default=False,
139
- help="Launch the upgrade without prompting for confirmation",
140
- )
141
- otherArgGroup.add_argument(
142
- '-h', "--help",
143
- action='help',
144
- default=False,
145
- help="Show this help message and exit",
146
- )
147
-
148
- args = parser.parse_args()
149
-
150
- try:
151
- app = App()
152
- app.upgrade(
153
- args.instance_id,
154
- args.skip_pre_check,
155
- args.no_confirm
156
- )
157
- except KeyboardInterrupt as e:
158
- pass
@@ -0,0 +1,56 @@
1
+ # *****************************************************************************
2
+ # Copyright (c) 2024 IBM Corporation and other Contributors.
3
+ #
4
+ # All rights reserved. This program and the accompanying materials
5
+ # are made available under the terms of the Eclipse Public License v1.0
6
+ # which accompanies this distribution, and is available at
7
+ # http://www.eclipse.org/legal/epl-v10.html
8
+ #
9
+ # *****************************************************************************
10
+
11
+ import argparse
12
+
13
+ from .. import __version__ as packageVersion
14
+ from ..cli import getHelpFormatter
15
+
16
+ upgradeArgParser = argparse.ArgumentParser(
17
+ prog='mas upgrade',
18
+ description="\n".join([
19
+ f"IBM Maximo Application Suite Admin CLI v{packageVersion}",
20
+ "Upgrade MAS by configuring and launching the MAS Upgrade Tekton Pipeline.\n",
21
+ "Interactive Mode:",
22
+ "Omitting the --instance-id option will trigger an interactive prompt"
23
+ ]),
24
+ epilog="Refer to the online documentation for more information: https://ibm-mas.github.io/cli/",
25
+ formatter_class=getHelpFormatter(),
26
+ add_help=False
27
+ )
28
+
29
+ masArgGroup = upgradeArgParser.add_argument_group('MAS Instance Selection')
30
+ masArgGroup.add_argument(
31
+ '--mas-instance-id',
32
+ required=False,
33
+ help="The MAS instance ID to be upgraded"
34
+ )
35
+
36
+ otherArgGroup = upgradeArgParser.add_argument_group('More')
37
+ otherArgGroup.add_argument(
38
+ '--skip-pre-check',
39
+ required=False,
40
+ action='store_true',
41
+ default=False,
42
+ help="Disable the 'pre-upgrade-check' and 'post-upgrade-verify' tasks in the upgrade pipeline"
43
+ )
44
+ otherArgGroup.add_argument(
45
+ '--no-confirm',
46
+ required=False,
47
+ action='store_true',
48
+ default=False,
49
+ help="Launch the upgrade without prompting for confirmation",
50
+ )
51
+ otherArgGroup.add_argument(
52
+ '-h', "--help",
53
+ action='help',
54
+ default=False,
55
+ help="Show this help message and exit",
56
+ )
@@ -0,0 +1,75 @@
1
+ #!python
2
+ # *****************************************************************************
3
+ # Copyright (c) 2024 IBM Corporation and other Contributors.
4
+ #
5
+ # All rights reserved. This program and the accompanying materials
6
+ # are made available under the terms of the Eclipse Public License v1.0
7
+ # which accompanies this distribution, and is available at
8
+ # http://www.eclipse.org/legal/epl-v10.html
9
+ #
10
+ # *****************************************************************************
11
+
12
+ import logging
13
+ import logging.handlers
14
+ from sys import argv
15
+
16
+ from mas.cli import __version__ as VERSION
17
+ from mas.cli.install.app import InstallApp
18
+ from mas.cli.upgrade.app import UpgradeApp
19
+ from mas.cli.uninstall.app import UninstallApp
20
+
21
+ from prompt_toolkit import HTML, print_formatted_text
22
+ from urllib3.exceptions import MaxRetryError
23
+ from jinja2.exceptions import TemplateNotFound
24
+ from kubeconfig.exceptions import KubectlCommandError
25
+ from kubernetes.client.exceptions import ApiException
26
+
27
+ logger = logging.getLogger(__name__)
28
+
29
+ def usage():
30
+ print_formatted_text(HTML(""))
31
+
32
+ print_formatted_text(HTML(f"\n<u>IBM Maximo Application Suite Admin CLI v{VERSION}</u>"))
33
+ print_formatted_text(HTML("Powered by <DarkGoldenRod><u>https://github.com/ibm-mas/ansible-devops/</u></DarkGoldenRod> and <DarkGoldenRod><u>https://tekton.dev/</u></DarkGoldenRod>"))
34
+ print("")
35
+ print_formatted_text(HTML("Important Notice:\nThis standalone CLI (<ForestGreen>mas-cli</ForestGreen>) is still in beta state, not all functions supported by the <ForestGreen>mas</ForestGreen> function in quay.io/ibmmas/cli are supported yet"))
36
+ print("")
37
+ print_formatted_text(HTML(
38
+ "<b>MAS Management Actions:</b>\n"+
39
+ " - <ForestGreen>mas-cli install</ForestGreen> Install a MAS instance\n"+
40
+ " - <ForestGreen>mas-cli upgrade</ForestGreen> Upgrade a MAS instance\n"+
41
+ " - <ForestGreen>mas-cli uninstall</ForestGreen> Uninstall a MAS instance\n"
42
+ ))
43
+ print_formatted_text(HTML("For usage information run <ForestGreen>mas-cli [action] --help</ForestGreen>\n"))
44
+
45
+ if __name__ == '__main__':
46
+ try:
47
+ function = argv[1]
48
+
49
+ if function == "install":
50
+ app = InstallApp()
51
+ app.install(argv[2:])
52
+ elif function == "uninstall":
53
+ app = UninstallApp()
54
+ app.uninstall(argv[2:])
55
+ elif function == "upgrade":
56
+ app = UpgradeApp()
57
+ app.upgrade(argv[2:])
58
+ elif function in ["-h", "--help"]:
59
+ usage()
60
+ exit(0)
61
+ else:
62
+ usage()
63
+ print_formatted_text(HTML(f"<Red>Unknown action: {function}</Red>\n"))
64
+ exit(1)
65
+
66
+ except KeyboardInterrupt as e:
67
+ pass
68
+ except ApiException as e:
69
+ app.fatalError(message=f"An error occured communicating with the target server: {e.reason} ({e.status})")
70
+ except MaxRetryError as e:
71
+ app.fatalError(message="Unable to connect to API server", exception=e)
72
+ except TemplateNotFound as e:
73
+ app.fatalError("Could not find template", exception=e)
74
+ except KubectlCommandError as e:
75
+ app.fatalError("Could not execute kubectl command", exception=e)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mas-cli
3
- Version: 10.0.6
3
+ Version: 10.1.0
4
4
  Summary: Python Admin CLI for Maximo Application Suite
5
5
  Home-page: https://github.com/ibm-mas/cli
6
6
  Author: David Parker
@@ -1,10 +1,11 @@
1
- mas/cli/__init__.py,sha256=KnkdBDbj89We8mdN3boGZ4riEJyDiPWb8CnO-RBY4j0,491
2
- mas/cli/cli.py,sha256=mo2z24YRNw13-vQ2QkiixIPTxB81TtadsvLx5iCbka4,8512
1
+ mas/cli/__init__.py,sha256=p_AG07T6oWD53gJ4uygQIEx5-nA7w2ZVRlaTArVsMaI,491
2
+ mas/cli/cli.py,sha256=hbeCvE6dKljR3u-C207RPmSGY5H-B4fY3sQrPohABz0,8521
3
3
  mas/cli/displayMixins.py,sha256=aIpqoedzKJfaaE8C8FlEvxfWTVahL261rjzPZhdT5q8,5117
4
4
  mas/cli/gencfg.py,sha256=57ik5x73gQBFXPl_8h2byXmV_vhCgxfeSDZk4Wg5-Pw,2102
5
5
  mas/cli/validators.py,sha256=5QwiDQn2EIqJABJyDbHGGaSvlkE38IeJ98d1Czz682A,4550
6
- mas/cli/install/__init__.py,sha256=55HhFzQjZrWuEIYRC5-fyGRpiMmC5g17MZJlH9_w7rk,467
7
- mas/cli/install/argParser.py,sha256=AEbodAediMlIGHtOE-jlLSKILcqSKCbOix7o2iTI6xY,18766
6
+ mas/cli/install/__init__.py,sha256=tGH_qJ5ZqcSFpIlObRiye3Y-r4zU8rEplYFjwuHwBTY,494
7
+ mas/cli/install/app.py,sha256=JLoouIIIgvxNal7Yw3BWQmH7BTP358lERYXD3YgoyJ8,45771
8
+ mas/cli/install/argParser.py,sha256=1H3eQ_ng-q8XfMVRgmKDBHh0hSYOr0FPjWIVhNUy7DM,18764
8
9
  mas/cli/install/summarizer.py,sha256=e5jPnitbFZJTjJJL0wPlWTSTCoNuBF-9jF08bDfgxy8,17775
9
10
  mas/cli/install/settings/__init__.py,sha256=eGdNVHVALUxJlZyGYkBet8LbHvVfa-1UjL_8Zl3d-lY,953
10
11
  mas/cli/install/settings/additionalConfigs.py,sha256=YNEISHlFNXnhX1gwFSVG3OBdHsuT9OJ5oZRTC7RqSVI,6800
@@ -12,7 +13,7 @@ mas/cli/install/settings/db2Settings.py,sha256=mR0XL81Talvwvm1bekw0o9VOwV42QkS0j
12
13
  mas/cli/install/settings/kafkaSettings.py,sha256=bjAji5OZfSBpttiYHKM5B5Lvva8L8PUzi8QSs6opQcE,6997
13
14
  mas/cli/install/settings/manageSettings.py,sha256=3HtyR6-DKiKQDFTWnnxAr5OmkfqKwjI4xnBaAcAjOCI,13229
14
15
  mas/cli/install/settings/turbonomicSettings.py,sha256=OC-sn6_Z6MAq0kf33OC3c96gqT8FT4P7A51PenPiCXw,1368
15
- mas/cli/templates/ibm-mas-tekton.yaml,sha256=Hf5bgNP3VHBocWeqp-BISf5o7w8VzfxuJoqMdiSODnw,335567
16
+ mas/cli/templates/ibm-mas-tekton.yaml,sha256=5j4dHu0k_DRfM2UzJfKFhDnTAGJYObEGbXXIHUI1D3Q,335567
16
17
  mas/cli/templates/jdbccfg.yml.j2,sha256=cANbwkUkKEPQp-P3_BB_Llbt94457Ciagah2hOdySIM,1644
17
18
  mas/cli/templates/pod-templates/best-effort/ibm-data-dictionary-assetdatadictionary.yml,sha256=8VG_FDFcEjWNaAOZTcS58Pe0tWOXC10SJLloNqzEMC8,757
18
19
  mas/cli/templates/pod-templates/best-effort/ibm-mas-bascfg.yml,sha256=rkq8c2pVJoskgict9tCZzCchGSE2MBC-dJ47JyMYm7A,1559
@@ -85,10 +86,14 @@ mas/cli/templates/pod-templates/guaranteed/ibm-mas-suite.yml,sha256=aB-buCWUAqD0
85
86
  mas/cli/templates/pod-templates/guaranteed/ibm-mas-visualinspection.yml,sha256=NiXBlXKe3j2RvroEcx3kCSuD92G6WB-jcpNAYGAg3T0,1975
86
87
  mas/cli/templates/pod-templates/guaranteed/ibm-sls-licenseservice.yml,sha256=CKt1yim4L3ClloVcQDHiXLD8EMvmKXIltmDxJTxNdDs,546
87
88
  mas/cli/templates/pod-templates/saas-essentials/ibm-mas-visualinspection.yml,sha256=4skVNh-8HG55ik0O0QG4jAwiQBRxxrPSRaUwllPYZ_I,1270
88
- mas_cli-10.0.6.data/scripts/mas-install,sha256=Nk2VhyFJ3q8T9_jQnVAEc1CdlJ-G2LMkLkSpeD-iRNs,46763
89
- mas_cli-10.0.6.data/scripts/mas-uninstall,sha256=BWjphJmzndnfZH1fSmsPkyypSngOso2qp5lT5_YT98g,13960
90
- mas_cli-10.0.6.data/scripts/mas-upgrade,sha256=zo8qwVtb5I_37qLlRixQiKGXGUj34Ue-4k-GKliXp7Y,6914
91
- mas_cli-10.0.6.dist-info/METADATA,sha256=7bAyhSVRi5eIQvFeG3Ei6iDQlAQhW0SGIIWJyf7Nv00,2076
92
- mas_cli-10.0.6.dist-info/WHEEL,sha256=y4mX-SOX4fYIkonsAGA5N0Oy-8_gI4FXw5HNI1xqvWg,91
93
- mas_cli-10.0.6.dist-info/top_level.txt,sha256=_Hlsp7pvMvyV14LFg-vk1hULq30j61EILnnxMFIhhc8,4
94
- mas_cli-10.0.6.dist-info/RECORD,,
89
+ mas/cli/uninstall/__init__.py,sha256=tGH_qJ5ZqcSFpIlObRiye3Y-r4zU8rEplYFjwuHwBTY,494
90
+ mas/cli/uninstall/app.py,sha256=Sbv-xqUUdIOerkSw3pz8wo3u7_KmgmwwRFEB8UP3uFU,9934
91
+ mas/cli/uninstall/argParser.py,sha256=VO6_u8Qv_munelgZMxBw9mdJBwF_9j688b6nUxQD2RM,3298
92
+ mas/cli/upgrade/__init__.py,sha256=tGH_qJ5ZqcSFpIlObRiye3Y-r4zU8rEplYFjwuHwBTY,494
93
+ mas/cli/upgrade/app.py,sha256=lxMZYlO_sybzbOuZ4D7R0OCjGqnMg3MF1h2vSVZ1YmE,5328
94
+ mas/cli/upgrade/argParser.py,sha256=jl8SU0mXDMAkpfqXaKE4MPNUmVoD0LSsvMUSJjU1dbQ,1881
95
+ mas_cli-10.1.0.data/scripts/mas-cli,sha256=txiATjPf7E0yCW-2C7VdRA8HSv_SQ52osZkvt_z_QJc,3166
96
+ mas_cli-10.1.0.dist-info/METADATA,sha256=4Y30bVkxNOeY7-95uaa454mGQXnWqCM033AkOWI_wKE,2076
97
+ mas_cli-10.1.0.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
98
+ mas_cli-10.1.0.dist-info/top_level.txt,sha256=_Hlsp7pvMvyV14LFg-vk1hULq30j61EILnnxMFIhhc8,4
99
+ mas_cli-10.1.0.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (70.2.0)
2
+ Generator: setuptools (70.3.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5