|
7 | 7 | BulkDeleteHostsResponseDto, |
8 | 8 | BulkDisableHostsResponseDto, |
9 | 9 | BulkEnableHostsResponseDto, |
10 | | - SetInboundToManyHostsRequestDto, |
11 | | - SetInboundToManyHostsResponseDto, |
12 | | - SetPortToManyHostsResponseDto, |
13 | | - SetPortToManyHostsRequestDto |
| 10 | + UpdateManyHostsRequestDto, |
| 11 | + UpdateManyHostsResponseDto, |
14 | 12 | ) |
15 | | -from remnawave.rapid import AttributeBody, BaseController, post |
| 13 | +from remnawave.rapid import AttributeBody, BaseController, patch, post |
16 | 14 |
|
17 | 15 |
|
18 | 16 | class HostsBulkActionsController(BaseController): |
@@ -40,21 +38,10 @@ async def enable_hosts( |
40 | 38 | """Enable many hosts""" |
41 | 39 | ... |
42 | 40 |
|
43 | | - @post( |
44 | | - "/hosts/bulk/set-inbound", |
45 | | - response_class=SetInboundToManyHostsResponseDto, |
46 | | - ) |
47 | | - async def set_inbound_to_hosts( |
| 41 | + @patch("/hosts/bulk/update", response_class=UpdateManyHostsResponseDto) |
| 42 | + async def update_hosts( |
48 | 43 | self, |
49 | | - body: Annotated[SetInboundToManyHostsRequestDto, PydanticBody()], |
50 | | - ) -> SetInboundToManyHostsResponseDto: |
51 | | - """Set inbound to many hosts""" |
52 | | - ... |
53 | | - |
54 | | - @post("/hosts/bulk/set-port", response_class=SetPortToManyHostsResponseDto) |
55 | | - async def set_port_to_hosts( |
56 | | - self, |
57 | | - body: Annotated[SetPortToManyHostsRequestDto, PydanticBody()], |
58 | | - ) -> SetPortToManyHostsResponseDto: |
59 | | - """Set port to many hosts""" |
| 44 | + body: Annotated[UpdateManyHostsRequestDto, PydanticBody()], |
| 45 | + ) -> UpdateManyHostsResponseDto: |
| 46 | + """Update many hosts""" |
60 | 47 | ... |
0 commit comments