~nskaggs/+junk/xenial-test

« back to all changes in this revision

Viewing changes to src/github.com/altoros/gosigma/data/drivesdata.go

  • Committer: Nicholas Skaggs
  • Date: 2016-10-24 20:56:05 UTC
  • Revision ID: nicholas.skaggs@canonical.com-20161024205605-z8lta0uvuhtxwzwl
Initi with beta15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright 2014 ALTOROS
 
2
// Licensed under the AGPLv3, see LICENSE file for details.
 
3
 
 
4
package data
 
5
 
 
6
var driveOwner = MakeUserResource("80cb30fb-0ea3-43db-b27b-a125752cc0bf")
 
7
 
 
8
var drivesData = []Drive{
 
9
        Drive{
 
10
                Resource: *MakeDriveResource("2ef7b7c7-7ec4-47a7-9b69-087c9417c0ff"),
 
11
                Owner:    driveOwner,
 
12
                Status:   "unmounted",
 
13
        },
 
14
        Drive{
 
15
                Resource: *MakeDriveResource("3b30c7ef-1fda-416d-91d1-ba616859360c"),
 
16
                Owner:    driveOwner,
 
17
                Status:   "unmounted",
 
18
        },
 
19
        Drive{
 
20
                Resource: *MakeDriveResource("464aed14-8604-4277-be3c-9d53151d53b4"),
 
21
                Owner:    driveOwner,
 
22
                Status:   "unmounted",
 
23
        },
 
24
}
 
25
 
 
26
const jsonDrivesData = `{
 
27
    "meta": {
 
28
        "limit": 0,
 
29
        "offset": 0,
 
30
        "total_count": 9
 
31
    },
 
32
    "objects": [
 
33
        {
 
34
            "owner": {
 
35
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
36
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
37
            },
 
38
            "resource_uri": "/api/2.0/drives/2ef7b7c7-7ec4-47a7-9b69-087c9417c0ff/",
 
39
            "status": "unmounted",
 
40
            "uuid": "2ef7b7c7-7ec4-47a7-9b69-087c9417c0ff"
 
41
        },
 
42
        {
 
43
            "owner": {
 
44
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
45
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
46
            },
 
47
            "resource_uri": "/api/2.0/drives/3b30c7ef-1fda-416d-91d1-ba616859360c/",
 
48
            "status": "unmounted",
 
49
            "uuid": "3b30c7ef-1fda-416d-91d1-ba616859360c"
 
50
        },
 
51
        {
 
52
            "owner": {
 
53
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
54
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
55
            },
 
56
            "resource_uri": "/api/2.0/drives/464aed14-8604-4277-be3c-9d53151d53b4/",
 
57
            "status": "unmounted",
 
58
            "uuid": "464aed14-8604-4277-be3c-9d53151d53b4"
 
59
        },
 
60
        {
 
61
            "owner": {
 
62
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
63
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
64
            },
 
65
            "resource_uri": "/api/2.0/drives/47ec5074-6058-4b0f-9505-78c83bd5a88b/",
 
66
            "status": "unmounted",
 
67
            "uuid": "47ec5074-6058-4b0f-9505-78c83bd5a88b"
 
68
        },
 
69
        {
 
70
            "owner": {
 
71
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
72
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
73
            },
 
74
            "resource_uri": "/api/2.0/drives/7949e52e-c8ba-461b-a84f-3f247221c644/",
 
75
            "status": "unmounted",
 
76
            "uuid": "7949e52e-c8ba-461b-a84f-3f247221c644"
 
77
        },
 
78
        {
 
79
            "owner": {
 
80
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
81
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
82
            },
 
83
            "resource_uri": "/api/2.0/drives/81b020b0-8ea0-4602-b778-e4df4539f0f7/",
 
84
            "status": "unmounted",
 
85
            "uuid": "81b020b0-8ea0-4602-b778-e4df4539f0f7"
 
86
        },
 
87
        {
 
88
            "owner": {
 
89
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
90
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
91
            },
 
92
            "resource_uri": "/api/2.0/drives/baf8fed4-757f-4d9e-a23a-3b3ff81e16c4/",
 
93
            "status": "unmounted",
 
94
            "uuid": "baf8fed4-757f-4d9e-a23a-3b3ff81e16c4"
 
95
        },
 
96
        {
 
97
            "owner": {
 
98
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
99
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
100
            },
 
101
            "resource_uri": "/api/2.0/drives/cae6df75-00a1-490c-a96b-51777b3ec515/",
 
102
            "status": "unmounted",
 
103
            "uuid": "cae6df75-00a1-490c-a96b-51777b3ec515"
 
104
        },
 
105
        {
 
106
            "owner": {
 
107
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
108
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
109
            },
 
110
            "resource_uri": "/api/2.0/drives/e15dd971-3ef8-497c-9f92-90d5ca1722bd/",
 
111
            "status": "unmounted",
 
112
            "uuid": "e15dd971-3ef8-497c-9f92-90d5ca1722bd"
 
113
        }
 
114
    ]
 
115
}`
 
