Using the adTempus API from Python

Language: Python

View on GitHub to download or comment.

See the Client API Examples Introduction for additional information and prerequisites.

Samples index

This sample demonstrates how to use the adTempus API from Python.

Background and Requirements

The adTempus API is only available as a .NET assembly, but can be referenced from Python by using Python.NET.

Refer to the Python.NET documentation for installation instructions. Once Python.NET is installed, your Python code can reference the adTempus client assembly as shown below.

sample.py
import clr

#Add a reference to the adTempus client assembly and import its types
clr.AddReference("C:\\Program Files\\Arcana Development\\adTempus\\4.0\\ArcanaDevelopment.adTempus.Client.dll")
from ArcanaDevelopment.adTempus.Client import *
from ArcanaDevelopment.adTempus.Shared import *

#create a connection to adTempus on the local server
serverName="."
connection = Scheduler.Connect(serverName, LoginAuthenticationType.Windows, "", "")
print("Successful connection to adTempus on " + connection.HostComputer + ", running version " + connection.ServerVersion.ToString())

#start a new context
context=connection.NewDataContext()

#fetch all jobs and list their names
jobs=context.GetJobs("*")
for job in jobs:
    print(job.FullyQualifiedName)

Comments

View on GitHub to comment.