-
Notifications
You must be signed in to change notification settings - Fork 46
/
constants.go
330 lines (298 loc) · 13.8 KB
/
constants.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
package backupprotectioncontainers
import "strings"
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See NOTICE.txt in the project root for license information.
type AcquireStorageAccountLock string
const (
AcquireStorageAccountLockAcquire AcquireStorageAccountLock = "Acquire"
AcquireStorageAccountLockNotAcquire AcquireStorageAccountLock = "NotAcquire"
)
func PossibleValuesForAcquireStorageAccountLock() []string {
return []string{
string(AcquireStorageAccountLockAcquire),
string(AcquireStorageAccountLockNotAcquire),
}
}
func parseAcquireStorageAccountLock(input string) (*AcquireStorageAccountLock, error) {
vals := map[string]AcquireStorageAccountLock{
"acquire": AcquireStorageAccountLockAcquire,
"notacquire": AcquireStorageAccountLockNotAcquire,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := AcquireStorageAccountLock(input)
return &out, nil
}
type BackupItemType string
const (
BackupItemTypeAzureFileShare BackupItemType = "AzureFileShare"
BackupItemTypeAzureSqlDb BackupItemType = "AzureSqlDb"
BackupItemTypeClient BackupItemType = "Client"
BackupItemTypeExchange BackupItemType = "Exchange"
BackupItemTypeFileFolder BackupItemType = "FileFolder"
BackupItemTypeGenericDataSource BackupItemType = "GenericDataSource"
BackupItemTypeInvalid BackupItemType = "Invalid"
BackupItemTypeSAPAseDatabase BackupItemType = "SAPAseDatabase"
BackupItemTypeSAPHanaDBInstance BackupItemType = "SAPHanaDBInstance"
BackupItemTypeSAPHanaDatabase BackupItemType = "SAPHanaDatabase"
BackupItemTypeSQLDB BackupItemType = "SQLDB"
BackupItemTypeSQLDataBase BackupItemType = "SQLDataBase"
BackupItemTypeSharepoint BackupItemType = "Sharepoint"
BackupItemTypeSystemState BackupItemType = "SystemState"
BackupItemTypeVM BackupItemType = "VM"
BackupItemTypeVMwareVM BackupItemType = "VMwareVM"
)
func PossibleValuesForBackupItemType() []string {
return []string{
string(BackupItemTypeAzureFileShare),
string(BackupItemTypeAzureSqlDb),
string(BackupItemTypeClient),
string(BackupItemTypeExchange),
string(BackupItemTypeFileFolder),
string(BackupItemTypeGenericDataSource),
string(BackupItemTypeInvalid),
string(BackupItemTypeSAPAseDatabase),
string(BackupItemTypeSAPHanaDBInstance),
string(BackupItemTypeSAPHanaDatabase),
string(BackupItemTypeSQLDB),
string(BackupItemTypeSQLDataBase),
string(BackupItemTypeSharepoint),
string(BackupItemTypeSystemState),
string(BackupItemTypeVM),
string(BackupItemTypeVMwareVM),
}
}
func parseBackupItemType(input string) (*BackupItemType, error) {
vals := map[string]BackupItemType{
"azurefileshare": BackupItemTypeAzureFileShare,
"azuresqldb": BackupItemTypeAzureSqlDb,
"client": BackupItemTypeClient,
"exchange": BackupItemTypeExchange,
"filefolder": BackupItemTypeFileFolder,
"genericdatasource": BackupItemTypeGenericDataSource,
"invalid": BackupItemTypeInvalid,
"sapasedatabase": BackupItemTypeSAPAseDatabase,
"saphanadbinstance": BackupItemTypeSAPHanaDBInstance,
"saphanadatabase": BackupItemTypeSAPHanaDatabase,
"sqldb": BackupItemTypeSQLDB,
"sqldatabase": BackupItemTypeSQLDataBase,
"sharepoint": BackupItemTypeSharepoint,
"systemstate": BackupItemTypeSystemState,
"vm": BackupItemTypeVM,
"vmwarevm": BackupItemTypeVMwareVM,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := BackupItemType(input)
return &out, nil
}
type BackupManagementType string
const (
BackupManagementTypeAzureBackupServer BackupManagementType = "AzureBackupServer"
BackupManagementTypeAzureIaasVM BackupManagementType = "AzureIaasVM"
BackupManagementTypeAzureSql BackupManagementType = "AzureSql"
BackupManagementTypeAzureStorage BackupManagementType = "AzureStorage"
BackupManagementTypeAzureWorkload BackupManagementType = "AzureWorkload"
BackupManagementTypeDPM BackupManagementType = "DPM"
BackupManagementTypeDefaultBackup BackupManagementType = "DefaultBackup"
BackupManagementTypeInvalid BackupManagementType = "Invalid"
BackupManagementTypeMAB BackupManagementType = "MAB"
)
func PossibleValuesForBackupManagementType() []string {
return []string{
string(BackupManagementTypeAzureBackupServer),
string(BackupManagementTypeAzureIaasVM),
string(BackupManagementTypeAzureSql),
string(BackupManagementTypeAzureStorage),
string(BackupManagementTypeAzureWorkload),
string(BackupManagementTypeDPM),
string(BackupManagementTypeDefaultBackup),
string(BackupManagementTypeInvalid),
string(BackupManagementTypeMAB),
}
}
func parseBackupManagementType(input string) (*BackupManagementType, error) {
vals := map[string]BackupManagementType{
"azurebackupserver": BackupManagementTypeAzureBackupServer,
"azureiaasvm": BackupManagementTypeAzureIaasVM,
"azuresql": BackupManagementTypeAzureSql,
"azurestorage": BackupManagementTypeAzureStorage,
"azureworkload": BackupManagementTypeAzureWorkload,
"dpm": BackupManagementTypeDPM,
"defaultbackup": BackupManagementTypeDefaultBackup,
"invalid": BackupManagementTypeInvalid,
"mab": BackupManagementTypeMAB,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := BackupManagementType(input)
return &out, nil
}
type OperationType string
const (
OperationTypeInvalid OperationType = "Invalid"
OperationTypeRegister OperationType = "Register"
OperationTypeReregister OperationType = "Reregister"
)
func PossibleValuesForOperationType() []string {
return []string{
string(OperationTypeInvalid),
string(OperationTypeRegister),
string(OperationTypeReregister),
}
}
func parseOperationType(input string) (*OperationType, error) {
vals := map[string]OperationType{
"invalid": OperationTypeInvalid,
"register": OperationTypeRegister,
"reregister": OperationTypeReregister,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := OperationType(input)
return &out, nil
}
type ProtectableContainerType string
const (
ProtectableContainerTypeAzureBackupServerContainer ProtectableContainerType = "AzureBackupServerContainer"
ProtectableContainerTypeAzureSqlContainer ProtectableContainerType = "AzureSqlContainer"
ProtectableContainerTypeAzureWorkloadContainer ProtectableContainerType = "AzureWorkloadContainer"
ProtectableContainerTypeCluster ProtectableContainerType = "Cluster"
ProtectableContainerTypeDPMContainer ProtectableContainerType = "DPMContainer"
ProtectableContainerTypeGenericContainer ProtectableContainerType = "GenericContainer"
ProtectableContainerTypeIaasVMContainer ProtectableContainerType = "IaasVMContainer"
ProtectableContainerTypeIaasVMServiceContainer ProtectableContainerType = "IaasVMServiceContainer"
ProtectableContainerTypeInvalid ProtectableContainerType = "Invalid"
ProtectableContainerTypeMABContainer ProtectableContainerType = "MABContainer"
ProtectableContainerTypeMicrosoftPointClassicComputeVirtualMachines ProtectableContainerType = "Microsoft.ClassicCompute/virtualMachines"
ProtectableContainerTypeMicrosoftPointComputeVirtualMachines ProtectableContainerType = "Microsoft.Compute/virtualMachines"
ProtectableContainerTypeSQLAGWorkLoadContainer ProtectableContainerType = "SQLAGWorkLoadContainer"
ProtectableContainerTypeStorageContainer ProtectableContainerType = "StorageContainer"
ProtectableContainerTypeUnknown ProtectableContainerType = "Unknown"
ProtectableContainerTypeVCenter ProtectableContainerType = "VCenter"
ProtectableContainerTypeVMAppContainer ProtectableContainerType = "VMAppContainer"
ProtectableContainerTypeWindows ProtectableContainerType = "Windows"
)
func PossibleValuesForProtectableContainerType() []string {
return []string{
string(ProtectableContainerTypeAzureBackupServerContainer),
string(ProtectableContainerTypeAzureSqlContainer),
string(ProtectableContainerTypeAzureWorkloadContainer),
string(ProtectableContainerTypeCluster),
string(ProtectableContainerTypeDPMContainer),
string(ProtectableContainerTypeGenericContainer),
string(ProtectableContainerTypeIaasVMContainer),
string(ProtectableContainerTypeIaasVMServiceContainer),
string(ProtectableContainerTypeInvalid),
string(ProtectableContainerTypeMABContainer),
string(ProtectableContainerTypeMicrosoftPointClassicComputeVirtualMachines),
string(ProtectableContainerTypeMicrosoftPointComputeVirtualMachines),
string(ProtectableContainerTypeSQLAGWorkLoadContainer),
string(ProtectableContainerTypeStorageContainer),
string(ProtectableContainerTypeUnknown),
string(ProtectableContainerTypeVCenter),
string(ProtectableContainerTypeVMAppContainer),
string(ProtectableContainerTypeWindows),
}
}
func parseProtectableContainerType(input string) (*ProtectableContainerType, error) {
vals := map[string]ProtectableContainerType{
"azurebackupservercontainer": ProtectableContainerTypeAzureBackupServerContainer,
"azuresqlcontainer": ProtectableContainerTypeAzureSqlContainer,
"azureworkloadcontainer": ProtectableContainerTypeAzureWorkloadContainer,
"cluster": ProtectableContainerTypeCluster,
"dpmcontainer": ProtectableContainerTypeDPMContainer,
"genericcontainer": ProtectableContainerTypeGenericContainer,
"iaasvmcontainer": ProtectableContainerTypeIaasVMContainer,
"iaasvmservicecontainer": ProtectableContainerTypeIaasVMServiceContainer,
"invalid": ProtectableContainerTypeInvalid,
"mabcontainer": ProtectableContainerTypeMABContainer,
"microsoft.classiccompute/virtualmachines": ProtectableContainerTypeMicrosoftPointClassicComputeVirtualMachines,
"microsoft.compute/virtualmachines": ProtectableContainerTypeMicrosoftPointComputeVirtualMachines,
"sqlagworkloadcontainer": ProtectableContainerTypeSQLAGWorkLoadContainer,
"storagecontainer": ProtectableContainerTypeStorageContainer,
"unknown": ProtectableContainerTypeUnknown,
"vcenter": ProtectableContainerTypeVCenter,
"vmappcontainer": ProtectableContainerTypeVMAppContainer,
"windows": ProtectableContainerTypeWindows,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := ProtectableContainerType(input)
return &out, nil
}
type WorkloadType string
const (
WorkloadTypeAzureFileShare WorkloadType = "AzureFileShare"
WorkloadTypeAzureSqlDb WorkloadType = "AzureSqlDb"
WorkloadTypeClient WorkloadType = "Client"
WorkloadTypeExchange WorkloadType = "Exchange"
WorkloadTypeFileFolder WorkloadType = "FileFolder"
WorkloadTypeGenericDataSource WorkloadType = "GenericDataSource"
WorkloadTypeInvalid WorkloadType = "Invalid"
WorkloadTypeSAPAseDatabase WorkloadType = "SAPAseDatabase"
WorkloadTypeSAPHanaDBInstance WorkloadType = "SAPHanaDBInstance"
WorkloadTypeSAPHanaDatabase WorkloadType = "SAPHanaDatabase"
WorkloadTypeSQLDB WorkloadType = "SQLDB"
WorkloadTypeSQLDataBase WorkloadType = "SQLDataBase"
WorkloadTypeSharepoint WorkloadType = "Sharepoint"
WorkloadTypeSystemState WorkloadType = "SystemState"
WorkloadTypeVM WorkloadType = "VM"
WorkloadTypeVMwareVM WorkloadType = "VMwareVM"
)
func PossibleValuesForWorkloadType() []string {
return []string{
string(WorkloadTypeAzureFileShare),
string(WorkloadTypeAzureSqlDb),
string(WorkloadTypeClient),
string(WorkloadTypeExchange),
string(WorkloadTypeFileFolder),
string(WorkloadTypeGenericDataSource),
string(WorkloadTypeInvalid),
string(WorkloadTypeSAPAseDatabase),
string(WorkloadTypeSAPHanaDBInstance),
string(WorkloadTypeSAPHanaDatabase),
string(WorkloadTypeSQLDB),
string(WorkloadTypeSQLDataBase),
string(WorkloadTypeSharepoint),
string(WorkloadTypeSystemState),
string(WorkloadTypeVM),
string(WorkloadTypeVMwareVM),
}
}
func parseWorkloadType(input string) (*WorkloadType, error) {
vals := map[string]WorkloadType{
"azurefileshare": WorkloadTypeAzureFileShare,
"azuresqldb": WorkloadTypeAzureSqlDb,
"client": WorkloadTypeClient,
"exchange": WorkloadTypeExchange,
"filefolder": WorkloadTypeFileFolder,
"genericdatasource": WorkloadTypeGenericDataSource,
"invalid": WorkloadTypeInvalid,
"sapasedatabase": WorkloadTypeSAPAseDatabase,
"saphanadbinstance": WorkloadTypeSAPHanaDBInstance,
"saphanadatabase": WorkloadTypeSAPHanaDatabase,
"sqldb": WorkloadTypeSQLDB,
"sqldatabase": WorkloadTypeSQLDataBase,
"sharepoint": WorkloadTypeSharepoint,
"systemstate": WorkloadTypeSystemState,
"vm": WorkloadTypeVM,
"vmwarevm": WorkloadTypeVMwareVM,
}
if v, ok := vals[strings.ToLower(input)]; ok {
return &v, nil
}
// otherwise presume it's an undefined value and best-effort it
out := WorkloadType(input)
return &out, nil
}