Documentation ¶
Overview ¶
SPDX-License-Identifier: Apache-2.0 Copyright (c) 2020 Intel Corporation
Index ¶
- Constants
- Variables
- func AddNetworkAnnotation(r interface{}, a nettypes.NetworkSelectionElement)
- func AddNfnAnnotation(r interface{}, new []WorkloadIfIntentSpec)
- func AddTemplateAnnotation(r interface{}, a nettypes.NetworkSelectionElement, new []WorkloadIfIntentSpec) ([]byte, error)
- func ParsePodTemplateNetworkAnnotation(pt *v1core.PodTemplateSpec) ([]*nettypes.NetworkSelectionElement, error)
- type Client
- type ClientDbInfo
- type Metadata
- type NetControlIntent
- type NetControlIntentClient
- func (v *NetControlIntentClient) CreateNetControlIntent(nci NetControlIntent, project, compositeapp, compositeappversion, dig string, ...) (NetControlIntent, error)
- func (v *NetControlIntentClient) DeleteNetControlIntent(name, project, compositeapp, compositeappversion, dig string) error
- func (v *NetControlIntentClient) GetNetControlIntent(name, project, compositeapp, compositeappversion, dig string) (NetControlIntent, error)
- func (v *NetControlIntentClient) GetNetControlIntents(project, compositeapp, compositeappversion, dig string) ([]NetControlIntent, error)
- type NetControlIntentKey
- type NetControlIntentManager
- type NfnAnnotation
- type WorkloadIfIntent
- type WorkloadIfIntentClient
- func (v *WorkloadIfIntentClient) CreateWorkloadIfIntent(wif WorkloadIfIntent, ...) (WorkloadIfIntent, error)
- func (v *WorkloadIfIntentClient) DeleteWorkloadIfIntent(...) error
- func (v *WorkloadIfIntentClient) GetWorkloadIfIntent(...) (WorkloadIfIntent, error)
- func (v *WorkloadIfIntentClient) GetWorkloadIfIntents(project, compositeapp, compositeappversion, dig, netcontrolintent, ... string) ([]WorkloadIfIntent, error)
- type WorkloadIfIntentKey
- type WorkloadIfIntentManager
- type WorkloadIfIntentSpec
- type WorkloadIntent
- type WorkloadIntentClient
- func (v *WorkloadIntentClient) CreateWorkloadIntent(wi WorkloadIntent, ...) (WorkloadIntent, error)
- func (v *WorkloadIntentClient) DeleteWorkloadIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent string) error
- func (v *WorkloadIntentClient) GetWorkloadIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent string) (WorkloadIntent, error)
- func (v *WorkloadIntentClient) GetWorkloadIntents(project, compositeapp, compositeappversion, dig, netcontrolintent string) ([]WorkloadIntent, error)
- type WorkloadIntentKey
- type WorkloadIntentManager
- type WorkloadIntentSpec
Constants ¶
const CNI_TYPE_OVN4NFV string = "ovn4nfv"
const MAX_DESCRIPTION_LEN int = 1024
It implements the interface for managing the ClusterProviders
const MAX_USERDATA_LEN int = 4096
const NfnAnnotationKey = "k8s.plugin.opnfv.org/nfn-network"
Variables ¶
var CNI_TYPES = [...]string{CNI_TYPE_OVN4NFV}
Functions ¶
func AddNetworkAnnotation ¶
func AddNetworkAnnotation(r interface{}, a nettypes.NetworkSelectionElement)
Add a network annotation to the resource
func AddNfnAnnotation ¶
func AddNfnAnnotation(r interface{}, new []WorkloadIfIntentSpec)
Add an nfn annotation to the resource
func AddTemplateAnnotation ¶
func AddTemplateAnnotation(r interface{}, a nettypes.NetworkSelectionElement, new []WorkloadIfIntentSpec) ([]byte, error)
Add Annotations for non standard K8s resources with template section
func ParsePodTemplateNetworkAnnotation ¶
func ParsePodTemplateNetworkAnnotation(pt *v1core.PodTemplateSpec) ([]*nettypes.NetworkSelectionElement, error)
ParsePodTemplateNetworkAnnotation parses Pod annotation in PodTemplate
Types ¶
type Client ¶
type Client struct { NetControlIntent *NetControlIntentClient WorkloadIntent *WorkloadIntentClient WorkloadIfIntent *WorkloadIfIntentClient }
Client for using the services in the ncm
type ClientDbInfo ¶
type ClientDbInfo struct {
// contains filtered or unexported fields
}
type NetControlIntent ¶
type NetControlIntent struct {
Metadata Metadata `json:"metadata"`
}
NetControlIntent contains the parameters needed for dynamic networks
type NetControlIntentClient ¶
type NetControlIntentClient struct {
// contains filtered or unexported fields
}
NetControlIntentClient implements the Manager It will also be used to maintain some localized state
func NewNetControlIntentClient ¶
func NewNetControlIntentClient() *NetControlIntentClient
NewNetControlIntentClient returns an instance of the NetControlIntentClient which implements the Manager
func (*NetControlIntentClient) CreateNetControlIntent ¶
func (v *NetControlIntentClient) CreateNetControlIntent(nci NetControlIntent, project, compositeapp, compositeappversion, dig string, exists bool) (NetControlIntent, error)
CreateNetControlIntent - create a new NetControlIntent
func (*NetControlIntentClient) DeleteNetControlIntent ¶
func (v *NetControlIntentClient) DeleteNetControlIntent(name, project, compositeapp, compositeappversion, dig string) error
Delete the NetControlIntent from database
func (*NetControlIntentClient) GetNetControlIntent ¶
func (v *NetControlIntentClient) GetNetControlIntent(name, project, compositeapp, compositeappversion, dig string) (NetControlIntent, error)
GetNetControlIntent returns the NetControlIntent for corresponding name
func (*NetControlIntentClient) GetNetControlIntents ¶
func (v *NetControlIntentClient) GetNetControlIntents(project, compositeapp, compositeappversion, dig string) ([]NetControlIntent, error)
GetNetControlIntentList returns all of the NetControlIntent for corresponding name
type NetControlIntentKey ¶
type NetControlIntentKey struct { NetControlIntent string `json:"netcontrolintent"` Project string `json:"project"` CompositeApp string `json:"compositeapp"` CompositeAppVersion string `json:"compositeappversion"` DigName string `json:"deploymentintentgroup"` }
NetControlIntentKey is the key structure that is used in the database
type NetControlIntentManager ¶
type NetControlIntentManager interface { CreateNetControlIntent(nci NetControlIntent, project, compositeapp, compositeappversion, dig string, exists bool) (NetControlIntent, error) GetNetControlIntent(name, project, compositeapp, compositeappversion, dig string) (NetControlIntent, error) GetNetControlIntents(project, compositeapp, compositeappversion, dig string) ([]NetControlIntent, error) DeleteNetControlIntent(name, project, compositeapp, compositeappversion, dig string) error }
Manager is an interface exposing the NetControlIntent functionality
type NfnAnnotation ¶
type NfnAnnotation struct { CniType string `json:"type"` Interface []WorkloadIfIntentSpec `json:"interface"` }
func GetPodNfnAnnotation ¶
func GetPodNfnAnnotation(p *v1core.Pod) NfnAnnotation
GetPodNetworkAnnotation gets Pod Nfn annotation in PodTemplate
func GetPodTemplateNfnAnnotation ¶
func GetPodTemplateNfnAnnotation(pt *v1core.PodTemplateSpec) NfnAnnotation
GetPodTemplateNetworkAnnotation gets Pod Nfn annotation in PodTemplate
type WorkloadIfIntent ¶
type WorkloadIfIntent struct { Metadata Metadata `json:"metadata"` Spec WorkloadIfIntentSpec `json:"spec"` }
WorkloadIfIntent contains the parameters needed for dynamic networks
type WorkloadIfIntentClient ¶
type WorkloadIfIntentClient struct {
// contains filtered or unexported fields
}
WorkloadIfIntentClient implements the Manager It will also be used to maintain some localized state
func NewWorkloadIfIntentClient ¶
func NewWorkloadIfIntentClient() *WorkloadIfIntentClient
NewWorkloadIfIntentClient returns an instance of the WorkloadIfIntentClient which implements the Manager
func (*WorkloadIfIntentClient) CreateWorkloadIfIntent ¶
func (v *WorkloadIfIntentClient) CreateWorkloadIfIntent(wif WorkloadIfIntent, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string, exists bool) (WorkloadIfIntent, error)
CreateWorkloadIfIntent - create a new WorkloadIfIntent
func (*WorkloadIfIntentClient) DeleteWorkloadIfIntent ¶
func (v *WorkloadIfIntentClient) DeleteWorkloadIfIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) error
Delete the WorkloadIfIntent from database
func (*WorkloadIfIntentClient) GetWorkloadIfIntent ¶
func (v *WorkloadIfIntentClient) GetWorkloadIfIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) (WorkloadIfIntent, error)
GetWorkloadIfIntent returns the WorkloadIfIntent for corresponding name
func (*WorkloadIfIntentClient) GetWorkloadIfIntents ¶
func (v *WorkloadIfIntentClient) GetWorkloadIfIntents(project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) ([]WorkloadIfIntent, error)
GetWorkloadIfIntentList returns all of the WorkloadIfIntent for corresponding name
type WorkloadIfIntentKey ¶
type WorkloadIfIntentKey struct { Project string `json:"provider"` CompositeApp string `json:"compositeapp"` CompositeAppVersion string `json:"compositeappversion"` DigName string `json:"deploymentintentgroup"` NetControlIntent string `json:"netcontrolintent"` WorkloadIntent string `json:"workloadintent"` WorkloadIfIntent string `json:"workloadifintent"` }
WorkloadIfIntentKey is the key structure that is used in the database
type WorkloadIfIntentManager ¶
type WorkloadIfIntentManager interface { CreateWorkloadIfIntent(wi WorkloadIfIntent, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string, exists bool) (WorkloadIfIntent, error) GetWorkloadIfIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) (WorkloadIfIntent, error) GetWorkloadIfIntents(project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) ([]WorkloadIfIntent, error) DeleteWorkloadIfIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent, workloadintent string) error }
Manager is an interface exposing the WorkloadIfIntent functionality
type WorkloadIfIntentSpec ¶
type WorkloadIfIntentSpec struct { IfName string `json:"interface"` NetworkName string `json:"name"` DefaultGateway string `json:"defaultGateway"` // optional, default value is "false" IpAddr string `json:"ipAddress,omitempty"` // optional, if not provided then will be dynamically allocated MacAddr string `json:"macAddress,omitempty"` // optional, if not provided then will be dynamically allocated }
type WorkloadIntent ¶
type WorkloadIntent struct { Metadata Metadata `json:"metadata"` Spec WorkloadIntentSpec `json:"spec"` }
WorkloadIntent contains the parameters needed for dynamic networks
type WorkloadIntentClient ¶
type WorkloadIntentClient struct {
// contains filtered or unexported fields
}
WorkloadIntentClient implements the Manager It will also be used to maintain some localized state
func NewWorkloadIntentClient ¶
func NewWorkloadIntentClient() *WorkloadIntentClient
NewWorkloadIntentClient returns an instance of the WorkloadIntentClient which implements the Manager
func (*WorkloadIntentClient) CreateWorkloadIntent ¶
func (v *WorkloadIntentClient) CreateWorkloadIntent(wi WorkloadIntent, project, compositeapp, compositeappversion, dig, netcontrolintent string, exists bool) (WorkloadIntent, error)
CreateWorkloadIntent - create a new WorkloadIntent
func (*WorkloadIntentClient) DeleteWorkloadIntent ¶
func (v *WorkloadIntentClient) DeleteWorkloadIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent string) error
Delete the WorkloadIntent from database
func (*WorkloadIntentClient) GetWorkloadIntent ¶
func (v *WorkloadIntentClient) GetWorkloadIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent string) (WorkloadIntent, error)
GetWorkloadIntent returns the WorkloadIntent for corresponding name
func (*WorkloadIntentClient) GetWorkloadIntents ¶
func (v *WorkloadIntentClient) GetWorkloadIntents(project, compositeapp, compositeappversion, dig, netcontrolintent string) ([]WorkloadIntent, error)
GetWorkloadIntentList returns all of the WorkloadIntent for corresponding name
type WorkloadIntentKey ¶
type WorkloadIntentKey struct { Project string `json:"provider"` CompositeApp string `json:"compositeapp"` CompositeAppVersion string `json:"compositeappversion"` DigName string `json:"deploymentintentgroup"` NetControlIntent string `json:"netcontrolintent"` WorkloadIntent string `json:"workloadintent"` }
WorkloadIntentKey is the key structure that is used in the database
type WorkloadIntentManager ¶
type WorkloadIntentManager interface { CreateWorkloadIntent(wi WorkloadIntent, project, compositeapp, compositeappversion, dig, netcontrolintent string, exists bool) (WorkloadIntent, error) GetWorkloadIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent string) (WorkloadIntent, error) GetWorkloadIntents(project, compositeapp, compositeappversion, dig, netcontrolintent string) ([]WorkloadIntent, error) DeleteWorkloadIntent(name, project, compositeapp, compositeappversion, dig, netcontrolintent string) error }
Manager is an interface exposing the WorkloadIntent functionality