Show Table of Contents
3.10. Modifying Sub-Resources
The following example outlines how to modify sub-resources. In this example, the name of a disk with the name 'test_Disk1' belonging to a virtual machine with the name 'test' is changed to 'test_Disk1_updated'.
Procedure 3.7. Updating a Sub-Resource
- Declare an instance of the resource whose sub-resource is to be modified:
VM vm = api.getVMs().get("test"); - Declare an instance of the sub-resource to be modified:
VMDisk disk = vm.getDisks().get("test_Disk1"); - Set the new value of the attribute:
disk.setAlias("test_Disk1_updated"); - Update the sub-resource:
VMDisk updateDisk = disk.update();

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.