modifydeptgroupviafile

Use the modifydeptgroupviafile command to modify an existing department by using an input file. You can add and remove members by specifying the member type (deptgroup, appgroup) and identifiers or by using a member type with a -tagkey and -tagvalue pair.

You can specify -tagkey and -tagvalue pairs, for a given resource type, in the following ways:
  • To select resources that match all of the specified tags, the -tagkey and -tagvalue parameters must be specified in this format:
    -tagkey udp1 udp2 -tagvalue value1 value2
    For example, to select the resources that have udp1 set to US and udp2 set to West specify:
    -tagkey udp1 udp2 -tagvalue US West
  • To select resources that match at least one of the specified tags, the -tagkey and -tagvalue parameters must be specified in this format:
    -tagkey udp1 -tagvalue value1 -tagkey udp2 -tagvalue value2
    For example, to select resources that have udp1 set to US or udp2 set to West specify:
    -tagkey udp1 -tagvalue US -tagkey udp2 -tagvalue West

Syntax


1  tpctool modifydeptgroupviafile  -user  user_name -pwd  password   -url  url  -inputfile inputfilename

Parameters and arguments

-user user_name
Specifies an IBM Spectrum Controlâ„¢ user ID.
-pwd password
Specifies the password for the IBM Spectrum Control user ID.
-url url
Specifies the Device server. The format of the URL is system:port_number, where system represents either the host name or IP address, and port_number represents the IBM Spectrum Control Device server port.
-inputfile inputfilename
Indicates the name of the input file that is used to parse the input file from the CLI program.
All the other parameters are specified directly in the input file. The input file specifies the department where the members are added or removed by using the -add or -remove parameters:
-id <deptgroupname> -add 
-id <deptgroupname> -remove 
Then, the input file specifies the type and identifiers of the members for the department.
The -memberid parameter can be separated by spaces or commas. For example:
-memberid /Department/5044 /Department/5045
-memberid /Department/5044,/Department/5045
-id DepartmentGroupID
Indicates the unique ID of the department where the member is added or removed. Use the lsdeptgroup command, to view a list of the departments that are known to IBM Spectrum Control.
-type deptgroup|appgroup
Specifies that the entities are a department or application. The -memberid parameter specifies the unique names of the departments or applications to be added or removed from the department, which is specified by the-id parameter. For example:
-type deptgroup -memberid /Department/5045, /Department/5046,
/Department/5047....
-type appgroup -memberid /Application/5050, /Application/5051,
/Application/5052....
When you are using the -tagkey and -tagvalue member pair:
-type deptgroup -tagkey <tag_key> -tagvalue <tag_value>
-memberid MemberID of the type
The unique ID of the member being added or removed. Use the lsdeptgroup command, to view a list of the departments that are known to IBM Spectrum Control. Use the lsappgroup command to view the list of applications.
You can specify one of the following types of ids for this parameter:
  • Department -memberid, for example, /Department/12345.
  • Application -memberid, for example, /Application/56789.
-tagkey udp1 or udp2 or udp3
Specifies the -tagkey parameter that is used to add or remove department members, with an input file.
-tagvalue tagvalue
Specifies the -tagvalue parameter that is used to add or remove department members, with an input file.
When you are using the -tagkey and -tagvalue member pair:
-type deptgroup -tagkey <tag_key> -tagvalue <tag_value>

Example: Modifying department members by using an input file

You can modify the department members according to the contents of the input file with the following command:
tpctool
tpctool> modifydeptgroupviafile -inputfile testModifyDeptGroup04.txt
tpctool>

If the command successfully completes, no message is displayed.

If some members are not found in the IBM Spectrum Control database, a warning message is displayed:

tpctool> modifydeptgroupviafile -inputfile testModifyDeptGroup04.txt
HWNDA0048W The following entities were not found: /Department/5041,
/Department/5044, /Department/7044,..
tpctool>

Example: Adding and removing members from a department by using an input file

If you want to add and remove members from the deptgroup1 department , specify two -deptgroupname stanzas, one with the -add parameter and the other with the -remove parameter, followed by any other parameters. For example:

-id /Department/5041 -add
-type deptgroup -memberid /Department/6000, /Department/6001, /Department/6002
-type appgroup -memberid /Application/7000, /Application/7001, /Application/7002
-remove
-type deptgroup -memberid /Department/6000, /Department/6001, /Department/6002

Example: Adding and removing members from multiple departments by using an input file

To include more than one department, use multiple -id stanzas followed by other parameters. The same parameter can be used again for each -id stanza. For example:

-id /Department/5041 -add
-type appgroup -memberid /Application/7004, /Application/7005, /Application/7006,
/Application/7007, /Application/7008, /Application/7009

-id /Department/5044 -remove
-type appgroup -memberid /Application/7004, /Application/7005, /Application/7006,
 /Application/7007, /Application/7008, /Application/7009

-id /Department/7044 -add
-type deptgroup -memberid /Department/6000, /Department/6001, /Department/6002,
/Department/6003, /Department/6004, /Department/6005

Example: Adding and removing members from an department by using an input file with tags

The following example adds department members that are specified by the -tagkey and -tagvalue parameter pairs. For example:
-id /Department/9003 -add
-type deptgroup -tagkey udp1 -tagvalue TPCDeptGroup
-type appgroup  -tagkey udp1 -tagvalue TPCAppGroup