aboutsummaryrefslogtreecommitdiffstats
path: root/src/orchestrator/api/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/orchestrator/api/api.go')
-rw-r--r--src/orchestrator/api/api.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/orchestrator/api/api.go b/src/orchestrator/api/api.go
index 1d38f106..fbd29563 100644
--- a/src/orchestrator/api/api.go
+++ b/src/orchestrator/api/api.go
@@ -33,7 +33,8 @@ func NewRouter(projectClient moduleLib.ProjectManager,
deploymentIntentGrpClient moduleLib.DeploymentIntentGroupManager,
intentClient moduleLib.IntentManager,
compositeProfileClient moduleLib.CompositeProfileManager,
- appProfileClient moduleLib.AppProfileManager) *mux.Router {
+ appProfileClient moduleLib.AppProfileManager,
+ instantiationClient moduleLib.InstantiationManager) *mux.Router {
router := mux.NewRouter().PathPrefix("/v2").Subrouter()
@@ -163,5 +164,16 @@ func NewRouter(projectClient moduleLib.ProjectManager,
router.HandleFunc("/projects/{project-name}/composite-apps/{composite-app-name}/{composite-app-version}/deployment-intent-groups/{deployment-intent-group-name}/intents/{intent-name}", intentHandler.getIntentHandler).Methods("GET")
router.HandleFunc("/projects/{project-name}/composite-apps/{composite-app-name}/{composite-app-version}/deployment-intent-groups/{deployment-intent-group-name}/intents/{intent-name}", intentHandler.deleteIntentHandler).Methods("DELETE")
+ // setting routes for Instantiation
+ if instantiationClient == nil {
+ instantiationClient = moduleClient.Instantiation
+ }
+
+ instantiationHandler := instantiationHandler{
+ client: instantiationClient,
+ }
+
+ router.HandleFunc("/projects/{project-name}/composite-apps/{composite-app-name}/{composite-app-version}/deployment-intent-groups/{deployment-intent-group-name}/instantiate", instantiationHandler.instantiateHandler).Methods("POST")
+
return router
}