29.3. Modifying the Attributes of Resources
The following example outlines how to modify the attributes of a resource. In this example, the attribute to be modified is the description of the virtual machine with the name 'test', which is changed to 'java_sdk'.
Procedure 29.2. Modifying the Attributes of a Resource
- Declare an instance of the resource whose attributes are to be modified:
VM vm = api.getVMs().get("test"); - Set the new value of the attribute:
vm.setDescription("java_sdk"); - Update the virtual machine to apply the change:
VM newVM = vm.update();