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

Release/4.1.0 #106

Merged
merged 15 commits into from
Sep 12, 2024
8 changes: 6 additions & 2 deletions maap/maap.py
Original file line number Diff line number Diff line change
@@ -256,17 +256,21 @@ def cancelJob(self, jobid):
job.id = jobid
return job.cancel_job()

def listJobs(self, username=None):
def listJobs(self, username=None, page_size=None, offset=None):
if username==None and self.profile is not None and 'username' in self.profile.account_info().keys():
username = self.profile.account_info()['username']

url = os.path.join(self.config.dps_job, username, endpoints.DPS_JOB_LIST)
params = {k: v for k, v in (("page_size", page_size), ("offset", offset)) if v}

headers = self._get_api_header()
logger.debug('GET request sent to {}'.format(url))
logger.debug('headers:')
logger.debug(headers)
response = requests.get(
url=url,
headers=headers
headers=headers,
params=params,
)
return response