Devices API
Device management endpoints.
List Devices
GET /api/devices
Authorization: Bearer <token>
Query Parameters:
- page (int): Page number (default: 1)
- limit (int): Items per page (default: 50)
- type (string): Filter by device type
- tag (string): Filter by tag
Response:
{
"data": [
{
"id": "uuid",
"name": "router-01",
"hostname": "10.0.0.1",
"device_type": "cisco_ios",
"tags": ["core", "production"]
}
],
"total": 100,
"page": 1
}Create Device
POST /api/devices
Authorization: Bearer <token>
Content-Type: application/json
{
"name": "router-01",
"hostname": "10.0.0.1",
"device_type": "cisco_ios",
"port": 22,
"credential_id": "uuid",
"tags": ["core"]
}
Response: 201 Created
{
"id": "uuid",
"name": "router-01",
...
}Get Device
GET /api/devices/:id
Authorization: Bearer <token>
Response:
{
"id": "uuid",
"name": "router-01",
"hostname": "10.0.0.1",
"device_type": "cisco_ios",
"port": 22,
"credential_id": "uuid",
"tags": ["core"],
"created_at": "2024-01-15T10:00:00Z",
"updated_at": "2024-01-15T10:00:00Z"
}