I can easily access ONTAP REST API documentaion here - https://devnet.netapp.com/restapi.php but cannot find documentation link for ONTAPI ZAPI reference, where I can find ZAPI API reference. Thanks, Mohan
... View more
Hi, I try to connect via HTTP as part of this Ansible task: - name: Get LUNs netapp.ontap.na_ontap_rest_info: hostname: '{{ ontap_host }}' cert_filepath: '{{ ontap_crt }}' key_filepath: '{{ ontap_key }}' gather_subset: - 'storage/luns' fields: - 'comment' https: True validate_certs: False register: lun_info but receive: Error using REST for version, error: {'code': '6691623', 'message': 'User is not authorized.'}. The user and role should be configured correctly: fc-netapp::> security login show -user-or-group-name orchestrator Vserver: fc-netapp Second User/Group Authentication Acct Authentication Name Application Method Role Name Locked Method -------------- ----------- ------------- ---------------- ------ -------------- orchestrator http cert georg_dev - none Vserver: vs_wilde Second User/Group Authentication Acct Authentication Name Application Method Role Name Locked Method -------------- ----------- ------------- ---------------- ------ -------------- orchestrator http cert georg_dev - none 2 entries were displayed. fc-netapp::> security login rest-role show -role georg_dev Role Access Vserver Name API Level ---------- ------------- ------------------- ------ fc-netapp georg_dev /api/cluster all /api/cluster/ all vs_wilde georg_dev /api/storage all /api/storage/ all 4 entries were displayed. A second user using username/passphrase authentication is able to connect using this role, only this new certificate based user won't work. I configured it according to https://netapp.io/2020/06/25/cert4uid-pswd/ and the variables shown above reference the respective certificate/key pair. What could I be missing? Thanks for any ideas!
... View more
Hello, I'm trying to display file permissions using rest-api. I have an old vserver and it does not work when SECD cannot resolve SID. It's fine using ZAPI. It displays SID when it cannot resolve to windows name. GET https://ip/api/protocols/file-security/permissions/c26b5fac-1135-11ea-a956-00a098d1acc2/%2FVOLUME%2FDIR%2FSUBDIR User-Agent: python-requests/2.28.1 Accept-Encoding: gzip, deflate Accept: */* Connection: keep-alive X-Dot-Client-App: netapp-ontap-python-9.11.1.0 Authorization: Basic aW52ZW50YWlyZTpZb3VwbGFib3VtMzA= None ----------------------------- DEBUG:charset_normalizer:Encoding detection: ascii is most likely the one. DEBUG:netapp_ontap.host_connection: -----------RESPONSE----------- 404 Not Found Date: Thu, 02 Feb 2023 10:48:14 GMT Server: libzapid-httpd X-Content-Type-Options: nosniff Cache-Control: no-cache,no-store,must-revalidate Content-Security-Policy: default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline'; img-src 'self' data:; frame-ancestors: 'self' Content-Length: 144 Content-Type: application/hal+json Keep-Alive: timeout=5, max=99 Connection: Keep-Alive { "error": { "message": "Failed to convert SID to a Windows name. Reason: \"SecD Error: object not found\". ", "code": "4849677" } } ------------------------------ Traceback (most recent call last): File "/home/XXXXXX/projects/reporting_acls/test.py", line 14, in <module> resource.get() File "/srv/xxxxx/venv/netapp/lib/python3.9/site-packages/netapp_ontap/resources/file_directory_security.py", line 1048, in get return super()._get(**kwargs) File "/srv/xxxxx/venv/netapp/lib/python3.9/site-packages/netapp_ontap/utils.py", line 55, in wrapper return on_api_fail(erro) File "/srv/xxxxx/venv/netapp/lib/python3.9/site-packages/netapp_ontap/utils.py", line 78, in on_api_fail raise NetAppRestError(cause=erro) from None netapp_ontap.error.NetAppRestError: Caused by HTTPError('404 Client Error: Not Found for url: https://IP:443/api/protocols/file-security/permissions/c26b5fac-1135-11ea-a956-00a098d1acc2/%2FVOLUME%2FDIR%2FSUBDIR'): Failed to convert SID to a Windows name. Reason: "SecD Error: object not found".
... View more
Hi all, We have an interesting case here where some volumes' relationships are not listed in snapmirror list-destinations REST api. However, these volumes' relationships are clearly visible and present in both ontap console and REST api CLI passthru as described below. The problematic volume used in this case is SL10248 but there are more. Our ontap is NetApp Release 9.7P13: Thu Apr 15 02:06:46 UTC 2021 Check the SL10248 relationships using ontap CLI, observe two relationships present
con-svm-201::> snapmirror list-destinations -source-volume SL10248 -instance
Source Path: con-svm-201:SL10248
Destination Path: con-svm-201_SVMDR:SL10248
Relationship Type: XDP
Relationship Group Type: vserver
SnapMirror Policy Type: async-mirror
Relationship Status: Idle
Transfer Progress: -
Progress Last Updated: -
Source Volume Node: con-stor-02
Relationship ID: 32747509-db36-11eb-b628-00a098997ee7
Source Path: con-svm-201:SL10248
Destination Path: rt1aae:SL10248
Relationship Type: DP
Relationship Group Type: none
SnapMirror Policy Type: async-mirror
Relationship Status: Idle
Transfer Progress: -
Progress Last Updated: -
Source Volume Node: con-stor-02
Relationship ID: fa107abb-aab8-11e7-9c1c-00a098b72ab5
2 entries were displayed.
con-svm-201::>
Check the SL10248 relationships using REST API CLI passtgrough. Observe two relationships present, same as above:
simacr@simacr-linux:~$ curl --insecure --user user:pass "https://con-svm-201/api/private/cli/snapmirror/list-destinations?source-volume=SL10248&fields=relationship_id"
{
"records": [
{
"source_path": "con-svm-201:SL10248",
"source_vserver": "con-svm-201",
"source_volume": "SL10248",
"destination_path": "con-svm-201_SVMDR:SL10248",
"destination_vserver": "con-svm-201_SVMDR",
"destination_volume": "SL10248",
"relationship_id": "32747509-db36-11eb-b628-00a098997ee7"
},
{
"source_path": "con-svm-201:SL10248",
"source_vserver": "con-svm-201",
"source_volume": "SL10248",
"destination_path": "rt1aae:SL10248",
"destination_vserver": "rt1aae",
"destination_volume": "SL10248",
"relationship_id": "fa107abb-aab8-11e7-9c1c-00a098b72ab5"
}
],
"num_records": 2
}simacr@simacr-linux:~$
Check the snapmirror relationships using proper REST API call. List all relationships to avoid filtering ambiguities. Redirect to file due to size. Grep the output for SL10248 AND by UUID to confirm the missing relationships. Show the output sample to prove the output contains valid data, but incomplete regarding SL10248:
simacr@simacr-linux:~$ curl --insecure --user user:pass "https://con-svm-201/api/snapmirror/relationships/?list_destinations_only=true&fields=source" >o
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 137k 0 137k 0 0 9628 0 --:--:-- 0:00:14 --:--:-- 9869
simacr@simacr-linux:~$ grep SL10248 o
simacr@simacr-linux:~$grep 32747509-db36-11eb-b628-00a098997ee7 o
simacr@simacr-linux:~$ grep fa107abb-aab8-11e7-9c1c-00a098b72ab5 o
simacr@simacr-linux:~$ more o
{
"records": [
{
"uuid": "000e6732-d8a1-11e9-8b45-00a098b98617",
"source": {
"path": "con-svm-201:SL10573",
"svm": {
"uuid": "73b41add-0450-11e7-a1f7-00a09876f5a4",
"name": "con-svm-201",
"_links": {
"self": {
"href": "/api/svm/svms/73b41add-0450-11e7-a1f7-00a09876f5a4"
}
}
}
},
"_links": {
"self": {
"href": "/api/snapmirror/relationships/000e6732-d8a1-11e9-8b45-00a098b98617/?list_destinations_only=true"
}
}
},
{
"uuid": "0017b348-5cab-11ea-ab11-00a098efcbcb",
"source": {
"path": "con-svm-201:SL10280",
"svm": {
"uuid": "73b41add-0450-11e7-a1f7-00a09876f5a4",
"name": "con-svm-201",
"_links": {
"self": {
"href": "/api/svm/svms/73b41add-0450-11e7-a1f7-00a09876f5a4"
}
}
}
},
"_links": {
"self": {
"href": "/api/snapmirror/relationships/0017b348-5cab-11ea-ab11-00a098efcbcb/?list_destinations_only=true"
}
}
},
...
... View more
Hi Everybody, I did quite an extensive search but was unable to find any functional examples of Python REST api doing the FileInfo writing. (Reading is ok). The samples at https://library.netapp.com/ecmdocs/ECMLP2858435/html/resources/file_info.html#netapp_ontap.resources.file_info.FileInfo.get_collection are not functional. An sample of writing to new, named file and writing to existing file would suffice. I'm currently at Ontap 9.7 Thanks! Robert
... View more