Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 1 | package servers |
| 2 | |
| 3 | // Recorded responses for the server resource. |
| 4 | |
| 5 | const ( |
| 6 | serverListBody = ` |
| 7 | { |
| 8 | "servers": [ |
| 9 | { |
| 10 | "status": "ACTIVE", |
| 11 | "updated": "2014-09-25T13:10:10Z", |
| 12 | "hostId": "29d3c8c896a45aa4c34e52247875d7fefc3d94bbcc9f622b5d204362", |
| 13 | "OS-EXT-SRV-ATTR:host": "devstack", |
| 14 | "addresses": { |
| 15 | "private": [ |
| 16 | { |
| 17 | "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:7c:1b:2b", |
| 18 | "version": 4, |
| 19 | "addr": "10.0.0.32", |
| 20 | "OS-EXT-IPS:type": "fixed" |
| 21 | } |
| 22 | ] |
| 23 | }, |
| 24 | "links": [ |
| 25 | { |
| 26 | "href": "http://104.130.131.164:8774/v2/fcad67a6189847c4aecfa3c81a05783b/servers/ef079b0c-e610-4dfb-b1aa-b49f07ac48e5", |
| 27 | "rel": "self" |
| 28 | }, |
| 29 | { |
| 30 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/servers/ef079b0c-e610-4dfb-b1aa-b49f07ac48e5", |
| 31 | "rel": "bookmark" |
| 32 | } |
| 33 | ], |
| 34 | "key_name": null, |
| 35 | "image": { |
| 36 | "id": "f90f6034-2570-4974-8351-6b49732ef2eb", |
| 37 | "links": [ |
| 38 | { |
| 39 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/images/f90f6034-2570-4974-8351-6b49732ef2eb", |
| 40 | "rel": "bookmark" |
| 41 | } |
| 42 | ] |
| 43 | }, |
| 44 | "OS-EXT-STS:task_state": null, |
| 45 | "OS-EXT-STS:vm_state": "active", |
| 46 | "OS-EXT-SRV-ATTR:instance_name": "instance-0000001e", |
| 47 | "OS-SRV-USG:launched_at": "2014-09-25T13:10:10.000000", |
| 48 | "OS-EXT-SRV-ATTR:hypervisor_hostname": "devstack", |
| 49 | "flavor": { |
| 50 | "id": "1", |
| 51 | "links": [ |
| 52 | { |
| 53 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/flavors/1", |
| 54 | "rel": "bookmark" |
| 55 | } |
| 56 | ] |
| 57 | }, |
| 58 | "id": "ef079b0c-e610-4dfb-b1aa-b49f07ac48e5", |
| 59 | "security_groups": [ |
| 60 | { |
| 61 | "name": "default" |
| 62 | } |
| 63 | ], |
| 64 | "OS-SRV-USG:terminated_at": null, |
| 65 | "OS-EXT-AZ:availability_zone": "nova", |
| 66 | "user_id": "9349aff8be7545ac9d2f1d00999a23cd", |
| 67 | "name": "herp", |
| 68 | "created": "2014-09-25T13:10:02Z", |
| 69 | "tenant_id": "fcad67a6189847c4aecfa3c81a05783b", |
| 70 | "OS-DCF:diskConfig": "MANUAL", |
| 71 | "os-extended-volumes:volumes_attached": [], |
| 72 | "accessIPv4": "", |
| 73 | "accessIPv6": "", |
| 74 | "progress": 0, |
| 75 | "OS-EXT-STS:power_state": 1, |
| 76 | "config_drive": "", |
| 77 | "metadata": {} |
| 78 | }, |
| 79 | { |
| 80 | "status": "ACTIVE", |
| 81 | "updated": "2014-09-25T13:04:49Z", |
| 82 | "hostId": "29d3c8c896a45aa4c34e52247875d7fefc3d94bbcc9f622b5d204362", |
| 83 | "OS-EXT-SRV-ATTR:host": "devstack", |
| 84 | "addresses": { |
| 85 | "private": [ |
| 86 | { |
| 87 | "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:9e:89:be", |
| 88 | "version": 4, |
| 89 | "addr": "10.0.0.31", |
| 90 | "OS-EXT-IPS:type": "fixed" |
| 91 | } |
| 92 | ] |
| 93 | }, |
| 94 | "links": [ |
| 95 | { |
| 96 | "href": "http://104.130.131.164:8774/v2/fcad67a6189847c4aecfa3c81a05783b/servers/9e5476bd-a4ec-4653-93d6-72c93aa682ba", |
| 97 | "rel": "self" |
| 98 | }, |
| 99 | { |
| 100 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/servers/9e5476bd-a4ec-4653-93d6-72c93aa682ba", |
| 101 | "rel": "bookmark" |
| 102 | } |
| 103 | ], |
| 104 | "key_name": null, |
| 105 | "image": { |
| 106 | "id": "f90f6034-2570-4974-8351-6b49732ef2eb", |
| 107 | "links": [ |
| 108 | { |
| 109 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/images/f90f6034-2570-4974-8351-6b49732ef2eb", |
| 110 | "rel": "bookmark" |
| 111 | } |
| 112 | ] |
| 113 | }, |
| 114 | "OS-EXT-STS:task_state": null, |
| 115 | "OS-EXT-STS:vm_state": "active", |
| 116 | "OS-EXT-SRV-ATTR:instance_name": "instance-0000001d", |
| 117 | "OS-SRV-USG:launched_at": "2014-09-25T13:04:49.000000", |
| 118 | "OS-EXT-SRV-ATTR:hypervisor_hostname": "devstack", |
| 119 | "flavor": { |
| 120 | "id": "1", |
| 121 | "links": [ |
| 122 | { |
| 123 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/flavors/1", |
| 124 | "rel": "bookmark" |
| 125 | } |
| 126 | ] |
| 127 | }, |
| 128 | "id": "9e5476bd-a4ec-4653-93d6-72c93aa682ba", |
| 129 | "security_groups": [ |
| 130 | { |
| 131 | "name": "default" |
| 132 | } |
| 133 | ], |
| 134 | "OS-SRV-USG:terminated_at": null, |
| 135 | "OS-EXT-AZ:availability_zone": "nova", |
| 136 | "user_id": "9349aff8be7545ac9d2f1d00999a23cd", |
| 137 | "name": "derp", |
| 138 | "created": "2014-09-25T13:04:41Z", |
| 139 | "tenant_id": "fcad67a6189847c4aecfa3c81a05783b", |
| 140 | "OS-DCF:diskConfig": "MANUAL", |
| 141 | "os-extended-volumes:volumes_attached": [], |
| 142 | "accessIPv4": "", |
| 143 | "accessIPv6": "", |
| 144 | "progress": 0, |
| 145 | "OS-EXT-STS:power_state": 1, |
| 146 | "config_drive": "", |
| 147 | "metadata": {} |
| 148 | } |
| 149 | ] |
| 150 | } |
| 151 | ` |
| 152 | |
Ash Wilson | 3204d0d | 2014-09-25 10:37:44 -0400 | [diff] [blame] | 153 | singleServerBody = ` |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 154 | { |
| 155 | "server": { |
| 156 | "status": "ACTIVE", |
| 157 | "updated": "2014-09-25T13:04:49Z", |
| 158 | "hostId": "29d3c8c896a45aa4c34e52247875d7fefc3d94bbcc9f622b5d204362", |
| 159 | "OS-EXT-SRV-ATTR:host": "devstack", |
| 160 | "addresses": { |
| 161 | "private": [ |
| 162 | { |
| 163 | "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:9e:89:be", |
| 164 | "version": 4, |
| 165 | "addr": "10.0.0.31", |
| 166 | "OS-EXT-IPS:type": "fixed" |
| 167 | } |
| 168 | ] |
| 169 | }, |
| 170 | "links": [ |
| 171 | { |
Ash Wilson | 3204d0d | 2014-09-25 10:37:44 -0400 | [diff] [blame] | 172 | "href": "http://104.130.131.164:8774/v2/fcad67a6189847c4aecfa3c81a05783b/servers/9e5476bd-a4ec-4653-93d6-72c93aa682ba", |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 173 | "rel": "self" |
| 174 | }, |
| 175 | { |
Ash Wilson | 3204d0d | 2014-09-25 10:37:44 -0400 | [diff] [blame] | 176 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/servers/9e5476bd-a4ec-4653-93d6-72c93aa682ba", |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 177 | "rel": "bookmark" |
| 178 | } |
| 179 | ], |
| 180 | "key_name": null, |
| 181 | "image": { |
| 182 | "id": "f90f6034-2570-4974-8351-6b49732ef2eb", |
| 183 | "links": [ |
| 184 | { |
Ash Wilson | 3204d0d | 2014-09-25 10:37:44 -0400 | [diff] [blame] | 185 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/images/f90f6034-2570-4974-8351-6b49732ef2eb", |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 186 | "rel": "bookmark" |
| 187 | } |
| 188 | ] |
| 189 | }, |
| 190 | "OS-EXT-STS:task_state": null, |
| 191 | "OS-EXT-STS:vm_state": "active", |
| 192 | "OS-EXT-SRV-ATTR:instance_name": "instance-0000001d", |
| 193 | "OS-SRV-USG:launched_at": "2014-09-25T13:04:49.000000", |
| 194 | "OS-EXT-SRV-ATTR:hypervisor_hostname": "devstack", |
| 195 | "flavor": { |
| 196 | "id": "1", |
| 197 | "links": [ |
| 198 | { |
Ash Wilson | 3204d0d | 2014-09-25 10:37:44 -0400 | [diff] [blame] | 199 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/flavors/1", |
Ash Wilson | ad21c71 | 2014-09-25 10:15:22 -0400 | [diff] [blame] | 200 | "rel": "bookmark" |
| 201 | } |
| 202 | ] |
| 203 | }, |
| 204 | "id": "9e5476bd-a4ec-4653-93d6-72c93aa682ba", |
| 205 | "security_groups": [ |
| 206 | { |
| 207 | "name": "default" |
| 208 | } |
| 209 | ], |
| 210 | "OS-SRV-USG:terminated_at": null, |
| 211 | "OS-EXT-AZ:availability_zone": "nova", |
| 212 | "user_id": "9349aff8be7545ac9d2f1d00999a23cd", |
| 213 | "name": "derp", |
| 214 | "created": "2014-09-25T13:04:41Z", |
| 215 | "tenant_id": "fcad67a6189847c4aecfa3c81a05783b", |
| 216 | "OS-DCF:diskConfig": "MANUAL", |
| 217 | "os-extended-volumes:volumes_attached": [], |
| 218 | "accessIPv4": "", |
| 219 | "accessIPv6": "", |
| 220 | "progress": 0, |
| 221 | "OS-EXT-STS:power_state": 1, |
| 222 | "config_drive": "", |
| 223 | "metadata": {} |
| 224 | } |
| 225 | } |
| 226 | ` |
| 227 | ) |
| 228 | |
| 229 | var ( |
| 230 | serverHerp = Server{ |
| 231 | Status: "ACTIVE", |
| 232 | Updated: "2014-09-25T13:10:10Z", |
| 233 | HostID: "29d3c8c896a45aa4c34e52247875d7fefc3d94bbcc9f622b5d204362", |
| 234 | Addresses: map[string]interface{}{ |
| 235 | "private": []interface{}{ |
| 236 | map[string]interface{}{ |
| 237 | "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:7c:1b:2b", |
| 238 | "version": float64(4), |
| 239 | "addr": "10.0.0.32", |
| 240 | "OS-EXT-IPS:type": "fixed", |
| 241 | }, |
| 242 | }, |
| 243 | }, |
| 244 | Links: []interface{}{ |
| 245 | map[string]interface{}{ |
| 246 | "href": "http://104.130.131.164:8774/v2/fcad67a6189847c4aecfa3c81a05783b/servers/ef079b0c-e610-4dfb-b1aa-b49f07ac48e5", |
| 247 | "rel": "self", |
| 248 | }, |
| 249 | map[string]interface{}{ |
| 250 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/servers/ef079b0c-e610-4dfb-b1aa-b49f07ac48e5", |
| 251 | "rel": "bookmark", |
| 252 | }, |
| 253 | }, |
| 254 | Image: map[string]interface{}{ |
| 255 | "id": "f90f6034-2570-4974-8351-6b49732ef2eb", |
| 256 | "links": []interface{}{ |
| 257 | map[string]interface{}{ |
| 258 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/images/f90f6034-2570-4974-8351-6b49732ef2eb", |
| 259 | "rel": "bookmark", |
| 260 | }, |
| 261 | }, |
| 262 | }, |
| 263 | Flavor: map[string]interface{}{ |
| 264 | "id": "1", |
| 265 | "links": []interface{}{ |
| 266 | map[string]interface{}{ |
| 267 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/flavors/1", |
| 268 | "rel": "bookmark", |
| 269 | }, |
| 270 | }, |
| 271 | }, |
| 272 | ID: "ef079b0c-e610-4dfb-b1aa-b49f07ac48e5", |
| 273 | UserID: "9349aff8be7545ac9d2f1d00999a23cd", |
| 274 | Name: "herp", |
| 275 | Created: "2014-09-25T13:10:02Z", |
| 276 | TenantID: "fcad67a6189847c4aecfa3c81a05783b", |
| 277 | Metadata: map[string]interface{}{}, |
| 278 | } |
| 279 | serverDerp = Server{ |
| 280 | Status: "ACTIVE", |
| 281 | Updated: "2014-09-25T13:04:49Z", |
| 282 | HostID: "29d3c8c896a45aa4c34e52247875d7fefc3d94bbcc9f622b5d204362", |
| 283 | Addresses: map[string]interface{}{ |
| 284 | "private": []interface{}{ |
| 285 | map[string]interface{}{ |
| 286 | "OS-EXT-IPS-MAC:mac_addr": "fa:16:3e:9e:89:be", |
| 287 | "version": float64(4), |
| 288 | "addr": "10.0.0.31", |
| 289 | "OS-EXT-IPS:type": "fixed", |
| 290 | }, |
| 291 | }, |
| 292 | }, |
| 293 | Links: []interface{}{ |
| 294 | map[string]interface{}{ |
| 295 | "href": "http://104.130.131.164:8774/v2/fcad67a6189847c4aecfa3c81a05783b/servers/9e5476bd-a4ec-4653-93d6-72c93aa682ba", |
| 296 | "rel": "self", |
| 297 | }, |
| 298 | map[string]interface{}{ |
| 299 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/servers/9e5476bd-a4ec-4653-93d6-72c93aa682ba", |
| 300 | "rel": "bookmark", |
| 301 | }, |
| 302 | }, |
| 303 | Image: map[string]interface{}{ |
| 304 | "id": "f90f6034-2570-4974-8351-6b49732ef2eb", |
| 305 | "links": []interface{}{ |
| 306 | map[string]interface{}{ |
| 307 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/images/f90f6034-2570-4974-8351-6b49732ef2eb", |
| 308 | "rel": "bookmark", |
| 309 | }, |
| 310 | }, |
| 311 | }, |
| 312 | Flavor: map[string]interface{}{ |
| 313 | "id": "1", |
| 314 | "links": []interface{}{ |
| 315 | map[string]interface{}{ |
| 316 | "href": "http://104.130.131.164:8774/fcad67a6189847c4aecfa3c81a05783b/flavors/1", |
| 317 | "rel": "bookmark", |
| 318 | }, |
| 319 | }, |
| 320 | }, |
| 321 | ID: "9e5476bd-a4ec-4653-93d6-72c93aa682ba", |
| 322 | UserID: "9349aff8be7545ac9d2f1d00999a23cd", |
| 323 | Name: "derp", |
| 324 | Created: "2014-09-25T13:04:41Z", |
| 325 | TenantID: "fcad67a6189847c4aecfa3c81a05783b", |
| 326 | Metadata: map[string]interface{}{}, |
| 327 | } |
| 328 | ) |