TaskStatus
Returns a status of a download task
Syntax
wds.TaskStatus( downloadTask )
Arguments
Name |
Type |
Description |
downloadTask |
DownloadTask |
Required. A download task |
Return type
DownloadTaskStatus
Return value
An object with information about a task execution and result
Examples
Getting an init download task status
DECLARE @jobConfig wds.JobConfig = 'Server: wds://localhost:2807; StartUrls: http://playground.svc';
SELECT
root.Task.Url URL,
wds.TaskStatus(root.Task).TaskState Status
FROM wds.Start(@jobConfig) root
URL |
Status |
http://playground.svc |
Created |
DECLARE @jobConfig wds.JobConfig = 'Server: wds://localhost:2807; StartUrls: http://playground.svc';
SELECT
root.Task.Url URL,
wds.TaskStatus(root.Task).ToString() Status
FROM wds.Start(@jobConfig) root
Init Download Task StatusXml
<?xml version="1.0" encoding="utf-8"?>
<DownloadTaskStatus xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<State>Created</State>
</DownloadTaskStatus>
DECLARE @jobConfig wds.JobConfig = 'Server: wds://localhost:2807; StartUrls: http://playground.svc';
SELECT TOP 1
nav.Task.Url URL,
wds.TaskStatus(root.Task).ToString() Status
FROM wds.Start(@jobConfig) root
OUTER APPLY wds.Crawl(root.Task, 'css: ul.nav a') nav
Download Task StatusXml
<?xml version="1.0" encoding="utf-8"?>
<DownloadTaskStatus xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<State>Handled</State>
<Result>
<Method>GET</Method>
<Url>http://playground.svc/</Url>
<IsSuccess>true</IsSuccess>
<HttpStatusCode>200</HttpStatusCode>
<ReasonPhrase>OK</ReasonPhrase>
<RequestHeaders />
<ResponseHeaders>
<HttpHeader>
<Name>date</Name>
<Values>
<string>ddd, DD MMM YYYY HH:mm:ss GMT</string>
</Values>
</HttpHeader>
<HttpHeader>
<Name>server</Name>
<Values>
<string>Kestrel</string>
</Values>
</HttpHeader>
<HttpHeader>
<Name>accept-ranges</Name>
<Values>
<string>bytes</string>
</Values>
</HttpHeader>
<HttpHeader>
<Name>etag</Name>
<Values>
<string>"etag string"</string>
</Values>
</HttpHeader>
<HttpHeader>
<Name>content-length</Name>
<Values>
<string>21040</string>
</Values>
</HttpHeader>
<HttpHeader>
<Name>content-type</Name>
<Values>
<string>text/html</string>
</Values>
</HttpHeader>
<HttpHeader>
<Name>last-modified</Name>
<Values>
<string>ddd, DD MMM YYYY HH:mm:ss GMT</string>
</Values>
</HttpHeader>
</ResponseHeaders>
<RequestCookies />
<ResponseCookies />
<RequestDateUtc>YYYY-MM-DDTHH:mm:ss.zzz</RequestDateUtc>
<DownloadTimeSec>0.0591974</DownloadTimeSec>
<ViaProxy>false</ViaProxy>
<WaitTimeSec>0</WaitTimeSec>
<CrawlDelaySec>0</CrawlDelaySec>
</Result>
<IntermedResults />
</DownloadTaskStatus>