UNPKG

azure-kusto-ingest

Version:
53 lines 2.05 kB
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. import { ExponentialRetry } from "./retry.js"; import { createStatusTableClient } from "./resourceManager.js"; export const putRecordInTable = async (tableClient, entity) => { const retry = new ExponentialRetry(3, 1, 1); while (retry.shouldTry()) { try { await tableClient.createEntity(entity); } catch (ex) { await retry.backoff(); } } }; export var OperationStatus; (function (OperationStatus) { OperationStatus["Pending"] = "Pending"; OperationStatus["Succeede"] = "Succeeded"; OperationStatus["Failed"] = "Failed"; OperationStatus["Queued"] = "Queued"; OperationStatus["Skipped"] = "Skipped"; OperationStatus["PartiallySucceeded"] = "PartiallySucceeded"; })(OperationStatus || (OperationStatus = {})); export class TableReportIngestionResult { constructor(ingestionStatusInTableDescription, tableClient = null) { this.ingestionStatusInTableDescription = ingestionStatusInTableDescription; this.tableClient = tableClient; } async getIngestionStatusCollection() { if (!this.tableClient) { this.tableClient = createStatusTableClient(this.ingestionStatusInTableDescription.tableConnectionString); } return await this.tableClient.getEntity(this.ingestionStatusInTableDescription.partitionKey, this.ingestionStatusInTableDescription.rowKey); } } export class IngestionStatusResult { constructor(ingestionStatus) { this.ingestionStatus = ingestionStatus; this.ingestionStatus = ingestionStatus; } getIngestionStatusCollection() { return Promise.resolve(this.ingestionStatus); } } export class IngestionStatusInTableDescription { constructor(tableConnectionString, partitionKey, rowKey) { this.tableConnectionString = tableConnectionString; this.partitionKey = partitionKey; this.rowKey = rowKey; } } //# sourceMappingURL=ingestionResult.js.map