Deletes an analysis from your application.
https://help.tago.io/portal/en/kb/tagoio/analysis Analysis
If receive an error "Authorization Denied", check policy Analysis / Delete in Access Management.
const result = await Resources.analysis.delete("analysis-id-123");
console.log(result); // Successfully Removed
Optional
options: { Optional
version?: numberGets a download URL for the analysis script.
https://help.tago.io/portal/en/kb/tagoio/analysis Analysis
If receive an error "Authorization Denied", check policy Analysis / Download Analysis Script in Access Management.
const download = await Resources.analysis.downloadScript("analysis-id-123", { version: 1 });
console.log(download.url);
Modifies an existing analysis.
https://help.tago.io/portal/en/kb/tagoio/analysis Analysis
If receive an error "Authorization Denied", check policy Analysis / Create in Access Management.
const result = await Resources.analysis.edit("analysis-id-123", {
name: "Updated Analysis",
active: false
});
console.log(result); // Successfully Updated
Retrieves detailed information about a specific analysis.
https://help.tago.io/portal/en/kb/tagoio/analysis Analysis
If receive an error "Authorization Denied", check policy Analysis / Access in Access Management.
const analysisInfo = await Resources.analysis.info("analysis-id-123");
console.log(analysisInfo);
Optional
queryObj: TLists all analyses from the application with pagination support. Use this to retrieve and manage analyses in your application.
https://help.tago.io/portal/en/kb/tagoio/analysis Analysis
If receive an error "Authorization Denied", check policy Analysis / Access in Access Management.
const list = await Resources.analysis.list({
page: 1,
fields: ["id", "name"],
amount: 10,
orderBy: ["name", "asc"]
});
console.log(list); // [ { id: 'analysis-id-123', name: 'Analysis Test', ...} ]
Optional
scopeObj: anyExecutes an analysis with optional scope parameters.
https://help.tago.io/portal/en/kb/tagoio/analysis Analysis
If receive an error "Authorization Denied", check policy Analysis / Run Analysis in Access Management.
const result = await Resources.analysis.run("analysis-id-123", { environment: "production" });
console.log(result.analysis_token);
Generates a new token for the analysis.
This is only allowed when the analysis is running in external mode.
https://help.tago.io/portal/en/kb/tagoio/analysis Analysis
const resources = new Resources({ token: "YOUR-PROFILE-TOKEN" });
const token = await resources.analysis.tokenGenerate("analysis-id-123");
console.log(token.analysis_token); // analysis-token-123
Uploads a script file to an analysis.
https://help.tago.io/portal/en/kb/tagoio/analysis Analysis
If receive an error "Authorization Denied", check policy Analysis / Upload Analysis Script in Access Management.
const result = await Resources.analysis.uploadScript("analysis-id-123", {
name: "script.js",
content: "base64-encoded-content",
language: "node"
});
console.log(result);
Description
Creates a new analysis in your application.
See
https://help.tago.io/portal/en/kb/articles/120-creating-analysis Creating Analysis
Example
If receive an error "Authorization Denied", check policy Analysis / Create in Access Management.