Skip to content

Commit 5678ff9

Browse files
committed
Added top and ip parameter and fix top type hint to int
1 parent 7f0881e commit 5678ff9

2 files changed

Lines changed: 37 additions & 7 deletions

File tree

domaintools/api.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1426,6 +1426,10 @@ def iphotlist(self, **kwargs) -> FeedsResults:
14261426
sessionID: str: A custom string to distinguish between different sessions
14271427
14281428
fromBeginning: bool: Requires a sessionID. When used with a new session ID, returns the first hour of data in the time window (rather than the last). Returns an error if the session ID already exists
1429+
1430+
ip: str: Filter for a specific IPv4 address.
1431+
1432+
top: int: Limits the number of results in the response payload. Primarily intended for testing. When you apply this parameter to risk feeds, results are sorted by all_threats_combined_percent (descending).
14291433
"""
14301434
validate_feeds_parameters(kwargs)
14311435
endpoint = kwargs.pop("endpoint", Endpoint.FEED.value)
@@ -1458,6 +1462,10 @@ def iprisk(self, **kwargs) -> FeedsResults:
14581462
sessionID: str: A custom string to distinguish between different sessions
14591463
14601464
fromBeginning: bool: Requires a sessionID. When used with a new session ID, returns the first hour of data in the time window (rather than the last). Returns an error if the session ID already exists
1465+
1466+
ip: str: Filter for a specific IPv4 address.
1467+
1468+
top: int: Limits the number of results in the response payload. Primarily intended for testing. When you apply this parameter to risk feeds, results are sorted by all_threats_combined_percent (descending).
14611469
"""
14621470
validate_feeds_parameters(kwargs)
14631471
endpoint = kwargs.pop("endpoint", Endpoint.FEED.value)

domaintools/cli/commands/feeds.py

Lines changed: 29 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def feeds_nad(
7979
"--headers",
8080
help="Adds a header to the first line of response when text/csv is set in header parameters",
8181
),
82-
top: str = typer.Option(
82+
top: int = typer.Option(
8383
None,
8484
"--top",
8585
help="Number of results to return in the response payload. This is ignored in download endpoint",
@@ -159,7 +159,7 @@ def feeds_nod(
159159
"--headers",
160160
help="Adds a header to the first line of response when text/csv is set in header parameters",
161161
),
162-
top: str = typer.Option(
162+
top: int = typer.Option(
163163
None,
164164
"--top",
165165
help="Number of results to return in the response payload. This is ignored in download endpoint",
@@ -227,7 +227,7 @@ def feeds_domainrdap(
227227
"--domain",
228228
help="A string value used to filter feed results",
229229
),
230-
top: str = typer.Option(
230+
top: int = typer.Option(
231231
None,
232232
"--top",
233233
help="Number of results to return in the response payload",
@@ -307,7 +307,7 @@ def feeds_domaindiscovery(
307307
"--headers",
308308
help="Adds a header to the first line of response when text/csv is set in header parameters",
309309
),
310-
top: str = typer.Option(
310+
top: int = typer.Option(
311311
None,
312312
"--top",
313313
help="Number of results to return in the response payload. This is ignored in download endpoint",
@@ -387,7 +387,7 @@ def feeds_noh(
387387
"--headers",
388388
help="Adds a header to the first line of response when text/csv is set in header parameters",
389389
),
390-
top: str = typer.Option(
390+
top: int = typer.Option(
391391
None,
392392
"--top",
393393
help="Number of results to return in the response payload. This is ignored in download endpoint",
@@ -467,7 +467,7 @@ def feeds_domainhotlist(
467467
"--headers",
468468
help="Adds a header to the first line of response when text/csv is set in header parameters",
469469
),
470-
top: str = typer.Option(
470+
top: int = typer.Option(
471471
None,
472472
"--top",
473473
help="Number of results to return in the response payload. This is ignored in download endpoint",
@@ -547,7 +547,7 @@ def feeds_realtime_domain_risk(
547547
"--headers",
548548
help="Adds a header to the first line of response when text/csv is set in header parameters",
549549
),
550-
top: str = typer.Option(
550+
top: int = typer.Option(
551551
None,
552552
"--top",
553553
help="Number of results to return in the response payload. This is ignored in download endpoint",
@@ -622,6 +622,17 @@ def feeds_iphotlist(
622622
"--frombeginning",
623623
help="Requires a sessionID. When used with a new session ID, returns the first hour of data in the time window (rather than the last). Returns an error if the session ID already exists",
624624
),
625+
ip: str = typer.Option(
626+
None,
627+
"-ip",
628+
"--ipaddr",
629+
help="Filter for a specific IPv4 address.",
630+
),
631+
top: int = typer.Option(
632+
None,
633+
"--top",
634+
help="Number of results to return in the response payload. This is ignored in download endpoint",
635+
),
625636
headers: bool = typer.Option(
626637
False,
627638
"--headers",
@@ -697,6 +708,17 @@ def feeds_iprisk(
697708
"--frombeginning",
698709
help="Requires a sessionID. When used with a new session ID, returns the first hour of data in the time window (rather than the last). Returns an error if the session ID already exists",
699710
),
711+
ip: str = typer.Option(
712+
None,
713+
"-ip",
714+
"--ipaddr",
715+
help="Filter for a specific IPv4 address.",
716+
),
717+
top: int = typer.Option(
718+
None,
719+
"--top",
720+
help="Number of results to return in the response payload. This is ignored in download endpoint",
721+
),
700722
headers: bool = typer.Option(
701723
False,
702724
"--headers",

0 commit comments

Comments
 (0)