API: Discovery - Services
This guide explains how to manage discovered services via the API.
List Services
Retrieve a list of discovered services. Use query parameters for paging, sorting, and filtering.
Request:
| GET /api/v1/discovery/services?{PAGING-SORT-PARAMETERS} HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
Query parameters:
- page: Page number
- pageSize: Number of items per page
- sort: Sorting format {FIELD}:{ASC/DESC} (can be used multiple times)
- address: Filter by address (supports wildcards)
- protocol: Filter by protocol (supports wildcards)
- banner: Filter by banner (supports wildcards)
- port: Filter by port (supports wildcards)
- anyFieldContains: Search in all fields
Examples:
| GET /api/v1/discovery/services?page=0&pageSize=10&sort=address:asc HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
| GET /api/v1/discovery/services?page=0&pageSize=100&address=192.168* HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
| GET /api/v1/discovery/services?page=0&pageSize=100&port=443 HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
Get Service Details
Retrieve information for a specific service by its ID.
Request:
| GET /api/v1/discovery/service/{SERVICE-ID} HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|
Create a New Service
Add a new service by submitting the required configuration.
Request:
| POST /api/v1/discovery/services HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{SERVICE-CONF}
|
Example:
| POST /api/v1/discovery/services HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"address": "192.168.1.2",
"port": 443,
"protocol": "HTTPS",
"banner": "Apache/2.4.41 (Ubuntu)",
"note": "looks like a web server"
}
|
Update a Service
Modify details of an existing service.
Request:
| PATCH /api/v1/discovery/service/{SERVICE-ID} HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{SERVICE-CONF}
|
Example:
| PATCH /api/v1/discovery/service/c065edc0-8792-4a31-a194-5ab829b67e15 HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"protocol": "HTTPS",
"banner": "new banner"
}
|
Bulk Archive Services
Archive one or more services by providing their IDs.
Request:
| POST /api/v1/discovery/services/bulk-archive HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"serviceIds": [SERVICE-IDS]
}
|
Example:
| POST /api/v1/discovery/services/bulk-archive HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"serviceIds": ["b0561061-b8f2-4820-adb3-1a4a369ebb35", "215ds361-b232-4650-a5b3-354a369ebb36"]
}
|
Bulk Restore Services
Restore archived services using their IDs.
Request:
| POST /api/v1/discovery/services/bulk-restore HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"serviceIds": [SERVICE-IDS]
}
|
Example:
| POST /api/v1/discovery/services/bulk-restore HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
Content-Type: application/json
{
"serviceIds": ["b0561061-b8f2-4820-adb3-1a4a369ebb35", "215ds361-b232-4650-a5b3-354a369ebb36"]
}
|
Get Service Events
Retrieve events related to a specific service.
Request:
| GET /api/v1/discovery/services/{SERVICE-ID}/events HTTP/1.1
Authorization: Bearer {JWT_TOKEN}
|