DataWorks provides built-in and custom parameters to help you develop extension code more efficiently and effectively. For example, you can use parameters to make an extension apply only to specific workspaces. This topic describes how to use extension parameters.
Background information
To use extension parameters in your code, you must first define them in the extension's registration information. You can add any built-in or custom parameters that you might need during development. Developers can call the GetExtension API to retrieve the extension's parameter configuration.
You can add multiple parameters. Each parameter must be on a new line.
When you add built-in parameters:
Built-in parameters use the
key=valueformat. The following built-in parameters are supported:Built-in parameter 1: extension.project.disabled, workspace blacklist configuration
Built-in parameter 2: extension.project.disabled.append, append to workspace blacklist
Built-in parameter 5: extension.fileType.{fileType}.{eventCode}.enabled
Built-in parameter 6:
extension.manualPass.enabled. This parameter determines whether to enable the manual Mark as Passed button for the extension.extension.manualPass.enabled=trueIf you set this parameter, the Mark as Passed button appears in the Operations column on the right side of the extension.
When you add custom parameters:
Use the
key=valueformat.
Built-in parameter 1: extension.project.disabled, workspace blacklist configuration
Scenario:
You can use this parameter to disable the extension for specific workspaces.
Parameter description:
extension.project.disabled=projectId1,projectId2,projectId3In this parameter, projectId specifies the ID of the workspace in which the extension is disabled. You can obtain the ID by calling the ListProjects operation or by finding it on the workspace configuration page in the DataWorks console.
NoteYou can specify multiple workspace IDs for a single parameter. Separate the IDs with commas (,).
Example:
extension.project.disabled=projectId1Note:
Do not configure the same key multiple times. If you configure the same key multiple times, only the last configuration takes effect.
Built-in parameter 2: extension.project.disabled.append, append to workspace blacklist
Scenario:
If the
extension.project.disabledparameter is already set, you can use this parameter to append more workspaces to the blacklist. The extension is disabled for the appended workspaces.Parameter description:
extension.project.disabled.append=projectId1,projectId2,projectId3In this parameter, projectId specifies the ID of the workspace in which the extension is disabled. You can obtain the ID by calling the ListProjects operation or by finding it on the workspace configuration page in the DataWorks console.
NoteYou can specify multiple workspace IDs for a single parameter. Separate the IDs with commas (,).
Example:
extension.project.disabled.append=projectId1
Built-in parameter 3: extension.project.{eventCode}.disabled, extension point blacklist configuration
Scenario:
You can use this parameter to disable the extension for specific extension points in specific workspaces.
Parameters:
extension.project.{eventCode}.disabled=projectId1,projectId2,projectId3The following table describes the parameters:
eventCode: The event type of the extension point that you want to disable. For more information, see Appendix: Event details (eventType).
projectId: The ID of the workspace where you want to disable the extension. You can obtain the ID by calling the ListProjects operation or finding it on the workspace configuration page in the DataWorks console.
NoteYou can specify multiple workspace IDs for this parameter. Separate the IDs with commas (,).
Example:
extension.project.commit-file.disabled=projectId1 extension.project.delete-file.disabled=projectId2,projectId3Note:
Do not configure the same key multiple times. If you configure the same key multiple times, only the last configuration takes effect.
Built-in parameter 4: extension.project.{eventCode}.disabled.append, append to extension point blacklist
Scenario:
When the
extension.project.{eventCode}.disabled.appendparameter contains a single value (that is, its value is not a comma-separated list of multiple workspace IDs), you can use this parameter to append a workspace, which disables the extension's extension points in that workspace.Parameter description:
extension.project.{eventCode}.disabled.append=projectId1,projectId2,projectId3The placeholders are described as follows:
eventCode: The event type of the extension point that you want to disable. For more information, see Appendix: Event details (eventType).
projectId: The ID of the workspace where you want to disable the extension. You can obtain the ID by calling the ListProjects operation or finding it on the workspace configuration page in the DataWorks console.
NoteYou can specify multiple workspace IDs for this parameter. Separate the IDs with commas (,).
Example:
extension.project.commit-file.disabled.append=projectId1 extension.project.delete-file.disabled.append=projectId2,projectId3
Built-in parameter 5: extension.fileType.{fileType}.{eventCode}.enabled
Scenario:
You can use this parameter to enable or disable the extension for specific types of node tasks.
Parameter description:
extension.fileType.{fileType}.{eventCode}.enabledThe placeholders are described as follows:
fileType: Specifies the type code for the node task type. You can obtain the type code by calling the ListFileType operation.
eventCode: The event type of the extension point that you want to disable. For more information, see Appendix: Event details (eventType).
Example:
The following example shows how to configure this parameter for node task type 10 (ODPS SQL task) and node task type 11 (ODPS MR task).
If you set the parameter to `true` for both task types, any unconfigured `fileType` defaults to `false`.
extension.fileType.10.run-file.enabled=true extension.fileType.11.run-file.enabled=trueThe extension takes effect for ODPS SQL tasks and ODPS MR tasks. The extension is triggered when these tasks run.
The extension is not triggered by other node tasks, such as Data Integration (DI) batch synchronization tasks.
If you set the parameter to `false` for both task types, any unconfigured `fileType` defaults to `true`.
extension.fileType.10.run-file.enabled=false extension.fileType.11.run-file.enabled=falseThe extension does not take effect for ODPS SQL tasks or ODPS MR tasks. The extension is not triggered when these tasks run.
The extension is triggered by all other node tasks, such as Data Integration (DI) batch synchronization tasks.
In mixed mode, any unconfigured `fileType` defaults to `false`.
extension.fileType.10.run-file.enabled=false extension.fileType.11.run-file.enabled=trueThe extension takes effect for ODPS MR tasks. The extension is triggered when this type of task runs.
The extension does not take effect for ODPS SQL tasks or other node tasks, such as Data Integration (DI) batch synchronization tasks. The extension is not triggered when these tasks run.