api

package
v1.0.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 1, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package api implements the resource struct definitions used by the northbound client API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BGPPeer

type BGPPeer struct {
	TypeMetadata

	// Metadata for a BGPPeer.
	Metadata BGPPeerMetadata `json:"metadata,omitempty"`

	// Specification for a BGPPeer.
	Spec BGPPeerSpec `json:"spec,omitempty"`
}

func NewBGPPeer

func NewBGPPeer() *BGPPeer

type BGPPeerList

type BGPPeerList struct {
	TypeMetadata
	Metadata ListMetadata `json:"metadata,omitempty"`
	Items    []BGPPeer    `json:"items" validate:"dive"`
}

func NewBGPPeerList

func NewBGPPeerList() *BGPPeerList

type BGPPeerMetadata

type BGPPeerMetadata struct {
	ObjectMetadata

	// The scope of the peer.  This may be global or node.  A global peer is a
	// BGP device that peers with all Calico nodes.  A node peer is a BGP device that
	// peers with the specified Calico node (specified by the node hostname).
	Scope scope.Scope `json:"scope" validate:"omitempty,scopeglobalornode"`

	// The hostname of the node that is peering with this peer.  When modifying a
	// BGP peer, the hostname must be specified when the scope is `node`, and must
	// be omitted when the scope is `global`.
	Hostname string `json:"hostname,omitempty" validate:"omitempty,name"`

	// The IP address of the peer.
	PeerIP IP `json:"peerIP" validate:"omitempty,ip"`
}

type BGPPeerSpec

type BGPPeerSpec struct {
	// The AS Number of the peer.
	ASNumber int `json:"asNumber" validate:"required,asn"`
}

type BackendType

type BackendType string
const (
	EtcdV2 BackendType = "etcdv2"
)

func (BackendType) NewConfig

func (b BackendType) NewConfig() interface{}

NewConfig returns a pointer to a new config struct for the relevant datastore.

type ClientConfig

type ClientConfig struct {
	BackendType   BackendType `json:"datastoreType" envconfig:"DATASTORE_TYPE" default:"etcdv2"`
	BackendConfig interface{} `json:"-"`
}

Client configuration required to instantiate a Calico client interface.

type EntityRule

type EntityRule struct {
	Tag      string `json:"tag,omitempty" validate:"omitempty,tag"`
	Net      *IPNet `json:"net,omitempty" validate:"omitempty"`
	Selector string `json:"selector,omitempty" validate:"omitempty,selector"`
	Ports    []Port `json:"ports,omitempty" validate:"omitempty,dive"`

	NotTag      string `json:"!tag,omitempty" validate:"omitempty,tag"`
	NotNet      *IPNet `json:"!net,omitempty" validate:"omitempty"`
	NotSelector string `json:"!selector,omitempty" validate:"omitempty,selector"`
	NotPorts    []Port `json:"!ports,omitempty" validate:"omitempty,dive"`
}

type HostEndpoint

type HostEndpoint struct {
	TypeMetadata
	Metadata HostEndpointMetadata `json:"metadata,omitempty"`
	Spec     HostEndpointSpec     `json:"spec,omitempty"`
}

func NewHostEndpoint

func NewHostEndpoint() *HostEndpoint

type HostEndpointList

type HostEndpointList struct {
	TypeMetadata
	Metadata ListMetadata   `json:"metadata,omitempty"`
	Items    []HostEndpoint `json:"items" validate:"dive"`
}

func NewHostEndpointList

func NewHostEndpointList() *HostEndpointList

type HostEndpointMetadata

type HostEndpointMetadata struct {
	ObjectMetadata
	Name     string            `json:"name,omitempty" validate:"omitempty,name"`
	Hostname string            `json:"hostname,omitempty" validate:"omitempty,name"`
	Labels   map[string]string `json:"labels,omitempty" validate:"omitempty,labels"`
}

type HostEndpointSpec

type HostEndpointSpec struct {
	InterfaceName string   `json:"interfaceName,omitempty" validate:"omitempty,interface"`
	ExpectedIPs   []IP     `json:"expectedIPs,omitempty" validate:"omitempty,dive,ip"`
	Profiles      []string `json:"profiles,omitempty" validate:"omitempty,dive,name"`
}

type ICMPFields

type ICMPFields struct {
	Type *int `json:"type,omitempty" validate:"omitempty,gte=0,lte=255"`
	Code *int `json:"code,omitempty" validate:"omitempty,gte=0,lte=255"`
}

ICMPFields defines structure for ICMP and NotICMP sub-struct for ICMP code and type

type IPIPConfiguration

type IPIPConfiguration struct {
	// When enabled is true, ipip tunneling will be
	// used to deliver packets to destinations within this
	// pool.
	Enabled bool `json:"enabled,omitempty"`
}

type Policy

type Policy struct {
	TypeMetadata
	Metadata PolicyMetadata `json:"metadata,omitempty"`
	Spec     PolicySpec     `json:"spec,omitempty"`
}

func NewPolicy

func NewPolicy() *Policy

type PolicyList

type PolicyList struct {
	TypeMetadata
	Metadata ListMetadata `json:"metadata,omitempty"`
	Items    []Policy     `json:"items" validate:"dive"`
}

func NewPolicyList

func NewPolicyList() *PolicyList

