contivModel

package
v0.0.0-10-28-2015.23-1... Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2015 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRoutes

func AddRoutes(router *mux.Router)

Add all routes for REST handlers

func CreateApp

func CreateApp(obj *App) error

Create a app object

func CreateEndpointGroup

func CreateEndpointGroup(obj *EndpointGroup) error

Create a endpointGroup object

func CreateNetwork

func CreateNetwork(obj *Network) error

Create a network object

func CreatePolicy

func CreatePolicy(obj *Policy) error

Create a policy object

func CreateRule

func CreateRule(obj *Rule) error

Create a rule object

func CreateService

func CreateService(obj *Service) error

Create a service object

func CreateServiceInstance

func CreateServiceInstance(obj *ServiceInstance) error

Create a serviceInstance object

func CreateTenant

func CreateTenant(obj *Tenant) error

Create a tenant object

func CreateVolume

func CreateVolume(obj *Volume) error

Create a volume object

func CreateVolumeProfile

func CreateVolumeProfile(obj *VolumeProfile) error

Create a volumeProfile object

func DeleteApp

func DeleteApp(key string) error

Delete a app object

func DeleteEndpointGroup

func DeleteEndpointGroup(key string) error

Delete a endpointGroup object

func DeleteNetwork

func DeleteNetwork(key string) error

Delete a network object

func DeletePolicy

func DeletePolicy(key string) error

Delete a policy object

func DeleteRule

func DeleteRule(key string) error

Delete a rule object

func DeleteService

func DeleteService(key string) error

Delete a service object

func DeleteServiceInstance

func DeleteServiceInstance(key string) error

Delete a serviceInstance object

func DeleteTenant

func DeleteTenant(key string) error

Delete a tenant object

func DeleteVolume

func DeleteVolume(key string) error

Delete a volume object

func DeleteVolumeProfile

func DeleteVolumeProfile(key string) error

Delete a volumeProfile object

func Init

func Init()

func RegisterAppCallbacks

func RegisterAppCallbacks(handler AppCallbacks)

func RegisterEndpointGroupCallbacks

func RegisterEndpointGroupCallbacks(handler EndpointGroupCallbacks)

func RegisterNetworkCallbacks

func RegisterNetworkCallbacks(handler NetworkCallbacks)

func RegisterPolicyCallbacks

func RegisterPolicyCallbacks(handler PolicyCallbacks)

func RegisterRuleCallbacks

func RegisterRuleCallbacks(handler RuleCallbacks)

func RegisterServiceCallbacks

func RegisterServiceCallbacks(handler ServiceCallbacks)

func RegisterServiceInstanceCallbacks

func RegisterServiceInstanceCallbacks(handler ServiceInstanceCallbacks)

func RegisterTenantCallbacks

func RegisterTenantCallbacks(handler TenantCallbacks)

func RegisterVolumeCallbacks

func RegisterVolumeCallbacks(handler VolumeCallbacks)

func RegisterVolumeProfileCallbacks

func RegisterVolumeProfileCallbacks(handler VolumeProfileCallbacks)

func ValidateApp

func ValidateApp(obj *App) error

Validate a app object

func ValidateEndpointGroup

func ValidateEndpointGroup(obj *EndpointGroup) error

Validate a endpointGroup object

func ValidateNetwork

func ValidateNetwork(obj *Network) error

Validate a network object

func ValidatePolicy

func ValidatePolicy(obj *Policy) error

Validate a policy object

func ValidateRule

func ValidateRule(obj *Rule) error

Validate a rule object

func ValidateService

func ValidateService(obj *Service) error

Validate a service object

func ValidateServiceInstance

func ValidateServiceInstance(obj *ServiceInstance) error

Validate a serviceInstance object

func ValidateTenant

func ValidateTenant(obj *Tenant) error

Validate a tenant object

func ValidateVolume

func ValidateVolume(obj *Volume) error

Validate a volume object

func ValidateVolumeProfile

func ValidateVolumeProfile(obj *VolumeProfile) error

Validate a volumeProfile object

Types

type App

