cloudflare
Version:
The official TypeScript library for the Cloudflare API
250 lines • 8.62 kB
text/typescript
import { APIResource } from "../../../../core/resource.mjs";
import * as TestsAPI from "./tests.mjs";
import * as DEXAPI from "../dex.mjs";
import * as UniqueDevicesAPI from "./unique-devices.mjs";
import { BaseUniqueDevices, UniqueDeviceListParams, UniqueDevices } from "./unique-devices.mjs";
import { PagePromise, V4PagePagination, type V4PagePaginationParams } from "../../../../core/pagination.mjs";
import { RequestOptions } from "../../../../internal/request-options.mjs";
export declare class BaseTests extends APIResource {
static readonly _key: readonly ['zeroTrust', 'dex', 'tests'];
/**
* List DEX tests with overview metrics.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const tests of client.zeroTrust.dex.tests.list({
* account_id: '01a7362d577a6c3019a474fd6f485823',
* })) {
* // ...
* }
* ```
*/
list(params: TestListParams, options?: RequestOptions): PagePromise<TestsV4PagePagination, Tests>;
}
export declare class Tests extends BaseTests {
uniqueDevices: UniqueDevicesAPI.UniqueDevices;
}
export type TestsV4PagePagination = V4PagePagination<Tests>;
export interface AggregateTimePeriod {
units: 'hours' | 'days' | 'testRuns';
value: number;
}
export interface Tests {
overviewMetrics: Tests.OverviewMetrics;
/**
* array of test results objects.
*/
tests: Array<Tests.Test>;
}
export declare namespace Tests {
interface OverviewMetrics {
/**
* number of tests.
*/
testsTotal: number;
/**
* percentage availability for all HTTP test results in response.
*/
avgHttpAvailabilityPct?: number | null;
/**
* percentage availability for all traceroutes results in response.
*/
avgTracerouteAvailabilityPct?: number | null;
}
interface Test {
/**
* API Resource UUID tag.
*/
id: string;
/**
* date the test was created.
*/
created: string;
/**
* the test description defined during configuration
*/
description: string;
/**
* if true, then the test will run on targeted devices. Else, the test will not
* run.
*/
enabled: boolean;
host: string;
/**
* The interval at which the synthetic application test is set to run.
*/
interval: string;
/**
* test type, http or traceroute
*/
kind: 'http' | 'traceroute';
/**
* name given to this test
*/
name: string;
updated: string;
httpResults?: Test.HTTPResults | null;
httpResultsByColo?: Array<Test.HTTPResultsByColo>;
/**
* for HTTP, the method to use when running the test
*/
method?: string;
target_policies?: Array<DEXAPI.DigitalExperienceMonitor> | null;
targeted?: boolean;
tracerouteResults?: Test.TracerouteResults | null;
tracerouteResultsByColo?: Array<Test.TracerouteResultsByColo>;
}
namespace Test {
interface HTTPResults {
resourceFetchTime: HTTPResults.ResourceFetchTime;
}
namespace HTTPResults {
interface ResourceFetchTime {
history: Array<ResourceFetchTime.History>;
avgMs?: number | null;
overTime?: ResourceFetchTime.OverTime | null;
}
namespace ResourceFetchTime {
interface History {
timePeriod: TestsAPI.AggregateTimePeriod;
avgMs?: number | null;
deltaPct?: number | null;
}
interface OverTime {
timePeriod: TestsAPI.AggregateTimePeriod;
values: Array<OverTime.Value>;
}
namespace OverTime {
interface Value {
avgMs: number;
timestamp: string;
}
}
}
}
interface HTTPResultsByColo {
/**
* Cloudflare colo
*/
colo: string;
resourceFetchTime: HTTPResultsByColo.ResourceFetchTime;
}
namespace HTTPResultsByColo {
interface ResourceFetchTime {
history: Array<ResourceFetchTime.History>;
avgMs?: number | null;
overTime?: ResourceFetchTime.OverTime | null;
}
namespace ResourceFetchTime {
interface History {
timePeriod: TestsAPI.AggregateTimePeriod;
avgMs?: number | null;
deltaPct?: number | null;
}
interface OverTime {
timePeriod: TestsAPI.AggregateTimePeriod;
values: Array<OverTime.Value>;
}
namespace OverTime {
interface Value {
avgMs: number;
timestamp: string;
}
}
}
}
interface TracerouteResults {
roundTripTime: TracerouteResults.RoundTripTime;
}
namespace TracerouteResults {
interface RoundTripTime {
history: Array<RoundTripTime.History>;
avgMs?: number | null;
overTime?: RoundTripTime.OverTime | null;
}
namespace RoundTripTime {
interface History {
timePeriod: TestsAPI.AggregateTimePeriod;
avgMs?: number | null;
deltaPct?: number | null;
}
interface OverTime {
timePeriod: TestsAPI.AggregateTimePeriod;
values: Array<OverTime.Value>;
}
namespace OverTime {
interface Value {
avgMs: number;
timestamp: string;
}
}
}
}
interface TracerouteResultsByColo {
/**
* Cloudflare colo
*/
colo: string;
roundTripTime: TracerouteResultsByColo.RoundTripTime;
}
namespace TracerouteResultsByColo {
interface RoundTripTime {
history: Array<RoundTripTime.History>;
avgMs?: number | null;
overTime?: RoundTripTime.OverTime | null;
}
namespace RoundTripTime {
interface History {
timePeriod: TestsAPI.AggregateTimePeriod;
avgMs?: number | null;
deltaPct?: number | null;
}
interface OverTime {
timePeriod: TestsAPI.AggregateTimePeriod;
values: Array<OverTime.Value>;
}
namespace OverTime {
interface Value {
avgMs: number;
timestamp: string;
}
}
}
}
}
}
export interface TestListParams extends V4PagePaginationParams {
/**
* Path param: Unique Cloudflare account ID.
*/
account_id: string;
/**
* Query param: Optionally filter result stats to a Cloudflare colo. Cannot be used
* in combination with deviceId param.
*/
colo?: string;
/**
* Query param: Optionally filter result stats to a specific device(s). Cannot be
* used in combination with colo param.
*/
deviceId?: Array<string>;
/**
* Query param: Filter by test type.
*/
kind?: 'http' | 'traceroute';
/**
* Query param: Optionally filter results to a specific device registration. Must
* be used in combination with a single deviceId.
*/
registration_id?: string;
/**
* Query param: Optionally filter results by test name.
*/
testName?: string;
}
export declare namespace Tests {
export { type AggregateTimePeriod as AggregateTimePeriod, type Tests as Tests, type TestsV4PagePagination as TestsV4PagePagination, type TestListParams as TestListParams, };
export { type UniqueDevices as UniqueDevices, BaseUniqueDevices as BaseUniqueDevices, type UniqueDeviceListParams as UniqueDeviceListParams, };
}
//# sourceMappingURL=tests.d.mts.map