[pve-devel] API - GET /nodes/{node}/storage

Andreas Steinel a.steinel at gmail.com
Mon Apr 16 18:03:58 CEST 2018


Hi all,

I tried to access the storage API and looked through [1] to find, that the

GET /nodes/{node}/storage

returns an array of string according to [2] the excerpt is:

"GET" : {
   "description" : "Get status for all datastores.",
   "method" : "GET",
   "name" : "index",
   "parameters" : {
      "additionalProperties" : 0,
      "properties" : {
         "content" : {
            "description" : "Only list stores which support this content type.",
            "format" : "pve-storage-content-list",
            "optional" : 1,
            "type" : "string",
            "typetext" : "<string>"
         },
         "enabled" : {
            "default" : 0,
            "description" : "Only list stores which are enabled (not
disabled in config).",
            "optional" : 1,
            "type" : "boolean",
            "typetext" : "<boolean>"
         },
         "node" : {
            "description" : "The cluster node name.",
            "format" : "pve-node",
            "type" : "string",
            "typetext" : "<string>"
         },
         "storage" : {
            "description" : "Only list status for  specified storage",
            "format" : "pve-storage-id",
            "optional" : 1,
            "type" : "string",
            "typetext" : "<string>"
         },
         "target" : {
            "description" : "If target is different to 'node', we only
lists shared storages which content is accessible on this 'node' and
the specified 'target' node.",
            "format" : "pve-node",
            "optional" : 1,
            "type" : "string",
            "typetext" : "<string>"
         }
      }
   },
   "permissions" : {
      "description" : "Only list entries where you have
'Datastore.Audit' or 'Datastore.AllocateSpace' permissions on
'/storage/<storage>'",
      "user" : "all"
   },
   "protected" : 1,
   "proxyto" : "node",
   "returns" : {
      "items" : {
         "properties" : {
            "storage" : {
               "type" : "string"
            }
         },
         "type" : "object"
      },
      "links" : [
         {
            "href" : "{storage}",
            "rel" : "child"
         }
      ],
      "type" : "array"
   }
}

The return type is a bit more complex:

root at pve-5-apitest:~# pvesh get /nodes/pve-5-apitest/storage
200 OK
[
   {
      "active" : 1,
      "avail" : 23488102400,
      "content" : "rootdir,images",
      "enabled" : 1,
      "shared" : 0,
      "storage" : "local-lvm",
      "total" : 23488102400,
      "type" : "lvmthin",
      "used" : 0
   },
   {
      "active" : 1,
      "avail" : 2546470912,
      "content" : "iso,vztmpl,backup",
      "enabled" : 1,
      "shared" : 0,
      "storage" : "local",
      "total" : 4160421888,
      "type" : "dir",
      "used" : 1382428672
   }
]

Yet I did not find any format description of this. The API in [1] does
e.g. contain only two times the attribute "used" is only found two
times, and neither does apply here. Could you point me to the place
where it is defined?

[1] https://pve.proxmox.com/pve-docs/api-viewer/index.html
[2] https://pve.proxmox.com/pve-docs/api-viewer/apidoc.js

-- 
With kind regards / Mit freundlichen Grüßen

Andreas Steinel
M.Sc. Visual Computing
M.Sc. Informatik



More information about the pve-devel mailing list