3.5.2. JSON 表示
对象的 JSON 表示形式包含含有各个属性(包括 id 和 href)的名称/值对的 JSON 文档。例如,虚拟机的 JSON 表示形式如下:
{
"id": "123",
"href": "/ovirt-engine/api/vms/123",
"name": "myvm",
"description": "My VM",
"memory": 1073741824,
...
}
对象集合的 JSON 表示形式包含一个 JSON 文档,包含一个名称/值对(以单数形式命名对象类型),后者包含一个数组,其中包含集合对象的表示形式。例如,虚拟机集合的 JSON 代表形式如下:
{
"vm": [
{
"id": "123",
"href": "/ovirt-engine/api/vms/123",
"name": "myvm",
"description": "My VM",
"memory": 1073741824,
...
},
{
"id": "456",
"href": "/ovirt-engine/api/vms/456",
"name": "yourvm",
"description": "Your VM",
"memory": 2147483648,
...
},
]
}