返回介绍

15.4. Models

发布于 2023-09-17 23:40:35 字数 12799 浏览 0 评论 0 收藏 0

15.4.1. Get a list of models

GET repository/models
Table 52. Get a list of models - URL query parameters
ParameterRequiredValueDescription
idNoStringOnly return models with the given id.
categoryNoStringOnly return models with the given category.
categoryLikeNoStringOnly return models with a category like the given value. Use the % character as wildcard.
categoryNotEqualsNoStringOnly return models without the given category.
nameNoStringOnly return models with the given name.
nameLikeNoStringOnly return models with a name like the given value. Use the % character as wildcard.
keyNoStringOnly return models with the given key.
deploymentIdNoStringOnly return models which are deployed in the given deployment.
versionNoIntegerOnly return models with the given version.
latestVersionNoBooleanIf true, only return models which are the latest version. Best used in combination with key. If false is passed in as value, this is ignored and all versions are returned.
deployedNoBooleanIf true, only deployed models are returned. If false, only undeployed models are returned (deploymentId is null).
tenantIdNoStringOnly return models with the given tenantId.
tenantIdLikeNoStringOnly return models with a tenantId like the given value.
withoutTenantIdNoBooleanIf true, only returns models without a tenantId set. If false, the withoutTenantId parameter is ignored.
sortNoid (default), category, createTime, key, lastUpdateTime, name, version or tenantIdProperty to sort on, to be used together with the order.
Table 53. Get a list of models - Response codes
Response codeDescription
200Indicates request was successful and the models are returned
400Indicates a parameter was passed in the wrong format. The status-message contains additional information.

Success response body:

{
   "data":[
    {
     "name":"Model name",
     "key":"Model key",
     "category":"Model category",
     "version":2,
     "metaInfo":"Model metainfo",
     "deploymentId":"7",
     "id":"10",
     "url":"http://localhost:8182/repository/models/10",
     "createTime":"2013-06-12T14:31:08.612+0000",
     "lastUpdateTime":"2013-06-12T14:31:08.612+0000",
     "deploymentUrl":"http://localhost:8182/repository/deployments/7",
     "tenantId":null
    },

    ...

   ],
   "total":2,
   "start":0,
   "sort":"id",
   "order":"asc",
   "size":2
}

15.4.2. Get a model

GET repository/models/{modelId}
Table 54. Get a model - URL parameters
ParameterRequiredValueDescription
modelIdYesStringThe id of the model to get.
Table 55. Get a model - Response codes
Response codeDescription
200Indicates the model was found and returned.
404Indicates the requested model was not found.

Success response body:

{
   "id":"5",
   "url":"http://localhost:8182/repository/models/5",
   "name":"Model name",
   "key":"Model key",
   "category":"Model category",
   "version":2,
   "metaInfo":"Model metainfo",
   "deploymentId":"2",
   "deploymentUrl":"http://localhost:8182/repository/deployments/2",
   "createTime":"2013-06-12T12:31:19.861+0000",
   "lastUpdateTime":"2013-06-12T12:31:19.861+0000",
   "tenantId":null
}

15.4.3. Update a model

PUT repository/models/{modelId}

Request body:

{
   "name":"Model name",
   "key":"Model key",
   "category":"Model category",
   "version":2,
   "metaInfo":"Model metainfo",
   "deploymentId":"2",
   "tenantId":"updatedTenant"
}

All request values are optional. For example, you can only include the name attribute in the request body JSON-object, only updating the name of the model, leaving all other fields unaffected. When an attribute is explicitly included and is set to null, the model-value will be updated to null. Example: {"metaInfo" : null} will clear the metaInfo of the model).

Table 56. Update a model - Response codes
Response codeDescription
200Indicates the model was found and updated.
404Indicates the requested model was not found.

Success response body:

