AWS CLI 重命名 API 网关模型

AWS CLI Rename API Gateway model

我正在尝试做一些我认为非常简单的事情。

我想通过 AWS CLI 脚本工具(使用 powershell)简单地重命名在我的 API 网关上创建的模型。

我查看了很多文档,包括 this aws document,除了重命名之外,我几乎可以在模型上做任何事情。

我希望它是这样的:

aws apigateway update-model --rest-api-id RESTID --model-name 'ModelName' --
patch-operations op=replace,path=/name,value='NewModelName' --region 
AWSREGION

这与更新模型描述的方法几乎相同:

aws apigateway update-model --rest-api-id RESTID --model-name 'MDescription' 
--patch-operations op=replace,path=/description,value='NewDescription' 
--region ap-southeast-2

我们不能重命名这些模型是否有特殊原因,或者我只是错过了什么?

API网关不支持重命名模型。

模型名称用作模型的唯一标识符,可以从 API 中的许多不同 resources/methods 引用。这使得实现重命名操作非常困难,因为还需要同时更新任意数量的引用。