-
Notifications
You must be signed in to change notification settings - Fork 82
/
bds_instance.go
303 lines (252 loc) · 13 KB
/
bds_instance.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
// Copyright (c) 2016, 2018, 2023, 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.
// Big Data Service API
//
// REST API for Oracle Big Data Service. Use this API to build, deploy, and manage fully elastic Big Data Service clusters. Build on Hadoop, Spark and Data Science distributions, which can be fully integrated with existing enterprise data in Oracle Database and Oracle applications.
//
package bds
import (
"fmt"
"github.com/oracle/oci-go-sdk/v65/common"
"strings"
)
// BdsInstance Description of the cluster.
type BdsInstance struct {
// The OCID of the Big Data Service resource.
Id *string `mandatory:"true" json:"id"`
// The OCID of the compartment.
CompartmentId *string `mandatory:"true" json:"compartmentId"`
// The name of the cluster.
DisplayName *string `mandatory:"true" json:"displayName"`
// The state of the cluster.
LifecycleState BdsInstanceLifecycleStateEnum `mandatory:"true" json:"lifecycleState"`
// Boolean flag specifying whether or not the cluster is highly available (HA)
IsHighAvailability *bool `mandatory:"true" json:"isHighAvailability"`
// Boolean flag specifying whether or not the cluster should be set up as secure.
IsSecure *bool `mandatory:"true" json:"isSecure"`
// Boolean flag specifying whether or not Cloud SQL should be configured.
IsCloudSqlConfigured *bool `mandatory:"true" json:"isCloudSqlConfigured"`
// Boolean flag specifying whether or not Kafka should be configured.
IsKafkaConfigured *bool `mandatory:"true" json:"isKafkaConfigured"`
// The list of nodes in the cluster.
Nodes []Node `mandatory:"true" json:"nodes"`
// Number of nodes that forming the cluster
NumberOfNodes *int `mandatory:"true" json:"numberOfNodes"`
// Version of the Hadoop distribution.
ClusterVersion BdsInstanceClusterVersionEnum `mandatory:"false" json:"clusterVersion,omitempty"`
NetworkConfig *NetworkConfig `mandatory:"false" json:"networkConfig"`
ClusterDetails *ClusterDetails `mandatory:"false" json:"clusterDetails"`
CloudSqlDetails *CloudSqlDetails `mandatory:"false" json:"cloudSqlDetails"`
// The user who created the cluster.
CreatedBy *string `mandatory:"false" json:"createdBy"`
// The time the cluster was created, shown as an RFC 3339 formatted datetime string.
TimeCreated *common.SDKTime `mandatory:"false" json:"timeCreated"`
// The time the cluster was updated, shown as an RFC 3339 formatted datetime string.
TimeUpdated *common.SDKTime `mandatory:"false" json:"timeUpdated"`
// Number of nodes that require a maintenance reboot
NumberOfNodesRequiringMaintenanceReboot *int `mandatory:"false" json:"numberOfNodesRequiringMaintenanceReboot"`
// pre-authenticated URL of the bootstrap script in Object Store that can be downloaded and executed.
BootstrapScriptUrl *string `mandatory:"false" json:"bootstrapScriptUrl"`
// Simple key-value pair that is applied without any predefined name, type, or scope.
// Exists for cross-compatibility only. For 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.
// For example, `{"foo-namespace": {"bar-key": "value"}}`
DefinedTags map[string]map[string]interface{} `mandatory:"false" json:"definedTags"`
// The OCID of the Key Management master encryption key.
KmsKeyId *string `mandatory:"false" json:"kmsKeyId"`
// Profile of the Big Data Service cluster.
ClusterProfile BdsInstanceClusterProfileEnum `mandatory:"false" json:"clusterProfile,omitempty"`
}
func (m BdsInstance) 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 BdsInstance) ValidateEnumValue() (bool, error) {
errMessage := []string{}
if _, ok := GetMappingBdsInstanceLifecycleStateEnum(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(GetBdsInstanceLifecycleStateEnumStringValues(), ",")))
}
if _, ok := GetMappingBdsInstanceClusterVersionEnum(string(m.ClusterVersion)); !ok && m.ClusterVersion != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ClusterVersion: %s. Supported values are: %s.", m.ClusterVersion, strings.Join(GetBdsInstanceClusterVersionEnumStringValues(), ",")))
}
if _, ok := GetMappingBdsInstanceClusterProfileEnum(string(m.ClusterProfile)); !ok && m.ClusterProfile != "" {
errMessage = append(errMessage, fmt.Sprintf("unsupported enum value for ClusterProfile: %s. Supported values are: %s.", m.ClusterProfile, strings.Join(GetBdsInstanceClusterProfileEnumStringValues(), ",")))
}
if len(errMessage) > 0 {
return true, fmt.Errorf(strings.Join(errMessage, "\n"))
}
return false, nil
}
// BdsInstanceLifecycleStateEnum Enum with underlying type: string
type BdsInstanceLifecycleStateEnum string
// Set of constants representing the allowable values for BdsInstanceLifecycleStateEnum
const (
BdsInstanceLifecycleStateCreating BdsInstanceLifecycleStateEnum = "CREATING"
BdsInstanceLifecycleStateActive BdsInstanceLifecycleStateEnum = "ACTIVE"
BdsInstanceLifecycleStateUpdating BdsInstanceLifecycleStateEnum = "UPDATING"
BdsInstanceLifecycleStateSuspending BdsInstanceLifecycleStateEnum = "SUSPENDING"
BdsInstanceLifecycleStateSuspended BdsInstanceLifecycleStateEnum = "SUSPENDED"
BdsInstanceLifecycleStateResuming BdsInstanceLifecycleStateEnum = "RESUMING"
BdsInstanceLifecycleStateDeleting BdsInstanceLifecycleStateEnum = "DELETING"
BdsInstanceLifecycleStateDeleted BdsInstanceLifecycleStateEnum = "DELETED"
BdsInstanceLifecycleStateFailed BdsInstanceLifecycleStateEnum = "FAILED"
BdsInstanceLifecycleStateInactive BdsInstanceLifecycleStateEnum = "INACTIVE"
)
var mappingBdsInstanceLifecycleStateEnum = map[string]BdsInstanceLifecycleStateEnum{
"CREATING": BdsInstanceLifecycleStateCreating,
"ACTIVE": BdsInstanceLifecycleStateActive,
"UPDATING": BdsInstanceLifecycleStateUpdating,
"SUSPENDING": BdsInstanceLifecycleStateSuspending,
"SUSPENDED": BdsInstanceLifecycleStateSuspended,
"RESUMING": BdsInstanceLifecycleStateResuming,
"DELETING": BdsInstanceLifecycleStateDeleting,
"DELETED": BdsInstanceLifecycleStateDeleted,
"FAILED": BdsInstanceLifecycleStateFailed,
"INACTIVE": BdsInstanceLifecycleStateInactive,
}
var mappingBdsInstanceLifecycleStateEnumLowerCase = map[string]BdsInstanceLifecycleStateEnum{
"creating": BdsInstanceLifecycleStateCreating,
"active": BdsInstanceLifecycleStateActive,
"updating": BdsInstanceLifecycleStateUpdating,
"suspending": BdsInstanceLifecycleStateSuspending,
"suspended": BdsInstanceLifecycleStateSuspended,
"resuming": BdsInstanceLifecycleStateResuming,
"deleting": BdsInstanceLifecycleStateDeleting,
"deleted": BdsInstanceLifecycleStateDeleted,
"failed": BdsInstanceLifecycleStateFailed,
"inactive": BdsInstanceLifecycleStateInactive,
}
// GetBdsInstanceLifecycleStateEnumValues Enumerates the set of values for BdsInstanceLifecycleStateEnum
func GetBdsInstanceLifecycleStateEnumValues() []BdsInstanceLifecycleStateEnum {
values := make([]BdsInstanceLifecycleStateEnum, 0)
for _, v := range mappingBdsInstanceLifecycleStateEnum {
values = append(values, v)
}
return values
}
// GetBdsInstanceLifecycleStateEnumStringValues Enumerates the set of values in String for BdsInstanceLifecycleStateEnum
func GetBdsInstanceLifecycleStateEnumStringValues() []string {
return []string{
"CREATING",
"ACTIVE",
"UPDATING",
"SUSPENDING",
"SUSPENDED",
"RESUMING",
"DELETING",
"DELETED",
"FAILED",
"INACTIVE",
}
}
// GetMappingBdsInstanceLifecycleStateEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingBdsInstanceLifecycleStateEnum(val string) (BdsInstanceLifecycleStateEnum, bool) {
enum, ok := mappingBdsInstanceLifecycleStateEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// BdsInstanceClusterVersionEnum Enum with underlying type: string
type BdsInstanceClusterVersionEnum string
// Set of constants representing the allowable values for BdsInstanceClusterVersionEnum
const (
BdsInstanceClusterVersionCdh5 BdsInstanceClusterVersionEnum = "CDH5"
BdsInstanceClusterVersionCdh6 BdsInstanceClusterVersionEnum = "CDH6"
BdsInstanceClusterVersionOdh1 BdsInstanceClusterVersionEnum = "ODH1"
BdsInstanceClusterVersionOdh09 BdsInstanceClusterVersionEnum = "ODH0_9"
BdsInstanceClusterVersionOdh20 BdsInstanceClusterVersionEnum = "ODH2_0"
)
var mappingBdsInstanceClusterVersionEnum = map[string]BdsInstanceClusterVersionEnum{
"CDH5": BdsInstanceClusterVersionCdh5,
"CDH6": BdsInstanceClusterVersionCdh6,
"ODH1": BdsInstanceClusterVersionOdh1,
"ODH0_9": BdsInstanceClusterVersionOdh09,
"ODH2_0": BdsInstanceClusterVersionOdh20,
}
var mappingBdsInstanceClusterVersionEnumLowerCase = map[string]BdsInstanceClusterVersionEnum{
"cdh5": BdsInstanceClusterVersionCdh5,
"cdh6": BdsInstanceClusterVersionCdh6,
"odh1": BdsInstanceClusterVersionOdh1,
"odh0_9": BdsInstanceClusterVersionOdh09,
"odh2_0": BdsInstanceClusterVersionOdh20,
}
// GetBdsInstanceClusterVersionEnumValues Enumerates the set of values for BdsInstanceClusterVersionEnum
func GetBdsInstanceClusterVersionEnumValues() []BdsInstanceClusterVersionEnum {
values := make([]BdsInstanceClusterVersionEnum, 0)
for _, v := range mappingBdsInstanceClusterVersionEnum {
values = append(values, v)
}
return values
}
// GetBdsInstanceClusterVersionEnumStringValues Enumerates the set of values in String for BdsInstanceClusterVersionEnum
func GetBdsInstanceClusterVersionEnumStringValues() []string {
return []string{
"CDH5",
"CDH6",
"ODH1",
"ODH0_9",
"ODH2_0",
}
}
// GetMappingBdsInstanceClusterVersionEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingBdsInstanceClusterVersionEnum(val string) (BdsInstanceClusterVersionEnum, bool) {
enum, ok := mappingBdsInstanceClusterVersionEnumLowerCase[strings.ToLower(val)]
return enum, ok
}
// BdsInstanceClusterProfileEnum Enum with underlying type: string
type BdsInstanceClusterProfileEnum string
// Set of constants representing the allowable values for BdsInstanceClusterProfileEnum
const (
BdsInstanceClusterProfileHadoopExtended BdsInstanceClusterProfileEnum = "HADOOP_EXTENDED"
BdsInstanceClusterProfileHadoop BdsInstanceClusterProfileEnum = "HADOOP"
BdsInstanceClusterProfileHive BdsInstanceClusterProfileEnum = "HIVE"
BdsInstanceClusterProfileSpark BdsInstanceClusterProfileEnum = "SPARK"
BdsInstanceClusterProfileHbase BdsInstanceClusterProfileEnum = "HBASE"
BdsInstanceClusterProfileTrino BdsInstanceClusterProfileEnum = "TRINO"
BdsInstanceClusterProfileKafka BdsInstanceClusterProfileEnum = "KAFKA"
)
var mappingBdsInstanceClusterProfileEnum = map[string]BdsInstanceClusterProfileEnum{
"HADOOP_EXTENDED": BdsInstanceClusterProfileHadoopExtended,
"HADOOP": BdsInstanceClusterProfileHadoop,
"HIVE": BdsInstanceClusterProfileHive,
"SPARK": BdsInstanceClusterProfileSpark,
"HBASE": BdsInstanceClusterProfileHbase,
"TRINO": BdsInstanceClusterProfileTrino,
"KAFKA": BdsInstanceClusterProfileKafka,
}
var mappingBdsInstanceClusterProfileEnumLowerCase = map[string]BdsInstanceClusterProfileEnum{
"hadoop_extended": BdsInstanceClusterProfileHadoopExtended,
"hadoop": BdsInstanceClusterProfileHadoop,
"hive": BdsInstanceClusterProfileHive,
"spark": BdsInstanceClusterProfileSpark,
"hbase": BdsInstanceClusterProfileHbase,
"trino": BdsInstanceClusterProfileTrino,
"kafka": BdsInstanceClusterProfileKafka,
}
// GetBdsInstanceClusterProfileEnumValues Enumerates the set of values for BdsInstanceClusterProfileEnum
func GetBdsInstanceClusterProfileEnumValues() []BdsInstanceClusterProfileEnum {
values := make([]BdsInstanceClusterProfileEnum, 0)
for _, v := range mappingBdsInstanceClusterProfileEnum {
values = append(values, v)
}
return values
}
// GetBdsInstanceClusterProfileEnumStringValues Enumerates the set of values in String for BdsInstanceClusterProfileEnum
func GetBdsInstanceClusterProfileEnumStringValues() []string {
return []string{
"HADOOP_EXTENDED",
"HADOOP",
"HIVE",
"SPARK",
"HBASE",
"TRINO",
"KAFKA",
}
}
// GetMappingBdsInstanceClusterProfileEnum performs case Insensitive comparison on enum value and return the desired enum
func GetMappingBdsInstanceClusterProfileEnum(val string) (BdsInstanceClusterProfileEnum, bool) {
enum, ok := mappingBdsInstanceClusterProfileEnumLowerCase[strings.ToLower(val)]
return enum, ok
}