-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathforms.yaml
364 lines (362 loc) · 11.4 KB
/
forms.yaml
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
categories:
- name: Default
icon: bars
- name: Dataset
icon: bath
- name: Create
icon: bath
- name: Clone
icon: bath
roles:
- name: admin
groups:
- local/admins
- ldap/Domain Admins
- name: operator
groups:
- local/operator
- name: demo
groups:
- local/demo
- name: public
groups: []
- name: DataOps
groups:
- local/DataOps Admins
forms:
- name: Create new dataset
help: |
This is used to create new dataset in the FZ-DEV. The new dataset will be mounted under /data/{aud,eng,nlp,vis}/datasets
roles:
- DataOps
description: New dataset creation
categories:
- Dataset
- Create
#tileClass: has-background-link
icon: scroll
playbook: dataops_create_vol.yaml
inventory: hosts
type: ansible
fields:
- type: expression
hide: true
label: globals
name: globals
expression: "fn.fnReadJsonFile('/app/dist/persistent/global.json','')"
#- type: expression
# name: existingvols
# label: existingvols
# expression: fn.fnRestBasic('get','https://$(cluster)/api/storage/volumes?order_by=name&svm.name=$(svm)&fields=name','','ONTAP','.records | map(.name) | "^(?!.*" + join (")(?!.*")+ ").*$"')
#set the vol type as flexgroup or flexvol
- type: enum
name: department
label: Depratment
default: aud
values:
- aud
- eng
- nlp
- vis
required: true
- type: text
name: dataset_name
label: Dataset Name
default: ""
required: true
minLength: 3
maxLength: 20
#regex: $(existingvols)
#regex: ^(?!.*app1)(?!.*app2)(?!.*svm1_root)(?!.*user_dans)(?!.*user_gracel)(?!.*user_hmarko)(?!.*user_janes)(?!.*user_kateh)(?!.*user_koko)(?!.*user_marium)(?!.*user_oved)(?!.*user_stanw)(?!.*user_stever)(?!.*user_tzafrir)(?!.*user_user)(?!.*user_userkk)(?!.*user_userko)(?!.*user_useruuu)(?!.*vol1).*$
#regexDescription: Dataset already exists
regex: ^[a-zA-Z0-9_]*$
regexDescription: Invalid dataset name
#will be used to create the volume name (department_projectname)
- type: expression
hide: true
label: volname
name: volname
expression: "'$(department)'+'_'+'$(dataset_name)'"
#will be used to create the junction path on the globalname space)
- type: expression
hide: true
label: junction_path
name: junction_path
expression: "'/data/'+'$(department)'+'/datasets/'+'$(dataset_name)'"
- type: enum
name: volsize
label: Dataset Initial Size
default: 2TB
required: true
values:
- 100GB
- 200GB
- 300GB
- 400GB
- 500GB
- 600GB
- 700GB
- 800GB
- 900GB
- 1TB
- 2TB
- 3TB
- 4TB
- 5TB
- 10TB
- 20TB
- 50TB
size: 4
help: Select the size of the volume. The volume will be created thin provisioned and can be resized in later phase.
- name: Clone dataset from FZ-DEV to SZ
help: |
This is used to clone dataset in the FZ-DEV. The new dataset will be mounted under /data/{aud,eng,nlp,vis}/datasets on the SZ
roles:
- DataOps
description: Clone dataset
categories:
- Dataset
- Clone
#tileClass: has-background-link
icon: scroll
playbook: dataops_clone_vol.yaml
inventory: hosts
type: ansible
fields:
#load global parameters
- type: expression
hide: true
label: globals
name: globals
expression: "fn.fnReadJsonFile('/app/dist/persistent/global.json','')"
- type: expression
runLocal: true
hide: true
label: cluster
name: cluster
expression: "JSON.parse('$(globals)').cluster"
- type: expression
runLocal: true
hide: true
label: sourcesvm
name: sourcesvm
expression: "JSON.parse('$(globals)').sourcesvm"
- type: enum
name: department
label: Depratment
default: aud
values:
- aud
- eng
- nlp
- vis
required: true
- type: query
name: dataset
expression: fn.fnRestBasic('get','https://$(cluster)/api/storage/volumes?svm.name=$(sourcesvm)&state=online&nas.path=/data/$(department)/datasets/*&name=$(department)_*&fields=nas.path&style=flexgroup,flexvol','','ONTAP','[(.records[] | ({Volume:.name} + {uuid} + {Path:.nas.path} + {Dataset:.nas.path | sub("^/data/$(department)/datasets/"; "")}))]','','')
label: Source Dataset
default: __auto__
multiple: false
outputObject: true
columns:
- Dataset
- Volume
- Path
- type: query
name: parent_snapshot
expression: fn.fnRestBasic('get','https://$(cluster)/api/storage/volumes/$(dataset.uuid)/snapshots?fields=name,create_time','','ONTAP','[(.records[] | ({Snapshot:.name} + {"Create Time":.create_time} ) ) ]','','')
label: Parent Snapshot
default: __auto__
multiple: false
outputObject: true
columns:
- Snapshot
- "Create Time"
- type: text
name: clone_dataset
label: Optional Clone Dataset Name
placeholder: optional dataset name, if not provided source name will be used
required: false
minLength: 1
maxLength: 20
regex: ^[a-zA-Z0-9_]*$
regexDescription: Invalid dataset name
default: ""
- type: expression
hide: true
label: targetvolume
name: targetvolume
expression: "'$(clone_dataset)'=='' ? '$(dataset.Volume)' : '$(department)'+'_'+'$(clone_dataset)'"
runLocal: true
- type: expression
hide: true
label: new_dataset
name: new_dataset
expression: "'$(clone_dataset)'=='' ? '$(dataset.Volume)' : '$(clone_dataset)'"
runLocal: true
- type: expression
hide: true
label: junction_path
name: junction_path
expression: "'/data/'+'$(department)'+'/datasets/'+'$(new_dataset)'"
runLocal: true
- name: Create snapshot
help: |
This is used to create snapshot for dataset
roles:
- DataOps
description: create snapshot on existing dataset
categories:
- Snapshot
- Create
#tileClass: has-background-link
icon: scroll
playbook: dataops_create_snapshot.yaml
inventory: hosts
type: ansible
fields:
#load global parameters
- type: expression
hide: true
label: globals
name: globals
expression: fn.fnReadJsonFile('/app/dist/persistent/global.json','')
- type: expression
runLocal: true
hide: true
label: cluster
name: cluster
expression: "JSON.parse('$(globals)').cluster"
- type: enum
name: department
label: Depratment
default: aud
values:
- aud
- eng
- nlp
- vis
required: true
- type: query
name: svm
expression: fn.fnRestBasic('get','https://$(cluster)/api/svm/svms?name=svm*&fields=name','','ONTAP','[.records[]]','','')
label: SVM
default: __auto__
multiple: false
outputObject: true
columns:
- name
- type: query
name: dataset
expression: fn.fnRestBasic('get','https://$(cluster)/api/storage/volumes?svm.name=$(svm.name)&state=online&nas.path=/data/$(department)/datasets/*&name=$(department)_*&fields=nas.path&style=flexgroup,flexvol','','ONTAP','[(.records[] | ({Volume:.name} + {uuid} + {Path:.nas.path} + {Dataset:.nas.path | sub("^/data/$(department)/datasets/"; "")}))]','','')
label: Dataset
default: __auto__
multiple: false
outputObject: true
columns:
- Dataset
- Volume
- Path
- type: text
name: snapshot
label: Snapshot Name
placeholder: manual snapshot name
required: true
minLength: 1
maxLength: 20
regex: ^[a-zA-Z0-9_]*$
regexDescription: Invalid snapshot name
- type: enum
name: retention
label: Retention Count
default: "0"
values:
- "0"
- "1"
- "2"
- "3"
- "4"
- "5"
- "10"
multiple: false
size: 4
required: true
icon: flag
help: when retention is bigger than 0, retention count of snapshots will be kept and snapshots will be suffixed by timestamp
- name: Delete dataset clone
help: |
This is used to permanently delete dataset and all its data.
This can only be done if this dataset have no clones
roles:
- DataOps
description: Delete dataset
categories:
- Dataset
- Delete
tileClass: has-background-danger
icon: scroll
playbook: dataops_delete_vol.yaml
inventory: hosts
type: ansible
fields:
#load global parameters
- type: expression
hide: true
label: globals
name: globals
expression: "fn.fnReadJsonFile('/app/dist/persistent/global.json','')"
- type: expression
runLocal: true
hide: true
label: cluster
name: cluster
expression: "JSON.parse('$(globals)').cluster"
- type: enum
name: department
label: Depratment
default: aud
values:
- aud
- eng
- nlp
- vis
required: true
- type: query
name: svm
expression: fn.fnRestBasic('get','https://$(cluster)/api/svm/svms?name=svm*&fields=name','','ONTAP','[.records[]]','','')
label: SVM
default: __auto__
multiple: false
outputObject: true
columns:
- name
- type: query
name: dataset
expression: fn.fnRestBasic('get','https://$(cluster)/api/storage/volumes?svm.name=$(svm.name)&state=online&nas.path=/data/$(department)/datasets/*&name=$(department)_*&fields=nas.path,clone.is_flexclone,clone.parent_svm.name,clone.parent_volume.name','','ONTAP','[(.records[] | ({Volume:.name} + {uuid} + {Path:.nas.path} + {FlexClone:.clone.is_flexclone} + {Dataset:.nas.path | sub("^/data/$(department)/datasets/"; "")}))]','','')
label: Source Dataset
default: __auto__
multiple: false
outputObject: true
columns:
- Dataset
- Volume
- Path
- FlexClone
- type: checkbox
name: areyousure
label: Confirmation
default: false
placeholder: Are you sure you want to delete the dataset (important data can be lost) ?
- type: text
name: confirmation
label: Please type YES to confirm you want to delete
placeholder: "YES"
required: true
minLength: 1
maxLength: 3
regex: ^YES$
regexDescription: Type YES to confirm
dependencies: # add a list of dependencies
- name: areyousure # reference field it depends on
values: # values of the reference field that are valid
- true