Difference between revisions of "Automate Update data/pt-br"

From TaticView
Jump to: navigation, search
(Updating to match new version of source page)
Line 2: Line 2:
  
  
== '''Data update automation on TaticView''' ==
+
== '''Automação de atualizações de dados no TaticView''' ==
  
 
Você pode através desse processo automatizar as atualizações das informações dos seus Arquivos de Dados.
 
Você pode através desse processo automatizar as atualizações das informações dos seus Arquivos de Dados.
Line 13: Line 13:
  
  
Primeiramente baixe o instalador:
+
First download the installer:
 
* <u>[http://wiki.taticview.com/taticfiles/tvcli-windows-installer.exe Windows]</u>  
 
* <u>[http://wiki.taticview.com/taticfiles/tvcli-windows-installer.exe Windows]</u>  
  
Line 39: Line 39:
  
 
    
 
    
'''Via interface do TaticView'''
+
'''Through TacticView interface'''
# Identificar-se no TaticView e acessar o '''Minha Conta''' botão '''TOKENS DE ACESSO''';
+
# Identify yourself on TaticView and access the '''My account''' button '''ACCESS TOKENS''';
# Em [[File:identificacao-novo-token+pr-BR.png]] informe um nome para identificar o TOKEN DE ACESSO na lista e clique em '''Gerar novo TOKEN'''.
+
# On [[File:identificacao-novo-token+en-US.png]] enter a name to identify the ACCESS TOKEN on the list and then click on '''Generate new TOKEN'''.
# Um TOKEN DE ACESSO será gerado [[File:generated-token+pr-BR.png]]
+
# An ACCESS TOKEN will be generated [[File:generated-token+en-US.png]]
# Executar o TVCli informando o TOKEN DE ACESSO gerado
+
# Run TVcli informing the generated ACCESS TOKEN
  
 
     '''Sintaxe: tvcli -cmd store_token -user <usuário> -token <token gerado>'''
 
     '''Sintaxe: tvcli -cmd store_token -user <usuário> -token <token gerado>'''
Line 56: Line 56:
 
=== Atualizando de forma automatizada ===
 
=== Atualizando de forma automatizada ===
  
Somente é possível automatizar atualizações de arquivos de dados já criados no TaticView, portanto é necessário pelo menos uma importação manual para criar a estrutura necessária.
+
You can only automate the update of data sources that have been already created on TaticView, so you are going to need at least one manual import to create the necessary structure.
 +
Then you must grant the automatic import to the desired data file.
 +
To do this click on the imported file (On the TaticView interface), select '''Properties''', and check the checkbox '''Automatic Importation''', which displays the identifier code of your data file, as you can see in the example below:
  
Depois é necessário liberar a atualização automática para o Arquivo de Dados desejado.
+
[[File:datamart-dropdown+en-US.png]]
Para isso clique sobre o arquivo importado (na interface do TaticView), selecionar '''Propriedades''', e marcar o checkbox '''Importação automática''', o que exibirá o código identificador de seu arquivo de dados, como no exemplo abaixo:
 
  
[[File:datamart-dropdown+pr-BR.png]]
 
  
  
 
+
[[File:automatic-importation+en-US.png]]
[[File:automatic-importation+pr-BR.png]]
 
  
 
Estando o arquivo de dados previamente importado, liberado para atualização automática e você possuir o seu código identificador, será possível executar a importação por linha de comando.
 
Estando o arquivo de dados previamente importado, liberado para atualização automática e você possuir o seu código identificador, será possível executar a importação por linha de comando.
  
    '''Sintaxe: tvcli -cmd import_file -user <usuário> -datamart <identificador> -file "<arquivo/planilha>" [-type <tipo>] [-wait -[notifyshare]] [-nonotifyerror] '''
+
  '''Syntax: tvcli -cmd import_file -user <user name> -datamart <identifier> -file "<file/spreadsheet>" [-type <type>] [-wait -[notifyshare]] [-nonotifyerror] '''
  
   -cmd                  - import_file  - faz upload do arquivo de dados e coloca na fila de atualização
+
   -cmd                  - import_file  - uploads the data file and places it in the import queue
   -user                  - usuário TaticView  
+
   -user                  - TaticView user
   -datamart              - identificador do arquivo de dados obtido na opção propriedades do Arquivo de Dados na Interface.
+
   -datamart              - identifier of the data file obtained in the Data file properties at the interface.
   -file                  - arquivo de dados Texto (CSV) ou planilha (XLSX,XLS) que será importado.
+
   -file                  - Text data file (CSV) or spreadsheet (XLSX,XLS) to be imported.
   -type (opcional)      - clear_and_add - Exclui todos os dados do Arquivo de Dados do TaticView e importa os novos dados (default)
+
   -type (opcional)      - clear_and_add - Deletes all data from TaticView Data File and imports the new data. (default)
                           append        - Adiciona os novos dados ao final do Arquivo de Dados do TaticView. É necessário ter cuidado para não duplicar dados.
+
                           append        - Adds the new data at the end of the TaticView Data File. It is necessary to be careful not to duplicate any data.
   -wait (opcional)      - aguarda o final da importação. Necessário para testar '''Status de Saída'''
+
   -wait (opcional)      - waits for the end of the import. It is needed to test '''Output Status'''
   -nonotifyerror (opcional)    - não notifica o usuário caso ocorra um erro durante o processo
+
   -nonotifyerror (opcional)    - does not notify the user if an error occurs during the process
   -notifyshare (opcional) - envia notificação de atualização de dados para os usuários que tem painéis compartilhados desse arquivo de dados quando a importação termina sem erros. Funciona somente em conjunto com "-wait".
+
   -notifyshare (opcional) - sends data update notification to users who have these data file dashboards shared when the importing process ends without errors. Only works with -wait.
  
   '''Exemplos:'''
+
   '''Example:'''
   '''tvcli -cmd import_file -user meuemail@email.com -datamart 246 -file "c:\taticview\imp\planilha.xlsx"'''
+
   '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx"'''
   '''tvcli -cmd import_file -user meuemail@email.com -datamart 246 -file "c:\taticview\imp\arquivo.csv" -wait -notifyshare'''
+
   '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\file.csv" -wait -notifyshare'''
   '''tvcli -cmd import_file -user meuemail@email.com -datamart 246 -file "c:\taticview\imp\planilha.xlsx" -wait'''
+
   '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -wait'''
   '''tvcli -cmd import_file -user meuemail@email.com -datamart 246 -file "c:\taticview\imp\planilha.xlsx" -type clear_and_add'''
+
   '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -type clear_and_add'''
   '''tvcli -cmd import_file -user meuemail@email.com -datamart 246 -file "c:\taticview\imp\planilha.xlsx" -type append'''
+
   '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -type append'''
   '''tvcli -cmd import_file -user meuemail@email.com -datamart 246 -file "c:\taticview\imp\planilha.xlsx" -type append -nonotifyerror'''
+
   '''tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -type append -nonotifyerror'''
  
  
Line 104: Line 103:
 
   '''8 - Erro'''
 
   '''8 - Erro'''
  
Uma notificação será enviada para o usuário caso ocorra erro na atualização.
+
A notification is sent to the user if an error occurs during the import process.
Uma log com os detalhes das execuções será gerada no diretório de configurações do usuário (exemplo: C:\Usuários\<usuário>\AppData\Local\TVcli\Logs).
+
A log with the details of the executions will be generated in the configuration directory of the user (example: C: \ Users \ <user> \ AppData \ Local \ TVcli \ Logs).
  
  
Line 111: Line 110:
  
 
  '''@ECHO OFF'''
 
  '''@ECHO OFF'''
  '''call tvcli -cmd import_file -user jonathan@sadig.com -file "C:\Users\jonathan.SADIG\Documents\TaticView\Arquivos Importacao\vendas.xlsx" -datamart 674 -wait
+
  '''call tvcli -cmd import_file -user jonathan@sadig.com -file "C:\Users\jonathan.SADIG\Documents\TaticView\Import Files\sales.xlsx" -datamart 674 -wait
 
  '''if %errorlevel% == 0 (
 
  '''if %errorlevel% == 0 (
  '''echo "VENDAS atualizado com sucesso!"
+
  '''echo "SALES updated successfully!"
 
  ''') else (
 
  ''') else (
  '''echo "Problemas na atualizacao do VENDAS!"
+
  '''echo "Problems updating SALES!"
 
  ''')
 
  ''')
  '''call tvcli -cmd import_file -user jonathan@sadig.com -file "C:\Users\jonathan.Sadig\Documents\TaticView\Arquivos Importacao\rh.xlsx" -datamart 673 -wait
+
  '''call tvcli -cmd import_file -user jonathan@sadig.com -file "C:\Users\jonathan.Sadig\Documents\TaticView\Import Files\hr.xlsx" -datamart 673 -wait
 
  '''if %errorlevel% == 0 (
 
  '''if %errorlevel% == 0 (
   '''echo "RH atualizado com sucesso!"
+
   '''echo "HR updated successfully!"
 
  ''') else (
 
  ''') else (
   '''echo "Problemas na atualizacao do RH!"
+
   '''echo "Problems updating HR!"
 
  ''')'''
 
  ''')'''
  
Line 127: Line 126:
 
<span style="color: red;">'''Importante'''</span>
 
<span style="color: red;">'''Importante'''</span>
  
A versão free dá direito a automação da atualização de um Arquivo de Dados. Para automatizar atualizações de mais arquivos de dados será necessário configurar o Recurso de '''Atualização automática de dados''' na sua Assinatura.
+
The free version grants you automation import from only one data source. You need to configure the feature '''automatic data update''' in your subscription to automate the imports of more data sources.

Revision as of 18:56, 22 September 2017

Other languages:
English • ‎português do Brasil


Automação de atualizações de dados no TaticView

Você pode através desse processo automatizar as atualizações das informações dos seus Arquivos de Dados.

Para automatizar as atualizações de dados no TaticView são necessários alguns procedimentos de configuração e uso do programa de linha de comando TVCli.

Caso tenha dificuldades abra um ticket de suporte em https://support.taticview.com/open.php/?&lang=pt_br. Teremos prazer em lhe ajudar.

Instalando o TVCli

First download the installer:

Depois execute a instalação na mesma máquina onde estarão os arquivos que serão usados para as atualizações automáticas.

Geração do TOKEN DE ACESSO

É necessário possuir um TOKEN DE ACESSO cadastrado no TaticView e no TVCli antes de poder executar uma automação de atualização. Um TOKEN DE ACESSO está sempre associado a um usuário TaticView. O TOKEN DE ACESSO é como uma senha gerada pelo TaticView que permite acesso a sua conta pelo TVCli, ele pode ser revogado por você a qualquer momento, permitindo assim que você decida quem pode acessar sua conta no TaticView e quando.

É possível gerar o TOKEN DE ACESSO de duas maneiras:


Pelo TVCli

  1. Executar o comando via linha de comando pedindo geração de um novo TOKEN DE ACESSO
   Sintaxe: tvcli -cmd get_token_by_password -user <usuário> -password <senha> [-token_name "<nome do token>"]
 -cmd                   - get_token_by_password - Solicita e armazena o TOKEN DE ACESSO via linha de comando (TVCli)
 -user                  - usuário TaticView 
 -password              - senha TaticView
 -token_name (opcional) - Nome que você quer dar ao TOKEN DE ACESSO. Nome default "TaticView CLI"          
   Exemplo: tvcli -cmd get_token_by_password -user meuemail@email.com -password 123466 -token_name "TVCli Servidor 1"


Through TacticView interface

  1. Identify yourself on TaticView and access the My account button ACCESS TOKENS;
  2. On Identificacao-novo-token+en-US.png enter a name to identify the ACCESS TOKEN on the list and then click on Generate new TOKEN.
  3. An ACCESS TOKEN will be generated Generated-token+en-US.png
  4. Run TVcli informing the generated ACCESS TOKEN
   Sintaxe: tvcli -cmd store_token -user <usuário> -token <token gerado>
 -cmd   - store_token - armazena token gerado pela interface
 -user  - usuário TaticView 
 -token - token gerado pela interface
   Exemplo: tvcli -cmd store_token -user meuemail@email.com -token 9bdr845gh5r4r1vd5d5


Atualizando de forma automatizada

You can only automate the update of data sources that have been already created on TaticView, so you are going to need at least one manual import to create the necessary structure. Then you must grant the automatic import to the desired data file. To do this click on the imported file (On the TaticView interface), select Properties, and check the checkbox Automatic Importation, which displays the identifier code of your data file, as you can see in the example below:

Datamart-dropdown+en-US.png


File:Automatic-importation+en-US.png

Estando o arquivo de dados previamente importado, liberado para atualização automática e você possuir o seu código identificador, será possível executar a importação por linha de comando.

 Syntax: tvcli -cmd import_file -user <user name> -datamart <identifier> -file "<file/spreadsheet>" [-type <type>] [-wait -[notifyshare]] [-nonotifyerror] 
 -cmd                   - import_file   - uploads the data file and places it in the import queue
 -user                  - TaticView user 
 -datamart              - identifier of the data file obtained in the Data file properties at the interface.
 -file                  - Text data file (CSV) or spreadsheet (XLSX,XLS) to be imported.
 -type (opcional)       - clear_and_add - Deletes all data from TaticView Data File and imports the new data. (default)
                          append        - Adds the new data at the end of the TaticView Data File. It is necessary to be careful not to duplicate any data.
 -wait (opcional)       - waits for the end of the import.  It is needed to test Output Status
 -nonotifyerror (opcional)    - does not notify the user if an error occurs during the process
 -notifyshare (opcional) - sends data update notification to users who have these data file dashboards shared when the importing process ends without errors. Only works with -wait.
 Example:
 tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx"
 tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\file.csv" -wait -notifyshare
 tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -wait
 tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -type clear_and_add
 tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -type append
 tvcli -cmd import_file -user myemail@email.com -datamart 246 -file "c:\taticview\imp\spreadsheet.xlsx" -type append -nonotifyerror


Versão TVCli

Mostra a versão do TVCli na console e registra na log.

   Sintaxe: tvcli -version


Teste de retorno do comando

O executável do TVCli retorna códigos distintos para informar o sucesso ou falha na execução.

 0 - Sucesso
 8 - Erro

A notification is sent to the user if an error occurs during the import process. A log with the details of the executions will be generated in the configuration directory of the user (example: C: \ Users \ <user> \ AppData \ Local \ TVcli \ Logs).


Exemplo de Script

@ECHO OFF
call tvcli -cmd import_file -user jonathan@sadig.com -file "C:\Users\jonathan.SADIG\Documents\TaticView\Import Files\sales.xlsx" -datamart 674 -wait
if %errorlevel% == 0 (
	echo "SALES updated successfully!"
) else (
	echo "Problems updating SALES!"
)
call tvcli -cmd import_file -user jonathan@sadig.com -file "C:\Users\jonathan.Sadig\Documents\TaticView\Import Files\hr.xlsx" -datamart 673 -wait
if %errorlevel% == 0 (
  	echo "HR updated successfully!"
) else (
  	echo "Problems updating HR!"
)


Importante

The free version grants you automation import from only one data source. You need to configure the feature automatic data update in your subscription to automate the imports of more data sources.