apache / apache/cloudstack

[API] Internal DB IDs used as parameters

未关闭
#9,684 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
component:api status:needs-functional-definition type:improvement
主要语言
Java
星标
3.1k
派生
1.4k
平均合并
6 天 19 小时
30 天内合并 PR
32

描述

##### ISSUE TYPE
* Improvement Request

##### COMPONENT NAME
~~~
API
~~~

##### CLOUDSTACK VERSION
~~~
Any
~~~

##### CONFIGURATION
N/A

##### OS / ENVIRONMENT
N/A

##### SUMMARY
The API accepts internal database IDs as well as UUIDs on the UUID parameters. For example:

````
(nvs) 🐱 > list accounts id=c3d932e5-488c-11ef-a188-3e7340e5df3c filter=id,name
{
"account": [
{
"id": "c3d932e5-488c-11ef-a188-3e7340e5df3c",
"name": "nicolas"
}
],
"count": 1
}
(nvs) 🐱 > list accounts id=2 filter=id,name
{
"account": [
{
"id": "c3d932e5-488c-11ef-a188-3e7340e5df3c",
"name": "nicolas"
}
],
"count": 1
}
(nvs) 🐱 > list accounts id=3 filter=id,name
{
"account": [
{
"id": "eef0d0a3-8013-4c37-954d-eafb96716c95",
"name": "baremetal-system-account"
}
],
"count": 1
}
````

##### EXPECTED RESULTS
~~~
ERROR - only UUIDs must be accepted
~~~

##### ACTUAL RESULTS
~~~
Successful API response
~~~

贡献指南

打开贡献指南

调研方向

首先复现文档中记录的 list accounts 调用,将 id 分别设置为 UUID、2 和 3,然后跟踪 UUID 参数的 API 参数验证和查找路径。当数值型内部数据库 ID 被报错拒绝,而有效的 UUID 仍然返回 account 时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
java
领域
api, backend
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
38/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。