Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NewMode - Add bulk targets endpoint #857

Merged
merged 2 commits into from
Jul 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions parsons/newmode/newmode.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,27 @@ def get_target(self, target_id, params={}):
logging.warning("Empty target returned")
return None

def get_targets(self, params={}):
"""
Get all targets

Args:
params dict:
Extra paramaters sent to New/Mode library

Returns:
Target information
"""

targets = self.client.getTargets(params=params)

if targets:
return self.convert_to_table(targets)

else:
logging.warning("No targets returned")
return None

def get_campaigns(self, params={}):
"""
Get existing campaigns.
Expand Down