mantis icon indicating copy to clipboard operation
mantis copied to clipboard

Add features as described in Issue 37

Open dmdhrumilmistry opened this issue 1 year ago • 2 comments

Issue Link: https://github.com/PhonePe/mantis/issues/37

  • Flag for listing org
python launch.py list --list-orgs
python launch.py list -l
  • List domains for org
python launch.py list --list-domains --org "org1" --org "org2" --tlds # list TLDs for multiple orgs
python launch.py list --list-domains --org "org1" --org "org2" --subs # list subdomains for multiple orgs
python launch.py list --list-domains --org "org1" --org "org2" --tlds --subs # list TLDs + subdomains for multiple orgs

python launch.py list -d -o "org1" -o "org2" -t # list TLDs for multiple orgs
python launch.py list -d -o "org1" -o "org2" -s # list subdomains for multiple orgs
python launch.py list -d -o "org1" -o "org2" -t -s # list TLDs + subdomains for multiple orgs
  • Time based filter
python launch.py list -tds -o "org1" -a 2024-09-04 -b 2024-09-05 # list TLDs + subdomains for org1 in timeframe [2024-09-04, 2024-09-05]

[!NOTE]
-a/--after and -b/--before filters can be used individually as well

Checklist:

dmdhrumilmistry avatar Oct 05 '24 12:10 dmdhrumilmistry

Hi @dmdhrumilmistry Thanks for raising the pr. I will review this and request changes if required any.

Prateek-Thakare avatar Oct 05 '24 16:10 Prateek-Thakare

Hi @dmdhrumilmistry Thanks for raising the pr. I will review this and request changes if required any.

Sure. Sg!

dmdhrumilmistry avatar Oct 05 '24 17:10 dmdhrumilmistry

@dmdhrumilmistry Thanks for the PR. This looks very good. I tested it and everything works as expected.

Quick question, any reason for using tds keyword in list -tds -o "org1" -a 2024-09-04 -b 2024-09-05 instead of tlds?

Also, when i run mantis list -tds -o "sample-org" -a 2024-01-01 -b 2024-02-02, the time based filter works but I get all the subdomains. When I use tds, my assumption was that I'll get only TLDs.

0xbharath avatar Oct 17 '24 03:10 0xbharath

@dmdhrumilmistry Thanks for the PR. This looks very good. I tested it and everything works as expected.

Quick question, any reason for using tds keyword in list -tds -o "org1" -a 2024-09-04 -b 2024-09-05 instead of tlds?

Also, when i run mantis list -tds -o "sample-org" -a 2024-01-01 -b 2024-02-02, the time based filter works but I get all the subdomains. When I use tds, my assumption was that I'll get only TLDs.

sg, actually tds are different flags -t -d -s. I've just added it for demonstration that they can be clubbed together as well (-tds)

Flag Description
t/tlds includes tlds in response
s/subs includes subdomains in response
d/list-domains used for listing domains

If you only need tlds then you'll need to use below command

mantis list -td -o "sample-org" -a 2024-01-01 -b 2024-02-02

dmdhrumilmistry avatar Oct 17 '24 18:10 dmdhrumilmistry

Makes sense.

@Prateek-Thakare I tested the functionality. It's good to go. Can you go through the code and merge the PR?

0xbharath avatar Oct 18 '24 04:10 0xbharath

Hi @dmdhrumilmistry, Can you please remove the commits for the Ansible feature from this PR and re-raise it?

Thanks, Prateek

Prateek-Thakare avatar Oct 19 '24 12:10 Prateek-Thakare

Hi @dmdhrumilmistry, Can you please remove the commits for the Ansible feature from this PR and re-raise it?

Thanks, Prateek

Hey @Prateek-Thakare,

I've removed ansible files. LMK if any other changes are required

dmdhrumilmistry avatar Oct 19 '24 15:10 dmdhrumilmistry

@Prateek-Thakare / @0xbharath thanks for the merge 🙌. Can someone add hacktoberfest-accepted label to this and https://github.com/PhonePe/mantis/pull/49 PRs?

dmdhrumilmistry avatar Oct 21 '24 06:10 dmdhrumilmistry

Thanks for the contribution. I have added the labels to the PRs. Looking forward to more such contributions.

Prateek-Thakare avatar Oct 21 '24 06:10 Prateek-Thakare