Reading a Simulation's History
Simulation History Feature
The Simulation History feature is designed to automatically log events each time a simulation (api.endpoints.Simulation) is created and during key operations on the simulation such as adding a ZTP script or the enabling/disabling of automatic OOB.
Accessing Simulation History
To retrieve the history associated with a specific simulation, use the list_history method available on the Simulation object; this returns an iterator of read-only HistoryEntry dicts. The following are optional filtering parameters that may be passed to the list_history method:
severityactorlabel— only return entries carrying a given label (e.g.label='publishing')searchorderinglimitoffset
list_history is also available on Node, Image, and MarketplaceDemo objects — each reads its own resource’s history. Publishing-lifecycle actions on images and marketplace demos (publish/unpublish/approve/deny/visibility changes) are recorded with the publishing label, so resource.list_history(label='publishing') returns just those entries.
Note:
Simulationalso exposes an olderget_history()method that reads the legacy flat history endpoint (returningHistoryobjects withcategory/tags). It is deprecated in favor oflist_history()and emits aDeprecationWarning.
Immutability of History Instances
History instances are immutable and cannot be instantiated directly by clients. This ensures the integrity and consistency of the historical data. As a result, History instances may not be refreshed or deleted by clients.
Creating and Listing History
Now that a simulation has been created and operations have been performed on the simulation, the history of the simulation may be retrieved and viewed.
Building Filter UIs with get_history_filters
To discover the values you can filter a resource’s history by, call get_history_filters(). It returns the distinct actors, severities, and labels present across that resource’s history — the options that would populate a filter dropdown:
Like list_history, this method is available on Simulation, Image, and MarketplaceDemo.