NetApp Community Update
This site will enter Read Only mode on July 23 as we prepare to move to a new platform. You will still be able to view content, but posting and replying will be temporarily disabled.
We're excited to launch our new Community experience on July 30 and more information will follow soon.
Stay connected during the transition - Join our Discord community today.

Software Development Kit (SDK) and API Discussions

get a cli output via api

HAIT_NETAPP
3,834 Views

Is there a way that I can get a cli output via api, rather than get a xml file and I have to parse it?

for example, I need following snap list output,

> snap list vol0

Volume vol0

working...

  %/used       %/total  date          name

----------  ----------  ------------  --------

  1% ( 1%)    0% ( 0%)  Jan 22 12:00  hourly.0

  2% ( 1%)    0% ( 0%)  Jan 22 08:00  hourly.1

  4% ( 2%)    0% ( 0%)  Jan 22 00:01  nightly.0

  5% ( 1%)    0% ( 0%)  Jan 21 20:00  hourly.2

  6% ( 1%)    0% ( 0%)  Jan 21 16:00  hourly.3

  7% ( 1%)    0% ( 0%)  Jan 21 12:01  hourly.4

  9% ( 1%)    0% ( 0%)  Jan 21 08:01  hourly.5

10% ( 2%)    0% ( 0%)  Jan 21 00:01  nightly.1

is that doable?

2 REPLIES 2

aborzenkov
3,834 Views

Just run the command via ssh/rsh. The whole point of using API is to avoid parsing command output. You get exactly the same information via API calls but in more reliable and “computer-friendly” way.

DANIELCM6
3,834 Views

agreed

Public