-
Notifications
You must be signed in to change notification settings - Fork 188
/
server_spec_arm_types_gen.go
321 lines (244 loc) · 11.9 KB
/
server_spec_arm_types_gen.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
// Code generated by azure-service-operator-codegen. DO NOT EDIT.
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package v1beta20180601
import (
"encoding/json"
"github.com/Azure/azure-service-operator/v2/pkg/genruntime"
)
type Server_Spec_ARM struct {
// Location: The location the resource resides in.
Location *string `json:"location,omitempty"`
Name string `json:"name,omitempty"`
// Properties: Properties of the server.
Properties *ServerPropertiesForCreate_ARM `json:"properties,omitempty"`
// Sku: The SKU (pricing tier) of the server.
Sku *Sku_ARM `json:"sku,omitempty"`
// Tags: Application-specific metadata in the form of key-value pairs.
Tags map[string]string `json:"tags,omitempty"`
}
var _ genruntime.ARMResourceSpec = &Server_Spec_ARM{}
// GetAPIVersion returns the ARM API version of the resource. This is always "2018-06-01"
func (server Server_Spec_ARM) GetAPIVersion() string {
return string(APIVersion_Value)
}
// GetName returns the Name of the resource
func (server *Server_Spec_ARM) GetName() string {
return server.Name
}
// GetType returns the ARM Type of the resource. This is always "Microsoft.DBforMariaDB/servers"
func (server *Server_Spec_ARM) GetType() string {
return "Microsoft.DBforMariaDB/servers"
}
type ServerPropertiesForCreate_ARM struct {
// Default: Mutually exclusive with all other properties
Default *ServerPropertiesForDefaultCreate_ARM `json:"default,omitempty"`
// GeoRestore: Mutually exclusive with all other properties
GeoRestore *ServerPropertiesForGeoRestore_ARM `json:"geoRestore,omitempty"`
// PointInTimeRestore: Mutually exclusive with all other properties
PointInTimeRestore *ServerPropertiesForRestore_ARM `json:"pointInTimeRestore,omitempty"`
// Replica: Mutually exclusive with all other properties
Replica *ServerPropertiesForReplica_ARM `json:"replica,omitempty"`
}
// MarshalJSON defers JSON marshaling to the first non-nil property, because ServerPropertiesForCreate_ARM represents a discriminated union (JSON OneOf)
func (create ServerPropertiesForCreate_ARM) MarshalJSON() ([]byte, error) {
if create.Default != nil {
return json.Marshal(create.Default)
}
if create.GeoRestore != nil {
return json.Marshal(create.GeoRestore)
}
if create.PointInTimeRestore != nil {
return json.Marshal(create.PointInTimeRestore)
}
if create.Replica != nil {
return json.Marshal(create.Replica)
}
return nil, nil
}
// UnmarshalJSON unmarshals the ServerPropertiesForCreate_ARM
func (create *ServerPropertiesForCreate_ARM) UnmarshalJSON(data []byte) error {
var rawJson map[string]interface{}
err := json.Unmarshal(data, &rawJson)
if err != nil {
return err
}
discriminator := rawJson["createMode"]
if discriminator == "Default" {
create.Default = &ServerPropertiesForDefaultCreate_ARM{}
return json.Unmarshal(data, create.Default)
}
if discriminator == "GeoRestore" {
create.GeoRestore = &ServerPropertiesForGeoRestore_ARM{}
return json.Unmarshal(data, create.GeoRestore)
}
if discriminator == "PointInTimeRestore" {
create.PointInTimeRestore = &ServerPropertiesForRestore_ARM{}
return json.Unmarshal(data, create.PointInTimeRestore)
}
if discriminator == "Replica" {
create.Replica = &ServerPropertiesForReplica_ARM{}
return json.Unmarshal(data, create.Replica)
}
// No error
return nil
}
// Billing information related properties of a server.
type Sku_ARM struct {
// Capacity: The scale up/out capacity, representing server's compute units.
Capacity *int `json:"capacity,omitempty"`
// Family: The family of hardware.
Family *string `json:"family,omitempty"`
// Name: The name of the sku, typically, tier + family + cores, e.g. B_Gen4_1, GP_Gen5_8.
Name *string `json:"name,omitempty"`
// Size: The size code, to be interpreted by resource as appropriate.
Size *string `json:"size,omitempty"`
// Tier: The tier of the particular SKU, e.g. Basic.
Tier *Sku_Tier `json:"tier,omitempty"`
}
type ServerPropertiesForDefaultCreate_ARM struct {
// AdministratorLogin: The administrator's login name of a server. Can only be specified when the server is being created
// (and is required for creation).
AdministratorLogin *string `json:"administratorLogin,omitempty"`
// AdministratorLoginPassword: The password of the administrator login.
AdministratorLoginPassword string `json:"administratorLoginPassword,omitempty"`
// CreateMode: The mode to create a new server.
CreateMode ServerPropertiesForDefaultCreate_CreateMode `json:"createMode,omitempty"`
// MinimalTlsVersion: Enforce a minimal Tls version for the server.
MinimalTlsVersion *MinimalTlsVersion `json:"minimalTlsVersion,omitempty"`
// PublicNetworkAccess: Whether or not public network access is allowed for this server. Value is optional but if passed
// in, must be 'Enabled' or 'Disabled'
PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
// SslEnforcement: Enable ssl enforcement or not when connect to server.
SslEnforcement *SslEnforcement `json:"sslEnforcement,omitempty"`
// StorageProfile: Storage profile of a server.
StorageProfile *StorageProfile_ARM `json:"storageProfile,omitempty"`
// Version: Server version.
Version *ServerVersion `json:"version,omitempty"`
}
type ServerPropertiesForGeoRestore_ARM struct {
// CreateMode: The mode to create a new server.
CreateMode ServerPropertiesForGeoRestore_CreateMode `json:"createMode,omitempty"`
// MinimalTlsVersion: Enforce a minimal Tls version for the server.
MinimalTlsVersion *MinimalTlsVersion `json:"minimalTlsVersion,omitempty"`
// PublicNetworkAccess: Whether or not public network access is allowed for this server. Value is optional but if passed
// in, must be 'Enabled' or 'Disabled'
PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
// SourceServerId: The source server id to restore from.
SourceServerId *string `json:"sourceServerId,omitempty"`
// SslEnforcement: Enable ssl enforcement or not when connect to server.
SslEnforcement *SslEnforcement `json:"sslEnforcement,omitempty"`
// StorageProfile: Storage profile of a server.
StorageProfile *StorageProfile_ARM `json:"storageProfile,omitempty"`
// Version: Server version.
Version *ServerVersion `json:"version,omitempty"`
}
type ServerPropertiesForReplica_ARM struct {
// CreateMode: The mode to create a new server.
CreateMode ServerPropertiesForReplica_CreateMode `json:"createMode,omitempty"`
// MinimalTlsVersion: Enforce a minimal Tls version for the server.
MinimalTlsVersion *MinimalTlsVersion `json:"minimalTlsVersion,omitempty"`
// PublicNetworkAccess: Whether or not public network access is allowed for this server. Value is optional but if passed
// in, must be 'Enabled' or 'Disabled'
PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
// SourceServerId: The master server id to create replica from.
SourceServerId *string `json:"sourceServerId,omitempty"`
// SslEnforcement: Enable ssl enforcement or not when connect to server.
SslEnforcement *SslEnforcement `json:"sslEnforcement,omitempty"`
// StorageProfile: Storage profile of a server.
StorageProfile *StorageProfile_ARM `json:"storageProfile,omitempty"`
// Version: Server version.
Version *ServerVersion `json:"version,omitempty"`
}
type ServerPropertiesForRestore_ARM struct {
// CreateMode: The mode to create a new server.
CreateMode ServerPropertiesForRestore_CreateMode `json:"createMode,omitempty"`
// MinimalTlsVersion: Enforce a minimal Tls version for the server.
MinimalTlsVersion *MinimalTlsVersion `json:"minimalTlsVersion,omitempty"`
// PublicNetworkAccess: Whether or not public network access is allowed for this server. Value is optional but if passed
// in, must be 'Enabled' or 'Disabled'
PublicNetworkAccess *PublicNetworkAccess `json:"publicNetworkAccess,omitempty"`
// RestorePointInTime: Restore point creation time (ISO8601 format), specifying the time to restore from.
RestorePointInTime *string `json:"restorePointInTime,omitempty"`
// SourceServerId: The source server id to restore from.
SourceServerId *string `json:"sourceServerId,omitempty"`
// SslEnforcement: Enable ssl enforcement or not when connect to server.
SslEnforcement *SslEnforcement `json:"sslEnforcement,omitempty"`
// StorageProfile: Storage profile of a server.
StorageProfile *StorageProfile_ARM `json:"storageProfile,omitempty"`
// Version: Server version.
Version *ServerVersion `json:"version,omitempty"`
}
// +kubebuilder:validation:Enum={"Basic","GeneralPurpose","MemoryOptimized"}
type Sku_Tier string
const (
Sku_Tier_Basic = Sku_Tier("Basic")
Sku_Tier_GeneralPurpose = Sku_Tier("GeneralPurpose")
Sku_Tier_MemoryOptimized = Sku_Tier("MemoryOptimized")
)
// Enforce a minimal Tls version for the server.
// +kubebuilder:validation:Enum={"TLS1_0","TLS1_1","TLS1_2","TLSEnforcementDisabled"}
type MinimalTlsVersion string
const (
MinimalTlsVersion_TLS1_0 = MinimalTlsVersion("TLS1_0")
MinimalTlsVersion_TLS1_1 = MinimalTlsVersion("TLS1_1")
MinimalTlsVersion_TLS1_2 = MinimalTlsVersion("TLS1_2")
MinimalTlsVersion_TLSEnforcementDisabled = MinimalTlsVersion("TLSEnforcementDisabled")
)
// Whether or not public network access is allowed for this server. Value is optional but if passed in, must be 'Enabled'
// or 'Disabled'
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type PublicNetworkAccess string
const (
PublicNetworkAccess_Disabled = PublicNetworkAccess("Disabled")
PublicNetworkAccess_Enabled = PublicNetworkAccess("Enabled")
)
// +kubebuilder:validation:Enum={"Default"}
type ServerPropertiesForDefaultCreate_CreateMode string
const ServerPropertiesForDefaultCreate_CreateMode_Default = ServerPropertiesForDefaultCreate_CreateMode("Default")
// +kubebuilder:validation:Enum={"GeoRestore"}
type ServerPropertiesForGeoRestore_CreateMode string
const ServerPropertiesForGeoRestore_CreateMode_GeoRestore = ServerPropertiesForGeoRestore_CreateMode("GeoRestore")
// +kubebuilder:validation:Enum={"Replica"}
type ServerPropertiesForReplica_CreateMode string
const ServerPropertiesForReplica_CreateMode_Replica = ServerPropertiesForReplica_CreateMode("Replica")
// +kubebuilder:validation:Enum={"PointInTimeRestore"}
type ServerPropertiesForRestore_CreateMode string
const ServerPropertiesForRestore_CreateMode_PointInTimeRestore = ServerPropertiesForRestore_CreateMode("PointInTimeRestore")
// The version of a server.
// +kubebuilder:validation:Enum={"10.2","10.3"}
type ServerVersion string
const (
ServerVersion_102 = ServerVersion("10.2")
ServerVersion_103 = ServerVersion("10.3")
)
// Enable ssl enforcement or not when connect to server.
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type SslEnforcement string
const (
SslEnforcement_Disabled = SslEnforcement("Disabled")
SslEnforcement_Enabled = SslEnforcement("Enabled")
)
// Storage Profile properties of a server
type StorageProfile_ARM struct {
// BackupRetentionDays: Backup retention days for the server.
BackupRetentionDays *int `json:"backupRetentionDays,omitempty"`
// GeoRedundantBackup: Enable Geo-redundant or not for server backup.
GeoRedundantBackup *StorageProfile_GeoRedundantBackup `json:"geoRedundantBackup,omitempty"`
// StorageAutogrow: Enable Storage Auto Grow.
StorageAutogrow *StorageProfile_StorageAutogrow `json:"storageAutogrow,omitempty"`
// StorageMB: Max storage allowed for a server.
StorageMB *int `json:"storageMB,omitempty"`
}
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type StorageProfile_GeoRedundantBackup string
const (
StorageProfile_GeoRedundantBackup_Disabled = StorageProfile_GeoRedundantBackup("Disabled")
StorageProfile_GeoRedundantBackup_Enabled = StorageProfile_GeoRedundantBackup("Enabled")
)
// +kubebuilder:validation:Enum={"Disabled","Enabled"}
type StorageProfile_StorageAutogrow string
const (
StorageProfile_StorageAutogrow_Disabled = StorageProfile_StorageAutogrow("Disabled")
StorageProfile_StorageAutogrow_Enabled = StorageProfile_StorageAutogrow("Enabled")
)