GET /api/report_templates
Enumerar todas las plantillas de informe

GET /api/locations/:location_id/report_templates
Enumerar todas las plantillas de informe por ubicación

GET /api/organizations/:organization_id/report_templates
Enumerar todas las plantillas de informe por organización

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Alcance por ubicación

Validations:

  • Must be a Integer

organization_id
opcional

Alcance por organización

Validations:

  • Must be a Integer

search
opcional

filtrar resultados

Validations:

  • Must be a String

order
opcional

Orden y campo de clasificación, p. ej., 'id DESC'

Validations:

  • Must be a String

page
opcional

Número de página, comenzando por 1

Validations:

  • Must be a number.

per_page
opcional

Número de resultados por página para devolver

Validations:

  • Must be a number.

Campos de búsqueda

Nombre del campo Tipo Valores posibles
default true, false
location
location_id
locked true, false
name
organization
organization_id
snippet true, false
template

GET /api/report_templates/:id
Mostrar una plantilla de informe

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/report_templates
Crear una plantilla de informe

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

report_template
requerido

Validations:

  • Must be a Hash

report_template[name]
requerido

Validations:

  • Must be a String

report_template[description]
opcional , nil permitido

Validations:

  • Must be a String

report_template[template]
requerido

Validations:

  • Must be a String

report_template[snippet]
opcional , nil permitido

Validations:

  • Must be one of: true, false, 1, 0.

report_template[audit_comment]
opcional , nil permitido

Validations:

  • Must be a String

report_template[locked]
opcional , nil permitido

Si la plantilla está bloqueada o no para edición

Validations:

  • Must be one of: true, false, 1, 0.

report_template[default]
opcional , nil permitido

Si la plantilla se agrega automáticamente a nuevas ubicaciones y organizaciones

Validations:

  • Must be one of: true, false, 1, 0.

report_template[location_ids]
opcional , nil permitido

REMPLAZAR ubicaciones con ID dadas

Validations:

  • Must be an array of any type

report_template[organization_ids]
opcional , nil permitido

REMPLAZAR organizaciones con ID dadas.

Validations:

  • Must be an array of any type


POST /api/report_templates/import
Importar una plantilla de informe

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

report_template
requerido

Validations:

  • Must be a Hash

report_template[name]
opcional

nombre de plantilla

Validations:

  • Must be a String

report_template[template]
opcional

contenidos de plantillas incluidos los metadatos

Validations:

  • Must be a String

report_template[location_ids]
opcional , nil permitido

REMPLAZAR ubicaciones con ID dadas

Validations:

  • Must be an array of any type

report_template[organization_ids]
opcional , nil permitido

REMPLAZAR organizaciones con ID dadas.

Validations:

  • Must be an array of any type

options
opcional

Validations:

  • Must be a Hash

options[force]
opcional , nil permitido

utilizar si desea actualizar las plantillas bloqueadas

Validations:

  • Must be one of: true, false, 1, 0.

options[associate]
opcional , nil permitido

determina los casos en que la plantilla debería asociar objetos en función de los metadatos, nuevo se aplica solo a los casos de plantilla nueva que se está creando, siempre se aplica tanto a plantilla nueva como existente que solo se están actualizando, nunca ignora los metadatos

Validations:

  • Must be one of: new, always, never.

options[lock]
opcional , nil permitido

bloquear plantillas importadas (falso de manera predeterminada)

Validations:

  • Must be one of: true, false, 1, 0.

options[default]
opcional , nil permitido

configura la plantilla como predeterminada, lo que significa que se asociará automáticamente con las ubicaciones y organizaciones nuevas creadas (falso de manera predeterminada)

Validations:

  • Must be one of: true, false, 1, 0.


GET /api/report_templates/revision

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

version
opcional

versión de plantilla

Validations:

  • Must be a String


PUT /api/report_templates/:id
Actualizar una plantilla de informe

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be a String

report_template
requerido

Validations:

  • Must be a Hash

report_template[name]
opcional

Validations:

  • Must be a String

report_template[description]
opcional , nil permitido

Validations:

  • Must be a String

report_template[template]
opcional

Validations:

  • Must be a String

report_template[snippet]
opcional , nil permitido

Validations:

  • Must be one of: true, false, 1, 0.

report_template[audit_comment]
opcional , nil permitido

Validations:

  • Must be a String

report_template[locked]
opcional , nil permitido

Si la plantilla está bloqueada o no para edición

Validations:

  • Must be one of: true, false, 1, 0.

report_template[default]
opcional , nil permitido

Si la plantilla se agrega automáticamente a nuevas ubicaciones y organizaciones

Validations:

  • Must be one of: true, false, 1, 0.

report_template[location_ids]
opcional , nil permitido

REMPLAZAR ubicaciones con ID dadas

Validations:

  • Must be an array of any type

report_template[organization_ids]
opcional , nil permitido

REMPLAZAR organizaciones con ID dadas.

Validations:

  • Must be an array of any type


DELETE /api/report_templates/:id
Eliminar una plantilla de informe

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be a String


POST /api/report_templates/:id/clone
Clonar una plantilla

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

report_template
requerido

Validations:

  • Must be a Hash

report_template[name]
requerido

nombre de plantilla

Validations:

  • Must be a String


GET /api/report_templates/:id/export
Exportar una plantilla de informe a ERB

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.


POST /api/report_templates/:id/generate
Generate report from a template

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

input_values
opcional

Hash de valores de entrada donde la clave es el nombre de la entrada; el valor es el valor para esta entrada

Validations:

  • Must be a Hash

gzip
opcional

Compress the report uzing gzip

Validations:

  • Must be one of: true, false, 1, 0.

report_format
opcional

Report format, defaults to 'csv'

Validations:

  • Must be one of: csv, json, yaml, html.


POST /api/report_templates/:id/schedule_report
Schedule generating of a report

The reports are generated asynchronously. If mail_to is not given, action returns an url to get resulting report from (see report_data).

Ejemplos

POST /api/report_templates/:id/schedule_report/
200
{
  "job_id": UNIQUE-REPORT-GENERATING-JOB-UUID
  "data_url": "/api/v2/report_templates/1/report_data/UNIQUE-REPORT-GENERATING-JOB-UUID"
}

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

input_values
opcional

Hash de valores de entrada donde la clave es el nombre de la entrada; el valor es el valor para esta entrada

Validations:

  • Must be a Hash

gzip
opcional

Compress the report using gzip

Validations:

  • Must be one of: true, false, 1, 0.

mail_to
opcional

If set, scheduled report will be delivered via e-mail. Use ',' to separate multiple email addresses.

Validations:

  • Must be a String

generate_at
opcional

UTC time to generate report at

Validations:

  • Must be a String

report_format
opcional

Report format, defaults to 'csv'

Validations:

  • Must be one of: csv, json, yaml, html.


GET /api/report_templates/:id/report_data/:job_id
Downloads a generated report

Returns the report data as a raw response. In case the report hasn't been generated yet, it will return an empty response with http status 204 - NoContent.

Parámetros

Nombre del parámetro Descripción
location_id
opcional

Set the current location context for the request

Validations:

  • Must be a Integer

organization_id
opcional

Set the current organization context for the request

Validations:

  • Must be a Integer

id
requerido

Validations:

  • Must be an identifier, string from 1 to 128 characters containing only alphanumeric characters, space, underscore(_), hypen(-) with no leading or trailing space.

job_id
requerido

ID assigned to generating job by the schedule command

Validations:

  • Must be a String