Closed ddebrunner closed 7 years ago
I'm working on this one.
Adding a refresh
method on _ResourceElement
, so all classes inherit from it (i.e. Jobs, Instance) will be able to refresh its own status.
When the REST call to refresh status returns successfully, the shape of the JSON response should be identical (i.e. contains identical set of keys).
When the REST call returns an error, the JSON attributes stored within _ResourceElement
object should be reflected accordingly. (for example, if a job has been cancelled, then the job.health
should indicate so)
Different objects may have different ways to represent error state, and will need to be processed accordingly.
E.g. refresh a job to get its latest health.
Code should be generic.