[jira] [Commented] (ARIA-148) Add CLI display commands
[ https://issues.apache.org/jira/browse/ARIA-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15994953#comment-15994953 ] ASF GitHub Bot commented on ARIA-148: - Github user ran-z commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/107#discussion_r114553081 --- Diff: aria/cli/helptexts.py --- @@ -47,3 +47,8 @@ SORT_BY = "Key for sorting the list" DESCENDING = "Sort list in descending order [default: False]" JSON_OUTPUT = "Output logs in a consumable JSON format" + +DISPLAY_JSON = "Display in JSON format" --- End diff -- lets merge this with `JSON_OUTPUT`, the latter is a good name, and simply have it as "Format the output as JSON" > Add CLI display commands > > > Key: ARIA-148 > URL: https://issues.apache.org/jira/browse/ARIA-148 > Project: AriaTosca > Issue Type: Story >Reporter: Tal Liron >Assignee: Tal Liron > > {{aria service-templates display}} > {{aria services display}} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (ARIA-148) Add CLI display commands
[ https://issues.apache.org/jira/browse/ARIA-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15994949#comment-15994949 ] ASF GitHub Bot commented on ARIA-148: - Github user ran-z commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/107#discussion_r114553136 --- Diff: aria/cli/core/aria.py --- @@ -325,6 +325,30 @@ def __init__(self): default=defaults.SERVICE_TEMPLATE_FILENAME, help=helptexts.SERVICE_TEMPLATE_FILENAME) +self.display_json = click.option( --- End diff -- merge this with the other JSON one > Add CLI display commands > > > Key: ARIA-148 > URL: https://issues.apache.org/jira/browse/ARIA-148 > Project: AriaTosca > Issue Type: Story >Reporter: Tal Liron >Assignee: Tal Liron > > {{aria service-templates display}} > {{aria services display}} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (ARIA-148) Add CLI display commands
[ https://issues.apache.org/jira/browse/ARIA-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15994952#comment-15994952 ] ASF GitHub Bot commented on ARIA-148: - Github user ran-z commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/107#discussion_r114553193 --- Diff: aria/cli/core/aria.py --- @@ -325,6 +325,30 @@ def __init__(self): default=defaults.SERVICE_TEMPLATE_FILENAME, help=helptexts.SERVICE_TEMPLATE_FILENAME) +self.display_json = click.option( +'-j', +'--json', +is_flag=True, +help=helptexts.DISPLAY_JSON) + +self.display_yaml = click.option( --- End diff -- `yaml_output`? > Add CLI display commands > > > Key: ARIA-148 > URL: https://issues.apache.org/jira/browse/ARIA-148 > Project: AriaTosca > Issue Type: Story >Reporter: Tal Liron >Assignee: Tal Liron > > {{aria service-templates display}} > {{aria services display}} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (ARIA-148) Add CLI display commands
[ https://issues.apache.org/jira/browse/ARIA-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15994948#comment-15994948 ] ASF GitHub Bot commented on ARIA-148: - Github user ran-z commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/107#discussion_r114554090 --- Diff: aria/cli/commands/services.py --- @@ -177,3 +179,31 @@ def inputs(service_name, model_storage, logger): logger.info(inputs_string.getvalue()) else: logger.info('\tNo inputs') + + +@services.command(name='display', + short_help='Display service information') +@aria.argument('service-name') +@aria.options.verbose() +@aria.options.display_json +@aria.options.display_yaml +@aria.options.display_graph +@aria.pass_model_storage +@aria.pass_logger +def display(service_name, model_storage, json, yaml, graph, logger): +"""Display information for a specific service template + +`SERVICE_NAME` is the name of the service to display information on. +""" +logger.info('Displaying service {0}...'.format(service_name)) +service = model_storage.service.get_by_name(service_name) +consumption.ConsumptionContext() +if graph: --- End diff -- General reminder that none of the methods below are standard for the CLI Fine for now, but keep https://issues.apache.org/jira/browse/ARIA-183 in mind > Add CLI display commands > > > Key: ARIA-148 > URL: https://issues.apache.org/jira/browse/ARIA-148 > Project: AriaTosca > Issue Type: Story >Reporter: Tal Liron >Assignee: Tal Liron > > {{aria service-templates display}} > {{aria services display}} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (ARIA-148) Add CLI display commands
[ https://issues.apache.org/jira/browse/ARIA-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15994950#comment-15994950 ] ASF GitHub Bot commented on ARIA-148: - Github user ran-z commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/107#discussion_r114555739 --- Diff: aria/cli/commands/service_templates.py --- @@ -181,21 +184,49 @@ def validate(service_template, service_template_filename, logger.info('Service template validated successfully') +@service_templates.command(name='display', + short_help='Display service template information') +@aria.argument('service-template-name') +@aria.options.verbose() +@aria.options.display_json +@aria.options.display_yaml +@aria.options.display_types +@aria.pass_model_storage +@aria.pass_logger +def display(service_template_name, model_storage, json, yaml, types, logger): --- End diff -- Having both `display` and `show` is confusing :/ I agree however that it doesn't make sense to make this command into a mere flag of `show` as they're very different. I'm generally ok with this as is, but Maxim wanted me to suggest `aria parse service/service-template` as an option as well. I'll leave it for your consideration :) > Add CLI display commands > > > Key: ARIA-148 > URL: https://issues.apache.org/jira/browse/ARIA-148 > Project: AriaTosca > Issue Type: Story >Reporter: Tal Liron >Assignee: Tal Liron > > {{aria service-templates display}} > {{aria services display}} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (ARIA-148) Add CLI display commands
[ https://issues.apache.org/jira/browse/ARIA-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15994951#comment-15994951 ] ASF GitHub Bot commented on ARIA-148: - Github user ran-z commented on a diff in the pull request: https://github.com/apache/incubator-ariatosca/pull/107#discussion_r114554248 --- Diff: aria/cli/commands/services.py --- @@ -177,3 +179,31 @@ def inputs(service_name, model_storage, logger): logger.info(inputs_string.getvalue()) else: logger.info('\tNo inputs') + + +@services.command(name='display', + short_help='Display service information') +@aria.argument('service-name') +@aria.options.verbose() +@aria.options.display_json +@aria.options.display_yaml +@aria.options.display_graph +@aria.pass_model_storage +@aria.pass_logger +def display(service_name, model_storage, json, yaml, graph, logger): --- End diff -- nitpicking that model_storage should probably sit after `graph`, before `logger` > Add CLI display commands > > > Key: ARIA-148 > URL: https://issues.apache.org/jira/browse/ARIA-148 > Project: AriaTosca > Issue Type: Story >Reporter: Tal Liron >Assignee: Tal Liron > > {{aria service-templates display}} > {{aria services display}} -- This message was sent by Atlassian JIRA (v6.3.15#6346)
[jira] [Commented] (ARIA-148) Add CLI display commands
[ https://issues.apache.org/jira/browse/ARIA-148?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15977754#comment-15977754 ] ASF subversion and git services commented on ARIA-148: -- Commit cf08b4bf7ae36f3a0748741a94db87f244314719 in incubator-ariatosca's branch refs/heads/ARIA-148-extra-cli-commands from [~emblemparade] [ https://git-wip-us.apache.org/repos/asf?p=incubator-ariatosca.git;h=cf08b4b ] ARIA-148 Add CLI display commands > Add CLI display commands > > > Key: ARIA-148 > URL: https://issues.apache.org/jira/browse/ARIA-148 > Project: AriaTosca > Issue Type: Story >Reporter: Tal Liron >Assignee: Tal Liron > > {{aria service-templates display}} > {{aria services display}} -- This message was sent by Atlassian JIRA (v6.3.15#6346)