blob: 957dccfd7dd2ebe3ca1d31b8980d58ad6a5a7f6e [file] [log] [blame]
Ash Wilson6f3162a2014-10-20 17:28:36 -04001// +build fixtures
Alex Gaynor2f071742014-11-13 12:03:29 -08002
Ash Wilson6f3162a2014-10-20 17:28:36 -04003package flavors
4
Ash Wilson6f3162a2014-10-20 17:28:36 -04005// ListOutput is a sample response of a flavor List request.
6const ListOutput = `
7{
8 "flavors": [
9 {
10 "OS-FLV-EXT-DATA:ephemeral": 0,
11 "OS-FLV-WITH-EXT-SPECS:extra_specs": {
12 "class": "performance1",
13 "disk_io_index": "40",
14 "number_of_data_disks": "0",
15 "policy_class": "performance_flavor",
16 "resize_policy_class": "performance_flavor"
17 },
18 "disk": 20,
19 "id": "performance1-1",
20 "links": [
21 {
22 "href": "https://iad.servers.api.rackspacecloud.com/v2/864477/flavors/performance1-1",
23 "rel": "self"
24 },
25 {
26 "href": "https://iad.servers.api.rackspacecloud.com/864477/flavors/performance1-1",
27 "rel": "bookmark"
28 }
29 ],
30 "name": "1 GB Performance",
31 "ram": 1024,
32 "rxtx_factor": 200,
33 "swap": "",
34 "vcpus": 1
35 },
36 {
37 "OS-FLV-EXT-DATA:ephemeral": 20,
38 "OS-FLV-WITH-EXT-SPECS:extra_specs": {
39 "class": "performance1",
40 "disk_io_index": "40",
41 "number_of_data_disks": "1",
42 "policy_class": "performance_flavor",
43 "resize_policy_class": "performance_flavor"
44 },
45 "disk": 40,
46 "id": "performance1-2",
47 "links": [
48 {
49 "href": "https://iad.servers.api.rackspacecloud.com/v2/864477/flavors/performance1-2",
50 "rel": "self"
51 },
52 {
53 "href": "https://iad.servers.api.rackspacecloud.com/864477/flavors/performance1-2",
54 "rel": "bookmark"
55 }
56 ],
57 "name": "2 GB Performance",
58 "ram": 2048,
59 "rxtx_factor": 400,
60 "swap": "",
61 "vcpus": 2
62 }
63 ]
64}`
65
66// GetOutput is a sample response from a flavor Get request. Its contents correspond to the
67// Performance1Flavor struct.
68const GetOutput = `
69{
70 "flavor": {
71 "OS-FLV-EXT-DATA:ephemeral": 0,
72 "OS-FLV-WITH-EXT-SPECS:extra_specs": {
73 "class": "performance1",
74 "disk_io_index": "40",
75 "number_of_data_disks": "0",
76 "policy_class": "performance_flavor",
77 "resize_policy_class": "performance_flavor"
78 },
79 "disk": 20,
80 "id": "performance1-1",
81 "links": [
82 {
83 "href": "https://iad.servers.api.rackspacecloud.com/v2/864477/flavors/performance1-1",
84 "rel": "self"
85 },
86 {
87 "href": "https://iad.servers.api.rackspacecloud.com/864477/flavors/performance1-1",
88 "rel": "bookmark"
89 }
90 ],
91 "name": "1 GB Performance",
92 "ram": 1024,
93 "rxtx_factor": 200,
94 "swap": "",
95 "vcpus": 1
96 }
97}
98`
99
100// Performance1Flavor is the expected result of parsing GetOutput, or the first element of
101// ListOutput.
Jon Perritt52e6ada2015-07-16 17:58:04 -0600102var Performance1Flavor = Flavor{
Ash Wilson6f3162a2014-10-20 17:28:36 -0400103 ID: "performance1-1",
104 Disk: 20,
105 RAM: 1024,
106 Name: "1 GB Performance",
107 RxTxFactor: 200.0,
108 Swap: 0,
109 VCPUs: 1,
Jon Perritt52e6ada2015-07-16 17:58:04 -0600110 ExtraSpecs: ExtraSpecs{
111 NumDataDisks: 0,
112 Class: "performance1",
113 DiskIOIndex: 0,
114 PolicyClass: "performance_flavor",
115 },
Ash Wilson6f3162a2014-10-20 17:28:36 -0400116}
117
118// Performance2Flavor is the second result expected from parsing ListOutput.
Jon Perritt52e6ada2015-07-16 17:58:04 -0600119var Performance2Flavor = Flavor{
Ash Wilson6f3162a2014-10-20 17:28:36 -0400120 ID: "performance1-2",
121 Disk: 40,
122 RAM: 2048,
123 Name: "2 GB Performance",
124 RxTxFactor: 400.0,
125 Swap: 0,
126 VCPUs: 2,
Jon Perritt52e6ada2015-07-16 17:58:04 -0600127 ExtraSpecs: ExtraSpecs{
128 NumDataDisks: 0,
129 Class: "performance1",
130 DiskIOIndex: 0,
131 PolicyClass: "performance_flavor",
132 },
Ash Wilson6f3162a2014-10-20 17:28:36 -0400133}
134
135// ExpectedFlavorSlice is the slice of Flavor structs that are expected to be parsed from
136// ListOutput.
Jon Perritt52e6ada2015-07-16 17:58:04 -0600137var ExpectedFlavorSlice = []Flavor{Performance1Flavor, Performance2Flavor}