Previous Topic: assignGroupToTarget—Assign Group to TargetNext Topic: createGroup—Create Group


Example

The attributes specified with the command serve as defaults for all jobs to be generated. While for a procedure group it is clear which procedure to run for software groups, this is open. As default for the software group products, the command selects the default install routine of the products for the jobs. All these defaults can be overwritten by additional specifications in the "procedures" file.

Assume a "procedures" file is specified. For each entry of a procedure group it will be checked whether the procedure and product also occurs in the specified "procedures" file or not. If not the commands defaults will be used to generate the job, otherwise the specifications of the first matching "procedures" file entry overwrite the defaults and these modified attributes are used to generate the job. The jobs will be generated in the order the procedures are sorted in the group.

For example, assume a domain manager, the following procedure group and a command as follows:

pg:
........Procedure:........configure_001
................Product........test_001
................Version........1.0
........Procedure:........activate_002
................Product........test_002
................Version........1.1

cadsmcmd swlibrary action=assignGroupToTarget name=pg computer=tar01 after=exacttime prompUser allowCancel Parameters="-xon xf -rs" procedures=c:\temp\procFile.txt

Assume further that c:\temp\procFile.txt has the following contents:

Item=test_002 version=1.1 procedure=activate_002 task=activate after=boottime allowCancel=n GlobalTime=y Parameters="" 

Two jobs will be generated. The first one is for the configure_001 and the attributes of the command are used as defaults, in other words, after=exacttime, promptUser, cancelAllow, and Parameters="-xon xf -rs" . The second job generated is for activate_002, and in this case the defaults from the command are used too, but some of them are overwritten by the related "procedures" file entry. This results in a job with the attributes after=boottime, promptUser, and GlobalTime while allowCancel is not set and Parameters is empty.

In case of a software group, it is only checked if the product matches an entry in the "procedures" file. The first entry found is used. The specified procedure of the matching entry and the specified parameters overwrite the defaults and these modified attributes are used to generate the job.

For example, assume a domain manager, the following software group and a command as follows:

swg:
........Product:........test_011
................Version........2.1
................Default installation procedure........inst_011
........Product:........test_012
................Version........2.2
................Default installation procedure........inst_012

cadsmcmd swlibrary action=assignGroupToTarget name=swg computer=tar01 after=exacttime prompUser allowCancel Parameters="-xon xf -rs" preaction=logoff procedures=c:\temp\procFile.txt

Assume further that c:\temp\procFile.txt has the following contents:

Item=test_012 version=2.2 procedure=activate_012 task=activate after=boottime allowCancel=n GlobalTime=y Parameters="-cleanUp" 
Item=test_011 version=2.0 procedure=activate_011 task=activate allowCancel=n GlobalTime=y Parameters="-format" 

Two jobs will be generated. The first one is for the product test_011 of Version 2.1 and its an installation job using the default procedure inst_011. The job is generated with the command defaults only, because there is no matching entry in the "procedures" file, although the product test_011 is refered to in the file but of a different version. Therefore the job is generated with the attributes after=exacttime, promptUser, allowCancel, and Parameters="-xon xf -rs" .

The second job is generated for the product test_012 of Version 2.2. This time there is a matching entry in the "procedures" file, therefore the defaults given by the command where updated by those of the entry, and the job created is for the activation procedure activate_012 with attributes after=boottime, promptUser, GlobalTime, preaction=logoff, and Parameters="-cleanUp," while allowCancel is not set.

A software group may have a hierarchical structure, in other words, it contains other software or procedure groups. The command works recursively, in other words, it also evaluates the subgroups and generates jobs for their entries. Using hierarchical group structures the user should take into account that the products and procedures are unique in this hierarchy. For example, consider the following structure:

swg: (software group)
........Product:........test_001
................Version........2.1
................Default installation procedure........inst_001
........Product:........test_022
................Version........1.1/00
................Default installation procedure........inst_022
swg_1: (software group)
........Product........test_010
................Version........1.0
................Default installation procedure........inst_010
........Product:........test_001
................Version........2.1
................Default installation procedure........inst_001
pg_11: (procedure group)
........Procedure:........configure_001
................Product........test_001
................Version........2.1
........Procedure:........activate_022
................Product........test_022
................Version........1.1/00
pg_1: (procedure group)
........Procedure:........configure_022
................Product........test_022
................Version........1.1/00
........Procedure:........activate_022
................Product........test_022
................Version........1.1/00

