Skip to main content

Services

List all services

Request

Definition

GET /api/v1/services

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}

Query string parameters

ParameterTypeRequiredDescription
paginatebooleanNoIf the result must be paginated.
pageintegerYes if paginate is truePage index.
page_sizeintegerYes if paginate is trueNumber of items displayed per page.
service_name_searchstringNoFilters services whose name matches all or part of the string entered.
service_name_listarray<string>NoFilters services whose name matches one of the list items.
host_name_searchstringNoFilters services that contain a Host whose name matches all or part of the string entered.

Response

Status codes

Status codeMessage
200"List of services"
400"Error with pagination fields"
403"Forbidden"

Body

  • data.services.id string

    Service ID.

  • data.services.created_at string

    Creation date of service.

  • data.services.updated_at string

    Update date of service.

  • data.services.name string

    Service name.

  • data.services.is_monitored boolean

    Indicates 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.

List a specific service

Request

Definition

GET /api/v1/services/{id}

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}

Response

Status codes

Status codeMessage
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 required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/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 codeMessage
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 required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Request body

{
"attrs": {
"description": "New description"
}
}

Response

Status codes

Status codeMessage
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 required

    Authentication token with privileges to view the resource.

    Bearer {token}

Response

Status codes

Status codeMessage
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 required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Request body

{
"service_ids": [
"kb+UUJ95RqfrIPfmjphO3RNAs9HFJkD0"
]
}

Response

Status codes

Status codeMessage
200"Services succesfully deleted"
400"Error deleting services"
403"Forbidden"

Body

{
"message": "Services succesfully deleted",
"status": "ok"
}