From f995df2d815703732d016364374f6f1e17b0bbde Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Mon, 10 Dec 2018 18:01:01 -0600 Subject: [PATCH 1/4] Issue #191 - Add filter description and configuration information to README.md --- README.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/README.md b/README.md index a3c412985..77d73d584 100644 --- a/README.md +++ b/README.md @@ -1072,6 +1072,43 @@ A custom injector for the admin server SSL listen port is: } ``` +### Model Filters + +WebLogic Deploy Tooling supports the use of model filters to manipulate the domain model. The Create Domain, Update Domain, and Deploy Applications Tools apply filters to the model after it is read, before it is validated and applied to the domain. The Discover Domain Tool applies filters to the model after it has been discovered, before the model is validated and written. + +Model filters are written in Jython, and must be compatible with the version used in the corresponding version of WLST. A filter must implement the method filter_model(model), which accepts as a single argument the domain model as a Jython dictionary. The method should make whatever adjustments are needed to the domain model. Filters can be stored in any directory, as long as they can be accessed by WebLogic Deploy Tooling. + +The following filter example (fix-password.py) sets the password for two attributes in the SecurityConfiguration WLST folder. + +```python +def filter_model(model): + if model and 'topology' in model: + if 'SecurityConfiguration' in model['topology']: + model['topology']['SecurityConfiguration']['CredentialEncrypted'] = 'welcome1' + model['topology']['SecurityConfiguration']['NodeManagerPasswordEncrypted'] = 'welcome1' + print 'Replaced SecurityConfiguration password' + else: + print 'SecurityConfiguration not in the model' +``` + +Model filters are configured by creating a model.filters.json file in the WLSDEPLOY_HOME/lib directory. This file has separate sections for filters to be applied for specific tools. Filters in the "deploy" section are also applied for the Update Domain Tool. + +This example deploys two filters for the Create Domain Tool: fix-password.py and no-mail.py, and one filter for the Discover Domain tool. + +```json +{ + "create": [ + { "name": "fixPassword", "path": "/home/user/fix-password.py" }, + { "name": "noMail", "path": "/home/user/no-mail.py" } + ], + "deploy": [ + ], + "discover": [ + { "name": "noMail", "path": "/home/user/no-mail.py" } + ] +} +``` + ## Samples A sample of a model_variable_injector.json file and a custom injector json file are installed in the WLSDEPLOY/samples directory. From 3a5672bd5285a0c2d7611233157cb39fc2bb019c Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Mon, 10 Dec 2018 18:05:18 -0600 Subject: [PATCH 2/4] Issue #191 - Corrected header level --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 77d73d584..139219d48 100644 --- a/README.md +++ b/README.md @@ -1072,7 +1072,7 @@ A custom injector for the admin server SSL listen port is: } ``` -### Model Filters +## Model Filters WebLogic Deploy Tooling supports the use of model filters to manipulate the domain model. The Create Domain, Update Domain, and Deploy Applications Tools apply filters to the model after it is read, before it is validated and applied to the domain. The Discover Domain Tool applies filters to the model after it has been discovered, before the model is validated and written. From 8c718efe9f3b463587d1fc1c979709c7b839051f Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Mon, 10 Dec 2018 18:16:39 -0600 Subject: [PATCH 3/4] Issue #191 - Corrected filter configuration file name, and configuration for update. --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 139219d48..a69081249 100644 --- a/README.md +++ b/README.md @@ -1091,7 +1091,7 @@ def filter_model(model): print 'SecurityConfiguration not in the model' ``` -Model filters are configured by creating a model.filters.json file in the WLSDEPLOY_HOME/lib directory. This file has separate sections for filters to be applied for specific tools. Filters in the "deploy" section are also applied for the Update Domain Tool. +Model filters are configured by creating a model_filters.json file in the WLSDEPLOY_HOME/lib directory. This file has separate sections for filters to be applied for specific tools. This example deploys two filters for the Create Domain Tool: fix-password.py and no-mail.py, and one filter for the Discover Domain tool. @@ -1105,6 +1105,8 @@ This example deploys two filters for the Create Domain Tool: fix-password.py and ], "discover": [ { "name": "noMail", "path": "/home/user/no-mail.py" } + ], + "update": [ ] } ``` From 61c5db0aada0ed92daea7d4c2e8b5cf5282f7142 Mon Sep 17 00:00:00 2001 From: Richard Killen Date: Mon, 10 Dec 2018 18:26:39 -0600 Subject: [PATCH 4/4] Issue #191 - Improved description. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index a69081249..bd0f2b1a1 100644 --- a/README.md +++ b/README.md @@ -1076,7 +1076,7 @@ A custom injector for the admin server SSL listen port is: WebLogic Deploy Tooling supports the use of model filters to manipulate the domain model. The Create Domain, Update Domain, and Deploy Applications Tools apply filters to the model after it is read, before it is validated and applied to the domain. The Discover Domain Tool applies filters to the model after it has been discovered, before the model is validated and written. -Model filters are written in Jython, and must be compatible with the version used in the corresponding version of WLST. A filter must implement the method filter_model(model), which accepts as a single argument the domain model as a Jython dictionary. The method should make whatever adjustments are needed to the domain model. Filters can be stored in any directory, as long as they can be accessed by WebLogic Deploy Tooling. +Model filters are written in Jython, and must be compatible with the version used in the corresponding version of WLST. A filter must implement the method filter_model(model), which accepts as a single argument the domain model as a Jython dictionary. This method can make any adjustments to the domain model that are required. Filters can be stored in any directory, as long as they can be accessed by WebLogic Deploy Tooling. The following filter example (fix-password.py) sets the password for two attributes in the SecurityConfiguration WLST folder. @@ -1093,7 +1093,7 @@ def filter_model(model): Model filters are configured by creating a model_filters.json file in the WLSDEPLOY_HOME/lib directory. This file has separate sections for filters to be applied for specific tools. -This example deploys two filters for the Create Domain Tool: fix-password.py and no-mail.py, and one filter for the Discover Domain tool. +This example configures two filters for the Create Domain Tool: fix-password.py and no-mail.py, and one filter for the Discover Domain tool. ```json {