mirror of
https://github.com/ferdzo/iotDashboard.git
synced 2026-04-05 17:16:26 +00:00
Functioning device manager with renew,revoke, updated model for cert id
This commit is contained in:
27
services/device_manager/app/models.py
Normal file
27
services/device_manager/app/models.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import datetime
|
||||
|
||||
from pydantic import BaseModel
|
||||
|
||||
class DeviceRegistrationRequest(BaseModel):
|
||||
"""Request model for registering a new device."""
|
||||
|
||||
name: str
|
||||
location: str | None = None
|
||||
|
||||
class DeviceRegistrationResponse(BaseModel):
|
||||
"""Response model after registering a new device."""
|
||||
|
||||
certificate_id: str
|
||||
device_id: str
|
||||
ca_certificate_pem: str
|
||||
certificate_pem: str
|
||||
private_key_pem: str
|
||||
expires_at: datetime.datetime
|
||||
|
||||
class DeviceResponse(BaseModel):
|
||||
"""Response model for device information."""
|
||||
|
||||
id: str
|
||||
name: str
|
||||
location: str | None = None
|
||||
created_at: datetime.datetime
|
||||
Reference in New Issue
Block a user