Skip to content

Commit 30a1e9f

Browse files
chore: add comments to types
1 parent 55c0a61 commit 30a1e9f

File tree

8 files changed

+51
-32
lines changed

8 files changed

+51
-32
lines changed

src/types/api/enums.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Shows system status
2-
// Currently is used in response types of viewer/json/nodes and viewer/json/storage
3-
// Probably will appear in /viewer/json/tenantinfo /viewer/json/cluster /viewer/json/tabletinfo /viewer/json/compute
2+
// Currently is used in response types viewer/json/ storage, nodes, compute
3+
// pdiskinfo, vdiskinfo, tabletinfo, tenantinfo
44
export enum EFlag {
55
Grey = 'Grey',
66
Green = 'Green',

src/types/api/nodes.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import {EFlag} from './enums';
22
import {TPDiskStateInfo} from './pdisk';
33
import {TTabletStateInfo} from './tablet';
44

5+
// endpoint: /viewer/json/nodes
6+
// source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/viewer/protos/viewer.proto
7+
58
export interface TNodesInfo {
69
Overall: EFlag;
710
Nodes?: TNodeInfo[];
@@ -64,12 +67,12 @@ export interface TPoolStats {
6467
Threads?: number;
6568
}
6669

67-
interface TEndpoint {
70+
export interface TEndpoint {
6871
Name?: string;
6972
Address?: string;
7073
}
7174

72-
interface TLegacyNodeLocation {
75+
export interface TLegacyNodeLocation {
7376
DataCenter?: number;
7477
Room?: number;
7578
Rack?: number;

src/types/api/pdisk.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import {EFlag} from './enums';
22

3+
// endpoint: /viewer/json/pdiskinfo
4+
// source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/protos/node_whiteboard.proto
5+
36
export interface TPDiskStateInfo {
47
PDiskId?: number;
58
/** uint64 */

src/types/api/schema.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ enum EStatus {
3737
StatusResourceExhausted = 'StatusResourceExhausted',
3838
}
3939

40+
// source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/protos/flat_scheme_op.proto
4041
// incomplete interface, only currently used fields are covered
4142
export interface TPathDescription {
4243
/** info about the path itself */

src/types/api/storage.ts

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,37 @@
11
import {EFlag} from './enums';
22
import {TVDiskStateInfo} from './vdisk';
33

4+
// endpoint: /viewer/json/storage
5+
// source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/viewer/protos/viewer.proto
6+
7+
export interface TStorageInfo {
8+
Overall?: EFlag;
9+
StoragePools?: TStoragePoolInfo[];
10+
/** uint64 */
11+
TotalGroups?: string;
12+
/** uint64 */
13+
FoundGroups?: string;
14+
}
15+
16+
interface TStoragePoolInfo {
17+
Overall?: EFlag;
18+
Name?: string;
19+
Kind?: string;
20+
Groups?: (TBSGroupStateInfo & THiveStorageGroupStats)[];
21+
/** uint64 */
22+
AcquiredUnits?: string;
23+
AcquiredIOPS?: number;
24+
/** uint64 */
25+
AcquiredThroughput?: string;
26+
/** uint64 */
27+
AcquiredSize?: string;
28+
MaximumIOPS?: number;
29+
/** uint64 */
30+
MaximumThroughput?: string;
31+
/** uint64 */
32+
MaximumSize?: string;
33+
}
34+
435
export interface TBSGroupStateInfo {
536
GroupID?: number;
637
ErasureSpecies?: string;
@@ -43,31 +74,3 @@ interface THiveStorageGroupStats {
4374
/** uint64 */
4475
AvailableSize?: string;
4576
}
46-
47-
interface TStoragePoolInfo {
48-
Overall?: EFlag;
49-
Name?: string;
50-
Kind?: string;
51-
Groups?: (TBSGroupStateInfo & THiveStorageGroupStats)[];
52-
/** uint64 */
53-
AcquiredUnits?: string;
54-
AcquiredIOPS?: number;
55-
/** uint64 */
56-
AcquiredThroughput?: string;
57-
/** uint64 */
58-
AcquiredSize?: string;
59-
MaximumIOPS?: number;
60-
/** uint64 */
61-
MaximumThroughput?: string;
62-
/** uint64 */
63-
MaximumSize?: string;
64-
}
65-
66-
export interface TStorageInfo {
67-
Overall?: EFlag;
68-
StoragePools?: TStoragePoolInfo[];
69-
/** uint64 */
70-
TotalGroups?: string;
71-
/** uint64 */
72-
FoundGroups?: string;
73-
}

src/types/api/tablet.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import {EFlag} from './enums';
22

3+
// endpoint: /viewer/json/tabletinfo
4+
// source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/protos/sys_view.proto
5+
36
export interface TEvTabletStateResponse {
47
TabletStateInfo?: TTabletStateInfo[];
58

src/types/api/tenant.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ import {EFlag} from './enums';
22
import {TPoolStats, TSystemStateInfo} from './nodes';
33
import {TTabletStateInfo} from './tablet';
44

5+
// endpoint: /viewer/json/tenantinfo
6+
// source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/viewer/protos/viewer.proto
7+
58
export interface TTenants {
69
Tenants?: TTenant[];
710
}

src/types/api/vdisk.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import {EFlag} from './enums';
22
import {TPDiskStateInfo} from './pdisk';
33

4+
// endpoint: /viewer/json/vdiskinfo
5+
// source: https://github.com/ydb-platform/ydb/blob/main/ydb/core/protos/node_whiteboard.proto
6+
47
export interface TVDiskStateInfo {
58
VDiskId?: TVDiskID;
69
/** uint64 */

0 commit comments

Comments
 (0)