Search in sources :

Example 1 with SecretProviderConfigurationsDTO

use of alien4cloud.rest.secret.model.SecretProviderConfigurationsDTO in project alien4cloud by alien4cloud.

the class LocationController method getSecretConfigurations.

private SecretProviderConfigurationsDTO getSecretConfigurations(Location location) {
    Set<String> availablePlugins = secretProviderService.getAvailablePlugins();
    Map<String, Map<String, Object>> genericFormDescriptionByPluginName = availablePlugins.stream().collect(Collectors.toMap(Function.identity(), pluginName -> pojoFormDescriptorGenerator.generateDescriptor(secretProviderService.getPluginConfigurationDescriptor(pluginName))));
    SecretProviderConfigurationsDTO dto = new SecretProviderConfigurationsDTO();
    dto.setCurrentConfiguration(location.getSecretProviderConfiguration());
    dto.setGenericFormByPluginName(genericFormDescriptionByPluginName);
    return dto;
}
Also used : PathVariable(org.springframework.web.bind.annotation.PathVariable) PreAuthorize(org.springframework.security.access.prepost.PreAuthorize) LocationService(alien4cloud.orchestrators.locations.services.LocationService) RequestMapping(org.springframework.web.bind.annotation.RequestMapping) ApiParam(io.swagger.annotations.ApiParam) Function(java.util.function.Function) ReflectionUtil(alien4cloud.utils.ReflectionUtil) Location(alien4cloud.model.orchestrators.locations.Location) Inject(javax.inject.Inject) Valid(javax.validation.Valid) RequestBody(org.springframework.web.bind.annotation.RequestBody) ApiOperation(io.swagger.annotations.ApiOperation) Lists(com.google.common.collect.Lists) Audit(alien4cloud.audit.annotation.Audit) RestResponseBuilder(alien4cloud.rest.model.RestResponseBuilder) RestResponse(alien4cloud.rest.model.RestResponse) Map(java.util.Map) SecretProviderService(org.alien4cloud.secret.services.SecretProviderService) ILocationResourceService(alien4cloud.orchestrators.locations.services.ILocationResourceService) Api(io.swagger.annotations.Api) ResponseStatus(org.springframework.web.bind.annotation.ResponseStatus) SecretProviderConfiguration(alien4cloud.model.secret.SecretProviderConfiguration) UpdateLocationRequest(alien4cloud.rest.orchestrator.model.UpdateLocationRequest) MediaType(org.springframework.http.MediaType) Resource(javax.annotation.Resource) SecretProviderConfigurationsDTO(alien4cloud.rest.secret.model.SecretProviderConfigurationsDTO) Set(java.util.Set) RequestMethod(org.springframework.web.bind.annotation.RequestMethod) CreateLocationRequest(alien4cloud.rest.orchestrator.model.CreateLocationRequest) Collectors(java.util.stream.Collectors) RestController(org.springframework.web.bind.annotation.RestController) HttpStatus(org.springframework.http.HttpStatus) List(java.util.List) NotEmpty(org.hibernate.validator.constraints.NotEmpty) PojoFormDescriptorGenerator(alien4cloud.ui.form.PojoFormDescriptorGenerator) Authorization(io.swagger.annotations.Authorization) LocationDTO(alien4cloud.rest.orchestrator.model.LocationDTO) SecretProviderConfigurationsDTO(alien4cloud.rest.secret.model.SecretProviderConfigurationsDTO) Map(java.util.Map)

Aggregations

Audit (alien4cloud.audit.annotation.Audit)1 Location (alien4cloud.model.orchestrators.locations.Location)1 SecretProviderConfiguration (alien4cloud.model.secret.SecretProviderConfiguration)1 ILocationResourceService (alien4cloud.orchestrators.locations.services.ILocationResourceService)1 LocationService (alien4cloud.orchestrators.locations.services.LocationService)1 RestResponse (alien4cloud.rest.model.RestResponse)1 RestResponseBuilder (alien4cloud.rest.model.RestResponseBuilder)1 CreateLocationRequest (alien4cloud.rest.orchestrator.model.CreateLocationRequest)1 LocationDTO (alien4cloud.rest.orchestrator.model.LocationDTO)1 UpdateLocationRequest (alien4cloud.rest.orchestrator.model.UpdateLocationRequest)1 SecretProviderConfigurationsDTO (alien4cloud.rest.secret.model.SecretProviderConfigurationsDTO)1 PojoFormDescriptorGenerator (alien4cloud.ui.form.PojoFormDescriptorGenerator)1 ReflectionUtil (alien4cloud.utils.ReflectionUtil)1 Lists (com.google.common.collect.Lists)1 Api (io.swagger.annotations.Api)1 ApiOperation (io.swagger.annotations.ApiOperation)1 ApiParam (io.swagger.annotations.ApiParam)1 Authorization (io.swagger.annotations.Authorization)1 List (java.util.List)1 Map (java.util.Map)1