Search in sources :

Example 1 with InstanceStatus

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);
}
Also used : PaaSInstanceStateMonitorEvent(alien4cloud.paas.model.PaaSInstanceStateMonitorEvent) InstanceStatus(alien4cloud.paas.model.InstanceStatus)

Aggregations

InstanceStatus (alien4cloud.paas.model.InstanceStatus)1 PaaSInstanceStateMonitorEvent (alien4cloud.paas.model.PaaSInstanceStateMonitorEvent)1