type App struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	AppName    string `json:"appName,omitempty"`
	TenantName string `json:"tenantName,omitempty"`

	// add link-sets and links
	LinkSets AppLinkSets `json:"link-sets,omitempty"`
	Links    AppLinks    `json:"links,omitempty"`
}

func FindApp

func FindApp(key string) *App

Return a pointer to app from collection

func (*App) Delete

func (self *App) Delete() error

func (*App) GetKey

func (self *App) GetKey() string

func (*App) GetType

func (self *App) GetType() string

func (*App) Read

func (self *App) Read() error

func (*App) Write

func (self *App) Write() error

type AppCallbacks

type AppCallbacks interface {
	AppCreate(app *App) error
	AppUpdate(app, params *App) error
	AppDelete(app *App) error
}

type AppLinkSets

type AppLinkSets struct {
	Services map[string]modeldb.Link `json:"Services,omitempty"`
}
type AppLinks struct {
	Tenant modeldb.Link `json:"Tenant,omitempty"`
}

type CallbackHandlers

type CallbackHandlers struct {
	AppCb             AppCallbacks
	EndpointGroupCb   EndpointGroupCallbacks
	NetworkCb         NetworkCallbacks
	PolicyCb          PolicyCallbacks
	RuleCb            RuleCallbacks
	ServiceCb         ServiceCallbacks
	ServiceInstanceCb ServiceInstanceCallbacks
	TenantCb          TenantCallbacks
	VolumeCb          VolumeCallbacks
	VolumeProfileCb   VolumeProfileCallbacks
}

type Collections

type Collections struct {
	// contains filtered or unexported fields
}

type EndpointGroup

type EndpointGroup struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	EndpointGroupID int      `json:"endpointGroupId,omitempty"`
	GroupName       string   `json:"groupName,omitempty"`
	NetworkName     string   `json:"networkName,omitempty"`
	Policies        []string `json:"policies,omitempty"`
	TenantName      string   `json:"tenantName,omitempty"`

	// add link-sets and links
	LinkSets EndpointGroupLinkSets `json:"link-sets,omitempty"`
	Links    EndpointGroupLinks    `json:"links,omitempty"`
}

func FindEndpointGroup

func FindEndpointGroup(key string) *EndpointGroup

Return a pointer to endpointGroup from collection

func (*EndpointGroup) Delete

func (self *EndpointGroup) Delete() error

func (*EndpointGroup) GetKey

func (self *EndpointGroup) GetKey() string

func (*EndpointGroup) GetType

func (self *EndpointGroup) GetType() string

func (*EndpointGroup) Read

func (self *EndpointGroup) Read() error

func (*EndpointGroup) Write

func (self *EndpointGroup) Write() error

type EndpointGroupCallbacks

type EndpointGroupCallbacks interface {
	EndpointGroupCreate(endpointGroup *EndpointGroup) error
	EndpointGroupUpdate(endpointGroup, params *EndpointGroup) error
	EndpointGroupDelete(endpointGroup *EndpointGroup) error
}

type EndpointGroupLinkSets

type EndpointGroupLinkSets struct {
	Policies map[string]modeldb.Link `json:"Policies,omitempty"`
	Services map[string]modeldb.Link `json:"Services,omitempty"`
}
type EndpointGroupLinks struct {
	Network modeldb.Link `json:"Network,omitempty"`
	Tenant  modeldb.Link `json:"Tenant,omitempty"`
}

type HttpApiFunc

type HttpApiFunc func(w http.ResponseWriter, r *http.Request, vars map[string]string) (interface{}, error)

type Network

type Network struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	DefaultGw   string `json:"defaultGw,omitempty"`
	Encap       string `json:"encap,omitempty"`
	IsPrivate   bool   `json:"isPrivate,omitempty"`
	IsPublic    bool   `json:"isPublic,omitempty"`
	NetworkName string `json:"networkName,omitempty"`
	Subnet      string `json:"subnet,omitempty"`
	TenantName  string `json:"tenantName,omitempty"`

	// add link-sets and links
	LinkSets NetworkLinkSets `json:"link-sets,omitempty"`
	Links    NetworkLinks    `json:"links,omitempty"`
}

