-
Notifications
You must be signed in to change notification settings - Fork 122
Models
The following attributes are included in the Capture model:
NOTE: url, status_only, and callback are provided in the POST request to the Sketchy API.
- url
- status_only
- callback
- job_status
- capture_status
- created_at
- modified_at
- retry
- sketch_url
- scrape_url
- html_url
string
required
The url is provided by the consumer in the form of a JSON post request. The url is required to submit a task in the Celery queue. The url will be visited first to confirm it is valid. Next, Sketchy will generate a capture that includes a screenshot, text scrape, and html file. If the status_only flag is sent on the JSON post request, the task will only confirm the url is valid and then the task is completed.
boolean
optional
The status_only boolean is provided by the consumer in the form of a JSON post request. If set to true, The APi will only check if a URL returns a valid HTTP status code (not 4xx or 5xx). After the status is returned, the task is marked as COMPETED.
string
optional
The callback url is provided by the consumer in the form of a JSON post request. Sketchy will post a completed or failed job to the callback url provided. The request will be JSON.
string
The job_status is used to track the task status as the task executes. The following values are used:
- CREATED - The job has been created.
- STARTED - The job has been started by Celery.
- RETRY - The job has retried due to an exception
- FAILURE - The job has failed.
- COMPLETED - The task has completed successfully.
When a task is finished, capture_status is updated with the value of COMPLETED.
string
The capture_status is updated as the task is running. In the event there is an unexpected error, the capture_status will be updated with that error message. In the event the URL provided returns a 4xx or 5xx status code, capture_status will be set to '404'.
When a task is finished, capture_status is updated with the value of COMPLETED.
string
This attribute is created when the API receives a POST. This returns a string that is formatted with datetime.now()
string
This attribute is modified when each time the Capture record is modified. This returns a string that is formatted with datetime.now()
integer
This attribute displays the number of times a task was retried.
string
The sketch_url contains the location of the screen capture that was generated by PhantomJS. The sketch_url will either point to a S3 link or locally depending on your configuration settings.
string
The scrape_url contains the location of the text that was scraped from the URL provided to PhantomJS.
The scrape_url will either point to a S3 link or locally depending on your configuration settings.
string
The html_url contains the location of the html file capture that was generated by PhantomJS. The html_url will either point to a S3 link or locally depending on your configuration settings.
The static model is identical to the Capture model with two changes. url is replaced with filename and status_only is removed.
NOTE: url, and callback are provided in the Multipart POST request to the Sketchy API.
- filename
- status_only
- callback
- job_status
- capture_status
- created_at
- modified_at
- retry
- sketch_url
- scrape_url
- html_url
string
The filename contains the name of the html file being uploaded to Sketchy. The filename must end in the html or htm file extension to be accepted.
See Capture Model above for more details on the model attributes.