Keith Byrne | bda4859 | 2016-03-23 11:37:08 +0000 | [diff] [blame] | 1 | // +build fixtures |
| 2 | |
Jamie Hannaford | 302c0b6 | 2015-02-16 14:12:34 +0100 | [diff] [blame] | 3 | package backups |
| 4 | |
Jamie Hannaford | e65ad95 | 2015-11-16 14:05:11 +0100 | [diff] [blame] | 5 | import "time" |
| 6 | |
| 7 | var ( |
| 8 | timestamp = "2015-11-12T14:22:42Z" |
| 9 | timeVal, _ = time.Parse(time.RFC3339, timestamp) |
| 10 | ) |
| 11 | |
Jamie Hannaford | e635b7d | 2015-02-18 14:11:46 +0100 | [diff] [blame] | 12 | var getResp = ` |
Jamie Hannaford | e052473 | 2015-02-16 14:44:13 +0100 | [diff] [blame] | 13 | { |
| 14 | "backup": { |
Jamie Hannaford | e65ad95 | 2015-11-16 14:05:11 +0100 | [diff] [blame] | 15 | "created": "` + timestamp + `", |
Jamie Hannaford | e052473 | 2015-02-16 14:44:13 +0100 | [diff] [blame] | 16 | "description": "My Backup", |
| 17 | "id": "61f12fef-edb1-4561-8122-e7c00ef26a82", |
| 18 | "instance_id": "d4603f69-ec7e-4e9b-803f-600b9205576f", |
| 19 | "locationRef": null, |
| 20 | "name": "snapshot", |
| 21 | "parent_id": null, |
| 22 | "size": 100, |
| 23 | "status": "NEW", |
| 24 | "datastore": { |
| 25 | "version": "5.1", |
| 26 | "type": "MySQL", |
| 27 | "version_id": "20000000-0000-0000-0000-000000000002" |
| 28 | }, |
Jamie Hannaford | e65ad95 | 2015-11-16 14:05:11 +0100 | [diff] [blame] | 29 | "updated": "` + timestamp + `" |
Jamie Hannaford | e052473 | 2015-02-16 14:44:13 +0100 | [diff] [blame] | 30 | } |
| 31 | } |
| 32 | ` |
| 33 | |
Jamie Hannaford | e635b7d | 2015-02-18 14:11:46 +0100 | [diff] [blame] | 34 | var createReq = ` |
Jamie Hannaford | 302c0b6 | 2015-02-16 14:12:34 +0100 | [diff] [blame] | 35 | { |
| 36 | "backup": { |
| 37 | "description": "My Backup", |
| 38 | "instance": "d4603f69-ec7e-4e9b-803f-600b9205576f", |
| 39 | "name": "snapshot" |
| 40 | } |
| 41 | } |
| 42 | ` |
| 43 | |
Jamie Hannaford | e635b7d | 2015-02-18 14:11:46 +0100 | [diff] [blame] | 44 | var createResp = getResp |
Jamie Hannaford | 302c0b6 | 2015-02-16 14:12:34 +0100 | [diff] [blame] | 45 | |
Jamie Hannaford | e635b7d | 2015-02-18 14:11:46 +0100 | [diff] [blame] | 46 | var listResp = ` |
Jamie Hannaford | 302c0b6 | 2015-02-16 14:12:34 +0100 | [diff] [blame] | 47 | { |
| 48 | "backups": [ |
| 49 | { |
| 50 | "status": "COMPLETED", |
Jamie Hannaford | e65ad95 | 2015-11-16 14:05:11 +0100 | [diff] [blame] | 51 | "updated": "` + timestamp + `", |
Jamie Hannaford | 302c0b6 | 2015-02-16 14:12:34 +0100 | [diff] [blame] | 52 | "description": "Backup from Restored Instance", |
Jamie Hannaford | e052473 | 2015-02-16 14:44:13 +0100 | [diff] [blame] | 53 | "datastore": { |
| 54 | "version": "5.1", |
| 55 | "type": "MySQL", |
| 56 | "version_id": "20000000-0000-0000-0000-000000000002" |
| 57 | }, |
Jamie Hannaford | 302c0b6 | 2015-02-16 14:12:34 +0100 | [diff] [blame] | 58 | "id": "87972694-4be2-40f5-83f8-501656e0032a", |
| 59 | "size": 0.141026, |
| 60 | "name": "restored_backup", |
Jamie Hannaford | e65ad95 | 2015-11-16 14:05:11 +0100 | [diff] [blame] | 61 | "created": "` + timestamp + `", |
Jamie Hannaford | 302c0b6 | 2015-02-16 14:12:34 +0100 | [diff] [blame] | 62 | "instance_id": "29af2cd9-0674-48ab-b87a-b160f00208e6", |
| 63 | "parent_id": null, |
| 64 | "locationRef": "http://localhost/path/to/backup" |
| 65 | } |
| 66 | ] |
| 67 | } |
| 68 | ` |