diff --git a/Dockerfile b/Dockerfile index 59f831b..9f5f54e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ WORKDIR /code ADD . /code/ # Install pipenv -RUN pip install --no-cache-dir -r linux-requirements.txt +RUN pip install --no-cache-dir -r requirements.txt # Make migrations RUN python equipment_tracker/manage.py makemigrations @@ -24,7 +24,7 @@ RUN python equipment_tracker/manage.py makemigrations RUN python equipment_tracker/manage.py migrate # Generate DRF Spectacular Documentation -RUN python equipment_tracker/manage.py spectacular --color --file stude/schema.yml +RUN python equipment_tracker/manage.py spectacular --color --file equipment_tracker/schema.yml # Expose port 8000 for the web server EXPOSE 8000 diff --git a/docker-compose.yml b/docker-compose.yml index c73ff8e..91e72fc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -15,7 +15,7 @@ services: [ "sh", "-c", - "python equipment_tracker/manage.py spectacular --color --file stude/schema.yml && python equipment_tracker/manage.py collectstatic --noinput && python equipment_tracker/manage.py makemigrations && python equipment_tracker/manage.py migrate && python equipment_tracker/manage.py runserver", + "python equipment_tracker/manage.py spectacular --color --file equipment_tracker/schema.yml && python equipment_tracker/manage.py collectstatic --noinput && python equipment_tracker/manage.py makemigrations && python equipment_tracker/manage.py migrate && python equipment_tracker/manage.py runserver", ] volumes: - .:/code # For hotreloading diff --git a/equipment_tracker/accounts/__pycache__/__init__.cpython-311.pyc b/equipment_tracker/accounts/__pycache__/__init__.cpython-311.pyc index 2d605aa..3e9616e 100644 Binary files a/equipment_tracker/accounts/__pycache__/__init__.cpython-311.pyc and b/equipment_tracker/accounts/__pycache__/__init__.cpython-311.pyc differ diff --git a/equipment_tracker/accounts/__pycache__/admin.cpython-311.pyc b/equipment_tracker/accounts/__pycache__/admin.cpython-311.pyc index 50f2516..d594b06 100644 Binary files a/equipment_tracker/accounts/__pycache__/admin.cpython-311.pyc and b/equipment_tracker/accounts/__pycache__/admin.cpython-311.pyc differ diff --git a/equipment_tracker/accounts/__pycache__/apps.cpython-311.pyc b/equipment_tracker/accounts/__pycache__/apps.cpython-311.pyc index 0a01fe9..a2ff15c 100644 Binary files a/equipment_tracker/accounts/__pycache__/apps.cpython-311.pyc and b/equipment_tracker/accounts/__pycache__/apps.cpython-311.pyc differ diff --git a/equipment_tracker/accounts/__pycache__/models.cpython-311.pyc b/equipment_tracker/accounts/__pycache__/models.cpython-311.pyc index b1db7fa..2e08770 100644 Binary files a/equipment_tracker/accounts/__pycache__/models.cpython-311.pyc and b/equipment_tracker/accounts/__pycache__/models.cpython-311.pyc differ diff --git a/equipment_tracker/accounts/__pycache__/serializers.cpython-311.pyc b/equipment_tracker/accounts/__pycache__/serializers.cpython-311.pyc index b5a7eac..6cad693 100644 Binary files a/equipment_tracker/accounts/__pycache__/serializers.cpython-311.pyc and b/equipment_tracker/accounts/__pycache__/serializers.cpython-311.pyc differ diff --git a/equipment_tracker/accounts/__pycache__/urls.cpython-311.pyc b/equipment_tracker/accounts/__pycache__/urls.cpython-311.pyc index 0a1c87a..fd784f6 100644 Binary files a/equipment_tracker/accounts/__pycache__/urls.cpython-311.pyc and b/equipment_tracker/accounts/__pycache__/urls.cpython-311.pyc differ diff --git a/equipment_tracker/api/__pycache__/urls.cpython-311.pyc b/equipment_tracker/api/__pycache__/urls.cpython-311.pyc index 0544ad2..25ad270 100644 Binary files a/equipment_tracker/api/__pycache__/urls.cpython-311.pyc and b/equipment_tracker/api/__pycache__/urls.cpython-311.pyc differ diff --git a/equipment_tracker/config/__pycache__/settings.cpython-311.pyc b/equipment_tracker/config/__pycache__/settings.cpython-311.pyc index 06dbdcb..d8c3599 100644 Binary files a/equipment_tracker/config/__pycache__/settings.cpython-311.pyc and b/equipment_tracker/config/__pycache__/settings.cpython-311.pyc differ diff --git a/equipment_tracker/config/__pycache__/urls.cpython-311.pyc b/equipment_tracker/config/__pycache__/urls.cpython-311.pyc index 03ff11c..791acf4 100644 Binary files a/equipment_tracker/config/__pycache__/urls.cpython-311.pyc and b/equipment_tracker/config/__pycache__/urls.cpython-311.pyc differ diff --git a/equipment_tracker/config/settings.py b/equipment_tracker/config/settings.py index 204ef6b..38e6907 100644 --- a/equipment_tracker/config/settings.py +++ b/equipment_tracker/config/settings.py @@ -28,10 +28,11 @@ BASE_DIR = Path(__file__).resolve().parent.parent SECRET_KEY = str(os.getenv('SECRET_KEY')) # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False ALLOWED_HOSTS = ['*'] -# CSRF_TRUSTED_ORIGINS = [] To-do: Specify URL to web frontend +CSRF_TRUSTED_ORIGINS = [ + "https://equipment-tracker-frontend.keannu1.duckdns.org"] # Email credentials EMAIL_HOST = '' @@ -210,7 +211,7 @@ USE_TZ = True DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -DOMAIN = 'citc-tracker.keannu1.duckdns.org' +DOMAIN = 'equipment-tracker-frontend.keannu1.duckdns.org' SITE_NAME = 'CITC Equipment Tracker' diff --git a/equipment_tracker/schema.yml b/equipment_tracker/schema.yml index b9dc8e5..e042267 100644 --- a/equipment_tracker/schema.yml +++ b/equipment_tracker/schema.yml @@ -933,6 +933,22 @@ components: required: - token - uid + CategoryEnum: + enum: + - PC + - NETWORKING + - CCTV + - FURNITURE + - PERIPHERALS + - MISC + type: string + description: |- + * `PC` - PC + * `NETWORKING` - Networking + * `CCTV` - CCTV + * `FURNITURE` - Furniture + * `PERIPHERALS` - Peripherals + * `MISC` - Miscellaneous CustomUser: type: object properties: @@ -970,6 +986,8 @@ components: type: string description: type: string + category: + $ref: '#/components/schemas/CategoryEnum' last_updated: type: string format: date-time @@ -996,6 +1014,12 @@ components: readOnly: true equipment: type: integer + equipment_name: + type: string + readOnly: true + category: + type: string + readOnly: true status: $ref: '#/components/schemas/StatusEnum' remarks: @@ -1012,12 +1036,13 @@ components: format: date-time readOnly: true required: + - category - date_added - equipment + - equipment_name - id - last_updated - last_updated_by - - remarks - status EquipmentInstanceLog: type: object @@ -1027,6 +1052,12 @@ components: readOnly: true equipment: type: integer + equipment_name: + type: string + readOnly: true + category: + type: string + readOnly: true status: type: string remarks: @@ -1048,8 +1079,10 @@ components: type: object additionalProperties: {} required: + - category - date_added - equipment + - equipment_name - history - id - last_updated @@ -1067,6 +1100,12 @@ components: readOnly: true equipment: type: integer + equipment_name: + type: string + readOnly: true + category: + type: string + readOnly: true status: allOf: - $ref: '#/components/schemas/StatusEnum' @@ -1074,6 +1113,7 @@ components: remarks: type: string readOnly: true + nullable: true history_date: type: string format: date-time @@ -1082,7 +1122,9 @@ components: type: string readOnly: true required: + - category - equipment + - equipment_name - history_date - history_id - history_user @@ -1099,6 +1141,8 @@ components: type: string description: type: string + category: + $ref: '#/components/schemas/CategoryEnum' last_updated: type: string format: date-time @@ -1117,7 +1161,6 @@ components: additionalProperties: {} required: - date_added - - description - history - id - last_updated @@ -1135,6 +1178,9 @@ components: description: type: string readOnly: true + nullable: true + category: + $ref: '#/components/schemas/CategoryEnum' history_date: type: string format: date-time @@ -1193,6 +1239,8 @@ components: type: string description: type: string + category: + $ref: '#/components/schemas/CategoryEnum' last_updated: type: string format: date-time @@ -1212,6 +1260,12 @@ components: readOnly: true equipment: type: integer + equipment_name: + type: string + readOnly: true + category: + type: string + readOnly: true status: $ref: '#/components/schemas/StatusEnum' remarks: @@ -1262,13 +1316,16 @@ components: - new_username StatusEnum: enum: - - Working - - Broken - - Under Maintenance - - Decomissioned + - WORKING + - BROKEN + - MAINTENANCE + - DECOMISSIONED type: string - description: "* `Working` - Working\n* `Broken` - Broken\n* `Under Maintenance`\ - \ - Under Maintenance\n* `Decomissioned` - Decomissioned " + description: |- + * `WORKING` - Working + * `BROKEN` - Broken + * `MAINTENANCE` - Under Maintenance + * `DECOMISSIONED` - Decomissioned TokenObtainPair: type: object properties: diff --git a/equipment_tracker/schema.yml1 b/equipment_tracker/schema.yml1 deleted file mode 100644 index b9dc8e5..0000000 --- a/equipment_tracker/schema.yml1 +++ /dev/null @@ -1,1359 +0,0 @@ -openapi: 3.0.3 -info: - title: CITC Equipment Tracker Backend - version: 1.0.0 - description: An IT Elective 4 Project -paths: - /api/v1/accounts/jwt/create/: - post: - operationId: api_v1_accounts_jwt_create_create - description: |- - Takes a set of user credentials and returns an access and refresh JSON web - token pair to prove the authentication of those credentials. - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TokenObtainPair' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/TokenObtainPair' - multipart/form-data: - schema: - $ref: '#/components/schemas/TokenObtainPair' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TokenObtainPair' - description: '' - /api/v1/accounts/jwt/refresh/: - post: - operationId: api_v1_accounts_jwt_refresh_create - description: |- - Takes a refresh type JSON web token and returns an access type JSON web - token if the refresh token is valid. - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TokenRefresh' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/TokenRefresh' - multipart/form-data: - schema: - $ref: '#/components/schemas/TokenRefresh' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TokenRefresh' - description: '' - /api/v1/accounts/jwt/verify/: - post: - operationId: api_v1_accounts_jwt_verify_create - description: |- - Takes a token and indicates if it is valid. This view provides no - information about a token's fitness for a particular use. - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/TokenVerify' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/TokenVerify' - multipart/form-data: - schema: - $ref: '#/components/schemas/TokenVerify' - required: true - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/TokenVerify' - description: '' - /api/v1/accounts/users/: - get: - operationId: api_v1_accounts_users_list - tags: - - api - security: - - jwtAuth: [] - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/CustomUser' - description: '' - post: - operationId: api_v1_accounts_users_create - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UserRegistration' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UserRegistration' - multipart/form-data: - schema: - $ref: '#/components/schemas/UserRegistration' - required: true - security: - - jwtAuth: [] - - {} - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/UserRegistration' - description: '' - /api/v1/accounts/users/{id}/: - get: - operationId: api_v1_accounts_users_retrieve - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - api - security: - - jwtAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CustomUser' - description: '' - put: - operationId: api_v1_accounts_users_update - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CustomUser' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CustomUser' - multipart/form-data: - schema: - $ref: '#/components/schemas/CustomUser' - required: true - security: - - jwtAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CustomUser' - description: '' - patch: - operationId: api_v1_accounts_users_partial_update - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedCustomUser' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedCustomUser' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedCustomUser' - security: - - jwtAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CustomUser' - description: '' - delete: - operationId: api_v1_accounts_users_destroy - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this user. - required: true - tags: - - api - security: - - jwtAuth: [] - responses: - '204': - description: No response body - /api/v1/accounts/users/activation/: - post: - operationId: api_v1_accounts_users_activation_create - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Activation' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/Activation' - multipart/form-data: - schema: - $ref: '#/components/schemas/Activation' - required: true - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Activation' - description: '' - /api/v1/accounts/users/me/: - get: - operationId: api_v1_accounts_users_me_retrieve - tags: - - api - security: - - jwtAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CustomUser' - description: '' - put: - operationId: api_v1_accounts_users_me_update - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/CustomUser' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/CustomUser' - multipart/form-data: - schema: - $ref: '#/components/schemas/CustomUser' - required: true - security: - - jwtAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CustomUser' - description: '' - patch: - operationId: api_v1_accounts_users_me_partial_update - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedCustomUser' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedCustomUser' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedCustomUser' - security: - - jwtAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/CustomUser' - description: '' - delete: - operationId: api_v1_accounts_users_me_destroy - tags: - - api - security: - - jwtAuth: [] - responses: - '204': - description: No response body - /api/v1/accounts/users/resend_activation/: - post: - operationId: api_v1_accounts_users_resend_activation_create - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SendEmailReset' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/SendEmailReset' - multipart/form-data: - schema: - $ref: '#/components/schemas/SendEmailReset' - required: true - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/SendEmailReset' - description: '' - /api/v1/accounts/users/reset_password/: - post: - operationId: api_v1_accounts_users_reset_password_create - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SendEmailReset' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/SendEmailReset' - multipart/form-data: - schema: - $ref: '#/components/schemas/SendEmailReset' - required: true - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/SendEmailReset' - description: '' - /api/v1/accounts/users/reset_password_confirm/: - post: - operationId: api_v1_accounts_users_reset_password_confirm_create - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PasswordResetConfirm' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PasswordResetConfirm' - multipart/form-data: - schema: - $ref: '#/components/schemas/PasswordResetConfirm' - required: true - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/PasswordResetConfirm' - description: '' - /api/v1/accounts/users/reset_username/: - post: - operationId: api_v1_accounts_users_reset_username_create - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SendEmailReset' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/SendEmailReset' - multipart/form-data: - schema: - $ref: '#/components/schemas/SendEmailReset' - required: true - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/SendEmailReset' - description: '' - /api/v1/accounts/users/reset_username_confirm/: - post: - operationId: api_v1_accounts_users_reset_username_confirm_create - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/UsernameResetConfirm' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/UsernameResetConfirm' - multipart/form-data: - schema: - $ref: '#/components/schemas/UsernameResetConfirm' - required: true - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/UsernameResetConfirm' - description: '' - /api/v1/accounts/users/set_password/: - post: - operationId: api_v1_accounts_users_set_password_create - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetPassword' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/SetPassword' - multipart/form-data: - schema: - $ref: '#/components/schemas/SetPassword' - required: true - security: - - jwtAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/SetPassword' - description: '' - /api/v1/accounts/users/set_username/: - post: - operationId: api_v1_accounts_users_set_username_create - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/SetUsername' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/SetUsername' - multipart/form-data: - schema: - $ref: '#/components/schemas/SetUsername' - required: true - security: - - jwtAuth: [] - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/SetUsername' - description: '' - /api/v1/equipments/equipment_instances/: - get: - operationId: api_v1_equipments_equipment_instances_list - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/EquipmentInstance' - description: '' - post: - operationId: api_v1_equipments_equipment_instances_create - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EquipmentInstance' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/EquipmentInstance' - multipart/form-data: - schema: - $ref: '#/components/schemas/EquipmentInstance' - required: true - security: - - jwtAuth: [] - - {} - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/EquipmentInstance' - description: '' - /api/v1/equipments/equipment_instances/{equipment_id}/logs/: - get: - operationId: api_v1_equipments_equipment_instances_logs_list_2 - parameters: - - in: path - name: equipment_id - schema: - type: integer - required: true - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/EquipmentInstanceLog' - description: '' - /api/v1/equipments/equipment_instances/{id}/: - get: - operationId: api_v1_equipments_equipment_instances_retrieve - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this equipment instance. - required: true - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EquipmentInstance' - description: '' - put: - operationId: api_v1_equipments_equipment_instances_update - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this equipment instance. - required: true - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/EquipmentInstance' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/EquipmentInstance' - multipart/form-data: - schema: - $ref: '#/components/schemas/EquipmentInstance' - required: true - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EquipmentInstance' - description: '' - patch: - operationId: api_v1_equipments_equipment_instances_partial_update - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this equipment instance. - required: true - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedEquipmentInstance' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedEquipmentInstance' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedEquipmentInstance' - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/EquipmentInstance' - description: '' - delete: - operationId: api_v1_equipments_equipment_instances_destroy - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this equipment instance. - required: true - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '204': - description: No response body - /api/v1/equipments/equipment_instances/latest: - get: - operationId: api_v1_equipments_equipment_instances_latest_list - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/EquipmentInstance' - description: '' - /api/v1/equipments/equipment_instances/logs: - get: - operationId: api_v1_equipments_equipment_instances_logs_list - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/EquipmentInstanceLogs' - description: '' - /api/v1/equipments/equipments/: - get: - operationId: api_v1_equipments_equipments_list - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Equipment' - description: '' - post: - operationId: api_v1_equipments_equipments_create - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Equipment' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/Equipment' - multipart/form-data: - schema: - $ref: '#/components/schemas/Equipment' - required: true - security: - - jwtAuth: [] - - {} - responses: - '201': - content: - application/json: - schema: - $ref: '#/components/schemas/Equipment' - description: '' - /api/v1/equipments/equipments/{equipment_id}/logs/: - get: - operationId: api_v1_equipments_equipments_logs_list_2 - parameters: - - in: path - name: equipment_id - schema: - type: integer - required: true - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/EquipmentLog' - description: '' - /api/v1/equipments/equipments/{id}/: - get: - operationId: api_v1_equipments_equipments_retrieve - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this equipment. - required: true - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Equipment' - description: '' - put: - operationId: api_v1_equipments_equipments_update - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this equipment. - required: true - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Equipment' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/Equipment' - multipart/form-data: - schema: - $ref: '#/components/schemas/Equipment' - required: true - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Equipment' - description: '' - patch: - operationId: api_v1_equipments_equipments_partial_update - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this equipment. - required: true - tags: - - api - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/PatchedEquipment' - application/x-www-form-urlencoded: - schema: - $ref: '#/components/schemas/PatchedEquipment' - multipart/form-data: - schema: - $ref: '#/components/schemas/PatchedEquipment' - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - $ref: '#/components/schemas/Equipment' - description: '' - delete: - operationId: api_v1_equipments_equipments_destroy - parameters: - - in: path - name: id - schema: - type: integer - description: A unique integer value identifying this equipment. - required: true - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '204': - description: No response body - /api/v1/equipments/equipments/latest: - get: - operationId: api_v1_equipments_equipments_latest_list - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/Equipment' - description: '' - /api/v1/equipments/equipments/logs: - get: - operationId: api_v1_equipments_equipments_logs_list - tags: - - api - security: - - jwtAuth: [] - - {} - responses: - '200': - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/EquipmentLogs' - description: '' -components: - schemas: - Activation: - type: object - properties: - uid: - type: string - token: - type: string - required: - - token - - uid - CustomUser: - type: object - properties: - username: - type: string - readOnly: true - description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ - only. - email: - type: string - format: email - title: Email address - maxLength: 254 - avatar: - type: string - format: uri - first_name: - type: string - maxLength: 100 - last_name: - type: string - maxLength: 100 - required: - - avatar - - first_name - - last_name - - username - Equipment: - type: object - properties: - id: - type: integer - readOnly: true - name: - type: string - description: - type: string - last_updated: - type: string - format: date-time - readOnly: true - last_updated_by: - type: string - readOnly: true - date_added: - type: string - format: date-time - readOnly: true - required: - - date_added - - description - - id - - last_updated - - last_updated_by - - name - EquipmentInstance: - type: object - properties: - id: - type: integer - readOnly: true - equipment: - type: integer - status: - $ref: '#/components/schemas/StatusEnum' - remarks: - type: string - last_updated: - type: string - format: date-time - readOnly: true - last_updated_by: - type: string - readOnly: true - date_added: - type: string - format: date-time - readOnly: true - required: - - date_added - - equipment - - id - - last_updated - - last_updated_by - - remarks - - status - EquipmentInstanceLog: - type: object - properties: - id: - type: integer - readOnly: true - equipment: - type: integer - status: - type: string - remarks: - type: string - last_updated: - type: string - format: date-time - readOnly: true - date_added: - type: string - format: date-time - readOnly: true - last_updated_by: - type: string - readOnly: true - history: - type: array - items: - type: object - additionalProperties: {} - required: - - date_added - - equipment - - history - - id - - last_updated - - last_updated_by - - remarks - - status - EquipmentInstanceLogs: - type: object - properties: - history_id: - type: integer - readOnly: true - id: - type: integer - readOnly: true - equipment: - type: integer - status: - allOf: - - $ref: '#/components/schemas/StatusEnum' - readOnly: true - remarks: - type: string - readOnly: true - history_date: - type: string - format: date-time - readOnly: true - history_user: - type: string - readOnly: true - required: - - equipment - - history_date - - history_id - - history_user - - id - - remarks - - status - EquipmentLog: - type: object - properties: - id: - type: integer - readOnly: true - name: - type: string - description: - type: string - last_updated: - type: string - format: date-time - readOnly: true - date_added: - type: string - format: date-time - readOnly: true - last_updated_by: - type: string - readOnly: true - history: - type: array - items: - type: object - additionalProperties: {} - required: - - date_added - - description - - history - - id - - last_updated - - last_updated_by - - name - EquipmentLogs: - type: object - properties: - history_id: - type: integer - readOnly: true - name: - type: string - readOnly: true - description: - type: string - readOnly: true - history_date: - type: string - format: date-time - readOnly: true - history_user: - type: string - readOnly: true - required: - - description - - history_date - - history_id - - history_user - - name - PasswordResetConfirm: - type: object - properties: - uid: - type: string - token: - type: string - new_password: - type: string - required: - - new_password - - token - - uid - PatchedCustomUser: - type: object - properties: - username: - type: string - readOnly: true - description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ - only. - email: - type: string - format: email - title: Email address - maxLength: 254 - avatar: - type: string - format: uri - first_name: - type: string - maxLength: 100 - last_name: - type: string - maxLength: 100 - PatchedEquipment: - type: object - properties: - id: - type: integer - readOnly: true - name: - type: string - description: - type: string - last_updated: - type: string - format: date-time - readOnly: true - last_updated_by: - type: string - readOnly: true - date_added: - type: string - format: date-time - readOnly: true - PatchedEquipmentInstance: - type: object - properties: - id: - type: integer - readOnly: true - equipment: - type: integer - status: - $ref: '#/components/schemas/StatusEnum' - remarks: - type: string - last_updated: - type: string - format: date-time - readOnly: true - last_updated_by: - type: string - readOnly: true - date_added: - type: string - format: date-time - readOnly: true - SendEmailReset: - type: object - properties: - email: - type: string - format: email - required: - - email - SetPassword: - type: object - properties: - new_password: - type: string - current_password: - type: string - required: - - current_password - - new_password - SetUsername: - type: object - properties: - current_password: - type: string - new_username: - type: string - title: Username - description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ - only. - pattern: ^[\w.@+-]+$ - maxLength: 150 - required: - - current_password - - new_username - StatusEnum: - enum: - - Working - - Broken - - Under Maintenance - - Decomissioned - type: string - description: "* `Working` - Working\n* `Broken` - Broken\n* `Under Maintenance`\ - \ - Under Maintenance\n* `Decomissioned` - Decomissioned " - TokenObtainPair: - type: object - properties: - username: - type: string - writeOnly: true - password: - type: string - writeOnly: true - access: - type: string - readOnly: true - refresh: - type: string - readOnly: true - required: - - access - - password - - refresh - - username - TokenRefresh: - type: object - properties: - access: - type: string - readOnly: true - refresh: - type: string - writeOnly: true - required: - - access - - refresh - TokenVerify: - type: object - properties: - token: - type: string - writeOnly: true - required: - - token - UserRegistration: - type: object - properties: - username: - type: string - description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ - only. - pattern: ^[\w.@+-]+$ - maxLength: 150 - email: - type: string - format: email - password: - type: string - writeOnly: true - avatar: - type: string - format: uri - nullable: true - first_name: - type: string - maxLength: 100 - last_name: - type: string - maxLength: 100 - required: - - email - - first_name - - last_name - - password - - username - UsernameResetConfirm: - type: object - properties: - new_username: - type: string - title: Username - description: Required. 150 characters or fewer. Letters, digits and @/./+/-/_ - only. - pattern: ^[\w.@+-]+$ - maxLength: 150 - required: - - new_username - securitySchemes: - jwtAuth: - type: http - scheme: bearer - bearerFormat: JWT