X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=osmclient%2Fscripts%2Fosm.py;h=ca795456ce5e025679dad01ca1243bc534e8fb43;hb=a56e7c2f36bbbd750200a5a599f07e009dca0fe6;hp=3ce02df0d5ad89f0df166546d64db046c7090f7f;hpb=0a3cee20d28824aeca5ef5afce2b83bdb31222d6;p=osm%2Fosmclient.git diff --git a/osmclient/scripts/osm.py b/osmclient/scripts/osm.py index 3ce02df..ca79545 100755 --- a/osmclient/scripts/osm.py +++ b/osmclient/scripts/osm.py @@ -3878,6 +3878,24 @@ def sdnc_show(ctx, name): help='''list of VIM networks, in JSON inline format, where the cluster is accessible via L3 routing, e.g. "{(k8s_net1:vim_network1) [,(k8s_net2:vim_network2) ...]}"''', ) +@click.option( + "--init-helm2/--skip-helm2", + required=False, + default=True, + help="Initialize helm v2", +) +@click.option( + "--init-helm3/--skip-helm3", + required=False, + default=True, + help="Initialize helm v3", +) +@click.option( + "--init-jujubundle/--skip-jujubundle", + required=False, + default=True, + help="Initialize juju-bundle", +) @click.option("--description", default=None, help="human readable description") @click.option( "--namespace", @@ -3905,7 +3923,7 @@ def sdnc_show(ctx, name): # help='do not return the control immediately, but keep it until the operation is completed, or timeout') @click.pass_context def k8scluster_add( - ctx, name, creds, version, vim, k8s_nets, description, namespace, wait, cni + ctx, name, creds, version, vim, k8s_nets, init_helm2, init_helm3, init_jujubundle, description, namespace, wait, cni ): """adds a K8s cluster to OSM @@ -3920,6 +3938,10 @@ def k8scluster_add( cluster["k8s_version"] = version cluster["vim_account"] = vim cluster["nets"] = yaml.safe_load(k8s_nets) + if not (init_helm2 and init_jujubundle and init_helm3): + cluster["deployment_methods"] = {"helm-chart": init_helm2, + "juju-bundle": init_jujubundle, + "helm-chart-v3": init_helm3} if description: cluster["description"] = description if namespace: @@ -4049,6 +4071,7 @@ def k8scluster_list(ctx, filter, literal, long): "Version", "VIM", "K8s-nets", + "Deployment methods", "Operational State", "Op. state (details)", "Description", @@ -4086,6 +4109,7 @@ def k8scluster_list(ctx, filter, literal, long): cluster["k8s_version"], vim_info, json.dumps(cluster["nets"]), + json.dumps(cluster["deployment_methods"]), cluster["_admin"]["operationalState"], op_state_details, trunc_text(cluster.get("description") or "", 40), @@ -5635,8 +5659,7 @@ def alarm_show(ctx, uuid): table = PrettyTable(["key", "attribute"]) try: # Arrange and return the response data - resp = resp.replace("ObjectId", "") - alarm = eval(resp) + alarm = resp.replace("ObjectId", "") for key in alarm_filter: if key == "uuid": value = alarm.get(key) @@ -5678,7 +5701,6 @@ def alarm_list(ctx, ns_id): if resp: # return the response data in a table resp = resp.replace("ObjectId", "") - resp = eval(resp) for alarm in resp: table.add_row( [