Listing User Rules
Function
This API is used to list all parsing rules configured by a user.
URI
GET /v1/{project_id}/applications/{application_id}/uni-search/rule-regex
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
project_id |
Yes |
String |
Definition: Project ID. For details about how to obtain the project ID, see Obtaining a Project ID. Constraints: N/A Value range: The value can contain 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter. Default value: N/A |
|
application_id |
Yes |
String |
Definition: Application ID. For details about how to obtain the application ID, see Obtaining an Application ID. Constraints: Character string Value range: The value can contain 1 to 64 characters. Only digits, letters, hyphens (-), and underscores (_) are allowed. The value must start with a letter. Default value: N/A |
Request Parameters
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
X-Auth-Token |
Yes |
String |
Definition: Token used for API authentication. For details about how to obtain the token, see Obtaining an IAM User Token. Constraints: N/A Value range: N/A Default value: N/A |
Response Parameters
Status code: 200
|
Parameter |
Type |
Description |
|---|---|---|
|
rules |
Array of RuleRegexInfo objects |
Definition: List of configured rule parsing rules. Value range: N/A |
|
Parameter |
Type |
Description |
|---|---|---|
|
id |
String |
Definition: Rule ID. Value range: N/A |
|
regexs |
Array of strings |
Definition: User-defined rule content. Value range: N/A |
|
project_id |
String |
Definition: Project ID. Value range: N/A |
Status code: 400
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition: Value range: N/A |
|
error_msg |
String |
Definition: Error message. Value range: N/A |
Status code: 500
|
Parameter |
Type |
Description |
|---|---|---|
|
error_code |
String |
Definition: Value range: N/A |
|
error_msg |
String |
Definition: Error message. Value range: N/A |
Example Requests
Lists user rule instances.
/v1/b25446daeb1a41a7953c5deba2b2677a/applications/cefb2a59-2f9e-4268-b56b-eab15dc0b9d6/uni-search/rule-regex
Example Responses
Status code: 200
List of user-defined rules.
{
"rules" : [ {
"id" : "default-rule-1",
"project_id" : "",
"regexs" : [ "^Chapter([01234567891-9]{1,7})", "^Section([01234567891-9]{1,7})", "^Article([01234567891-9]{1,7})" ]
}, {
"id" : "1825365053436710914",
"project_id" : "b25446daeb1a41a7953c5deba2b2677a",
"regexs" : [ "^Chapter([01234567891-9]{1,7})", "^Section([01234567891-9]{1,7})", "^Article([01234567891-9]{1,7})" ]
}, {
"id" : "1825444775541723137",
"project_id" : "b25446daeb1a41a7953c5deba2b2677a",
"regexs" : [ "^Chapter([01234567891-9]{1,7})", "^(\\d+)(\\.)\\s*[\\u4e00-\\u9fa5]+$", "^(\\d+)(\\.\\d+)\\s*[\\u4e00-\\u9fa5]+$", "^(\\d+)(\\.\\d+)(\\.\\d+)\\s*[\\u4e00-\\u9fa5]+$" ]
}, {
"id" : "1846457265960275969",
"project_id" : "b25446daeb1a41a7953c5deba2b2677a",
"regexs" : [ "^Chapter([01234567891-9]{1,7})", "^Section([01234567891-9]{1,7})", "^Article([01234567891-9]{1,7})" ]
}, {
"id" : "1868588283685076994",
"project_id" : "b25446daeb1a41a7953c5deba2b2677a",
"regexs" : [ "^Chapter([01234567891-9]{1,7})", "^Article([01234567891-9]{1,7})" ]
}, {
"id" : "1875103496942211074",
"project_id" : "b25446daeb1a41a7953c5deba2b2677a",
"regexs" : [ "^Chapter([01234567891-9]{1,7})", "^ ([one two three four five six eighty ninety]{1,7})", "^ (([1 2 3 4 5 6 87 89] {1, 7}))", "^(1-9)(.)", "^((1-9))(.)" ]
}, {
"id" : "1911702996365717505",
"project_id" : "b25446daeb1a41a7953c5deba2b2677a",
"regexs" : [ "^Chapter([01234567891-9]{1,7})", "^Article([01234567891-9]{1,7})" ]
}, {
"id" : "1911709287901409282",
"project_id" : "b25446daeb1a41a7953c5deba2b2677a",
"regexs" : [ "^Chapter([01234567891-9]{1,7})", "^Article([01234567891-9]{1,7})" ]
}, {
"id" : "1912398708489379841",
"project_id" : "b25446daeb1a41a7953c5deba2b2677a",
"regexs" : [ "^Chapter([01234567891-9]{1,7})", "^Article([01234567891-9]{1,7})" ]
} ]
}
Status Codes
|
Status Code |
Description |
|---|---|
|
200 |
List of user-defined rules. |
|
400 |
Incorrect request body parameter. |
|
500 |
Internal error. |
Error Codes
See Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot