litmuschaos / litmusctl

Command-Line tool to manage Litmuschaos's agent plane
Apache License 2.0
24 stars 42 forks source link

Merge get/list env command #206

Closed shivam-Purohit closed 5 months ago

shivam-Purohit commented 6 months ago

Merges both get chaos-environment and list chaos-envrionments commands into a single command asget chaos-environments.

shivam-Purohit commented 6 months ago

@SarthakJain26 its hard to just add a flag and show the whole details. Like not hard but unnecessary cause it will make the command slower if we query all the fields for list environments also. We should consider adding it to descibe or something. WDYT?

shivam-Purohit commented 6 months ago

i havent touched other part of the code which can be optimised with this new get environment endpoint, we would do that in some other pr. I will create an issue regarding that.

shivam-Purohit commented 6 months ago
/litmusctl get chaos-environments --project-id="8adf62d5-64f8-4c66-ab53-63729db9dd9a" --environment-id="shivamenv"

CHAOS ENVIRONMENT DETAILS

CHAOS ENVIRONMENT ID     shivamenv

CHAOS ENVIRONMENT NAME   shivamenv

CHAOS ENVIRONMENT Type   NON_PROD

CREATED AT       55908-04-03 16:42:51 +0530 IST

CREATED BY       admin

UPDATED AT       55908-04-03 16:42:51 +0530 IST

UPDATED BY       admin

CHAOS INFRA IDs  d99c7d14-56ef-4836-8537-423f28ceac4e

TAGS    
./litmusctl get chaos-environments --project-id="8adf62d5-64f8-4c66-ab53-63729db9dd9a"

CHAOS ENVIRONMENT ID    CHAOS ENVIRONMENT NAME      CREATED AT          CREATED BY

shivamnewenv        shivamnewenv            55962-10-01 15:05:45 +0530 IST  admin

newenvironmenttest  newenvironmenttest      55912-12-01 10:55:23 +0530 IST  admin

shivamenv       shivamenv           55908-04-03 16:42:51 +0530 IST  admin

Press Enter to show more environments (or type 'q' to quit): q
shivam-Purohit commented 6 months ago

@Nageshbansal does the master branch have updated-dependencies? Not rebasing in case, dont want to add extra commit

Nageshbansal commented 6 months ago

Not yet, as Pr#209 is still opened.