-
Notifications
You must be signed in to change notification settings - Fork 80
/
dedicated_sharded_database.go
338 lines (267 loc) · 14.4 KB
/
dedicated_sharded_database.go
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
// Copyright (c) 2016, 2018, 2024, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose either license.
// Code generated. DO NOT EDIT.
// Globally Distributed Database
//
// Use the Globally Distributed Database service APIs to create and manage distributed databases.
//
package globallydistributeddatabase
import (
"encoding/json"
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// DedicatedShardedDatabase Details of ATP-D based sharded database.
type DedicatedShardedDatabase struct {
// Sharded Database identifier
Id *string `mandatory:"true" json:"id"`
// Identifier of the compartment in which sharded database exists.
CompartmentId *string `mandatory:"true" json:"compartmentId"`
// Oracle sharded database display name.
DisplayName *string `mandatory:"true" json:"displayName"`
// The time the the Sharded Database was created. An RFC3339 formatted datetime string
TimeCreated *common.SDKTime `mandatory:"true" json:"timeCreated"`
// The time the Sharded Database was last updated. An RFC3339 formatted datetime string
TimeUpdated *common.SDKTime `mandatory:"true" json:"timeUpdated"`
// Detailed message for the lifecycle state.
LifecycleStateDetails *string `mandatory:"true" json:"lifecycleStateDetails"`
// The character set for the database.
CharacterSet *string `mandatory:"true" json:"characterSet"`
// The national character set for the database.
NcharacterSet *string `mandatory:"true" json:"ncharacterSet"`
// Oracle Database version number.
DbVersion *string `mandatory:"true" json:"dbVersion"`
// Unique prefix for the sharded database.
Prefix *string `mandatory:"true" json:"prefix"`
// Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only.
// Example: `{"bar-key": "value"}`
FreeformTags map[string]string `mandatory:"false" json:"freeformTags"`
// Defined tags for this resource. Each key is predefined and scoped to a namespace.
// Example: `{"foo-namespace": {"bar-key": "value"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// Usage of system tag keys. These predefined keys are scoped to namespaces.
// Example: `{"orcl-cloud": {"free-tier-retained": "true"}}`
SystemTags map[string]map[string]interface{} `mandatory:"false" json:"systemTags"`
// The Replication factor for RAFT replication based sharded database. Currently supported values are 3, 5 and 7.
ReplicationFactor *int `mandatory:"false" json:"replicationFactor"`
// For RAFT replication based sharded database, the value should be atleast twice the number of shards.
ReplicationUnit *int `mandatory:"false" json:"replicationUnit"`
// The certificate common name used in all cloudAutonomousVmClusters for the sharded database topology. Eg. Production.
// All the clusters used in one sharded database topology shall have same CABundle setup. Valid characterset for
// clusterCertificateCommonName include uppercase or lowercase letters, numbers, hyphens, underscores, and period.
ClusterCertificateCommonName *string `mandatory:"false" json:"clusterCertificateCommonName"`
// The default number of unique chunks in a shardspace. The value of chunks must be
// greater than 2 times the size of the largest shardgroup in any shardspace.
Chunks *int `mandatory:"false" json:"chunks"`
// The GSM listener port number.
ListenerPort *int `mandatory:"false" json:"listenerPort"`
// The TLS listener port number for sharded database.
ListenerPortTls *int `mandatory:"false" json:"listenerPortTls"`
// Ons local port number.
OnsPortLocal *int `mandatory:"false" json:"onsPortLocal"`
// Ons remote port number.
OnsPortRemote *int `mandatory:"false" json:"onsPortRemote"`
// The OCID of private endpoint being used by the sharded database.
PrivateEndpoint *string `mandatory:"false" json:"privateEndpoint"`
ConnectionStrings *ConnectionString `mandatory:"false" json:"connectionStrings"`
// Timezone associated with the sharded database.
TimeZone *string `mandatory:"false" json:"timeZone"`
// Details of GSM instances for the sharded database.
Gsms []GsmDetails `mandatory:"false" json:"gsms"`
// Details of ATP-D based shards.
ShardDetails []DedicatedShardDetails `mandatory:"false" json:"shardDetails"`
// Details of ATP-D based catalogs.
CatalogDetails []DedicatedCatalogDetails `mandatory:"false" json:"catalogDetails"`
// The Replication method for sharded database. Use RAFT for Raft replication, and DG for
// DataGuard. If replicationMethod is not provided, it defaults to DG.
ReplicationMethod DedicatedShardedDatabaseReplicationMethodEnum `mandatory:"false" json:"replicationMethod,omitempty"`
// Possible workload types.
DbWorkload DedicatedShardedDatabaseDbWorkloadEnum `mandatory:"false" json:"dbWorkload,omitempty"`
// Sharding Method.
ShardingMethod DedicatedShardedDatabaseShardingMethodEnum `mandatory:"true" json:"shardingMethod"`
// Lifecycle states for sharded databases.
LifecycleState ShardedDatabaseLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
}
// GetId returns Id
func (m DedicatedShardedDatabase) GetId() *string {
return m.Id
}
// GetCompartmentId returns CompartmentId
func (m DedicatedShardedDatabase) GetCompartmentId() *string {
return m.CompartmentId
}
// GetDisplayName returns DisplayName
func (m DedicatedShardedDatabase) GetDisplayName() *string {
return m.DisplayName
}
// GetTimeCreated returns TimeCreated
func (m DedicatedShardedDatabase) GetTimeCreated() *common.SDKTime {
return m.TimeCreated
}
// GetTimeUpdated returns TimeUpdated
func (m DedicatedShardedDatabase) GetTimeUpdated() *common.SDKTime {
return m.TimeUpdated
}
// GetLifecycleState returns LifecycleState
func (m DedicatedShardedDatabase) GetLifecycleState() ShardedDatabaseLifecycleStateEnum {
return m.LifecycleState
}
// GetLifecycleStateDetails returns LifecycleStateDetails
func (m DedicatedShardedDatabase) GetLifecycleStateDetails() *string {
return m.LifecycleStateDetails
}
// GetFreeformTags returns FreeformTags
func (m DedicatedShardedDatabase) GetFreeformTags() map[string]string {
return m.FreeformTags
}
// GetDefinedTags returns DefinedTags
func (m DedicatedShardedDatabase) GetDefinedTags() map[string]map[string]interface{} {
return m.DefinedTags
}
// GetSystemTags returns SystemTags
func (m DedicatedShardedDatabase) GetSystemTags() map[string]map[string]interface{} {
return m.SystemTags
}
func (m DedicatedShardedDatabase) String() string {
return common.PointerString(m)
}
// ValidateEnumValue returns an error when providing an unsupported enum value
// This function is being called during constructing API request process
// Not recommended for calling this function directly
func (m DedicatedShardedDatabase) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingDedicatedShardedDatabaseReplicationMethodEnum(string(m.ReplicationMethod)); !ok && m.ReplicationMethod != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ReplicationMethod: %s. Supported values are: %s.", m.ReplicationMethod, strings.Join(GetDedicatedShardedDatabaseReplicationMethodEnumStringValues(), ",")))
}
if _, ok := GetMappingDedicatedShardedDatabaseDbWorkloadEnum(string(m.DbWorkload)); !ok && m.DbWorkload != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for DbWorkload: %s. Supported values are: %s.", m.DbWorkload, strings.Join(GetDedicatedShardedDatabaseDbWorkloadEnumStringValues(), ",")))
}
if _, ok := GetMappingDedicatedShardedDatabaseShardingMethodEnum(string(m.ShardingMethod)); !ok && m.ShardingMethod != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ShardingMethod: %s. Supported values are: %s.", m.ShardingMethod, strings.Join(GetDedicatedShardedDatabaseShardingMethodEnumStringValues(), ",")))
}
if _, ok := GetMappingShardedDatabaseLifecycleStateEnum(string(m.LifecycleState)); !ok && m.LifecycleState != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for LifecycleState: %s. Supported values are: %s.", m.LifecycleState, strings.Join(GetShardedDatabaseLifecycleStateEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// MarshalJSON marshals to json representation
func (m DedicatedShardedDatabase) MarshalJSON() (buff []byte, e error) {
type MarshalTypeDedicatedShardedDatabase DedicatedShardedDatabase
s := struct {
DiscriminatorParam string `json:"dbDeploymentType"`
MarshalTypeDedicatedShardedDatabase
}{
"DEDICATED",
(MarshalTypeDedicatedShardedDatabase)(m),
}
return json.Marshal(&s)
}
// DedicatedShardedDatabaseReplicationMethodEnum Enum with underlying type: string
type DedicatedShardedDatabaseReplicationMethodEnum string
// Set of constants representing the allowable values for DedicatedShardedDatabaseReplicationMethodEnum
const (
DedicatedShardedDatabaseReplicationMethodRaft DedicatedShardedDatabaseReplicationMethodEnum = "RAFT"
DedicatedShardedDatabaseReplicationMethodDg DedicatedShardedDatabaseReplicationMethodEnum = "DG"
)
var mappingDedicatedShardedDatabaseReplicationMethodEnum = map[string]DedicatedShardedDatabaseReplicationMethodEnum{
"RAFT": DedicatedShardedDatabaseReplicationMethodRaft,
"DG": DedicatedShardedDatabaseReplicationMethodDg,
}
var mappingDedicatedShardedDatabaseReplicationMethodEnumLowerCase = map[string]DedicatedShardedDatabaseReplicationMethodEnum{
"raft": DedicatedShardedDatabaseReplicationMethodRaft,
"dg": DedicatedShardedDatabaseReplicationMethodDg,
}
// GetDedicatedShardedDatabaseReplicationMethodEnumValues Enumerates the set of values for DedicatedShardedDatabaseReplicationMethodEnum
func GetDedicatedShardedDatabaseReplicationMethodEnumValues() []DedicatedShardedDatabaseReplicationMethodEnum {
values := make([]DedicatedShardedDatabaseReplicationMethodEnum, 0)
for _, v := range mappingDedicatedShardedDatabaseReplicationMethodEnum {
values = append(values, v)
}
return values
}
// GetDedicatedShardedDatabaseReplicationMethodEnumStringValues Enumerates the set of values in String for DedicatedShardedDatabaseReplicationMethodEnum
func GetDedicatedShardedDatabaseReplicationMethodEnumStringValues() []string {
return []string{
"RAFT",
"DG",
}
}
// GetMappingDedicatedShardedDatabaseReplicationMethodEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingDedicatedShardedDatabaseReplicationMethodEnum(val string) (DedicatedShardedDatabaseReplicationMethodEnum, bool) {
enum, ok := mappingDedicatedShardedDatabaseReplicationMethodEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// DedicatedShardedDatabaseDbWorkloadEnum Enum with underlying type: string
type DedicatedShardedDatabaseDbWorkloadEnum string
// Set of constants representing the allowable values for DedicatedShardedDatabaseDbWorkloadEnum
const (
DedicatedShardedDatabaseDbWorkloadOltp DedicatedShardedDatabaseDbWorkloadEnum = "OLTP"
DedicatedShardedDatabaseDbWorkloadDw DedicatedShardedDatabaseDbWorkloadEnum = "DW"
)
var mappingDedicatedShardedDatabaseDbWorkloadEnum = map[string]DedicatedShardedDatabaseDbWorkloadEnum{
"OLTP": DedicatedShardedDatabaseDbWorkloadOltp,
"DW": DedicatedShardedDatabaseDbWorkloadDw,
}
var mappingDedicatedShardedDatabaseDbWorkloadEnumLowerCase = map[string]DedicatedShardedDatabaseDbWorkloadEnum{
"oltp": DedicatedShardedDatabaseDbWorkloadOltp,
"dw": DedicatedShardedDatabaseDbWorkloadDw,
}
// GetDedicatedShardedDatabaseDbWorkloadEnumValues Enumerates the set of values for DedicatedShardedDatabaseDbWorkloadEnum
func GetDedicatedShardedDatabaseDbWorkloadEnumValues() []DedicatedShardedDatabaseDbWorkloadEnum {
values := make([]DedicatedShardedDatabaseDbWorkloadEnum, 0)
for _, v := range mappingDedicatedShardedDatabaseDbWorkloadEnum {
values = append(values, v)
}
return values
}
// GetDedicatedShardedDatabaseDbWorkloadEnumStringValues Enumerates the set of values in String for DedicatedShardedDatabaseDbWorkloadEnum
func GetDedicatedShardedDatabaseDbWorkloadEnumStringValues() []string {
return []string{
"OLTP",
"DW",
}
}
// GetMappingDedicatedShardedDatabaseDbWorkloadEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingDedicatedShardedDatabaseDbWorkloadEnum(val string) (DedicatedShardedDatabaseDbWorkloadEnum, bool) {
enum, ok := mappingDedicatedShardedDatabaseDbWorkloadEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// DedicatedShardedDatabaseShardingMethodEnum Enum with underlying type: string
type DedicatedShardedDatabaseShardingMethodEnum string
// Set of constants representing the allowable values for DedicatedShardedDatabaseShardingMethodEnum
const (
DedicatedShardedDatabaseShardingMethodUser DedicatedShardedDatabaseShardingMethodEnum = "USER"
DedicatedShardedDatabaseShardingMethodSystem DedicatedShardedDatabaseShardingMethodEnum = "SYSTEM"
)
var mappingDedicatedShardedDatabaseShardingMethodEnum = map[string]DedicatedShardedDatabaseShardingMethodEnum{
"USER": DedicatedShardedDatabaseShardingMethodUser,
"SYSTEM": DedicatedShardedDatabaseShardingMethodSystem,
}
var mappingDedicatedShardedDatabaseShardingMethodEnumLowerCase = map[string]DedicatedShardedDatabaseShardingMethodEnum{
"user": DedicatedShardedDatabaseShardingMethodUser,
"system": DedicatedShardedDatabaseShardingMethodSystem,
}
// GetDedicatedShardedDatabaseShardingMethodEnumValues Enumerates the set of values for DedicatedShardedDatabaseShardingMethodEnum
func GetDedicatedShardedDatabaseShardingMethodEnumValues() []DedicatedShardedDatabaseShardingMethodEnum {
values := make([]DedicatedShardedDatabaseShardingMethodEnum, 0)
for _, v := range mappingDedicatedShardedDatabaseShardingMethodEnum {
values = append(values, v)
}
return values
}
// GetDedicatedShardedDatabaseShardingMethodEnumStringValues Enumerates the set of values in String for DedicatedShardedDatabaseShardingMethodEnum
func GetDedicatedShardedDatabaseShardingMethodEnumStringValues() []string {
return []string{
"USER",
"SYSTEM",
}
}
// GetMappingDedicatedShardedDatabaseShardingMethodEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingDedicatedShardedDatabaseShardingMethodEnum(val string) (DedicatedShardedDatabaseShardingMethodEnum, bool) {
enum, ok := mappingDedicatedShardedDatabaseShardingMethodEnumLowerCase[strings.ToLower(val)]
return enum, ok
}