Services
List all services
Request
Definition
GET /api/v1/services
Headers
-
Authorization
requiredAuthentication token with privileges to view the resource.
Bearer {token}
Query string parameters
Parameter | Type | Required | Description |
---|---|---|---|
paginate | boolean | No | If the result must be paginated. |
page | integer | Yes if paginate is true | Page index. |
page_size | integer | Yes if paginate is true | Number of items displayed per page. |
service_name_search | string | No | Filters services whose name matches all or part of the string entered. |
service_name_list | array<string> | No | Filters services whose name matches one of the list items. |
host_name_search | string | No | Filters services that contain a Host whose name matches all or part of the string entered. |
Response
Status codes
Status code | Message |
---|---|
200 | "List of services" |
400 | "Error with pagination fields" |
403 | "Forbidden" |
Body
- Attributes
- Example
-
data.services.id
stringService ID.
-
data.services.created_at
stringCreation date of service.
-
data.services.updated_at
stringUpdate date of service.
-
data.services.name
stringService name.
-
data.services.is_monitored
booleanIndicates if the requests associated with the Domain Group are analysed by the software.
-
data.services.hosts
array<string>Hosts that are part of the service.
{
"data": {
"services": [
{
"created_at": "2024-01-17T13:12:04Z",
"description": "Testing service",
"hosts": [],
"id": "kb+XUJxxxxxrIPfmjpxxxxxAs9HFJkD0",
"is_monitored": true,
"name": "www.xxxxxxxxxxxx.it",
"updated_at": "2024-01-17T13:12:04Z"
}
]
},
"message": "List of services",
"pagination": {
"first": 1,
"last": 1,
"page": 0,
"total_count": 1,
"total_pages": 1
},
"status": "ok"
}
List a specific service
Request
Definition
GET /api/v1/services/{id}
Headers
-
Authorization
requiredAuthentication token with privileges to view the resource.
Bearer {token}
Response
Status codes
Status code | Message |
---|---|
200 | "Application retrieved." |
400 | "Error retrieving service." |
403 | "Forbidden" |
Body
{
"data": {
"service": {
"created_at": "2024-01-17T13:12:08Z",
"description": "Testing service",
"hosts": [],
"id": "kb+UUJ95RqfrIPfmjphO3RNAs9HFJkD0",
"is_monitored": true,
"name": "www.xxxxxxxxxxxx.it",
"updated_at": "2024-01-17T13:12:08Z"
}
},
"message": "Application retrieved.",
"status": "ok"
}
Create a service
Request
Definition
POST /api/v1/services
Headers
-
Authorization
requiredAuthentication token with privileges to view the resource.
Bearer {token}
-
Content-Type
requiredapplication/json
Request body
{
"attrs": [
{
"description": "Testing service",
"host_ids": [
"kb+UUJ95RqfrIPfmjphO3UEZGo2Nq4pbAp0yNWgnZrc="
],
"is_monitored": true,
"name": "www.service-test.it"
},
{
"description": "Testing service",
"host_ids": [
"kb+UUJ95RqfrIPfmjphO3bdcvMr4cF3C5JkygNi4OBA="
],
"is_monitored": true,
"name": "www.service-test2.it"
}
]
}
Response
Status codes
Status code | Message |
---|---|
200 | "Services created succesfully." |
400 | "Error creating new services." |
403 | "Forbidden" |
Body
{
"data": {
"service_names": [
"www.service-test2.it",
"www.service-test.it"
]
},
"message": "Services created succesfully.",
"status": "ok"
}
Updates specific service
Request
Definition
PUT /api/v1/services/{id}
Headers
-
Authorization
requiredAuthentication token with privileges to view the resource.
Bearer {token}
-
Content-Type
requiredapplication/json
Request body
{
"attrs": {
"description": "New description"
}
}
Response
Status codes
Status code | Message |
---|---|
200 | "Service updated successfully." |
400 | "Error updating the service." |
403 | "Forbidden" |
Body
{
"data": {
"service": {
"created_at": "2024-01-17T13:12:10Z",
"description": "New description",
"hosts": [],
"id": "kb+UUJ95RqfrIPfmjphO3RNAs9HFJkD0",
"is_monitored": true,
"name": "www.service-test.it",
"updated_at": "2024-01-17T13:12:10Z"
}
},
"message": "Service updated succesfully.",
"status": "ok"
}
Delete specific service
Request
Definition
DELETE /api/v1/services/{id}
Headers
-
Authorization
requiredAuthentication token with privileges to view the resource.
Bearer {token}
Response
Status codes
Status code | Message |
---|---|
200 | "Service succesfully deleted" |
400 | "Error deleting service" |
403 | "Forbidden" |
Body
{
"message": "Services succesfully deleted",
"status": "ok"
}
Deletes multiple services
Request
Definition
DELETE /api/v1/services
Headers
-
Authorization
requiredAuthentication token with privileges to view the resource.
Bearer {token}
-
Content-Type
requiredapplication/json
Request body
{
"service_ids": [
"kb+UUJ95RqfrIPfmjphO3RNAs9HFJkD0"
]
}
Response
Status codes
Status code | Message |
---|---|
200 | "Services succesfully deleted" |
400 | "Error deleting services" |
403 | "Forbidden" |
Body
{
"message": "Services succesfully deleted",
"status": "ok"
}