fermyon / cloud-plugin

A Spin plugin for the Spin CLI for managing Spin apps in Fermyon Cloud.
https://developer.fermyon.com/cloud/
Apache License 2.0
8 stars 13 forks source link

Support outputting a list of databases as JSON #112

Closed kate-goldenring closed 1 year ago

kate-goldenring commented 1 year ago

Takes a similar approach as spin templates list and provides an option of listing databases as JSON

Example output:

[
  {
    "database": "brilliant-kangaroo",
    "links": [
      {
        "label": "default",
        "app": "todo"
      }
    ]
  },
  {
    "database": "mydb",
    "links": [
      {
        "label": "hello",
        "app": "todo"
      },
      {
        "label": "foo",
        "app": "bar"
      }
    ]
  }
]
kate-goldenring commented 1 year ago

@itowlson I noticed that in spin templates list, we hide the optionality of json output format. Is there a reason for that -- and one that is related to whether it should be hidden here too?

itowlson commented 1 year ago

@kate-goldenring Just to reduce clutter in the help text. In that case, the JSON is primarily expected to be consumed by other programs, not be interactive users, so I felt it was not worth making interactive users look at the flag.