summaryrefslogtreecommitdiffstats
path: root/src/orchestrator/api/api.go
diff options
context:
space:
mode:
authorDileep Ranganathan <dileep.ranganathan@intel.com>2020-02-19 16:19:18 -0800
committerEric Multanen <eric.w.multanen@intel.com>2020-03-05 09:54:19 -0800
commit8e0c4c63e5a014c95805f16d30a64cd53ddc7385 (patch)
tree19c2cec8ca35760dd9c869dd52569bb0ecbcd6f7 /src/orchestrator/api/api.go
parenta2c244896cb87eb8564743af8c463f170869a824 (diff)
Composite Profile API and Handler
Implemented Composite Profile API and handler, adding create, get and delete handlers for the composite profile. Issue-ID: MULTICLOUD-997 Signed-off-by: Eric Multanen <eric.w.multanen@intel.com> Signed-off-by: Dileep Ranganathan <dileep.ranganathan@intel.com> Change-Id: Iab105cf88ef4635038cd36e90f3251bc900b2faf
Diffstat (limited to 'src/orchestrator/api/api.go')
-rw-r--r--src/orchestrator/api/api.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/orchestrator/api/api.go b/src/orchestrator/api/api.go
index f3e3b177..7c540dd3 100644
--- a/src/orchestrator/api/api.go
+++ b/src/orchestrator/api/api.go
@@ -30,7 +30,8 @@ func NewRouter(projectClient moduleLib.ProjectManager,
genericPlacementIntentClient moduleLib.GenericPlacementIntentManager,
appIntentClient moduleLib.AppIntentManager,
deploymentIntentGrpClient moduleLib.DeploymentIntentGroupManager,
- intentClient moduleLib.IntentManager) *mux.Router {
+ intentClient moduleLib.IntentManager,
+ compositeProfileClient moduleLib.CompositeProfileManager) *mux.Router {
router := mux.NewRouter().PathPrefix("/v2").Subrouter()
@@ -71,6 +72,18 @@ func NewRouter(projectClient moduleLib.ProjectManager,
router.HandleFunc("/projects/{project-name}/composite-apps/{composite-app-name}/{version}", compAppHandler.getHandler).Methods("GET")
router.HandleFunc("/projects/{project-name}/composite-apps/{composite-app-name}/{version}", compAppHandler.deleteHandler).Methods("DELETE")
+ if compositeProfileClient == nil {
+ compositeProfileClient = moduleClient.CompositeProfile
+ }
+ compProfilepHandler := compositeProfileHandler{
+ client: compositeProfileClient,
+ }
+
+ router.HandleFunc("/projects/{project-name}/composite-apps/{composite-app-name}/{composite-app-version}/composite-profiles", compProfilepHandler.createHandler).Methods("POST")
+ router.HandleFunc("/projects/{project-name}/composite-apps/{composite-app-name}/{composite-app-version}/composite-profiles", compProfilepHandler.getHandler).Methods("GET")
+ router.HandleFunc("/projects/{project-name}/composite-apps/{composite-app-name}/{composite-app-version}/composite-profiles/{composite-profile-name}", compProfilepHandler.getHandler).Methods("GET")
+ router.HandleFunc("/projects/{project-name}/composite-apps/{composite-app-name}/{composite-app-version}/composite-profiles/{composite-profile-name}", compProfilepHandler.deleteHandler).Methods("DELETE")
+
router.HandleFunc("/controllers", controlHandler.createHandler).Methods("POST")
router.HandleFunc("/controllers", controlHandler.createHandler).Methods("PUT")
router.HandleFunc("/controllers/{controller-name}", controlHandler.getHandler).Methods("GET")