func FindNetwork

func FindNetwork(key string) *Network

Return a pointer to network from collection

func (*Network) Delete

func (self *Network) Delete() error

func (*Network) GetKey

func (self *Network) GetKey() string

func (*Network) GetType

func (self *Network) GetType() string

func (*Network) Read

func (self *Network) Read() error

func (*Network) Write

func (self *Network) Write() error

type NetworkCallbacks

type NetworkCallbacks interface {
	NetworkCreate(network *Network) error
	NetworkUpdate(network, params *Network) error
	NetworkDelete(network *Network) error
}

type NetworkLinkSets

type NetworkLinkSets struct {
	EndpointGroups map[string]modeldb.Link `json:"EndpointGroups,omitempty"`
	Services       map[string]modeldb.Link `json:"Services,omitempty"`
}
type NetworkLinks struct {
	Tenant modeldb.Link `json:"Tenant,omitempty"`
}

type Policy

type Policy struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	PolicyName string `json:"policyName,omitempty"`
	TenantName string `json:"tenantName,omitempty"`

	// add link-sets and links
	LinkSets PolicyLinkSets `json:"link-sets,omitempty"`
	Links    PolicyLinks    `json:"links,omitempty"`
}

func FindPolicy

func FindPolicy(key string) *Policy

Return a pointer to policy from collection

func (*Policy) Delete

func (self *Policy) Delete() error

func (*Policy) GetKey

func (self *Policy) GetKey() string

func (*Policy) GetType

func (self *Policy) GetType() string

func (*Policy) Read

func (self *Policy) Read() error

func (*Policy) Write

func (self *Policy) Write() error

type PolicyCallbacks

type PolicyCallbacks interface {
	PolicyCreate(policy *Policy) error
	PolicyUpdate(policy, params *Policy) error
	PolicyDelete(policy *Policy) error
}

type PolicyLinkSets

type PolicyLinkSets struct {
	EndpointGroups map[string]modeldb.Link `json:"EndpointGroups,omitempty"`
	Rules          map[string]modeldb.Link `json:"Rules,omitempty"`
}
type PolicyLinks struct {
	Tenant modeldb.Link `json:"Tenant,omitempty"`
}

type Rule

type Rule struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	Action        string `json:"action,omitempty"`
	Direction     string `json:"direction,omitempty"`
	EndpointGroup string `json:"endpointGroup,omitempty"`
	IpAddress     string `json:"ipAddress,omitempty"`
	Network       string `json:"network,omitempty"`
	PolicyName    string `json:"policyName,omitempty"`
	Port          int    `json:"port,omitempty"`
	Priority      int    `json:"priority,omitempty"`
	Protocol      string `json:"protocol,omitempty"`
	RuleID        string `json:"ruleId,omitempty"`
	TenantName    string `json:"tenantName,omitempty"`

	// add link-sets and links
	LinkSets RuleLinkSets `json:"link-sets,omitempty"`
}

func FindRule

func FindRule(key string) *Rule

Return a pointer to rule from collection

func (*Rule) Delete

func (self *Rule) Delete() error

func (*Rule) GetKey

func (self *Rule) GetKey() string

func (*Rule) GetType

func (self *Rule) GetType() string

func (*Rule) Read

func (self *Rule) Read() error

func (*Rule) Write

func (self *Rule) Write() error

type RuleCallbacks

type RuleCallbacks interface {
	RuleCreate(rule *Rule) error
	RuleUpdate(rule, params *Rule) error
	RuleDelete(rule *Rule) error
}

type RuleLinkSets

type RuleLinkSets struct {
	Policies map[string]modeldb.Link `json:"Policies,omitempty"`
}

type Service

