diff options
author | 2020-04-14 17:54:45 -0700 | |
---|---|---|
committer | 2020-04-16 16:58:05 -0700 | |
commit | b7a4e00a6cd9d4ce903448ea958d85f17c8d68ab (patch) | |
tree | 5ac53a49fd1efd559494755ca666ecf9550b1014 /src/ncm/api/clusterhandler_test.go | |
parent | c898a84208d20f0040778450cc401a35c3f8ee41 (diff) |
Add apply API for network intents
Support POST API to 'apply' and 'terminate' network and
providernetwork intents for a given cluster.
Issue-ID: MULTICLOUD-1029
Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
Change-Id: I8c9bae9e93aeeb68654eaab1f15de9883c22215c
Diffstat (limited to 'src/ncm/api/clusterhandler_test.go')
-rw-r--r-- | src/ncm/api/clusterhandler_test.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/ncm/api/clusterhandler_test.go b/src/ncm/api/clusterhandler_test.go index a26c41bd..b32df527 100644 --- a/src/ncm/api/clusterhandler_test.go +++ b/src/ncm/api/clusterhandler_test.go @@ -28,6 +28,7 @@ import ( "testing" moduleLib "github.com/onap/multicloud-k8s/src/ncm/pkg/module" + "github.com/onap/multicloud-k8s/src/orchestrator/pkg/appcontext" pkgerrors "github.com/pkg/errors" ) @@ -41,6 +42,7 @@ type mockClusterManager struct { ClusterProviderItems []moduleLib.ClusterProvider ClusterItems []moduleLib.Cluster ClusterContentItems []moduleLib.ClusterContent + ClusterContextItems []appcontext.AppContext ClusterLabelItems []moduleLib.ClusterLabel ClusterKvPairsItems []moduleLib.ClusterKvPairs ClusterList []string @@ -99,6 +101,14 @@ func (m *mockClusterManager) GetClusterContent(provider, name string) (moduleLib return m.ClusterContentItems[0], nil } +func (m *mockClusterManager) GetClusterContext(provider, name string) (appcontext.AppContext, error) { + if m.Err != nil { + return appcontext.AppContext{}, m.Err + } + + return m.ClusterContextItems[0], nil +} + func (m *mockClusterManager) GetClusters(provider string) ([]moduleLib.Cluster, error) { if m.Err != nil { return []moduleLib.Cluster{}, m.Err @@ -119,6 +129,14 @@ func (m *mockClusterManager) DeleteCluster(provider, name string) error { return m.Err } +func (m *mockClusterManager) ApplyNetworkIntents(provider, name string) error { + return m.Err +} + +func (m *mockClusterManager) TerminateNetworkIntents(provider, name string) error { + return m.Err +} + func (m *mockClusterManager) CreateClusterLabel(provider, cluster string, inp moduleLib.ClusterLabel) (moduleLib.ClusterLabel, error) { if m.Err != nil { return moduleLib.ClusterLabel{}, m.Err |