Show Table of Contents
2.4. 修改资源属性
以下示例展示了如何修改资源的属性。在这个示例中,要被修改的属性是名为 'test' 的虚拟机的描述信息,它被改为 'java_sdk'。
过程 2.2. 修改资源的属性
- 声明一个需要被更改属性的资源的实例。
VM vm = api.getVMs().get("test"); - 为属性设置新的值:
vm.setDescription("java_sdk"); - 更新虚拟机来应用所做的修改:
VM newVM = vm.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.