Skip to content

Commit e81d3d3

Browse files
chore: update types (#471)
* chore: update nodes and compute types * chore: move schema types, add external sources types * chore: split schema types to several files
1 parent c8420cf commit e81d3d3

File tree

13 files changed

+1438
-1329
lines changed

13 files changed

+1438
-1329
lines changed

src/types/api/compute.ts

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,20 @@ import {TMetrics} from './tenant';
44

55
/**
66
* endpoint: viewer/json/compute
7-
*
7+
*
88
* source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/viewer/protos/viewer.proto
9+
*
10+
* response has 2 versions, depending on version param in request
911
*/
1012
export interface TComputeInfo {
1113
Overall: EFlag;
12-
Tenants?: TComputeTenantInfo[];
14+
Tenants?: TComputeTenantInfo[]; // v1
1315
Errors?: string[];
16+
/** uint64 */
17+
TotalNodes: string;
18+
/** uint64 */
19+
FoundNodes: string;
20+
Nodes?: TComputeNodeInfo[]; // v2
1421
}
1522

1623
interface TComputeTenantInfo {
@@ -43,6 +50,7 @@ export interface TComputeNodeInfo {
4350
MemoryLimit?: string;
4451
Metrics: TMetrics;
4552
Tablets?: TTabletStateInfo[];
53+
Tenant?: string; // For v2 response without grouping by tenants
4654
}
4755

4856
// Tablets in compute nodes
@@ -52,3 +60,20 @@ export interface TTabletStateInfo {
5260
State: EFlag;
5361
Count: number;
5462
}
63+
64+
export enum EVersion {
65+
v1,
66+
v2, // only this versions works with sorting
67+
}
68+
69+
export enum ESort {
70+
NodeId,
71+
Host,
72+
DC,
73+
Rack,
74+
Version,
75+
Uptime,
76+
Memory,
77+
CPU,
78+
LoadAverage,
79+
}

src/types/api/nodes.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {TVDiskStateInfo} from './vdisk';
55

66
/**
77
* endpoint: /viewer/json/nodes
8-
*
8+
*
99
* source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/viewer/protos/viewer.proto
1010
*/
1111
export interface TNodesInfo {
@@ -101,3 +101,14 @@ enum EConfigState {
101101
'Consistent' = 'Consistent',
102102
'Outdated' = 'Outdated',
103103
}
104+
105+
export enum ESort {
106+
NodeId,
107+
Host,
108+
DC,
109+
Version,
110+
Uptime,
111+
Memory,
112+
CPU,
113+
LoadAverage,
114+
}

0 commit comments

Comments
 (0)