public ListenableFuture<CreateDeploymentGroupResponse> createDeploymentGroup( final DeploymentGroup descriptor) { return transform( request(uri("/deployment-group/"), "POST", descriptor), ConvertResponseToPojo.create( CreateDeploymentGroupResponse.class, ImmutableSet.of(HTTP_OK, HTTP_BAD_REQUEST))); }
public ListenableFuture<JobDeleteResponse> deleteJob(final JobId id, final String token) { return transform( request(uri(path("/jobs/%s", id), ImmutableMap.of("token", token)), "DELETE"), ConvertResponseToPojo.create( JobDeleteResponse.class, ImmutableSet.of(HTTP_OK, HTTP_NOT_FOUND, HTTP_BAD_REQUEST, HTTP_FORBIDDEN))); }
public ListenableFuture<Map<JobId, JobStatus>> jobStatuses(final Set<JobId> jobs) { final ConvertResponseToPojo<Map<JobId, JobStatus>> converter = ConvertResponseToPojo.create( TypeFactory.defaultInstance().constructMapType(Map.class, JobId.class, JobStatus.class), ImmutableSet.of(HTTP_OK)); return transform(request(uri("/jobs/statuses"), "POST", jobs), converter); }
public ListenableFuture<JobUndeployResponse> undeploy( final JobId jobId, final String host, final String token) { return transform( request( uri(path("/hosts/%s/jobs/%s", host, jobId), ImmutableMap.of("token", token)), "DELETE"), ConvertResponseToPojo.create( JobUndeployResponse.class, ImmutableSet.of(HTTP_OK, HTTP_NOT_FOUND, HTTP_BAD_REQUEST, HTTP_FORBIDDEN))); }
public ListenableFuture<RollingUpdateResponse> rollingUpdate( final String deploymentGroupName, final JobId job, final RolloutOptions options) { return transform( request( uri(path("/deployment-group/%s/rolling-update", deploymentGroupName)), "POST", new RollingUpdateRequest(job, options)), ConvertResponseToPojo.create( RollingUpdateResponse.class, ImmutableSet.of(HTTP_OK, HTTP_BAD_REQUEST))); }
public ListenableFuture<Map<String, HostStatus>> hostStatuses( final List<String> hosts, final Map<String, String> queryParams) { final ConvertResponseToPojo<Map<String, HostStatus>> converter = ConvertResponseToPojo.create( TypeFactory.defaultInstance() .constructMapType(Map.class, String.class, HostStatus.class), ImmutableSet.of(HTTP_OK)); return transform(request(uri("/hosts/statuses", queryParams), "POST", hosts), converter); }
public ListenableFuture<SetGoalResponse> setGoal( final Deployment job, final String host, final String token) { return transform( request( uri(path("/hosts/%s/jobs/%s", host, job.getJobId()), ImmutableMap.of("token", token)), "PATCH", job), ConvertResponseToPojo.create( SetGoalResponse.class, ImmutableSet.of(HTTP_OK, HTTP_NOT_FOUND, HTTP_FORBIDDEN))); }
public ListenableFuture<JobDeployResponse> deploy( final Deployment job, final String host, final String token) { final Set<Integer> deserializeReturnCodes = ImmutableSet.of(HTTP_OK, HTTP_NOT_FOUND, HTTP_BAD_METHOD, HTTP_BAD_REQUEST, HTTP_FORBIDDEN); return transform( request( uri(path("/hosts/%s/jobs/%s", host, job.getJobId()), ImmutableMap.of("token", token)), "PUT", job), ConvertResponseToPojo.create(JobDeployResponse.class, deserializeReturnCodes)); }
public ListenableFuture<RemoveDeploymentGroupResponse> removeDeploymentGroup(final String name) { return transform( request(uri("/deployment-group/" + name), "DELETE"), ConvertResponseToPojo.create( RemoveDeploymentGroupResponse.class, ImmutableSet.of(HTTP_OK, HTTP_BAD_REQUEST))); }
public ListenableFuture<TaskStatusEvents> jobHistory(final JobId jobId) { return transform( request(uri(path("/history/jobs/%s", jobId.toString())), "GET"), ConvertResponseToPojo.create( TaskStatusEvents.class, ImmutableSet.of(HTTP_OK, HTTP_NOT_FOUND))); }
public ListenableFuture<CreateJobResponse> createJob(final Job descriptor) { return transform( request(uri("/jobs/"), "POST", descriptor), ConvertResponseToPojo.create( CreateJobResponse.class, ImmutableSet.of(HTTP_OK, HTTP_BAD_REQUEST))); }
public ListenableFuture<HostDeregisterResponse> deregisterHost(final String host) { return transform( request(uri(path("/hosts/%s", host)), "DELETE"), ConvertResponseToPojo.create( HostDeregisterResponse.class, ImmutableSet.of(HTTP_OK, HTTP_NOT_FOUND))); }