GET /api/report_templates
Lista todos os modelos de relatório

GET /api/locations/:location_id/report_templates
Lista todos os modelos de relatório por local

GET /api/organizations/:organization_id/report_templates
Lista todos os modelos de relatório por organização

Parâmentros

Nome parâmetro Descrição
location_id
opcional

Escopo de localizações

Validations:

  • Must be a Integer

organization_id
opcional

Escopo de organização

Validations:

  • Must be a Integer

search
opcional

filtrar resultados

Validations:

  • Must be a String

order
opcional

Classificar campo e ordem, ex.: ‘id DESC’

Validations:

  • Must be a String

page
opcional

Número de página, iniciando em 1

Validations:

  • Must be a number.

per_page
opcional

Número de resultados por página para retornar

Validations:

  • Must be a number.

Pesquisar campos

Nome do campo Tipo Valores possíveis
default true, false
location
location_id
locked true, false
name
organization
organization_id
snippet true, false
template

GET /api/report_templates/:id
Mostrar um modelo de relatório

Parâmentros

Nome parâmetro Descrição
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
Criar um modelo de relatório

Parâmentros

Nome parâmetro Descrição
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 , nulo permitido

Validations:

  • Must be a String

report_template[template]
requerido

Validations:

  • Must be a String

report_template[snippet]
opcional , nulo permitido

Validations:

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

report_template[audit_comment]
opcional , nulo permitido

Validations:

  • Must be a String

report_template[locked]
opcional , nulo permitido

Se deve ou não o template está bloqueado para edição

Validations:

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

report_template[default]
opcional , nulo permitido

Define se o modelo é ou não adicionado automaticamente a novas organizações e locais

Validations:

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

report_template[location_ids]
opcional , nulo permitido

SUBSTITUIR localizações dadas com ids

Validations:

  • Must be an array of any type

report_template[organization_ids]
opcional , nulo permitido

SUBSTITUIR organizações dadas com ids

Validations:

  • Must be an array of any type


POST /api/report_templates/import
Importar um modelo de relatório

Parâmentros

Nome parâmetro Descrição
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

nome do modelo

Validations:

  • Must be a String

report_template[template]
opcional

conteúdos do modelo incluindo metadados

Validations:

  • Must be a String

report_template[location_ids]
opcional , nulo permitido

SUBSTITUIR localizações dadas com ids

Validations:

  • Must be an array of any type

report_template[organization_ids]
opcional , nulo permitido

SUBSTITUIR organizações dadas com ids

Validations:

  • Must be an array of any type

options
opcional

Validations:

  • Must be a Hash

options[force]
opcional , nulo permitido

use se você deseja atualizar modelos bloquados

Validations:

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

options[associate]
opcional , nulo permitido

determina quando o modelo deve associar objetos com base nos metadados. Novo significa somente quando um novo modelo está sendo criado; Sempre é para modelos novos e existentes que somente estão sendo atualizados; nunca ignora os metadados.

Validations:

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

options[lock]
opcional , nulo permitido

bloquear modelos importados (falso por padrão)

Validations:

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

options[default]
opcional , nulo permitido

faz o padrão do modelo, o que significa que ele será automaticamente associado a organizações e locais criados recentemente (falso por padrão)

Validations:

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


GET /api/report_templates/revision

Parâmentros

Nome parâmetro Descrição
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

versão do modelo

Validations:

  • Must be a String


PUT /api/report_templates/:id
Atualizar um modelo de relatório

Parâmentros

Nome parâmetro Descrição
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 , nulo permitido

Validations:

  • Must be a String

report_template[template]
opcional

Validations:

  • Must be a String

report_template[snippet]
opcional , nulo permitido

Validations:

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

report_template[audit_comment]
opcional , nulo permitido

Validations:

  • Must be a String

report_template[locked]
opcional , nulo permitido

Se deve ou não o template está bloqueado para edição

Validations:

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

report_template[default]
opcional , nulo permitido

Define se o modelo é ou não adicionado automaticamente a novas organizações e locais

Validations:

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

report_template[location_ids]
opcional , nulo permitido

SUBSTITUIR localizações dadas com ids

Validations:

  • Must be an array of any type

report_template[organization_ids]
opcional , nulo permitido

SUBSTITUIR organizações dadas com ids

Validations:

  • Must be an array of any type


DELETE /api/report_templates/:id
Excluir um modelo de relatório

Parâmentros

Nome parâmetro Descrição
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 um template

Parâmentros

Nome parâmetro Descrição
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

nome do modelo

Validations:

  • Must be a String


GET /api/report_templates/:id/export
Exportar um modelo de relatório para o ERB

Parâmentros

Nome parâmetro Descrição
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âmentros

Nome parâmetro Descrição
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 em que a chave é o nome da entrada, o valor é o valor para essa 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).

Exemplos

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âmentros

Nome parâmetro Descrição
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 em que a chave é o nome da entrada, o valor é o valor para essa 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âmentros

Nome parâmetro Descrição
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