cle_clock
Home > wikikonf >  was/actions/by kikonf > chgclonid







Chgclonid

print

Action : was.chgclonid   (Category : was, Name : chgclonid, By : kikonf)
Complete Name : was.chgclonid.by.kikonf
Version : 5.0        License : Modified BSD License

Purpose of the was category :
Easy to customize. This category use in background the wsadmin command in jython mode (through AdminConfig, AdminControl and AdminTask), to drive WebSphere Application Server ® configuration.
You can use it to manage the whole WebSphere ® architecture.

Purpose of this chgclonid plugin : Changes a Cluster Member's clone id, insteresting for proxiying considerations.

The following shows the main Source Code File for the Action : was.chgclonid

Toggle lines
##  Copyright (c) 2008, Patrick Germain Placidoux
##  All rights reserved.
##
##  This file is part of Kikonf Public Software.
##
##  Kikonf Public Software is released under the modified BSD License,
##  which should accompany it or any part of it in the file "COPYING".
##  If you do not have this file you can access the license 
##  through the WWW at http://www.kikonf.org/license/bsd/license.txt.
## 
##  Home: http://www.kikonf.org
##  Contact: kikonf@gmx.com



from actions.was.tools import *



class Chgclonid(wasAction):

    def extract(self, scope_attrs=None, **keywords):
        self_funct='extract'
        self.verbose(scope_attrs)        
        scope_id, scope_attrs, scope=self.getScope(scope_attrs=scope_attrs, indent=self.getIndent())
        indent=self.getIndent() + 3*' '

        if 'cluster' not in scope_attrs.keys():raise xception.kikonfActionParameterException(self, self_funct, 'Chgclonid support Cluster Member, the Attribute "cluster" of your scope must be set ! Your scope:' + str(scope_attrs) + '.')

        chgclonid_node=self.newTop()
        id=AdminConfig.showAttribute(scope_id, 'uniqueId')
        
        chgclonid_node.setAttrs(id=id)
        mkNodeScope(chgclonid_node, scope_attrs, isUnique=True)
        
    def inject(self):
        self_funct='inject'    
        chgclonid_node = self.getTop()                                          #-- Grabs top node
        chgclonid_attrs = chgclonid_node.getAttrs()
        scope_id, scope_attrs, scope=self.getScope(parent_node=chgclonid_node, indent=self.getIndent()) #-- Retreives scope
        self.verbose(scope_attrs)
        indent=self.getIndent() + 3*' '
        
        cmdvalues=[]
        cmdvalues.append(['uniqueId', chgclonid_attrs.id])           
        verbose('ClusterMember:' + scope_attrs['server'] + ' retreiving.', level=self.getVerbose(), ifLevel=4, indent=indent, logFile=self.getLogFile())
        
        AdminConfig.modify(scope_id, cmdvalues)
        verbose('ClusterMember:' + scope_attrs['server'] + ', clonid:' + chgclonid_attrs.id + ' modified.', level=self.getVerbose(), ifLevel=3, indent=indent, logFile=self.getLogFile())
        
    def verbose(self, scope_attrs):
        scope=str(scope_attrs).replace("'", '')[1:-1]
        
        verbose('Cluster Member CloneId at scope:' + scope + '.', level=self.getVerbose(), ifLevel=2, indent=self.getIndent())
							
(Source: <KIKONF_INSTALLATION_DIR>/plugins/actions/was/chgclonid/by/kikonf/chgclonid.py)


  • Line 1 to 3 say something , say something , say something
  • Line 10 to 17 say something , say something , say something , say something , say something
  • Line 20 to 25 say something



Trademarks :
  • "IBM", "WebSphere", "WebSphere Aplication Server", "WAS" are registred trademarks of International Business Machines Corporation.
  • "Java" and "JVM" are a registred trademarks of Oracle and/or its affiliates.
  • Other names may be trademarks of their respective owners.

Copyright © 2011 - Patrick Placidoux, Hélène Malamoud