type PolicyMetadata

type PolicyMetadata struct {
	ObjectMetadata
	Name string `json:"name,omitempty" validate:"omitempty,name"`
	Tier string `json:"tier,omitempty" validate:"omitempty,name"`
}

type PolicySpec

type PolicySpec struct {
	Order        *float32 `json:"order" validate:"order"`
	IngressRules []Rule   `json:"ingress,omitempty" validate:"omitempty,dive"`
	EgressRules  []Rule   `json:"egress,omitempty" validate:"omitempty,dive"`
	Selector     string   `json:"selector" validate:"selector"`
}

type Pool

type Pool struct {
	TypeMetadata

	// Metadata for a Pool.
	Metadata PoolMetadata `json:"metadata,omitempty"`

	// Specification for a Pool.
	Spec PoolSpec `json:"spec,omitempty"`
}

func NewPool

func NewPool() *Pool

type PoolList

type PoolList struct {
	TypeMetadata
	Metadata ListMetadata `json:"metadata,omitempty"`
	Items    []Pool       `json:"items" validate:"dive"`
}

func NewPoolList

func NewPoolList() *PoolList

type PoolMetadata

type PoolMetadata struct {
	ObjectMetadata
	CIDR IPNet `json:"cidr"`
}

type PoolSpec

type PoolSpec struct {
	// Contains configuration for ipip tunneling
	// for this pool. If not specified, then ipip
	// tunneling is disabled for this pool.
	IPIP *IPIPConfiguration `json:"ipip,omitempty"`

	// When nat-outgoing is true, packets sent from Calico networked
	// containers in this pool to destinations outside of this pool
	// will be masqueraded.
	NATOutgoing bool `json:"nat-outgoing,omitempty"`

	// When disabled is true, Calico IPAM will not assign
	// addreses from this pool.
	Disabled bool `json:"disabled,omitempty"`
}

type Profile

type Profile struct {
	TypeMetadata
	Metadata ProfileMetadata `json:"metadata,omitempty"`
	Spec     ProfileSpec     `json:"spec,omitempty"`
}

func NewProfile

func NewProfile() *Profile

type ProfileList

type ProfileList struct {
	TypeMetadata
	Metadata ListMetadata `json:"metadata,omitempty"`
	Items    []Profile    `json:"items" validate:"dive,omitempty"`
}

func NewProfileList

func NewProfileList() *ProfileList

type ProfileMetadata

type ProfileMetadata struct {
	ObjectMetadata
	Name   string            `json:"name,omitempty" validate:"omitempty,name"`
	Labels map[string]string `json:"labels,omitempty" validate:"omitempty,labels"`
}

type ProfileSpec

type ProfileSpec struct {
	IngressRules []Rule   `json:"ingress,omitempty" validate:"omitempty,dive"`
	EgressRules  []Rule   `json:"egress,omitempty" validate:"omitempty,dive"`
	Tags         []string `json:"tags,omitempty" validate:"omitempty,dive,tag"`
}

type Rule

type Rule struct {
	Action string `json:"action" validate:"action"`

	Protocol *Protocol   `json:"protocol,omitempty" validate:"omitempty"`
	ICMP     *ICMPFields `json:"icmp,omitempty" validate:"omitempty"`

	NotProtocol *Protocol   `json:"!protocol,omitempty" validate:"omitempty"`
	NotICMP     *ICMPFields `json:"!icmp,omitempty" validate:"omitempty"`

	Source      EntityRule `json:"source,omitempty" validate:"omitempty"`
	Destination EntityRule `json:"destination,omitempty" validate:"omitempty"`
}

type WorkloadEndpoint

type WorkloadEndpoint struct {
	TypeMetadata
	Metadata WorkloadEndpointMetadata `json:"metadata,omitempty"`
	Spec     WorkloadEndpointSpec     `json:"spec,omitempty"`
}

func NewWorkloadEndpoint

func NewWorkloadEndpoint() *WorkloadEndpoint

type WorkloadEndpointList

type WorkloadEndpointList struct {
	TypeMetadata
	Metadata ListMetadata       `json:"metadata,omitempty"`
	Items    []WorkloadEndpoint `json:"items" validate:"dive"`
}

func NewWorkloadEndpointList

func NewWorkloadEndpointList() *WorkloadEndpointList

type WorkloadEndpointMetadata

type WorkloadEndpointMetadata struct {
	ObjectMetadata
	Name           string            `json:"name,omitempty" validate:"omitempty,name"`
	WorkloadID     string            `json:"workloadID,omitempty" valid:"omitempty,name"`
	OrchestratorID string            `json:"orchestratorID,omitempty" valid:"omitempty,name"`
	Hostname       string            `json:"hostname,omitempty" valid:"omitempty,name"`
	Labels         map[string]string `json:"labels,omitempty" validate:"omitempty,labels"`
}

type WorkloadEndpointSpec

type WorkloadEndpointSpec struct {
	IPNetworks    []IPNet  `json:"ipNetworks,omitempty" validate:"omitempty"`
	Profiles      []string `json:"profiles,omitempty" validate:"omitempty,dive,name"`
	InterfaceName string   `json:"interfaceName,omitempty" validate:"omitempty,interface"`
	MAC           MAC      `json:"mac,omitempty" validate:"omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL