diff options
author | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-03-13 15:43:33 -0400 |
---|---|---|
committer | Benjamin, Max (mb388a) <mb388a@us.att.com> | 2019-03-13 16:04:51 -0400 |
commit | 88953d4f6c0ae360e6fb5d6967fc71dcc3652b4a (patch) | |
tree | 91d6e1d0c5d833fbf96f1feac2a9b49a73755c40 /mso-api-handlers/mso-api-handler-infra/src/main | |
parent | 7321d01bda3524066d5a76276a4511554b7a4062 (diff) |
Added param requestId to query 1 row
Added param requestId to uniquely query 1 row from model distribution
status db.
Change-Id: Ice8db174166e6a00d211f191dcf5537eef729127
Issue-ID: SO-1651
Signed-off-by: Benjamin, Max (mb388a) <mb388a@us.att.com>
Diffstat (limited to 'mso-api-handlers/mso-api-handler-infra/src/main')
2 files changed, 14 insertions, 13 deletions
diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java index 31c65e1bd2..9303e12071 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/helpers/SDCClientHelper.java @@ -82,7 +82,6 @@ public class SDCClientHelper { try { String urlString = this.buildUriBuilder(serviceModelVersionId, operationalEnvironmentId); - logger.debug("Url ASDC Activate request: {}", urlString); String jsonPayload = this.buildJsonWorkloadContext(workloadContext); String basicAuthCred = getBasicAuth(); @@ -158,7 +157,6 @@ public class SDCClientHelper { enhancedAsdcResponseJsonObj.put("statusCode", Integer.toString(statusCode)); enhancedAsdcResponseJsonObj.put("messageId", ""); enhancedAsdcResponseJsonObj.put("message", "Success"); - logger.debug("Url ASDC Activate response: {} {}", "distributionId ", sdcResponseJsonObj.get("distributionId")); } else { // error if (sdcResponseJsonObj.has("requestError") ) { diff --git a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java index 219a2efcac..352bf8fb0b 100644 --- a/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java +++ b/mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/process/ActivateVnfStatusOperationalEnvironment.java @@ -86,26 +86,31 @@ public class ActivateVnfStatusOperationalEnvironment { */ public void execute(String requestId, CloudOrchestrationRequest request) throws ApiException { - - String operationalEnvironmentId = ""; + try { + + String operationalEnvironmentId = ""; String sdcDistributionId = request.getDistributionId(); Distribution sdcStatus = request.getDistribution(); - // Distribution, Query for operationalEnvironmentId, serviceModelVersionId + // Distribution, Query for operationalEnvironmentId, serviceModelVersionId, origRequestId this.queryDistributionDbResponse = client.getDistributionStatusById(sdcDistributionId); operationalEnvironmentId = this.queryDistributionDbResponse.getOperationalEnvId(); + this.origRequestId = this.queryDistributionDbResponse.getRequestId(); - // ServiceModel, Query for dbRequestId, recoveryAction, retryCountString - this.queryServiceModelResponse = client.findOneByOperationalEnvIdAndServiceModelVersionId(operationalEnvironmentId, queryDistributionDbResponse.getServiceModelVersionId()); - this.origRequestId = this.queryServiceModelResponse.getRequestId(); - + // ServiceModel, Query for recoveryAction, retryCountString + this.queryServiceModelResponse = client.findOneByOperationalEnvIdAndServiceModelVersionIdAndRequestId(operationalEnvironmentId, queryDistributionDbResponse.getServiceModelVersionId(), this.origRequestId); + processActivateSDCStatus(sdcDistributionId, sdcStatus, this.queryDistributionDbResponse, this.queryServiceModelResponse); // After EVERY status processed, need to query the status of all service modelId // to determine the OVERALL status if "COMPLETE" or "FAILURE": checkOrUpdateOverallStatus(operationalEnvironmentId, this.origRequestId); - + + } catch(Exception e) { + requestDb.updateInfraFailureCompletion(e.getMessage(), this.origRequestId, this.queryDistributionDbResponse.getOperationalEnvId()); + } + } /** @@ -161,13 +166,11 @@ public class ActivateVnfStatusOperationalEnvironment { } sdcStatusValue = modifiedStatus; - // should update 1 row, modified status & retryCount set 0 OperationalEnvServiceModelStatus updateRetryCountZeroAndStatus = dbHelper.updateRetryCountAndStatusInOperationalEnvServiceModelStatus(queryServiceModelResponse, modifiedStatus, - RETRY_COUNT_ZERO); + RETRY_COUNT_ZERO); client.save(updateRetryCountZeroAndStatus); - // should update 1 row, modified status OperationalEnvDistributionStatus updateDistStatus = dbHelper.updateStatusInOperationalEnvDistributionStatus(queryDistributionDbResponse, modifiedStatus, |