Adding PaaS Service Creation
[osm/osmclient.git] / osmclient / scripts / osm.py
index de121b1..fac267d 100755 (executable)
@@ -2289,9 +2289,14 @@ def nfpkg_create(
 @click.option("--nsd_name", prompt=True, help="name of the NS descriptor")
 @click.option(
     "--vim_account",
-    prompt=True,
+    default=None,
     help="default VIM account id or name for the deployment",
 )
+@click.option(
+    "--paas_account",
+    default=None,
+    help="default PaaS account id or name for the deployment",
+)
 @click.option("--admin_status", default="ENABLED", help="administration status")
 @click.option(
     "--ssh_keys",
@@ -2315,6 +2320,7 @@ def ns_create(
     nsd_name,
     ns_name,
     vim_account,
+    paas_account,
     admin_status,
     ssh_keys,
     config,
@@ -2333,18 +2339,25 @@ def ns_create(
             )
         with open(config_file, "r") as cf:
             config = cf.read()
+    if not (vim_account or paas_account):
+        raise ClientException(
+            'specify "vim_account" or "paas_account", both options can not be empty'
+        )
+    if vim_account and paas_account:
+        raise ClientException(
+            '"vim_account" and "paas_account" can not be used together, use only one of them'
+        )
     ctx.obj.ns.create(
         nsd_name,
         ns_name,
         config=config,
         ssh_keys=ssh_keys,
-        account=vim_account,
+        vim_account=vim_account,
+        paas_account=paas_account,
+        admin_status=admin_status,
         wait=wait,
         timeout=timeout,
     )
-    # except ClientException as e:
-    #     print(str(e))
-    #     exit(1)
 
 
 def nst_create(ctx, filename, overwrite):