EPM Inner Circle - EMEA - DACH Group

 View Only
  • 1.  Create a Client Job using the SDK or Workflow?

    Posted Oct 14, 2019 04:59 AM
     

    Does anyone have any information on creating a Client Job using the SDK or Workflow?

    I have found out how to create tasks and how to schedule Jobs/Tasks.

     

    Thanks

    Matthias



  • 2.  RE: Create a Client Job using the SDK or Workflow?
    Best Answer

    Posted Oct 14, 2019 06:17 AM


  • 3.  RE: Create a Client Job using the SDK or Workflow?

    Posted Oct 15, 2019 05:37 AM

    Hi Alex,

     

    I found that too, but besides the the title it only is about tasks.

    When exporting a Job as xml, there is for every node another guid.

    I want to build jobs from scratch, so i have to get these from somewhere. I am fiddeling around with a guid generator to build these, but what happens if I accidently generate a guid that is already in the SMP. These node guids in the jobs are no where to find in the Database, and therefore I could not check for duplicates.

     

    - <version guid="dcffcd18-f6eb-4aeb-b3bf-c10e43dce6c4" number="2">
      <modifiedBy>DEMO\servicealtiris</modifiedBy>
      <modifiedDate>637063104408870000</modifiedDate>
      <name>New Client Job 3</name>
      <description />
    - <state>
    - <vItem>
      <baseClientTask />
    - <remoteExecAdvanced>
      <priority value="Normal" compatibility="Exclusive" />
      <preventComputerFromSleeping value="False" />
      <kill enforce="True" maxMinutes="90" />
      <interruptable value="DEFAULT" />
      <platform configuredProviderGuid="00000000-0000-0000-0000-000000000000" />
      </remoteExecAdvanced>
    - <jobScript>
    - <node guid="93aa48b2-ccfa-4dd2-a08b-b293b933431d" designerType="Altiris.TaskManagement.ClientTask.Jobs.ClientJobNode, Altiris.TaskManagement, Version=8.0.0.0, Culture=neutral, PublicKeyToken=99b1e4cc0d03f223" execType="Altiris.ClientTask.Server.Jobs.ClientJobExecRoot, Altiris.ClientTask.Server, Version=8.0.0.0, Culture=neutral, PublicKeyToken=99b1e4cc0d03f223">
      <subNodes />
      <inputMap />
      </node>
      </jobScript>
      <failIfAnyTaskFails>False</failIfAnyTaskFails>
      </vItem>
      </state>
      </version>
    - <version guid="3413d602-490a-47df-88fe-7d3308133963" number="3">
      <modifiedBy>DEMO\servicealtiris</modifiedBy>
      <modifiedDate>637066389394100000</modifiedDate>
      <name>New Client Job 3</name>
      <description />
    - <state>
    - <vItem>
    - <requiredPermissions>
      <permission guid="7a8ca359-02fe-465c-9bd5-66cb373d3950" />
      </requiredPermissions>
      <baseClientTask />
    - <remoteExecAdvanced>
      <priority value="Normal" compatibility="Exclusive" />
      <preventComputerFromSleeping value="False" />
      <kill enforce="True" maxMinutes="90" />
      <interruptable value="DEFAULT" />
      <platform configuredProviderGuid="00000000-0000-0000-0000-000000000000" />
      </remoteExecAdvanced>
    - <jobScript>
    - <node guid="93aa48b2-ccfa-4dd2-a08b-b293b933431d" designerType="Altiris.TaskManagement.ClientTask.Jobs.ClientJobNode, Altiris.TaskManagement, Version=8.0.0.0, Culture=neutral, PublicKeyToken=99b1e4cc0d03f223" execType="Altiris.ClientTask.Server.Jobs.ClientJobExecRoot, Altiris.ClientTask.Server, Version=8.0.0.0, Culture=neutral, PublicKeyToken=99b1e4cc0d03f223">
    - <subNodes>
    - <node guid="b61ff889-3866-47a3-81e7-e1c149e7114b" designerType="Altiris.TaskManagement.ClientTask.Jobs.ClientTaskJobNode, Altiris.TaskManagement, Version=8.0.0.0, Culture=neutral, PublicKeyToken=99b1e4cc0d03f223" execType="Altiris.ClientTask.Server.Jobs.ClientJobExecTaskNode, Altiris.ClientTask.Server, Version=8.0.0.0, Culture=neutral, PublicKeyToken=99b1e4cc0d03f223">
      <execute taskVersionGuid="569af6eb-5ab3-4de6-b528-7d74985929ca" failJobIfTaskFails="False" />
      </node>
    - <node guid="8e8fc297-05a6-47c5-a38d-7a0e31e5a42d" designerType="Altiris.TaskManagement.ClientTask.Jobs.ClientTaskJobNode, Altiris.TaskManagement, Version=8.0.0.0, Culture=neutral, PublicKeyToken=99b1e4cc0d03f223" execType="Altiris.ClientTask.Server.Jobs.ClientJobExecTaskNode, Altiris.ClientTask.Server, Version=8.0.0.0, Culture=neutral, PublicKeyToken=99b1e4cc0d03f223">
      <execute taskVersionGuid="1dda05c1-0d6b-4d92-855a-b427c3ca2870" failJobIfTaskFails="False" />
      </node>
      </subNodes>
    - <inputMap>
    - <input nodeGuid="b61ff889-3866-47a3-81e7-e1c149e7114b">
      <params />
      </input>
    - <input nodeGuid="8e8fc297-05a6-47c5-a38d-7a0e31e5a42d">
      <params />
      </input>
      </inputMap>
      </node>
      </jobScript>
      <failIfAnyTaskFails>False</failIfAnyTaskFails>
      </vItem>
      </state>
      </version>


  • 4.  RE: Create a Client Job using the SDK or Workflow?

    Posted Oct 15, 2019 07:57 AM
    A Job is just a collection of Tasks, have you already created all the Tasks that you want to use in your job? it’s just ordering etc you want to determine? What’s the reason for it being dynamic and outside of the console?


  • 5.  RE: Create a Client Job using the SDK or Workflow?

    Posted Oct 15, 2019 09:12 AM

    Yes all Tasks and Sub-Jobs are there.

    The customer wants to deploy the master servers for a citrix farm. Its a matter of creating a new job for every master server as they are not identical, and this changes nearly monthly.

    This job a monster, at top level there 10+ subjobs, nearly every subjob has a condition to trigger several other subjobs. And since cloning a job in the SMP duplicates everything that is in it, we opted out of this mess.



  • 6.  RE: Create a Client Job using the SDK or Workflow?

    Posted Oct 15, 2019 10:59 AM

    Ah the joys of a clone!

     

    So if you want to get a list of current Jobs/Tasks you can either retrieve this via SQL or WSs:

    How to list the contents of an item folder?
    https://www.symantec.com/connect/blogs/how-list-contents-item-folder
    SQL

    Via WS - ItemManagementService
    http://localhost/Altiris/ASDK.NS/ItemManagementService.asmx?op=GetItemsInFolder

    Depending on how you store the jobs/tasks you might need to go recursive.



  • 7.  RE: Create a Client Job using the SDK or Workflow?

    Posted Oct 16, 2019 09:32 AM
    I have a collection in Workflow (Itemdetails) of all the jobs and tasks I wanted to be in new one. It looks like the only Chance I have is reverse engineer the structure of a Job in XML and then puzzle the new one together that I want to import.


  • 8.  RE: Create a Client Job using the SDK or Workflow?
    Best Answer

    Posted Oct 23, 2019 02:18 AM
    8.5 RU3 Enhancements of the Symantec Administrator Software Development Kit (ASDK) application programming interface (API). The Symantec ASDK provides APIs that you can use to automate and customize the Symantec Management Platform. You can call APIs through Web services, COM, and the Windows command line (CLI). In 8.5 RU3, the following new API methods for interfacing with Task Management are introduced: ■ CreateClientJob ■ CreateServerJob ■ AddTaskFirstToJob ■ AddTaskLastToJob ■ CreateJobCondition ■ AddJobConditionRules ■ AddTaskToJobConditionThenGroup ■ AddTaskToJobConditionElseGroup ■ RemoveJobCondition ■ RemoveNodeFromJob ■ RemoveAllNodesFromJob ■ ConfirmJobChanges For more information, see the Symantec ASDK Help at C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Symantec\ASDK