TaskService


Click here for a complete list of operations.

GetTasks

Return all your tasks with additional information if requested

Params:
  • TaskInformation - combination of simple flags for specifying additional info. Simple flags are:
    • 0x00 (None) - no additional info
    • 0x01 (Subscriptions) - return array of Subscription for every task (see subscription service for details)
    • 0x10 (Stats) - return task daily, monthly, yearly, total statistics (see Task description below)
Result: array of Task inherited types: HttpTask, PingTask, PortTask, DatabaseTask, SnmpTask
  • Task:
    • id - task id
    • name - task name specified by you (user)
    • userId - task user id
    • creationTime - time of task creation
    • taskType - task type
    • enabled - is task enabled by you (user) or not
    • interval - task interval in minutes
    • upFromTime - time from which task is up
    • lastCheckedTime - time of last task execution
    • lastViewedTime - last task access
    • lastState - 1 if task is up, 0 if task is down
    • lastStateChangeTime - time of last state change
    • openStatEnabled - if statistics and task results are public
    • fullLogEnabled - is full log enabled
    • disablenceReason - null(nil) if task is enabled by host-tracker system or some disablence reason: InsufficientFunds for example
    • disablenceTime - null(nil) if task is enabled by host-tracker system or some disablence time
    • deleted - always false for retrieved tasks (for future use).
    • holdResults - true if results for task must be saved in db.
    • agentStat - true if statistics for task by agent should be stored
    • billingOverlimits - array of task overlimits in current user billing package or empty array.
    • tags - user specified task tags
    • subscriptions - subscriptions for this task (see subscription service GetSubscriptions for details)
    • stats - statistics for task:
      • daily - daily statistics (in %)
      • monthly - monthly statistics (in %)
      • yearly - yearly statistics (in %)
      • total - total statistics (in %)
    • agentPools - pools of agents from which task is monitored (see agent service for details)
      Default is taken from profile.
  • HttpTask:
    • Inherited fields from Task
    • httpMethod - available Get, Head, Post
    • userAgent - user agent for http requests
    • referer - referrer for http requests
    • acceptHeader - Accept http header for http requests
    • keywords - list of words which are used in http response analyzing. See keywordMode below.
    • keywordMode - specify how to analyze response from http resource:
      • PresentAny - task will success if any word in keywords parameter will be present in response
      • PresentAll - task will success if all words in keywords parameter will be present in response
      • ReverseAll - task will success if all words in keywords parameter will be absent in response
      • ReverseAny - task will success if any word in keywords parameter will be absent in response
      • ReverseWithResult - task will success if all words in keywords parameter will be absent in response. If task failed - some word was found - respnse document line part after this word will be captured and returned as task result
    • maxResponsePageSize - maximal response size
    • timeout - request timeout
    • userName - user name for basic authentication
    • password - password for basic authentication
    • postParameters - if method is Post then this parameter is form urlEncoded parameters to use in request
  • PingTask:
    • Inherited fields from Task
    • delay - delay in seconds between pings
    • quantity - number of pings
  • PortTask:
    • Inherited fields from Task
    • port - port to check
    • protocol - TCP, maybe UDP in future
    • pattern - in future - pattern for response analyzation
  • Other task types - DatabaseTask, SnmpTask currently could not be created from api (only from ui). CounterTask development is in progress

Test

The test form is only available for requests from the local machine.

SOAP 1.1

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /api/soap/v1/task.asmx HTTP/1.1
Host: www.host-tracker.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://www.host-tracker.com/Services/GetTasks"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Header>
    <AuthHeader xmlns="http://www.host-tracker.com/Services">
      <login>string</login>
      <password>string</password>
      <ticket>string</ticket>
    </AuthHeader>
  </soap:Header>
  <soap:Body>
    <GetTasks xmlns="http://www.host-tracker.com/Services">
      <additionalTaskInfo>None or Subscriptions or Stats</additionalTaskInfo>
    </GetTasks>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <GetTasksResponse xmlns="http://www.host-tracker.com/Services">
      <GetTasksResult>
        <Task>
          <creationTime>dateTime</creationTime>
          <taskType>string</taskType>
          <enabled>boolean</enabled>
          <interval>int</interval>
          <upFromTime>dateTime</upFromTime>
          <lastState>boolean</lastState>
          <lastStateChangeTime>dateTime</lastStateChangeTime>
          <openStatEnabled>boolean</openStatEnabled>
          <fullLogEnabled>boolean</fullLogEnabled>
          <disablenceReason>string</disablenceReason>
          <disablenceTime>dateTime</disablenceTime>
          <holdResults>boolean</holdResults>
          <agentStat>boolean</agentStat>
          <billingOverlimits>
            <string>string</string>
            <string>string</string>
          </billingOverlimits>
          <tags>
            <string>string</string>
            <string>string</string>
          </tags>
          <subscriptions>
            <Subscription xsi:nil="true" />
            <Subscription xsi:nil="true" />
          </subscriptions>
          <stats>
            <daily>double</daily>
            <monthly>double</monthly>
            <yearly>double</yearly>
            <total>double</total>
          </stats>
          <agentPools>
            <string>string</string>
            <string>string</string>
          </agentPools>
          <deleted>boolean</deleted>
          <dnsbl>
            <lastChecked>dateTime</lastChecked>
            <interval>int</interval>
            <lastState>boolean</lastState>
            <lastStateChangeTime>dateTime</lastStateChangeTime>
          </dnsbl>
        </Task>
        <Task>
          <creationTime>dateTime</creationTime>
          <taskType>string</taskType>
          <enabled>boolean</enabled>
          <interval>int</interval>
          <upFromTime>dateTime</upFromTime>
          <lastState>boolean</lastState>
          <lastStateChangeTime>dateTime</lastStateChangeTime>
          <openStatEnabled>boolean</openStatEnabled>
          <fullLogEnabled>boolean</fullLogEnabled>
          <disablenceReason>string</disablenceReason>
          <disablenceTime>dateTime</disablenceTime>
          <holdResults>boolean</holdResults>
          <agentStat>boolean</agentStat>
          <billingOverlimits>
            <string>string</string>
            <string>string</string>
          </billingOverlimits>
          <tags>
            <string>string</string>
            <string>string</string>
          </tags>
          <subscriptions>
            <Subscription xsi:nil="true" />
            <Subscription xsi:nil="true" />
          </subscriptions>
          <stats>
            <daily>double</daily>
            <monthly>double</monthly>
            <yearly>double</yearly>
            <total>double</total>
          </stats>
          <agentPools>
            <string>string</string>
            <string>string</string>
          </agentPools>
          <deleted>boolean</deleted>
          <dnsbl>
            <lastChecked>dateTime</lastChecked>
            <interval>int</interval>
            <lastState>boolean</lastState>
            <lastStateChangeTime>dateTime</lastStateChangeTime>
          </dnsbl>
        </Task>
      </GetTasksResult>
    </GetTasksResponse>
  </soap:Body>
</soap:Envelope>