type Service struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	AppName        string   `json:"appName,omitempty"`
	Command        string   `json:"command,omitempty"`
	Cpu            string   `json:"cpu,omitempty"`
	EndpointGroups []string `json:"endpointGroups,omitempty"`
	Environment    []string `json:"environment,omitempty"`
	ImageName      string   `json:"imageName,omitempty"`
	Memory         string   `json:"memory,omitempty"`
	Networks       []string `json:"networks,omitempty"`
	Scale          int      `json:"scale,omitempty"`
	ServiceName    string   `json:"serviceName,omitempty"`
	TenantName     string   `json:"tenantName,omitempty"`
	VolumeProfile  string   `json:"volumeProfile,omitempty"`

	// add link-sets and links
	LinkSets ServiceLinkSets `json:"link-sets,omitempty"`
	Links    ServiceLinks    `json:"links,omitempty"`
}

func FindService

func FindService(key string) *Service

Return a pointer to service from collection

func (*Service) Delete

func (self *Service) Delete() error

func (*Service) GetKey

func (self *Service) GetKey() string

func (*Service) GetType

func (self *Service) GetType() string

func (*Service) Read

func (self *Service) Read() error

func (*Service) Write

func (self *Service) Write() error

type ServiceCallbacks

type ServiceCallbacks interface {
	ServiceCreate(service *Service) error
	ServiceUpdate(service, params *Service) error
	ServiceDelete(service *Service) error
}

type ServiceInstance

type ServiceInstance struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	AppName     string   `json:"appName,omitempty"`
	InstanceID  string   `json:"instanceId,omitempty"`
	ServiceName string   `json:"serviceName,omitempty"`
	TenantName  string   `json:"tenantName,omitempty"`
	Volumes     []string `json:"volumes,omitempty"`

	// add link-sets and links
	LinkSets ServiceInstanceLinkSets `json:"link-sets,omitempty"`
	Links    ServiceInstanceLinks    `json:"links,omitempty"`
}

func FindServiceInstance

func FindServiceInstance(key string) *ServiceInstance

Return a pointer to serviceInstance from collection

func (*ServiceInstance) Delete

func (self *ServiceInstance) Delete() error

func (*ServiceInstance) GetKey

func (self *ServiceInstance) GetKey() string

func (*ServiceInstance) GetType

func (self *ServiceInstance) GetType() string

func (*ServiceInstance) Read

func (self *ServiceInstance) Read() error

func (*ServiceInstance) Write

func (self *ServiceInstance) Write() error

type ServiceInstanceCallbacks

type ServiceInstanceCallbacks interface {
	ServiceInstanceCreate(serviceInstance *ServiceInstance) error
	ServiceInstanceUpdate(serviceInstance, params *ServiceInstance) error
	ServiceInstanceDelete(serviceInstance *ServiceInstance) error
}

type ServiceInstanceLinkSets

type ServiceInstanceLinkSets struct {
	Volumes map[string]modeldb.Link `json:"Volumes,omitempty"`
}
type ServiceInstanceLinks struct {
	Service modeldb.Link `json:"Service,omitempty"`
}

type ServiceLinkSets

type ServiceLinkSets struct {
	EndpointGroups map[string]modeldb.Link `json:"EndpointGroups,omitempty"`
	Instances      map[string]modeldb.Link `json:"Instances,omitempty"`
	Networks       map[string]modeldb.Link `json:"Networks,omitempty"`
}
type ServiceLinks struct {
	App           modeldb.Link `json:"App,omitempty"`
	VolumeProfile modeldb.Link `json:"VolumeProfile,omitempty"`
}

type Tenant

type Tenant struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	DefaultNetwork string `json:"defaultNetwork,omitempty"`
	SubnetLen      int    `json:"subnetLen,omitempty"`
	SubnetPool     string `json:"subnetPool,omitempty"`
	TenantName     string `json:"tenantName,omitempty"`
	Vlans          string `json:"vlans,omitempty"`
	Vxlans         string `json:"vxlans,omitempty"`

	// add link-sets and links
	LinkSets TenantLinkSets `json:"link-sets,omitempty"`
}

func FindTenant

func FindTenant(key string) *Tenant

Return a pointer to tenant from collection

func (*Tenant) Delete

func (self *Tenant) Delete() error

func (*Tenant) GetKey

func (self *Tenant) GetKey() string

func (*Tenant) GetType

func (self *Tenant) GetType() string

func (*Tenant) Read

func (self *Tenant) Read() error

func (*Tenant) Write

func (self *Tenant) Write() error

type TenantCallbacks

type TenantCallbacks interface {
	TenantCreate(tenant *Tenant) error
	TenantUpdate(tenant, params *Tenant) error
	TenantDelete(tenant *Tenant) error
}

type TenantLinkSets

type TenantLinkSets struct {
	Apps           map[string]modeldb.Link `json:"Apps,omitempty"`
	EndpointGroups map[string]modeldb.Link `json:"EndpointGroups,omitempty"`
	Networks       map[string]modeldb.Link `json:"Networks,omitempty"`
	Policies       map[string]modeldb.Link `json:"Policies,omitempty"`
	VolumeProfiles map[string]modeldb.Link `json:"VolumeProfiles,omitempty"`
	Volumes        map[string]modeldb.Link `json:"Volumes,omitempty"`
}

type Volume

type Volume struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	DatastoreType string `json:"datastoreType,omitempty"`
	MountPoint    string `json:"mountPoint,omitempty"`
	PoolName      string `json:"poolName,omitempty"`
	Size          string `json:"size,omitempty"`
	TenantName    string `json:"tenantName,omitempty"`
	VolumeName    string `json:"volumeName,omitempty"`

	// add link-sets and links
	LinkSets VolumeLinkSets `json:"link-sets,omitempty"`
	Links    VolumeLinks    `json:"links,omitempty"`
}

func FindVolume

func FindVolume(key string) *Volume

Return a pointer to volume from collection

func (*Volume) Delete

func (self *Volume) Delete() error

func (*Volume) GetKey

func (self *Volume) GetKey() string

func (*Volume) GetType

func (self *Volume) GetType() string

func (*Volume) Read

func (self *Volume) Read() error

func (*Volume) Write

func (self *Volume) Write() error

type VolumeCallbacks

type VolumeCallbacks interface {
	VolumeCreate(volume *Volume) error
	VolumeUpdate(volume, params *Volume) error
	VolumeDelete(volume *Volume) error
}

type VolumeLinkSets

type VolumeLinkSets struct {
	ServiceInstances map[string]modeldb.Link `json:"ServiceInstances,omitempty"`
}
type VolumeLinks struct {
	Tenant modeldb.Link `json:"Tenant,omitempty"`
}

type VolumeProfile

type VolumeProfile struct {
	// every object has a key
	Key string `json:"key,omitempty"`

	DatastoreType     string `json:"datastoreType,omitempty"`
	MountPoint        string `json:"mountPoint,omitempty"`
	PoolName          string `json:"poolName,omitempty"`
	Size              string `json:"size,omitempty"`
	TenantName        string `json:"tenantName,omitempty"`
	VolumeProfileName string `json:"volumeProfileName,omitempty"`

	// add link-sets and links
	LinkSets VolumeProfileLinkSets `json:"link-sets,omitempty"`
	Links    VolumeProfileLinks    `json:"links,omitempty"`
}

func FindVolumeProfile

func FindVolumeProfile(key string) *VolumeProfile

Return a pointer to volumeProfile from collection

func (*VolumeProfile) Delete

func (self *VolumeProfile) Delete() error

func (*VolumeProfile) GetKey

func (self *VolumeProfile) GetKey() string

func (*VolumeProfile) GetType

func (self *VolumeProfile) GetType() string

func (*VolumeProfile) Read

func (self *VolumeProfile) Read() error

func (*VolumeProfile) Write

func (self *VolumeProfile) Write() error

type VolumeProfileCallbacks

type VolumeProfileCallbacks interface {
	VolumeProfileCreate(volumeProfile *VolumeProfile) error
	VolumeProfileUpdate(volumeProfile, params *VolumeProfile) error
	VolumeProfileDelete(volumeProfile *VolumeProfile) error
}

type VolumeProfileLinkSets

type VolumeProfileLinkSets struct {
	Services map[string]modeldb.Link `json:"Services,omitempty"`
}
type VolumeProfileLinks struct {
	Tenant modeldb.Link `json:"Tenant,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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