Network Deployment (Distributed operating systems), v8.0 > Scripting the application serving environment (wsadmin) > Use properties files to manage system configuration > Manage environment configurations with properties files using wsadmin.sh


Create server, cluster, application, or authorization group objects using properties files and wsadmin scripting

Use this topic to create new server, cluster, application, or authorization group objects for the configuration.

Use the PropertiesBasedConfiguration command group for the AdminTask object, you can use properties files to create configuration objects in the environment. We 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.


Procedure

  1. Start wsadmin.sh.

  2. Create a properties file template.

    Create a properties file template to use to create the new server, cluster, application, or authorization group object. Use the -configType parameter and the following guidelines to specify the type of template to create:

    • Specify Server to create a server type properties file template.

    • Specify ServerCluster to create a server cluster type properties file template.

    • Specify Application to create an application type properties file template.

    • Specify AuthorizationGroup to create an authorization group type properties file template.

    The following Jython example uses the createPropertiesFileTemplates command to create a new AuthorizationGroup object template:

    AdminTask.createPropertiesFileTemplates('[-propertiesFileName authorizationGroup.template
       -configType AuthorizationGroup]')
    

    The command generates a template file similar to the following sample template:

    #
    # Create parameters # Replace the line `SKIP=true` with 'SKIP=false' under each section that is needed
    # Set necessary parameters under each command or step sections
    # Invoke applyConfigProperties command using this properties file.
    #
    ResourceType=AuthorizationGroup
    ImplementingResourceType=AuthorizationGroup
    ResourceId=AuthorizationGroup=
    SKIP=true
    CreateDeleteCommandProperties=true
    #
    
    #
    #Properties
    #
    authorizationGroupName=authorizationGroupName #String,required
    commandName=createAuthorizationGroup
    
    
  3. Modify the new template file.

    Modify the new AuthorizationGroup template file by setting the required parameters. We can also modify the optional parameters, but modify the required parameters. Change the SKIP required property value from SKIP=true to SKIP=false to indicate that the system should apply the properties in the specific section of the properties file to the configuration.

    To ignore a specific section of a properties file, set the SKIP property to SKIP=true.

    #
    # Create parameters # Replace the line `SKIP=true` with 'SKIP=false' under each section that is needed
    # Set necessary parameters under each command or step sections
    # Invoke applyConfigProperties command using this properties file.
    #
    ResourceType=AuthorizationGroup
    ImplementingResourceType=AuthorizationGroup
    ResourceId=AuthorizationGroup=
    SKIP=false
    CreateDeleteCommandProperties=true
    #
    
    #
    #Properties
    #
    authorizationGroupName=ag1 #String,required
    commandName=createAuthorizationGroup
    
    
  4. Apply the modified properties to the configuration.

    Use applyConfigProperties to apply the properties file to the configuration, as the following Jython example demonstrates:

    AdminTask.applyConfigProperties('[-propertiesFileName authorizationGroup.template]')
    

    The command creates the ag1 authorization group in the configuration.

  5. Save the configuration changes.

    Save the configuration changes:

    AdminConfig.save()
    


Extract properties files using wsadmin.sh
Apply properties files using wsadmin.sh
Validate properties files using wsadmin.sh
Delete server, cluster, application, or authorization group objects using properties files
Create and delete configuration objects using properties files and wsadmin scripting
Manage environment configurations with properties files using wsadmin.sh
Extract properties files to troubleshoot the environment using wsadmin.sh
Manage servers and nodes with scripting


Related


PropertiesBasedConfiguration command group using wsadmin.sh

+

Search Tips   |   Advanced Search