Revision 51fdecfb src/com/rackspace/cloud/servers/api/client/ServerManager.java
b/src/com/rackspace/cloud/servers/api/client/ServerManager.java | ||
---|---|---|
305 | 305 |
|
306 | 306 |
StringEntity tmp = null; |
307 | 307 |
try { |
308 |
tmp = new StringEntity("<confirmResize xmlns=\"http://docs.rackspacecloud.com/servers/api/v1.0\">"); |
|
308 |
tmp = new StringEntity("<confirmResize xmlns=\"http://docs.rackspacecloud.com/servers/api/v1.0\"/>");
|
|
309 | 309 |
} catch (UnsupportedEncodingException e) { |
310 | 310 |
CloudServersException cse = new CloudServersException(); |
311 | 311 |
cse.setMessage(e.getLocalizedMessage()); |
... | ... | |
335 | 335 |
return bundle; |
336 | 336 |
} |
337 | 337 |
|
338 |
public HttpBundle revertResize(Server server, Context context) throws CloudServersException { |
|
339 |
HttpResponse resp = null; |
|
340 |
CustomHttpClient httpclient = new CustomHttpClient(context); |
|
341 |
HttpPost post = new HttpPost(Account.getAccount().getServerUrl() + "/servers/" + server.getId() + "/action.xml"); |
|
342 |
post.addHeader("X-Auth-Token", Account.getAccount().getAuthToken()); |
|
343 |
post.addHeader("Content-Type", "application/xml"); |
|
344 |
httpclient.removeRequestInterceptorByClass(RequestExpectContinue.class); |
|
338 | 345 |
|
346 |
StringEntity tmp = null; |
|
347 |
try { |
|
348 |
tmp = new StringEntity("<revertResize xmlns=\"http://docs.rackspacecloud.com/servers/api/v1.0\"/>"); |
|
349 |
} catch (UnsupportedEncodingException e) { |
|
350 |
CloudServersException cse = new CloudServersException(); |
|
351 |
cse.setMessage(e.getLocalizedMessage()); |
|
352 |
throw cse; |
|
353 |
} |
|
354 |
post.setEntity(tmp); |
|
355 |
|
|
356 |
HttpBundle bundle = new HttpBundle(); |
|
357 |
bundle.setCurlRequest(post); |
|
358 |
|
|
359 |
try { |
|
360 |
resp = httpclient.execute(post); |
|
361 |
bundle.setHttpResponse(resp); |
|
362 |
} catch (ClientProtocolException e) { |
|
363 |
CloudServersException cse = new CloudServersException(); |
|
364 |
cse.setMessage(e.getLocalizedMessage()); |
|
365 |
throw cse; |
|
366 |
} catch (IOException e) { |
|
367 |
CloudServersException cse = new CloudServersException(); |
|
368 |
cse.setMessage(e.getLocalizedMessage()); |
|
369 |
throw cse; |
|
370 |
} catch (FactoryConfigurationError e) { |
|
371 |
CloudServersException cse = new CloudServersException(); |
|
372 |
cse.setMessage(e.getLocalizedMessage()); |
|
373 |
throw cse; |
|
374 |
} |
|
375 |
return bundle; |
|
376 |
} |
|
377 |
|
|
339 | 378 |
public HttpBundle delete(Server server, Context context) throws CloudServersException { |
340 | 379 |
HttpResponse resp = null; |
341 | 380 |
CustomHttpClient httpclient = new CustomHttpClient(context); |
Also available in: Unified diff