Setting CustomProperty for HTTP channels in Websphere using wsadmin and jython

This is not smart enough yet.

HTTP_4 and HTTP_2  channels are harcoded

Need to be run from Deployment <anager bin folder

================================

PropertyName=’CookiesConfigureNoCache’

PropertyValue=’false’

PropertyDesc=’Requsted by App Team to fix IE6 bug’

serverlist=AdminTask.listServers(‘[-serverType APPLICATION_SERVER ]‘)

for server in serverlist.split():

        services=ac.list(‘TransportChannelService’,server)

        channels=ac.list(‘HTTPInboundChannel’,services)

        for http in channels.split(‘\n’):

                hname=ac.showAttribute(http, ‘name’)

                if  hname==’HTTP_2′ or hname==’HTTP_4′:

                        print http

                        print ‘[[validationExpression ""] [name "'+PropertyName+'"] [description "'+PropertyDesc+'"] [value "'+PropertyValue+'"] [required "false"]]’

                        ac.create(‘Property’,http,’[[validationExpression ""] [name "'+PropertyName+'"] [description "'+PropertyDesc+'"] [value "'+PropertyValue+'"] [required "false"]]’)

ac.save()

============================================

Dodaj komentarz

Wprowadź swoje dane lub kliknij jedną z tych ikon, aby się zalogować:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Zmień )

Twitter picture

You are commenting using your Twitter account. Log Out / Zmień )

Facebook photo

You are commenting using your Facebook account. Log Out / Zmień )

Connecting to %s

Follow

Otrzymuj każdy nowy wpis na swoją skrzynkę e-mail.