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

Command to programmatically get the generated web action urls #183

Closed
alexkli opened this issue Apr 4, 2020 · 2 comments
Closed

Command to programmatically get the generated web action urls #183

alexkli opened this issue Apr 4, 2020 · 2 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@alexkli
Copy link

alexkli commented Apr 4, 2020

Motivation

In a CI or other developer tooling one might want to programmatically get the url of the web actions.

However, because the openwhisk package name is dynamically generated by aio app (using folder name, module version) and the action name could also be subject to certain dynamic adjustments, it is difficult to use aio runtime action get -r since one does not know the full name of the deployed action.

Feature request

I suggest these commands:

  1. get url for an action. <action> is the name of the action in the manifest.yml:
    aio app get-url <action>
    
    outputs just the url so it can be easily used in shell scripts
  2. get url for all actions
    aio app get-url
    
    outputs one url on each line

Workaround

As workaround, I added this shell script, with the package name logic AFAICS (not sure if always correct):

export ACTION_NAME=worker
export ACTION_PKG=$(node -e 'p = require("./package.json"); console.log(`${p.name}-${p.version}`)')
export WEB_ACTION_URL=https://${AIO_RUNTIME_NAMESPACE}.adobeioruntime.net/api/v1/web/${ACTION_PKG}/${ACTION_NAME}
@meryllblanchet meryllblanchet added enhancement New feature or request help wanted Extra attention is needed labels Apr 6, 2020
@meryllblanchet
Copy link
Contributor

Thanks for the proposal @alexkli !
I'd like to add some --cdn option to also output the URL of the actions behind the CDN for SPA use-cases.

@moritzraho
Copy link
Member

fix by #186

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