diff options
Diffstat (limited to 'so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/service/statuscheck/SimpleStatusCheckService.java')
-rw-r--r-- | so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/service/statuscheck/SimpleStatusCheckService.java | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/service/statuscheck/SimpleStatusCheckService.java b/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/service/statuscheck/SimpleStatusCheckService.java index 510d6b8..7e750a9 100644 --- a/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/service/statuscheck/SimpleStatusCheckService.java +++ b/so-cnf-adapter-application/src/main/java/org/onap/so/adapters/cnf/service/statuscheck/SimpleStatusCheckService.java @@ -1,3 +1,24 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2021 Samsung Electronics Co. Ltd. All rights reserved. + * Modifications Copyright (C) 2021 Orange. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + package org.onap.so.adapters.cnf.service.statuscheck; import org.onap.so.adapters.cnf.client.MulticloudClient; @@ -41,6 +62,20 @@ public class SimpleStatusCheckService { return result; } + public StatusCheckResponse statusCheckError(CheckInstanceRequest instanceIds, Exception e) { + StatusCheckResponse result = new StatusCheckResponse(); + + List<StatusCheckInstanceResponse> simpleStatuses = new ArrayList<>(); + for (InstanceRequest instanceRequest : instanceIds.getInstances()) { + StatusCheckInstanceResponse statusCheck = new StatusCheckInstanceResponse( + instanceRequest.getInstanceId(), e.getMessage(), false); + simpleStatuses.add(statusCheck); + } + + result.setInstanceResponse(simpleStatuses); + return result; + } + private StatusCheckInstanceResponse getStatusCheck(String instanceId) throws BadResponseException { log.debug("SIMPLE STATUS CHECK - START"); K8sRbInstanceStatus instanceStatus = instanceApi.getInstanceStatus(instanceId); |