feat: add environment_uuid support and update API documentation

- Introduced `environment_uuid` as a required field in various API endpoints and schemas.
- Updated descriptions to clarify that either `environment_name` or `environment_uuid` must be provided.
- Modified routes and controller methods to accommodate the new UUID parameter.
- Adjusted frontend components to utilize `environment_uuid` for better consistency and clarity.
- Removed deprecated fields related to environment handling.

This change enhances the API's flexibility in identifying environments, improving overall usability.
This commit is contained in:
Andras Bacsai
2024-12-17 13:42:16 +01:00
parent 0ce01238d7
commit 9e3467578f
24 changed files with 421 additions and 525 deletions

View File

@@ -47,6 +47,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- git_repository
- git_branch
- build_pack
@@ -60,7 +61,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
git_repository:
type: string
description: 'The git repository URL.'
@@ -272,6 +276,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- github_app_uuid
- git_repository
- git_branch
@@ -286,7 +291,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
github_app_uuid:
type: string
description: 'The Github App UUID.'
@@ -501,6 +509,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- private_key_uuid
- git_repository
- git_branch
@@ -515,7 +524,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
private_key_uuid:
type: string
description: 'The private key UUID.'
@@ -730,6 +742,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- dockerfile
properties:
project_uuid:
@@ -740,7 +753,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
dockerfile:
type: string
description: 'The Dockerfile content.'
@@ -906,6 +922,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- docker_registry_image_name
- ports_exposes
properties:
@@ -917,7 +934,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
docker_registry_image_name:
type: string
description: 'The docker registry image name.'
@@ -1073,6 +1093,7 @@ paths:
- project_uuid
- server_uuid
- environment_name
- environment_uuid
- docker_compose_raw
properties:
project_uuid:
@@ -1083,7 +1104,10 @@ paths:
description: 'The server UUID.'
environment_name:
type: string
description: 'The environment name.'
description: 'The environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'The environment UUID. You need to provide at least one of environment_name or environment_uuid.'
docker_compose_raw:
type: string
description: 'The Docker Compose raw content.'
@@ -2137,6 +2161,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2146,7 +2171,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
postgres_user:
type: string
description: 'PostgreSQL user'
@@ -2235,6 +2263,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2244,7 +2273,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2321,6 +2353,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2330,7 +2363,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2404,6 +2440,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2413,7 +2450,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2490,6 +2530,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2499,7 +2540,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2576,6 +2620,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2585,7 +2630,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2671,6 +2719,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2680,7 +2729,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -2766,6 +2818,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
properties:
server_uuid:
type: string
@@ -2775,7 +2828,10 @@ paths:
description: 'UUID of the project'
environment_name:
type: string
description: 'Name of the environment'
description: 'Name of the environment. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'UUID of the environment. You need to provide at least one of environment_name or environment_uuid.'
destination_uuid:
type: string
description: 'UUID of the destination if the server has multiple destinations'
@@ -3293,13 +3349,13 @@ paths:
security:
-
bearerAuth: []
'/projects/{uuid}/{environment_name}':
'/projects/{uuid}/{environment_name_or_uuid}':
get:
tags:
- Projects
summary: Environment
description: 'Get environment by name.'
operationId: get-environment-by-name
description: 'Get environment by name or UUID.'
operationId: get-environment-by-name-or-uuid
parameters:
-
name: uuid
@@ -3309,9 +3365,9 @@ paths:
schema:
type: string
-
name: environment_name
name: environment_name_or_uuid
in: path
description: 'Environment name'
description: 'Environment name or UUID'
required: true
schema:
type: string
@@ -3872,6 +3928,7 @@ paths:
- server_uuid
- project_uuid
- environment_name
- environment_uuid
- type
properties:
type:
@@ -3891,7 +3948,10 @@ paths:
description: 'Project UUID.'
environment_name:
type: string
description: 'Environment name.'
description: 'Environment name. You need to provide at least one of environment_name or environment_uuid.'
environment_uuid:
type: string
description: 'Environment UUID. You need to provide at least one of environment_name or environment_uuid.'
server_uuid:
type: string
description: 'Server UUID.'
@@ -4856,11 +4916,9 @@ components:
type: integer
uuid:
type: string
application_id:
type: integer
service_id:
type: integer
database_id:
resourceable_type:
type: string
resourceable_id:
type: integer
is_build_time:
type: boolean
@@ -5139,132 +5197,12 @@ components:
updated_at:
type: string
description: 'The date and time the team was last updated.'
smtp_enabled:
type: boolean
description: 'Whether SMTP is enabled or not.'
smtp_from_address:
type: string
description: 'The email address to send emails from.'
smtp_from_name:
type: string
description: 'The name to send emails from.'
smtp_recipients:
type: string
description: 'The email addresses to send emails to.'
smtp_host:
type: string
description: 'The SMTP host.'
smtp_port:
type: string
description: 'The SMTP port.'
smtp_encryption:
type: string
description: 'The SMTP encryption.'
smtp_username:
type: string
description: 'The SMTP username.'
smtp_password:
type: string
description: 'The SMTP password.'
smtp_timeout:
type: string
description: 'The SMTP timeout.'
smtp_notifications_test:
type: boolean
description: 'Whether to send test notifications via SMTP.'
smtp_notifications_deployments:
type: boolean
description: 'Whether to send deployment notifications via SMTP.'
smtp_notifications_status_changes:
type: boolean
description: 'Whether to send status change notifications via SMTP.'
smtp_notifications_scheduled_tasks:
type: boolean
description: 'Whether to send scheduled task notifications via SMTP.'
smtp_notifications_database_backups:
type: boolean
description: 'Whether to send database backup notifications via SMTP.'
smtp_notifications_server_disk_usage:
type: boolean
description: 'Whether to send server disk usage notifications via SMTP.'
discord_enabled:
type: boolean
description: 'Whether Discord is enabled or not.'
discord_webhook_url:
type: string
description: 'The Discord webhook URL.'
discord_notifications_test:
type: boolean
description: 'Whether to send test notifications via Discord.'
discord_notifications_deployments:
type: boolean
description: 'Whether to send deployment notifications via Discord.'
discord_notifications_status_changes:
type: boolean
description: 'Whether to send status change notifications via Discord.'
discord_notifications_database_backups:
type: boolean
description: 'Whether to send database backup notifications via Discord.'
discord_notifications_scheduled_tasks:
type: boolean
description: 'Whether to send scheduled task notifications via Discord.'
discord_notifications_server_disk_usage:
type: boolean
description: 'Whether to send server disk usage notifications via Discord.'
show_boarding:
type: boolean
description: 'Whether to show the boarding screen or not.'
resend_enabled:
type: boolean
description: 'Whether to enable resending or not.'
resend_api_key:
type: string
description: 'The resending API key.'
use_instance_email_settings:
type: boolean
description: 'Whether to use instance email settings or not.'
telegram_enabled:
type: boolean
description: 'Whether Telegram is enabled or not.'
telegram_token:
type: string
description: 'The Telegram token.'
telegram_chat_id:
type: string
description: 'The Telegram chat ID.'
telegram_notifications_test:
type: boolean
description: 'Whether to send test notifications via Telegram.'
telegram_notifications_deployments:
type: boolean
description: 'Whether to send deployment notifications via Telegram.'
telegram_notifications_status_changes:
type: boolean
description: 'Whether to send status change notifications via Telegram.'
telegram_notifications_database_backups:
type: boolean
description: 'Whether to send database backup notifications via Telegram.'
telegram_notifications_test_message_thread_id:
type: string
description: 'The Telegram test message thread ID.'
telegram_notifications_deployments_message_thread_id:
type: string
description: 'The Telegram deployment message thread ID.'
telegram_notifications_status_changes_message_thread_id:
type: string
description: 'The Telegram status change message thread ID.'
telegram_notifications_database_backups_message_thread_id:
type: string
description: 'The Telegram database backup message thread ID.'
custom_server_limit:
type: string
description: 'The custom server limit.'
telegram_notifications_scheduled_tasks:
type: boolean
description: 'Whether to send scheduled task notifications via Telegram.'
telegram_notifications_scheduled_tasks_thread_id:
type: string
description: 'The Telegram scheduled task message thread ID.'
members:
description: 'The members of the team.'
type: array