init studio admin backend
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { Controller, Delete, Get, Param, Patch, Query, Body } from '@nestjs/common';
|
||||
|
||||
import {
|
||||
ListLauncherSshKeysQuery,
|
||||
ListProvisionedDevicesQuery,
|
||||
UpdateProvisionedDeviceDto,
|
||||
} from './dto';
|
||||
import { AgentsService } from './agents.service';
|
||||
|
||||
@Controller('agents')
|
||||
export class AgentsController {
|
||||
constructor(private readonly agentsService: AgentsService) {}
|
||||
|
||||
@Get('devices')
|
||||
listDevices(@Query() query: ListProvisionedDevicesQuery) {
|
||||
return this.agentsService.listDevices(query);
|
||||
}
|
||||
|
||||
@Get('devices/:id')
|
||||
getDevice(@Param('id') id: string) {
|
||||
return this.agentsService.getDevice(id);
|
||||
}
|
||||
|
||||
@Patch('devices/:id')
|
||||
updateDevice(
|
||||
@Param('id') id: string,
|
||||
@Body() body: UpdateProvisionedDeviceDto,
|
||||
) {
|
||||
return this.agentsService.updateDevice(id, body);
|
||||
}
|
||||
|
||||
@Get('ssh-keys')
|
||||
listSshKeys(@Query() query: ListLauncherSshKeysQuery) {
|
||||
return this.agentsService.listSshKeys(query);
|
||||
}
|
||||
|
||||
@Delete('ssh-keys/:id')
|
||||
removeSshKey(@Param('id') id: string) {
|
||||
return this.agentsService.removeSshKey(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user