TdrModifyCheck
Check Whether the Table Structure Has Changed
Check whether the table structure of multiple tables under the same zone has changed according to the specified xml file
Request address
POST
http://OmsAddress/app/newoms.php/webservice/tdr/modifycheck?cmd=10003&ip-type=webservicerest&access-token=AccessTokenVal
POST request parameter description
| Parameter name | Data type | Description | Whether the field is required | Remarks |
|---|---|---|---|---|
| app_id | integer | app id of the table to be checked | Yes | |
| zone_id | integer | zone id of the table to be checked | Yes | |
| table_list | Array | tablename list of the table to be checked, such as ["tbl_1", "tbl_2", "tbl_3"],Table Empty list indicates checking all tables in the current area(The OMS console version requirement is 3.70.1 or above for support) | NO | |
| attachment_id | string | id of the data returned after the xml file defining the table structure is successfully uploaded using the "3.4.1 Upload xml/tdr File Defining Table Structure" interface. Multiple xml files are connected with commas ",", such as "23,24" | Yes | For files with tdr suffix, only one file can be used to check. For files with xml suffix, the maximum number is 64 |
Data Parameters
Use json format to represent the record related information. The following is an example:
{
"app_id": 2,
"zone_id": 3,
"attachment_id": "8",
"table_list": [
"table_generic",
"add_table1",
"add_table2",
"add_table3",
"add_table4",
"add_table5"
]
}
Return Syntax
Return Parameter Description
When the returned status code is not 200, it indicates that the check was unsuccessful, and the returned data is the check failure message
When the returned status code is 200, it indicates that the check was successful, and the returned data is in json format:
| Field name | Data type | Description | Remarks |
|---|---|---|---|
| invaild_modify_table | Array | Table information that does not meet the table modification limitations using the specified file | |
| same_field_table | Array | Table information whose structure has not changed using the specified file | |
| diff_field_table | Array | Table information whose structure has changed and meets the table modification limitations using the specified file | |
| invaild_table_in_file | Array | All tables in the file that do not conform to the rules for adding tables | 35.1 Add |
| only_file_table | Array | Table defined in the xml file, but does not exist in the database | 35.1 Add |
| only_db_table | Array | Table that only exists in the database but cannot be found in the xml | 35.1 Add |
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 '{
"app_id": 2,
"zone_id": 3,
"attachment_id": "8",
"table_list": [
"table_generic",
"add_table1",
"add_table2",
"add_table3",
"add_table4",
"add_table5"
]
}' http://omsaddress/app/newoms.php/webservice/tdr/modifycheck?cmd=10003&ip-type=webservicerest&access-token=\
Return Example
Successful Return Example
Status of http request = 200
{
"invaild_modify_table": [
{
"table_name": "table_generic",
"check_count_with_refer": true,
"value_field_num": false, #table_generic is not defined in the xml file with id 5. It is not allowed
"table_status": 1,
"table_type_info": {
"TableType": "1",
"ListNum": "100",
"DataProtocolType": "TBD",
"old_table_define": false
},
"data_protocol_type": "",
"error_msg": { #Note: Verify the error in the PB table file here_ The return form of msg is an array. "error_msg":["xxxx"]
"check_modify_error": "ERROR:Can't reduce list_num from 200 to 100"
}
},
{
"table_name": "add_table4",
"check_count_with_refer": true,
"value_field_num": 114, the type_int8_89 field of the table named add_table4 is deleted from the xml file with id 5. It is not allowed
"table_status": 1,
"table_type_info": {
"TableType": "1",
"ListNum": "100",
"DataProtocolType": "TBD",
"old_table_define": false
},
"data_protocol_type": "",
"error_msg": {
"check_modify_error": "ERROR:The entry can't be found! entry_name:'type_int8_89' metaname:'add_table4'"
}
},
{
"table_name": "add_table3",
"check_count_with_refer": true,
"value_field_num": 116, the type_int8_90 field of the table named add_table4 is modified from int8 to int64 in the xml file with id 5. It is not allowed
"table_status": 1,
"table_type_info": {
"TableType": "1",
"ListNum": "100",
"DataProtocolType": "TBD",
"old_table_define": false
},
"data_protocol_type": "",
"error_msg": {
"check_modify_error": "ERROR:The type of entry can't be modified! entry:'type_int8_90' metaname:'add_table3''"
}
}
],
"same_field_table": [
{
"table_name": "add_table2",
"check_count_with_refer": true,
"value_field_num": 116
},
{
"table_name": "add_table1",
"check_count_with_refer": true,
"value_field_num": 116
}
],
"diff_field_table": [
{
"table_name": "add_table5",
"check_count_with_refer": true,
"value_field_num": 117
}
],
"invaild_table_in_file": [
{
"table_name": "table_list_2",
"generic_err": "Primaykey must include splittablekey! Splittablekey:'items',table:'table_list_2' ",
"list_err": "Primaykey must include splittablekey! Splittablekey:'items',table:'table_list_2' "
}
],
"only_file_table": [
{
"table_name": "table_list_1"
}
],
"only_db_table": [
{
"table_name": "clubTable"
},
{
"table_name": "trela_core"
}
]
}
Failed Return Example
Status of http request != 200
{
"name": "Unauthorized",
"message": "You are requesting with an invalid credential.",
"code": 0,
"status": 401,
"type": "yii\\web UnauthorizedHttpException"
}
[
"can't get the tdr content"
]