Remnawave_python-sdk/remnawave/controllers/config_profiles.py
Artem 9e2822774a
feat: Enhance subscription and external squad management
- Updated NodeUsageDto to include node_uuid and changed date to datetime.
- Changed total fields in subscription and subscription request history models from float to int.
- Introduced response rules and conditions for subscription settings, including new models for response modifications.
- Added external squads management with CRUD operations and associated models.
- Implemented passkey management with registration and verification endpoints.
- Enhanced snippets management with full CRUD operations and validation.
- Added OAuth2 provider enum for better authentication handling.
2025-10-28 00:44:15 +01:00

78 lines
No EOL
2.9 KiB
Python
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

from typing import Annotated
from rapid_api_client import Path, Query
from rapid_api_client.annotations import PydanticBody
from remnawave.models import (
CreateConfigProfileRequestDto,
CreateConfigProfileResponseDto,
DeleteConfigProfileResponseDto,
GetAllConfigProfilesResponseDto,
GetAllInboundsResponseDto,
GetConfigProfileByUuidResponseDto,
GetInboundsByProfileUuidResponseDto,
UpdateConfigProfileRequestDto,
UpdateConfigProfileResponseDto,
)
from remnawave.rapid import BaseController, delete, get, patch, post
class ConfigProfilesController(BaseController):
@get("/config-profiles", response_class=GetAllConfigProfilesResponseDto)
async def get_config_profiles(self) -> GetAllConfigProfilesResponseDto:
"""Get config profiles"""
...
@post("/config-profiles", response_class=CreateConfigProfileResponseDto)
async def create_config_profile(
self,
body: Annotated[CreateConfigProfileRequestDto, PydanticBody()],
) -> CreateConfigProfileResponseDto:
"""Create config profile"""
...
@patch("/config-profiles", response_class=UpdateConfigProfileResponseDto)
async def update_config_profile(
self,
body: Annotated[UpdateConfigProfileRequestDto, PydanticBody()],
) -> UpdateConfigProfileResponseDto:
"""Update Core Config in specific config profile"""
...
@get("/config-profiles/inbounds", response_class=GetAllInboundsResponseDto)
async def get_all_inbounds(self) -> GetAllInboundsResponseDto:
"""Get all inbounds from all config profiles"""
...
@get("/config-profiles/{uuid}/inbounds", response_class=GetInboundsByProfileUuidResponseDto)
async def get_inbounds_by_profile_uuid(
self,
uuid: Annotated[str, Path(description="UUID of the config profile")],
) -> GetInboundsByProfileUuidResponseDto:
"""Get inbounds by profile uuid"""
...
@get("/config-profiles/{uuid}", response_class=GetConfigProfileByUuidResponseDto)
async def get_config_profile_by_uuid(
self,
uuid: Annotated[str, Path(description="UUID of the config profile")],
) -> GetConfigProfileByUuidResponseDto:
"""Get config profile by uuid"""
...
@delete("/config-profiles/{uuid}", response_class=DeleteConfigProfileResponseDto)
async def delete_config_profile_by_uuid(
self,
uuid: Annotated[str, Path(description="UUID of the config profile")],
) -> DeleteConfigProfileResponseDto:
"""Delete config profile"""
...
# Get computed config profile by uuid
@get("/config-profiles/{uuid}/computed-config", response_class=GetConfigProfileByUuidResponseDto)
async def get_computed_config_profile_by_uuid(
self,
uuid: Annotated[str, Path(description="UUID of the config profile")],
) -> GetConfigProfileByUuidResponseDto:
"""Get computed config profile by uuid"""
...