Merge lp:~axwalk/gwacl/gwacl-update-version into lp:gwacl
- gwacl-update-version
- Merge into trunk
Proposed by
Andrew Wilkins
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Andrew Wilkins | ||||
Approved revision: | 243 | ||||
Merged at revision: | 243 | ||||
Proposed branch: | lp:~axwalk/gwacl/gwacl-update-version | ||||
Merge into: | lp:gwacl | ||||
Diff against target: |
1029 lines (+160/-138) 8 files modified
deletedisk_test.go (+5/-4) management_base.go (+32/-26) management_base_test.go (+25/-25) poller.go (+1/-1) poller_test.go (+6/-5) storage_base.go (+16/-14) xmlobjects.go (+63/-39) xmlobjects_test.go (+12/-24) |
||||
To merge this branch: | bzr merge lp:~axwalk/gwacl/gwacl-update-version | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Ian Booth | Approve | ||
Review via email: mp+266071@code.launchpad.net |
Commit message
Update to latest API across the board
For each API call in gwacl, I have audited
the Azure SM API changelog for notable
differences, and updated the relevant
XML definitions.
I have confirmed that Juju is still able
to bootstrap and cleanly destroy with these
changes.
Description of the change
Update to latest API across the board
For each API call in gwacl, I have audited
the Azure SM API changelog for notable
differences, and updated the relevant
XML definitions.
I have confirmed that Juju is still able
to bootstrap and cleanly destroy with these
changes.
To post a comment you must log in.
Revision history for this message
Ian Booth (wallyworld) : | # |
review:
Approve
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'deletedisk_test.go' |
2 | --- deletedisk_test.go 2014-12-02 00:36:45 +0000 |
3 | +++ deletedisk_test.go 2015-07-28 10:07:55 +0000 |
4 | @@ -5,9 +5,10 @@ |
5 | |
6 | import ( |
7 | "fmt" |
8 | - . "launchpad.net/gocheck" |
9 | "net/http" |
10 | "time" |
11 | + |
12 | + . "launchpad.net/gocheck" |
13 | ) |
14 | |
15 | type deleteDiskSuite struct{} |
16 | @@ -73,7 +74,7 @@ |
17 | c.Assert(response, IsNil) |
18 | c.Assert(err, IsNil) |
19 | expectedURL := api.session.composeURL("services/disks/" + diskName) |
20 | - checkOneRequest(c, recordedRequests, expectedURL, "2012-08-01", nil, "DELETE") |
21 | + checkOneRequest(c, recordedRequests, expectedURL, baseAPIVersion, nil, "DELETE") |
22 | } |
23 | |
24 | func (suite *deleteDiskSuite) TestManagementAPIDeleteDiskPolls(c *C) { |
25 | @@ -98,6 +99,6 @@ |
26 | c.Assert(err, IsNil) |
27 | expectedURL := api.session.composeURL("services/disks/" + diskName) |
28 | c.Check(len(recordedRequests), Equals, 2) |
29 | - checkRequest(c, recordedRequests[0], expectedURL, "2012-08-01", nil, "DELETE") |
30 | - checkRequest(c, recordedRequests[1], expectedURL, "2012-08-01", nil, "DELETE") |
31 | + checkRequest(c, recordedRequests[0], expectedURL, baseAPIVersion, nil, "DELETE") |
32 | + checkRequest(c, recordedRequests[1], expectedURL, baseAPIVersion, nil, "DELETE") |
33 | } |
34 | |
35 | === modified file 'management_base.go' |
36 | --- management_base.go 2014-12-03 07:29:23 +0000 |
37 | +++ management_base.go 2015-07-28 10:07:55 +0000 |
38 | @@ -13,6 +13,12 @@ |
39 | "launchpad.net/gwacl/fork/tls" |
40 | ) |
41 | |
42 | +// baseAPIVersion is the minimum API version used for all API calls. |
43 | +// |
44 | +// Note: all methods have been audited for use with this API version, |
45 | +// so do not change this without having done so again. |
46 | +const baseAPIVersion = "2015-04-01" |
47 | + |
48 | // Note: each API call is required to include a version string in the request header. |
49 | // These may often be the same string, but need to be kept as strings rather than being |
50 | // pulled out and replaced with a constant, each API call may be individually changed. |
51 | @@ -171,7 +177,7 @@ |
52 | // Images are returned in the order in which Azure lists them. |
53 | // http://msdn.microsoft.com/en-us/library/windowsazure/jj157191.aspx |
54 | func (api *ManagementAPI) ListOSImages() (*Images, error) { |
55 | - response, err := api.session.get("services/images", "2013-03-01") |
56 | + response, err := api.session.get("services/images", baseAPIVersion) |
57 | if err != nil { |
58 | return nil, err |
59 | } |
60 | @@ -186,7 +192,7 @@ |
61 | // HostedService objects. |
62 | // See http://msdn.microsoft.com/en-us/library/windowsazure/ee460781.aspx |
63 | func (api *ManagementAPI) ListHostedServices() ([]HostedServiceDescriptor, error) { |
64 | - res, err := api.session.get("services/hostedservices", "2013-10-01") |
65 | + res, err := api.session.get("services/hostedservices", baseAPIVersion) |
66 | if err != nil { |
67 | return nil, err |
68 | } |
69 | @@ -206,7 +212,7 @@ |
70 | if err != nil { |
71 | return err |
72 | } |
73 | - response, err := api.session.put(URI, "2013-10-01", []byte(body), "application/xml") |
74 | + response, err := api.session.put(URI, baseAPIVersion, []byte(body), "application/xml") |
75 | if err != nil { |
76 | return err |
77 | } |
78 | @@ -226,7 +232,7 @@ |
79 | case false: |
80 | URI += "false" |
81 | } |
82 | - res, err := api.session.get(URI, "2013-10-01") |
83 | + res, err := api.session.get(URI, baseAPIVersion) |
84 | if err != nil { |
85 | return nil, err |
86 | } |
87 | @@ -246,7 +252,7 @@ |
88 | if err != nil { |
89 | return err |
90 | } |
91 | - response, err := api.session.post(URI, "2013-10-01", []byte(body), "application/xml") |
92 | + response, err := api.session.post(URI, baseAPIVersion, []byte(body), "application/xml") |
93 | if err != nil { |
94 | return err |
95 | } |
96 | @@ -261,7 +267,7 @@ |
97 | func (api *ManagementAPI) CheckHostedServiceNameAvailability(name string) error { |
98 | var err error |
99 | response, err := api.session.get( |
100 | - "services/hostedservices/operations/isavailable/"+name, "2013-10-01") |
101 | + "services/hostedservices/operations/isavailable/"+name, baseAPIVersion) |
102 | if err != nil { |
103 | return err |
104 | } |
105 | @@ -282,7 +288,7 @@ |
106 | func (api *ManagementAPI) DeleteHostedService(serviceName string) error { |
107 | url := "services/hostedservices/" + serviceName |
108 | url = addURLQueryParams(url, "comp", "media") |
109 | - response, err := api.session.delete(url, "2013-08-01") |
110 | + response, err := api.session.delete(url, baseAPIVersion) |
111 | if err != nil { |
112 | if IsNotFoundError(err) { |
113 | return nil |
114 | @@ -304,7 +310,7 @@ |
115 | if err != nil { |
116 | return err |
117 | } |
118 | - response, err := api.session.post(URI, "2013-10-01", []byte(body), "application/xml") |
119 | + response, err := api.session.post(URI, baseAPIVersion, []byte(body), "application/xml") |
120 | if err != nil { |
121 | return err |
122 | } |
123 | @@ -315,7 +321,7 @@ |
124 | // See http://msdn.microsoft.com/en-us/library/windowsazure/ee460815.aspx |
125 | func (api *ManagementAPI) DeleteDeployment(serviceName string, deploymentName string) error { |
126 | path := "services/hostedservices/" + serviceName + "/deployments/" + deploymentName |
127 | - response, err := api.session.delete(path, "2013-10-01") |
128 | + response, err := api.session.delete(path, baseAPIVersion) |
129 | if err != nil { |
130 | if IsNotFoundError(err) { |
131 | return nil |
132 | @@ -337,7 +343,7 @@ |
133 | checkPathComponents(request.ServiceName) |
134 | checkPathComponents(request.DeploymentName) |
135 | path := "services/hostedservices/" + request.ServiceName + "/deployments/" + request.DeploymentName |
136 | - response, err := api.session.get(path, "2013-10-01") |
137 | + response, err := api.session.get(path, baseAPIVersion) |
138 | if err != nil { |
139 | return nil, err |
140 | } |
141 | @@ -362,7 +368,7 @@ |
142 | if err != nil { |
143 | return err |
144 | } |
145 | - response, err := api.session.post(uri, "2013-10-01", []byte(body), "application/xml") |
146 | + response, err := api.session.post(uri, baseAPIVersion, []byte(body), "application/xml") |
147 | if err != nil { |
148 | return err |
149 | } |
150 | @@ -372,7 +378,7 @@ |
151 | // DeleteStorageAccount deletes a storage account. |
152 | // See http://msdn.microsoft.com/en-us/library/windowsazure/hh264517.aspx |
153 | func (api *ManagementAPI) DeleteStorageAccount(storageAccountName string) error { |
154 | - response, err := api.session.delete("services/storageservices/"+storageAccountName, "2011-06-01") |
155 | + response, err := api.session.delete("services/storageservices/"+storageAccountName, baseAPIVersion) |
156 | if err != nil { |
157 | if IsNotFoundError(err) { |
158 | return nil |
159 | @@ -387,7 +393,7 @@ |
160 | // See http://msdn.microsoft.com/en-us/library/windowsazure/ee460785.aspx |
161 | func (api *ManagementAPI) GetStorageAccountKeys(accountName string) (*StorageAccountKeys, error) { |
162 | url := "services/storageservices/" + accountName + "/keys" |
163 | - res, err := api.session.get(url, "2009-10-01") |
164 | + res, err := api.session.get(url, baseAPIVersion) |
165 | if err != nil { |
166 | return nil, err |
167 | } |
168 | @@ -419,7 +425,7 @@ |
169 | if deleteBlob { |
170 | url = addURLQueryParams(url, "comp", "media") |
171 | } |
172 | - response, err := api.session.delete(url, "2012-08-01") |
173 | + response, err := api.session.delete(url, baseAPIVersion) |
174 | if err != nil { |
175 | if IsNotFoundError(err) { |
176 | return nil |
177 | @@ -459,7 +465,7 @@ |
178 | func (api *ManagementAPI) StartRole(request *StartRoleRequest) error { |
179 | return api.performRoleOperation( |
180 | request.ServiceName, request.DeploymentName, request.RoleName, |
181 | - "2013-10-01", startRoleOperation) |
182 | + baseAPIVersion, startRoleOperation) |
183 | } |
184 | |
185 | type RestartRoleRequest performRoleOperationRequest |
186 | @@ -469,7 +475,7 @@ |
187 | func (api *ManagementAPI) RestartRole(request *RestartRoleRequest) error { |
188 | return api.performRoleOperation( |
189 | request.ServiceName, request.DeploymentName, request.RoleName, |
190 | - "2013-10-01", restartRoleOperation) |
191 | + baseAPIVersion, restartRoleOperation) |
192 | } |
193 | |
194 | type ShutdownRoleRequest performRoleOperationRequest |
195 | @@ -479,7 +485,7 @@ |
196 | func (api *ManagementAPI) ShutdownRole(request *ShutdownRoleRequest) error { |
197 | return api.performRoleOperation( |
198 | request.ServiceName, request.DeploymentName, request.RoleName, |
199 | - "2013-10-01", shutdownRoleOperation) |
200 | + baseAPIVersion, shutdownRoleOperation) |
201 | } |
202 | |
203 | type GetRoleRequest performRoleOperationRequest |
204 | @@ -492,7 +498,7 @@ |
205 | url := ("services/hostedservices/" + request.ServiceName + |
206 | "/deployments/" + request.DeploymentName + "/roles/" + |
207 | request.RoleName) |
208 | - response, err := api.session.get(url, "2013-10-01") |
209 | + response, err := api.session.get(url, baseAPIVersion) |
210 | if err != nil { |
211 | return nil, err |
212 | } |
213 | @@ -527,7 +533,7 @@ |
214 | if err != nil { |
215 | return err |
216 | } |
217 | - response, err := api.session.put(url, "2013-10-01", []byte(role), "application/xml") |
218 | + response, err := api.session.put(url, baseAPIVersion, []byte(role), "application/xml") |
219 | if err != nil { |
220 | return err |
221 | } |
222 | @@ -551,7 +557,7 @@ |
223 | if request.DeleteMedia { |
224 | url = addURLQueryParams(url, "comp", "media") |
225 | } |
226 | - response, err := api.session.delete(url, "2013-08-01") |
227 | + response, err := api.session.delete(url, baseAPIVersion) |
228 | if err != nil { |
229 | if IsNotFoundError(err) { |
230 | return nil |
231 | @@ -578,7 +584,7 @@ |
232 | if err != nil { |
233 | return err |
234 | } |
235 | - response, err := api.session.post(url, "2013-10-01", []byte(role), "application/xml") |
236 | + response, err := api.session.post(url, baseAPIVersion, []byte(role), "application/xml") |
237 | if err != nil { |
238 | return err |
239 | } |
240 | @@ -598,7 +604,7 @@ |
241 | if err != nil { |
242 | return err |
243 | } |
244 | - response, err := api.session.post(url, "2013-10-01", []byte(body), "application/xml") |
245 | + response, err := api.session.post(url, baseAPIVersion, []byte(body), "application/xml") |
246 | if err != nil { |
247 | return err |
248 | } |
249 | @@ -620,7 +626,7 @@ |
250 | if err != nil { |
251 | return err |
252 | } |
253 | - response, err := api.session.put(url, "2011-02-25", []byte(body), "application/xml") |
254 | + response, err := api.session.put(url, baseAPIVersion, []byte(body), "application/xml") |
255 | if err != nil { |
256 | return err |
257 | } |
258 | @@ -636,7 +642,7 @@ |
259 | func (api *ManagementAPI) DeleteAffinityGroup(request *DeleteAffinityGroupRequest) error { |
260 | checkPathComponents(request.Name) |
261 | url := "affinitygroups/" + request.Name |
262 | - response, err := api.session.delete(url, "2011-02-25") |
263 | + response, err := api.session.delete(url, baseAPIVersion) |
264 | if err != nil { |
265 | if IsNotFoundError(err) { |
266 | return nil |
267 | @@ -651,7 +657,7 @@ |
268 | // be nil. |
269 | // See http://msdn.microsoft.com/en-us/library/windowsazure/jj157196.aspx |
270 | func (api *ManagementAPI) GetNetworkConfiguration() (*NetworkConfiguration, error) { |
271 | - response, err := api.session.get("services/networking/media", "2012-03-01") |
272 | + response, err := api.session.get("services/networking/media", baseAPIVersion) |
273 | if err != nil { |
274 | if IsNotFoundError(err) { |
275 | return nil, nil |
276 | @@ -676,7 +682,7 @@ |
277 | return err |
278 | } |
279 | response, err := api.session.put( |
280 | - "services/networking/media", "2012-03-01", []byte(body), |
281 | + "services/networking/media", baseAPIVersion, []byte(body), |
282 | "text/plain", |
283 | ) |
284 | if err != nil { |
285 | |
286 | === modified file 'management_base_test.go' |
287 | --- management_base_test.go 2014-12-03 07:29:23 +0000 |
288 | +++ management_base_test.go 2015-07-28 10:07:55 +0000 |
289 | @@ -437,7 +437,7 @@ |
290 | |
291 | c.Assert(err, IsNil) |
292 | expectedURL := defaultManagement + api.session.subscriptionId + "/services/hostedservices" |
293 | - checkOneRequest(c, &recordedRequests, expectedURL, "2013-10-01", nil, "GET") |
294 | + checkOneRequest(c, &recordedRequests, expectedURL, baseAPIVersion, nil, "GET") |
295 | c.Assert(descriptors[0].URL, Equals, url) |
296 | } |
297 | |
298 | @@ -467,7 +467,7 @@ |
299 | |
300 | c.Assert(err, IsNil) |
301 | expectedURL := defaultManagement + api.session.subscriptionId + "/services/hostedservices/" + serviceName |
302 | - checkOneRequest(c, &recordedRequests, expectedURL, "2013-10-01", requestPayload, "PUT") |
303 | + checkOneRequest(c, &recordedRequests, expectedURL, baseAPIVersion, requestPayload, "PUT") |
304 | } |
305 | |
306 | func assertGetHostedServicePropertiesRequest(c *C, api *ManagementAPI, serviceName string, embedDetail bool, httpRequest *X509Request) { |
307 | @@ -479,7 +479,7 @@ |
308 | } |
309 | expectedURL := fmt.Sprintf("%s%s/services/hostedservices/%s?%s", defaultManagement, |
310 | api.session.subscriptionId, serviceName, query) |
311 | - checkRequest(c, httpRequest, expectedURL, "2013-10-01", nil, "GET") |
312 | + checkRequest(c, httpRequest, expectedURL, baseAPIVersion, nil, "GET") |
313 | } |
314 | |
315 | func (suite *managementBaseAPISuite) TestGetHostedServiceProperties_withoutDetails(c *C) { |
316 | @@ -588,7 +588,7 @@ |
317 | expectedURL := defaultManagement + api.session.subscriptionId + "/services/hostedservices" |
318 | expectedPayload, err := marshalXML(createHostedService) |
319 | c.Assert(err, IsNil) |
320 | - checkOneRequest(c, recordedRequests, expectedURL, "2013-10-01", expectedPayload, "POST") |
321 | + checkOneRequest(c, recordedRequests, expectedURL, baseAPIVersion, expectedPayload, "POST") |
322 | } |
323 | |
324 | func makeAvailabilityResponse(result, reason string) string { |
325 | @@ -617,7 +617,7 @@ |
326 | c.Assert(err, IsNil) |
327 | expectedURL := (defaultManagement + api.session.subscriptionId + |
328 | "/services/hostedservices/operations/isavailable/" + serviceName) |
329 | - checkOneRequest(c, &recordedRequests, expectedURL, "2013-10-01", nil, "GET") |
330 | + checkOneRequest(c, &recordedRequests, expectedURL, baseAPIVersion, nil, "GET") |
331 | } |
332 | |
333 | func (*managementBaseAPISuite) TestAddHostedServiceWithBadName(c *C) { |
334 | @@ -639,7 +639,7 @@ |
335 | c.Check(recordedRequests, HasLen, 1) |
336 | expectedURL := (defaultManagement + api.session.subscriptionId + |
337 | "/services/hostedservices/operations/isavailable/" + serviceName) |
338 | - checkOneRequest(c, &recordedRequests, expectedURL, "2013-10-01", nil, "GET") |
339 | + checkOneRequest(c, &recordedRequests, expectedURL, baseAPIVersion, nil, "GET") |
340 | } |
341 | |
342 | func (*managementBaseAPISuite) TestAddHostedServiceWithServerError(c *C) { |
343 | @@ -681,7 +681,7 @@ |
344 | func assertDeleteHostedServiceRequest(c *C, api *ManagementAPI, serviceName string, httpRequest *X509Request) { |
345 | expectedURL := fmt.Sprintf("%s%s/services/hostedservices/%s?comp=media", defaultManagement, |
346 | api.session.subscriptionId, serviceName) |
347 | - checkRequest(c, httpRequest, expectedURL, "2013-08-01", nil, "DELETE") |
348 | + checkRequest(c, httpRequest, expectedURL, baseAPIVersion, nil, "DELETE") |
349 | } |
350 | |
351 | func (suite *managementBaseAPISuite) TestDeleteHostedService(c *C) { |
352 | @@ -714,14 +714,14 @@ |
353 | expectedURL := defaultManagement + api.session.subscriptionId + "/services/hostedservices/" + serviceName + "/deployments" |
354 | expectedPayload, err := marshalXML(deployment) |
355 | c.Assert(err, IsNil) |
356 | - checkOneRequest(c, recordedRequests, expectedURL, "2013-10-01", expectedPayload, "POST") |
357 | + checkOneRequest(c, recordedRequests, expectedURL, baseAPIVersion, expectedPayload, "POST") |
358 | } |
359 | |
360 | func assertDeleteDeploymentRequest(c *C, api *ManagementAPI, hostedServiceName, deploymentName string, httpRequest *X509Request) { |
361 | expectedURL := fmt.Sprintf( |
362 | "%s%s/services/hostedservices/%s/deployments/%s", defaultManagement, |
363 | api.session.subscriptionId, hostedServiceName, deploymentName) |
364 | - checkRequest(c, httpRequest, expectedURL, "2013-10-01", nil, "DELETE") |
365 | + checkRequest(c, httpRequest, expectedURL, baseAPIVersion, nil, "DELETE") |
366 | } |
367 | |
368 | func (suite *managementBaseAPISuite) TestDeleteDeployment(c *C) { |
369 | @@ -820,7 +820,7 @@ |
370 | expectedURL := fmt.Sprintf( |
371 | "%s%s/services/hostedservices/%s/deployments/%s", defaultManagement, |
372 | api.session.subscriptionId, request.ServiceName, request.DeploymentName) |
373 | - checkRequest(c, httpRequest, expectedURL, "2013-10-01", nil, "GET") |
374 | + checkRequest(c, httpRequest, expectedURL, baseAPIVersion, nil, "GET") |
375 | } |
376 | |
377 | func (suite *managementBaseAPISuite) TestGetDeployment(c *C) { |
378 | @@ -863,7 +863,7 @@ |
379 | expectedURL := defaultManagement + api.session.subscriptionId + "/services/storageservices" |
380 | expectedPayload, err := marshalXML(cssi) |
381 | c.Assert(err, IsNil) |
382 | - checkOneRequest(c, &recordedRequests, expectedURL, "2013-10-01", expectedPayload, "POST") |
383 | + checkOneRequest(c, &recordedRequests, expectedURL, baseAPIVersion, expectedPayload, "POST") |
384 | } |
385 | |
386 | func (suite *managementBaseAPISuite) TestDeleteStorageAccount(c *C) { |
387 | @@ -875,7 +875,7 @@ |
388 | err := api.DeleteStorageAccount(accountName) |
389 | c.Assert(err, IsNil) |
390 | |
391 | - checkOneRequest(c, recordedRequests, accountURL, "2011-06-01", nil, "DELETE") |
392 | + checkOneRequest(c, recordedRequests, accountURL, baseAPIVersion, nil, "DELETE") |
393 | } |
394 | |
395 | func (suite *managementBaseAPISuite) TestDeleteStorageAccountWhenAccountDoesNotExist(c *C) { |
396 | @@ -920,7 +920,7 @@ |
397 | if deleteBlob { |
398 | expectedURL += "?comp=media" |
399 | } |
400 | - checkRequest(c, httpRequest, expectedURL, "2012-08-01", nil, "DELETE") |
401 | + checkRequest(c, httpRequest, expectedURL, baseAPIVersion, nil, "DELETE") |
402 | } |
403 | |
404 | func (suite *managementBaseAPISuite) TestDeleteDisk(c *C) { |
405 | @@ -996,7 +996,7 @@ |
406 | request.RoleName + "/Operations") |
407 | expectedPayload, err := marshalXML(startRoleOperation) |
408 | c.Assert(err, IsNil) |
409 | - checkOneRequest(c, recordedRequests, expectedURL, "2013-10-01", expectedPayload, "POST") |
410 | + checkOneRequest(c, recordedRequests, expectedURL, baseAPIVersion, expectedPayload, "POST") |
411 | } |
412 | |
413 | func (suite *managementBaseAPISuite) TestRestartRole(c *C) { |
414 | @@ -1010,7 +1010,7 @@ |
415 | request.RoleName + "/Operations") |
416 | expectedPayload, err := marshalXML(restartRoleOperation) |
417 | c.Assert(err, IsNil) |
418 | - checkOneRequest(c, recordedRequests, expectedURL, "2013-10-01", expectedPayload, "POST") |
419 | + checkOneRequest(c, recordedRequests, expectedURL, baseAPIVersion, expectedPayload, "POST") |
420 | } |
421 | |
422 | func assertShutdownRoleRequest(c *C, api *ManagementAPI, request *ShutdownRoleRequest, httpRequest *X509Request) { |
423 | @@ -1020,7 +1020,7 @@ |
424 | request.DeploymentName, request.RoleName) |
425 | expectedPayload, err := marshalXML(shutdownRoleOperation) |
426 | c.Assert(err, IsNil) |
427 | - checkRequest(c, httpRequest, expectedURL, "2013-10-01", expectedPayload, "POST") |
428 | + checkRequest(c, httpRequest, expectedURL, baseAPIVersion, expectedPayload, "POST") |
429 | } |
430 | |
431 | func (suite *managementBaseAPISuite) TestShutdownRole(c *C) { |
432 | @@ -1037,7 +1037,7 @@ |
433 | expectedURL := (defaultManagement + api.session.subscriptionId + |
434 | "/services/hostedservices/" + |
435 | serviceName + "/deployments/" + deploymentName + "/roles/" + roleName) |
436 | - checkRequest(c, httpRequest, expectedURL, "2013-10-01", nil, "GET") |
437 | + checkRequest(c, httpRequest, expectedURL, baseAPIVersion, nil, "GET") |
438 | } |
439 | |
440 | func (suite *managementBaseAPISuite) TestGetRole(c *C) { |
441 | @@ -1066,7 +1066,7 @@ |
442 | "/services/hostedservices/" + |
443 | serviceName + "/deployments/" + deploymentName + "/roles/" + roleName) |
444 | checkRequest( |
445 | - c, httpRequest, expectedURL, "2013-10-01", []byte(expectedXML), "PUT") |
446 | + c, httpRequest, expectedURL, baseAPIVersion, []byte(expectedXML), "PUT") |
447 | c.Assert(httpRequest.ContentType, Equals, "application/xml") |
448 | } |
449 | |
450 | @@ -1142,7 +1142,7 @@ |
451 | expectedURL += "?comp=media" |
452 | } |
453 | checkRequest( |
454 | - c, httpRequest, expectedURL, "2013-08-01", nil, "DELETE") |
455 | + c, httpRequest, expectedURL, baseAPIVersion, nil, "DELETE") |
456 | } |
457 | |
458 | func (suite *managementBaseAPISuite) TestDeleteRole(c *C) { |
459 | @@ -1177,7 +1177,7 @@ |
460 | "/services/hostedservices/" + |
461 | serviceName + "/deployments/" + deploymentName + "/roles") |
462 | checkRequest( |
463 | - c, httpRequest, expectedURL, "2013-10-01", []byte(expectedXML), "POST") |
464 | + c, httpRequest, expectedURL, baseAPIVersion, []byte(expectedXML), "POST") |
465 | c.Assert(httpRequest.ContentType, Equals, "application/xml") |
466 | } |
467 | |
468 | @@ -1221,7 +1221,7 @@ |
469 | |
470 | expectedURL := defaultManagement + api.session.subscriptionId + "/affinitygroups" |
471 | expectedBody, _ := cag.Serialize() |
472 | - checkOneRequest(c, &recordedRequests, expectedURL, "2013-10-01", []byte(expectedBody), "POST") |
473 | + checkOneRequest(c, &recordedRequests, expectedURL, baseAPIVersion, []byte(expectedBody), "POST") |
474 | } |
475 | |
476 | func (suite *managementBaseAPISuite) TestUpdateAffinityGroup(c *C) { |
477 | @@ -1242,7 +1242,7 @@ |
478 | expectedURL := (defaultManagement + api.session.subscriptionId + |
479 | "/affinitygroups/" + request.Name) |
480 | expectedBody, _ := uag.Serialize() |
481 | - checkOneRequest(c, &recordedRequests, expectedURL, "2011-02-25", []byte(expectedBody), "PUT") |
482 | + checkOneRequest(c, &recordedRequests, expectedURL, baseAPIVersion, []byte(expectedBody), "PUT") |
483 | } |
484 | |
485 | func (suite *managementBaseAPISuite) TestDeleteAffinityGroup(c *C) { |
486 | @@ -1260,7 +1260,7 @@ |
487 | |
488 | expectedURL := (defaultManagement + api.session.subscriptionId + |
489 | "/affinitygroups/" + request.Name) |
490 | - checkOneRequest(c, &recordedRequests, expectedURL, "2011-02-25", nil, "DELETE") |
491 | + checkOneRequest(c, &recordedRequests, expectedURL, baseAPIVersion, nil, "DELETE") |
492 | } |
493 | |
494 | func (suite *managementBaseAPISuite) TestDeleteAffinityGroupWhenGroupDoesNotExist(c *C) { |
495 | @@ -1327,7 +1327,7 @@ |
496 | expectedURL := fmt.Sprintf( |
497 | "%s%s/services/networking/media", defaultManagement, |
498 | api.session.subscriptionId) |
499 | - checkRequest(c, httpRequest, expectedURL, "2012-03-01", nil, "GET") |
500 | + checkRequest(c, httpRequest, expectedURL, baseAPIVersion, nil, "GET") |
501 | } |
502 | |
503 | func (suite *managementBaseAPISuite) TestGetNetworkConfiguration(c *C) { |
504 | @@ -1366,7 +1366,7 @@ |
505 | expectedURL := fmt.Sprintf( |
506 | "%s%s/services/networking/media", defaultManagement, |
507 | api.session.subscriptionId) |
508 | - checkRequest(c, httpRequest, expectedURL, "2012-03-01", body, "PUT") |
509 | + checkRequest(c, httpRequest, expectedURL, baseAPIVersion, body, "PUT") |
510 | // Azure chokes when the content type is text/xml or similar. |
511 | c.Assert(httpRequest.ContentType, Equals, "text/plain") |
512 | } |
513 | |
514 | === modified file 'poller.go' |
515 | --- poller.go 2014-12-02 00:36:45 +0000 |
516 | +++ poller.go 2015-07-28 10:07:55 +0000 |
517 | @@ -96,7 +96,7 @@ |
518 | // See http://msdn.microsoft.com/en-us/library/windowsazure/ee460783.aspx |
519 | func (poller operationPoller) poll() (*x509Response, error) { |
520 | URI := "operations/" + poller.operationID |
521 | - return poller.api.session.get(URI, "2009-10-01") |
522 | + return poller.api.session.get(URI, baseAPIVersion) |
523 | } |
524 | |
525 | // IsDone returns true if the given response has a status code indicating |
526 | |
527 | === modified file 'poller_test.go' |
528 | --- poller_test.go 2014-12-02 00:36:45 +0000 |
529 | +++ poller_test.go 2015-07-28 10:07:55 +0000 |
530 | @@ -6,10 +6,11 @@ |
531 | import ( |
532 | "encoding/xml" |
533 | "fmt" |
534 | + "net/http" |
535 | + "time" |
536 | + |
537 | . "launchpad.net/gocheck" |
538 | "launchpad.net/gwacl/dedent" |
539 | - "net/http" |
540 | - "time" |
541 | ) |
542 | |
543 | type pollerSuite struct{} |
544 | @@ -120,7 +121,7 @@ |
545 | |
546 | c.Assert(err, IsNil) |
547 | expectedURL := defaultManagement + api.session.subscriptionId + "/operations/" + operationID |
548 | - checkOneRequest(c, recordedRequests, expectedURL, "2009-10-01", nil, "GET") |
549 | + checkOneRequest(c, recordedRequests, expectedURL, baseAPIVersion, nil, "GET") |
550 | } |
551 | |
552 | var operationXMLTemplate = dedent.Dedent(` |
553 | @@ -212,6 +213,6 @@ |
554 | operationPollerInstance := poller.(operationPoller) |
555 | expectedURL := defaultManagement + operationPollerInstance.api.session.subscriptionId + "/operations/" + operationID |
556 | c.Assert(len(recordedRequests), Equals, 2) |
557 | - checkRequest(c, recordedRequests[0], expectedURL, "2009-10-01", nil, "GET") |
558 | - checkRequest(c, recordedRequests[1], expectedURL, "2009-10-01", nil, "GET") |
559 | + checkRequest(c, recordedRequests[0], expectedURL, baseAPIVersion, nil, "GET") |
560 | + checkRequest(c, recordedRequests[1], expectedURL, baseAPIVersion, nil, "GET") |
561 | } |
562 | |
563 | === modified file 'storage_base.go' |
564 | --- storage_base.go 2014-12-02 00:36:45 +0000 |
565 | +++ storage_base.go 2015-07-28 10:07:55 +0000 |
566 | @@ -27,6 +27,8 @@ |
567 | "time" |
568 | ) |
569 | |
570 | +const defaultStorageAPIVersion = "2014-02-14" |
571 | + |
572 | var headersToSign = []string{ |
573 | "Content-Encoding", |
574 | "Content-Language", |
575 | @@ -256,7 +258,7 @@ |
576 | Method string // HTTP method, e.g. "GET" or "PUT". |
577 | URL string // Resource locator, e.g. "http://example.com/my/resource". |
578 | Body io.Reader // Optional request body. |
579 | - APIVersion string // Expected Azure API version, e.g. "2012-02-12". |
580 | + APIVersion string // Expected Azure API version, e.g. "2014-02-14". |
581 | ExtraHeaders http.Header // Optional extra request headers. |
582 | Result Deserializer // Optional object to parse API response into. |
583 | ExpectedStatus HTTPStatus // Expected response status, e.g. http.StatusOK. |
584 | @@ -400,7 +402,7 @@ |
585 | _, _, err := context.performRequest(requestParams{ |
586 | Method: "GET", |
587 | URL: uri, |
588 | - APIVersion: "2012-02-12", |
589 | + APIVersion: defaultStorageAPIVersion, |
590 | Result: &containers, |
591 | ExpectedStatus: http.StatusOK, |
592 | }) |
593 | @@ -437,7 +439,7 @@ |
594 | _, _, err := context.performRequest(requestParams{ |
595 | Method: "GET", |
596 | URL: uri, |
597 | - APIVersion: "2012-02-12", |
598 | + APIVersion: defaultStorageAPIVersion, |
599 | Result: &blobs, |
600 | ExpectedStatus: http.StatusOK, |
601 | }) |
602 | @@ -457,7 +459,7 @@ |
603 | _, _, err := context.performRequest(requestParams{ |
604 | Method: "PUT", |
605 | URL: uri, |
606 | - APIVersion: "2012-02-12", |
607 | + APIVersion: defaultStorageAPIVersion, |
608 | ExpectedStatus: http.StatusCreated, |
609 | }) |
610 | if err != nil { |
611 | @@ -476,7 +478,7 @@ |
612 | _, _, err := context.performRequest(requestParams{ |
613 | Method: "DELETE", |
614 | URL: uri, |
615 | - APIVersion: "2012-02-12", |
616 | + APIVersion: defaultStorageAPIVersion, |
617 | ExpectedStatus: http.StatusAccepted, |
618 | }) |
619 | if err != nil { |
620 | @@ -500,7 +502,7 @@ |
621 | params := requestParams{ |
622 | Method: "GET", |
623 | URL: uri, |
624 | - APIVersion: "2012-02-12", |
625 | + APIVersion: defaultStorageAPIVersion, |
626 | ExpectedStatus: http.StatusOK, |
627 | } |
628 | _, headers, err := context.performRequest(params) |
629 | @@ -556,7 +558,7 @@ |
630 | _, _, err := context.performRequest(requestParams{ |
631 | Method: "PUT", |
632 | URL: context.GetFileURL(req.Container, req.Filename), |
633 | - APIVersion: "2012-02-12", |
634 | + APIVersion: defaultStorageAPIVersion, |
635 | ExtraHeaders: extraHeaders, |
636 | ExpectedStatus: http.StatusCreated, |
637 | }) |
638 | @@ -598,7 +600,7 @@ |
639 | Method: "PUT", |
640 | URL: uri, |
641 | Body: req.Data, |
642 | - APIVersion: "2012-02-12", |
643 | + APIVersion: defaultStorageAPIVersion, |
644 | ExtraHeaders: extraHeaders, |
645 | ExpectedStatus: http.StatusCreated, |
646 | }) |
647 | @@ -620,7 +622,7 @@ |
648 | _, _, err := context.performRequest(requestParams{ |
649 | Method: "GET", |
650 | URL: uri, |
651 | - APIVersion: "2012-02-12", |
652 | + APIVersion: defaultStorageAPIVersion, |
653 | Result: &bl, |
654 | ExpectedStatus: http.StatusOK, |
655 | }) |
656 | @@ -643,7 +645,7 @@ |
657 | Method: "PUT", |
658 | URL: uri, |
659 | Body: data, |
660 | - APIVersion: "2012-02-12", |
661 | + APIVersion: defaultStorageAPIVersion, |
662 | ExpectedStatus: http.StatusCreated, |
663 | }) |
664 | if err != nil { |
665 | @@ -668,7 +670,7 @@ |
666 | Method: "PUT", |
667 | URL: uri, |
668 | Body: dataReader, |
669 | - APIVersion: "2012-02-12", |
670 | + APIVersion: defaultStorageAPIVersion, |
671 | ExpectedStatus: http.StatusCreated, |
672 | }) |
673 | if err != nil { |
674 | @@ -684,7 +686,7 @@ |
675 | _, _, err := context.performRequest(requestParams{ |
676 | Method: "DELETE", |
677 | URL: context.GetFileURL(container, filename), |
678 | - APIVersion: "2012-02-12", |
679 | + APIVersion: defaultStorageAPIVersion, |
680 | ExpectedStatus: http.StatusAccepted, |
681 | }) |
682 | if err != nil { |
683 | @@ -704,7 +706,7 @@ |
684 | body, _, err := context.performRequest(requestParams{ |
685 | Method: "GET", |
686 | URL: context.GetFileURL(container, filename), |
687 | - APIVersion: "2012-02-12", |
688 | + APIVersion: defaultStorageAPIVersion, |
689 | ExpectedStatus: http.StatusOK, |
690 | }) |
691 | if err != nil { |
692 | @@ -740,7 +742,7 @@ |
693 | _, _, err := context.performRequest(requestParams{ |
694 | Method: "PUT", |
695 | URL: uri, |
696 | - APIVersion: "2009-09-19", |
697 | + APIVersion: defaultStorageAPIVersion, |
698 | ExtraHeaders: extraHeaders, |
699 | ExpectedStatus: http.StatusOK, |
700 | }) |
701 | |
702 | === modified file 'xmlobjects.go' |
703 | --- xmlobjects.go 2014-12-03 07:29:23 +0000 |
704 | +++ xmlobjects.go 2015-07-28 10:07:55 +0000 |
705 | @@ -65,8 +65,12 @@ |
706 | // when no InputEndpoint objects are present (this happens when the |
707 | // ConfigurationSet object has a LinuxProvisioningConfiguration type for |
708 | // instance). |
709 | - InputEndpoints *[]InputEndpoint `xml:"InputEndpoints>InputEndpoint,omitempty"` |
710 | - SubnetNames *[]string `xml:"SubnetNames>SubnetName,omitempty"` |
711 | + InputEndpoints *[]InputEndpoint `xml:"InputEndpoints>InputEndpoint,omitempty"` |
712 | + SubnetNames *[]string `xml:"SubnetNames>SubnetName,omitempty"` |
713 | + StaticVirtualNetworkIPAddress string `xml:"StaticVirtualNetworkIPAddress,omitempty"` |
714 | + NetworkSecurityGroup string `xml:"NetworkSecurityGroup,omitempty"` |
715 | + // TODO(axw) PublicIPs |
716 | + // TODO(axw) NetworkInterfaces |
717 | } |
718 | |
719 | func (c *ConfigurationSet) inputEndpoints() []InputEndpoint { |
720 | @@ -229,6 +233,7 @@ |
721 | ShowInGUI string `xml:"ShowInGui"` |
722 | SmallIconURI string `xml:"SmallIconUri,omitempty"` |
723 | Language string `xml:"Language"` |
724 | + IOType string `xml:"IOType,omitempty"` |
725 | } |
726 | |
727 | func (image *OSImage) hasLocation(location string) bool { |
728 | @@ -291,12 +296,14 @@ |
729 | ) |
730 | |
731 | type OSVirtualHardDisk struct { |
732 | - HostCaching string `xml:"HostCaching,omitempty"` |
733 | - DiskLabel string `xml:"DiskLabel,omitempty"` |
734 | - DiskName string `xml:"DiskName,omitempty"` |
735 | - MediaLink string `xml:"MediaLink,omitempty"` |
736 | - SourceImageName string `xml:"SourceImageName,omitempty"` |
737 | - OS string `xml:"OS,omitempty"` |
738 | + HostCaching string `xml:"HostCaching,omitempty"` |
739 | + DiskLabel string `xml:"DiskLabel,omitempty"` |
740 | + DiskName string `xml:"DiskName,omitempty"` |
741 | + MediaLink string `xml:"MediaLink,omitempty"` |
742 | + SourceImageName string `xml:"SourceImageName,omitempty"` |
743 | + OS string `xml:"OS,omitempty"` |
744 | + RemoteSourceImageLink string `xml:"RemoteSourceImageLink,omitempty"` |
745 | + ResizedSizeInGB int `xml:"ResizedSizeInGB,omitempty"` |
746 | } |
747 | |
748 | func (c *OSVirtualHardDisk) Serialize() (string, error) { |
749 | @@ -327,16 +334,20 @@ |
750 | } |
751 | |
752 | type Role struct { |
753 | - XMLNS string `xml:"xmlns,attr,omitempty"` |
754 | - RoleName string `xml:"RoleName"` |
755 | - OsVersion string `xml:"OsVersion,omitempty"` |
756 | - RoleType string `xml:"RoleType"` // Always "PersistentVMRole" |
757 | - ConfigurationSets []ConfigurationSet `xml:"ConfigurationSets>ConfigurationSet"` |
758 | + XMLNS string `xml:"xmlns,attr,omitempty"` |
759 | + RoleName string `xml:"RoleName"` |
760 | + RoleType string `xml:"RoleType"` // Always "PersistentVMRole" |
761 | + VMImage string `xml:"VMImage,omitempty"` |
762 | + MediaLocation string `xml:"MediaLocation,omitempty"` |
763 | + ConfigurationSets []ConfigurationSet `xml:"ConfigurationSets>ConfigurationSet"` |
764 | + // TODO(axw) ResourceExtensionReferences |
765 | AvailabilitySetName string `xml:"AvailabilitySetName,omitempty"` |
766 | DataVirtualHardDisks *[]DataVirtualHardDisk `xml:"DataVirtualHardDisks>DataVirtualHardDisk,omitempty"` |
767 | OSVirtualHardDisk *OSVirtualHardDisk `xml:"OSVirtualHardDisk,omitempty"` |
768 | RoleSize string `xml:"RoleSize"` |
769 | + ProvisionGuestAgent bool `xml:"ProvisionGuestAgent,omitempty"` |
770 | DefaultWinRmCertificateThumbprint string `xml:"DefaultWinRmCertificateThumbprint,omitempty"` |
771 | + // TODO(axw) VMImageInput |
772 | } |
773 | |
774 | // |
775 | @@ -408,16 +419,19 @@ |
776 | // and is used when describing a list of HostedServices. |
777 | // See http://msdn.microsoft.com/en-us/library/windowsazure/ee460781.aspx |
778 | type HostedServiceDescriptor struct { |
779 | - URL string `xml:"Url"` |
780 | - ServiceName string `xml:"ServiceName"` |
781 | - Description string `xml:"HostedServiceProperties>Description"` |
782 | - AffinityGroup string `xml:"HostedServiceProperties>AffinityGroup"` |
783 | - Location string `xml:"HostedServiceProperties>Location"` |
784 | - Label string `xml:"HostedServiceProperties>Label"` |
785 | - Status string `xml:"HostedServiceProperties>Status"` |
786 | - DateCreated string `xml:"HostedServiceProperties>DateCreated"` |
787 | - DateLastModified string `xml:"HostedServiceProperties>DateLastModified"` |
788 | - ExtendedProperties []ExtendedProperty `xml:"HostedServiceProperties>ExtendedProperties>ExtendedProperty"` |
789 | + URL string `xml:"Url"` |
790 | + ServiceName string `xml:"ServiceName"` |
791 | + Description string `xml:"HostedServiceProperties>Description"` |
792 | + AffinityGroup string `xml:"HostedServiceProperties>AffinityGroup"` |
793 | + Location string `xml:"HostedServiceProperties>Location"` |
794 | + Label string `xml:"HostedServiceProperties>Label"` |
795 | + Status string `xml:"HostedServiceProperties>Status"` |
796 | + DateCreated string `xml:"HostedServiceProperties>DateCreated"` |
797 | + DateLastModified string `xml:"HostedServiceProperties>DateLastModified"` |
798 | + ExtendedProperties []ExtendedProperty `xml:"HostedServiceProperties>ExtendedProperties>ExtendedProperty"` |
799 | + ReverseDnsFqdn string `xml:"HostedServiceProperties>ReverseDnsFqdn,omitempty"` |
800 | + DefaultWinRMCertificateThumbprint string `xml:"DefaultWinRMCertificateThumbprint,omitempty"` |
801 | + ComputeCapabilities *ComputeCapabilities `xml:"ComputeCapabilities,omitempty"` |
802 | } |
803 | |
804 | func (c HostedServiceDescriptor) Serialize() (string, error) { |
805 | @@ -440,6 +454,7 @@ |
806 | Location string `xml:"Location,omitempty"` |
807 | AffinityGroup string `xml:"AffinityGroup,omitempty"` |
808 | ExtendedProperties []ExtendedProperty `xml:"ExtendedProperties>ExtendedProperty"` |
809 | + ReverseDnsFqdn string `xml:"ReverseDnsFqdn,omitempty"` |
810 | } |
811 | |
812 | func NewCreateHostedServiceWithLocation(serviceName, label, location string) *CreateHostedService { |
813 | @@ -476,6 +491,7 @@ |
814 | Label string `xml:"Label,omitempty"` // base64-encoded |
815 | Description string `xml:"Description,omitempty"` |
816 | ExtendedProperties []ExtendedProperty `xml:"ExtendedProperties>ExtendedProperty,omitempty"` |
817 | + ReverseDnsFqdn string `xml:"ReverseDnsFqdn,omitempty"` |
818 | } |
819 | |
820 | func (u *UpdateHostedService) Serialize() (string, error) { |
821 | @@ -503,21 +519,30 @@ |
822 | XMLNS_I string `xml:"xmlns:i,attr"` |
823 | Name string `xml:"Name"` |
824 | // DeploymentSlot is either "Production" or "Staging". |
825 | - DeploymentSlot string `xml:"DeploymentSlot"` |
826 | - PrivateID string `xml:"PrivateID,omitempty"` // Only used for "Get Deployment." |
827 | - Status string `xml:"Status,omitempty"` // Only used for "Get Deployment." |
828 | - Label string `xml:"Label"` |
829 | - URL string `xml:"Url,omitempty"` // Only used for "Get Deployment." |
830 | - Configuration string `xml:"Configuration,omitempty"` // Only used for "Get Deployment." |
831 | - RoleInstanceList []RoleInstance `xml:"RoleInstanceList>RoleInstance"` |
832 | - UpgradeDomainCount string `xml:"UpgradeDomainCount,omitempty"` // Only used for "Get Deployment." |
833 | - RoleList []Role `xml:"RoleList>Role"` |
834 | - SDKVersion string `xml:"SdkVersion,omitempty"` // Only used for "Get Deployment." |
835 | - Locked string `xml:"Locked,omitempty"` // Only used for "Get Deployment." |
836 | - RollbackAllowed string `xml:"RollbackAllowed,omitempty"` // Only used for "Get Deployment." |
837 | - VirtualNetworkName string `xml:VirtualNetworkName,omitempty"` |
838 | - DNS []DnsServer `xml:"Dns>DnsServers>DnsServer,omitempty"` |
839 | + DeploymentSlot string `xml:"DeploymentSlot"` |
840 | + PrivateID string `xml:"PrivateID,omitempty"` // Only used for "Get Deployment." |
841 | + Status string `xml:"Status,omitempty"` // Only used for "Get Deployment." |
842 | + Label string `xml:"Label"` |
843 | + URL string `xml:"Url,omitempty"` // Only used for "Get Deployment." |
844 | + Configuration string `xml:"Configuration,omitempty"` // Only used for "Get Deployment." |
845 | + RoleInstanceList []RoleInstance `xml:"RoleInstanceList>RoleInstance"` |
846 | + // TODO(axw) UpgradeStatus |
847 | + UpgradeDomainCount string `xml:"UpgradeDomainCount,omitempty"` // Only used for "Get Deployment." |
848 | + RoleList []Role `xml:"RoleList>Role"` |
849 | + SDKVersion string `xml:"SdkVersion,omitempty"` // Only used for "Get Deployment." |
850 | + Locked string `xml:"Locked,omitempty"` // Only used for "Get Deployment." |
851 | + RollbackAllowed string `xml:"RollbackAllowed,omitempty"` // Only used for "Get Deployment." |
852 | + CreatedTime string `xml:"CreatedTime,omitempty"` |
853 | + LastModifiedTime string `xml:"LastModifiedTime,omitempty"` |
854 | + VirtualNetworkName string `xml:VirtualNetworkName,omitempty"` |
855 | + DNS []DnsServer `xml:"Dns>DnsServers>DnsServer,omitempty"` |
856 | + // TODO(axw) LoadBalancers |
857 | ExtendedProperties []ExtendedProperty `xml:"ExtendedProperties>ExtendedProperty,omitempty"` // Only used for "Get Deployment." |
858 | + // TODO(axw) PersistentVMDowntime |
859 | + // TODO(axw) VirtualIPs |
860 | + // TODO(axw) ExtensionConfiguration |
861 | + ReservedIPName string `xml:"ReservedIPName,omitempty"` |
862 | + InternalDnsSuffix string `xml:"InternalDnsSuffix,omitempty"` |
863 | } |
864 | |
865 | func (deployment *Deployment) GetFQDN() (string, error) { |
866 | @@ -807,6 +832,7 @@ |
867 | AffinityGroup string `xml:"AffinityGroup,omitempty"` |
868 | GeoReplicationEnabled string `xml:"GeoReplicationEnabled,omitempty"` |
869 | ExtendedProperties []ExtendedProperty `xml:"ExtendedProperties>ExtendedProperty"` |
870 | + AccountType string `xml:"AccountType,omitempty"` |
871 | } |
872 | |
873 | func (c *CreateStorageServiceInput) Serialize() (string, error) { |
874 | @@ -841,7 +867,6 @@ |
875 | type Blob struct { |
876 | Name string `xml:"Name"` |
877 | Snapshot string `xml:"Snapshot"` |
878 | - URL string `xml:"Url"` |
879 | LastModified string `xml:"Properties>Last-Modified"` |
880 | ETag string `xml:"Properties>Etag"` |
881 | ContentLength string `xml:"Properties>Content-Length"` |
882 | @@ -906,7 +931,6 @@ |
883 | type Container struct { |
884 | XMLName xml.Name `xml:"Container"` |
885 | Name string `xml:"Name"` |
886 | - URL string `xml:"URL"` |
887 | Properties Properties `xml:"Properties"` |
888 | Metadata Metadata `xml:"Metadata"` |
889 | } |
890 | |
891 | === modified file 'xmlobjects_test.go' |
892 | --- xmlobjects_test.go 2014-12-02 00:36:45 +0000 |
893 | +++ xmlobjects_test.go 2015-07-28 10:07:55 +0000 |
894 | @@ -7,10 +7,11 @@ |
895 | "encoding/base64" |
896 | "encoding/xml" |
897 | "fmt" |
898 | + "sort" |
899 | + "strings" |
900 | + |
901 | . "launchpad.net/gocheck" |
902 | "launchpad.net/gwacl/dedent" |
903 | - "sort" |
904 | - "strings" |
905 | ) |
906 | |
907 | type xmlSuite struct{} |
908 | @@ -180,7 +181,6 @@ |
909 | template := dedent.Dedent(` |
910 | <PersistentVMRole xmlns="http://schemas.microsoft.com/windowsazure"> |
911 | <RoleName>%s</RoleName> |
912 | - <OsVersion>operating-system-version</OsVersion> |
913 | <RoleType>PersistentVMRole</RoleType> |
914 | <ConfigurationSets> |
915 | <ConfigurationSet> |
916 | @@ -243,10 +243,9 @@ |
917 | |
918 | func (suite *xmlSuite) TestPersistentVMRoleDeserialize(c *C) { |
919 | expected := &PersistentVMRole{ |
920 | - XMLNS: XMLNS, |
921 | - RoleName: "name-of-the-vm", |
922 | - OsVersion: "operating-system-version", |
923 | - RoleType: "PersistentVMRole", |
924 | + XMLNS: XMLNS, |
925 | + RoleName: "name-of-the-vm", |
926 | + RoleType: "PersistentVMRole", |
927 | ConfigurationSets: []ConfigurationSet{ |
928 | { |
929 | ConfigurationSetType: CONFIG_SET_NETWORK, |
930 | @@ -312,10 +311,9 @@ |
931 | |
932 | func (suite *xmlSuite) TestPersistentVMRoleSerialize(c *C) { |
933 | role := &PersistentVMRole{ |
934 | - XMLNS: XMLNS, |
935 | - RoleName: "name-of-the-vm", |
936 | - OsVersion: "operating-system-version", |
937 | - RoleType: "PersistentVMRole", |
938 | + XMLNS: XMLNS, |
939 | + RoleName: "name-of-the-vm", |
940 | + RoleType: "PersistentVMRole", |
941 | ConfigurationSets: []ConfigurationSet{ |
942 | { |
943 | ConfigurationSetType: CONFIG_SET_NETWORK, |
944 | @@ -786,7 +784,6 @@ |
945 | <RoleList> |
946 | <Role> |
947 | <RoleName>name-of-role</RoleName> |
948 | - <OsVersion>operating-system-version</OsVersion> |
949 | <ConfigurationSets> |
950 | <ConfigurationSet> |
951 | <ConfigurationSetType>LinuxProvisioningConfiguration</ConfigurationSetType> |
952 | @@ -796,7 +793,6 @@ |
953 | </Role> |
954 | <Role> |
955 | <RoleName>name-of-role</RoleName> |
956 | - <OsVersion>operating-system-version</OsVersion> |
957 | <RoleType>PersistentVMRole</RoleType> |
958 | <ConfigurationSets> |
959 | <ConfigurationSet> |
960 | @@ -922,8 +918,7 @@ |
961 | UpgradeDomainCount: "number-of-upgrade-domains-in-deployment", |
962 | RoleList: []Role{ |
963 | { |
964 | - RoleName: "name-of-role", |
965 | - OsVersion: "operating-system-version", |
966 | + RoleName: "name-of-role", |
967 | ConfigurationSets: []ConfigurationSet{ |
968 | { |
969 | ConfigurationSetType: "LinuxProvisioningConfiguration", |
970 | @@ -932,9 +927,8 @@ |
971 | }, |
972 | }, |
973 | { |
974 | - RoleName: "name-of-role", |
975 | - OsVersion: "operating-system-version", |
976 | - RoleType: "PersistentVMRole", |
977 | + RoleName: "name-of-role", |
978 | + RoleType: "PersistentVMRole", |
979 | ConfigurationSets: []ConfigurationSet{ |
980 | { |
981 | ConfigurationSetType: CONFIG_SET_NETWORK, |
982 | @@ -1208,7 +1202,6 @@ |
983 | <Blob> |
984 | <Name>blob-name</Name> |
985 | <Snapshot>snapshot-date-time</Snapshot> |
986 | - <Url>blob-address</Url> |
987 | <Properties> |
988 | <Last-Modified>last-modified</Last-Modified> |
989 | <Etag>etag</Etag> |
990 | @@ -1254,7 +1247,6 @@ |
991 | b := r.Blobs[0] |
992 | c.Check(b.Name, Equals, "blob-name") |
993 | c.Check(b.Snapshot, Equals, "snapshot-date-time") |
994 | - c.Check(b.URL, Equals, "blob-address") |
995 | c.Check(b.LastModified, Equals, "last-modified") |
996 | c.Check(b.ETag, Equals, "etag") |
997 | c.Check(b.ContentLength, Equals, "size-in-bytes") |
998 | @@ -1432,7 +1424,6 @@ |
999 | <?xml version="1.0" encoding="utf-8"?> |
1000 | <Container> |
1001 | <Name>name-value</Name> |
1002 | - <URL>url-value</URL> |
1003 | <Properties> |
1004 | <Last-Modified>date/time-value</Last-Modified> |
1005 | <Etag>etag-value</Etag> |
1006 | @@ -1451,7 +1442,6 @@ |
1007 | expected := &Container{ |
1008 | XMLName: xml.Name{Local: "Container"}, |
1009 | Name: "name-value", |
1010 | - URL: "url-value", |
1011 | Properties: Properties{ |
1012 | LastModified: "date/time-value", |
1013 | ETag: "etag-value", |
1014 | @@ -1483,7 +1473,6 @@ |
1015 | <Containers> |
1016 | <Container> |
1017 | <Name>name-value</Name> |
1018 | - <URL>url-value</URL> |
1019 | <Properties> |
1020 | <Last-Modified>date/time-value</Last-Modified> |
1021 | <Etag>etag-value</Etag> |
1022 | @@ -1511,7 +1500,6 @@ |
1023 | { |
1024 | XMLName: xml.Name{Local: "Container"}, |
1025 | Name: "name-value", |
1026 | - URL: "url-value", |
1027 | Properties: Properties{ |
1028 | LastModified: "date/time-value", |
1029 | ETag: "etag-value", |