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
d4c8cef3
Commit
d4c8cef3
authored
8 months ago
by
Ikram Haq
Browse files
Options
Downloads
Patches
Plain Diff
Implement logic to retrieves information about a mecService resource via CAPIF
parent
752196ee
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
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go
+38
-20
38 additions, 20 deletions
...pps/meep-app-enablement/server/capif-mgmt/service-mgmt.go
go-apps/meep-app-enablement/server/routers.go
+7
-0
7 additions, 0 deletions
go-apps/meep-app-enablement/server/routers.go
with
45 additions
and
20 deletions
go-apps/meep-app-enablement/server/capif-mgmt/service-mgmt.go
+
38
−
20
View file @
d4c8cef3
...
...
@@ -253,9 +253,6 @@ func appServicesPOST(w http.ResponseWriter, r *http.Request) {
IsLocal
:
true
,
ConsumedLocalOnly
:
true
,
},
// ScopeOfLocality: &locality,
// IsLocal: true,
// ConsumedLocalOnly: true,
}
decoder
:=
json
.
NewDecoder
(
r
.
Body
)
err
=
decoder
.
Decode
(
&
sInfoPost
)
...
...
@@ -363,12 +360,12 @@ func appServicesPOST(w http.ResponseWriter, r *http.Request) {
}
transportInfo_
:=
TransportInfo
{
Id
:
sInfoPost
.
AefProfiles
[
0
]
.
AefId
,
// Set this appropriately or generate it
Id
:
sInfoPost
.
AefProfiles
[
0
]
.
AefId
,
Name
:
sInfoPost
.
AefProfiles
[
0
]
.
VendorSpecificUrnetsimeccapifexttransportInfo
.
Name
,
Type_
:
sInfoPost
.
AefProfiles
[
0
]
.
VendorSpecificUrnetsimeccapifexttransportInfo
.
Type_
,
Protocol
:
sInfoPost
.
AefProfiles
[
0
]
.
VendorSpecificUrnetsimeccapifexttransportInfo
.
Protocol
,
Version
:
sInfoPost
.
AefProfiles
[
0
]
.
VendorSpecificUrnetsimeccapifexttransportInfo
.
Version
,
Endpoint
:
sInfoPost
.
AefProfiles
[
0
]
.
InterfaceDescriptions
,
// Set the endpoint as required
Endpoint
:
sInfoPost
.
AefProfiles
[
0
]
.
InterfaceDescriptions
,
Security
:
sInfoPost
.
AefProfiles
[
0
]
.
VendorSpecificUrnetsimeccapifexttransportInfo
.
Security
,
}
...
...
@@ -383,9 +380,8 @@ func appServicesPOST(w http.ResponseWriter, r *http.Request) {
Serializer
:
dsInfo
.
VendorSpecificUrnetsimeccapifextserviceInfo
.
Serializer
,
ScopeOfLocality
:
dsInfo
.
VendorSpecificUrnetsimeccapifextserviceInfo
.
ScopeOfLocality
,
ConsumedLocalOnly
:
dsInfo
.
VendorSpecificUrnetsimeccapifextserviceInfo
.
ConsumedLocalOnly
,
// although IsLocal is reevaluated when a query is replied to, value stored in sInfo as is for now
IsLocal
:
dsInfo
.
VendorSpecificUrnetsimeccapifextserviceInfo
.
IsLocal
,
LivenessInterval
:
0
,
IsLocal
:
dsInfo
.
VendorSpecificUrnetsimeccapifextserviceInfo
.
IsLocal
,
LivenessInterval
:
0
,
}
sInfo
.
Links
=
&
ServiceInfoLinks
{
Self
:
&
LinkType
{
...
...
@@ -615,8 +611,8 @@ func appServicesByIdGET(w http.ResponseWriter, r *http.Request) {
log
.
Info
(
"appServicesByIdGET"
)
w
.
Header
()
.
Set
(
"Content-Type"
,
"application/json; charset=UTF-8"
)
vars
:=
mux
.
Vars
(
r
)
svcId
:=
vars
[
"serviceId"
]
appId
:=
vars
[
"ap
pInstance
Id"
]
svcId
:=
vars
[
"service
Api
Id"
]
appId
:=
vars
[
"ap
f
Id"
]
mutex
.
Lock
()
defer
mutex
.
Unlock
()
...
...
@@ -1273,15 +1269,6 @@ func getServices(w http.ResponseWriter, r *http.Request, appId string) {
}
serName
:=
q
[
"api-name"
]
// var serName []string
// if serNameParam != "" {
// parsedParam, err := parseJSONQueryParam(serNameParam)
// if err != nil {
// errHandlerProblemDetails(w, "Invalid JSON in ser_name", http.StatusBadRequest)
// return
// }
// serName = append(serName, parsedParam.Value)
// }
serCategoryIdParam
:=
q
.
Get
(
"vend-spec-etsi-mec-sercategory-id"
)
var
serCategoryId
string
...
...
@@ -1450,8 +1437,39 @@ func getService(w http.ResponseWriter, r *http.Request, appId string, serviceId
return
}
// Map ServiceInfoList to ServiceApiDescription list
serviceApiDescriptions
:=
make
([]
ServiceApiDescription
,
0
)
for
_
,
service
:=
range
sInfoList
.
Services
{
aefProfile
:=
AefProfile
{
AefId
:
service
.
TransportInfo
.
Id
,
Versions
:
[]
string
{
service
.
Version
},
InterfaceDescriptions
:
service
.
TransportInfo
.
Endpoint
,
VendorSpecificUrnetsimeccapifexttransportInfo
:
&
MecTransportInfoCapifExt
{
Name
:
service
.
TransportInfo
.
Name
,
Type_
:
service
.
TransportInfo
.
Type_
,
Protocol
:
service
.
TransportInfo
.
Protocol
,
Version
:
service
.
TransportInfo
.
Version
,
Security
:
service
.
TransportInfo
.
Security
,
},
}
apiDesc
:=
ServiceApiDescription
{
ApiName
:
service
.
SerName
,
ApiId
:
service
.
SerInstanceId
,
AefProfiles
:
[]
AefProfile
{
aefProfile
},
VendorSpecificUrnetsimeccapifextserviceInfo
:
&
MecServiceInfoCapifExt
{
Serializer
:
service
.
Serializer
,
State
:
service
.
State
,
ScopeOfLocality
:
service
.
ScopeOfLocality
,
ConsumedLocalOnly
:
service
.
ConsumedLocalOnly
,
IsLocal
:
service
.
IsLocal
,
Category
:
service
.
SerCategory
,
},
}
serviceApiDescriptions
=
append
(
serviceApiDescriptions
,
apiDesc
)
}
// Prepare & send response
jsonResponse
,
err
:=
json
.
Marshal
(
s
InfoList
.
Services
[
0
]
)
jsonResponse
,
err
:=
json
.
Marshal
(
s
erviceApiDescriptions
)
if
err
!=
nil
{
log
.
Error
(
err
.
Error
())
errHandlerProblemDetails
(
w
,
err
.
Error
(),
http
.
StatusInternalServerError
)
...
...
This diff is collapsed.
Click to expand it.
go-apps/meep-app-enablement/server/routers.go
+
7
−
0
View file @
d4c8cef3
...
...
@@ -357,6 +357,13 @@ var routes = Routes{
capifMgmt
.
AppServicesPOST
,
},
Route
{
"AppServicesServiceIdGET"
,
strings
.
ToUpper
(
"Get"
),
"/published-apis/v1/{apfId}/service-apis/{serviceId}"
,
capifMgmt
.
AppServicesServiceIdGET
,
},
Route
{
"Index"
,
"GET"
,
...
...
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