Previous Topic: listSWG—List Products of Software GroupNext Topic: removeGroupFromSWG—Remove Group from Software Group


Example

Consider a software group swg_1. Before modifying, the group, the structure of the group, and the contents should be listed. This action is done using the following commands:

cadsmcmd swlibrary action=listSWG name=swg_1
CA IT Client Manager r12
ITCM Command Line Version 12.8.0.xxxx
Copyright (c) 2014 CA. All rights reserved.
Trace mode: FILE
Trace file name: C:\ProgramFiles\CA\DSM\SD\..\logs\cadsmcmd.log
Connecting to manager "<default manager>" as user "<default user>" ...OK.
Manager:mymanager
Domain:mydomain
Domain type:Domain
Supporting: CO CCNF USD OSIM AM
-------------------------------------------------------------------------------
List members of software group "swg_1" 
-------------------------------------------------------------------------------
tstbase 1.0 <Generic>, <Regular>, 22622(0), CA, http://supportconnect.ca.com/
tstkpk01 1.0 <Generic>, <Regular>, 22752(0), CA, http://supportconnect.ca.com/
tstkpk02 1.0 <Generic>, <Regular>, 22832(0), CA, http://supportconnect.ca.com/
tstkpk03 1.0 <Generic>, <Regular>, 22962(0), CA, http://supportconnect.ca.com/
pg_1 <Procedure group>
SDCMD<A000000>: OK

cadsmcmd swlibrary action=listPG name=pg_1
CA IT Client Manager r12
ITCM Command Line Version 12.8.0.xxxx
Copyright (c) 2014 CA. All rights reserved.

Connecting to manager "kkkkk01b" as user "<default user>" ...OK.

-------------------------------------------------------------------------------
List members of procedure group "pg_1" 
-------------------------------------------------------------------------------
inst (tstbase 1.0 <1>)
inst (tstkpk03 1.0 <2>)
SDCMD<A000000>: OK

The entry of tstkpk03 is obsolete and should be removed. To perform this action, use the following command:

cadsmcmd swlibrary action=removeItemFromSWG name=swg_1 item=tstkpk03 version=1.0

The removal does not mean that the item tstkpk03 is deleted from the software library. It is still available at "All Software" and at all other groups where it has been assigned. It is just removed from the group swg_1.

If, besides tstkpk03, the entry tstbase should also be removed, then the following command lets you remove both entries by one call:

cadsmcmd swlibrary action=removeItemFromSWG name=swg_1 itemList=(tstbase/1.0) itemList=("tstkpk03" /"1.0")

Now consider a product named "DMS Editor" of Version 6.01.0000 that should be added to the group. The following command performs the assignment:

cadsmcmd swlibrary action=addItemToSWG name=swg_1 item="DMS Editor" version=6.01.0000

If another product should be added (for example, "DMS Interpreter" of Version 6.01.0000), this action can be done by the following command in one call:

cadsmcmd swlibrary action=addItemToSWG name=swg_1 itemList=("DMS Editor" /6.01.0000) itemList=("DMS Interpreter" /6.01.0000) 

The group now has the following contents:

cadsmcmd swlibrary action=listSWG name=swg_1
CA IT Client Manager r12
ITCM Command Line Version 12.8.0.xxxx
Copyright (c) 2014 CA. All rights reserved.
Connecting to manager "kkkkk01b" as user "<default user>" ...OK.
-------------------------------------------------------------------------------
List members of software group "swg_1" 
-------------------------------------------------------------------------------
tstbase 1.0 <Generic>, <Regular>, 22622(0), CA, http://supportconnect.ca.com/
tstkpk01 1.0 <Generic>, <Regular>, 22752(0), CA, http://supportconnect.ca.com/
tstkpk02 1.0 <Generic>, <Regular>, 22832(0), CA, http://supportconnect.ca.com/
DMS Editor 6.01.0000 <MSI>, <Regular>, 22972(0), CA http://supportconnect.ca.com/
pg_1 <Procedure group>
SDCMD<A000000>: OK
cadsmcmd swlibrary action=listPG name=pg_1
CA IT Client Manager r12
ITCM Command Line Version 12.8.0.xxxx
Copyright (c) 2014 CA. All rights reserved.
Connecting to manager "kkkkk01b" as user "<default user>" ...OK.
-------------------------------------------------------------------------------
List members of procedure group "pg_1" 
-------------------------------------------------------------------------------
inst (tstbase 1.0 <1>)
inst (tstkpk03 1.0 <2>)
SDCMD<A000000>: OK

