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
cce416a9
Commit
cce416a9
authored
6 months ago
by
Ikram Haq
Browse files
Options
Downloads
Patches
Plain Diff
Add appProfile attributes functionality in PUT method
parent
31b3e219
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/app-support/app-support.go
+39
-0
39 additions, 0 deletions
...pps/meep-app-enablement/server/app-support/app-support.go
with
39 additions
and
0 deletions
go-apps/meep-app-enablement/server/app-support/app-support.go
+
39
−
0
View file @
cce416a9
...
...
@@ -704,6 +704,17 @@ func appRegistrationPOST(w http.ResponseWriter, r *http.Request) {
}
}
if
appInfo
.
AppProfile
.
EasId
==
""
{
log
.
Error
(
"Mandatory easId parameter should be present"
)
errHandlerProblemDetails
(
w
,
"Mandatory attribute easId is missing in the request body."
,
http
.
StatusBadRequest
)
return
}
if
appInfo
.
AppName
!=
appInfo
.
AppProfile
.
EasId
{
log
.
Error
(
"AppName in AppInfo does not match EasId in appProfile"
)
errHandlerProblemDetails
(
w
,
"AppName and EasId must be consistent"
,
http
.
StatusBadRequest
)
return
}
// Additional consistency checks for fields like scheds, svcArea, etc., based on appProfile attributes
}
...
...
@@ -870,6 +881,34 @@ func appRegistrationPUT(w http.ResponseWriter, r *http.Request) {
errHandlerProblemDetails
(
w
,
"Shall be present when IsInsByMec is FALSE."
,
http
.
StatusBadRequest
)
return
}
// Process appProfile if present
if
appInfoPut
.
AppProfile
!=
nil
{
// Validate appProvider, endpoint, and other fields as per mapping to EASProfile
if
appInfoPut
.
AppProvider
!=
appInfoPut
.
AppProfile
.
ProvId
{
log
.
Error
(
"appProvider in AppInfo does not match provId in appProfile"
)
errHandlerProblemDetails
(
w
,
"appProvider and provId must be consistent"
,
http
.
StatusBadRequest
)
return
}
if
appInfoPut
.
AppProfile
!=
nil
{
if
!
reflect
.
DeepEqual
(
getEndpointUris
(
appInfoPut
.
Endpoint
),
getProfileEndpointUris
(
appInfoPut
.
AppProfile
.
EndPt
))
{
log
.
Error
(
"endpoint in AppInfo does not match endPt in appProfile"
)
errHandlerProblemDetails
(
w
,
"Endpoint and endPt must be consistent"
,
http
.
StatusBadRequest
)
return
}
}
if
appInfoPut
.
AppProfile
.
EasId
==
""
{
log
.
Error
(
"Mandatory easId parameter should be present"
)
errHandlerProblemDetails
(
w
,
"Mandatory attribute easId is missing in the request body."
,
http
.
StatusBadRequest
)
return
}
if
appInfoPut
.
AppName
!=
appInfoPut
.
AppProfile
.
EasId
{
log
.
Error
(
"AppName in AppInfo does not match EasId in appProfile"
)
errHandlerProblemDetails
(
w
,
"AppName and EasId must be consistent"
,
http
.
StatusBadRequest
)
return
}
// Additional consistency checks for fields like scheds, svcArea, etc., based on appProfile attributes
}
appInfoPut
.
AppInstanceId
=
appInstanceId
...
...
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