116
 
 
117
var drivesDetailData = []Drive{
 
118
        Drive{
 
119
                Resource:    *MakeDriveResource("2ef7b7c7-7ec4-47a7-9b69-087c9417c0ff"),
 
120
                Jobs:        nil,
 
121
                Media:       "disk",
 
122
                Meta:        nil,
 
123
                Name:        "test_drive_2",
 
124
                Owner:       driveOwner,
 
125
                Size:        1073741824,
 
126
                Status:      "unmounted",
 
127
                StorageType: "dssd",
 
128
        },
 
129
        Drive{
 
130
                Resource: *MakeDriveResource("3b30c7ef-1fda-416d-91d1-ba616859360c"),
 
131
                Jobs: []Resource{
 
132
                        *MakeJobResource("fbe05708-fd42-43d5-814c-9cb805edd4cb"),
 
133
                        *MakeJobResource("32513930-6815-4cd4-ae8e-2eb89733c206"),
 
134
                },
 
135
 
 
136
                Media:       "disk",
 
137
                Meta:        nil,
 
138
                Name:        "atom",
 
139
                Owner:       driveOwner,
 
140
                Size:        10737418240,
 
141
                Status:      "unmounted",
 
142
                StorageType: "dssd",
 
143
        },
 
144
        Drive{
 
145
                Resource:    *MakeDriveResource("464aed14-8604-4277-be3c-9d53151d53b4"),
 
146
                Jobs:        nil,
 
147
                Media:       "disk",
 
148
                Meta:        nil,
 
149
                Name:        "test_drive_1",
 
150
                Owner:       driveOwner,
 
151
                Size:        1073741824,
 
152
                Status:      "unmounted",
 
153
                StorageType: "dssd",
 
154
        },
 
155
}
 
