CreateDataQualityScan
Creates a data quality monitor.
Operation description
You must purchase DataWorks Basic Edition or a higher edition to use this feature.
Try it now
Test
RAM authorization
Request syntax
POST HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| Description |
string |
No |
The description of the data quality monitor. |
Daily data quality scanning of ods tables. |
| ProjectId |
integer |
No |
The ID of the DataWorks workspace. You can log on to the DataWorks console and go to the Workspace Configuration page to obtain the workspace ID. This parameter is used to specify the DataWorks workspace for the API operation. |
101 |
| Owner |
string |
No |
The user ID of the owner of the data quality monitor. |
95279527**** |
| Spec |
string |
No |
The spec code for the data quality monitor. For more information, see Data quality spec configuration. |
{ "datasets": [ { "type": "Table", "dataSource": { "name": "odps_first", "envType": "Prod" }, "tables": [ "ods_d_user_info" ], "filter": "pt = $[yyyymmdd-1]" } ], "rules": [ { "assertion": "row_count > 0" }, { "templateId": "SYSTEM:field:null_value:fixed", "pass": "when = 0", "name": "The id cannot be empty.", "severity": "High", "identity": "a-customized-data-quality-rule-uuid" } ] } |
| Parameters |
array<object> |
No |
The execution parameters for the data quality monitor. |
|
|
object |
No |
The execution parameters for the data quality monitor. |
||
| Value |
string |
No |
The value of the parameter. |
$[yyyymmdd-1] |
| Name |
string |
No |
The name of the parameter. |
triggerTime |
| RuntimeResource |
object |
No |
The resource group used when the data quality monitor runs. |
|
| Id |
string |
No |
The ID of the resource group. |
0525242e-d0ee-4bda-bc73-765d82f6a34a |
| Cu |
number |
No |
The number of compute units (CUs) consumed by the runtime configuration. |
0.25 |
| Image |
string |
No |
The ID of the image used in the runtime configuration. |
i-xxxxxx |
| ComputeResource |
object |
No |
The compute engine used when the data quality monitor runs. This parameter is optional. If you do not specify this parameter, the data source connection specified in the spec is used. |
|
| Name |
string |
No |
The name of the compute engine, which serves as a unique identifier. |
emr_first |
| Runtime |
object |
No |
The advanced settings for the data quality monitor at runtime. |
|
| Engine |
string |
No |
The type of the engine. Only the E-MapReduce (EMR) compute engine supports this setting. Valid values:
|
Hive |
| SparkConf |
object |
No |
The advanced parameter settings for the Spark engine. Currently, you can only use spark.yarn.queue to specify a queue. |
{"spark.yarn.queue": "dq_queue"} |
| HiveConf |
object |
No |
The advanced parameter settings for the Hive engine. Currently, you can only use mapreduce.job.queuename to specify a queue. |
{"mapreduce.job.queuename": "dq_queue"} |
| EnvType |
string |
No |
The workspace environment to which the compute engine belongs. Valid values:
Valid values:
|
Dev |
| Trigger |
object |
No |
The trigger settings for the data quality monitor. |
|
| Type |
string |
No |
The trigger method for the data quality monitor. Valid values:
|
BySchedule |
| TaskIds |
array |
No |
The IDs of the scheduled tasks that trigger the data quality monitor when the trigger method is set to BySchedule. |
|
|
integer |
No |
The ID of the scheduled task. |
1004979033 |
|
| Hooks |
array<object> |
No |
The hook configurations after the data quality monitor finishes running. |
|
|
object |
No |
The hook configurations after the data quality monitor finishes running. |
||
| Condition |
string |
No |
The trigger condition for the hook. When this condition is met, the hook is triggered. Currently, only one expression syntax is supported: Specify multiple groups of rule severity levels and rule check statuses. For example, |
results.any { r -> r.status == 'Fail' && r.rule.severity == 'Normal' || r.status == 'Error' && r.rule.severity == 'High' || r.status == 'Warn' && r.rule.severity == 'High' } |
| Type |
string |
No |
The type of the hook. Valid values:
|
BlockTaskInstance |
| Name |
string |
No |
The name of the data quality monitor. |
data_quality_scan_001 |
| ClientToken |
string |
Yes |
The idempotency token. |
a-customized-uuid |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
The response. |
||
| RequestId |
string |
The request ID. |
0000-ABCD-EFG**** |
| Id |
integer |
The ID of the created data quality monitor. |
676303114031776 |
Examples
Success response
JSON format
{
"RequestId": "0000-ABCD-EFG****",
"Id": 676303114031776
}
Error codes
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.