aio-cli-plugin-runtime icon indicating copy to clipboard operation
aio-cli-plugin-runtime copied to clipboard

`api list` to `api get`

Open sarahxxu opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe. Currently, aio rt api list requires a base path of the api to return results. The behavior of the list command is inconsistant with other lists (like action list). We think get may be the better verb here as all other gets do expect arg to return results.

aio rt api list --help
list route/apis for Adobe I/O Runtime

USAGE
  $ aio runtime:route:list [BASEPATH] [RELPATH] [APIVERB]

ARGUMENTS
  BASEPATH  The base path of the api
  RELPATH   The path of the api relative to the base path
  APIVERB   (get|post|put|patch|delete|head|options) The http verb

Describe the solution you'd like Instead of api list, change the default to api get and retain list as an alias for openwhisk users

Additional context related to https://github.com/adobe/aio-cli-plugin-runtime/issues/184

sarahxxu avatar Jul 22 '20 14:07 sarahxxu

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

aiojbot avatar Jul 22 '20 14:07 aiojbot

Agreed list should not take any args but we already have a aio api get. I see this is coming from wsk cli which behaves the same.

openwhisk api does not have a list api. So both list and get use the same openwhisk get api but list command just shows the list instead of the whole api metadata.

Question in openwhisk slack about this. https://openwhisk-team.slack.com/archives/C3TPCAQG1/p1602570856060800

Himavanth avatar Oct 13 '20 06:10 Himavanth

@sarahxxu see @Himavanth 's comment here. Our current behavior has feature parity with wsk and adapting the commands as suggested would break this feature parity.

How do you feel with that?

meryllblanchet avatar Nov 04 '20 10:11 meryllblanchet

I like the idea of using list to list all APIs - if the feature is possible to implement. My point of view is that it's ok to break with wsk parity where it makes sense to improve the experience for the developer. I will help in looking to see if it's possible to even implement this (and would consider then making it a feature request for the wsk cli too).

rabbah avatar Nov 04 '20 14:11 rabbah

Thanks for the feedback @rabbah ! @Himavanth can you follow-up with Rodric and look whether there would be a way to implement the new approach for list (and eventually contribute the changes back to wsk cli)?

meryllblanchet avatar Nov 04 '20 15:11 meryllblanchet