AddTableConfirm
Confirm the Application Form for Adding Tables
The application for adding a table will write the table adding related data into the application form. The confirmation of the table adding data is to assign shard and proxy resources to the applied table, and specify the engine parameters of the table.
Request address
POST
http://OmsAddress/app/newoms.php/webservice/business/table/add-table-confirm?cmd=10002&ip-type=webservicerest&access-token=AccessTokenVal
POST request parameter description
| Parameter name | Data type | Description | Whether the field is required | Remarks |
|---|---|---|---|---|
| uid | integer | id of the table-adding application form | Yes | |
| table_param | Array | Parameters of modifying tables: when adding tables in simple mode (calc_resource_type=1), the table parameter names are: active_record_num,total_record_num,estimated_read_load,estimated_write_load,key_avarage_record_size,value_avarage_record_size. When adding tables in complex mode (calc_resource_type=2), the table parameter names are: total_record_num,key_avarage_record_size,value_avarage_record_size,pcu,relationship_chain_interval,relationship_chain_count,index_count,read_index_interval,read_index_count,read_interval write_interval | No. You can only fill in the fields that need to be modified | See Table Parameter Description in the Application Form for the corresponding Chinese name of the table parameter and the range of parameter values |
| machine_choose | string | Resource (shard and proxy) allocation mode (automatic: auto, manual: manual) | No, the default is automatic mode | When automatically allocating shards and proxies required for adding tables, the formal set can only assign shards and proxies to exclusive hosts, and the test set can only assign shards and proxies to shared hosts |
| set_alloc_shard_num_type | integer | Shard resource allocation method | No | 0:Automatic calculation 1:Manually specify the model and quantity 2:Configure with cluster |
| alloc_svr_type_in_auto | string | Assign model name | No | When set_alloc_stard_num_type=1, the assigned model must be specified |
| alloc_shard_num_in_auto | integer | Allocate the number of shards | No | When set_alloc_stard_num_type=1, the number of shards to be allocated must be specified |
| svr_list | Array | When allocating resources automatically, it specifies the ip list of the host to which shard is assigned. If not specified, it indicates all available resources that meet the conditions. This field is not required when manually allocating resources | No | |
| proxy_list | Array | When allocating resources automatically, it specifies the ip list of the machine to which the proxy is assigned. If not specified, it indicates all available resources that meet the conditions. This field is not required when manually allocating resources | No | |
| version | string | This is the version number of the new tcapssvr and tcaproxy processes that need to be installed in the process of addting tables | No, the default is the center version number of the set where the table is located | |
| engine_parameters | string | Table engine parameters | No, table engine parameters will be calculated according to the table parameters | |
| alloc_svr_type | string | Model of tcapsvr where shards are assigned manually (shards must be assigned to tcapsvr of the same model. The total number of shards assigned should be equal to or greater than the required number. Under the test set, only one shard is required for a table) | No, if it is specified to assign resources manually, it is required | |
| alloc_shard_list | Data | List of manually assigned shards. Its format is as follows: {tcapsvr_name_1:1;tcapsvr_name_2:2} | No, if it is specified to assign resources manually, it is required | |
| alloc_proxy_type | string | Model of the tcaproxy where the proxy is manually assigned (the proxy must be assigned to the tcaproxy of the same model, and the total number of assigned proxies should be equal to the required number. Under the test set, only one proxy is required for a game zone) | No, if it is specified to assign resources manually, it is required | |
| alloc_proxy_list | Array | List of manually assigned proxy. {tcaproxy_name_1:1;tcaproxy_name_2:1} | No, if it is specified to assign resources manually, it is required | |
| verify_process_tcapsvr | integer | Verify whether to continue (0: do not continue, 1: continue), when the shard assigned automatically or manually is on the tcapsvr machine that has not started the process, and the existing tcapsvr process of the current set reaches the alarm line of the set. | No, do not continue | |
| verify_process_porxy | integer | Verify whether to continue (0: do not continue, 1: continue), when a new proxy process needs to be added, and the existing tcaproxy process of the current set reaches the alarm line of the set | No, do not continue | |
| conf_app_id | integer | Table information: app id of a table | Yes | |
| conf_zone_id | integer | Table information: game zone id of a table | Yes | |
| conf_table_name | string | Table information: table name | Yes |
Data Parameters
Use json format to represent the record related information. The following is an example:
{
"conf_app_id": 2,
"machine_choose": "manual",
"uid": 108,
"conf_zone_id": 3,
"conf_table_name": "test_table_generic_modify",
"alloc_svr_type": "Z3",
"alloc_shard_list": {
"host1_master_node": 1
}
}
Return Syntax
Return Parameter Description
| Field name | Data type | Description | Remarks |
|---|---|---|---|
| trans_id | integer | id of the generated corresponding transaction | |
| set_id | integer | Set of the transaction | |
| username | string | Transaction owner |
Request Example
Send A Request through the Curl Method
For the parameters in the command, please refer to the "Description of POST Request Parameters" on this page. For the method to obtain access-token, see: Get access-token
curl -H "Content-type: application/json" -X "POST" -d '{
"conf_app_id": 2,
"machine_choose": "manual",
"uid": 108,
"conf_zone_id": 3,
"conf_table_name": "test_table_generic_modify",
"alloc_svr_type": "Z3",
"alloc_shard_list": {
"host1_master_node": 1
}
}' http://omsaddress/app/newoms.php/webservice/business/table/add-table-confirm?cmd=10002&ip-type=webservicerest&access-token=\
Return Example
Successful Return Example
Status of http request = 200
{
"set_id": 126,
"trans_id": 404,
"user": "tcaplus"
}
Failed Return Example
Status of http request != 200
{
"uid": [
"Can't handle application,status not pending,application status:Failed To Exec"
]
}
{
"conf_zone_id": [
"table info confirm:error conf_zone_id(4)"
]
}