Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ETSI MEC Sandbox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MEC - Multi-access Edge Computing
ETSI MEC Sandbox
Commits
011d205f
Commit
011d205f
authored
8 months ago
by
Ikram Haq
Browse files
Options
Downloads
Patches
Plain Diff
Add api-invoker-id query parameter functionality
parent
6c1168bd
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Merge CAPIF into MEC Federation branch for ETSI SNS4SNS demo
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go
+18
-3
18 additions, 3 deletions
...pps/meep-app-enablement/server/capif-mgmt/service-mgmt.go
with
18 additions
and
3 deletions
go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go
+
18
−
3
View file @
011d205f
...
...
@@ -616,8 +616,23 @@ func servicesGET(w http.ResponseWriter, r *http.Request) {
mutex
.
Lock
()
defer
mutex
.
Unlock
()
// Validate query parameters
u
,
_
:=
url
.
Parse
(
r
.
URL
.
String
())
q
:=
u
.
Query
()
validParams
:=
[]
string
{
"api-invoker-id"
}
err
:=
validateQueryParams
(
q
,
validParams
)
if
err
!=
nil
{
errHandlerProblemDetails
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
return
}
getServices
(
w
,
r
,
""
)
// Extract and parse query parameters
api_invoker_id
:=
q
.
Get
(
"api-invoker-id"
)
if
api_invoker_id
!=
""
{
getServices
(
w
,
r
,
api_invoker_id
)
}
else
{
getServices
(
w
,
r
,
""
)
}
}
func
applicationsSubscriptionsPOST
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
...
...
@@ -1192,7 +1207,7 @@ func getServices(w http.ResponseWriter, r *http.Request, appId string) {
// Validate query parameters
u
,
_
:=
url
.
Parse
(
r
.
URL
.
String
())
q
:=
u
.
Query
()
validParams
:=
[]
string
{
"vend-spec-etsi-mec-serinstance-id"
,
"api-name"
,
"vend-spec-etsi-mec-sercategory-id"
,
"vend-spec-etsi-mec-consumed-local-only"
,
"vend-spec-etsi-mec-is-local"
,
"vend-spec-etsi-mec-scope-of-locality"
}
validParams
:=
[]
string
{
"api-invoker-id"
,
"vend-spec-etsi-mec-serinstance-id"
,
"api-name"
,
"vend-spec-etsi-mec-sercategory-id"
,
"vend-spec-etsi-mec-consumed-local-only"
,
"vend-spec-etsi-mec-is-local"
,
"vend-spec-etsi-mec-scope-of-locality"
}
err
:=
validateQueryParams
(
q
,
validParams
)
if
err
!=
nil
{
errHandlerProblemDetails
(
w
,
err
.
Error
(),
http
.
StatusBadRequest
)
...
...
@@ -1320,7 +1335,7 @@ func getServices(w http.ResponseWriter, r *http.Request, appId string) {
for
_
,
service
:=
range
sInfoList
.
Services
{
aefProfile
:=
AefProfile
{
AefId
:
service
.
TransportInfo
.
Id
,
Versions
:
[]
string
{
service
.
Version
},
// Assuming service.Version is a string, wrap it in a slice
Versions
:
[]
string
{
service
.
Version
},
InterfaceDescriptions
:
service
.
TransportInfo
.
Endpoint
,
VendorSpecificUrnetsimeccapifexttransportInfo
:
&
MecTransportInfoCapifExt
{
Name
:
service
.
TransportInfo
.
Name
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment