From dea07ad93560ab8535ae48c943e6b6c58ae6bc9a Mon Sep 17 00:00:00 2001 From: bharath Date: Tue, 6 Nov 2018 17:21:40 +0530 Subject: [PATCH] Add flavor details to model cmds Change-Id: Idb468ecb6875125fac7e7ecd9d037e2c9d666551 --- gyanclient/v1/models.py | 1 + gyanclient/v1/models_shell.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/gyanclient/v1/models.py b/gyanclient/v1/models.py index ac411b9..bfeb19f 100644 --- a/gyanclient/v1/models.py +++ b/gyanclient/v1/models.py @@ -54,6 +54,7 @@ class ModelManager(base.Manager): new = {} new["name"] = kwargs["name"] new["type"] = kwargs["type"] + new["flavor_id"] = kwargs["flavor_id"] model = self._create(self._path(), new) upload_trained_model = kwargs['trained_model'] return self._create_and_upload(self._path(model.id)+'/upload_trained_model', upload_trained_model) diff --git a/gyanclient/v1/models_shell.py b/gyanclient/v1/models_shell.py index b3313a0..d0ef67b 100644 --- a/gyanclient/v1/models_shell.py +++ b/gyanclient/v1/models_shell.py @@ -86,6 +86,9 @@ def do_model_list(cs, args): @utils.arg('name', metavar='', help='ID or name of the model to train') +@utils.arg('--flavor-id', + metavar='', + help='ID or name of the model to train') @utils.arg('--trained-model', metavar='', help='Absolute path for trained models') @@ -97,6 +100,7 @@ def do_create_model(cs, args): opts = {} opts['name'] = args.name opts['type'] = args.type + opts["flavor_id"] = args.flavor_id opts = gyan_utils.remove_null_parms(**opts) try: opts['trained_model'] = open(args.trained_model, 'rb').read()