fixed nodes list command
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/39634b78 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/39634b78 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/39634b78 Branch: refs/heads/minor_fixes_to_script_ctx_mechanism Commit: 39634b788048a6f7c4e707e39cd397926d11abf1 Parents: bdd8d37 Author: Ran Ziv <r...@gigaspaces.com> Authored: Thu Mar 30 18:23:53 2017 +0300 Committer: Ran Ziv <r...@gigaspaces.com> Committed: Thu Mar 30 18:23:53 2017 +0300 ---------------------------------------------------------------------- aria/cli/cli/helptexts.py | 4 ++-- aria/cli/commands/nodes.py | 16 ++++++++-------- aria/cli/commands/services.py | 6 +++--- aria/cli/commands/workflows.py | 4 ++-- aria/cli/table.py | 4 ++-- 5 files changed, 17 insertions(+), 17 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/39634b78/aria/cli/cli/helptexts.py ---------------------------------------------------------------------- diff --git a/aria/cli/cli/helptexts.py b/aria/cli/cli/helptexts.py index 3b6f162..de1e789 100644 --- a/aria/cli/cli/helptexts.py +++ b/aria/cli/cli/helptexts.py @@ -38,7 +38,7 @@ OUTPUT_PATH = "The local path to download to" SERVICE_TEMPLATE_FILENAME = ( "The name of the archive's main service template file. " "This is only relevant if uploading an archive") -INPUTS = "Inputs for the deployment {0}".format(INPUTS_PARAMS_USAGE) +INPUTS = "Inputs for the service {0}".format(INPUTS_PARAMS_USAGE) PARAMETERS = "Parameters for the workflow {0}".format(INPUTS_PARAMS_USAGE) TASK_RETRY_INTERVAL = \ "How long of a minimal interval should occur between task retry attempts [default: {0}]" @@ -55,7 +55,7 @@ JSON_OUTPUT = "Output events in a consumable JSON format" SERVICE_ID = "The unique identifier for the service" EXECUTION_ID = "The unique identifier for the execution" -IGNORE_RUNNING_NODES = "Delete the deployment even if it has running nodes" +IGNORE_RUNNING_NODES = "Delete the service even if it has running nodes" NODE_NAME = "The node's name" http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/39634b78/aria/cli/commands/nodes.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/nodes.py b/aria/cli/commands/nodes.py index fad96fc..f38c917 100644 --- a/aria/cli/commands/nodes.py +++ b/aria/cli/commands/nodes.py @@ -61,30 +61,30 @@ def show(node_id, model_storage, logger): @nodes.command(name='list', - short_help='List node for a deployment') -@aria.options.service_id(required=False) + short_help='List node for a service') +@aria.options.service_name(required=False) @aria.options.sort_by('service_name') @aria.options.descending @aria.options.verbose() @aria.pass_model_storage @aria.pass_logger -def list(service_id, +def list(service_name, sort_by, descending, model_storage, logger): """List nodes - If `SERVICE_ID` is provided, list nodes for that service. + If `SERVICE_NAME` is provided, list nodes for that service. Otherwise, list nodes for all services. """ - if service_id: - logger.info('Listing nodes for service {0}...'.format(service_id)) + if service_name: + logger.info('Listing nodes for service {0}...'.format(service_name)) try: - service = model_storage.service_instance.get(service_id) + service = model_storage.service.get_by_name(service_name) filters = dict(service=service) except StorageError: - raise AriaCliError('Service {0} does not exist'.format(service_id)) + raise AriaCliError('Service {0} does not exist'.format(service_name)) else: logger.info('Listing all nodes...') filters = {} http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/39634b78/aria/cli/commands/services.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/services.py b/aria/cli/commands/services.py index 9ddb272..ce1139b 100644 --- a/aria/cli/commands/services.py +++ b/aria/cli/commands/services.py @@ -26,7 +26,7 @@ from ...core import Core from ...exceptions import AriaException -DEPLOYMENT_COLUMNS = ['id', 'name', 'service_template_name', 'created_at', 'updated_at'] +SERVICE_COLUMNS = ['id', 'name', 'service_template_name', 'created_at', 'updated_at'] @aria.group(name='services') @@ -63,10 +63,10 @@ def list(service_template_id, logger.info('Listing all service...') filters = {} - deployments = [d.to_dict() for d in model_storage.service.list( + services = [d.to_dict() for d in model_storage.service.list( sort=storage_sort_param(sort_by=sort_by, descending=descending), filters=filters)] - print_data(DEPLOYMENT_COLUMNS, deployments, 'Services:') + print_data(SERVICE_COLUMNS, services, 'Services:') @services.command(name='create', http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/39634b78/aria/cli/commands/workflows.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/workflows.py b/aria/cli/commands/workflows.py index c09fe84..2180168 100644 --- a/aria/cli/commands/workflows.py +++ b/aria/cli/commands/workflows.py @@ -37,7 +37,7 @@ def workflows(): @aria.pass_model_storage @aria.pass_logger def show(workflow_name, service_name, model_storage, logger): - """Show information for a specific workflow of a specific deployment + """Show information for a specific workflow of a specific service `WORKFLOW_NAME` is the name of the workflow to get information on. """ @@ -88,7 +88,7 @@ def show(workflow_name, service_name, model_storage, logger): @workflows.command(name='list', - short_help='List workflows for a deployment') + short_help='List workflows for a service') @aria.options.service_name(required=True) @aria.options.verbose() @aria.pass_model_storage http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/39634b78/aria/cli/table.py ---------------------------------------------------------------------- diff --git a/aria/cli/table.py b/aria/cli/table.py index 0ce629e..9c195f5 100644 --- a/aria/cli/table.py +++ b/aria/cli/table.py @@ -40,8 +40,8 @@ def generate(cols, data, defaults=None): defaults - A dictionary specifying default values for key's that don't exist in the data itself. - for example: {'deploymentId':'123'} will set the - deploymentId value for all rows to '123'. + for example: {'serviceId':'123'} will set the + serviceId value for all rows to '123'. """ def get_values_per_column(column, row_data):