ONTAP Rest API Discussions

size output from /storage/volumes

Is it possible to to get size output from /storage/volumes in KB/MB/GB? Or is it only in bytes.  I saw the following but this seems to apply only for query parameters.

 

Overview

Many objects contain properties related to various sizes. Examples can be found in the aggregate object, volume object, lun object and nvme_namespace object. These properties are documented as type integer.

Unless otherwise documented, all sizes are reported in GET in bytes.

Depending on the development language-specific code generation, the API typically also requires an integer value in bytes for POST and PATCH input as well.

Where a string value is accepted, such as query parameters and ad-hoc curl requests, any of the following suffixes can be used to specify different units:

Suffix

Definition

KB

kilobytes (1024 bytes, aka kibibytes)

MB

megabytes (KB x 1024, aka mebibytes)

GB

gigabytes (MB x 1024, aka gibibytes)

TB

terabytes (GB x 1024, aka tebibytes)

PB

petabytes (TB x 1024, aka pebibytes)

1 REPLY 1

Re: size output from /storage/volumes

No, there is no way to ask the API to return the value in any other format other than an integer number of bytes (unless otherwise noted). Any conversion after fetching will need to be done on the client side by the application.

View solution in original post

Cloud Volumes ONTAP
Review Banner
All Community Forums
Public