use of com.sequenceiq.cloudbreak.api.model.UpdateClusterJson in project cloudbreak by hortonworks.
the class StackAndClusterStartTest method testStackAndClusterStart.
@Test
@Parameters("waitOn")
public void testStackAndClusterStart(@Optional(NOWAIT) Boolean waitOn) {
// GIVEN
IntegrationTestContext itContext = getItContext();
String stackId = itContext.getContextParam(CloudbreakITContextConstants.STACK_ID);
Integer stackIntId = Integer.valueOf(stackId);
String ambariUser = itContext.getContextParam(CloudbreakITContextConstants.AMBARI_USER_ID);
String ambariPassword = itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID);
String ambariPort = itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PORT_ID);
// WHEN
UpdateStackJson updateStackJson = new UpdateStackJson();
updateStackJson.setStatus(StatusRequest.valueOf(STARTED));
CloudbreakUtil.checkResponse("StartStack", getCloudbreakClient().stackV1Endpoint().put(Long.valueOf(stackIntId), updateStackJson));
if (Boolean.TRUE.equals(waitOn)) {
CloudbreakUtil.waitAndCheckStackStatus(getCloudbreakClient(), stackId, "AVAILABLE");
}
UpdateClusterJson updateClusterJson = new UpdateClusterJson();
updateClusterJson.setStatus(StatusRequest.valueOf(STARTED));
CloudbreakUtil.checkResponse("StartCluster", getCloudbreakClient().clusterEndpoint().put(Long.valueOf(stackIntId), updateClusterJson));
CloudbreakUtil.waitAndCheckClusterStatus(getCloudbreakClient(), stackId, "AVAILABLE");
// THEN
CloudbreakUtil.checkClusterAvailability(getCloudbreakClient().stackV1Endpoint(), ambariPort, stackId, ambariUser, ambariPassword, true);
}
use of com.sequenceiq.cloudbreak.api.model.UpdateClusterJson in project cloudbreak by hortonworks.
the class ClusterAndStackStopTest method testClusterAndStackStop.
@Test
@Parameters("waitOn")
public void testClusterAndStackStop(@Optional(NOWAIT) Boolean waitOn) {
// GIVEN
IntegrationTestContext itContext = getItContext();
String stackId = itContext.getContextParam(CloudbreakITContextConstants.STACK_ID);
Integer stackIntId = Integer.valueOf(stackId);
String ambariUser = itContext.getContextParam(CloudbreakITContextConstants.AMBARI_USER_ID);
String ambariPassword = itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID);
String ambariPort = itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PORT_ID);
// WHEN
UpdateClusterJson updateClusterJson = new UpdateClusterJson();
updateClusterJson.setStatus(StatusRequest.valueOf(STOPPED));
CloudbreakUtil.checkResponse("StopCluster", getCloudbreakClient().clusterEndpoint().put(Long.valueOf(stackIntId), updateClusterJson));
if (Boolean.TRUE.equals(waitOn)) {
CloudbreakUtil.waitAndCheckClusterStatus(getCloudbreakClient(), stackId, STOPPED);
}
UpdateStackJson updateStackJson = new UpdateStackJson();
updateStackJson.setStatus(StatusRequest.valueOf(STOPPED));
CloudbreakUtil.checkResponse("StopStack", getCloudbreakClient().stackV1Endpoint().put(Long.valueOf(stackIntId), updateStackJson));
CloudbreakUtil.waitAndCheckStackStatus(getCloudbreakClient(), stackId, STOPPED);
// THEN
CloudbreakUtil.checkClusterStopped(getCloudbreakClient().stackV1Endpoint(), ambariPort, stackId, ambariUser, ambariPassword);
}
use of com.sequenceiq.cloudbreak.api.model.UpdateClusterJson in project cloudbreak by hortonworks.
the class ClusterStartTest method testClusterStart.
@Test
public void testClusterStart() {
// GIVEN
IntegrationTestContext itContext = getItContext();
String stackId = itContext.getContextParam(CloudbreakITContextConstants.STACK_ID);
Integer stackIntId = Integer.valueOf(stackId);
String ambariUser = itContext.getContextParam(CloudbreakITContextConstants.AMBARI_USER_ID);
String ambariPassword = itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PASSWORD_ID);
String ambariPort = itContext.getContextParam(CloudbreakITContextConstants.AMBARI_PORT_ID);
// WHEN
UpdateClusterJson updateClusterJson = new UpdateClusterJson();
updateClusterJson.setStatus(StatusRequest.valueOf(STARTED));
CloudbreakUtil.checkResponse("StartCluster", getCloudbreakClient().clusterEndpoint().put(Long.valueOf(stackIntId), updateClusterJson));
CloudbreakUtil.waitAndCheckClusterStatus(getCloudbreakClient(), stackId, "AVAILABLE");
// THEN
CloudbreakUtil.checkClusterAvailability(getCloudbreakClient().stackV1Endpoint(), ambariPort, stackId, ambariUser, ambariPassword, true);
}
use of com.sequenceiq.cloudbreak.api.model.UpdateClusterJson in project cloudbreak by hortonworks.
the class ClusterStopTest method testClusterStop.
@Test
public void testClusterStop() {
// GIVEN
IntegrationTestContext itContext = getItContext();
String stackId = itContext.getContextParam(CloudbreakITContextConstants.STACK_ID);
Integer stackIntId = Integer.valueOf(stackId);
// WHEN
UpdateClusterJson updateClusterJson = new UpdateClusterJson();
updateClusterJson.setStatus(StatusRequest.valueOf(STOPPED));
CloudbreakUtil.checkResponse("StopCluster", getCloudbreakClient().clusterEndpoint().put(Long.valueOf(stackIntId), updateClusterJson));
CloudbreakUtil.waitAndCheckClusterStatus(getCloudbreakClient(), stackId, STOPPED);
// THEN
}
use of com.sequenceiq.cloudbreak.api.model.UpdateClusterJson in project cloudbreak by hortonworks.
the class StackV2Controller method putPassword.
@Override
public Response putPassword(String name, UserNamePasswordJson userNamePasswordJson) {
IdentityUser user = authenticatedUserService.getCbUser();
Stack stack = stackService.getPublicStack(name, user);
UpdateClusterJson updateClusterJson = conversionService.convert(userNamePasswordJson, UpdateClusterJson.class);
return clusterCommonController.put(stack.getId(), updateClusterJson);
}
Aggregations