156
 
 
157
const jsonDrivesDetailData = `{
 
158
    "meta": {
 
159
        "limit": 0,
 
160
        "offset": 0,
 
161
        "total_count": 9
 
162
    },
 
163
    "objects": [
 
164
        {
 
165
            "affinities": [],
 
166
            "allow_multimount": false,
 
167
            "jobs": [],
 
168
            "licenses": [],
 
169
            "media": "disk",
 
170
            "meta": {},
 
171
            "mounted_on": [],
 
172
            "name": "test_drive_2",
 
173
            "owner": {
 
174
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
175
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
176
            },
 
177
            "resource_uri": "/api/2.0/drives/2ef7b7c7-7ec4-47a7-9b69-087c9417c0ff/",
 
178
            "runtime": {
 
179
                "is_snapshotable": true,
 
180
                "snapshots_allocated_size": 0,
 
181
                "storage_type": "dssd"
 
182
            },
 
183
            "size": 1073741824,
 
184
            "snapshots": [],
 
185
            "status": "unmounted",
 
186
            "storage_type": "dssd",
 
187
            "tags": [],
 
188
            "uuid": "2ef7b7c7-7ec4-47a7-9b69-087c9417c0ff"
 
189
        },
 
190
        {
 
191
            "affinities": [],
 
192
            "allow_multimount": false,
 
193
            "jobs": [
 
194
                {
 
195
                    "resource_uri": "/api/2.0/jobs/fbe05708-fd42-43d5-814c-9cb805edd4cb/",
 
196
                    "uuid": "fbe05708-fd42-43d5-814c-9cb805edd4cb"
 
197
                },
 
198
                {
 
199
                    "resource_uri": "/api/2.0/jobs/32513930-6815-4cd4-ae8e-2eb89733c206/",
 
200
                    "uuid": "32513930-6815-4cd4-ae8e-2eb89733c206"
 
201
                }
 
202
            ],
 
203
            "licenses": [],
 
204
            "media": "disk",
 
205
            "meta": {},
 
206
            "mounted_on": [],
 
207
            "name": "atom",
 
208
            "owner": {
 
209
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
210
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
211
            },
 
212
            "resource_uri": "/api/2.0/drives/3b30c7ef-1fda-416d-91d1-ba616859360c/",
 
213
            "runtime": {
 
214
                "is_snapshotable": true,
 
215
                "snapshots_allocated_size": 0,
 
216
                "storage_type": "dssd"
 
217
            },
 
218
            "size": 10737418240,
 
219
            "snapshots": [],
 
220
            "status": "unmounted",
 
221
            "storage_type": "dssd",
 
222
            "tags": [],
 
223
            "uuid": "3b30c7ef-1fda-416d-91d1-ba616859360c"
 
224
        },
 
225
        {
 
226
            "affinities": [],
 
227
            "allow_multimount": false,
 
228
            "jobs": [],
 
229
            "licenses": [],
 
230
            "media": "disk",
 
231
            "meta": {},
 
232
            "mounted_on": [],
 
233
            "name": "test_drive_1",
 
234
            "owner": {
 
235
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
236
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
237
            },
 
238
            "resource_uri": "/api/2.0/drives/464aed14-8604-4277-be3c-9d53151d53b4/",
 
239
            "runtime": {
 
240
                "is_snapshotable": true,
 
241
                "snapshots_allocated_size": 0,
 
242
                "storage_type": "dssd"
 
243
            },
 
244
            "size": 1073741824,
 
245
            "snapshots": [],
 
246
            "status": "unmounted",
 
247
            "storage_type": "dssd",
 
248
            "tags": [],
 
249
            "uuid": "464aed14-8604-4277-be3c-9d53151d53b4"
 
250
        },
 
251
        {
 
252
            "affinities": [],
 
253
            "allow_multimount": false,
 
254
            "jobs": [],
 
255
            "licenses": [],
 
256
            "media": "disk",
 
257
            "meta": {},
 
258
            "mounted_on": [],
 
259
            "name": "test_drive_4",
 
260
            "owner": {
 
261
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
262
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
263
            },
 
264
            "resource_uri": "/api/2.0/drives/47ec5074-6058-4b0f-9505-78c83bd5a88b/",
 
265
            "runtime": {
 
266
                "is_snapshotable": true,
 
267
                "snapshots_allocated_size": 0,
 
268
                "storage_type": "dssd"
 
269
            },
 
270
            "size": 1073741824,
 
271
            "snapshots": [],
 
272
            "status": "unmounted",
 
273
            "storage_type": "dssd",
 
274
            "tags": [],
 
275
            "uuid": "47ec5074-6058-4b0f-9505-78c83bd5a88b"
 
276
        },
 
277
        {
 
278
            "affinities": [],
 
279
            "allow_multimount": false,
 
280
            "jobs": [],
 
281
            "licenses": [],
 
282
            "media": "disk",
 
283
            "meta": {
 
284
                "description": ""
 
285
            },
 
286
            "mounted_on": [],
 
287
            "name": "xxx",
 
288
            "owner": {
 
289
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
290
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
291
            },
 
292
            "resource_uri": "/api/2.0/drives/7949e52e-c8ba-461b-a84f-3f247221c644/",
 
293
            "runtime": {
 
294
                "is_snapshotable": true,
 
295
                "snapshots_allocated_size": 0,
 
296
                "storage_type": "dssd"
 
297
            },
 
298
            "size": 1073741824,
 
299
            "snapshots": [],
 
300
            "status": "unmounted",
 
301
            "storage_type": "dssd",
 
302
            "tags": [],
 
303
            "uuid": "7949e52e-c8ba-461b-a84f-3f247221c644"
 
304
        },
 
305
        {
 
306
            "affinities": [],
 
307
            "allow_multimount": false,
 
308
            "jobs": [],
 
309
            "licenses": [],
 
310
            "media": "disk",
 
311
            "meta": {},
 
312
            "mounted_on": [],
 
313
            "name": "t1",
 
314
            "owner": {
 
315
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
316
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
317
            },
 
318
            "resource_uri": "/api/2.0/drives/81b020b0-8ea0-4602-b778-e4df4539f0f7/",
 
319
            "runtime": {
 
320
                "is_snapshotable": false,
 
321
                "snapshots_allocated_size": 0,
 
322
                "storage_type": "zadara"
 
323
            },
 
324
            "size": 3221225472,
 
325
            "snapshots": [],
 
326
            "status": "unmounted",
 
327
            "storage_type": "zadara",
 
328
            "tags": [],
 
329
            "uuid": "81b020b0-8ea0-4602-b778-e4df4539f0f7"
 
330
        },
 
331
        {
 
332
            "affinities": [],
 
333
            "allow_multimount": false,
 
334
            "jobs": [],
 
335
            "licenses": [],
 
336
            "media": "disk",
 
337
            "meta": {},
 
338
            "mounted_on": [],
 
339
            "name": "test_drive_3",
 
340
            "owner": {
 
341
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
342
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
343
            },
 
344
            "resource_uri": "/api/2.0/drives/baf8fed4-757f-4d9e-a23a-3b3ff81e16c4/",
 
345
            "runtime": {
 
346
                "is_snapshotable": true,
 
347
                "snapshots_allocated_size": 0,
 
348
                "storage_type": "dssd"
 
349
            },
 
350
            "size": 1073741824,
 
351
            "snapshots": [],
 
352
            "status": "unmounted",
 
353
            "storage_type": "dssd",
 
354
            "tags": [],
 
355
            "uuid": "baf8fed4-757f-4d9e-a23a-3b3ff81e16c4"
 
356
        },
 
357
        {
 
358
            "affinities": [],
 
359
            "allow_multimount": false,
 
360
            "jobs": [],
 
361
            "licenses": [],
 
362
            "media": "disk",
 
363
            "meta": {},
 
364
            "mounted_on": [],
 
365
            "name": "test_drive_0",
 
366
            "owner": {
 
367
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
368
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
369
            },
 
370
            "resource_uri": "/api/2.0/drives/cae6df75-00a1-490c-a96b-51777b3ec515/",
 
371
            "runtime": {
 
372
                "is_snapshotable": true,
 
373
                "snapshots_allocated_size": 0,
 
374
                "storage_type": "dssd"
 
375
            },
 
376
            "size": 1073741824,
 
377
            "snapshots": [],
 
378
            "status": "unmounted",
 
379
            "storage_type": "dssd",
 
380
            "tags": [],
 
381
            "uuid": "cae6df75-00a1-490c-a96b-51777b3ec515"
 
382
        },
 
383
        {
 
384
            "affinities": [],
 
385
            "allow_multimount": false,
 
386
            "jobs": [],
 
387
            "licenses": [],
 
388
            "media": "disk",
 
389
            "meta": {
 
390
                "arch": "64",
 
391
                "category": "general",
 
392
                "description": "",
 
393
                "favourite": "False",
 
394
                "image_type": "preinst",
 
395
                "install_notes": "",
 
396
                "os": "linux",
 
397
                "paid": "False",
 
398
                "url": ""
 
399
            },
 
400
            "mounted_on": [],
 
401
            "name": "otom",
 
402
            "owner": {
 
403
                "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
404
                "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
405
            },
 
406
            "resource_uri": "/api/2.0/drives/e15dd971-3ef8-497c-9f92-90d5ca1722bd/",
 
407
            "runtime": {
 
408
                "is_snapshotable": true,
 
409
                "snapshots_allocated_size": 0,
 
410
                "storage_type": "dssd"
 
411
            },
 
412
            "size": 10737418240,
 
413
            "snapshots": [],
 
414
            "status": "unmounted",
 
415
            "storage_type": "dssd",
 
416
            "tags": [],
 
417
            "uuid": "e15dd971-3ef8-497c-9f92-90d5ca1722bd"
 
418
        }
 
419
    ]
 
420
}`
 
