写点什么

【TcaplusDB 知识库】如何申请创建表索引

作者:tcaplus
  • 2022 年 4 月 15 日
  • 本文字数:1353 字

    阅读完需:约 4 分钟

【TcaplusDB知识库】如何申请创建表索引

【TcaplusDB 知识库】如何申请创建表索引

申请创建表索引,如果有其他表操作申请单未处理,会报冲突


请求地址


POSThttp://OmsAddress/app/newoms.php/webservice/business/table/apply-table-index?cmd=10022&ip-type=webservicerest&access-token=AccessTokenVal
复制代码


POST 请求参数说明


Data 参数

使用 json 格式表示记录相关信息,示例如下:


{    "app_id": 2,    "zone_id": 4,    "table_name": "T_CHESS_COMMENT",    "key_index_fields": [        "chess_id"    ],    "value_index_fields": [        "thumb_num"    ],    "memo": "apply by webservice"}
复制代码

返回语法

返回参数说明

需要关注的参数是 apply,info,id, 在审核的时候需要用到

请求示例

通过 curl 方法发起请求

命令中的红色部分是需要用户自行填写的参数,请参阅[url 中 GET 参数说明](https://tcaplusdb.tencent.com/UserGuide/06TcaplusDB Webservice API/07 索引/56 申请创建表索引[ApplyTableIndex].html#getParamDesc)


curl -H "Content-type: application/json" -X "POST" -d '{"app_id": 2,"zone_id": 4,"table_name": "T_CHESS_COMMENT","key_index_fields": ["chess_id"],"value_index_fields": ["thumb_num"],"memo": "apply by webservice"}' http://omsaddress/app/newoms.php/webservice/business/table/apply-table-index?cmd=10022&ip-type=webservicerest&access-token=<access-token>

返回示例

成功返回示例

http 请求的 Status=200


{    "apply": {        "ret": 0,        "info": {            "dba": "tcaplus;peterwong",            "set_id": 1,            "app_id": 2,            "app_name": "test_app",            "zone_list": "4",            "table_name": "T_CHESS_COMMENT",            "table_type": 0,            "apply_type": 14,            "user": "peterwong",            "write_time": "2020-10-16 14:21:56",            "memo": "apply by webservice",            "job_id": 21,            "key_struct": "[\"chess_id\"]",            "value_struct": "[\"thumb_num\"]",            "dm_ratio": 5,            "table_maxnum": 0,            "calc_resource_type": 1,            "attention_man": "",            "kelly_id": 0,            "resource_ratio": 1,            "sort_field_num": 0,            "sort_rule": 0,            "data_protocol_type": "TBD",            "id": 117        },        "msg": ""    }}
复制代码

错误返回

http 请求的 Status!=200


{    "name": "Unauthorized",    "message": "You are requesting with an invalid credential.",    "code": 0,    "status": 401,    "type": "yii\\web UnauthorizedHttpException"}{    "source_ip": "ip:10.29.89.51 not in whitelist"}
复制代码




更多信息请关注 TcaplusDB 微信公众号,风里雨里,我们一直在等你!



TcaplusDB 是腾讯出品的分布式 NoSQL 数据库,存储和调度的代码完全自研。具备缓存+落地融合架构、PB 级存储、毫秒级时延、无损水平扩展和复杂数据结构等特性。同时具备丰富的生态、便捷的迁移、极低的运维成本和五个九高可用等特点。客户覆盖游戏、互联网、政务、金融、制造和物联网等领域。

用户头像

tcaplus

关注

还未添加个人签名 2021.03.18 加入

还未添加个人简介

评论

发布
暂无评论
【TcaplusDB知识库】如何申请创建表索引_tcaplus_InfoQ写作平台