azure - 填充选项列表时如何在 Extension task.json 中对数据源绑定进行排序和过滤
问题描述
我正在使用 API 在我的实用程序的选择列表中获取可用的 AKS 版本。我只想按从高到低的顺序显示最新的 4 个版本。
我的代码的当前版本提供了该地区的所有可用版本-
{
"name": "kubeVersion",
"type": "picklist",
"label": "Kubernetes Version",
"defaultValue": "",
"required": true,
"helpMarkDown": "Select the version of the Kubernetes that needs to be installed on the AKS cluster.",
},
.
.
.
{
"target": "kubeVersion",
"endpointId": "$(ConnectedServiceName)",
"endpointUrl": "{{{endpoint.url}}}/subscriptions/$(endpoint.subscriptionId)/providers/Microsoft.ContainerService/locations/$(rsgLocation)/orchestrators?api-version=2019-04-01&resource-type=managedClusters",
"resultSelector":
"jsonpath:$.properties.orchestrators[*].orchestratorVersion",
"parameters": {
"rsgLocation": "$(rsgLocation)"
}
},
在上面的代码中,我在选择所有可用值的 jsonpath 中给出 [*]。这就像
1.10.12
1.10.13
.
.
.
1.14.6
1.15.3
你能帮我添加过滤器并在那里排序吗?我想对这些值从最新到最早进行排序,并且只取前 4 个版本。稍后要求可能会更改为 1.X.* 和 1.Y.* 所以我也希望能够过滤。你能告诉我这些是什么类型的符号以及我可以从哪里学习吗?我非常感谢任何满足这些要求的建议。
解决方案
推荐阅读
- asp.net-web-api - Telerik Reporting REST API 不接受跨源请求
- javascript - reactjs vs html中的按钮
- ios - 使用按钮的水平滚动视图/页面控制
- django - Django Social Auth命名空间错误
- android - 应用程序关闭并从内存中删除时继续的计时器
- aws-lambda - 无法对 AWS Lambda 中的 zip 文件使用内联代码编辑器
- php - 我希望我的选择标签的默认值是一个 php 会话
- python - Convert dict to HTML table
- angular - 使用原理图生成的 mat-table 时设置过滤
- python - 你如何在氢气中使用 pdb?