解决了

sort_attribute用法


我正在探索API,并注意到列表操作(特别是 /VMS /LIST操作)支持提供排序参数。我找不到有关请求中sort_attribute键的正确值的任何信息。有没有人使用过,可以为我提供一些灯光吗?

谢谢
图标

最好的答案Nogodan12342019年9月4日,09:46

\n\"https:\/\/\"Prism_Element_VIP\":9440\/PrismGateway\/services\/rest\/v1\/vms\/?sortCriteria=vmName
\n
\nAlso you can find other detail from below API guide
\nhttps:\/\/portal.nutanix.com\/#\/page\/docs\/details?targetId=API-Ref-AOS-v510:man-rest-api-v1-u.html<\/a>
\n
\nCtrl+F \"sortCriteria\"
\n
\nHope this clear your question","className":"post__content__best_answer"}">
查看原件

2个答复

徽章 +1
我发现的唯一引用表明它是“要执行排序的属性”。我使用sort_atribute“ vm_name”对此进行了测试,并通过VM名称获得了一个排序列表。但是,当我尝试使用sort_attributes“ num_sockets”或“ memory_size_mib”或“ memory_size_bytes”列表时,返回的列表没有排序。我在.Next与Nutanix的新API总监进行了交谈,他承诺很快就会提供更好的文档。我当然希望如此。
您可以按照以下方式指定排序属性
“ https://“ prism_element_vip”:9440/prismgateway/services/rest/v1/vms/?sortcriteria = vmname

您也可以从下面的API指南中找到其他细节
https://portal.nutanix.com/#/page/docs/details?targetID=API-REF-AOS-V510:MAN-REST-AP-API-V1-U.HTML

ctrl+f“ sort Criteria”

希望这清除你的问题

回复


Learn more about our cookies.<\/a>","cookiepolicy.button":"Accept cookies","cookiepolicy.button.deny":"Deny all","cookiepolicy.link":"Cookie settings","cookiepolicy.modal.title":"Cookie settings","cookiepolicy.modal.content":"We use 3 different kinds of cookies. You can choose which cookies you want to accept. We need basic cookies to make this site work, therefore these are the minimum you can select. Learn more about our cookies.<\/a>","cookiepolicy.modal.level1":"Basic
Functional","cookiepolicy.modal.level2":"Normal
Functional + analytics","cookiepolicy.modal.level3":"Complete
Functional + analytics + social media + embedded videos"}}}">
Baidu