简体   繁体   English

wlst脚本使用解析多个值来停止/启动域

[英]wlst script to use parse several values to stop/start domains

I want to parse the following entries in config file: 我想解析配置文件中的以下条目:

[Domain1]
DOMAIN_NAME=my_domain1
NM_HOST=myhost1.com
ADMIN_URL=t3://myhost1.com:9001
DOMAIN_DIR=/nasn/app/oracle/admin/domains/mydomain_1/bin
WLS_DIR=/nasampn/app/oracle/product/fmw_api12c
ADMIN_USER=/software/wlst/secure/UPE/mydomain_1/AdminConfig.secure
ADMIN_PASS=/software/wlst/secure/UPE/mydomain_1/AdminKey.secure
NM_PORT=5556
NM_TYPE=SSL
OS_USER=oraamp

[Domain2]
DOMAIN_NAME=mydomain_2
NM_HOST=myhost1.com
ADMIN_URL=t3://myhost1.com:7001
DOMAIN_DIR=/nasn/app/oracle/admin/domains/mydomain_1/bin
WLS_DIR=/nasn/app/oracle/product/fmw_api12c
ADMIN_USER=/software/wlst/secure/UPE/mydomain_2/AdminConfig.secure
ADMIN_PASS=/software/wlst/secure/UPE/mydomain_2/AdminKey.secure
NM_PORT=5556
NM_TYPE=SSL
OS_USER=oraamp

[Domain3]
[Domain4,5,6,7]

for example and for each domain, I need to pass the values to connect to the admin server and stop and start the domain. 例如,对于每个域,我需要传递值以连接到管理服务器,然后停止并启动域。

How can I parse the values so that I can provide the info for the connect and serverStart arguments 我如何解析值,以便可以提供connect和serverStart参数的信息

I am new python member and wanted to see why parser I can use to get this info 我是新的python成员,想了解为什么我可以使用解析器来获取此信息

https://www.ebicus.com/en/blog/how-to-restart-managed-servers-simultaneously-with-wlst/ https://www.ebicus.com/en/blog/how-to-restart-managed-servers-simultaneously-with-wlst/

All you have to do is to install the configparser module in python. 您要做的就是在python中安装configparser模块。 You can do that simply by opening the (command promp) on Windows or (terminal) on Linux, then write pip install configparser and your code should work perfectly!! 您只需在Windows上打开(命令提示符)或在Linux上打开(终端),然后编写pip install configparser ,您的代码应该可以正常工作!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM