apache / apache/openwhisk-cli

Export package parameters in the format needed for import

Open
#469 5 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
109
Forks
98
PR merge metrics
No merged PRs in 30d

Description

(I couldn't find an issue where this had already been discussed, I apologise if this is a duplicate or I'm creating noise)

My use case: copying parameters from one action to another
- when you add a database and refresh the package list, the parameters you want are on the wrong package and it's tedious to get them from one place to another
- when I wanted to test some changes to my openwhisk package without hurting what's already live, I wanted to copy the package - it's easy to redeploy but I needed the package parameters.

To get the parameters from a package, we do: `wsk package get [packagename] parameters` which outputs something like:

```json
ok: got package firstpackage, displaying field parameters
[
{
"key": "slackURL",
"value": "https://hooks.slack.com/blah/blah"
},
{
"key": "cloudantURL",
"value": "https://wibble-squeak-bluemix.cloudant.com"
},
{
"key": "dbname",
"value": "awesomedb"
}
]
```

To supply these parameters to another package (e.g. for testing, or allowing another team member to match my config) the format I want is:

```json
{
"slackURL": "https://hooks.slack.com/services/blah/blah",
"cloudantURL": "https://wibble-squeak-bluemix.cloudant.com",
"dbname": "awesomedb"
}
```

With the above in a file called `params.json` I can then to `wsk package create mypackage -P params.json`.

Would it be desirable to offer this format (ideally _without_ the extra verbose output as the first line as we have now) as an option? It's a small thing and I appreciate that patches are probably welcome, but is this a useful addition for anyone other than myself?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.