Creating and deleting configuration objects using properties files and wsadmin scripting

Use this topic to use an extracted properties file to create or delete configuration objects that are not server, cluster, application, or authorization group object types.

About this task

Using the PropertiesBasedConfiguration command group for the AdminTask object, you can use properties files to create and delete configuration objects from your environment.

문제점 방지 문제점 방지: You cannot apply a z/OS® operating system properties file directly to a distributed operating system. Similarly, you cannot apply a distributed operating system properties file directly to a z/OS operating system. gotcha

Procedure

  1. wsadmin 스크립트 도구를 시작하십시오.
  2. Extract a properties file for the subtype of interest from your configuration.
    Use the extractConfigProperties command to extract the properties file for the resource of interest. The following example extracts the properties for the ThreadPool resource:
    AdminTask.extractConfigProperties('[-propertiesFileName threadPool.props -configData 
     Server=server1 -filterMechanism SELECTED_SUBTYPES -selectedSubTypes [ThreadPool]]')
    The command generates a template file similar to the following sample template:
    # # SubSection 1.0.1.4 # Thread pools # ResourceType=ThreadPool 
     ImplementingResourceType=Server ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:Thr 
     eadPoolManager=ID#ThreadPoolManager_1:ThreadPool=ID#builtin_ThreadPool_4 #  # #Properties #
    	maximumSize=20 #integer name=Default inactivityTimeout=5000 #integer minimumSize=5
    #integer isGrowable=false #boolean 
  3. Create or delete configuration objects.

    To create a new thread pool or delete the existing thread pool, modify the ResourceId attribute.

    • To create a new thread pool, set the ResourceId attribute to a value that does not exist in your configuration. In the following example, note that the ThreadPool=ID#builtin_ThreadPool_4 ResourceId is replaced with the ThreadPool=ID#ThreadPool_99999 ResourceId, which does not exist in the configuration:
       # # SubSection 1.0.1.4 # Thread pools # ResourceType=ThreadPool 
       ImplementingResourceType=Server ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:Thr 
       eadPoolManager=ID#ThreadPoolManager_1:ThreadPool=ID#ThreadPool_99999 #  # #Properties # maximumSize=20 
       #integer name=myThreadPool inactivityTimeout=5000 #integer minimumSize=5 #integer isGrowable=false #Boolean 
      Run the applyConfigProperties command to apply the properties file to your configuration, as the following command demonstrates:
      AdminTask.applyConfigProperties('[-propertiesFileName threadPool.props]')
      The command automatically validates the properties file, then uses the modified values in the file to create a new thread pool in your configuration.
    • To delete the thread pool, specify the DELETE=true property in the header of the properties file, as the following example demonstrates:
      # # SubSection 1.0.1.4 # Thread pools # ResourceType=ThreadPool 
       ImplementingResourceType=Server ResourceId=Cell=!{cellName}:Node=!{nodeName}:Server=!{serverName}:Thr 
       eadPoolManager=ID#ThreadPoolManager_1:ThreadPool=myThreadPool DELETE=true #  # #Properties # maximumSize=20 
      #integer  name=myThreadPool inactivityTimeout=5000 #integer minimumSize=5 #integer isGrowable=false #boolean 
      Run the deleteConfigProperties command to use the properties file to remove the thread pool from your configuration, as the following command demonstrates:
      AdminTask.deleteConfigProperties('[-propertiesFileName threadPool.props]')
      The command automatically validates the properties file, then uses the new attribute and value in the file to remove the thread pool from your configuration.
      문제점 방지 문제점 방지: If you run the deleteConfigProperties command before you add the DELETE=true attribute and value to the properties file, the command resets each property to the default value. The system completely removes properties that do not have default values.gotcha
  4. Save the configuration changes.
    다음 명령 예제를 사용하여 구성 변경사항을 저장하십시오.
    AdminConfig.save()

주제 유형을 표시하는 아이콘 태스크 주제



시간소인 아이콘 마지막 업데이트 날짜: July 9, 2016 6:14
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=txml_7modobjects
파일 이름:txml_7modobjects.html