def lookup_bridge_destination(name): instance_bean = wl.getMBean('/JMSBridgeDestinations/' + name) if instance_bean == None: raise LookupError("The bridge destination doesn't exist: " + name) return instance_bean
def lookup_server_instance(instance_name): instance_bean = wl.getMBean('/Servers/' + instance_name) if instance_bean == None: raise LookupError("The target server instance doesn't exist: " + instance_name) return instance_bean
def create_subdeployment(jms_module_name, jms_server_name, jms_subdeployment): wl.cd('/JMSSystemResources/' + jms_module_name) wl.cmo.createSubDeployment(jms_subdeployment) jms_server = wl.getMBean('/JMSServers/' + jms_server_name) if (jms_server == None): raise LookupError("The JMS server doesn't exist") wl.cd('/JMSSystemResources/' + jms_module_name + '/SubDeployments/' + jms_subdeployment) wl.cmo.addTarget(jms_server)
def SetQFailureOptions(systemModule, queueName, backupQueueName): print 'Setting Queue Failure options for : ' + queueName + '... at System Module: ' + systemModule + '...' cmo = wlst.cd('/JMSSystemResources/' + systemModule + '/JMSResource/' + systemModule + '/UniformDistributedQueues/' + queueName + '/DeliveryFailureParams/' + queueName) cmo.setErrorDestination( wlst.getMBean('/JMSSystemResources/' + systemModule + '/JMSResource/' + systemModule + '/UniformDistributedQueues/' + backupQueueName)) cmo.setRedeliveryLimit(24) cmo.setExpirationPolicy('Discard') cmo = wlst.cd('/JMSSystemResources/' + systemModule + '/JMSResource/' + systemModule + '/UniformDistributedQueues/' + queueName + '/DeliveryParamsOverrides/' + queueName) cmo.setRedeliveryDelay(120000) print 'Setting Queue Failure options for : ' + queueName + '... at System Module: ' + systemModule + '...end.'
def getMBean(path): return wlst.getMBean(path)
'''Get the list of artifacs for a WebLogic Domain''' global __app_state_runtime__ artifact_list = [] library_list = [] result = (artifact_list, library_list) try: connect(user, passwd, adminurl, timeout=200000) except Exception, _e: print 'Connection to', adminurl, 'failed' print _e return result try: __app_state_runtime__ = getMBean('domainRuntime:AppRuntimeStateRuntime')\ .getAppRuntimeStateRuntime() serverConfig() deployments = _get_names('AppDeployments') deployments.sort() #print 'deployments', deployments for item in deployments: artifact_list.append(_get_wl_details('AppDeployments', item)) except Exception, _e: print 'Getting artifacts from', adminurl, 'failed' print _e artifact_list.extend(_get_env_config()) try:
def assignManagedServerToCluster(serverName, clusterName): cmo = wlst.cd('/Servers/' + serverName) cmo.setCluster(wlst.getMBean('/Clusters/' + clusterName))
def assignServerToMachine(serverName, machineName): cmo = wlst.cd('/Servers/' + serverName) cmo.setMachine(wlst.getMBean('/Machines/' + machineName))
def assignPersistentStoreToJMSServer(jmsServerName, filestoreName): cmo = wlst.cd('/Deployments/' + jmsServerName) cmo.setPersistentStore(wlst.getMBean('/FileStores/' + filestoreName))