From 4647e3ef6c87e271794e06fb1660cad5ee72ab04 Mon Sep 17 00:00:00 2001 From: Abhishek Patil Date: Fri, 31 Mar 2023 10:39:46 +0530 Subject: Code changes in SO api-handler for RAN Slice Issue-ID: SO-4038 Change-Id: Ifad4e0a65dc810a753d30741a84c08081bcfd258 Signed-off-by: Patil --- .../org/onap/aaiclient/client/aai/AAIRestClientImpl.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'graph-inventory') diff --git a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIRestClientImpl.java b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIRestClientImpl.java index bf9ad56da7..03260dbfae 100644 --- a/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIRestClientImpl.java +++ b/graph-inventory/aai-client/src/main/java/org/onap/aaiclient/client/aai/AAIRestClientImpl.java @@ -36,6 +36,7 @@ import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri; import org.onap.aaiclient.client.aai.entities.uri.AAIUriFactory; import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder; import org.onap.aaiclient.client.graphinventory.Format; +import org.onap.aaiclient.client.graphinventory.entities.uri.Depth; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import com.fasterxml.jackson.core.type.TypeReference; @@ -114,6 +115,17 @@ public class AAIRestClientImpl implements AAIRestClientI { return Optional.ofNullable(response.readEntity(ServiceInstance.class)); } + public Optional getServiceInstanceByIdWithDepth(String serviceInstanceId, String serviceType, + String globalSubscriberId) { + Response response = + new AAIResourcesClient() + .getFullResponse(AAIUriFactory + .createResourceUri(AAIFluentTypeBuilder.business().customer(globalSubscriberId) + .serviceSubscription(serviceType).serviceInstance(serviceInstanceId)) + .depth(Depth.ALL)); + return Optional.ofNullable(response.readEntity(ServiceInstance.class)); + } + @Override public void updateServiceInstance(String serviceInstanceId, String serviceType, String globalSubscriberId, ServiceInstance serviceInstance) { -- cgit 1.2.3-korg