Show Table of Contents
3.4. 从集合中获取特定资源
在这些示例中,使用
get 方法从集合中获取特定资源。
例 3.1. 获取特定名称的资源
在
get 方法中使用 name 参数从 datacenters 集合中获取 Default 数据中心:
dc = api.datacenters.get("Default")
它等同于:
dc = api.datacenters.get(name="Default")
使用头中包括
all-content 的 get 请求可以获得的额外信息。
例 3.2. 在特定资源中获取额外信息
vm = api.vms.get(name="VM01", all_content=True)

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.