The community is undergoing maintenance and is in Read-Only mode. Click to learn more.

Software Development Kit (SDK) and API Discussions

Is there an ONTAP SDK interface to change a qtree's security style?

sbriatnetapp

Am I missing something, or is there no means to change a qtree's security style in the Manageability SDK version 4.1 ONTAP APIs?  I'm looking for an API equivalent to "qtree security" on the CLI.

Thanks,

Andy

1 ACCEPTED SOLUTION

rle
NetApp Alumni

There is no 7-mode API to change qtree security.  You will have to use the system-cli API.  See https://communities.netapp.com/message/3072#3072 for an example.

Regards,

   - Rick -

View solution in original post

4 REPLIES 4

rle
NetApp Alumni

There is no 7-mode API to change qtree security.  You will have to use the system-cli API.  See https://communities.netapp.com/message/3072#3072 for an example.

Regards,

   - Rick -

View solution in original post

sbriatnetapp

Does system-cli still exist in version 4.1?  I'm not seeing it in the Docs...

Thanks,

Andy

rle
NetApp Alumni

Andy -

It is undocumented.  That is why I pointed you to the example.  There is also a code example in the SDK.  I suggest writing a small standalone Perl script or C or Java program and call "qtree security".

Here is some documentation:

system-cli[top]

An interface to the CLI.

Input NameRangeTypeDescription
args
arg[]
The arguments of the command line.
priv
string
optional
Priviledge level, e.g. "admin" or "advanced".

Output NameRangeTypeDescription
cli-output
string
All output (including error messages) from the command.
cli-result-value
integer
The result value of the command execution (as in CLI 'result'). Possible Values: 0 (command could not be executed), 1 (command executed, but may have errors). Data ONTAP 6.4 and earlier returned 255 if the command executed.

Vfiler-enabled
Yes



Element definition: arg[top]
The individual arguments of a command

[none]

Regards,

   - Rick -

sbriatnetapp

For the benefit of anyone who comes across this discussion later, here's the way I did this in Python, possibly useful as an example:

def invoke_cli(self, *cli_args):

    """

    Call the unsupported/undocumented system-cli API.

    cli_args, joined with spaces, would represent the command line

    if executing in the CLI.

    Return the NaElement result of executing the command.

    """

    args = NaElement('args')

    for arg in cli_args:

        args.child_add(NaElement('arg', arg))

    cli = NaElement('system-cli')

    cli.child_add(args)

    out = self.api.invoke_elem(cli)

    if out.results_status() == 'failed':

        raise OntapApiException(out.results_errno(), out.results_reason())

    return out

"self.api" is simply an NaServer instance; OntapApiException is an exception I use to handle errors that would be shown in out.results_status().

-Andy

Announcements
NetApp on Discord Image

We're on Discord, are you?

Live Chat, Watch Parties, and More!

Explore Banner

Meet Explore, NetApp’s digital sales platform

Engage digitally throughout the sales process, from product discovery to configuration, and handle all your post-purchase needs.

NetApp Insights to Action
I2A Banner
Public