{
   "id":"5",
   "url":"http://localhost:8182/repository/models/5",
   "name":"Model name",
   "key":"Model key",
   "category":"Model category",
   "version":2,
   "metaInfo":"Model metainfo",
   "deploymentId":"2",
   "deploymentUrl":"http://localhost:8182/repository/deployments/2",
   "createTime":"2013-06-12T12:31:19.861+0000",
   "lastUpdateTime":"2013-06-12T12:31:19.861+0000",
   "tenantId":""updatedTenant"
}

15.4.4. Create a model

POST repository/models

Request body:

{
   "name":"Model name",
   "key":"Model key",
   "category":"Model category",
   "version":1,
   "metaInfo":"Model metainfo",
   "deploymentId":"2",
   "tenantId":"tenant"
}

All request values are optional. For example, you can only include the name attribute in the request body JSON-object, only setting the name of the model, leaving all other fields null.

Table 57. Create a model - Response codes
Response codeDescription
201Indicates the model was created.

Success response body:

{
   "id":"5",
   "url":"http://localhost:8182/repository/models/5",
   "name":"Model name",
   "key":"Model key",
   "category":"Model category",
   "version":1,
   "metaInfo":"Model metainfo",
   "deploymentId":"2",
   "deploymentUrl":"http://localhost:8182/repository/deployments/2",
   "createTime":"2013-06-12T12:31:19.861+0000",
   "lastUpdateTime":"2013-06-12T12:31:19.861+0000",
   "tenantId":"tenant"
}

15.4.5. Delete a model

DELETE repository/models/{modelId}
Table 58. Delete a model - URL parameters
ParameterRequiredValueDescription
modelIdYesStringThe id of the model to delete.
Table 59. Delete a model - Response codes
Response codeDescription
204Indicates the model was found and has been deleted. Response-body is intentionally empty.
404Indicates the requested model was not found.

15.4.6. Get the editor source for a model

GET repository/models/{modelId}/source
Table 60. Get the editor source for a model - URL parameters
ParameterRequiredValueDescription
modelIdYesStringThe id of the model.
Table 61. Get the editor source for a model - Response codes
Response codeDescription
200Indicates the model was found and source is returned.
404Indicates the requested model was not found.

Success response body:

Response body contains the model’s raw editor source. The response’s content-type is set to application/octet-stream, regardless of the content of the source.

15.4.7. Set the editor source for a model

PUT repository/models/{modelId}/source
Table 62. Set the editor source for a model - URL parameters
ParameterRequiredValueDescription
modelIdYesStringThe id of the model.

Request body:

The request should be of type multipart/form-data. There should be a single file-part included with the binary value of the source.

Table 63. Set the editor source for a model - Response codes
Response codeDescription
200Indicates the model was found and the source has been updated.
404Indicates the requested model was not found.

Success response body:

Response body contains the model’s raw editor source. The response’s content-type is set to application/octet-stream, regardless of the content of the source.

15.4.8. Get the extra editor source for a model

GET repository/models/{modelId}/source-extra
Table 64. Get the extra editor source for a model - URL parameters
ParameterRequiredValueDescription
modelIdYesStringThe id of the model.
Table 65. Get the extra editor source for a model - Response codes
Response codeDescription
200Indicates the model was found and source is returned.
404Indicates the requested model was not found.

Success response body:

Response body contains the model’s raw extra editor source. The response’s content-type is set to application/octet-stream, regardless of the content of the extra source.

15.4.9. Set the extra editor source for a model

PUT repository/models/{modelId}/source-extra
Table 66. Set the extra editor source for a model - URL parameters
ParameterRequiredValueDescription
modelIdYesStringThe id of the model.

Request body:

The request should be of type multipart/form-data. There should be a single file-part included with the binary value of the extra source.

Table 67. Set the extra editor source for a model - Response codes
Response codeDescription
200Indicates the model was found and the extra source has been updated.
404Indicates the requested model was not found.

Success response body:

Response body contains the model’s raw editor source. The response’s content-type is set to application/octet-stream, regardless of the content of the source.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文