Hierarchy

Constructors

Methods

  • Parameters

    Returns Promise<{
        id: string;
        token: string;
    }>

    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.

    const newAnalysis = await Resources.analysis.create({
    name: "My Analysis",
    type: "node",
    tags: [{ key: "type", value: "data-processing" }]
    });
    console.log(newAnalysis.id, newAnalysis.token); // analysis-id-123, analysis-token-123
  • Parameters

    • analysisID: string

    Returns Promise<string>

    Description

    Deletes an analysis from your application.

    See

    https://help.tago.io/portal/en/kb/tagoio/analysis Analysis

    Example

    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
  • Parameters

    • analysisID: string
    • Optional options: {
          version?: number;
      }
      • Optional version?: number

    Returns Promise<{
        expire_at: Date;
        size: number;
        size_unit: string;
        url: string;
    }>

    Description

    Gets a download URL for the analysis script.

    See

    https://help.tago.io/portal/en/kb/tagoio/analysis Analysis

    Example

    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);
  • Parameters

    Returns Promise<string>

    Description

    Modifies an existing analysis.

    See

    https://help.tago.io/portal/en/kb/tagoio/analysis Analysis

    Example

    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
  • Type Parameters

    Parameters

    • Optional queryObj: T

    Returns Promise<AnalysisListItem<T["fields"] extends (keyof AnalysisInfo)[]
        ? any[any][number]
        : "id" | "name">[]>

    Description

    Lists all analyses from the application with pagination support. Use this to retrieve and manage analyses in your application.

    See

    https://help.tago.io/portal/en/kb/tagoio/analysis Analysis

    Example

    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', ...} ]
  • Parameters

    • analysisID: string
    • Optional scopeObj: any

    Returns Promise<{
        analysis_token: string;
    }>

    Description

    Executes an analysis with optional scope parameters.

    See

    https://help.tago.io/portal/en/kb/tagoio/analysis Analysis

    Example

    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);
  • Parameters

    • analysisID: string

    Returns Promise<{
        analysis_token: string;
    }>

    Description

    Generates a new token for the analysis.

    Note

    This is only allowed when the analysis is running in external mode.

    See

    https://help.tago.io/portal/en/kb/tagoio/analysis Analysis

    Example

    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
  • Parameters

    Returns Promise<string>

    Description

    Uploads a script file to an analysis.

    See

    https://help.tago.io/portal/en/kb/tagoio/analysis Analysis

    Example

    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);