Red Hat Training

A Red Hat training course is available for Red Hat Virtualization

3.7. Updating a Resource in a Collection

To update a resource you must retrieve it from the collection it resides in, modify the desired parameters, and then call the update method for the resource to save the changes. Parameter modification is performed by using the set_* methods of the retrieved resource.

Example 3.7. Updating a Resource

In this example the data center named DemoDataCenter has its description updated.
dc = api.datacenters.get("DemoDataCenter")
dc.set_description("This data center description provided using the Python SDK")
dc.update()