use of com.sequenceiq.periscope.api.endpoint.v1.AutoScaleClusterV1Endpoint in project cloudbreak by hortonworks.
the class AutoscalingUtil method getPeriscopeClusterId.
static long getPeriscopeClusterId(AutoscaleClient autoscaleClient, String stackId) {
Long clusterId = null;
int retryCount = 0;
AutoScaleClusterV1Endpoint autoScaleClusterV1Endpoint = autoscaleClient.clusterEndpoint();
while (clusterId == null && retryCount < 30) {
LOGGER.info("Waiting for having Prometheus cluster id ...");
CloudbreakUtil.sleep();
List<AutoscaleClusterResponse> autoscaleClusterResponse = autoScaleClusterV1Endpoint.getClusters();
for (AutoscaleClusterResponse elem : autoscaleClusterResponse) {
if (String.valueOf(elem.getStackId()).equals(stackId)) {
clusterId = elem.getId();
}
}
retryCount += 1;
}
Assert.assertNotNull(clusterId);
return clusterId;
}
use of com.sequenceiq.periscope.api.endpoint.v1.AutoScaleClusterV1Endpoint in project cloudbreak by hortonworks.
the class AutoscalingUtil method switchAutoscaling.
static void switchAutoscaling(AutoscaleClient autoscaleClient, Long clusterId, boolean enableAutoscaling) {
AutoScaleClusterV1Endpoint autoScaleClusterV1Endpoint = autoscaleClient.clusterEndpoint();
AutoscaleClusterState json = new AutoscaleClusterState();
json.setEnableAutoscaling(enableAutoscaling);
autoScaleClusterV1Endpoint.setAutoscaleState(clusterId, json);
}
Aggregations