Skip to content

Latest commit

 

History

History
984 lines (694 loc) · 70.4 KB

README.md

File metadata and controls

984 lines (694 loc) · 70.4 KB

Ingestions

(ingestions)

Available Operations

getRun

Read Ingestion Run

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.getRun({
    id: "<id>",
  });

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsGetRun } from "statsig/funcs/ingestionsGetRun.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsGetRun(statsig, {
    id: "<id>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionControllerGenIngestionRunRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionControllerGenIngestionRunResponseBody>

Errors

Error Object Status Code Content Type
errors.ConsoleV1IngestionControllerGenIngestionRunResponseBody 401 application/json
errors.ConsoleV1IngestionControllerGenIngestionRunIngestionsResponseBody 404 application/json
errors.SDKError 4xx-5xx /

listRuns

List Ingestion Runs

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.listRuns({});

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsListRuns } from "statsig/funcs/ingestionsListRuns.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsListRuns(statsig, {});

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionControllerGenIngestionRunsRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionControllerGenIngestionRunsResponseBody>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

backfill

Backfill Ingestion

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.backfill({
    ingestionBackfillContractDto: {
      datestampStart: "<value>",
      datestampEnd: "<value>",
      type: "redshift",
      dataset: "Events",
    },
  });

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsBackfill } from "statsig/funcs/ingestionsBackfill.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsBackfill(statsig, {
    ingestionBackfillContractDto: {
      datestampStart: "<value>",
      datestampEnd: "<value>",
      type: "bigquery-v2",
      dataset: "Metrics",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionControllerGenBackfillIngestionRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionControllerGenBackfillIngestionResponseBody>

Errors

Error Object Status Code Content Type
errors.ConsoleV1IngestionControllerGenBackfillIngestionResponseBody 400 application/json
errors.SDKError 4xx-5xx /

getSchedule

Read Ingestion Schedule

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.getSchedule({
    dataset: "Metrics",
  });

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsGetSchedule } from "statsig/funcs/ingestionsGetSchedule.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsGetSchedule(statsig, {
    dataset: "entity_properties",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionControllerGenReadIngestionScheduleRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionControllerGenReadIngestionScheduleResponseBody>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

updateSchedule

Update Ingestion Schedule

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.updateSchedule({
    ingestionScheduleUpdateContractDto: {
      dataset: "Metrics",
    },
  });

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsUpdateSchedule } from "statsig/funcs/ingestionsUpdateSchedule.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsUpdateSchedule(statsig, {
    ingestionScheduleUpdateContractDto: {
      dataset: "export_exposures",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionControllerGenUpdateIngestionScheduleRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionControllerGenUpdateIngestionScheduleResponseBody>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

get

Read Ingestion

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.get({
    type: "s3",
    dataset: "Events",
  });

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsGet } from "statsig/funcs/ingestionsGet.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsGet(statsig, {
    type: "azure-synapse",
    dataset: "entity_properties",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionControllerGenReadIngestionRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionControllerGenReadIngestionResponseBody>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

createSource

Create Ingestion Source

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.createSource({
  ingestionSourceCreateContractDto:     {
        dataset: "Events",
        type: "bigquery-v2",
        sourceName: "<value>",
      },
  });

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsCreateSource } from "statsig/funcs/ingestionsCreateSource.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsCreateSource(statsig, {
  ingestionSourceCreateContractDto:     {
        dataset: "Exposures",
        type: "redshift",
        sourceName: "<value>",
      },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionControllerGenCreateIngestionSourceRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionControllerGenCreateIngestionSourceResponseBody>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

updateSource

Update Ingestion Source

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.updateSource({
  ingestionUpdateContractDto:     {
        dataset: "Events",
        type: "adls",
      },
  });

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsUpdateSource } from "statsig/funcs/ingestionsUpdateSource.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsUpdateSource(statsig, {
  ingestionUpdateContractDto:     {
        dataset: "Events",
        type: "databricks",
      },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionControllerGenUpdateIngestionRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionControllerGenUpdateIngestionResponseBody>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

deleteSource

Delete Ingestion Source

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.deleteSource({
    type: "redshift",
    dataset: "export_exposures",
  });

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsDeleteSource } from "statsig/funcs/ingestionsDeleteSource.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsDeleteSource(statsig, {
    type: "azure-synapse",
    dataset: "entity_properties",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionControllerGenDeleteIngestionSourceRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionControllerGenDeleteIngestionSourceResponseBody>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

createConnectionDatabricks

Create Ingestion Databricks

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.createConnectionDatabricks({
    ingestionCreateDatabricksConnectionContractDto: {
      token: "<value>",
      host: "impressive-secretion.org",
      path: "/lost+found",
    },
  });

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsCreateConnectionDatabricks } from "statsig/funcs/ingestionsCreateConnectionDatabricks.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsCreateConnectionDatabricks(statsig, {
    ingestionCreateDatabricksConnectionContractDto: {
      token: "<value>",
      host: "bleak-workhorse.org",
      path: "/etc/defaults",
    },
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionConnectionControllerGenCreateIngestionDatabricksRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionConnectionControllerGenCreateIngestionDatabricksResponseBody>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getEventCount

Get Ingestion Event Count

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.getEventCount({
    startDate: "<value>",
    endDate: "<value>",
  });

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsGetEventCount } from "statsig/funcs/ingestionsGetEventCount.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsGetEventCount(statsig, {
    startDate: "<value>",
    endDate: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionEventsControllerGenIngestionEventCountRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionEventsControllerGenIngestionEventCountResponseBody>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getEventDeltaLedger

Get Ingestion Event Delta Ledger

Example Usage

import { Statsig } from "statsig";

const statsig = new Statsig({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const result = await statsig.ingestions.getEventDeltaLedger({
    startDate: "<value>",
    endDate: "<value>",
  });

  // Handle the result
  console.log(result)
}

run();

Standalone function

The standalone function version of this method:

import { StatsigCore } from "statsig/core.js";
import { ingestionsGetEventDeltaLedger } from "statsig/funcs/ingestionsGetEventDeltaLedger.js";

// Use `StatsigCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const statsig = new StatsigCore({
  statsigApiKey: "<YOUR_API_KEY_HERE>",
});

async function run() {
  const res = await ingestionsGetEventDeltaLedger(statsig, {
    startDate: "<value>",
    endDate: "<value>",
  });

  if (!res.ok) {
    throw res.error;
  }

  const { value: result } = res;

  // Handle the result
  console.log(result)
}

run();

Parameters

Parameter Type Required Description
request operations.ConsoleV1IngestionEventsControllerGenIngestionDeltaLedgerRequest ✔️ The request object to use for the request.
options RequestOptions Used to set various options for making HTTP requests.
options.fetchOptions RequestInit Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All Request options, except method and body, are allowed.
options.retries RetryConfig Enables retrying HTTP requests under certain failure conditions.

Response

Promise<operations.ConsoleV1IngestionEventsControllerGenIngestionDeltaLedgerResponseBody>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /