File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed
Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change 66import io
77import json
88from time import sleep
9- from typing import Any , Dict , Union
9+ from typing import Any , Dict , List , Union
1010from urllib .parse import urljoin
1111
1212import requests
@@ -179,3 +179,21 @@ def wait_for_target_processed(self, target_id: str) -> None:
179179 # number of calls made to the API, to decrease the likelihood of
180180 # hitting the request quota.
181181 sleep (0.2 )
182+
183+ def list_targets (self ) -> List [str ]:
184+ """
185+ Get a list of targets.
186+
187+ Returns:
188+ The IDs of all targets in the database.
189+ """
190+ response = _target_api_request (
191+ server_access_key = self ._server_access_key ,
192+ server_secret_key = self ._server_secret_key ,
193+ method = 'GET' ,
194+ content = b'' ,
195+ request_path = '/targets' ,
196+ base_vws_url = self ._base_vws_url ,
197+ )
198+
199+ return list (response .json ()['results' ])
You can’t perform that action at this time.
0 commit comments