File: list_timers.py

package info (click to toggle)
python-globus-sdk 3.54.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 5,032 kB
  • sloc: python: 34,226; sh: 44; makefile: 31
file content (24 lines) | stat: -rw-r--r-- 638 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env python

import globus_sdk
from globus_sdk.experimental.globus_app import UserApp

# Tutorial Client ID - <replace this with your own client>
NATIVE_CLIENT_ID = "61338d24-54d5-408f-a10d-66c06b59f6d2"
USER_APP = UserApp("manage-timers-example", client_id=NATIVE_CLIENT_ID)


def main():
    client = globus_sdk.TimersClient(app=USER_APP)

    first = True
    for record in client.list_jobs(query_params={"filter_active": True})["jobs"]:
        if not first:
            print("---")
        first = False
        print("name:", record["name"])
        print("id:", record["job_id"])


if __name__ == "__main__":
    main()