diff options
author | Eric Multanen <eric.w.multanen@intel.com> | 2020-05-28 17:25:30 -0700 |
---|---|---|
committer | Eric Multanen <eric.w.multanen@intel.com> | 2020-06-02 14:00:07 -0700 |
commit | a6e2a3a65a6e4f3f1d964578ae4e60c6f9dd1184 (patch) | |
tree | ab7fa1157f9b98840b0482592c886da61e62cc6d /src/ncm/api/networkhandler.go | |
parent | ad7782cbf83c11f152a6457f3808a4da99a1ae56 (diff) |
Reorganize ncm packages to align with architecture
Reorginize the ncm packges to delineate
- cluster provider and cluster management
- virtual and provider netowrk intent management
- intent scheduler
- internal ovn4k8s network controller
Overall, no code changes, just moving things around.
Issue-ID: MULTICLOUD-1029
Signed-off-by: Eric Multanen <eric.w.multanen@intel.com>
Change-Id: I3d43c7e4eb6f285b51c0385ba18626d3511a14f5
Diffstat (limited to 'src/ncm/api/networkhandler.go')
-rw-r--r-- | src/ncm/api/networkhandler.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/ncm/api/networkhandler.go b/src/ncm/api/networkhandler.go index 01d077a7..ed266697 100644 --- a/src/ncm/api/networkhandler.go +++ b/src/ncm/api/networkhandler.go @@ -22,7 +22,8 @@ import ( "io" "net/http" - moduleLib "github.com/onap/multicloud-k8s/src/ncm/pkg/module" + netintents "github.com/onap/multicloud-k8s/src/ncm/pkg/networkintents" + nettypes "github.com/onap/multicloud-k8s/src/ncm/pkg/networkintents/types" "github.com/onap/multicloud-k8s/src/orchestrator/pkg/infra/validation" pkgerrors "github.com/pkg/errors" @@ -34,11 +35,11 @@ import ( type networkHandler struct { // Interface that implements Cluster operations // We will set this variable with a mock interface for testing - client moduleLib.NetworkManager + client netintents.NetworkManager } // Check for valid format of input parameters -func validateNetworkInputs(p moduleLib.Network) error { +func validateNetworkInputs(p netintents.Network) error { // validate name errs := validation.IsValidName(p.Metadata.Name) if len(errs) > 0 { @@ -47,7 +48,7 @@ func validateNetworkInputs(p moduleLib.Network) error { // validate cni type found := false - for _, val := range moduleLib.CNI_TYPES { + for _, val := range nettypes.CNI_TYPES { if p.Spec.CniType == val { found = true break @@ -59,7 +60,7 @@ func validateNetworkInputs(p moduleLib.Network) error { subnets := p.Spec.Ipv4Subnets for _, subnet := range subnets { - err := moduleLib.ValidateSubnet(subnet) + err := nettypes.ValidateSubnet(subnet) if err != nil { return pkgerrors.Wrap(err, "invalid subnet") } @@ -69,7 +70,7 @@ func validateNetworkInputs(p moduleLib.Network) error { // Create handles creation of the Network entry in the database func (h networkHandler) createNetworkHandler(w http.ResponseWriter, r *http.Request) { - var p moduleLib.Network + var p netintents.Network vars := mux.Vars(r) clusterProvider := vars["provider-name"] cluster := vars["cluster-name"] @@ -114,7 +115,7 @@ func (h networkHandler) createNetworkHandler(w http.ResponseWriter, r *http.Requ // Put handles creation/update of the Network entry in the database func (h networkHandler) putNetworkHandler(w http.ResponseWriter, r *http.Request) { - var p moduleLib.Network + var p netintents.Network vars := mux.Vars(r) clusterProvider := vars["provider-name"] cluster := vars["cluster-name"] |