All Products
Search
Document Center

PolarDB:ModifyMaskingRules

Last Updated:Jul 01, 2024

Modifies or adds a data masking rule.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

The ID of the cluster.

Note You can call the DescribeDBClusters operation to query the details of the clusters that belong to your Alibaba Cloud account, such as cluster IDs.
pc-*****************
RuleNamestringNo

The name of the data masking rule. You can specify only one rule name at a time.

Note
  • You can call the DescribeMaskingRules operation to query the details of all masking rules for a specified cluster, such as the names of the masking rules.
  • If the rule name does not exist in the cluster, the system automatically creates a masking rule based on the name and the value of RuleConfig.
  • testrule
    RuleConfigstringNo

    The parameter that is used to specify the masking rule that you want to modify and the value in the JSON format. All parameter values are of the string type. Example: {"auto": {"databases": ["db1"], "tables": ["tb1"], "columns": ["c1,c2"] }, "description": "This rule will be applied to the columns c1 and c2 in table t1", "enabled": true, "applies_to": ["user"]}. Parameters in the function:

    • "auto": specifies that the dynamic masking algorithm is supported. This parameter is required.
    • "databases": Optional. The names of databases to which the masking rule is applied. Separate the names with commas (,). If you leave this parameter empty, the masking rule applies to all databases in the cluster.
    • "tables": Optional. The names of tables to which the masking rule is applied. Separate the names with commas (,). If you leave this parameter empty, the rule applies to all tables in the cluster.
    • "columns": Required. The names of fields to which the masking rule is applied. Separate the names with commas (,).
    • "description": Optional. The description of the masking rule. The description can be up to 64 characters in length.
    • "enabled": Required. Specifies whether to enable the masking rule. Valid values: true and false.
    • "applies_to": The names of database accounts to which the masking rule is applied. Separate the names with commas (,).
    • "exempted": The names of database accounts to which the masking rule is not applied. Separate the names with commas (,).
    Note
  • If you specify RuleName, RuleConfig parameter is required.
  • You need to select either "applies_to" or "exempted".
  • {"auto": {"databases": ["db1"], "tables": ["tb1"], "columns": ["c1,c2"] }, "description": "This rule will be applied to the columns c1 and c2 in table t1", "enabled": true, "applies_to": ["user"]}
    RuleNameListstringNo

    The list of masking rule names. You can specify one or more masking rules at a time. Separate the masking rule names with commas (,).

    Note You must specify either the RuleName or RuleNameList parameter.
    testrule
    EnablestringNo

    Specifies whether to enable the specified masking rule. Valid values:

    • true
    • false
    Note This parameter is valid only when the RuleNameList parameter is specfied.
    true
    RuleVersionstringNo

    The version of the masking rule. Default value: v1. Valid values:

    • v1
    • v2
    v2

    Response parameters

    ParameterTypeDescriptionExample
    object
    RequestIdstring

    The ID of the request.

    99B355CE-526C-478B-B730-AD9D7C******
    Messagestring

    The message that is returned for the request.

    Note If the request is successful, Successful is returned. If the request fails, an error message such as an error code is returned.
    Message
    Successboolean

    Indicates whether the request is successful. Valid value:

    • true:
    • false
    true

    Examples

    Sample success responses

    JSONformat

    {
      "RequestId": "99B355CE-526C-478B-B730-AD9D7C******",
      "Message": "Message",
      "Success": true
    }

    Error codes

    HTTP status codeError codeError messageDescription
    404InvalidDBClusterId.MalformedThe specified parameter DBClusterId is not valid.The specified DBClusterId parameter is invalid.

    For a list of error codes, visit the Service error codes.

    Change history

    Change timeSummary of changesOperation
    2024-01-02The Error code has changed. The request parameters of the API has changedView Change Details
    2023-09-12The Error code has changedView Change Details