fcs.manager.views

This module contains FCS Manager application views rendered in web browser.

index(request)

Main page.

Parameters:request (django.http.HttpRequest) – The request object used to generate the response.
Returns:HTML code of the page.
Return type:django.http.HttpResponse
list_tasks(request)

List of all current user’s tasks.

Note

View accessible for logged in users only.

Parameters:request (django.http.HttpRequest) – The request object used to generate the response.
Returns:HTML code of the page.
Return type:django.http.HttpResponse
add_task(request)

View for creating new task.

Note

View accessible for logged in users only.

Parameters:request (django.http.HttpRequest) – The request object used to generate the response.
Returns:redirect to list_tasks() if request HTTP method is POST and form with new task’s details is valid, view HTML code otherwise.
Return type:django.http.HttpResponseRedirect or django.http.HttpResponse
show_task(request, task_id)

Allows pausing, stopping, resuming task and sending feedback. Shows its details. Additionally, some parameters of running or paused task can be changed.

Note

View accessible for logged in users only.

Parameters:
  • request (django.http.HttpRequest) – The request object used to generate the response.
  • task_id (int) – ID of the given task.
Returns:

redirect to list_tasks() if request HTTP method is POST and form with task’s edited details is valid, HTML code of the page otherwise.

Return type:

django.http.HttpResponseRedirect or django.http.HttpResponse

send_feedback(request, task_id)

View for sending user’s feedback on crawling results.

Note

View accessible for logged in users only.

Parameters:
  • request (django.http.HttpRequest) – The request object used to generate the response.
  • task_id (int) – ID of the given task.
Returns:

redirect to show_task().

Return type:

django.http.HttpResponseRedirect

api_keys(request)

Shows Application Key and Secret Key for REST API.

Note

View accessible for logged in users only.

Parameters:request (django.http.HttpRequest) – The request object used to generate the response.
Returns:HTML code of the page.
Return type:django.http.HttpResponse
pause_task(request, task_id)

Pauses task and redirects to tasks list.

Note

View accessible for logged in users only.

Parameters:
  • request (django.http.HttpRequest) – The request object used to generate the response.
  • task_id (int) – ID of the given task.
Returns:

Redirect to list_tasks()

Return type:

django.http.HttpResponseRedirect

resume_task(request, task_id)

Resumes task and redirects to tasks list.

Note

View accessible for logged in users only.

Parameters:
  • request (django.http.HttpRequest) – The request object used to generate the response.
  • task_id (int) – ID of the given task.
Returns:

Redirect to list_tasks().

Return type:

django.http.HttpResponseRedirect

stop_task(request, task_id)

Stops task and redirects to tasks list.

Note

View accessible for logged in users only.

Parameters:
  • request (django.http.HttpRequest) – The request object used to generate the response.
  • task_id (int) – ID of the given task.
Returns:

Redirect to list_tasks().

Return type:

django.http.HttpResponseRedirect

get_data(request, task_id, size)

Downloads data gathered by crawler.

Note

View accessible for logged in users only.

Parameters:
  • request (django.http.HttpRequest) – The request object used to generate the response.
  • task_id (int) – ID of the given task related to data to be downloaded.
  • size (int) – Size of data to be downloaded in MB.
Returns:

Redirect to proper REST method of Task Server assigned to this task if there is one, information about absence of an appropriate Task Server otherwise.

Return type:

django.http.HttpResponseRedirect or django.http.StreamingHttpResponse

show_quota(request)

Shows limitations for tasks, described by Quota object.

Note

View accessible for logged in users only.

Parameters:request (django.http.HttpRequest) – The request object used to generate the response.
Returns:HTML code of the page.
Return type:django.http.HttpResponse
api_docs_resources(request)

Swagger view generating REST API documentation.

Parameters:request (django.http.HttpRequest) – The request object used to generate the response.
Returns:HTML code of the page and an HttpResponse object with rendered text.
Return type:django.http.HttpResponse
api_docs_declaration(request, path)

Swagger view generating REST API documentation located at the given path.

Parameters:
  • request (django.http.HttpRequest) – The request object used to generate the response.
  • path (string) – Path to documentation.
Returns:

HTML code of the page and an HttpResponse object with rendered text.

Return type:

django.http.HttpResponse