Search in sources :

Example 6 with JsonReader

use of com.thoughtworks.go.api.representers.JsonReader in project gocd by gocd.

the class PipelineOperationsControllerV1Delegate method pause.

public String pause(Request req, Response res) throws IOException {
    HttpLocalizedOperationResult result = new HttpLocalizedOperationResult();
    JsonReader requestBody = GsonTransformer.getInstance().jsonReaderFrom(req.body());
    String pipelineName = req.params("pipeline_name");
    String pauseCause = requestBody.optString("pause_cause").orElse(null);
    pipelinePauseService.pause(pipelineName, pauseCause, currentUsername(), result);
    return renderHTTPOperationResult(result, req, res, localizer);
}
Also used : HttpLocalizedOperationResult(com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult) JsonReader(com.thoughtworks.go.api.representers.JsonReader)

Aggregations

JsonReader (com.thoughtworks.go.api.representers.JsonReader)6 PipelineScheduleOptions (com.thoughtworks.go.server.domain.PipelineScheduleOptions)2 ArrayList (java.util.ArrayList)2 GsonTransformer (com.thoughtworks.go.api.util.GsonTransformer)1 PipelineSelectionResponse (com.thoughtworks.go.apiv1.pipelineselection.representers.PipelineSelectionResponse)1 EnvironmentVariablesConfig (com.thoughtworks.go.config.EnvironmentVariablesConfig)1 PluginRoleConfig (com.thoughtworks.go.config.PluginRoleConfig)1 ConfigurationProperty (com.thoughtworks.go.domain.config.ConfigurationProperty)1 MaterialForScheduling (com.thoughtworks.go.server.domain.MaterialForScheduling)1 HttpLocalizedOperationResult (com.thoughtworks.go.server.service.result.HttpLocalizedOperationResult)1