421
 
 
422
var driveData = Drive{
 
423
        Resource:    *MakeDriveResource("2ef7b7c7-7ec4-47a7-9b69-087c9417c0ff"),
 
424
        Affinities:  []string{"123", "321"},
 
425
        Jobs:        nil,
 
426
        Media:       "disk",
 
427
        Meta:        nil,
 
428
        Name:        "test_drive_2",
 
429
        Owner:       driveOwner,
 
430
        Size:        1073741824,
 
431
        Status:      "unmounted",
 
432
        StorageType: "dssd",
 
433
}
 
434
 
 
435
const jsonDriveData = `{
 
436
    "affinities": ["123","321"],
 
437
    "allow_multimount": false,
 
438
    "jobs": [],
 
439
    "licenses": [],
 
440
    "media": "disk",
 
441
    "meta": {},
 
442
    "mounted_on": [],
 
443
    "name": "test_drive_2",
 
444
    "owner": {
 
445
        "resource_uri": "/api/2.0/user/80cb30fb-0ea3-43db-b27b-a125752cc0bf/",
 
446
        "uuid": "80cb30fb-0ea3-43db-b27b-a125752cc0bf"
 
447
    },
 
448
    "resource_uri": "/api/2.0/drives/2ef7b7c7-7ec4-47a7-9b69-087c9417c0ff/",
 
449
    "runtime": {
 
450
        "is_snapshotable": true,
 
451
        "snapshots_allocated_size": 0,
 
452
        "storage_type": "dssd"
 
453
    },
 
454
    "size": 1073741824,
 
455
    "snapshots": [],
 
456
    "status": "unmounted",
 
457
    "storage_type": "dssd",
 
458
    "tags": [],
 
459
    "uuid": "2ef7b7c7-7ec4-47a7-9b69-087c9417c0ff"
 
460
}`
 