Invoking the command for this group will cause some warnings and some products and procedures will be ignored. This holds for the product test_001 of Version 2.1 in swg_1 because it already appears at level swg as well as for the procedure activate_022 of product test_022 of Version 1.1/00 in pg_11, because it already appears at pg_1. If a "procedures" file is coded with the command the procedure groups are checked for matching entries first. After they are all completed the software groups of the hierarchy are checked against the remaining entries of the "procedure" files, in other words, against those entries not already used within procedure groups.

For example, consider the swg structure previously shown and the following command on a domain manager:

cadsmcmd swlibrary action=assignGroupToTarget name=swg computer=tar01 after=exacttime promptUser allowCancel Parameters="-xon xf -rs" procedures=c:\temp\procFile.txt

Assume further that c:\temp\procFile.txt has the following contents:

Item=test_001 version=2.1 procedure=configure_001 task=configure allowCancel=n Parameters="-init" preaction=reboot
Item=test_001 version=2.1 procedure=install_min task=install allowCancel=n Parameters="-x -y -z" preaction=logoff postaction=reboot
Item=test_022 version=1.1/00 procedure=configure_022 task=configure preaction=logoff Repeat noCalendar
Item=test_022 version=1.1/00 procedure=activate_022 task=activate preaction=logoff Repeat noCalendar

This will generate the subsequent jobs with the listed attributes:

test_001 2.1: install_min
task=install
after=exacttime
promptUser
Parameters="-x -y -z" 
preaction=log0ff
postaction=reboot
test_022 1.0/00:inst_002
task=install
after=exacttime
promptUser
allowCancel
Parameters="-xon xf -rs" 
test_022 1.0/00:configure_022 
task=configure
after=exacttime
preaction=logoff
promptUser
allowCancel
Repeat
noCalendar
Parameters="-xon xf -rs" 
test_022 1.0/00:activate_022 
task=activate
after=exacttime
preaction=logoff
promptUser
allowCancel
Repeat
noCalendar
Parameters="-xon xf -rs" 
test_010 1.0:inst_010
task=install
after=exacttime
promptUser
allowCancel
Parameters="-xon xf -rs" 
test_001 1.0/00:configure_001
task=configure
after=exacttime
promptUser
Parameters="-init" 
preaction=reboot

It will test_001 of version 2.1 in swg_1 as well as activate_022 of test_022 and version 1.1/00 in pg_11 will be ignored.

The entries of the procedures file have the following format:

item=item 
version=version 
procedure=procedure task={install|configure|activate|uninstall}
[deliverytime="YYYY-MM-DD hh:mm" ] 
[attime="YYYY-MM-DD hh:mm" ]
[after={exacttime|boottime}] [calendarname=deliverycalendar]
[preaction={none|reboot|logoff}]
[postaction={none|reboot|logoff|rebootAtEnd|logoffAtEnd}]
[promptUser={y|n}] 
[allowCancel={y|n}] 
[execTimedOut={y|n}] 
[prompt=days.hours]
[offline={y|n}] 
[RunAtShutdown={y|n}] 
[PreventLogon={y|n}] 
[GlobalTime={y|n}] 
[nocalendar={y|n}]
[ResolveQuery={y|n}] 
[Parameters=userparameter]
[repeat={y|n}] 
[stagingserver={y|n}]
[JobTimeout=d.h]

item

Name of the group item this entry is related to.

version

Version for the group item this entry is related to.

procedure

Specifies the item procedure to be performed.

task

Specifies the procedure type. The following types are valid:

install

The procedure installs the item.

configure

The procedure configures the item.

activate

The procedure activates the item.

uninstall

The procedure uninstalls the item.

If the parameter is not coded, install is assumed.

The item, version, procedure, and task parameters have to be coded at each line as the first parameters, and they have to be coded in the order as in the syntax definition previously shown. The remaining parameters can be coded in any order.

The other parameters' meanings correspond to the command parameters previously shown. If a y is coded, then the parameter will be set; otherwise, it will not be set. For parameters not set, the default is taken from each command's parameter setting.

Consider a software group swg_1 that should be distributed to the targets given by the group q_grp. The swg_1 shows the following contents and structure:

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: Off

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 procedure group "swg_1" 
-------------------------------------------------------------------------------
InstallActivateConfigureUninstall 1 <Generic>, <Regular>, 3(0), schbe05, 
Pass the exitcode that should be returned as a user parameter.
TransferComplexDirectoryStructure 1 <Generic>, <Regular>, 329(0), QA Mch schir03, 
SD Package with complex directory structure.

