blob: ccfbdc6a1e44985aa1cfabfe3a80585be8797b55 [file] [log] [blame]
Ash Wilsond5506542014-10-21 09:02:16 -04001// +build fixtures
Alex Gaynor2f071742014-11-13 12:03:29 -08002
Ash Wilsond5506542014-10-21 09:02:16 -04003package images
4
5import (
6 os "github.com/rackspace/gophercloud/openstack/compute/v2/images"
7)
8
9// ListOutput is an example response from an /images/detail request.
10const ListOutput = `
11{
12 "images": [
13 {
14 "OS-DCF:diskConfig": "MANUAL",
15 "OS-EXT-IMG-SIZE:size": 1.017415075e+09,
16 "created": "2014-10-01T15:49:02Z",
17 "id": "30aa010e-080e-4d4b-a7f9-09fc55b07d69",
18 "links": [
19 {
20 "href": "https://iad.servers.api.rackspacecloud.com/v2/111222/images/30aa010e-080e-4d4b-a7f9-09fc55b07d69",
21 "rel": "self"
22 },
23 {
24 "href": "https://iad.servers.api.rackspacecloud.com/111222/images/30aa010e-080e-4d4b-a7f9-09fc55b07d69",
25 "rel": "bookmark"
26 },
27 {
28 "href": "https://iad.servers.api.rackspacecloud.com/111222/images/30aa010e-080e-4d4b-a7f9-09fc55b07d69",
29 "rel": "alternate",
30 "type": "application/vnd.openstack.image"
31 }
32 ],
33 "metadata": {
34 "auto_disk_config": "disabled",
35 "cache_in_nova": "True",
36 "com.rackspace__1__build_core": "1",
37 "com.rackspace__1__build_managed": "1",
38 "com.rackspace__1__build_rackconnect": "1",
39 "com.rackspace__1__options": "0",
40 "com.rackspace__1__platform_target": "PublicCloud",
41 "com.rackspace__1__release_build_date": "2014-10-01_15-46-08",
42 "com.rackspace__1__release_id": "100",
43 "com.rackspace__1__release_version": "10",
44 "com.rackspace__1__source": "kickstart",
45 "com.rackspace__1__visible_core": "1",
46 "com.rackspace__1__visible_managed": "0",
47 "com.rackspace__1__visible_rackconnect": "0",
48 "image_type": "base",
49 "org.openstack__1__architecture": "x64",
50 "org.openstack__1__os_distro": "org.archlinux",
51 "org.openstack__1__os_version": "2014.8",
52 "os_distro": "arch",
53 "os_type": "linux",
54 "vm_mode": "hvm"
55 },
56 "minDisk": 20,
57 "minRam": 512,
58 "name": "Arch 2014.10 (PVHVM)",
59 "progress": 100,
60 "status": "ACTIVE",
61 "updated": "2014-10-01T19:37:58Z"
62 },
63 {
64 "OS-DCF:diskConfig": "AUTO",
65 "OS-EXT-IMG-SIZE:size": 1.060306463e+09,
66 "created": "2014-10-01T12:58:11Z",
67 "id": "e19a734c-c7e6-443a-830c-242209c4d65d",
68 "links": [
69 {
70 "href": "https://iad.servers.api.rackspacecloud.com/v2/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d",
71 "rel": "self"
72 },
73 {
74 "href": "https://iad.servers.api.rackspacecloud.com/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d",
75 "rel": "bookmark"
76 },
77 {
78 "href": "https://iad.servers.api.rackspacecloud.com/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d",
79 "rel": "alternate",
80 "type": "application/vnd.openstack.image"
81 }
82 ],
83 "metadata": {
84 "auto_disk_config": "True",
85 "cache_in_nova": "True",
86 "com.rackspace__1__build_core": "1",
87 "com.rackspace__1__build_managed": "1",
88 "com.rackspace__1__build_rackconnect": "1",
89 "com.rackspace__1__options": "0",
90 "com.rackspace__1__platform_target": "PublicCloud",
91 "com.rackspace__1__release_build_date": "2014-10-01_12-31-03",
92 "com.rackspace__1__release_id": "1007",
93 "com.rackspace__1__release_version": "6",
94 "com.rackspace__1__source": "kickstart",
95 "com.rackspace__1__visible_core": "1",
96 "com.rackspace__1__visible_managed": "1",
97 "com.rackspace__1__visible_rackconnect": "1",
98 "image_type": "base",
99 "org.openstack__1__architecture": "x64",
100 "org.openstack__1__os_distro": "com.ubuntu",
101 "org.openstack__1__os_version": "14.04",
102 "os_distro": "ubuntu",
103 "os_type": "linux",
104 "vm_mode": "xen"
105 },
106 "minDisk": 20,
107 "minRam": 512,
108 "name": "Ubuntu 14.04 LTS (Trusty Tahr)",
109 "progress": 100,
110 "status": "ACTIVE",
111 "updated": "2014-10-01T15:51:44Z"
112 }
113 ]
114}
115`
116
117// GetOutput is an example response from an /images request.
118const GetOutput = `
119{
120 "image": {
121 "OS-DCF:diskConfig": "AUTO",
122 "OS-EXT-IMG-SIZE:size": 1060306463,
123 "created": "2014-10-01T12:58:11Z",
124 "id": "e19a734c-c7e6-443a-830c-242209c4d65d",
125 "links": [
126 {
127 "href": "https://iad.servers.api.rackspacecloud.com/v2/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d",
128 "rel": "self"
129 },
130 {
131 "href": "https://iad.servers.api.rackspacecloud.com/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d",
132 "rel": "bookmark"
133 },
134 {
135 "href": "https://iad.servers.api.rackspacecloud.com/111222/images/e19a734c-c7e6-443a-830c-242209c4d65d",
136 "rel": "alternate",
137 "type": "application/vnd.openstack.image"
138 }
139 ],
140 "metadata": {
141 "auto_disk_config": "True",
142 "cache_in_nova": "True",
143 "com.rackspace__1__build_core": "1",
144 "com.rackspace__1__build_managed": "1",
145 "com.rackspace__1__build_rackconnect": "1",
146 "com.rackspace__1__options": "0",
147 "com.rackspace__1__platform_target": "PublicCloud",
148 "com.rackspace__1__release_build_date": "2014-10-01_12-31-03",
149 "com.rackspace__1__release_id": "1007",
150 "com.rackspace__1__release_version": "6",
151 "com.rackspace__1__source": "kickstart",
152 "com.rackspace__1__visible_core": "1",
153 "com.rackspace__1__visible_managed": "1",
154 "com.rackspace__1__visible_rackconnect": "1",
155 "image_type": "base",
156 "org.openstack__1__architecture": "x64",
157 "org.openstack__1__os_distro": "com.ubuntu",
158 "org.openstack__1__os_version": "14.04",
159 "os_distro": "ubuntu",
160 "os_type": "linux",
161 "vm_mode": "xen"
162 },
163 "minDisk": 20,
164 "minRam": 512,
165 "name": "Ubuntu 14.04 LTS (Trusty Tahr)",
166 "progress": 100,
167 "status": "ACTIVE",
168 "updated": "2014-10-01T15:51:44Z"
169 }
170}
171`
172
173// ArchImage is the first Image structure that should be parsed from ListOutput.
174var ArchImage = os.Image{
175 ID: "30aa010e-080e-4d4b-a7f9-09fc55b07d69",
176 Name: "Arch 2014.10 (PVHVM)",
177 Created: "2014-10-01T15:49:02Z",
178 Updated: "2014-10-01T19:37:58Z",
179 MinDisk: 20,
180 MinRAM: 512,
181 Progress: 100,
182 Status: "ACTIVE",
183}
184
185// UbuntuImage is the second Image structure that should be parsed from ListOutput and
186// the only image that should be extracted from GetOutput.
187var UbuntuImage = os.Image{
188 ID: "e19a734c-c7e6-443a-830c-242209c4d65d",
189 Name: "Ubuntu 14.04 LTS (Trusty Tahr)",
190 Created: "2014-10-01T12:58:11Z",
191 Updated: "2014-10-01T15:51:44Z",
192 MinDisk: 20,
193 MinRAM: 512,
194 Progress: 100,
195 Status: "ACTIVE",
196}
197
198// ExpectedImageSlice is the collection of images that should be parsed from ListOutput,
199// in order.
200var ExpectedImageSlice = []os.Image{ArchImage, UbuntuImage}