summaryrefslogtreecommitdiffstats
path: root/mock-clamp/mock-clamp.go
diff options
context:
space:
mode:
authorMichal Jagiello <michal.jagiello@t-mobile.pl>2023-03-13 11:00:21 +0000
committerMichal Jagiello <michal.jagiello@t-mobile.pl>2023-03-14 14:25:16 +0000
commit870ff702088b89549bc21631eb48443fff0bcd71 (patch)
tree5d52aca25035644bdc2ac687275ed858ba524e7e /mock-clamp/mock-clamp.go
parent98e0e65ba145ab4c85c301118d4a0d02940221ec (diff)
Migrate mock applications from Orange GitLab
Move from Orange repositories into ONAP one. Issue-ID: INT-2208 Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl> Change-Id: I6e165da5144c28a6ff151e02e32f5ae89ce124e3
Diffstat (limited to 'mock-clamp/mock-clamp.go')
-rw-r--r--mock-clamp/mock-clamp.go44
1 files changed, 44 insertions, 0 deletions
diff --git a/mock-clamp/mock-clamp.go b/mock-clamp/mock-clamp.go
new file mode 100644
index 0000000..6e82d7f
--- /dev/null
+++ b/mock-clamp/mock-clamp.go
@@ -0,0 +1,44 @@
+// Copyright 2023 Deutsche Telekom AG, Orange
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+package main
+
+import (
+ "github.com/labstack/echo"
+ "github.com/labstack/echo/middleware"
+ "github.com/labstack/gommon/log"
+)
+
+func main() {
+ e := echo.New()
+ e.Use(middleware.Logger())
+ e.Logger.SetLevel(log.DEBUG)
+ e.GET("/", index)
+ e.GET("/restservices/clds/v2/templates/", getTemplates)
+ e.GET("/restservices/clds/v2/policyToscaModels/", getPolicies)
+
+ e.GET("/restservices/clds/v2/loop/:loopID", updateLoopDetails)
+ e.GET("/restservices/clds/v2/loop/getstatus/:loopID", updateLoopDetails) //refresh status
+ e.POST("/restservices/clds/v2/loop/create/:loopID", createLoopInstance)
+ e.PUT("/restservices/clds/v2/loop/addOperationaPolicy/:loopID/policyModel/:policyType/:policyVersion", addOperationaPolicy)
+ e.PUT("/restservices/clds/v2/loop/removeOperationaPolicy/:loopID/policyModel/:policyType/:policyVersion", removeOperationaPolicy)
+ e.POST("/restservices/clds/v2/loop/updateMicroservicePolicy/:loopID", addTcaConfig) //modify
+ e.POST("/restservices/clds/v2/loop/updateOperationalPolicies/:loopID", addOperationalPolicyConfig) //modify
+ e.PUT("/restservices/clds/v2/loop/:action/:loopID", putLoopAction)
+ e.POST("/reset", reset)
+ generateInitialTemplateList()
+ generateInitialPolicyList()
+ generateInitialLoopInstances()
+ e.Logger.Fatal(e.Start(":30258"))
+}