GetScheduler

Syntax

GetSchedulerResult GetScheduler(SchedulerId tScheduler, GetSchedulerArg tArg)

Parameters

tScheduler. Scheduled tasks container instance moniker.

tArg. Parameters of metadata getting.

Description

The GetScheduler operation gets metadata of the scheduled tasks container.

Comments

The operation gets information about tasks created in the container and information about the task scheduler's state. To execute the operation, in the tScheduler parameter specify the opened scheduled tasks container instance moniker, and in the tArg parameter specify getting parameters. The moniker can be obtained on executing the OpenScheduler operation. The operation results in the requested metadata.

Example

Below is the example of getting general and specific settings of the tasks located in the scheduled tasks container. The request contains the moniker of opened task container instance and the pattern that specifies whether task settings should be obtained. The response contains the obtained information.

SOAP request:

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<GetScheduler xmlns="http://www.fsight.ru/PP.SOM.Som">
<tScheduler xmlns="">
  <id>S1!M!6445</id>
  </tScheduler>
<tArg xmlns="">
<pattern>
  <obInst>true</obInst>
  <all>true</all>
<task>
  <properties>true</properties>
  <settings>true</settings>
  </task>
  </pattern>
  </tArg>
  </GetScheduler>
  </s:Body>
  </s:Envelope>

SOAP response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<GetSchedulerResult xmlns="http://www.fsight.ru/PP.SOM.Som" xmlns:q1="http://www.fsight.ru/PP.SOM.Som" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<id xmlns="">
  <id>S1!M!6445</id>
  </id>
<meta xmlns="">
<obInst>
<obDesc ds="" isShortcut="0" isLink="0" ver="0" hf="0">
  <i>TASKS_CONTAINTER</i>
  <n>Scheduled tasks container</n>
  <k>6445</k>
  <c>5378</c>
  <p>6444</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  <isPermanent>1</isPermanent>
  <isTemp>0</isTemp>
  </obDesc>
  </obInst>
<tasks>
<its>
<it>
  <k>6449</k>
  <id>RUN_MODULE</id>
  <n>Unit execution</n>
  <vis>1</vis>
  <type>ExecuteSub</type>
  <ds />
<properties>
<period>
  <type>Daily</type>
  <startDateTime>1999-12-31T23:00:00.000</startDateTime>
  <stopDateTime>2009-12-31T23:00:00.000</stopDateTime>
  <everyDays>1</everyDays>
  </period>
  <active>0</active>
  <queueing>0</queueing>
  <userTag>ADMIN</userTag>
  <threadClass>1</threadClass>
<publishing>
  <SendMail>0</SendMail>
  <mailAddress />
  <mailSubject>&[TASK_RESULT] - &[TASK_FINISH] : &[TASK_NAME]</mailSubject>
  <mailBody>&[TASK_RESULT] - &[TASK_FINISH] : &[TASK_NAME]</mailBody>
  <ftpAddress />
  <appendAttachment>1</appendAttachment>
  <dynamicMailListMacro />
  <dynamicMailListModule />
  <UseDynamicMailList>0</UseDynamicMailList>
  </publishing>
  <paramValues />
  <eventId />
  </properties>
<settings>
<fore>
<obDesc ds="" isShortcut="0" isLink="0" ver="0" hf="0">
  <i>TASK_MODULE</i>
  <n>Unit</n>
  <k>6447</k>
  <c>1537</c>
  <p>6444</p>
  <h>0</h>
  <hasPrv>0</hasPrv>
  <ic>0</ic>
  <trackElementDependents>0</trackElementDependents>
  </obDesc>
  <subName>Run</subName>
  </fore>
  </settings>
  </it>
  </its>
  </tasks>
  </meta>
  </GetSchedulerResult>
  </soapenv:Body>
  </soapenv:Envelope>

JSON request:

{
"GetScheduler" :
{
"tScheduler" :
{
"id" : "S1!M!6445"
},
"tArg" :
{
"pattern" :
{
"obInst" : "true",
"all" : "true",
"task" :
{
"properties" : "true",
"settings" : "true"
}
}
}
}
}

JSON response:

{
"GetSchedulerResult" :
{
"id" :
{
"id" : "S1!M!6445"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "0",
"@hf" : "0",
"i" : "TASKS_CONTAINTER",
"n" : "Scheduled tasks container",
"k" : "6445",
"c" : "5378",
"p" : "6444",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"tasks" :
{
"its" :
{
"it" :
[
{
"k" : "6449",
"id" : "RUN_MODULE",
"n" : "Unit execution",
"vis" : "1",
"type" : "ExecuteSub",
"ds" : "",
"properties" :
{
"period" :
{
"type" : "Daily",
"startDateTime" : "1999-12-31T23:00:00.000",
"stopDateTime" : "2009-12-31T23:00:00.000",
"everyDays" : "1"
},
"active" : "0",
"queueing" : "0",
"userTag" : "ADMIN",
"threadClass" : "1",
"publishing" :
{
"SendMail" : "0",
"mailAddress" : "",
"mailSubject" : "&[TASK_RESULT] - &[TASK_FINISH] : &[TASK_NAME]",
"mailBody" : "&[TASK_RESULT] - &[TASK_FINISH] : &[TASK_NAME]",
"ftpAddress" : "",
"appendAttachment" : "1",
"dynamicMailListMacro" : "",
"dynamicMailListModule" : "",
"UseDynamicMailList" : "0"
},
"paramValues" : "",
"eventId" : ""
},
"settings" :
{
"fore" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "0",
"@hf" : "0",
"i" : "TASK_MODULE",
"n" : "Unit",
"k" : "6447",
"c" : "1537",
"p" : "6444",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"trackElementDependents" : "0"
},
"subName" : "Run"
}
}
}
]
}
}
}
}
}
public static GetSchedulerResult GetTasksContainernMd(SchedulerId moniker)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
//Operation execution parameters
var tGet = new GetScheduler()
{
tScheduler = moniker,
tArg = new GetSchedulerArg()
{
pattern = new SchedulerMdPattern // Metadata get pattern
{
all = true,
task = new SchedulerTaskPattern()
{
properties = true,
settings = true
}
}
}
};
//Get scheduled tasks container metadata
var tResult = somClient.GetScheduler(tGet);
return tResult;
}

See also:

Working with Modeling Container