2012-02-16 10:04 AM
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.
Solved! SEE THE SOLUTION
2012-02-16 04:45 PM
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:
Input Name Range Type Description args arg The arguments of the command line. priv string
Priviledge level, e.g. "admin" or "advanced". Output Name Range Type Description 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.
|Element definition: arg||[top]|
|The individual arguments of a command|
- Rick -
2012-03-01 10:12 AM
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().