Skip to content

File Management Endpoints

Alexandar83 edited this page Feb 25, 2025 · 33 revisions

This page outlines the file management system in The Wall API, which provides endpoints for uploading, listing, and deleting wall configuration files.

Table of Contents

  1. Overview
  2. Initial File Upload Flow Diagram
  3. File Management Endpoints
  4. File Management Views
    4.1 Throttling Controls
    4.2 OpenAPI Schema Documentation
    4.3 Key DRF Files
  5. File Management and ORM Representation
    5.1 Data Model Overview
    5.2 Key Behaviors

1. Overview

  • File management is a core functionality in The Wall API, allowing users to perform the following operations on wall configuration files:

    ✔ Upload a new configuration file.
    ✔ List the config_id values of all uploaded configuration files.
    ✔ Delete one or more configuration files.

  • All operations require authentication and are subject to rate limits.

  • Files are linked to user accounts, ensuring secure and user-specific access to uploaded wall configurations.



2. Initial File Upload Flow Diagram

The following diagram illustrates the API request flow for initial file uploads in The Wall API. It shows how the system processes file uploads, checks for duplicates, manages concurrent tasks, and triggers Celery-based calculations.

Initial file upload flow diagram

View full image


3. File Management Endpoints

Action Endpoint Requires Authentication?
Upload File /api/v2/wallconfig-files/upload/ ✅ Yes
List Files /api/v2/wallconfig-files/list/ ✅ Yes
Delete File /api/v2/wallconfig-files/delete/ ✅ Yes

💡 API Access Overview - Full API endpoints breakdown and applied throttling rates.

💡 Uploaded Files - Rules and limitations for uploaded files.

💡 Detailed OpenAPI Documentation - Comprehensive information on each file management endpoint and its parameters.


4. File Management Views

File management in The Wall API is handled by dedicated Django Rest Framework (DRF) views. These views enforce authentication, apply request throttling, and are integrated with DRF Spectacular for API documentation.

4.1 Throttling Controls

  • Request limits are enforced under the File management throttle scope to prevent excessive API usage.
  • This ensures fair resource distribution and protects the API from abuse.

💡 For more details on throttling, refer to the API Throttling page.

4.2 OpenAPI Schema Documentation

  • File management endpoints are fully documented using DRF Spectacular’s schema extension, ensuring clear and structured API visibility.
  • This documentation provides detailed request and response structures, making it easier for clients to integrate with the API.

💡 For more details on OpenAPI schema generation, see the DRF Spectacular page.

4.3 Key DRF Files

The following files handle file management operations:

  • the_wall_api/views.py

    • Defines file management views, implemented with the views.APIView class.
    • Each view utilizes @extend_schema from drf-spectacular, providing clear and structured documentation tailored to each endpoint.
  • config/urls.py – Maps file management API endpoints.

  • the_wall_api/utils/api_utils.py – Manages file management endpoints integration within the centralized API setup.

  • the_wall_api/serializers.py – Handles request validation and response formatting.

  • config/settings.py – Configures authentication, permissions, and throttling settings for file operations.

    • Global authentication and permission settings are defined under REST_FRAMEWORK:
      REST_FRAMEWORK = {
          'DEFAULT_AUTHENTICATION_CLASSES': [
              'rest_framework.authentication.TokenAuthentication',
          ],
          'DEFAULT_PERMISSION_CLASSES': [
              'rest_framework.permissions.IsAuthenticated',
          ],
      }
      💡 These settings enforce token-based authentication and restrict access to authenticated users for all file management views, unless explicitly overridden in the view configuration.

5. File Management and ORM Representation

5.1 Data Model Overview

5.2 Key Behaviors

  • A WallConfigReference is always created for every uploaded file, ensuring user-specific access.

  • If an identical wall configuration already exists, only a WallConfigReference is created instead of creating a duplicate WallConfig.

  • Each WallConfigReference entry contains a config_id, which is defined by the user at the time of upload. This config_id allows users to manage their own configurations independently, even when referring to the same underlying WallConfig.

  • Deleting a file aborts any ongoing user-related task processing for that file.

💡 Check the Abort Signals section for a detailed description of the abort task mechanism.


Next:   Profiles Endpoints
Back to: Authentication (Djoser)

Return to Top
DTS Index
Home Page


Clone this wiki locally