Hide Forgot
In order to get the next sync time for a repository you have to: 1. Get the full task list for the repository 2. Sort the tasks by scheduled time 3. Look at the scheduled time on the earliest executing task and evaluate it based on 4 different possible scenarios to determine when the next sync is. If the time is in the future, that's the next scheduled sync time. If it's in the past, and currently running, there's no next sync scheduled yet as one is already running. If it's in the past and currently waiting, there's no next sync scheduled yet as it's already waiting. If there is no task with a scheduled time, then the next sync is not scheduled. We should have 1 simple API call to get the next sync time for a repository. Implementation details such as what it means for a task to have a scheduled time in the past, but still be waiting should not have to be known by a client in order to use the API. This is logic that should be server side.
I added a next_sync_time field to the following 2 API's: /repositories/<repoid>/schedules/sync/ /repositories/<repoid>/statuses/sync/ Figured it made sense in both those contexts. If a repository has no schedule, the field is null. commit: 02b576031b3f498f2300d21b06fc290437094d31
build: 0.256
[root@preethi ~]# rpm -q pulp pulp-0.0.256-1.fc15.noarch [root@preethi ~]# curl -k -u admin:admin -X GET https://localhost/pulpsitories/f15/schedules/sync/ {"schedule": "2012-01-07T14:00:00-05:00/PT5M", "id": "f15", "href": "/pulp/api/repositories/f15/", "next_sync_time": "2012-01-07T19:00:00Z", "type": "sync", "options": {"skip": {}}}[root@preethi ~]# [root@preethi ~]# curl -k -u admin:admin -X GET https://localhost/pulp/api/repositories/f15/statuses/sync/ {"exception": null, "traceback": null, "state": "waiting", "next_sync_time": "2012-01-07T19:00:00Z", "progress": null, "repoid": "f15"}[root@preethi ~]#
Pulp v1.0 is released Closed Current Release.
Pulp v1.0 is released.