k_satish22
asked on
Jython Script
Hello HonorGod,
As per your comment in other question. I have opend new Question. Jython Script to export and import Namespace Bindings from one environment other. The please find the attached for the output you have asked for below code.
for ns in AdminConfig.list( 'NameSpaceBinding' ).splitlines() :
print ns
print '-' * 50
print AdminConfig.show( ns )
print '-' * 50
print
ns-out.txt
As per your comment in other question. I have opend new Question. Jython Script to export and import Namespace Bindings from one environment other. The please find the attached for the output you have asked for below code.
for ns in AdminConfig.list( 'NameSpaceBinding' ).splitlines() :
print ns
print '-' * 50
print AdminConfig.show( ns )
print '-' * 50
ns-out.txt
ASKER
Hi Gary,
I need a script to export and import Namespace Bindings from one environment other.
I need a script to export and import Namespace Bindings from one environment other.
Check out this questions, and see if it gives you what you need:
https://www.experts-exchange.com/questions/23918846/Exporting-WebSphere-name-space-bindings-and-import-into-new-WebSphere-configuration.html
- Gary Patterson
https://www.experts-exchange.com/questions/23918846/Exporting-WebSphere-name-space-bindings-and-import-into-new-WebSphere-configuration.html
- Gary Patterson
ASKER
That is of no help for me because hu8mypho is developing his own script and never posted the script.
Old (related) question - which was the instigation for this one:
https://www.experts-exchange.com/questions/26928348/Jython-Script.html?anchorAnswerId=35318694#a35318694
What's the output of:
https://www.experts-exchange.com/questions/26928348/Jython-Script.html?anchorAnswerId=35318694#a35318694
What's the output of:
for ns in AdminConfig.list( 'NameSpaceBinding' ).splitlines() :
name = AdminConfig.showAttribute( ns, 'name' )
ot = AdminConfig.getObjectType( ns )
print '%20s %s' % ( ot, name )
It looks like you only have String, and EJB NameSpaceBindings
One of the challenges that I'm having is trying to determine if they are all bound to the Cell, or if some other scope is involved...
One of the challenges that I'm having is trying to determine if they are all bound to the Cell, or if some other scope is involved...
ASKER
There are some other scops also involved.
Will the new bindings be imported to a configuration containing the same Cell, Node, Cluster, and Server names?
ASKER
Yes.
Please provide the output requested here: https://www.experts-exchange.com/questions/26933403/Jython-Script.html?anchorAnswerId=35325473#a35325473 Thanks
ASKER
I have attached the output.
Can I change the questio to -
Script to create NameSpaceBinding by taking input from Properties files. That properties file will contain Scop, Values.
The Properties file will contain –
Scope=
Name: nameInNameSpace, stringToBind
Property:Value= CACHE_SWITCH, CACHE_SWITCH,ON
ns-out.txt
Can I change the questio to -
Script to create NameSpaceBinding by taking input from Properties files. That properties file will contain Scop, Values.
The Properties file will contain –
Scope=
Name: nameInNameSpace, stringToBind
Property:Value= CACHE_SWITCH, CACHE_SWITCH,ON
ns-out.txt
Thanks!
Q: Can I change the question?
A: Sure, it's your question. ;-)
The Properties file will contain –
Scope=
Name: nameInNameSpace, stringToBind
Property:Value= CACHE_SWITCH, CACHE_SWITCH,ON
My questions for you are:
Q: Is the Scope going to be like what was eventually used here?
https://www.experts-exchange.com/questions/26928348/Jython-Script.html?anchorAnswerId=35316498#a35316498
Q: Can we change the Property:Value to include a "Type" indicator?
e.g., Something like
String
EJB
Corba
Indirect
I wanted to provide a link to the online documentation about the different
namespace bindings, but I'm having trouble with my machine at the moment. ;-(
Does this make sense?
Q: Can I change the question?
A: Sure, it's your question. ;-)
The Properties file will contain –
Scope=
Name: nameInNameSpace, stringToBind
Property:Value= CACHE_SWITCH, CACHE_SWITCH,ON
My questions for you are:
Q: Is the Scope going to be like what was eventually used here?
https://www.experts-exchange.com/questions/26928348/Jython-Script.html?anchorAnswerId=35316498#a35316498
Q: Can we change the Property:Value to include a "Type" indicator?
e.g., Something like
String
EJB
Corba
Indirect
I wanted to provide a link to the online documentation about the different
namespace bindings, but I'm having trouble with my machine at the moment. ;-(
Does this make sense?
ASKER
I am sorry for the Confusion I am creating here. I would like to stick to earlier question only. Because I need create a properties file with 1300 entries. These namespace bindings already configured in one of our environments. I just want to export form that environment and import to my new environment. I will open a new question of creation of namespace bindings.
ok. I'm trying to figure out how to determine scope of a given NameSpace Binding.
I will get back to you.
I will get back to you.
ASKER
Thank you very much.
Please execute the following script and let me know:
- if you encounter any errors
Please include all messages written to the screen
- if no errors are encountered, please attach the output file
Thanks!
If you invoke it without any extra parameters, it should display appropriate Usage information.
e.g.,
./wsadmin.sh -conntype none -f exportNS.py
exportNS.py
- if you encounter any errors
Please include all messages written to the screen
- if no errors are encountered, please attach the output file
Thanks!
If you invoke it without any extra parameters, it should display appropriate Usage information.
e.g.,
./wsadmin.sh -conntype none -f exportNS.py
exportNS.py
ASKER
Here is the error...
$ ./wsadmin.sh -conntype none -f exportNS.py
WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.
WASX7017E: Exception received while running file "exportNS.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
(no code object) at line 0
File "<string>", line 27
cp, depth = '', len( hierarchy ) // 2
^
SyntaxError: invalid syntax
$
$ ./wsadmin.sh -conntype none -f exportNS.py
WASX7357I: By request, this scripting client is not connected to any server process. Certain configuration and application operations will be available in local mode.
WASX7017E: Exception received while running file "exportNS.py"; exception information: com.ibm.bsf.BSFException: exception from Jython:
Traceback (innermost last):
(no code object) at line 0
File "<string>", line 27
cp, depth = '', len( hierarchy ) // 2
^
SyntaxError: invalid syntax
$
sorry. ;-(
Unfortunately, I can't test it very thoroughly be cause I don't have any NameSpaceBindings defined.
Thanks for your help!
Thanks for your help!
I fixed a trivial typo that messed up the Usage information slightly
exportNS.py
exportNS.py
ASKER
Please find the attached for the output...
exportNS.txt
exportNS.txt
That looks sweet! (as well as looking right).
Now, I have to write the reverse ... i.e., importNS ;-)
Did you take a look at the output?
Now, I have to write the reverse ... i.e., importNS ;-)
Did you take a look at the output?
ok, this might work, I've tested it some, but I'm not certain if my environment is "good enough"
./wsadmin.sh -conntype none -f importNS.py
Shows usage information
Note: The "save" feature is currently disabled, so actual changes will not occur!
importNS.py
./wsadmin.sh -conntype none -f importNS.py
Shows usage information
Note: The "save" feature is currently disabled, so actual changes will not occur!
importNS.py
ASKER
Hello HonorGod
I am very sorry for the delayed response on this question. The import script is not working Please find the attachement for error details.
importNS-Out.txt
I am very sorry for the delayed response on this question. The import script is not working Please find the attachement for error details.
importNS-Out.txt
Ah ha. Your output helped me find a mistake.
Please try this, and let me know how it goes.
importNS.py
Please try this, and let me know how it goes.
importNS.py
ASKER
Now I am gettting below error ....
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector; The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[/home/wasadmin/satish_sc ripts/expo rtNS_out.t xt]"
Error: WASX7480E: "'" found instead of expected [.
Attribute= had invalid value= for input parameter='[ [ "name", "ClaimInquiry_Bloodhound_R EALM" ], [ "nameInNameSpace", "ClaimInquiry_Bloodhound_R EALM" ], [ "stringToBind", "bh0009" ] ]'
, line ignored
-------------------------- ---------- ---------- ---------- ---------- ----
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps 01Node01/S erver:NonC laims1/' '[ [ "name", "ClaimInquiry_Bloodhound_R EALM" ], [ "nameInNameSpace", "ClaimInquiry_Bloodhound_R EALM" ], [ "stringToBin
d", "bh0009" ] ]'
-------------------------- ---------- ---------- ---------- ---------- ----
Error: WASX7480E: "'" found instead of expected [.
Attribute= had invalid value= for input parameter='[ [ "name", "ClaimInquiry_Bloodhound_R EALM" ], [ "nameInNameSpace", "ClaimInquiry_Bloodhound_R EALM" ], [ "stringToBind", "bh0009" ] ]'
^
, line ignored
-------------------------- ---------- ---------- ---------- ---------- ----
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps 02Node01/S erver:NonC laims2/' '[ [ "name", "ClaimInquiry_Bloodhound_R EALM" ], [ "nameInNameSpace", "ClaimInquiry_Bloodhound_R EALM" ], [ "stringToBin
d", "bh0009" ] ]'
-------------------------- ---------- ---------- ---------- ---------- ----
Error: WASX7480E: "'" found instead of expected [.
Attribute= had invalid value= for input parameter='[ [ "name", "ClaimInquiry_Bloodhound_R EALM" ], [ "nameInNameSpace", "ClaimInquiry_Bloodhound_R EALM" ], [ "stringToBind", "bh0009" ] ]'
^
, line ignored
-------------------------- ---------- ---------- ---------- ---------- ----
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps 01Node01/S erver:NonC laims1/' '[ [ "name", "ClaimInquiry_Bloodhound_U RL" ], [ "nameInNameSpace", "ClaimInquiry_Bloodhound_U RL" ], [ "stringToBind",
"https://ATLENTVAWSL01/bhi/web-portlet/sso/sso.seam" ] ]'
-------------------------- ---------- ---------- ---------- ---------- ----
Error: WASX7480E: "'" found instead of expected [.
Attribute= had invalid value= for input parameter='[ [ "name", "ClaimInquiry_Bloodhound_R EALM" ], [ "nameInNameSpace", "ClaimInquiry_Bloodhound_R EALM" ], [ "stringToBind", "bh0009" ] ]'
^
, line ignored
-------------------------- ---------- ---------- ---------- ---------- ----
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps 02Node01/S erver:NonC laims2/' '[ [ "name", "ClaimInquiry_Bloodhound_U RL" ], [ "nameInNameSpace", "ClaimInquiry_Bloodhound_U RL" ], [ "stringToBind",
"https://ATLENTVAWSL01/bhi/web-portlet/sso/sso.seam" ] ]'
-------------------------- ---------- ---------- ---------- ---------- ----
WASX7209I: Connected to process "dmgr" on node dmgr1ProcNode01 using SOAP connector; The type of process is: DeploymentManager
WASX7303I: The following options are passed to the scripting environment and are available as arguments that are stored in the argv variable: "[/home/wasadmin/satish_sc
Error: WASX7480E: "'" found instead of expected [.
Attribute= had invalid value= for input parameter='[ [ "name", "ClaimInquiry_Bloodhound_R
, line ignored
--------------------------
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps
d", "bh0009" ] ]'
--------------------------
Error: WASX7480E: "'" found instead of expected [.
Attribute= had invalid value= for input parameter='[ [ "name", "ClaimInquiry_Bloodhound_R
^
, line ignored
--------------------------
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps
d", "bh0009" ] ]'
--------------------------
Error: WASX7480E: "'" found instead of expected [.
Attribute= had invalid value= for input parameter='[ [ "name", "ClaimInquiry_Bloodhound_R
^
, line ignored
--------------------------
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps
"https://ATLENTVAWSL01/bhi/web-portlet/sso/sso.seam" ] ]'
--------------------------
Error: WASX7480E: "'" found instead of expected [.
Attribute= had invalid value= for input parameter='[ [ "name", "ClaimInquiry_Bloodhound_R
^
, line ignored
--------------------------
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps
"https://ATLENTVAWSL01/bhi/web-portlet/sso/sso.seam" ] ]'
--------------------------
Yikes. Please provide the input file. Thanks!
ASKER
PFA...
exportNS-out.txt
exportNS-out.txt
Ah. I bet I made the same kind of mistake for the 3rd parameter that I did for the 1st!
importNS.py
importNS.py
ASKER
Now I am getting below error.
Error: WASX7122E: Expected "]" not found.
Attribute=name had invalid value=, for input parameter= [ "name", "ClaimInquiry_Bloodhound_R EALM" ], [ "nameInNameSpace", "ClaimInquiry_Bloodhound_R EALM" ], [ "stringToBind", "bh0009" ]
^
, line ignored
-------------------------- ---------- ---------- ---------- ---------- ----
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps 02Node01/S erver:NonC laims2/' '[ [ "name", "xPressionServerURL" ], [ "nameInNameSpace", "xPressionServerURL" ], [ "stringToBind", "10.220.31.54:9081" ] ]'
-------------------------- ---------- ---------- ---------- ---------- ----
Error: WASX7122E: Expected "]" not found.
Attribute=name had invalid value=, for input parameter= [ "name", "ClaimInquiry_Bloodhound_R EALM" ], [ "nameInNameSpace", "ClaimInquiry_Bloodhound_R EALM" ], [ "stringToBind", "bh0009" ]
^
, line ignored
-------------------------- ---------- ---------- ---------- ---------- ----
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps 01Node01/S erver:Cots 1/' '[ [ "name", "xPressionWaterMarkProfile Name" ], [ "nameInNameSpace", "xPressionWaterMarkProfile Name" ], [ "stringToBind", "ENV05__NH_Realtime_Waterm ark_View" ] ]'
-------------------------- ---------- ---------- ---------- ---------- ----
Error: WASX7122E: Expected "]" not found.
Attribute=name had invalid value=, for input parameter= [ "name", "ClaimInquiry_Bloodhound_R EALM" ], [ "nameInNameSpace", "ClaimInquiry_Bloodhound_R EALM" ], [ "stringToBind", "bh0009" ]
^
, line ignored
-------------------------- ---------- ---------- ---------- ---------- ----
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps 02Node01/S erver:Cots 2/' '[ [ "name", "xPressionWaterMarkProfile Name" ], [ "nameInNameSpace", "xPressionWaterMarkProfile Name" ], [ "stringToBind", "ENV05__NH_Realtime_Waterm ark_View" ] ]'
-------------------------- ---------- ---------- ---------- ---------- ----
0 objects created.
Error: WASX7122E: Expected "]" not found.
Attribute=name had invalid value=, for input parameter= [ "name", "ClaimInquiry_Bloodhound_R
^
, line ignored
--------------------------
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps
--------------------------
Error: WASX7122E: Expected "]" not found.
Attribute=name had invalid value=, for input parameter= [ "name", "ClaimInquiry_Bloodhound_R
^
, line ignored
--------------------------
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps
--------------------------
Error: WASX7122E: Expected "]" not found.
Attribute=name had invalid value=, for input parameter= [ "name", "ClaimInquiry_Bloodhound_R
^
, line ignored
--------------------------
'StringNameSpaceBinding' '/Cell:ProcCell01/Node:wps
--------------------------
0 objects created.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
You Rock!!!!
Thanks for the compliments, grade and points.
Good luck & have a great day.
Good luck & have a great day.
- Gary Patterson