Search in sources :

Example 1 with SecurityGroupEndpoint

use of com.sequenceiq.cloudbreak.api.endpoint.v1.SecurityGroupEndpoint in project cloudbreak by hortonworks.

the class CleanupService method deleteSecurityGroup.

public void deleteSecurityGroup(CloudbreakClient cloudbreakClient, String securityGroupId) {
    if (securityGroupId != null) {
        SecurityGroupEndpoint securityGroupEndpoint = cloudbreakClient.securityGroupEndpoint();
        SecurityGroupResponse securityGroupResponse = securityGroupEndpoint.get(Long.valueOf(securityGroupId));
        if (!itProps.isDefaultSecurityGroup(securityGroupResponse.getName())) {
            securityGroupEndpoint.delete(Long.valueOf(securityGroupId));
        }
    }
}
Also used : SecurityGroupResponse(com.sequenceiq.cloudbreak.api.model.SecurityGroupResponse) SecurityGroupEndpoint(com.sequenceiq.cloudbreak.api.endpoint.v1.SecurityGroupEndpoint)

Aggregations

SecurityGroupEndpoint (com.sequenceiq.cloudbreak.api.endpoint.v1.SecurityGroupEndpoint)1 SecurityGroupResponse (com.sequenceiq.cloudbreak.api.model.SecurityGroupResponse)1