use of com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse in project cloudbreak by hortonworks.
the class ProxyController method deleteByCrn.
@Override
@CheckPermissionByAccount(action = AuthorizationResourceAction.POWERUSER_ONLY)
public ProxyResponse deleteByCrn(String crn) {
ProxyResponse proxyResponse = proxyConfigToProxyResponseConverter.convert(proxyConfigService.deleteByCrnInAccount(crn, ThreadBasedUserCrnProvider.getAccountId()));
notify(ResourceEvent.PROXY_CONFIG_DELETED);
return proxyResponse;
}
use of com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse in project cloudbreak by hortonworks.
the class ProxyConfigToProxyResponseConverter method convert.
public ProxyResponse convert(ProxyConfig source) {
ProxyResponse response = new ProxyResponse();
response.setCrn(source.getResourceCrn());
response.setName(source.getName());
response.setDescription(source.getDescription());
response.setProtocol(source.getProtocol());
response.setUserName(stringToSecretResponseConverter.convert(source.getUserNameSecret()));
response.setPassword(stringToSecretResponseConverter.convert(source.getPasswordSecret()));
response.setCreator(source.getCreator());
response.setHost(source.getServerHost());
response.setPort(source.getServerPort());
response.setNoProxyHosts(source.getNoProxyHosts());
return response;
}
use of com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse in project cloudbreak by hortonworks.
the class EnvironmentServiceIntegrationTest method testProxyList.
@Test
public void testProxyList() {
proxyConfigRepository.save(getProxyConfig());
ProxyResponses results = client.proxyV1Endpoint().list();
assertTrue(results.getResponses().stream().anyMatch(proxyResponse -> proxyResponse.getName().equals(getProxyConfig().getName())), String.format("Result set should have proxy with name: %s", getProxyConfig().getName()));
}
use of com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse in project cloudbreak by hortonworks.
the class EnvironmentServiceIntegrationTest method testProxyGetByCrnName.
@Test
public void testProxyGetByCrnName() {
proxyConfigRepository.save(getProxyConfig());
ProxyResponse results = client.proxyV1Endpoint().getByResourceCrn(getProxyConfig().getResourceCrn());
assertTrue(results.getCrn().equals(getProxyConfig().getResourceCrn()), String.format("Result should have proxy with resource crn: %s", getProxyConfig().getResourceCrn()));
}
use of com.sequenceiq.environment.api.v1.proxy.model.response.ProxyResponse in project cloudbreak by hortonworks.
the class EnvironmentServiceIntegrationTest method testProxyDeleteByName.
@Test
public void testProxyDeleteByName() {
proxyConfigRepository.save(getProxyConfig());
ProxyResponse results = client.proxyV1Endpoint().deleteByName(getProxyRequest().getName());
assertTrue(results.getName().equals(getProxyConfig().getName()), String.format("Result should have proxy with name: %s", getProxyConfig().getName()));
}
Aggregations