-
Notifications
You must be signed in to change notification settings - Fork 3
/
database.ts
164 lines (152 loc) · 5.66 KB
/
database.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
import { DatabaseModule } from './general';
/**
* The database response
* @param databaseId The id of the database
* @param protocol The protocol of the database
* @param provider The provider of the database
* @param region The region of the database
* @param redisVersionCompliance The Redis version of the database
* @param status The status of the database
* @param memoryLimitInGb The memory limit of the database
* @param memoryUsedInMb The memory used in the database
* @param memoryStorage The memory storage type of the database
* @param supportOSSClusterApi If the database supports oss cluster API
* @param dataPersistence The data persistence of the database
* @param replication If the database replication is enabled/disabled
* @param privateEndpoint The private endpoint of the database
* @param publicEndpoint The public endpoint of the database
* @param dataEvictionPolicy The data eviction policy of the database
* @param throughputMeasurement The throughput measurement of the database
* @param replicaOf The replica of endpoints of the database
* @param clustering The database clustering
* @param security The database security
* @param modules The database modules
* @param alerts The database alerts
*/
export type DatabaseResponse = {
databaseId: number,
name: string,
protocol: DatabaseProtocol,
provider: DatabaseProvider,
region: string,
redisVersionCompliance: string,
status: DatabaseStatus,
memoryLimitInGb: number,
memoryUsedInMb: number,
memoryStorage: DatabaseMemoryStorage,
supportOSSClusterApi: boolean,
dataPersistence: DatabaseDataPersistence,
replication: boolean,
privateEndpoint: string,
publicEndpoint: string,
dataEvictionPolicy: DatabaseDataEvictionPolicy,
throughputMeasurement: DatabaseThroughputMeasurement,
replicaOf: DatabaseReplicaOfEndpoints,
clustering: DatabaseClustering,
security: DatabaseSecurity,
modules: DatabaseModule[],
alerts: any[],
[key: string]: any
}
/**
* The database throughput measurement
* @param by The type of throughput measurement
* @param value The value of the throughput measurement
*/
export type DatabaseThroughputMeasurement = {
by: 'number-of-shards' | 'operations-per-second',
value: number,
[key: string]: any
}
/**
* The database security
* @param password The database password
* @param enableTls The TLS status
* @param sslClientAuthentication The SSL client authentication
* @param sourceIps The list of source IP's
*/
export type DatabaseSecurity = {
password: string,
enableTls?: boolean,
sslClientAuthentication: boolean,
sourceIps: string[],
[key: string]: any
}
/**
* The database clustering
* @param numberOfShards The database number of shards
* @param regexRules The database regex rules
* @param hashingPolicy The database hashing policy
*/
export type DatabaseClustering = {
numberOfShards?: number,
regexRules?: any[],
hashingPolicy: any[],
[key: string]: any
}
/**
* The database memory storage type
* @param ram Redis on RAM
* @param ram-and-flash Redis on Flash
*/
export type DatabaseMemoryStorage = 'ram' | 'ram-and-flash';
/**
* The database provider
* @param AWS Amazon Web Services
* @param GCP Google Cloud Platform
*/
export type DatabaseProvider = 'AWS' | 'GCP';
/**
* The database protocol types
* @param redis Redis database protocol
* @param memcached Memchached database protocol
*/
export type DatabaseProtocol = 'redis' | 'memcached';
/**
* The database data persistence types
* @param none No data persistence
* @param aof-every-1-second AOF every second
* @param aof-every-write AOF every write
* @param snapshot-every-1-hour Snapshot every hour
* @param snapshot-every-6-hours Snapshot every 6 hours
* @param snapshot-every-12-hours Snapshot every 12 hours
*/
export type DatabaseDataPersistence = 'none' | 'aof-every-1-second' | 'aof-every-write' | 'snapshot-every-1-hour' | 'snapshot-every-6-hours' | 'snapshot-every-12-hours';
/**
* The database data eviction policy types
* @param allkeys-lru allkeys-lru eviction policy
* @param allkeys-lfu allkeys-lfu eviction policy
* @param allkeys-random allkeys-random eviction policy
* @param volatile-lru volatile-lru eviction policy
* @param volatile-lfu volatile-lfu eviction policy
* @param volatile-random volatile-random eviction policy
* @param volatile-ttl volatile-ttl eviction policy
* @param noeviction noeviction eviction policy
*/
export type DatabaseDataEvictionPolicy = 'allkeys-lru' | 'allkeys-lfu' | 'allkeys-random' | 'volatile-lru' | 'volatile-lfu' | 'volatile-random' | 'volatile-ttl' | 'noeviction';
/**
* The database import source types
* @param http HTTP import source
* @param redis Redis import source
* @param ftp FTP import source
* @param aws-s3 S3 import source
* @param azure-blob-storage Azure import source
* @param google-blob-sotrage Google import source
*/
export type DatabaseImportSource = 'http' | 'redis' | 'ftp' | 'aws-s3' | 'azure-blob-storage' | 'google-blob-storage';
/**
* The available database status
* @param active The database status when it's activated
* @param draft The database status when it's pending
* @param active-change-pending The database status when it's pending for an active change (active + pending status)
* @param 404 The database status when it's deleted (404 status code)
* @param error The database status when it's in error
* @param synced The database status when it's synced with it's replica's
*/
export type DatabaseStatus = 'active' | 'draft' | 'active-change-pending' | 404 | 'error' | 'synced';
/**
* The replica of endpoints of the database
*/
export type DatabaseReplicaOfEndpoints = {
endpoints: string[]
}