Skip to content

Commit 0a3e3cd

Browse files
chore: cover getNodesList api request with types
1 parent 186ae6c commit 0a3e3cd

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/services/api.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ interface Window {
8080
getNodeInfo: (
8181
id?: string,
8282
) => Promise<import('../types/api/systemState').TEvSystemStateResponse>;
83+
getNodesList: () => Promise<import('../types/api/nodesList').TEvNodesInfo>;
8384
[method: string]: Function;
8485
};
8586
}

src/types/api/nodesList.ts

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/**
2+
* endpoint: /viewer/json/nodesList
3+
*
4+
* source: https://github.com/ydb-platform/ydb/blob/main/library/cpp/actors/core/interconnect.h
5+
*/
6+
export type TEvNodesInfo = TNodeInfo[];
7+
8+
export interface TNodeInfo {
9+
Id?: number;
10+
Host?: string;
11+
ResolveHost?: string;
12+
Address?: string;
13+
Port?: number;
14+
PhysicalLocation?: TNodeLocation;
15+
}
16+
17+
interface TNodeLocation {
18+
DataCenter?: number;
19+
Room?: number;
20+
Rack?: number;
21+
Body?: number;
22+
DataCenterId?: string;
23+
/** String with DC, Module, Rack and Unit ids */
24+
Location?: string;
25+
}

0 commit comments

Comments
 (0)