回收站恢复数据表
使用该接口可以从回收站恢复指定数据表
请求
curl -vvv -X POST "$API_HOST/open/api/v1/tablenodes/recycle/$table_id/" -H "Authorization: $access-token"
Python 示例
def table_undelete(access_token, table_id):
headers = {'Authorization': access_token}
url = '%s/open/api/v1/tablenodes/recycle/%d/' % (API_HOST, table_id)
response = requests.post(url, headers=headers)
return response.json()
# create table using csv
data = {
'projectID': project['id'],
'name': 'test-csv-upload',
'skipFirstRow': True
}
resp = ma.create_table(access_token, data,
'data/create_table_columns.json',
'data/gd.csv')
table = resp['detail']
resp = ma.table_delete(access_token, table['id'])
resp = ma.table_undelete(access_token, table['id'])
resp = ma.table_delete(access_token, table['id'])
resp = ma.recycle_delete(access_token, table['id'])
响应
响应体示例
{
"code": 0,
"detail": {
"projectID": 264,
"recycleID": 981,
"tableNodes": [
{
"id": 981,
"name": "test",
"type": "table",
"order": 442,
"parentID":null,
"subscribed":false,
"published":false,
"roleInherited":true,
"createTime": "2022-04-15T07:51:38.699027Z",
"updateTime": "2022-04-15T08:10:43.14421Z"
}
],
"layerNodes":null },
"extra":null,
"message": "OK",
"requestID":null
}