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