Consider the following situation:

cadsmcmd swlibrary action=listGroups recursive
CA IT Client Manager r12
ITCM Command Line Version 12.8.0.xxxx
Copyright (c) 2014 CA. All rights reserved.
Connecting to manager "kkkkk01b" as user "<default user>" ...OK.
-------------------------------------------------------------------------------
List of groups in the software library
-------------------------------------------------------------------------------
Software Groups
..Group name...........................: Catalog
....Comment............................: CA-Software Delivery Reserved Group
....Creation date......................: 2003-04-09 11:26
....Change date........................: 2003-04-09 11:26
..Group name...........................: Software Delivery
....Comment............................: CA-Software Delivery Reserved Group
....Creation date......................: 2003-04-09 11:26
....Change date........................: 2003-04-09 11:27
..Group name...........................: swg_1
....Comment............................:
....Creation date......................: 2003-04-10 08:51
....Change date........................: 2003-04-10 10:33
....Procedure Groups
......Group name.......................: pg_1
........Comment........................:
........Creation date..................: 2003-04-10 09:11
........Change date....................: 2003-04-10 10:13
..Group name...........................: swg_2
....Comment............................:
....Creation date......................: 2003-04-10 09:28
....Change date........................: 2003-04-10 09:28
....Software Groups
......Group name.......................: swg_2.1
........Comment........................: 4 test only
........Creation date..................: 2003-04-10 09:28
........Change date....................: 2003-04-10 09:57
..Group name...........................: swg_2.1
....Comment............................: 4 test only
....Creation date......................: 2003-04-10 09:28
....Change date........................: 2003-04-10 09:57
Procedure Groups
..Group name...........................: pg_2
....Comment............................:
....Creation date......................: 2003-04-10 09:29
....Change date........................: 2003-04-10 09:29
SDCMD<A000000>: OK

The software group swg_2.1 should be removed as a subgroup from group swg_2, and pg_2 should be added as a new subgroup of swg_2. The following commands rearrange the hierarchy:

cadsmcmd swlibrary action=removeGroupFromSWG name=swg_2 subgroup=swg_2.1
cadsmcmd swlibrary action=addGroupToSWG name=swg_2 subgroup=pg_2

Now the hierarchy is as follows:

cadsmcmd swlibrary action=listGroups recursive
CA IT Client Manager r12
ITCM Command Line Version 12.8.0.xxxx
Copyright (c) 2014 CA. All rights reserved.
Connecting to manager "kkkkk01b" as user "<default user>" ...OK.
-------------------------------------------------------------------------------
List of groups in the software library
-------------------------------------------------------------------------------
Software Groups
..Group name...........................: Catalog
....Comment............................: CA-Software Delivery Reserved Group
....Creation date......................: 2003-04-09 11:26
....Change date........................: 2003-04-09 11:26
..Group name...........................: Software Delivery
....Comment............................: CA-Software Delivery Reserved Group
....Creation date......................: 2003-04-09 11:26
....Change date........................: 2003-04-09 11:27
..Group name...........................: swg_1
....Comment............................:
....Creation date......................: 2003-04-10 08:51
....Change date........................: 2003-04-10 10:58
....Procedure Groups
......Group name.......................: pg_1
........Comment........................:
........Creation date..................: 2003-04-10 09:11
........Change date....................: 2003-04-10 10:13
..Group name...........................: swg_2
....Comment............................:
....Creation date......................: 2003-04-10 09:28
....Change date........................: 2003-04-10 11:11
....Procedure Groups
......Group name.......................: pg_2
........Comment........................:
........Creation date..................: 2003-04-10 09:29
........Change date....................: 2003-04-10 09:29
..Group name...........................: swg_2.1
....Comment............................: 4 test only
....Creation date......................: 2003-04-10 09:28
....Change date........................: 2003-04-10 09:57
Procedure Groups
..Group name...........................: pg_2
....Comment............................:
....Creation date......................: 2003-04-10 09:29
....Change date........................: 2003-04-10 09:29
SDCMD<A000000>: OK

If swg_2.1 is not assigned somewhere outside swg_2 (in other words, swg_2 is its only supergroup), the command to remove this subgroup from swg_2 fails with an error A001563.