Show Table of Contents
2.9. 获得子资源
以下示例展示了如何引用资源的子资源。在这个示例中,属于名为 'test' 的虚拟机的、名为 'my disk' 的磁盘被引用。
过程 2.5. 获得一个资源的子资源
- 声明一个需要被引用的子资源所属资源的实例。
VM vm = api.getVMs().get("test"); - 声明需要被引用的子资源的一个实例:
VMDisk disk = vm.getDisks().get("my disk");

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.