更新时间:2019-02-12 15:09
通过调用CreateModel接口, 可以创建描述API请求的数据模型或者返回数据的模型:
名称 | 类型 | 是否必须 | 描述 |
---|---|---|---|
Action | String | 是 | 操作接口名,系统规定参数,取值:CreateModel |
GroupId | String | 是 | 模型所属的分组编号 |
ModelName | String | 是 | 模型的名称, 组内不许重复 |
Schema | String | 是 | 模型的JSON Schema定义 |
Description | String | 否 | 模型定义的描述 |
名称 | 类型 | 描述 |
---|---|---|
RequestId | String | 本次请求编号 |
ModelId | String | 本次创建模型的ID |
ModelRef | String | 本次创建模型的URI |
ModelName | String | 本次创建模型的名称 |
GroupId | String | 本次创建模型所属的分组编号 |
Schema | String | 本次创建模型的模型定义 |
RegionId | String | 本次创建模型的所属区域 |
Description | String | 本次创建模型的描述 |
CreatedTime | String | 本次创建模型的创建时间 |
ModifiedTime | String | 本次创建模型的最后修改时间 |
请求示例
https://apigateway.cn-qingdao.aliyuncs.com/?Action=CreateModel
&GroupId=30e792398d6c4569b04c0e53a3494381
&ModelName=Test
&Schema={"type":"object","properties":{"id":{"format":"int64","maximum":100,"exclusiveMaximum":true,"type":"integer"},"name":{"maxLength":10,"type":"string"}}}
&Description=Model Description
&<公共请求参数>
返回示例XML
格式
<CreateModelResponse>
<ModelId>766c0b9538a04bdf974953b5576783ba</ModelId>
<Description>Model Description</Description>
<CreatedTime>2019-01-29T09:33:01Z</CreatedTime>
<ModelName>Test</ModelName>
<RequestId>4173F95B-360C-460C-9F6C-4A960B904411</RequestId>
<Schema>{\"type\":\"object\",\"properties\":{\"id\":{\"format\":\"int64\",\"maximum\":100,\"exclusiveMaximum\":true,\"type\":\"integer\"},\"name\":{\"maxLength\":10,\"type\":\"string\"}}}"</Schema>
<ModelRef>https://apigateway.aliyun.com/models/30e792398d6c4569b04c0e53a3494381/766c0b9538a04bdf974953b5576783ba</ModelRef>
<ModifiedTime>2019-01-29T09:33:01Z</ModifiedTime>
<GroupId>30e792398d6c4569b04c0e53a3494381</GroupId>
</CreateModelResponse>
JSON
格式
{
"ModelId": "766c0b9538a04bdf974953b5576783ba",
"Description": "Model Description",
"CreatedTime": "2019-01-29T09:33:01Z",
"ModelName": "Test",
"RequestId": "4173F95B-360C-460C-9F6C-4A960B904411",
"Schema": "{\"type\":\"object\",\"properties\":{\"id\":{\"format\":\"int64\",\"maximum\":100,\"exclusiveMaximum\":true,\"type\":\"integer\"},\"name\":{\"maxLength\":10,\"type\":\"string\"}}}",
"ModelRef": "https://apigateway.aliyun.com/models/30e792398d6c4569b04c0e53a3494381/766c0b9538a04bdf974953b5576783ba",
"ModifiedTime": "2019-01-29T09:33:01Z",
"GroupId": "30e792398d6c4569b04c0e53a3494381"
}
在文档使用中是否遇到以下问题
更多建议
匿名提交