use of com.amazonaws.services.ec2.model.StartInstancesRequest in project openvidu-loadtest by OpenVidu.
the class Ec2Client method startInstances.
public void startInstances(List<String> instanceIds) {
if (instanceIds.size() > 0) {
StartInstancesRequest request = new StartInstancesRequest().withInstanceIds(instanceIds);
ec2.startInstances(request);
log.info("Instance {} is being starting", instanceIds);
// Avoided start test before start instances
sleep(WAIT_RUNNING_STATE_MS);
}
}
use of com.amazonaws.services.ec2.model.StartInstancesRequest in project prompto-platform by prompto.
the class EC2 method startInstance.
public void startInstance(String instanceId) {
StartInstancesRequest startRequest = StartInstancesRequest.builder().instanceIds(instanceId).build();
ec2.startInstances(startRequest);
}
use of com.amazonaws.services.ec2.model.StartInstancesRequest in project aws-sdk-android by aws-amplify.
the class StartInstancesRequest method getDryRunRequest.
/**
* This method is intended for internal use only.
* Returns the marshaled request configured with additional parameters to
* enable operation dry-run.
*/
@Override
public Request<StartInstancesRequest> getDryRunRequest() {
Request<StartInstancesRequest> request = new StartInstancesRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
}
use of com.amazonaws.services.ec2.model.StartInstancesRequest in project onebusaway-application-modules by camsys.
the class BundleServerServiceImpl method start.
@Override
public String start(String instanceId) {
if (!_isAws) {
return LOCAL_HOST;
}
if (LOCAL_HOST.equalsIgnoreCase(instanceId)) {
return instanceId;
}
List<String> instances = new ArrayList<String>();
instances.add(instanceId);
StartInstancesRequest startInstancesRequest = new StartInstancesRequest(instances);
StartInstancesResult startInstancesResult = _ec2.startInstances(startInstancesRequest);
InstanceStateChange change = null;
if (!startInstancesResult.getStartingInstances().isEmpty()) {
change = startInstancesResult.getStartingInstances().get(0);
_log.info("from state=" + change.getPreviousState() + " to state=" + change.getCurrentState());
return change.getInstanceId();
}
return null;
}
Aggregations