X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=capifcore%2Finternal%2Fdiscoverservice%2Fdiscoverservice.go;h=82b59725b075211c3c617d7dcc2a5a219ce792a3;hb=HEAD;hp=4ab8a92c66fa0468285959e10725292875ef77fd;hpb=712247934a771ca533b0febcca4b2702225b17cb;p=nonrtric%2Fplt%2Fsme.git diff --git a/capifcore/internal/discoverservice/discoverservice.go b/capifcore/internal/discoverservice/discoverservice.go index 4ab8a92..82b5972 100644 --- a/capifcore/internal/discoverservice/discoverservice.go +++ b/capifcore/internal/discoverservice/discoverservice.go @@ -3,6 +3,7 @@ // O-RAN-SC // %% // Copyright (C) 2022: Nordix Foundation +// Copyright (C) 2023: OpenInfra Foundation Europe. // %% // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. @@ -21,6 +22,7 @@ package discoverservice import ( + "fmt" "net/http" "oransc.org/nonrtric/capifcore/internal/common29122" @@ -45,20 +47,14 @@ func NewDiscoverService(invokerRegister invokermanagement.InvokerRegister) *Disc func (ds *DiscoverService) GetAllServiceAPIs(ctx echo.Context, params discoverapi.GetAllServiceAPIsParams) error { allApis := ds.invokerRegister.GetInvokerApiList(params.ApiInvokerId) if allApis == nil { - return sendCoreError(ctx, http.StatusNotFound, "Invoker not registered") + return sendCoreError(ctx, http.StatusNotFound, fmt.Sprintf("Invoker %s not registered", params.ApiInvokerId)) } + filteredApis := []publishapi.ServiceAPIDescription{} - gatewayDomain := "r1-expo-func-aef" for _, api := range *allApis { - if !matchesFilter(api, params) { - continue - } - profiles := *api.AefProfiles - for i, profile := range profiles { - profile.DomainName = &gatewayDomain // Hardcoded for now. Should be provided through some other mechanism. - profiles[i] = profile + if matchesFilter(api, params) { + filteredApis = append(filteredApis, api) } - filteredApis = append(filteredApis, api) } discoveredApis := discoverapi.DiscoveredAPIs{ ServiceAPIDescriptions: &filteredApis,