api

package
v0.0.0-...-0da7f2c Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2016 License: Apache-2.0 Imports: 8 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 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 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"`
	ICMPType *int      `json:"icmpType,omitempty" validate:"omitempty,gte=0,lte=255"`
	ICMPCode *int      `json:"icmpCode,omitempty" validate:"omitempty,gte=0,lte=255"`

	NotProtocol *Protocol `json:"!protocol,omitempty" validate:"omitempty"`
	NotICMPType *int      `json:"!icmpType,omitempty" validate:"omitempty,gte=0,lte=255"`
	NotICMPCode *int      `json:"!icmpCode,omitempty" validate:"omitempty,gte=0,lte=255"`

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

type Tier

type Tier struct {
	TypeMetadata
	Metadata TierMetadata `json:"metadata,omitempty"`
	Spec     TierSpec     `json:"spec,omitempty"`
}

func NewTier

func NewTier() *Tier

type TierList

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

func NewTierList

func NewTierList() *TierList

type TierMetadata

type TierMetadata struct {
	ObjectMetadata
	Name string `json:"name,omitempty" validate:"omitempty,name"`
}

type TierSpec

type TierSpec struct {
	Order *float32 `json:"order,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