couchbase
Version:
The official Couchbase Node.js Client Library.
283 lines (282 loc) • 6.02 kB
TypeScript
import { ServiceType } from './generaltypes';
/**
* Represents the status of an an endpoint in a diagnostics report.
*
* @category Diagnostics
*/
export declare enum EndpointState {
/**
* Indicates the endpoint is disconnected.
*/
Disconnected = 0,
/**
* Indicates the endpoint is still connecting.
*/
Connecting = 1,
/**
* Indicates the endpoint is connected.
*/
Connected = 2,
/**
* Indicates the endpoint is disconnecting.
*/
Disconnecting = 3
}
/**
* Represents the status of an an endpoint in a ping report.
*/
export declare enum PingState {
/**
* Indicates the endpoint was pinged successfully.
*/
Ok = 0,
/**
* Indicates the endpoint timed out during the ping.
*/
Timeout = 1,
/**
* Indicates an error occured trying to ping the endpoint.
*/
Error = 2
}
/**
* The JSON-formated output report from a ping operation.
*
* @see {PingResult}
* @category Diagnostics
*/
export interface JsonPingReport {
version: number;
id: string;
sdk: string;
services: {
[serviceType: string]: {
latency_us: number;
remote: string;
local: string;
id: string;
state: string;
namespace?: string;
error?: string;
}[];
};
}
/**
* The JSON-formated output report from a diagnostics operation.
*
* @see {DiagnosticsResult}
* @category Diagnostics
*/
export interface JsonDiagnosticsReport {
version: number;
id: string;
sdk: string;
services: {
[serviceType: string]: {
last_activity_us?: number;
remote: string;
local: string;
id: string;
state: string;
namespace?: string;
details?: string;
}[];
};
}
/**
* PingEndpoint represents a single endpoint in a ping result.
*
* @category Diagnostics
*/
export declare class PingEndpoint {
/**
* @internal
*/
constructor(data: PingEndpoint);
/**
* The type of service this endpoint refers to.
*/
type: ServiceType;
/**
* The unique identifier for this endpoint.
*/
id: string;
/**
* The remote address of this endpoint.
*/
remote: string;
/**
* The local address of this endpoint.
*/
local: string;
/**
* The latency of the ping to the endpoint.
*/
latency: number;
/**
* The current state of this endpoint.
*/
state: PingState;
/**
* The bucket this endpoint is connected to.
*/
bucket?: string;
/**
* Information about errors that occured during pinging.
*/
error?: any;
}
/**
* PingResult represents the output of a ping operation.
*
* @category Diagnostics
*/
export declare class PingResult {
/**
* @internal
*/
constructor(data: {
version: number;
id: string;
sdk: string;
services: {
[serviceType: string]: PingEndpoint[];
};
});
/**
* The version number of this report.
*/
version: number;
/**
* The unique identifier for this report.
*/
id: string;
/**
* The name of the SDK which generated this report.
*/
sdk: string;
/**
* A list of service endpoints and their ping results.
*/
services: {
[serviceType: string]: PingEndpoint[];
};
/**
* Returns a JSON formatted ping report.
*/
toJSON(): JsonPingReport;
}
/**
* @category Diagnostics
*/
export interface PingOptions {
/**
* A unique identifier for the report generated by this operation.
*/
reportId?: string;
/**
* The services which should be pinged.
*/
serviceTypes?: ServiceType[];
/**
* The name of the bucket to ping.
*/
bucket?: string;
/**
* The timeout for this operation, represented in milliseconds.
*/
timeout?: number;
}
/**
* DiagnosticsEndpoint represents a single endpoint in a diagnostics
* result.
*
* @category Diagnostics
*/
export declare class DiagnosticsEndpoint {
/**
* @internal
*/
constructor(data: DiagnosticsEndpoint);
/**
* The type of service this entry represents.
*/
type: ServiceType;
/**
* The unique identifier for this endpoint.
*/
id: string;
/**
* The local address of this endpoint.
*/
local: string;
/**
* The remote address of this endpoint.
*/
remote: string;
/**
* The time in milliseconds since the last activity.
*/
lastActivity: number;
/**
* The current state of this endpoint.
*/
state: EndpointState;
/**
* The name of the bucket this endpoint is connected to.
*/
bucket?: string;
/**
* Various additional details about the endpoint.
*/
details?: any;
}
/**
* DiagnosticsResult represents the output of a operation result.
*
* @category Diagnostics
*/
export declare class DiagnosticsResult {
/**
* @internal
*/
constructor(data: {
version: number;
id: string;
sdk: string;
services: {
[serviceType: string]: DiagnosticsEndpoint[];
};
});
/**
* The version number of this report.
*/
version: number;
/**
* The unique identifier for this report.
*/
id: string;
/**
* The name of the SDK which generated this report.
*/
sdk: string;
/**
* A list of service endpoints and their diagnostic status.
*/
services: {
[serviceType: string]: DiagnosticsEndpoint[];
};
/**
* Returns a JSON formatted diagnostics report.
*/
toJSON(): JsonDiagnosticsReport;
}
/**
* @category Diagnostics
*/
export interface DiagnosticsOptions {
/**
* A unique identifier for the report generated by this operation.
*/
reportId?: string;
}