In my application I have a Job class as defined/outlined below. Instance of this job class represents a particular Job run, Job can have multiple checkpoints and each checkpoint can have multiple commands.
Job
- JobName
- [JobCheckpoint]
- StartTime
- EndTime
- Status
- ...
JobCheckpoint
- JobCheckpointName
- [JobCommand]
- StartTime
- EndTime
- Status
- ...
JobCommand
- JobCommandName
- [Command]
- StartTime
- EndTime
- Status
- ...
At any given day there are like 100k different jobs that runs. I want to design a user interface in Python for querying these job objects. For example users want to query
- Jobs that ran between x and y interval.
- Jobs that run command x
- Jobs in failed state.
- All checkpoints/commands of a particular job.
- And many more...
To solve this, I was thinking of providing following methods in user interface.
- dict getJobs(Filter)
- dict getCommands(Job)
- dict getCheckpoints(Job)
I am not sure
- How Filter class will look like?
- Is returning dict correct or should I return proper Job object?
- Should I take dict as an input or defined classes as an input.
- Whether this is a best design.
Aucun commentaire:
Enregistrer un commentaire