adobe / aio-cli-plugin-runtime

Adobe I/O Runtime plugin for the Adobe I/O CLI
https://www.adobe.io
Apache License 2.0
15 stars 31 forks source link

`api list` to `api get` #185

Open sarahxxu opened 4 years ago

sarahxxu commented 4 years ago

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

aiojbot commented 4 years ago

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

Himavanth commented 3 years ago

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

meryllblanchet commented 3 years ago

@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?

rabbah commented 3 years ago

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).

meryllblanchet commented 3 years ago

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)?