-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathtypes.ts
More file actions
124 lines (116 loc) · 3.03 KB
/
types.ts
File metadata and controls
124 lines (116 loc) · 3.03 KB
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
export interface Database {
etag?: string;
name: string;
instance: string;
project: string;
}
export interface IpConfiguration {
ipv4Enabled?: boolean;
privateNetwork?: string;
requireSsl?: boolean;
authorizedNetworks?: {
value: string;
expirationTime?: string;
name?: string;
}[];
allocatedIpRange?: string;
sslMode?:
| "ALLOW_UNENCRYPTED_AND_ENCRYPTED"
| "ENCRYPTED_ONLY"
| "TRUSTED_CLIENT_CERTIFICATE_REQUIRED";
pscConfig?: {
allowedConsumerProjects: string[];
pscEnabled: boolean;
};
enablePrivatePathForGoogleCloudServices?: boolean;
}
export interface InstanceSettings {
authorizedGaeApplications?: string[];
tier?: string;
edition?: "ENTERPRISE_PLUS" | "ENTERPRISE";
availabilityType?: "ZONAL" | "REGIONAL";
pricingPlan?: "PER_USE" | "PACKAGE";
replicationType?: "SYNCHRONOUS" | "ASYNCHRONOUS";
activationPolicy?: "ALWAYS" | "NEVER";
ipConfiguration?: IpConfiguration;
locationPreference?: [Object];
databaseFlags?: DatabaseFlag[];
dataDiskType?: "PD_SSD" | "PD_HDD";
storageAutoResizeLimit?: string;
storageAutoResize?: boolean;
dataDiskSizeGb?: string;
deletionProtectionEnabled?: boolean;
dataCacheConfig?: {
dataCacheEnabled: boolean;
};
enableGoogleMlIntegration?: boolean;
insightsConfig?: InsightsConfig;
userLabels?: { [key: string]: string };
}
export interface DatabaseFlag {
name: string;
value: string;
}
interface InsightsConfig {
queryInsightsEnabled: boolean;
queryPlansPerMinute: number;
queryStringLength: number;
}
// TODO: Consider splitting off return only fields and input fields into different types.
export interface Instance {
state?: "RUNNABLE" | "SUSPENDED" | "PENDING_DELETE" | "PENDING_CREATE" | "MAINTENANCE" | "FAILED";
databaseVersion:
| "POSTGRES_18"
| "POSTGRES_17"
| "POSTGRES_16"
| "POSTGRES_15"
| "POSTGRES_14"
| "POSTGRES_13"
| "POSTGRES_12"
| "POSTGRES_11"
| string;
settings: InstanceSettings;
etag?: string;
rootPassword: string;
ipAddresses: {
type: "PRIMARY" | "OUTGOING" | "PRIVATE";
ipAddress: string;
timeToRetire?: string;
}[];
serverCaCert?: SslCert;
instanceType: "CLOUD_SQL_INSTANCE" | "ON_PREMISES_INSTANCE" | "READ_REPLICA_INSTANCE";
project: string;
serviceAccountEmailAddress: string;
backendType: "SECOND_GEN" | "EXTERNAL";
selfLink?: string;
connectionName?: string;
name: string;
region: string;
gceZone?: string;
databaseInstalledVersion?: string;
maintenanceVersion?: string;
createTime?: string;
sqlNetworkArchitecture?: string;
}
export interface SslCert {
certSerialNumber: string;
cert: string;
commonName: string;
sha1Fingerprint: string;
instance: string;
createTime?: string;
expirationTime?: string;
}
export interface User {
password?: string;
name: string;
host?: string;
instance: string;
project: string;
type: UserType;
sqlserverUserDetails: {
disabled: boolean;
serverRoles: string[];
};
}
export type UserType = "BUILT_IN" | "CLOUD_IAM_USER" | "CLOUD_IAM_SERVICE_ACCOUNT";