SDCMD<A000000>: OK

Suppose the requirements for the job container to be used are as follows:

The defaults for all jobs to be generated are:

The individual requirements for jobs and items are as follows:

To distribute and run the associated jobs, the command assignGroupToTarget is used. Due to the individual requirements for some jobs, a procedure file is needed to describe those individual requirements. This procedure file has the following contents:

item=tstbase version=1.0 procedure=remdir task=configure postaction=reboot
item=tstbase version=1.0 procedure=setdir task=configure postaction=reboot
item=tstbase version=1.0 procedure=inst task=install preaction=logoff preventLogon

The following command will create a job container of default name, populate it with jobs required and schedule it for execution:

cadsmcmd swlibrary action=assignGroupToTarget name=swg_1 compgrp=q_grp transaction rollback deliveryTime="2005-06-30 13:00" atTime="2005-07-05 01:00" after=exacttime resolveQuery procedures=c:\temp\proc.usd
CA IT Client Manager r12
ITCM Command Line Version 12.8.0.xxxx
Copyright (c) 2014 CA. All rights reserved.

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

A container with the name q_grp [04/11/02 10:44:10.093] was created.
Evaluate group swg_1
Evaluate group swg_1/pg_1
Evaluate procedures file c:\temp\proc.usd
Generate job "tstbase 1.0:inst" : OK.
Generate job "DMS Editor 6.01.0000:Local Install" : OK.
Generate job "tstbase 1.0:remdir" : OK.
Generate job "tstbase 1.0:setdir" : OK.
Generate job "tstkpk01 1.0:inst" : OK.

SDCMD<A000000>: OK

The following command shows the job container generated:

cadsmcmd jobContainer action=showAttr name="q_grp [04/11/02 10:44:10.093]" 
CA IT Client Manager r12
ITCM Command Line Version 12.8.0.xxxx
Copyright (c) 2014 CA. All rights reserved.

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

-------------------------------------------------------------------------------
Show attributes of the job container "q_grp [04/11/02 10:44:10.093]" 
-------------------------------------------------------------------------------
Job container name.....................: q_grp [04/11/02 10:44:10.093]
Job container properties...............: 28
.........................................Transaction
.........................................Rollback previous jobs on failure
.........................................Cascade install
Sealed.................................: Yes
Created at.............................: 2005-04-11 10:45
Changed at.............................: 2005-04-11 10:45
Number of contained objects............: 5
Job container state....................: waiting
.........................................3 - jobs waiting
.........................................0 - jobs active
.........................................2 - jobs ok
.........................................0 - jobs failed

Job name...............................: tstbase 1.0:inst
..Overall state........................: WAITING
.........................................2 - job targets waiting
.........................................0 - job targets active
.........................................0 - job targets ok
.........................................0 - job targets failed
..Job order number.....................: 0
..Created at...........................: 2005-06-30 13:00
..Activate at..........................: 2005-07-05 01:00
..Status message.......................: OK
..Target...............................: KKKKK01B
....Task...............................: install
....Job state..........................: WAITING
....Task...............................: install
....Started at.........................: 2005-07-05 01:00
....Completed at.......................: 2005-04-11 10:45
....Created at.........................: 2005-04-11 10:45
....Data sent in per cent..............:
....Status message.....................: OK
....Ordered by.........................: KKKKK01
....Type...............................: mandatory
....Comment............................:
..Target...............................: KKKKK01C
....Task...............................: install
....Job state..........................: WAITING
....Task...............................: install
....Started at.........................: 2005-07-05 01:00
....Completed at.......................: 2005-04-11 10:45
....Created at.........................: 2005-04-11 10:45
....Data sent in per cent..............:
....Status message.....................: OK
....Ordered by.........................: KKKKK01
....Type...............................: mandatory
....Comment............................:

