aboutsummaryrefslogtreecommitdiffstats
path: root/src/k8splugin/api/api.go
diff options
context:
space:
mode:
authorKiran Kamineni <kiran.k.kamineni@intel.com>2018-11-28 12:21:09 -0800
committerKiran Kamineni <kiran.k.kamineni@intel.com>2019-01-17 12:47:04 -0800
commitcd9644049545a47676e87ad279833ced1b0f9c1a (patch)
treee400e1afc580cef33a95a17a5e6b019d00a07fef /src/k8splugin/api/api.go
parent1fa0e21ea6d3c5fb060daba19a0cb6c1f26f1364 (diff)
Add resource bundle profile api
Add CRUD api for uploading profiles for specific definition resource bundles. - Adding unit tests Issue-ID: ONAPARC-348 Change-Id: Ic43724b4e2c035e7989c827612f1b2800fc49a69 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.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/k8splugin/api/api.go b/src/k8splugin/api/api.go
index 06f5009f..593e2b0b 100644
--- a/src/k8splugin/api/api.go
+++ b/src/k8splugin/api/api.go
@@ -106,6 +106,7 @@ func NewRouter(kubeconfig string) *mux.Router {
vnfInstanceHandler.HandleFunc("/{cloudRegionID}/{namespace}/{externalVNFID}", DeleteHandler).Methods("DELETE")
vnfInstanceHandler.HandleFunc("/{cloudRegionID}/{namespace}/{externalVNFID}", GetHandler).Methods("GET")
+ //rbd is resource bundle definition
resRouter := router.PathPrefix("/v1/rb").Subrouter()
rbdef := rbDefinitionHandler{client: rb.NewDefinitionClient()}
resRouter.HandleFunc("/definition", rbdef.createHandler).Methods("POST")
@@ -114,6 +115,15 @@ func NewRouter(kubeconfig string) *mux.Router {
resRouter.HandleFunc("/definition/{rbdID}", rbdef.getHandler).Methods("GET")
resRouter.HandleFunc("/definition/{rbdID}", rbdef.deleteHandler).Methods("DELETE")
+ //rbp is resource bundle profile
+ rbprofile := rbProfileHandler{client: rb.NewProfileClient()}
+ resRouter.HandleFunc("/profile", rbprofile.createHandler).Methods("POST")
+ resRouter.HandleFunc("/profile/{rbpID}/content", rbprofile.uploadHandler).Methods("POST")
+ resRouter.HandleFunc("/profile/help", rbprofile.helpHandler).Methods("GET")
+ resRouter.HandleFunc("/profile", rbprofile.listHandler).Methods("GET")
+ resRouter.HandleFunc("/profile/{rbpID}", rbprofile.getHandler).Methods("GET")
+ resRouter.HandleFunc("/profile/{rbpID}", rbprofile.deleteHandler).Methods("DELETE")
+
// (TODO): Fix update method
// vnfInstanceHandler.HandleFunc("/{vnfInstanceId}", UpdateHandler).Methods("PUT")