public void setVersion(String deploymentName, String version) { DeploymentConfiguration deploymentConfiguration = getDeploymentConfiguration(deploymentName); deploymentConfiguration.setVersion(version); }
public void setMetricStores(String deploymentName, MetricStores newMetricStores) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); deploymentConfiguration.setMetricStores(newMetricStores); }
public void setCanary(String deploymentName, Canary newCanary) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); deploymentConfiguration.setCanary(newCanary); }
public void setWebhook(String deploymentName, Webhook newWebhook) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); deploymentConfiguration.setWebhook(newWebhook); }
public NodeDiff configDiff(String deploymentName) { try { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); halconfigParser.switchToBackupConfig(); DeploymentConfiguration oldDeploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); return deploymentConfiguration.diff(oldDeploymentConfiguration); } finally { halconfigParser.switchToPrimaryConfig(); } }
public NodeDiff configDiff(String deploymentName) { try { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); halconfigParser.switchToBackupConfig(); DeploymentConfiguration oldDeploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); return deploymentConfiguration.diff(oldDeploymentConfiguration); } finally { halconfigParser.switchToPrimaryConfig(); } }
public ResolvedConfiguration generateConfigWithOptionalServices(String deploymentName, List<SpinnakerService.Type> serviceTypes) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); SpinnakerServiceProvider<DeploymentDetails> serviceProvider = serviceProviderFactory.create(deploymentConfiguration); if (serviceTypes.isEmpty()) { serviceTypes = serviceProvider .getServices() .stream() .map(SpinnakerService::getType) .collect(Collectors.toList()); } return generateConfig(deploymentName, serviceTypes); }
public ResolvedConfiguration generateConfigWithOptionalServices(String deploymentName, List<SpinnakerService.Type> serviceTypes) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); SpinnakerServiceProvider<DeploymentDetails> serviceProvider = serviceProviderFactory.create(deploymentConfiguration); if (serviceTypes.isEmpty()) { serviceTypes = serviceProvider .getServices() .stream() .map(SpinnakerService::getType) .collect(Collectors.toList()); } return generateConfig(deploymentName, serviceTypes); }
BillOfMaterials getBillOfMaterials(String deploymentName) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); String version = deploymentConfiguration.getVersion(); return versionsService.getBillOfMaterials(version); }
BillOfMaterials getBillOfMaterials(String deploymentName) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); String version = deploymentConfiguration.getVersion(); return versionsService.getBillOfMaterials(version); }
public String getLocation(String deploymentName) { DeploymentConfiguration deploymentConfiguration = getDeploymentConfiguration(deploymentName); return deploymentConfiguration.getDeploymentEnvironment().getLocation(); }
public void setNotification(String deploymentName, Notification notification) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); Notifications notifications = deploymentConfiguration.getNotifications(); switch (notification.getNotificationType()) { case SLACK: notifications.setSlack((SlackNotification) notification); break; default: throw new IllegalArgumentException("Unknown notification type " + notification.getNotificationType()); } }
public Notifications getNotifications(String deploymentName) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); Notifications notifications = deploymentConfiguration.getNotifications(); if (notifications == null) { notifications = new Notifications(); deploymentConfiguration.setNotifications(notifications); } return notifications; }
public void setPubsub(String deploymentName, Pubsub pubsub) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); Pubsubs pubsubs = deploymentConfiguration.getPubsub(); switch (pubsub.pubsubType()) { case GOOGLE: pubsubs.setGoogle((GooglePubsub) pubsub); break; default: throw new IllegalArgumentException("Unknown pubsub type " + pubsub.pubsubType()); } }
public void setPubsub(String deploymentName, Pubsub pubsub) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); Pubsubs pubsubs = deploymentConfiguration.getPubsub(); switch (pubsub.getPubsubType()) { case GOOGLE: pubsubs.setGoogle((GooglePubsub) pubsub); break; default: throw new IllegalArgumentException("Unknown pubsub type " + pubsub.getPubsubType()); } }
public Notifications getNotifications(String deploymentName) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); Notifications notifications = deploymentConfiguration.getNotifications(); if (notifications == null) { notifications = new Notifications(); deploymentConfiguration.setNotifications(notifications); } return notifications; }
@RequestMapping(value = "/{deploymentName:.+}", method = RequestMethod.GET) DaemonTask<Halconfig, DeploymentConfiguration> deploymentConfiguration(@PathVariable String deploymentName, @ModelAttribute ValidationSettings validationSettings) { return GenericGetRequest.<DeploymentConfiguration>builder() .getter(() -> deploymentService.getDeploymentConfiguration(deploymentName)) .validator(() -> deploymentService.validateDeployment(deploymentName)) .description("Get deployment configuration") .build() .execute(validationSettings); }
public void setHaService(String deploymentName, HaService haService) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); HaServices haServices = deploymentConfiguration.getDeploymentEnvironment().getHaServices(); switch (haService.haServiceType()) { case CLOUDDRIVER: haServices.setClouddriver((ClouddriverHaService) haService); break; case ECHO: haServices.setEcho((EchoHaService) haService); break; default: throw new IllegalArgumentException("Unknown high availability service type " + haService.haServiceType()); } }
public void clean(String deploymentName) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); SpinnakerServiceProvider<DeploymentDetails> serviceProvider = serviceProviderFactory.create(deploymentConfiguration); DeploymentDetails deploymentDetails = getDeploymentDetails(deploymentConfiguration); RemoteAction action = serviceProvider.clean(deploymentDetails, serviceProvider.buildRuntimeSettings(deploymentConfiguration)); action.commitScript(halconfigDirectoryStructure.getUnInstallScriptPath(deploymentName)); }
public void clean(String deploymentName) { DeploymentConfiguration deploymentConfiguration = deploymentService.getDeploymentConfiguration(deploymentName); SpinnakerServiceProvider<DeploymentDetails> serviceProvider = serviceProviderFactory.create(deploymentConfiguration); DeploymentDetails deploymentDetails = getDeploymentDetails(deploymentConfiguration); RemoteAction action = serviceProvider.clean(deploymentDetails, serviceProvider.buildRuntimeSettings(deploymentConfiguration)); action.commitScript(halconfigDirectoryStructure.getUnInstallScriptPath(deploymentName)); }