REST API与CLI结果不同
适用场景
- ONTAP
- 休息
- 活动文件系统(AFS)
问题描述
在执行REST调用以获取快照使用情况信息时、它与ONTAP命令行界面中显示的size
字段不匹配
以下示例显示了一个REST和CLI输出示例、展示了报告中的大小差异:
svm1::> snap list -volume svm1_root -snapshot weekly.2024-03-01_1427 -fields blocks, size, usedblocks
vserver volume snapshot size blocks usedblocks
------- --------- ---------------------- ----- ------ ----------
svm1 svm1_root weekly.2024-03-01_1427 220KB 1% 34%
% curl --insecure -u vsadmin -X GET "https://10.61.87.72/api/storage/volumes/4ce95854-cf08-11ed-81ae-005056a034e0/snapshots?svm.name=svm1&fields=size&return_records=true&return_timeout=0" -H "accept: application/json" - "authorization: Basic dnNhZG1pbjpOZXRhcHAxIQ=="
Enter host password for user 'vsadmin':
{
"records": [
{
"uuid": "f22002fa-5626-4976-9ec7-8ecd74be1a4c",
"svm": {
"name": "svm1"
},
"name": "weekly.2024-03-01_1427",
"size": 348160
}
],
"num_records": 1,
"_links": {
"self": {
"href": "/api/storage/volumes/4ce95854-cf08-11ed-81ae-005056a034e0/snapshots?svm.name=svm1&fields=size&return_records=true&return_timeout=0"
},
"next": {
"href": "/api/storage/volumes/4ce95854-cf08-11ed-81ae-005056a034e0/snapshots?start.cpcount=11&start.uuid=f22002fa-5626-4976-9ec7-8ecd74be1a4c&svm.name=svm1&fields=size&return_records=true&return_timeout=0"
}
}