use of alien4cloud.paas.model.InstanceStatus in project yorc-a4c-plugin by ystia.
the class YorcPaaSProvider method updateInstanceState.
/**
* Update Instance State and notify alien4cloud if needed
* @param paasId Deployment PaaS Id
* @param nodeId
* @param instanceId
* @param iinfo
* @param state
*/
public void updateInstanceState(String paasId, String nodeId, String instanceId, InstanceInformation iinfo, String state) {
log.debug("paasId=" + paasId + " : set instance state: " + instanceId + "=" + state);
// update InstanceInformation
InstanceStatus status = getInstanceStatusFromState(state);
iinfo.setState(state);
iinfo.setInstanceStatus(status);
// Notify a4c
PaaSInstanceStateMonitorEvent event = new PaaSInstanceStateMonitorEvent();
event.setInstanceId(instanceId);
event.setInstanceState(state);
event.setInstanceStatus(status);
event.setNodeTemplateId(nodeId);
event.setRuntimeProperties(iinfo.getRuntimeProperties());
event.setAttributes(iinfo.getAttributes());
postEvent(event, paasId);
}
Aggregations