contivModel

package
v0.0.0-09-18-2015.23-1... Latest Latest
Warning

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

Go to latest
Published: Sep 18, 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 {
	Key        string      `json:"key,omitempty"`
	TenantName string      `json:"tenantName,omitempty"`
	AppName    string      `json:"appName,omitempty"`
	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 {
	Key         string                `json:"key,omitempty"`
	GroupName   string                `json:"groupName,omitempty"`
	TenantName  string                `json:"tenantName,omitempty"`
	NetworkName string                `json:"networkName,omitempty"`
	Policies    []string              `json:"policies,omitempty"`
	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 {
	Services map[string]modeldb.Link `json:"services,omitempty"`
	Policies map[string]modeldb.Link `json:"policies,omitempty"`
}
type EndpointGroupLinks struct {
	Tenant  modeldb.Link `json:"tenant,omitempty"`
	Network modeldb.Link `json:"network,omitempty"`
}

type HttpApiFunc

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

type Network

type Network struct {
	Key         string          `json:"key,omitempty"`
	IsPrivate   bool            `json:"isPrivate,omitempty"`
	Encap       string          `json:"encap,omitempty"`
	Subnet      string          `json:"subnet,omitempty"`
	DefaultGw   string          `json:"defaultGw,omitempty"`
	NetworkName string          `json:"networkName,omitempty"`
	TenantName  string          `json:"tenantName,omitempty"`
	IsPublic    bool            `json:"isPublic,omitempty"`
	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 {
	Key        string         `json:"key,omitempty"`
	PolicyName string         `json:"policyName,omitempty"`
	TenantName string         `json:"tenantName,omitempty"`
	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 {
	Key           string       `json:"key,omitempty"`
	EndpointGroup string       `json:"endpointGroup,omitempty"`
	Network       string       `json:"network,omitempty"`
	Protocol      string       `json:"protocol,omitempty"`
	RuleName      string       `json:"ruleName,omitempty"`
	PolicyName    string       `json:"policyName,omitempty"`
	TenantName    string       `json:"tenantName,omitempty"`
	Direction     string       `json:"direction,omitempty"`
	IpAddress     string       `json:"ipAddress,omitempty"`
	Port          int64        `json:"port,omitempty"`
	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 {
	Key            string          `json:"key,omitempty"`
	Scale          int64           `json:"scale,omitempty"`
	ServiceName    string          `json:"serviceName,omitempty"`
	AppName        string          `json:"appName,omitempty"`
	ImageName      string          `json:"imageName,omitempty"`
	Cpu            string          `json:"cpu,omitempty"`
	EndpointGroups []string        `json:"endpointGroups,omitempty"`
	Networks       []string        `json:"networks,omitempty"`
	VolumeProfile  string          `json:"volumeProfile,omitempty"`
	TenantName     string          `json:"tenantName,omitempty"`
	Memory         string          `json:"memory,omitempty"`
	Command        string          `json:"command,omitempty"`
	Environment    []string        `json:"environment,omitempty"`
	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 {
	Key         string                  `json:"key,omitempty"`
	InstanceID  string                  `json:"instanceId,omitempty"`
	TenantName  string                  `json:"tenantName,omitempty"`
	AppName     string                  `json:"appName,omitempty"`
	ServiceName string                  `json:"serviceName,omitempty"`
	Volumes     []string                `json:"volumes,omitempty"`
	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 {
	Networks       map[string]modeldb.Link `json:"networks,omitempty"`
	EndpointGroups map[string]modeldb.Link `json:"endpointGroups,omitempty"`
	Instances      map[string]modeldb.Link `json:"instances,omitempty"`
}
type ServiceLinks struct {
	VolumeProfile modeldb.Link `json:"volumeProfile,omitempty"`
	App           modeldb.Link `json:"app,omitempty"`
}

type Tenant

type Tenant struct {
	Key        string         `json:"key,omitempty"`
	TenantName string         `json:"tenantName,omitempty"`
	SubnetPool string         `json:"subnetPool,omitempty"`
	SubnetLen  int64          `json:"subnetLen,omitempty"`
	Vlans      string         `json:"vlans,omitempty"`
	Vxlans     string         `json:"vxlans,omitempty"`
	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 {
	EndpointGroups map[string]modeldb.Link `json:"endpointGroups,omitempty"`
	Policies       map[string]modeldb.Link `json:"policies,omitempty"`
	Volumes        map[string]modeldb.Link `json:"volumes,omitempty"`
	VolumeProfiles map[string]modeldb.Link `json:"volumeProfiles,omitempty"`
	Networks       map[string]modeldb.Link `json:"networks,omitempty"`
	Apps           map[string]modeldb.Link `json:"apps,omitempty"`
}

type Volume

type Volume struct {
	Key           string         `json:"key,omitempty"`
	Size          string         `json:"size,omitempty"`
	MountPoint    string         `json:"mountPoint,omitempty"`
	VolumeName    string         `json:"volumeName,omitempty"`
	TenantName    string         `json:"tenantName,omitempty"`
	DatastoreType string         `json:"datastoreType,omitempty"`
	PoolName      string         `json:"poolName,omitempty"`
	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 {
	Key               string                `json:"key,omitempty"`
	Size              string                `json:"size,omitempty"`
	MountPoint        string                `json:"mountPoint,omitempty"`
	VolumeProfileName string                `json:"volumeProfileName,omitempty"`
	TenantName        string                `json:"tenantName,omitempty"`
	DatastoreType     string                `json:"datastoreType,omitempty"`
	PoolName          string                `json:"poolName,omitempty"`
	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