mirror of
https://github.com/remnawave/python-sdk.git
synced 2026-08-30 13:23:02 +00:00
- Implemented models for nodes usage history including NodeInfoDto, GetUserAccessibleNodesResponse, and usage statistics. - Created subscription-related models such as UserSubscription, SubscriptionInfoData, and various response DTOs for subscription information. - Developed models for subscription settings, templates, and system statistics, enhancing the API's capability to manage and retrieve subscription configurations. - Introduced user management models including CreateUserRequestDto, UpdateUserRequestDto, and various response DTOs for user actions. - Added bulk actions for user updates and statistics tracking, improving the efficiency of user management operations. - Established a base controller for handling API requests and responses, along with decorators for HTTP methods to streamline API interactions. - Included utility functions for serialization using orjson for better performance with Pydantic models.
25 lines
No EOL
877 B
Python
25 lines
No EOL
877 B
Python
from typing import Annotated
|
|
|
|
from rapid_api_client import Query
|
|
|
|
from remnawave.models import GetNodesUsageByRangeResponseDto, GetNodesRealtimeUsageResponseDto
|
|
from remnawave.rapid import BaseController, get
|
|
|
|
|
|
class BandWidthStatsController(BaseController):
|
|
@get("/nodes/usage/range", response_class=GetNodesUsageByRangeResponseDto)
|
|
async def get_nodes_usage_by_range(
|
|
self,
|
|
start: Annotated[str, Query(description="Start date in ISO format")],
|
|
end: Annotated[str, Query(description="End date in ISO format")],
|
|
) -> GetNodesUsageByRangeResponseDto:
|
|
"""Get Nodes Usage By Range"""
|
|
...
|
|
|
|
@get("/nodes/usage/realtime", response_class=GetNodesRealtimeUsageResponseDto)
|
|
async def get_nodes_usage_realtime(
|
|
self,
|
|
) -> GetNodesRealtimeUsageResponseDto:
|
|
"""Get Nodes Usage Realtime"""
|
|
...
|
|
|