上一主题: vol 对象下一主题: info 方法(vol 对象)


list 方法(vol 对象)
说明

检索应用中卷的列表

语法
/api/v2/vol/list?app=application&vdc=controller-name 
参数
app

应用的名称

vdc

目标虚拟数据中心的名称

事务类型

同步

请求类型

GET

示例

检索 test 的卷的列表。

GET http://192.168.123.200/api/v2/vol/list?app=test&vdc=mygrid 
样例输出
XML:

<volumes>
  <volume>
    <comment></comment>
    <filesystem>ext3</filesystem>
    <mount_state>in_use</mount_state>
    <n_mirrors>2</n_mirrors>
    <name>WS_API_r271:code</name>
    <scope_name>WS_API_r271</scope_name>
    <scope_type>application</scope_type>
    <server>srv1,srv2</server>
    <size>54525952</size>
    <state>ok</state>
    <store>local</store>
    <uuid>fc746912-cc65-4e9c-9327-14c66b1741c7</uuid>
  </volume>
  。
  。
  。
  <volume>
    <comment></comment>
    <filesystem>ext3</filesystem>
    <mount_state>available</mount_state>
    <n_mirrors>2</n_mirrors>
    <name>WS_API_r271:mon</name>
    <scope_name>WS_API_r271</scope_name>
    <scope_type>application</scope_type>
    <server>srv1,srv2</server>
    <size>53477376</size>
    <state>ok</state>
    <store>local</store>
    <uuid>f4fd637c-4aa8-4111-be31-55d28a1e275d</uuid>
  </volume>
</volumes>

JSON:
{
   "volume" : [
      {
         "store" : "local",
         "scope_type" : "application",
         "name" : "WS_API_r271:code",
         "scope_name" : "WS_API_r271",
         "mount_state" : "in_use",
         "uuid" : "fc746912-cc65-4e9c-9327-14c66b1741c7",
         "size" : "54525952",
         "state" : "ok",
         "comment" : "",
         "filesystem" : "ext3",
         "n_mirrors" : "2",
         "server" : "srv1,srv2"
      },
      。
      。
      。
      {
         "store" : "local",
         "scope_type" : "application",
         "name" : "WS_API_r271:mon",
         "scope_name" : "WS_API_r271",
         "mount_state" : "available",
         "uuid" : "f4fd637c-4aa8-4111-be31-55d28a1e275d",
         "size" : "53477376",
         "state" : "ok",
         "comment" : "",
         "filesystem" : "ext3",
         "n_mirrors" : "2",
         "server" : "srv1,srv2"
      }
   ]
}

HTTP 错误代码
404

未找到实体 vdc mygrid-WS_API 应用中没有配置指定的 VDC 名称。

400.1

应用 test 不存在。 -请求中指定的应用无效。