TargetGroup using wsadmin.sh
We can use the Jython scripting language to configure target groups with the wsadmin tool. Use the commands in the TargetGroup command group to manage target groups. Create target groups to submit jobs from the job manager to one or many targets. Commands in the TargetGroup command group provide function that replaces deprecated commands in the ManagedNodeGroup command group.
Use the following commands to create and configure target groups:
- addMemberToTargetGroup
- createTargetGroup
- deleteMemberFromTargetGroup
- deleteTargetGroup
- getTargetGroupMembers
- getTargetGroupInfo
- queryTargetGroups
- modifyTargetGroupInfo
Add a target to an existing target group.
Target object: None.
Required parameters:
- -groupName
- Name of the target group of interest. (String, required)
- -targetNameList
- List of target names to add to the target group of interest. (String [ ], required)
Return value. The command does not return output.
Batch mode example usage
- Use Jython string:
AdminTask.addMemberToTargetGroup('-groupName myNewGroup -targetNameList "[target1 target2 target3]"')
- Use Jython list:
AdminTask.addMemberToTargetGroup(['-groupName', 'myNewGroup', '-targetNameList', '[target1 target2 target3]'])
Interactive mode example usage
- Use Jython:
AdminTask.addMemberToTargetGroup('-interactive')
Creates a new target group.
Target object
None.Required parameters:
- -groupName
- Name of the target group of interest. (String, required)
Optional parameters:
- -description
- Specifies a description of the target group. (String, optional)
Return value. The command does not return output.
Batch mode example usage
- Use Jython string:
AdminTask.createTargetGroup('-groupName myNewGroup')
- Use Jython list:
AdminTask.createTargetGroup(['-groupName', 'myNewGroup'])
Interactive mode example usage
- Use Jython:
AdminTask.createTargetGroup('-interactive')
Remove a target from a specific target group.
Target object: None.
Required parameters:
- -groupName
- Name of the target group of interest. (String, required)
- -targetNameList
- List of target Unique Uniform Identifiers (UUID) to delete from the target group of interest. (String [ ], required)
Return value. The command does not return output.
Batch mode example usage
- Use Jython string:
AdminTask.deleteMemberFromTargetGroup('-groupName myNewGroup -targetNameList "[dmgr1 dmgr2]"')
- Use Jython list:
AdminTask.deleteMemberFromTargetGroup(['-groupName', 'myNewGroup', '-targetNameList', '[target1 target2]'])
Interactive mode example usage
- Use Jython:
AdminTask.deleteMemberFromTargetGroup('-interactive')
Delete a target group from the configuration.
Target object: None.
Required parameters:
- -groupNameList
- List of target groups to delete. (String [ ], required)
Return value. The command does not return output.
Batch mode example usage
- Use Jython string:
AdminTask.deleteTargetGroup('-groupNameList "[target1 target2 target3]"')
- Use Jython list:
AdminTask.deleteTargetGroup(['-groupNameList', '[target1 target2 target3]'])
Interactive mode example usage
- Use Jython:
AdminTask.deleteTargetGroup('-interactive')
Display the targets that belong to a specific target group.
Target object: None.
Required parameters:
- -groupName
- Name of the target group of interest. (String, required)
Return value.
The command returns a list of target UUIDs that belong to the target group of interest.
Batch mode example usage
- Use Jython string:
AdminTask.getTargetGroupMembers('-groupName myNewGroup')
- Use Jython list:
AdminTask.getTargetGroupMembers(['-groupName', 'myNewGroup'])
Interactive mode example usage
- Use Jython:
AdminTask.getTargetGroupMembers('-interactive')
Display configuration information for the target group of interest.
Target object: None.
Required parameters:
- -groupName
- Name of one or more target groups of interest. (String [ ], required)
Return value.
The command returns a list of attributes for each target group. Each list of attributes displays the name, size, and description of the target group, and whether all group members have an administrative agent.
Batch mode example usage
- Use Jython string:
AdminTask.getTargetGroupInfo('-groupName "[target1 target2 target3]"')
- Use Jython list:
AdminTask.getTargetGroupInfo(['-groupName', '[target1 target2 target3]'])
Interactive mode example usage
- Use Jython:
AdminTask.getTargetGroupInfo('-interactive')
Display each target group in the configuration that meets specific query criteria.
Target object: None.
Required parameters:
- -maxReturn
- Maximum size of the target group data to display.
Optional parameters:
- -query
- Settings for which the command queries the target groups. We can query for size, description, groupName, and jobType. (String, optional)
- -validate
- Specifies whether to validate the query string. (Boolean, optional)
Return value.
The command returns a list of target group names.
Batch mode example usage
- Use Jython string:
AdminTask.queryTargetGroups('-maxReturn 10 -query "size=2" -validate true')
- Use Jython list:
AdminTask.queryTargetGroups(['-maxReturn', '10', '-query', 'size=2', '-validate', 'true'])
Interactive mode example usage
- Use Jython:
AdminTask.queryTargetGroups('-interactive')
Modify the description for a target group.
Target object: None.
Required parameters:
- -groupName
- Name of the target group of interest. (String, required)
- -description
- Name description for the target group of interest. (String, required)
Return value. The command does not return output.
Batch mode example usage
- Use Jython string:
AdminTask.modifyTargetGroupInfo('-groupName myNewGroup -description "New description of myNewGroup"')
- Use Jython list:
AdminTask.modifyTargetGroupInfo(['-groupName', 'myNewGroup', '-description', 'New description of myNewGroup'])
Interactive mode example usage
- Use Jython:
AdminTask.modifyTargetGroupInfo('-interactive')
Registering nodes with the job manager using commands Grouping nodes Running administrative jobs Running administrative jobs across multiple nodes Scheduling future administrative jobs Manage administrative jobs ManagedNodeGroup using wsadmin.sh (deprecated) AdministrativeJobs . JobManagerNode . ManagedNodeAgent .