Job name...............................: DMS Editor 6.01.0000:Local Install
..Overall state........................: WAITING
.........................................2 - job targets waiting
.........................................0 - job targets active
.........................................0 - job targets ok
.........................................0 - job targets failed
..Job order number.....................: 1
..Created at...........................: 2005-06-30 13:00
..Activate at..........................: 2005-07-05 01:00
..Status message.......................: OK
..Target...............................: KKKKK01B
....Task...............................: install
....Job state..........................: WAITING
....Task...............................: install
....Started at.........................: 2005-07-05 01:00
....Completed at.......................: 2005-04-11 10:45
....Created at.........................: 2005-04-11 10:45
....Data sent in per cent..............:
....Status message.....................: OK
....Ordered by.........................: KKKKK01
....Type...............................: mandatory
....Comment............................:
..Target...............................: KKKKK01C
....Task...............................: install
....Job state..........................: WAITING
....Task...............................: install
....Started at.........................: 2005-07-05 01:00
....Completed at.......................: 2005-04-11 10:45
....Created at.........................: 2005-04-11 10:45
....Data sent in per cent..............:
....Status message.....................: OK
....Ordered by.........................: KKKKK01
....Type...............................: mandatory
....Comment............................:

Job name...............................: tstbase 1.0:remdir
..Overall state........................: unknown (9)
.........................................0 - job targets waiting
.........................................0 - job targets active
.........................................0 - job targets ok
.........................................0 - job targets failed
..Job order number.....................: 2
..Created at...........................: 2005-06-30 13:00
..Activate at..........................: 2005-07-05 01:00
..Status message.......................: Job setup warning. No target instal
.........................................+ lations found in evaluation step.

Job name...............................: tstbase 1.0:setdir
..Overall state........................: unknown (9)
.........................................0 - job targets waiting
.........................................0 - job targets active
.........................................0 - job targets ok
.........................................0 - job targets failed
..Job order number.....................: 3
..Created at...........................: 2005-06-30 13:00
..Activate at..........................: 2005-07-05 01:00
..Status message.......................: Job setup warning. No target instal
.........................................+ lations found in evaluation step.

Job name...............................: tstkpk01 1.0:inst
..Overall state........................: WAITING
.........................................2 - job targets waiting
.........................................0 - job targets active
.........................................0 - job targets ok
.........................................0 - job targets failed
..Job order number.....................: 4
..Created at...........................: 2005-06-30 13:00
..Activate at..........................: 2005-07-05 01:00
..Status message.......................: OK
..Target...............................: KKKKK01B
....Task...............................: install
....Job state..........................: WAITING
....Task...............................: install
....Started at.........................: 2005-07-05 01:00
....Completed at.......................: 2005-04-11 10:45
....Created at.........................: 2005-04-11 10:45
....Data sent in per cent..............:
....Status message.....................: OK
....Ordered by.........................: KKKKK01
....Type...............................: mandatory
....Comment............................:
..Target...............................: KKKKK01C
....Task...............................: install
....Job state..........................: WAITING
....Task...............................: install
....Started at.........................: 2005-07-05 01:00
....Completed at.......................: 2005-04-11 10:45
....Created at.........................: 2005-04-11 10:45
....Data sent in per cent..............:
....Status message.....................: OK
....Ordered by.........................: KKKKK01
....Type...............................: mandatory
....Comment............................:


SDCMD<A000000>: OK

The following command allows you to see the attributes of a special job of this container:

cadsmcmd jobContainer action=showAttrJobs name=" q_grp [04/11/02 10:44:10.093]"jobName=" tstbase 1.0:inst" 
CA IT Client Manager r12
ITCM Command Line Version 12.8.0.xxxx
Copyright (c) 2014 CA. All rights reserved.

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

-------------------------------------------------------------------------------
List of attributes of job "q_grp [04/11/02 10:44:10.093]" from container "tstbase 1.0:inst" 
-------------------------------------------------------------------------------
Job name...............................: tstbase 1.0:inst
Software...............................: tstbase 1.0
Procedure..............................: inst
Deliver at.............................: 2005-06-30 13:00
Activate at............................: 2005-07-05 01:00
Status message.........................: OK
Overall state..........................: WAITING
.........................................2 - job targets waiting
.........................................0 - job targets active
.........................................0 - job targets ok
.........................................0 - job targets failed
Job task...............................: install
Pre action..............................: logoff user
Post action.............................: no action
Prompt user............................: No
Characteristic flags...................:
.........................................prevent user logon during job execution
.........................................local time/exact
.........................................calendar controlled
.........................................resolve query groups
Delivery calendar......................:
User parameters........................:
Prompt during..........................: 1 Days, 0 Hours
Job timeout............................: 7 Days, 0 Hours

SDCMD<A000000>: OK