From 0af31b5e508faa227a36e687346e7905a7a10ed6 Mon Sep 17 00:00:00 2001 From: Eric Multanen Date: Thu, 2 Jul 2020 15:34:13 -0700 Subject: Add terminate support to orchestrator and ncm Complete the basic terminate support for the orchestrator and ncm services. 1. When terminate REST API is invoked on a deployment intent group, call the uninstall grpc api to rsync and then remove the app context. 2. When terminate REST API is invoked on a cluster, add the uninstall grpc api call to rsync to remove the network resources from the clusters. Issue-ID: MULTICLOUD-1040 Signed-off-by: Eric Multanen Change-Id: I181e891a8c7c973970af061f9ff07d80c3bb64f9 --- .../pkg/module/instantiation_scheduler_helper.go | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/orchestrator/pkg/module/instantiation_scheduler_helper.go') diff --git a/src/orchestrator/pkg/module/instantiation_scheduler_helper.go b/src/orchestrator/pkg/module/instantiation_scheduler_helper.go index 3d9d851c..184d6972 100644 --- a/src/orchestrator/pkg/module/instantiation_scheduler_helper.go +++ b/src/orchestrator/pkg/module/instantiation_scheduler_helper.go @@ -192,9 +192,9 @@ func callGrpcForControllerList(cl []controller.Controller, mc map[string]string, } /* -callRsync method shall take in the app context id and invokes the rsync service via grpc +callRsyncInstall method shall take in the app context id and invokes the rsync service via grpc */ -func callRsync(contextid interface{}) error { +func callRsyncInstall(contextid interface{}) error { appContextID := fmt.Sprintf("%v", contextid) err := rsyncclient.InvokeInstallApp(appContextID) if err != nil { @@ -203,6 +203,18 @@ func callRsync(contextid interface{}) error { return nil } +/* +callRsyncUninstall method shall take in the app context id and invokes the rsync service via grpc +*/ +func callRsyncUninstall(contextid interface{}) error { + appContextID := fmt.Sprintf("%v", contextid) + err := rsyncclient.InvokeUninstallApp(appContextID) + if err != nil { + return err + } + return nil +} + /* deleteExtraClusters method shall delete the extra cluster handles for each AnyOf cluster present in the etcd after the grpc call for context updation. */ -- cgit 1.2.3-korg