-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathtypes.go
More file actions
400 lines (312 loc) · 15.1 KB
/
types.go
File metadata and controls
400 lines (312 loc) · 15.1 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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
// Package api provides primitives to interact with the openapi HTTP API.
//
// Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
package api
import (
"time"
)
// Defines values for DeployStatus.
const (
CONFIGURING DeployStatus = "CONFIGURING"
DELETED DeployStatus = "DELETED"
DELETING DeployStatus = "DELETING"
OPTIMIZING DeployStatus = "OPTIMIZING"
PAUSED DeployStatus = "PAUSED"
PAUSING DeployStatus = "PAUSING"
QUEUED DeployStatus = "QUEUED"
READY DeployStatus = "READY"
RESUMING DeployStatus = "RESUMING"
UNSTABLE DeployStatus = "UNSTABLE"
UPGRADING DeployStatus = "UPGRADING"
)
// Defines values for ForkStrategy.
const (
LASTSNAPSHOT ForkStrategy = "LAST_SNAPSHOT"
NOW ForkStrategy = "NOW"
PITR ForkStrategy = "PITR"
)
// Defines values for ReadReplicaSetStatus.
const (
ReadReplicaSetStatusActive ReadReplicaSetStatus = "active"
ReadReplicaSetStatusCreating ReadReplicaSetStatus = "creating"
ReadReplicaSetStatusDeleting ReadReplicaSetStatus = "deleting"
ReadReplicaSetStatusError ReadReplicaSetStatus = "error"
ReadReplicaSetStatusResizing ReadReplicaSetStatus = "resizing"
)
// Defines values for ServiceCreateAddons.
const (
Ai ServiceCreateAddons = "ai"
TimeSeries ServiceCreateAddons = "time-series"
)
// Defines values for ServiceType.
const (
POSTGRES ServiceType = "POSTGRES"
TIMESCALEDB ServiceType = "TIMESCALEDB"
VECTOR ServiceType = "VECTOR"
)
// Defines values for SetEnvironmentInputEnvironment.
const (
DEV SetEnvironmentInputEnvironment = "DEV"
PROD SetEnvironmentInputEnvironment = "PROD"
)
// ConnectionPooler defines model for ConnectionPooler.
type ConnectionPooler struct {
Endpoint *Endpoint `json:"endpoint,omitempty"`
}
// DeployStatus defines model for DeployStatus.
type DeployStatus string
// Endpoint defines model for Endpoint.
type Endpoint struct {
Host *string `json:"host,omitempty"`
Port *int `json:"port,omitempty"`
}
// Error defines model for Error.
type Error struct {
Code *string `json:"code,omitempty"`
Message *string `json:"message,omitempty"`
}
// ForkServiceCreate Create a fork of an existing service. Service type, region code, and storage are always inherited from the parent service.
// HA replica count is always set to 0 for forked services.
type ForkServiceCreate struct {
// CpuMillis The initial CPU allocation in milli-cores. If not provided, will inherit from parent service.
CpuMillis *int `json:"cpu_millis,omitempty"`
// ForkStrategy Strategy for creating the fork:
// - LAST_SNAPSHOT: Use existing snapshot for fast fork
// - NOW: Create new snapshot for up-to-date fork
// - PITR: Point-in-time recovery using target_time
ForkStrategy ForkStrategy `json:"fork_strategy"`
// Free Whether to create a free forked service (if true, cpu_millis and memory_gbs must not be provided)
Free *bool `json:"free,omitempty"`
// MemoryGbs The initial memory allocation in gigabytes. If not provided, will inherit from parent service.
MemoryGbs *int `json:"memory_gbs,omitempty"`
// Name A human-readable name for the forked service. If not provided, will use parent service name with "-fork" suffix.
Name *string `json:"name,omitempty"`
// TargetTime Target time for point-in-time recovery. Required when fork_strategy is PITR.
TargetTime *time.Time `json:"target_time,omitempty"`
}
// ForkSpec defines model for ForkSpec.
type ForkSpec struct {
IsStandby *bool `json:"is_standby,omitempty"`
ProjectId *string `json:"project_id,omitempty"`
ServiceId *string `json:"service_id,omitempty"`
}
// ForkStrategy Strategy for creating the fork:
// - LAST_SNAPSHOT: Use existing snapshot for fast fork
// - NOW: Create new snapshot for up-to-date fork
// - PITR: Point-in-time recovery using target_time
type ForkStrategy string
// HAReplica defines model for HAReplica.
type HAReplica struct {
// ReplicaCount Number of high-availability replicas (all replicas are asynchronous by default).
ReplicaCount *int `json:"replica_count,omitempty"`
// SyncReplicaCount Number of synchronous high-availability replicas.
SyncReplicaCount *int `json:"sync_replica_count,omitempty"`
}
// Peering defines model for Peering.
type Peering struct {
ErrorMessage *string `json:"error_message,omitempty"`
Id *string `json:"id,omitempty"`
PeerAccountId *string `json:"peer_account_id,omitempty"`
PeerRegionCode *string `json:"peer_region_code,omitempty"`
PeerVpcId *string `json:"peer_vpc_id,omitempty"`
ProvisionedId *string `json:"provisioned_id,omitempty"`
Status *string `json:"status,omitempty"`
}
// PeeringCreate defines model for PeeringCreate.
type PeeringCreate struct {
PeerAccountId string `json:"peer_account_id"`
PeerRegionCode string `json:"peer_region_code"`
PeerVpcId string `json:"peer_vpc_id"`
}
// ReadReplicaSet defines model for ReadReplicaSet.
type ReadReplicaSet struct {
ConnectionPooler *ConnectionPooler `json:"connection_pooler,omitempty"`
// CpuMillis CPU allocation in milli-cores.
CpuMillis *int `json:"cpu_millis,omitempty"`
Endpoint *Endpoint `json:"endpoint,omitempty"`
Id *string `json:"id,omitempty"`
// MemoryGbs Memory allocation in gigabytes.
MemoryGbs *int `json:"memory_gbs,omitempty"`
// Metadata Additional metadata for the read replica set
Metadata *struct {
// Environment Environment tag for the read replica set
Environment *string `json:"environment,omitempty"`
} `json:"metadata,omitempty"`
Name *string `json:"name,omitempty"`
// Nodes Number of nodes in the replica set.
Nodes *int `json:"nodes,omitempty"`
Status *ReadReplicaSetStatus `json:"status,omitempty"`
}
// ReadReplicaSetStatus defines model for ReadReplicaSet.Status.
type ReadReplicaSetStatus string
// ReadReplicaSetCreate defines model for ReadReplicaSetCreate.
type ReadReplicaSetCreate struct {
// CpuMillis The initial CPU allocation in milli-cores.
CpuMillis int `json:"cpu_millis"`
// MemoryGbs The initial memory allocation in gigabytes.
MemoryGbs int `json:"memory_gbs"`
// Name A human-readable name for the read replica.
Name string `json:"name"`
// Nodes Number of nodes to create in the replica set.
Nodes int `json:"nodes"`
}
// ResizeInput defines model for ResizeInput.
type ResizeInput struct {
// CpuMillis The new CPU allocation in milli-cores (e.g., 1000 for 1 vCPU).
CpuMillis int `json:"cpu_millis"`
// MemoryGbs The new memory allocation in gigabytes.
MemoryGbs int `json:"memory_gbs"`
// Nodes The new number of nodes in the replica set.
Nodes *int `json:"nodes,omitempty"`
}
// Service defines model for Service.
type Service struct {
ConnectionPooler *ConnectionPooler `json:"connection_pooler,omitempty"`
// Created Creation timestamp
Created *time.Time `json:"created,omitempty"`
Endpoint *Endpoint `json:"endpoint,omitempty"`
ForkedFrom *ForkSpec `json:"forked_from,omitempty"`
HaReplicas *HAReplica `json:"ha_replicas,omitempty"`
// InitialPassword The initial password for the service.
InitialPassword *string `json:"initial_password,omitempty"`
// Metadata Additional metadata for the service
Metadata *struct {
// Environment Environment tag for the service
Environment *string `json:"environment,omitempty"`
} `json:"metadata,omitempty"`
// Name The name of the service.
Name *string `json:"name,omitempty"`
// Paused Whether the service is paused
Paused *bool `json:"paused,omitempty"`
// ProjectId The project this service belongs to.
ProjectId *string `json:"project_id,omitempty"`
ReadReplicaSets *[]ReadReplicaSet `json:"read_replica_sets,omitempty"`
// RegionCode The cloud region where the service is hosted.
RegionCode *string `json:"region_code,omitempty"`
// Resources List of resources allocated to the service
Resources *[]struct {
// Id Resource identifier
Id *string `json:"id,omitempty"`
// Spec Resource specification
Spec *struct {
// CpuMillis CPU allocation in millicores
CpuMillis *int `json:"cpu_millis,omitempty"`
// MemoryGbs Memory allocation in gigabytes
MemoryGbs *int `json:"memory_gbs,omitempty"`
// VolumeType Type of storage volume
VolumeType *string `json:"volume_type,omitempty"`
} `json:"spec,omitempty"`
} `json:"resources,omitempty"`
// ServiceId The unique identifier for the service.
ServiceId *string `json:"service_id,omitempty"`
ServiceType *ServiceType `json:"service_type,omitempty"`
Status *DeployStatus `json:"status,omitempty"`
// VpcEndpoint VPC endpoint configuration if available
VpcEndpoint *map[string]interface{} `json:"vpcEndpoint"`
}
// ServiceCreate defines model for ServiceCreate.
type ServiceCreate struct {
// Addons List of addons to enable for the service. 'time-series' enables TimescaleDB, 'ai' enables AI/vector extensions.
Addons []ServiceCreateAddons `json:"addons"`
// CpuMillis The initial CPU allocation in milli-cores.
CpuMillis int `json:"cpu_millis"`
// Free Whether to create a free service (if true, addons, replica_count, cpu_millis, and memory_gbs must not be provided)
Free *bool `json:"free,omitempty"`
// MemoryGbs The initial memory allocation in gigabytes.
MemoryGbs int `json:"memory_gbs"`
// Name A human-readable name for the service.
Name string `json:"name"`
RegionCode string `json:"region_code"`
// ReplicaCount Number of high-availability replicas to create (all replicas are asynchronous by default).
ReplicaCount int `json:"replica_count"`
}
// ServiceCreateAddons defines model for ServiceCreate.Addons.
type ServiceCreateAddons string
// ServiceType defines model for ServiceType.
type ServiceType string
// ServiceVPCInput defines model for ServiceVPCInput.
type ServiceVPCInput struct {
// VpcId The ID of the VPC to attach the service to.
VpcId string `json:"vpc_id"`
}
// SetEnvironmentInput defines model for SetEnvironmentInput.
type SetEnvironmentInput struct {
// Environment The target environment for the service.
Environment SetEnvironmentInputEnvironment `json:"environment"`
}
// SetEnvironmentInputEnvironment The target environment for the service.
type SetEnvironmentInputEnvironment string
// SetHAReplicaInput At least one of sync_replica_count or replica_count must be provided.
type SetHAReplicaInput struct {
// ReplicaCount Number of high-availability replicas (all replicas are asynchronous by default).
ReplicaCount *int `json:"replica_count,omitempty"`
// SyncReplicaCount Number of synchronous high-availability replicas.
SyncReplicaCount *int `json:"sync_replica_count,omitempty"`
}
// UpdatePasswordInput defines model for UpdatePasswordInput.
type UpdatePasswordInput struct {
// Password The new password.
Password string `json:"password"`
}
// VPC defines model for VPC.
type VPC struct {
Cidr *string `json:"cidr,omitempty"`
Id *string `json:"id,omitempty"`
Name *string `json:"name,omitempty"`
RegionCode *string `json:"region_code,omitempty"`
}
// VPCCreate defines model for VPCCreate.
type VPCCreate struct {
Cidr string `json:"cidr"`
Name string `json:"name"`
RegionCode string `json:"region_code"`
}
// VPCRename defines model for VPCRename.
type VPCRename struct {
// Name The new name for the VPC.
Name string `json:"name"`
}
// PeeringId defines model for PeeringId.
type PeeringId = string
// ProjectId defines model for ProjectId.
type ProjectId = string
// ReplicaSetId defines model for ReplicaSetId.
type ReplicaSetId = string
// ServiceId defines model for ServiceId.
type ServiceId = string
// VPCId defines model for VPCId.
type VPCId = string
// ClientError defines model for ClientError.
type ClientError = Error
// SuccessMessage defines model for SuccessMessage.
type SuccessMessage struct {
Message *string `json:"message,omitempty"`
}
// PostProjectsProjectIdServicesJSONRequestBody defines body for PostProjectsProjectIdServices for application/json ContentType.
type PostProjectsProjectIdServicesJSONRequestBody = ServiceCreate
// PostProjectsProjectIdServicesServiceIdAttachToVPCJSONRequestBody defines body for PostProjectsProjectIdServicesServiceIdAttachToVPC for application/json ContentType.
type PostProjectsProjectIdServicesServiceIdAttachToVPCJSONRequestBody = ServiceVPCInput
// PostProjectsProjectIdServicesServiceIdDetachFromVPCJSONRequestBody defines body for PostProjectsProjectIdServicesServiceIdDetachFromVPC for application/json ContentType.
type PostProjectsProjectIdServicesServiceIdDetachFromVPCJSONRequestBody = ServiceVPCInput
// PostProjectsProjectIdServicesServiceIdForkServiceJSONRequestBody defines body for PostProjectsProjectIdServicesServiceIdForkService for application/json ContentType.
type PostProjectsProjectIdServicesServiceIdForkServiceJSONRequestBody = ForkServiceCreate
// PostProjectsProjectIdServicesServiceIdReplicaSetsJSONRequestBody defines body for PostProjectsProjectIdServicesServiceIdReplicaSets for application/json ContentType.
type PostProjectsProjectIdServicesServiceIdReplicaSetsJSONRequestBody = ReadReplicaSetCreate
// PostProjectsProjectIdServicesServiceIdReplicaSetsReplicaSetIdResizeJSONRequestBody defines body for PostProjectsProjectIdServicesServiceIdReplicaSetsReplicaSetIdResize for application/json ContentType.
type PostProjectsProjectIdServicesServiceIdReplicaSetsReplicaSetIdResizeJSONRequestBody = ResizeInput
// PostProjectsProjectIdServicesServiceIdReplicaSetsReplicaSetIdSetEnvironmentJSONRequestBody defines body for PostProjectsProjectIdServicesServiceIdReplicaSetsReplicaSetIdSetEnvironment for application/json ContentType.
type PostProjectsProjectIdServicesServiceIdReplicaSetsReplicaSetIdSetEnvironmentJSONRequestBody = SetEnvironmentInput
// PostProjectsProjectIdServicesServiceIdResizeJSONRequestBody defines body for PostProjectsProjectIdServicesServiceIdResize for application/json ContentType.
type PostProjectsProjectIdServicesServiceIdResizeJSONRequestBody = ResizeInput
// PostProjectsProjectIdServicesServiceIdSetEnvironmentJSONRequestBody defines body for PostProjectsProjectIdServicesServiceIdSetEnvironment for application/json ContentType.
type PostProjectsProjectIdServicesServiceIdSetEnvironmentJSONRequestBody = SetEnvironmentInput
// PostProjectsProjectIdServicesServiceIdSetHAJSONRequestBody defines body for PostProjectsProjectIdServicesServiceIdSetHA for application/json ContentType.
type PostProjectsProjectIdServicesServiceIdSetHAJSONRequestBody = SetHAReplicaInput
// PostProjectsProjectIdServicesServiceIdUpdatePasswordJSONRequestBody defines body for PostProjectsProjectIdServicesServiceIdUpdatePassword for application/json ContentType.
type PostProjectsProjectIdServicesServiceIdUpdatePasswordJSONRequestBody = UpdatePasswordInput
// PostProjectsProjectIdVpcsJSONRequestBody defines body for PostProjectsProjectIdVpcs for application/json ContentType.
type PostProjectsProjectIdVpcsJSONRequestBody = VPCCreate
// PostProjectsProjectIdVpcsVpcIdPeeringsJSONRequestBody defines body for PostProjectsProjectIdVpcsVpcIdPeerings for application/json ContentType.
type PostProjectsProjectIdVpcsVpcIdPeeringsJSONRequestBody = PeeringCreate
// PostProjectsProjectIdVpcsVpcIdRenameJSONRequestBody defines body for PostProjectsProjectIdVpcsVpcIdRename for application/json ContentType.
type PostProjectsProjectIdVpcsVpcIdRenameJSONRequestBody = VPCRename