You can call this operation to create a custom sensitive data detection rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateRule

The operation that you want to perform. Set the value to CreateRule.

Category Integer Yes 0

The content type of the sensitive data detection rule. Valid values:

  • 0: keyword
  • 2: regular expression
Content String Yes (?:\\D|^)((?:(?:25[0-4]|2[0-4]\\d|1\\d{2}|[1-9]\\d{1})\\.)(?:(?:25[0-5]|2[0-4]\\d|[01]? \\d? \\d)\\.){2} (?:25[0-5]|2[0-4]\\d|1[0-9]\\d|[1-9]\\d|[1-9]))(?:\\D|$)

The content of the sensitive data detection rule. The content can be a regular expression or keywords used to match sensitive fields or text.

Name String Yes rule-tst

The name of the sensitive data detection rule.

Lang String No zh

The language of the request and response. Valid values:

  • zh: Chinese
  • en: English
RiskLevelId Long No 2

The risk level ID of data that hits the sensitive data detection rule. Valid values:

  • 1: S1, indicating the low risk level
  • 2: S2, indicating the medium risk level
  • 3: S3, indicating the high risk level
  • 4: S4, indicating the highest risk level

Response parameters

Parameter Type Example Description
RequestId String 208B016D-4CB9-4A85-96A5-0B8ED1EBF271

The ID of the request.

Examples

Sample requests


http(s)://[Endpoint]/? Action=CreateRule
&<Common request parameters>

Sample success responses

XML format

<CreateRule>
	  <RequestId>208B016D-4CB9-4A85-96A5-0B8ED1EBF271</RequestId>
</CreateRule>

JSON format

{
	"RequestId":"208B016D-4CB9-4A85-96A5-0B8ED1EBF271"
}

Error codes

For a list of error codes, visit the API Error Center.