diff options
Diffstat (limited to 'src/k8splugin/api/api.go')
-rw-r--r-- | src/k8splugin/api/api.go | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/k8splugin/api/api.go b/src/k8splugin/api/api.go index 53db3fb5..e90c994e 100644 --- a/src/k8splugin/api/api.go +++ b/src/k8splugin/api/api.go @@ -14,6 +14,7 @@ limitations under the License. package api import ( + "k8splugin/vnfd" "os" "path/filepath" "plugin" @@ -110,6 +111,14 @@ func NewRouter(kubeconfig string) *mux.Router { vnfInstanceHandler.HandleFunc("/{cloudRegionID}/{namespace}/{externalVNFID}", DeleteHandler).Methods("DELETE") vnfInstanceHandler.HandleFunc("/{cloudRegionID}/{namespace}/{externalVNFID}", GetHandler).Methods("GET") + vnfdRouter := router.PathPrefix("/v1/vnfd").Subrouter() + vh := vnfdHandler{vnfdClient: vnfd.GetVNFDClient()} + vnfdRouter.HandleFunc("", vh.vnfdCreateHandler).Methods("POST") + vnfdRouter.HandleFunc("/{vnfdID}/upload", vh.vnfdUploadHandler).Methods("POST") + vnfdRouter.HandleFunc("", vh.vnfdListHandler).Methods("GET") + vnfdRouter.HandleFunc("/{vnfdID}", vh.vnfdGetHandler).Methods("GET") + vnfdRouter.HandleFunc("/{vnfdID}", vh.vnfdDeleteHandler).Methods("DELETE") + // (TODO): Fix update method // vnfInstanceHandler.HandleFunc("/{vnfInstanceId}", UpdateHandler).Methods("PUT") |