461
 
 
462
var libraryDriveData = Drive{
 
463
        Resource: *MakeLibDriveResource("22bd1b24-ea78-47bb-a59b-a09ed5407867"),
 
464
        Media:    "cdrom",
 
465
        Name:     "Debian 7.1.0 Netinstall",
 
466
        Owner:    nil,
 
467
        Status:   "unmounted",
 
468
        Size:     536870912,
 
469
        LibraryDrive: LibraryDrive{
 
470
                Arch:      "64",
 
471
                ImageType: "install",
 
472
                OS:        "linux",
 
473
                Paid:      false,
 
474
        },
 
475
}
 
476
 
 
477
const jsonLibraryDriveData = `{
 
478
            "affinities": [],
 
479
            "allow_multimount": false,
 
480
            "arch": "64",
 
481
            "category": [
 
482
                "general"
 
483
            ],
 
484
            "description": "Debian 7.1.0 Netinstall AMD64.",
 
485
            "favourite": false,
 
486
            "image_type": "install",
 
487
            "install_notes": "1. Attach the CD. \\n\r\nPlease be aware that the CD needs to be attached to the server as IDE. \\n\r\n \\n\r\n2. Attach a Drive. \\n\r\nPlease be aware that the minimum drive size where you are going to install the OS should be 5 GB. \\n\r\n \\n\r\n3. Connecting to your server via VNC. \\n\r\na) Go to the \u201cProperties\u201d tab of the server and Turn on the VNC Tunnel by clicking the button right next to it \\n\r\nb) In order to use the inbuilt client click on the icon right next to the VNC link and choose \u201cOpen in Dialog Window\u201d or \u201cOpen in new browser window/tab\u201d \\n\r\nOR \\n\r\nc) Having installed a compatible VNC client, open a VNC connection to your server through the UI.  \\n\r\nd) Enter your VNC url and VNC password as displayed on your Server Properties Window.  \\n\r\n \\n\r\n4. Minimum Hardware Requirements. \\n\r\nThe recommended minimum hardware requirements as published by debian.org are: 1GB RAM and 1GHz CPU",
 
488
            "jobs": [],
 
489
            "licenses": [],
 
490
            "media": "cdrom",
 
491
            "meta": {},
 
492
            "mounted_on": [],
 
493
            "name": "Debian 7.1.0 Netinstall",
 
494
            "os": "linux",
 
495
            "owner": null,
 
496
            "paid": false,
 
497
            "resource_uri": "/api/2.0/libdrives/22bd1b24-ea78-47bb-a59b-a09ed5407867/",
 
498
            "size": 536870912,
 
499
            "status": "unmounted",
 
500
            "storage_type": null,
 
501
            "tags": [],
 
502
            "url": "http://debian.org/",
 
503
            "uuid": "22bd1b24-ea78-47bb-a59b-a09ed5407867"
 
504
        }`