@Test public void testResumeSystem() throws IOException { Task responseTask = getExpectedTaskResponse(); DeploymentApi deploymentApi = new DeploymentRestApi(restClient); Task task = deploymentApi.resumeSystem("deploymentId1"); assertEquals(task, responseTask); }
@Override public Task resumeSystem(String deploymentId) throws IOException { String path = String.format("%s/%s/resume_system", getBasePath(), deploymentId); HttpResponse response = this.restClient.perform(RestClient.Method.POST, path, null); this.restClient.checkResponse(response, HttpStatus.SC_CREATED); return parseTaskFromHttpResponse(response); }
DeploymentRestApi extends ApiBase implements DeploymentApi { @Override public Task resumeSystem(String deploymentId) throws IOException { String path = String.format("%s/%s/resume_system", getBasePath(), deploymentId); HttpResponse response = this.restClient.perform(RestClient.Method.POST, path, null); this.restClient.checkResponse(response, HttpStatus.SC_CREATED); return parseTaskFromHttpResponse(response); } }
DeploymentRestApi extends ApiBase implements DeploymentApi { @Override public Task resumeSystem(String deploymentId) throws IOException { String path = String.format("%s/%s/resume_system", getBasePath(), deploymentId); HttpResponse response = this.restClient.perform(RestClient.Method.POST, path, null); this.restClient.checkResponse(response, HttpStatus.SC_CREATED); return parseTaskFromHttpResponse(response); } DeploymentRestApi(RestClient restClient); }
DeploymentRestApi extends ApiBase implements DeploymentApi { @Override public Task resumeSystem(String deploymentId) throws IOException { String path = String.format("%s/%s/resume_system", getBasePath(), deploymentId); HttpResponse response = this.restClient.perform(RestClient.Method.POST, path, null); this.restClient.checkResponse(response, HttpStatus.SC_CREATED); return parseTaskFromHttpResponse(response); } DeploymentRestApi(RestClient restClient); @Override String getBasePath(); @Override ResourceList<Deployment> listAll(); @Override void listAllAsync(final FutureCallback<ResourceList<Deployment>> responseCallback); @Override Task pauseSystem(String deploymentId); @Override void pauseSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback); @Override Task resumeSystem(String deploymentId); @Override void resumeSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback); @Override ResourceList<Vm> getAllDeploymentVms(final String deploymentId); @Override void getAllDeploymentVmsAsync(String deploymentId, final FutureCallback<ResourceList<Vm>> responseCallback); }
DeploymentRestApi extends ApiBase implements DeploymentApi { @Override public Task resumeSystem(String deploymentId) throws IOException { String path = String.format("%s/%s/resume_system", getBasePath(), deploymentId); HttpResponse response = this.restClient.perform(RestClient.Method.POST, path, null); this.restClient.checkResponse(response, HttpStatus.SC_CREATED); return parseTaskFromHttpResponse(response); } DeploymentRestApi(RestClient restClient); @Override String getBasePath(); @Override ResourceList<Deployment> listAll(); @Override void listAllAsync(final FutureCallback<ResourceList<Deployment>> responseCallback); @Override Task pauseSystem(String deploymentId); @Override void pauseSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback); @Override Task resumeSystem(String deploymentId); @Override void resumeSystemAsync(final String deploymentId, final FutureCallback<Task> responseCallback); @Override ResourceList<Vm> getAllDeploymentVms(final String deploymentId); @Override void getAllDeploymentVmsAsync(String deploymentId, final FutureCallback<ResourceList<Vm>> responseCallback);  }