use of com.sequenceiq.cloudbreak.domain.Network in project cloudbreak by hortonworks.
the class StackToStackResponseConverterTest method createSource.
@Override
public Stack createSource() {
Stack stack = TestUtil.stack();
Cluster cluster = TestUtil.cluster(TestUtil.blueprint(), stack, 1L);
stack.setCluster(cluster);
stack.setAvailabilityZone("avZone");
Network network = new Network();
network.setId(1L);
stack.setNetwork(network);
stack.setFailurePolicy(new FailurePolicy());
Orchestrator orchestrator = new Orchestrator();
orchestrator.setId(1L);
orchestrator.setApiEndpoint("endpoint");
orchestrator.setType("type");
stack.setOrchestrator(orchestrator);
stack.setParameters(new HashMap<>());
stack.setCloudPlatform("OPENSTACK");
stack.setGatewayPort(9443);
stack.setCustomDomain("custom.domain");
stack.setCustomHostname("hostname");
stack.setStackAuthentication(new StackAuthentication());
stack.getStackAuthentication().setPublicKey("rsakey");
stack.getStackAuthentication().setLoginUserName("cloudbreak");
stack.setHostgroupNameAsHostname(false);
stack.setClusterNameAsSubdomain(false);
Resource s3ArnResource = new Resource(ResourceType.S3_ACCESS_ROLE_ARN, "s3Arn", stack);
stack.setResources(Collections.singleton(s3ArnResource));
return stack;
}
use of com.sequenceiq.cloudbreak.domain.Network in project cloudbreak by hortonworks.
the class NetworkController method convert.
private Network convert(NetworkRequest networkRequest, boolean publicInAccount) {
Network network = conversionService.convert(networkRequest, Network.class);
network.setPublicInAccount(publicInAccount);
return network;
}
use of com.sequenceiq.cloudbreak.domain.Network in project cloudbreak by hortonworks.
the class NetworkController method getPublic.
@Override
public NetworkResponse getPublic(String name) {
IdentityUser user = authenticatedUserService.getCbUser();
Network network = networkService.getPublicNetwork(name, user);
return convert(network);
}
use of com.sequenceiq.cloudbreak.domain.Network in project cloudbreak by hortonworks.
the class NetworkController method createNetwork.
private NetworkResponse createNetwork(IdentityUser user, NetworkRequest networkRequest, boolean publicInAccount) {
Network network = convert(networkRequest, publicInAccount);
network = networkService.create(user, network);
notify(user, ResourceEvent.NETWORK_CREATED);
return conversionService.convert(network, NetworkResponse.class);
}
use of com.sequenceiq.cloudbreak.domain.Network in project cloudbreak by hortonworks.
the class TestUtil method network.
public static Network network(String subnet) {
Network network = new Network();
network.setSubnetCIDR(subnet);
// network.setAddressPrefixCIDR(DUMMY_ADDRESS_PREFIX_CIDR);
network.setId(1L);
network.setName(DUMMY_NAME);
return network;
}
Aggregations