Skip to main content

Schedules

List all schedules

Request

Definition

GET /api/v1/reports/schedules

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}

Query string parameter

ParameterTypeRequiredDescription
paginatebooleanYesIf the result must be paginated.
pageintegerYes if paginate is truePage index.
page_sizeintegerYes if paginate is trueNumber of items displayed per page.
idintegerNoFilters the results related to the schedule ID entered.
id_listarray<string>NoFilters the results related to the schedule IDs contained in the specified list.
namestringNoFilters the results whose schedule name matches all or part of the specified string.
typestringNoFilters the results whose schedule type matches the one entered.
schedulestringNoFilters the results related to the specified report run frequency.
scheduled_at_startintegerNoFilters reports scheduled after the date entered.
scheduled_by_endintegerNoFilters reports scheduled before the date entered.
scheduled_bystringNoFilters the results where the user specified in scheduled_by matches the one entered.

Response

Status codes

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

Body

  • data.registries.name string

    Schedule name.

  • data.registries.id string

    Schedule ID.

  • data.registries.hosts array<string>

    Hosts reported and observed in the report.

  • data.registries.end_timestamp integer

    Date the report was last executed, in UNIX format (microseconds).

  • data.registries.start_timestamp integer

    Date of the first execution of the report in UNIX format (microseconds).

  • data.registries.scheduled_by string

    Name of the user who created the schedule.

  • data.registries.scheduled_at integer

    Date the schedule was created in UNIX format (microseconds).

  • data.registries.schedule integer

    Frequency of planned creation.

  • data.registries.type string

    The type of planning.

  • data.registries.send_to string

    Email address to which the report will be sent.

  • data.registries.send_via string

    Method used to send the report.

  • data.registries.services array<string>

    Domain Groups involved in the report.

  • data.registries.timezone string

    Timezone associated with the time interval for which the report was created.

List a specific schedule

Request

Definition

GET /api/v1/reports/schedules/{schedule_id}

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}

Response

Status codes

Status codeMessage
200"Report schedule retrieved"
400"Error retrieving schedules"
400"Error with pagination fields"
403"Forbidden"

Body

{
"data": {
"schedule": {
"end_timestamp": null,
"hosts": [
"www.service-test-host.it"
],
"id": "407xxxab-xxxx-4b04-xxxx-7xxxcdxxa2x8",
"name": "one_shot_generic",
"schedule": "daily",
"scheduled_at": 1705497139412776,
"scheduled_by": "username",
"send_to": [
"test@test.it"
],
"send_via": "email",
"services": null,
"start_timestamp": null,
"timezone": "Europe/Rome",
"type": "generic"
}
},
"message": "Report schedule retrieved",
"status": "ok"
}

Create a schedule

Request

Definition

POST /api/v1/reports/schedules

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Request body

{
"attrs": {
"hosts": [
"www.service-test-host.it"
],
"name": "one_shot_generic",
"schedule": "daily",
"send_to": [
"test@test.it"
],
"send_via": "email",
"timezone": "Europe/Rome",
"type": "generic"
}
}

Response

Status codes

Status codeMessage
200"Report schedule created succesfully"
400"Error creating new schedule"
403"Forbidden"

Body

{
"data": {
"schedule": {
"end_timestamp": null,
"hosts": [
"www.service-test-host.it"
],
"id": "09x04xx2-xxxx-48b5-xxxx-2x0xxx263xxf",
"name": "one_shot_generic",
"schedule": "daily",
"scheduled_at": 1705497138483506,
"scheduled_by": "username",
"send_to": [
"test@test.it"
],
"send_via": "email",
"services": null,
"start_timestamp": null,
"timezone": "Europe/Rome",
"type": "generic"
}
},
"message": "Report schedule created succesfully",
"status": "ok"
}

Update a schedule

Request

Definition

PUT /api/v1/reports/schedules/{schedule_id}

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}
  • Content-Type required

    application/json

Request body

{
"attrs": {
"send_to": [
"test@test.it",
"test2@test.it"
],
"send_via": "email"
}
}

Response

Status codes

Status codeMessage
200"Report schedule updated succesfully"
400"Error updating schedule"
403"Forbidden"

Body

{
"data": {
"schedule": {
"end_timestamp": null,
"hosts": [
"www.service-test-host.it"
],
"id": "09x04xx2-xxxx-48b5-xxxx-2x0xxx263xxf",
"name": "one_shot_generic",
"schedule": "daily",
"scheduled_at": 1705497136642579,
"scheduled_by": "username",
"send_to": [
"test@test.it",
"test2@test.it"
],
"send_via": "email",
"services": null,
"start_timestamp": null,
"timezone": "Europe/Rome",
"type": "generic"
}
},
"message": "Report schedule updated succesfully",
"status": "ok"
}

Delete multiple schedules

Request

Definition

DELETE /api/v1/reports/registries

Headers

  • Authorization required

    Authentication token with privileges to view the resource.

    Bearer {token}

Request body

{
"schedules_ids": [
"09x04xx2-xxxx-48b5-xxxx-2x0xxx263xxf"
]
}

Response

Status codes

Status codeMessage
200"Schedules succesfully deleted"
400"Error deleting report schedules"
403"Forbidden"

Body

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