简体   繁体   中英

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

I am new python member and wanted to see why parser I can use to get this info

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. 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!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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