diff options
author | Eric Multanen <eric.w.multanen@intel.com> | 2020-04-14 17:54:45 -0700 |
---|---|---|
committer | Eric Multanen <eric.w.multanen@intel.com> | 2020-04-16 16:58:05 -0700 |
commit | b7a4e00a6cd9d4ce903448ea958d85f17c8d68ab (patch) | |
tree | 5ac53a49fd1efd559494755ca666ecf9550b1014 /src/ncm/pkg/module/network.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/pkg/module/network.go')
-rw-r--r-- | src/ncm/pkg/module/network.go | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/ncm/pkg/module/network.go b/src/ncm/pkg/module/network.go index 2d4121e9..cfb414c5 100644 --- a/src/ncm/pkg/module/network.go +++ b/src/ncm/pkg/module/network.go @@ -24,8 +24,8 @@ import ( // Network contains the parameters needed for dynamic networks type Network struct { - Metadata Metadata `json:"metadata"` - Spec NetworkSpec `json:"spec"` + Metadata Metadata `json:"metadata" yaml:"metadata"` + Spec NetworkSpec `json:"spec" yaml:"spec"` } type NetworkSpec struct { @@ -40,6 +40,16 @@ type NetworkKey struct { NetworkName string `json:"network"` } +// structure for the Network Custom Resource +type CrNetwork struct { + ApiVersion string `yaml:"apiVersion"` + Kind string `yaml:"kind"` + Network Network +} + +const NETWORK_APIVERSION = "k8s.plugin.opnfv.org/v1alpha1" +const NETWORK_KIND = "Network" + // Manager is an interface exposing the Network functionality type NetworkManager interface { CreateNetwork(pr Network, clusterProvider, cluster string, exists bool) (Network, error) |