文档首页/ 测试计划 CodeArts TestPlan/ API参考/ API/ 测试用例管理/ 还原资源 - RestoreResourceByTypes
更新时间:2025-12-27 GMT+08:00
分享

还原资源 - RestoreResourceByTypes

功能介绍

此接口用于还原回收站中的资源,如被删除的用例.

测试 -> 测试用例 -> 左下角回收站

调用方法

请参见如何调用API

URI

POST /v4/resource/restore/types

请求参数

表1 请求Body参数

参数

是否必选

参数类型

描述

resources

Array of RecycleChangeElementInfo objects

资源变更详情

project_uuid

String

项目UUID,项目唯一标识,固定长度32位字符(字母和数字)。获取方式请参见获取项目ID

表2 RecycleChangeElementInfo

参数

是否必选

参数类型

描述

resource_type

String

参数解释:

资源类型

取值范围:

  • TestCase,用例。

  • TestItem,目录。

  • IteratorTestCase,迭代用例。

resource_uris

Array of strings

资源uri

响应参数

状态码:200

表3 响应Body参数

参数

参数类型

描述

value

String

请求返回的数据

状态码:400

表4 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

状态码:401

表5 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

状态码:404

表6 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

状态码:500

表7 响应Body参数

参数

参数类型

描述

error_code

String

接口调用失败错误码

error_msg

String

接口调用失败错误信息

请求示例

post https://{endpoint}/v4/resource/restore/types

{
  "resources" : [ {
    "resource_type" : "TestCase or TestItem or IteratorTestCase",
    "resource_uris" : "dwezdfbsdfaegrx"
  } ],
  "project_id" : "1f22e3511dd348e38131b4066afbd0b4"
}

响应示例

状态码:200

OK

{
  "value" : "success"
}

状态码

状态码

描述

200

OK

400

Bad Request

401

Unauthorized

404

Not Found

500

Internal Server Error

错误码

请参见错误码

相关文档