We have an interesting case here. Bit older Ontap version, 9.7, but may apply to newer versions too. Also a bit of show stopper for our ongoing zapi-to-rest porting, otherwise progressing very well, and rest apis both performing well and simplifying existing code greatly.
Problem:
As documented https://library.netapp.com/ecmdocs/ECMLP2862544/html/, this should work, but as the test below show, it does not, ontap rest cli passthrough is not retreiving the available_size field even though that field is visible in the vserver CLI console, under exact same user/lif.
Documentation states the security for both console CLI and ontap cli passthru is exactly the same: Security: All CLI-based REST APIs are RBAC-controlled, based on the role of the authenticated user and have the same protections they have in the CLI.
Ontap CLI console, at SVM lif, shows all the fields we need, especially the aggr available size:
devzzy::> vserver show-aggregates
Available
Vserver Aggregate State Size Type SnapLock Type
-------------- -------------- ------- ---------- ------- --------------
devzzy dev_stor_01_ssd1 online 14.09TB ssd non-snaplock
devzzy dev_stor_02_ssd1 online 16.34TB ssd non-snaplock
2 entries were displayed.
devzzy::> version
NetApp Release 9.7P13: Thu Apr 15 02:06:46 UTC 2021
Ontap REST to CLI passthrough, showing nothing but vserver and aggr name and ignores the fields required. At he end, positive test confirming the calling syntax is ok:
simacr@simacr-linux:~$curl --insecure --user user:pass "https://devzzy/api/private/cli/vserver/aggregates"
{
"records": [
{
"vserver": "devzzy",
"aggregate": "dev_stor_01_ssd1"
},
{
"vserver": "devzzy",
"aggregate": "dev_stor_02_ssd1"
}
],
"num_records": 2
}
simacr@simacr-linux:~$ curl --insecure --user user:pass "https://devzzy/api/private/cli/vserver/aggregates?fields=available_size"
{
"error": {
"message": "The value \"available_size\" is invalid for field \"fields\" (<field,...>)",
"code": "262197",
"target": "fields"
}
}simacr@simacr-linux:~$ curl --insecure --user user:pass "https://devzzy/api/private/cli/vserver/aggregates?fields=size"
{
"error": {
"message": "The value \"size\" is invalid for field \"fields\" (<field,...>)",
"code": "262197",
"target": "fields"
}
}simacr@simacr-linux:~$ curl --insecure --user user:pass "https://devzzy/api/private/cli/vserver/aggregates?fields=state"
{
"error": {
"message": "The value \"state\" is invalid for field \"fields\" (<field,...>)",
"code": "262197",
"target": "fields"
}
}simacr@simacr-linux:~$ curl --insecure --user user:pass "https://devzzy/api/private/cli/vserver/aggregates?fields=vserver"
{
"records": [
{
"vserver": "devzzy",
"aggregate": "dev_stor_01_ssd1"
},
{
"vserver": "devzzy",
"aggregate": "dev_stor_02_ssd1"
}
],
"num_records": 2
}