From 98bb84b069a248d5d9a3f57c417faf4f80285eaa Mon Sep 17 00:00:00 2001 From: Matthew Farrellee Date: Thu, 23 Jan 2014 20:16:09 -0500 Subject: [PATCH] Add data-source-create to CLI Change-Id: I046510f53eb511d739ae5d4b630b1a5a32b8f02b Implements: blueprint python-savannaclient-cli --- savannaclient/api/shell.py | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/savannaclient/api/shell.py b/savannaclient/api/shell.py index 4c329c52..831b34b7 100644 --- a/savannaclient/api/shell.py +++ b/savannaclient/api/shell.py @@ -443,10 +443,10 @@ def do_cluster_template_delete(cs, args): # # data-source-show --name |--id # -# TODO(mattf): data-source-create --name --type -# --url -# [--user --password ] -# [--description ] +# data-source-create --name --type +# --url +# [--user --password ] +# [--description ] # NB: user & password if type is swift # # data-source-delete --name |--id @@ -468,6 +468,31 @@ def do_data_source_show(cs, args): _show_data_source(cs.data_sources.get(args.id)) +@utils.arg('--name', + required=True, + help='Name of the data source') +@utils.arg('--type', + required=True, + help='Type of the data source') +@utils.arg('--url', + required=True, + help='URL for data source') +@utils.arg('--description', + default='', + help='Description of the data source') +@utils.arg('--user', + default=None, + help='Username for accessing the data source url') +@utils.arg('--password', + default=None, + help='Password for accessing the data source url') +def do_data_source_create(cs, args): + """Create a data source that provides job input or receives job output.""" + _show_data_source(cs.data_sources.create(args.name, args.description, + args.type, args.url, + args.user, args.password)) + + @utils.arg('--id', required=True, help='Id of data source to delete')