<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Role privileges necessary to run system-cli API calls in Software Development Kit (SDK) and API Discussions</title>
    <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Role-privileges-necessary-to-run-system-cli-API-calls/m-p/136583#M2516</link>
    <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/62248"&gt;@treydock&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just a couple of things before using the system-cli API...please remember that it is an unsupported, "private", API, so we do actively discourage it's use.&amp;nbsp; It also has some quirks, noteably it has a buffer in the return output that, when it overflows, may incorrectly report that the call fails.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That being said, system-cli is the CLI equivalent of "system node run", so the user executing the command must have permission to that set of commands via ONTAPI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
    <pubDate>Thu, 07 Dec 2017 17:43:15 GMT</pubDate>
    <dc:creator>asulliva</dc:creator>
    <dc:date>2017-12-07T17:43:15Z</dc:date>
    <item>
      <title>Role privileges necessary to run system-cli API calls</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Role-privileges-necessary-to-run-system-cli-API-calls/m-p/136582#M2515</link>
      <description>&lt;P&gt;I am attempting to run "system-cli" calls that show some statistics.&amp;nbsp; I am using a user called "monitor" that has role "readonly" [1] .&amp;nbsp; This is on ONTAP 9.2.&amp;nbsp; I keep getting "&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Insufficient privileges: user \'monitor\' does not have write access to this resource" when I use the "system-cli" API [2] call but the exact same command works just fine via SSH [3].&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;What am I missing in the readonly role that would prevent access only when running the command via system-cli?&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;- Trey&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;[1]:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;netapp-home::&amp;gt; security login show -user-or-group-name monitor

Vserver: netapp-home
                             Authentication             Acct   Is-Nsswitch
User/Group Name  Application Method    Role Name        Locked Group
---------------- ----------- --------- ---------------- ------ -----------
monitor          console     password  readonly         no     no
monitor          http        password  readonly         no     no
monitor          ontapi      password  readonly         no     no
monitor          ssh         password  readonly         no     no
monitor          ssh         publickey readonly         -      no
5 entries were displayed.

netapp-home::&amp;gt; security login role show -role readonly
           Role          Command/                                      Access
Vserver    Name          Directory                               Query Level
---------- ------------- --------- ----------------------------------- --------
netapp-home 
           readonly      DEFAULT                                       readonly
                         security                                      none
                         security login password                       all
                         security login role show-user-capability      all
                         set                                           all
5 entries were displayed.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;[2]:&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="p1"&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;gt;&amp;gt;&amp;gt; from NetApp.NaServer import *
&amp;gt;&amp;gt;&amp;gt; s = NaServer('netapp-home', 1, 31)
&amp;gt;&amp;gt;&amp;gt; s.set_style('LOGIN')
&amp;gt;&amp;gt;&amp;gt; s.set_admin_user('monitor', 'OMIT')
&amp;gt;&amp;gt;&amp;gt; s.set_transport_type('HTTPS')
&amp;gt;&amp;gt;&amp;gt; import shlex
&amp;gt;&amp;gt;&amp;gt; cmd = shlex.split('statistics show -object nfsv4_diag -instance nfs4_diag -counter storePool_* -raw -node netapp-home01')
&amp;gt;&amp;gt;&amp;gt; args = NaElement('args')
&amp;gt;&amp;gt;&amp;gt; for arg in cmd:
...     args.child_add(NaElement('arg', arg))
... 
&amp;gt;&amp;gt;&amp;gt; cli = NaElement('system-cli')
&amp;gt;&amp;gt;&amp;gt; cli.child_add(args)
&amp;gt;&amp;gt;&amp;gt; cli.child_add(NaElement('priv', 'diagnostic'))
&amp;gt;&amp;gt;&amp;gt; out = s.invoke_elem(cli)
&amp;gt;&amp;gt;&amp;gt; out.sprintf()
u'&amp;lt;results status="failed" errno="13003" reason="Insufficient privileges: user \'monitor\' does not have write access to this resource"&amp;gt;&amp;lt;/results&amp;gt;\n'
&amp;gt;&amp;gt;&amp;gt; s.set_admin_user('admin', 'OMIT')
&amp;gt;&amp;gt;&amp;gt; out = s.invoke_elem(cli)
&amp;gt;&amp;gt;&amp;gt; out.sprintf()
u'&amp;lt;results status="passed"&amp;gt;\n\t&amp;lt;cli-output&amp;gt;\n\nObject: nfsv4_diag\nInstance: nfs4_diag\nStart-time: 12/7/2017 11:11:00\nEnd-time: 12/7/2017 11:11:00\nScope: netapp-home01\n\n    Counter                                                     Value\n    -------------------------------- --------------------------------\n    storePool_ByteLockAlloc                                        11\n    storePool_ByteLockMax                                     1024005\n    storePool_ClientAlloc                                        1305\n    storePool_ClientMax                                        102402\n    storePool_CopyStateAlloc                                        0\n    storePool_CopyStateMax                                      10241\n    storePool_DelegAlloc                                        32298\n    storePool_DelegMax                                        1024002\n    storePool_DelegStateAlloc                                   32298\n    storePool_DelegStateMax                                   1024010\n    storePool_LayoutAlloc                                           0\n    storePool_LayoutMax                                       1024005\n    storePool_LayoutStateAlloc                                      0\n    storePool_LayoutStateMax                                  1024010\n    storePool_LockStateAlloc                                       11\n    storePool_LockStateMax                                    1024002\n    storePool_OpenAlloc                                        204365\n    storePool_OpenMax                                         1024002\n    storePool_OpenStateAlloc                                   204365\n    storePool_OpenStateMax                                    1024010\n    storePool_OwnerAlloc                                       129643\n    storePool_OwnerMax                                        1024002\n    storePool_StateRefHistoryAlloc                                  0\n    storePool_StateRefHistoryMax                              9216008\n    storePool_StringAlloc                                      130910\n    storePool_StringMax                                       1024002\n26 entries were displayed.\n\n&amp;lt;/cli-output&amp;gt;\n\t&amp;lt;cli-result-value&amp;gt;1&amp;lt;/cli-result-value&amp;gt;\n&amp;lt;/results&amp;gt;\n'
&amp;gt;&amp;gt;&amp;gt; &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P class="p1"&gt;&lt;SPAN class="s1"&gt;[3]:&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;$ ssh -l monitor netapp-home "set diag; statistics show -object nfsv4_diag -instance nfs4_diag -counter storePool_* -raw -node netapp-home01"
Password:


