Software Development Kit (SDK) and API Discussions
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.
See The Solution
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.
- Rick -
View solution in original post
Does system-cli still exist in version 4.1? I'm not seeing it in the Docs...
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:
An interface to the CLI.
Input NameRangeTypeDescriptionargsarg The arguments of the command line.privstring optionalPriviledge level, e.g. "admin" or "advanced".Output NameRangeTypeDescriptioncli-outputstring All output (including error messages) from the command.cli-result-valueinteger 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.
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:
cli = NaElement('system-cli')
out = self.api.invoke_elem(cli)
if out.results_status() == 'failed':
raise OntapApiException(out.results_errno(), out.results_reason())
"self.api" is simply an NaServer instance; OntapApiException is an exception I use to handle errors that would be shown in out.results_status().
The NetApp Support Site continues to win, 6 years in a row!
Join our Discord Community