1. 程式人生 > 其它 >【TcaplusDB知識庫】表操作—如何申請刪除表

【TcaplusDB知識庫】表操作—如何申請刪除表

【TcaplusDB知識庫】表操作—如何申請刪除表

請求地址

POST
http://OmsAddress/app/newoms.php/webservice/business/table/deleting?cmd=10005&ip-type=webservicerest&access-token=AccessTokenVal

POST請求引數說明

引數名稱 資料型別 說明 是否必填欄位 備註
app_id 整型 刪除的表所在的業務id  
zone_id 整型 刪除的表所在的遊戲區id  
table_name 字串 刪除的表的表名  
auto_approve 整型(0或1)
是否自動稽核刪除表申請(表所在叢集允許自動稽核表刪除申請) 否,預設不自動稽核  
auto_exec_trans 整型(0或1) 是否執行自動稽核刪除表申請後,生成清理表事務(表所在的叢集允許自動執行刪除表事務,auto_approve=1時,auto_exec_trans=1才有效) 否,預設不自動執行  
attention_man 字串 用分號";"分隔關注人,欄位最大長度為200  

 

Data引數

使用json格式表示記錄相關資訊,示例如下:

{
  "app_id": 2,
  "zone_id": 3,
  "table_name": "test_table_generic_modify",
  "auto_approve": 0,
  "auto_exec_trans": 0
}

返回語法

返回引數說明

引數名稱 資料型別 說明 備註
apply json ret:表示是否申請成功,0表示成功;其他表示失敗 msg:表示ret不等於0時的錯誤資訊 info:申請成功的刪除表單據,其中uid表示單據id,稽核時需要  
check json ret:表示是否稽核成功,0表示成功;其他表示失敗 msg:表示ret不等於0時的錯誤資訊 info:其中trans_id表示生成的刪除表的事務,set_id表示事務所在的叢集(表所在的叢集)  

 

請求示例

通過 curl 方法發起請求

命令中的紅色部分是需要使用者自行填寫的引數,請參閱url中GET引數說明

curl -H "Content-type: application/json" -X "POST" -d '{ "app_id": 2, "zone_id": 3, "table_name": "test_table_generic_modify", "auto_approve": 0, "auto_exec_trans": 0 }'

http://omsaddress/app/newoms.php/webservice/business/table/deleting?cmd=10005&ip-type=webservicerest&access-token=<access-token>

返回示例

成功返回示例

http請求的Status=200

{
  "apply": {
      "ret": 0,
      "msg": "success to apply delete table",
      "info": {
          "app_id": 2,
          "app_name": "t_app",
          "set_id": 126,
          "zone_list": "3",
          "table_name": "test_table_generic_modify",
          "table_type": 0,
          "estimated_write_load": 0,
          "estimated_read_load": 0,
          "type": "xml",
          "table_maxnum": 0,
          "write_time": "2017-03-02 22:10:55",
          "apply_type": 1,
          "key_avarage_record_size": 1,
          "value_avarage_record_size": 1,
          "compress": 0,
          "active_record_num": "0",
          "total_record_num": "3",
          "memo": "",
          "tdr": "-1",
          "pcu": 1,
          "relationship_chain_interval": 60,
          "relationship_chain_count": 1,
          "index_count": 1,
          "read_index_interval": 60,
          "read_index_count": 1,
          "read_interval": 60,
          "write_interval": 60,
          "calc_resource_type": 2,
          "dm_ratio": 5,
          "user": "tcaplus",
          "job_id": "43",
          "id": 116
      }
  }
}

錯誤返回

http請求的Status!=200

{
  "name": "Unauthorized",
  "message": "You are requesting with an invalid credential.",
  "code": 0,
  "status": 401,
  "type": "yii\\web UnauthorizedHttpException"
}
{
  "apply": {
      "ret": -1,
      "msg": "table_name:已經申請其他表操作 app:2 zone:3 table_name:test_table_generic_modify apply id:116 apply type:1 error type:1",
      "info": null
  }
}

 


 

TcaplusDB是騰訊出品的分散式NoSQL資料庫,儲存和排程的程式碼完全自研。具備快取+落地融合架構、PB級儲存、毫秒級時延、無損水平擴充套件和複雜資料結構等特性。同時具備豐富的生態、便捷的遷移、極低的運維成本和五個九高可用等特點。客戶覆蓋遊戲、網際網路、政務、金融、製造和物聯網等領域。