TaskService


Click here for a complete list of operations.

CreateTask

Create task from HttpTaskEditableData, PingTaskEditableData, PortTaskEditableData

Params:
  • TaskEditableData is base but could not be used in Create methods directly (could be used in Update methods):
    • id - should only be specified in UpdateTasks method. Ignored in other methods.
    • enabled - if true task will be created in enabled state
    • interval - interval in minutes. See available intervals in GetTaskIntervals method
    • name - task name
    • fullLog - enable or disable full logging for task
    • openStat - is statistics and task results are public (available for public access)
    • tags - array of tags for task
    • agentPools - monitoring agents from which task should be monitored. Default is taken from profile.
    • subscriptions - array of Subscription. See subscription service for details
    • Result of passing TaskEditableData is Soap client fault with message UncomplitedData.
  • HttpTaskEditableData extends TaskEditableData:
    • url - http task url
    • httpMethod - http method. Supported: Get, Head, Post
    • userAgent - user agent for http requests
    • referer - referrer for http request
    • acceptHeader - Accept http header for requests
    • keywords - keywords (see GetTasks method description)
    • keywordMode - keyword mode (see GetTasks method description)
    • userName - basic authentication user name
    • password - basic authentication password
    • postParameters - post parameters
    • checkDnsbl - true or false(default), if true then domain will be checked agains DNS black lists and if it is there, notification will be send according to subscriptions.
    • checkCertificateExpiration - true or false(default), if true then certificate expiration date of provided endpoint will be monitored. Notifications will be sent 30,7 and 1 day before expiration and every day after it according to subscriptions. Available only for https endpoints and ignored in other cases.
    • checkDomainExpiration - true or false(default), if true then domain expiration date will be monitored. Notifications will be sent 30,7 and 1 day before expiration and every day after it according to subscriptions.
    • followRedirect - true or false(default), if true then redirects will be followed.
    • treat300AsError - true or false(default), if set then redirects will be treated as errors and followRedirect flag will be ignored.
  • PortTaskEditableData extends TaskEditableData:
    • host - IP or domain name of target host
    • port - port on the host
  • PingTaskEditableData extends TaskEditableData:
    • host - IP or domain name of target host
Result: created Task. See GetTasks method for details.
Soap client faults:
  • Hint. Some Soap faults provide additional information in Soap message such as specified value of faulted parameter and allowed array of values for it.
  • WrongInterval - interval for task is not in range of available regular task intervals (see GetTaskIntervals method)
  • UncomplitedData - passed in method TaskEditableData. But should HttpTaskEditableData, PingTaskEditableData, PortTaskEditableData.
  • DeniedAccessToMonitoringAgents - you could not set monitoring points for task by default. Contact us if you want to do this.
  • EmptyUrl - url is required
  • BadIP - bad ip specified in host or url
  • WrongUrl - url is wrong
  • UrlInBlackList - url is in black list
  • WrongHttpMethod - http method is wrong (see GetTask for allowed methods)
  • WrongKeywordMode - http task keyword mode is wrong (see GetTask for allowed modes)
  • WrongPort - port of port task is wrong
  • WrongTaskType - task type is wrong (see GetTaskTypes for allowed types)
  • WrongTaskStatus - allowed enabled and disabled values
  • SimilarExists - some of your tasks have same url or host or host:port specified
  • Subscription error codes - see subscription service AddSubscriptions

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/CreateTask"

<?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>
    <CreateTask xmlns="http://www.host-tracker.com/Services">
      <taskData>
        <id>guid</id>
        <enabled>boolean</enabled>
        <interval>int</interval>
        <name>string</name>
        <fullLog>boolean</fullLog>
        <openStat>boolean</openStat>
        <tags>
          <string>string</string>
          <string>string</string>
        </tags>
        <agentPools>
          <string>string</string>
          <string>string</string>
        </agentPools>
        <subscriptions>
          <Subscription>
            <alertTypes xsi:nil="true" />
            <reportTypes xsi:nil="true" />
            <taskIds xsi:nil="true" />
            <contactIds xsi:nil="true" />
          </Subscription>
          <Subscription>
            <alertTypes xsi:nil="true" />
            <reportTypes xsi:nil="true" />
            <taskIds xsi:nil="true" />
            <contactIds xsi:nil="true" />
          </Subscription>
        </subscriptions>
      </taskData>
    </CreateTask>
  </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>
    <CreateTaskResponse xmlns="http://www.host-tracker.com/Services">
      <CreateTaskResult>
        <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>
            <alertTypes xsi:nil="true" />
            <reportTypes xsi:nil="true" />
            <taskIds xsi:nil="true" />
            <contactIds xsi:nil="true" />
          </Subscription>
          <Subscription>
            <alertTypes xsi:nil="true" />
            <reportTypes xsi:nil="true" />
            <taskIds xsi:nil="true" />
            <contactIds xsi:nil="true" />
          </Subscription>
        </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>
      </CreateTaskResult>
    </CreateTaskResponse>
  </soap:Body>
</soap:Envelope>