Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright 2018 Google, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.netflix.spinnaker.gate.controllers;
import static com.netflix.spinnaker.gate.controllers.PipelineTemplatesController.encodeAsBase64;
import static com.netflix.spinnaker.gate.controllers.PipelineTemplatesController.getApplicationFromTemplate;
import static com.netflix.spinnaker.gate.controllers.PipelineTemplatesController.getNameFromTemplate;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.netflix.spinnaker.gate.controllers.PipelineTemplatesController.PipelineTemplate;
import com.netflix.spinnaker.gate.services.PipelineTemplateService.PipelineTemplateDependent;
import com.netflix.spinnaker.gate.services.TaskService;
import com.netflix.spinnaker.gate.services.V2PipelineTemplateService;
import com.netflix.spinnaker.kork.exceptions.HasAdditionalAttributes;
import com.netflix.spinnaker.security.AuthenticatedRequest;
import groovy.transform.InheritConstructors;
import io.swagger.annotations.ApiOperation;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestController;
@RestController
@RequestMapping(value = "/v2/pipelineTemplates")
public class V2PipelineTemplatesController {
private static final String DEFAULT_APPLICATION = "spinnaker";
private static final String SCHEMA = "schema";
private static final String V2_SCHEMA_VERSION = "v2";
private V2PipelineTemplateService v2PipelineTemplateService;
private TaskService taskService;
private ObjectMapper objectMapper;
@Autowired
public V2PipelineTemplatesController(
V2PipelineTemplateService v2PipelineTemplateService,
TaskService taskService,
ObjectMapper objectMapper) {
this.v2PipelineTemplateService = v2PipelineTemplateService;
this.taskService = taskService;
this.objectMapper = objectMapper;
}
// TODO(louisjimenez): Deprecated. Will be replaced with /versions endpoint starting with 1.19.
@ApiOperation(value = "(ALPHA) List pipeline templates.", response = List.class)
@RequestMapping(method = RequestMethod.GET)
public Collection