All Products
Search
Document Center

:DsgQueryDefaultTemplates

最終更新日:Jun 11, 2024

Queries a list of available sensitive field type templates and the data masking rules supported by the templates. You can refer to the response parameters of this operation to configure 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. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter

Type

Required

Example

Description

Action

String

Yes

DsgQueryDefaultTemplates

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

SceneId

Integer

Yes

123

The ID of the level-2 data masking scenario. You can call the DsgSceneQuerySceneListByName operation to query the list of IDs.

Response parameters

Parameter

Type

Example

Description

Success

Boolean

true

Indicates whether the request was successful. Valid values:

  • true

  • false

ErrorCode

String

1029030003

The error code.

ErrorMessage

String

param error

The error message.

HttpStatusCode

Integer

400

The HTTP status code.

Data

Array of Data

The returned data.

DataType

String

phone

The sensitive field type.

DesensPlanTemplate

Map

The supported data masking methods and parameter descriptions.

Array of Item

The information about the data masking method and parameters.

Name

String

hash

The name of the data masking method.

SupportWaterMark

Boolean

true

Indicates whether a watermark is added. Valid values:

  • true: allow

  • false: disallow

ExtParamTemplate

Array of Any

{ "key": "algo", "valueEnum": [ "MD5", "SHA256", "SHA512", "SM3" ], "valueType": "string" }, { "key": "salt", "valueEnum": [ 1, 2, 3, 4, 5, 6, 7, 8, 9 ], "valueType": "int" }

The supported data masking rules and related parameter configurations, which are in the JSON format.

The returned results are used to describe the parameters of a data masking rule. You cannot use the results as input parameters to create or modify a data masking rule.

RequestId

String

102400001

The request ID. You can use the ID to locate logs and troubleshoot issues.

Examples

Sample requests

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

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<DsgQueryDefaultTemplatesResponse>
    <Success>true</Success>
    <ErrorCode>1029030003</ErrorCode>
    <ErrorMessage>param error</ErrorMessage>
    <HttpStatusCode>400</HttpStatusCode>
    <Data>
        <DataType>phone</DataType>
        <DesensPlanTemplate>
            <Name>hash</Name>
            <SupportWaterMark>true</SupportWaterMark>
            <ExtParamTemplate>{                     "key": "algo",                     "valueEnum": [                         "MD5",                         "SHA256",                         "SHA512",                         "SM3"                     ],                     "valueType": "string"                 },                 {                     "key": "salt",                     "valueEnum": [                         1,                         2,                         3,                         4,                         5,                         6,                         7,                         8,                         9                     ],                     "valueType": "int"                 }</ExtParamTemplate>
        </DesensPlanTemplate>
    </Data>
    <RequestId>102400001</RequestId>
</DsgQueryDefaultTemplatesResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

{
  "Success" : true,
  "ErrorCode" : "1029030003",
  "ErrorMessage" : "param error",
  "HttpStatusCode" : 400,
  "Data" : [ {
    "DataType" : "phone",
    "DesensPlanTemplate" : [ {
      "Name" : "hash",
      "SupportWaterMark" : true,
      "ExtParamTemplate" : [ "{                     \"key\": \"algo\",                     \"valueEnum\": [                         \"MD5\",                         \"SHA256\",                         \"SHA512\",                         \"SM3\"                     ],                     \"valueType\": \"string\"                 },                 {                     \"key\": \"salt\",                     \"valueEnum\": [                         1,                         2,                         3,                         4,                         5,                         6,                         7,                         8,                         9                     ],                     \"valueType\": \"int\"                 }" ]
    } ]
  } ],
  "RequestId" : "102400001"
}

Error codes

HttpCode

Error code

Error message

Description

400

DESENSTEMPLATE.SCENE.ERROR

Scene ID does not exist.

The scenario ID does not exist.

400

DESENSTEMPLATE.SCENELEVEL.ERROR

The scene is not a secondary scene.

The data masking scenario is not a level-2 data masking scenario.

400

PARAMS.ERROR

param error.

The values specified for one or more parameters are invalid.

403

PERMISSION.DENIED.ERROR

Permission denied

You are not authorized to perform this operation.

500

UNKNOWN.ERROR

unknown error.

An unknown error has occurred.

For a list of error codes, see Service error codes.