Is it possible to get Full Schedules via API call? i am able to get the schedules and sub tasks inside the schedule but i could not find a way to differentiate schedules from Full, vs Incremental vs Full Synthetic?
Granted Full Synthetic has a display name so it lets you differentiate from Full and incremental but Full backup and incremental does not have any name in schedules.is there any other property that i can key off?
Best answer by MitchellView original
I think that the property you are looking for is backupLevel. I can see it on the Return of RestAPI for the schedules call
that is also confirmed in the qoperations page:
Deferring to alt account
Disclaimer: I am guessing here
I have to test this, but if this is any way analogous to the way schedules are returned in the database…
Then I think what he actually wants is http://WebConsoleHostName/webconsole/api/Schedules
With no parameters. Postman and the API documentation by default shows this with parameters but that is just to be specific, without parameters it should return all schedules and schedule policies.
This is necessary since you can either define a task, or a task with subtasks
This will return all schedules for every entity type, and he would want to filter on “ScheduleType”
To differentiate between Policies and Standalone tasks.
He can then select object to return tasks of specific type, as a schedule policy would not tell you whether a backup is full, synthetic etc.
This is a little confusing because api/schedulepolicy would just return the taskid that returns the parent task.
So summing up api/schedule returns all tasks including tasks that are supertasks(schedule policies) and standard tasks which is just an individual schedule which may or may not be associated with a schedule policy.
I’ll confirm this when I get in front of a computer.
In the world of powershell, api/schedulepolicy is equivalent to api/schedule | Select-Object $_.tasktype “SchedulePolicy”
So you will have more control by doing your own filtering, you will also get a better understanding of the thinking behind scheduling.
thank you! Appreciate it. I will start poking on it as well!
You’re welcome, your best bet is to pull in the schedule with no parameters and view the result in the vscode debugger, then you can see what you need to filter on.
So I got around to taking a look and this is what it looks like.
When you return the schedule api with no parameters you get this Json Structure
“Taskdetail” is an array of schedules and “tasktype” when returned from this api is an integer.
This matches what is returned when you query the DB, I am pretty sure the tasktype for a schedule policy is 4.
I didn’t have time to dig further, but you will see that literally all schedules are returned so now your primary issue is filtering.
I am not an expert with PowerShell or API but I did manage to find this info.
I am sure this can be optimized further.
I used these commands post login call. - > called schedule policy to determine id, used to get response1.
called response1 subtasks options to find backup level. the policy I am using only has a synth full and an incremental which is displayed as value 2 and 4 .
@christopherlecky, @Damian Andre and @Mitchell
This helped a lot! here is sample script to update incremental schedule