Reputation: 11
I have a script that sets a Custom JVM Property at each of the node agents, but I also want it to do the same at the dmgr level. I'm having a hard time getting the id for the dmgr jvm. Here's my nodeagent script. I'm really struggling with the list, listServers, getid differences.
Thanks to covener's comment, here's the working script
dmgrServer = AdminTask.listServers('[-serverType DEPLOYMENT_MANAGER]').splitlines()
for jvm in dmgrServer: # get dmgr jvm id jvmid = AdminConfig.list('JavaVirtualMachine', jvm) # create new property AdminConfig.create('Property', jvmid, '[[validationExpression ""] [name "MyProperty"] [description "Do cool stuff"] [value "true"] [required "false"]]')
nodeagents = AdminTask.listServers('[-serverType NODE_AGENT]').splitlines()
for nodeagent in nodeagents: # get the id of the JVM for this node agent server jvmid = AdminConfig.list('JavaVirtualMachine', nodeagent) # set the custom property AdminConfig.create('Property', jvmid, '[[validationExpression ""] [name "MyProperty"] [description "Do cool stuff"] [value "true"] [required "false"]]')
AdminConfig.save()
AdminNodeManagement.syncActiveNodes()
Upvotes: 1
Views: 846
Reputation: 17896
Adding comment as an answer:
DEPLOYMENT_MANAGER is a valid server type, so it can be handled exactly the same as the NODE_AGENT loop:
dmgrServer = AdminTask.listServers('[-serverType DEPLOYMENT_MANAGER]').splitlines()
Upvotes: 2