Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make JSON output compatible with jq (for action:get among others) #66

Open
rabbah opened this issue Nov 7, 2019 · 2 comments
Open

make JSON output compatible with jq (for action:get among others) #66

rabbah opened this issue Nov 7, 2019 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@rabbah
Copy link
Contributor

rabbah commented Nov 7, 2019

Is your feature request related to a problem? Please describe.
When you action:get, you get the action's name printed before the JSON API response.

> ./bin/run runtime:action:get foo
foo
 { ... }

This makes the output incompatible with jq to project some subset of the values of interest. Since aio here diverges from wsk's output of "ok: got action foo", perhaps do it better by dropping the action name that's currently prefixing the JSON response.

Describe the solution you'd like

> ./bin/run runtime:action:get foo
 {
  "annotations": [
    {
      "key": "exec",
      "value": "nodejs:10"
    }
  ],
  "exec": {
    "kind": "nodejs:10",
    "binary": false
  },
  "limits": {
    "concurrency": 1,
    "logs": 10,
    "memory": 256,
    "timeout": 60000
  },
  "name": "foo",
  "namespace": "guest",
  "parameters": [],
  "publish": false,
  "version": "0.0.1"
}

Describe alternatives you've considered
Wrap the cli with another bash script.

@shazron shazron added the enhancement New feature or request label Nov 26, 2019
@adobe-bot
Copy link

JIRA issue created: https://jira.corp.adobe.com/browse/ACNA-587

@meryllblanchet meryllblanchet added the help wanted Extra attention is needed label Mar 25, 2020
@shazron
Copy link
Member

shazron commented Apr 27, 2021

Hints for the hackathon:

  1. The action:get code is this nested file: https://github.com/adobe/aio-cli-plugin-runtime/blob/master/src/commands/runtime/action/get.js
  2. The code that prints out that line is here:
    this.logJSON(`${result.name}\n`, { ...result,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants