kthcloud / go-deploy

Creation and management of resources on kthcloud
https://api.cloud.cbh.kth.se/deploy
MIT License
3 stars 1 forks source link

Add fields for job type #409

Closed pierrelefevre closed 5 months ago

pierrelefevre commented 5 months ago

visualize-api needs to load the 10 latest jobs, however it needs to apply a filter.

Allow this by adding a param (?types=

Current code:


    # all the jobs that are not repair or failed or pending, sorted by createdAt, descending, limit 10
    jobs = collection.find({"$nor": [{"type": {"$regex": "repair"}}, {"status": {"$regex": "failed"}}, {"status": {"$regex": "terminated"}}, {"status": {"$regex": "pending"}}]}).sort(
        "createdAt", -1).limit(10)
saffronjam commented 5 months ago

resolved in https://github.com/kthcloud/go-deploy/pull/411