@RequestMapping(value = {"/uui-lcm/services/{serviceId}/operations/{operationId}"}, method = RequestMethod.GET , produces = "application/json")
public OperationProgressInformation queryOperationProgress(@PathVariable(value="serviceId") String serviceId, @PathVariable(value="operationId") String operationId){
OperationProgressInformation operationProgressInformation =serviceLcmService.queryOperationProgress(serviceId, operationId);
- serviceLcmService.updateServiceInstanceStatusById(operationProgressInformation.getOperationStatus().getResult(), serviceId);
+ if(UuiCommonUtil.isNotNullOrEmpty(operationProgressInformation)&&UuiCommonUtil.isNotNullOrEmpty(operationProgressInformation.getOperationStatus())){
+ serviceLcmService.updateServiceInstanceStatusById(operationProgressInformation.getOperationStatus().getResult(), serviceId);
+ }
return operationProgressInformation;
}
@JsonIgnoreProperties(ignoreUnknown=true)
public class OperationProgress {
-
+
+ private String serviceId;
+
private String operationId;
+
+ private String serviceName;
private String operation;
private String finishedAt;
- public String getOperationId() {
+
+
+ public OperationProgress(String serviceId, String operationId, String serviceName, String operation, String result,
+ String reason, String userId, String operationContent, int progress, String operateAt, String finishedAt) {
+ this.serviceId = serviceId;
+ this.operationId = operationId;
+ this.serviceName = serviceName;
+ this.operation = operation;
+ this.result = result;
+ this.reason = reason;
+ this.userId = userId;
+ this.operationContent = operationContent;
+ this.progress = progress;
+ this.operateAt = operateAt;
+ this.finishedAt = finishedAt;
+ }
+
+ public OperationProgress() {
+ }
+
+ public String getOperationId() {
return operationId;
}
- public void setOperationId(String operationId) {
+ public void setOperationId(String operationId) {
this.operationId = operationId;
}
public void setFinishedAt(String finishedAt) {
this.finishedAt = finishedAt;
}
+
+ public String getServiceId() {
+ return serviceId;
+ }
+
+ public void setServiceId(String serviceId) {
+ this.serviceId = serviceId;
+ }
+
+ public String getServiceName() {
+ return serviceName;
+ }
+
+ public void setServiceName(String serviceName) {
+ this.serviceName = serviceName;
+ }
+
}
package org.onap.usecaseui.server.service.lcm.domain.so.bean;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import com.fasterxml.jackson.annotation.JsonProperty;
@JsonIgnoreProperties(ignoreUnknown=true)
public class OperationProgressInformation {
-
+
private OperationProgress operationStatus;
+
+ public OperationProgressInformation(@JsonProperty("operation")OperationProgress operationStatus) {
+ this.operationStatus = operationStatus;
+ }
+
+ public OperationProgressInformation() {
+ }
- public OperationProgress getOperationStatus() {
+ public OperationProgress getOperationStatus() {
return operationStatus;
}