summaryrefslogtreecommitdiffstats
path: root/src/k8splugin/api/api.go
diff options
context:
space:
mode:
authorrsood <ritu.sood@intel.com>2019-04-11 13:09:00 +0000
committerKiran Kamineni <kiran.k.kamineni@intel.com>2019-04-11 13:24:06 -0700
commit8c3bfebaf6792bbf5fb9042532c918107633a957 (patch)
tree3e3da048b317b0381667f6c74055396ec292e9b0 /src/k8splugin/api/api.go
parent3357aa8ad47c923021d53796c618c94f7c4ef37c (diff)
Add Connectivity Info API
API to add connectivity information for Cloud Regions to K8s Plugin https://wiki.onap.org/display/DW/MultiCloud+K8s-Plugin-service+API%27s Change-Id: I0a9166df9b076a7fdacf0b2f9e51a9cdebe4b621 Signed-off-by: rsood <ritu.sood@intel.com> Issue-ID: MULTICLOUD-292 Signed-off-by: Kiran Kamineni <kiran.k.kamineni@intel.com>
Diffstat (limited to 'src/k8splugin/api/api.go')
-rw-r--r--src/k8splugin/api/api.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/k8splugin/api/api.go b/src/k8splugin/api/api.go
index 4bf8d6a6..282835a4 100644
--- a/src/k8splugin/api/api.go
+++ b/src/k8splugin/api/api.go
@@ -15,6 +15,7 @@ package api
import (
"k8splugin/internal/app"
+ "k8splugin/internal/connection"
"k8splugin/internal/rb"
"github.com/gorilla/mux"
@@ -39,6 +40,7 @@ func NewRouter(defClient rb.DefinitionManager,
// (TODO): Fix update method
// instRouter.HandleFunc("/{vnfInstanceId}", UpdateHandler).Methods("PUT")
+ //Setup the broker handler here
brokerHandler := brokerInstanceHandler{client: instClient}
instRouter.HandleFunc("/{cloud-owner}/{cloud-region}/infra_workload", brokerHandler.createHandler).Methods("POST")
instRouter.HandleFunc("/{cloud-owner}/{cloud-region}/infra_workload/{instID}",
@@ -46,6 +48,13 @@ func NewRouter(defClient rb.DefinitionManager,
instRouter.HandleFunc("/{cloud-owner}/{cloud-region}/infra_workload/{instID}",
brokerHandler.deleteHandler).Methods("DELETE")
+ //Setup the connectivity api handler here
+ connectionClient := connection.NewConnectionClient()
+ connectionHandler := connection.ConnectionHandler{Client: connectionClient}
+ instRouter.HandleFunc("/connectivity-info", connectionHandler.CreateHandler).Methods("POST")
+ instRouter.HandleFunc("/connectivity-info/{connname}", connectionHandler.GetHandler).Methods("GET")
+ instRouter.HandleFunc("/connectivity-info/{connname}", connectionHandler.DeleteHandler).Methods("DELETE")
+
//Setup resource bundle definition routes
if defClient == nil {
defClient = rb.NewDefinitionClient()