use of com.netflix.spinnaker.front50.model.project.Project in project front50 by spinnaker.
the class ProjectsController method put.
@ApiOperation(value = "", notes = "Update an existing project")
@RequestMapping(method = RequestMethod.PUT, value = "/{projectId}")
public Project put(@PathVariable final String projectId, @RequestBody final Project project) {
Project existingProject = projectDAO.findById(projectId);
project.setId(existingProject.getId());
project.setCreateTs(existingProject.getCreateTs());
project.setUpdateTs(System.currentTimeMillis());
try {
if (!projectDAO.findByName(project.getName()).getId().equals(projectId)) {
// renamed projects must still be uniquely named
throw new InvalidRequestException(format("A Project named '%s' already exists", project.getName()));
}
} catch (NotFoundException ignored) {
}
projectDAO.update(projectId, project);
return project;
}
use of com.netflix.spinnaker.front50.model.project.Project in project front50 by spinnaker.
the class GcsConfig method googleCloudStorageService.
private GcsStorageService googleCloudStorageService(Storage storage, String dataFilename, GcsProperties gcsProperties) {
var executor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat(GcsStorageService.class.getName() + "-%s").build());
GcsStorageService service = new GcsStorageService(storage, gcsProperties.getBucket(), gcsProperties.getBucketLocation(), gcsProperties.getRootFolder(), dataFilename, new ObjectMapper().addMixIn(Timestamped.class, TimestampedMixins.class).addMixIn(Pipeline.class, PipelineMixins.class), executor);
log.info("Using Google Cloud Storage bucket={} in project={}", value("bucket", gcsProperties.getBucket()), value("project", gcsProperties.getProject()));
return service;
}
Aggregations