Object: nfsv4_diag
Instance: nfs4_diag
Start-time: 12/7/2017 11:07:05
End-time: 12/7/2017 11:07:05
Scope: netapp-home01

    Counter                                                     Value
    -------------------------------- --------------------------------
    storePool_ByteLockAlloc                                        11
    storePool_ByteLockMax                                     1024005
    storePool_ClientAlloc                                        1303
    storePool_ClientMax                                        102402
    storePool_CopyStateAlloc                                        0
    storePool_CopyStateMax                                      10241
    storePool_DelegAlloc                                        32145
    storePool_DelegMax                                        1024002
    storePool_DelegStateAlloc                                   32145
    storePool_DelegStateMax                                   1024010
    storePool_LayoutAlloc                                           0
    storePool_LayoutMax                                       1024005
    storePool_LayoutStateAlloc                                      0
    storePool_LayoutStateMax                                  1024010
    storePool_LockStateAlloc                                       11
    storePool_LockStateMax                                    1024002
    storePool_OpenAlloc                                        204158
    storePool_OpenMax                                         1024002
    storePool_OpenStateAlloc                                   204158
    storePool_OpenStateMax                                    1024010
    storePool_OwnerAlloc                                       129557
    storePool_OwnerMax                                        1024002
    storePool_StateRefHistoryAlloc                                  0
    storePool_StateRefHistoryMax                              9216008
    storePool_StringAlloc                                      130822
    storePool_StringMax                                       1024002
26 entries were displayed.&lt;/PRE&gt;</description>
      <pubDate>Wed, 04 Jun 2025 14:16:14 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Role-privileges-necessary-to-run-system-cli-API-calls/m-p/136582#M2515</guid>
      <dc:creator>treydock</dc:creator>
      <dc:date>2025-06-04T14:16:14Z</dc:date>
    </item>
    <item>
      <title>Re: Role privileges necessary to run system-cli API calls</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Role-privileges-necessary-to-run-system-cli-API-calls/m-p/136583#M2516</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/62248"&gt;@treydock&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just a couple of things before using the system-cli API...please remember that it is an unsupported, "private", API, so we do actively discourage it's use.&amp;nbsp; It also has some quirks, noteably it has a buffer in the return output that, when it overflows, may incorrectly report that the call fails.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That being said, system-cli is the CLI equivalent of "system node run", so the user executing the command must have permission to that set of commands via ONTAPI.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope that helps.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Andrew&lt;/P&gt;</description>
      <pubDate>Thu, 07 Dec 2017 17:43:15 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Role-privileges-necessary-to-run-system-cli-API-calls/m-p/136583#M2516</guid>
      <dc:creator>asulliva</dc:creator>
      <dc:date>2017-12-07T17:43:15Z</dc:date>
    </item>
    <item>
      <title>Re: Role privileges necessary to run system-cli API calls</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Role-privileges-necessary-to-run-system-cli-API-calls/m-p/136585#M2518</link>
      <description>&lt;P&gt;&lt;a href="https://community.netapp.com/t5/user/viewprofilepage/user-id/8479"&gt;@asulliva&lt;/a&gt;&amp;nbsp;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In case others come across this I had to modify a non-builtin role and use that role to make the necessary changes:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;netapp-home::&amp;gt; security login role create -vserver netapp-home -role monitor -access all -cmddirname "system node run" -query "-command statistics *"&lt;/PRE&gt;</description>
      <pubDate>Thu, 07 Dec 2017 18:31:29 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Role-privileges-necessary-to-run-system-cli-API-calls/m-p/136585#M2518</guid>
      <dc:creator>treydock</dc:creator>
      <dc:date>2017-12-07T18:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Role privileges necessary to run system-cli API calls</title>
      <link>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Role-privileges-necessary-to-run-system-cli-API-calls/m-p/145727#M2813</link>
      <description>&lt;P&gt;What is the equvalent call through the API for this command?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;statistics show -object nfsv4_diag -instance nfs4_diag -counter storePool_* -raw -node netapp-home01"&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;Thank you for the heads up.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Jan 2019 21:57:40 GMT</pubDate>
      <guid>https://community.netapp.com/t5/Software-Development-Kit-SDK-and-API-Discussions/Role-privileges-necessary-to-run-system-cli-API-calls/m-p/145727#M2813</guid>
      <dc:creator>beszan</dc:creator>
      <dc:date>2019-01-04T21:57:40Z</dc:date>
    </item>
  </channel>
</rss>

