Documentation ¶
Index ¶
- func AddRoutes(router *mux.Router)
- func CreateApp(obj *App) error
- func CreateEndpointGroup(obj *EndpointGroup) error
- func CreateGlobal(obj *Global) error
- func CreateNetwork(obj *Network) error
- func CreatePolicy(obj *Policy) error
- func CreateRule(obj *Rule) error
- func CreateService(obj *Service) error
- func CreateServiceInstance(obj *ServiceInstance) error
- func CreateTenant(obj *Tenant) error
- func CreateVolume(obj *Volume) error
- func CreateVolumeProfile(obj *VolumeProfile) error
- func DeleteApp(key string) error
- func DeleteEndpointGroup(key string) error
- func DeleteGlobal(key string) error
- func DeleteNetwork(key string) error
- func DeletePolicy(key string) error
- func DeleteRule(key string) error
- func DeleteService(key string) error
- func DeleteServiceInstance(key string) error
- func DeleteTenant(key string) error
- func DeleteVolume(key string) error
- func DeleteVolumeProfile(key string) error
- func Init()
- func RegisterAppCallbacks(handler AppCallbacks)
- func RegisterEndpointGroupCallbacks(handler EndpointGroupCallbacks)
- func RegisterGlobalCallbacks(handler GlobalCallbacks)
- func RegisterNetworkCallbacks(handler NetworkCallbacks)
- func RegisterPolicyCallbacks(handler PolicyCallbacks)
- func RegisterRuleCallbacks(handler RuleCallbacks)
- func RegisterServiceCallbacks(handler ServiceCallbacks)
- func RegisterServiceInstanceCallbacks(handler ServiceInstanceCallbacks)
- func RegisterTenantCallbacks(handler TenantCallbacks)
- func RegisterVolumeCallbacks(handler VolumeCallbacks)
- func RegisterVolumeProfileCallbacks(handler VolumeProfileCallbacks)
- func ValidateApp(obj *App) error
- func ValidateEndpointGroup(obj *EndpointGroup) error
- func ValidateGlobal(obj *Global) error
- func ValidateNetwork(obj *Network) error
- func ValidatePolicy(obj *Policy) error
- func ValidateRule(obj *Rule) error
- func ValidateService(obj *Service) error
- func ValidateServiceInstance(obj *ServiceInstance) error
- func ValidateTenant(obj *Tenant) error
- func ValidateVolume(obj *Volume) error
- func ValidateVolumeProfile(obj *VolumeProfile) error
- type App
- type AppCallbacks
- type AppLinkSets
- type AppLinks
- type CallbackHandlers
- type Collections
- type ContivClient
- func (c *ContivClient) DeleteApp(tenantName string, appName string) error
- func (c *ContivClient) DeleteEndpointGroup(tenantName string, networkName string, groupName string) error
- func (c *ContivClient) DeleteGlobal(name string) error
- func (c *ContivClient) DeleteNetwork(tenantName string, networkName string) error
- func (c *ContivClient) DeletePolicy(tenantName string, policyName string) error
- func (c *ContivClient) DeleteRule(tenantName string, policyName string, ruleId string) error
- func (c *ContivClient) DeleteService(tenantName string, appName string, serviceName string) error
- func (c *ContivClient) DeleteServiceInstance(tenantName string, appName string, serviceName string, instanceId string) error
- func (c *ContivClient) DeleteTenant(tenantName string) error
- func (c *ContivClient) DeleteVolume(tenantName string, volumeName string) error
- func (c *ContivClient) DeleteVolumeProfile(tenantName string, volumeProfileName string) error
- func (c *ContivClient) GetApp(tenantName string, appName string) (*App, error)
- func (c *ContivClient) GetEndpointGroup(tenantName string, networkName string, groupName string) (*EndpointGroup, error)
- func (c *ContivClient) GetGlobal(name string) (*Global, error)
- func (c *ContivClient) GetNetwork(tenantName string, networkName string) (*Network, error)
- func (c *ContivClient) GetPolicy(tenantName string, policyName string) (*Policy, error)
- func (c *ContivClient) GetRule(tenantName string, policyName string, ruleId string) (*Rule, error)
- func (c *ContivClient) GetService(tenantName string, appName string, serviceName string) (*Service, error)
- func (c *ContivClient) GetServiceInstance(tenantName string, appName string, serviceName string, instanceId string) (*ServiceInstance, error)
- func (c *ContivClient) GetTenant(tenantName string) (*Tenant, error)
- func (c *ContivClient) GetVolume(tenantName string, volumeName string) (*Volume, error)
- func (c *ContivClient) GetVolumeProfile(tenantName string, volumeProfileName string) (*VolumeProfile, error)
- func (c *ContivClient) PostApp(obj *App) error
- func (c *ContivClient) PostEndpointGroup(obj *EndpointGroup) error
- func (c *ContivClient) PostGlobal(obj *Global) error
- func (c *ContivClient) PostNetwork(obj *Network) error
- func (c *ContivClient) PostPolicy(obj *Policy) error
- func (c *ContivClient) PostRule(obj *Rule) error
- func (c *ContivClient) PostService(obj *Service) error
- func (c *ContivClient) PostServiceInstance(obj *ServiceInstance) error
- func (c *ContivClient) PostTenant(obj *Tenant) error
- func (c *ContivClient) PostVolume(obj *Volume) error
- func (c *ContivClient) PostVolumeProfile(obj *VolumeProfile) error
- type EndpointGroup
- type EndpointGroupCallbacks
- type EndpointGroupLinkSets
- type EndpointGroupLinks
- type Global
- type GlobalCallbacks
- type HttpApiFunc
- type Network
- type NetworkCallbacks
- type NetworkLinkSets
- type NetworkLinks
- type Policy
- type PolicyCallbacks
- type PolicyLinkSets
- type PolicyLinks
- type Rule
- type RuleCallbacks
- type RuleLinkSets
- type Service
- type ServiceCallbacks
- type ServiceInstance
- type ServiceInstanceCallbacks
- type ServiceInstanceLinkSets
- type ServiceInstanceLinks
- type ServiceLinkSets
- type ServiceLinks
- type Tenant
- type TenantCallbacks
- type TenantLinkSets
- type Volume
- type VolumeCallbacks
- type VolumeLinkSets
- type VolumeLinks
- type VolumeProfile
- type VolumeProfileCallbacks
- type VolumeProfileLinkSets
- type VolumeProfileLinks
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateEndpointGroup ¶
func CreateEndpointGroup(obj *EndpointGroup) error
Create a endpointGroup object
func CreateServiceInstance ¶
func CreateServiceInstance(obj *ServiceInstance) error
Create a serviceInstance object
func CreateVolumeProfile ¶
func CreateVolumeProfile(obj *VolumeProfile) error
Create a volumeProfile object
func DeleteServiceInstance ¶
Delete a serviceInstance object
func RegisterAppCallbacks ¶
func RegisterAppCallbacks(handler AppCallbacks)
func RegisterEndpointGroupCallbacks ¶
func RegisterEndpointGroupCallbacks(handler EndpointGroupCallbacks)
func RegisterGlobalCallbacks ¶
func RegisterGlobalCallbacks(handler GlobalCallbacks)
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 ValidateEndpointGroup ¶
func ValidateEndpointGroup(obj *EndpointGroup) error
Validate a endpointGroup object
func ValidateServiceInstance ¶
func ValidateServiceInstance(obj *ServiceInstance) error
Validate a serviceInstance 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"` }
type AppCallbacks ¶
type AppLinkSets ¶
type CallbackHandlers ¶
type CallbackHandlers struct { AppCb AppCallbacks EndpointGroupCb EndpointGroupCallbacks GlobalCb GlobalCallbacks 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 ContivClient ¶
type ContivClient struct {
// contains filtered or unexported fields
}
ContivClient has the contiv model client instance
func NewContivClient ¶
func NewContivClient(baseURL string) (*ContivClient, error)
NewContivClient returns a new client instance
func (*ContivClient) DeleteApp ¶
func (c *ContivClient) DeleteApp(tenantName string, appName string) error
DeleteApp deletes the app object
func (*ContivClient) DeleteEndpointGroup ¶
func (c *ContivClient) DeleteEndpointGroup(tenantName string, networkName string, groupName string) error
DeleteEndpointGroup deletes the endpointGroup object
func (*ContivClient) DeleteGlobal ¶
func (c *ContivClient) DeleteGlobal(name string) error
DeleteGlobal deletes the global object
func (*ContivClient) DeleteNetwork ¶
func (c *ContivClient) DeleteNetwork(tenantName string, networkName string) error
DeleteNetwork deletes the network object
func (*ContivClient) DeletePolicy ¶
func (c *ContivClient) DeletePolicy(tenantName string, policyName string) error
DeletePolicy deletes the policy object
func (*ContivClient) DeleteRule ¶
func (c *ContivClient) DeleteRule(tenantName string, policyName string, ruleId string) error
DeleteRule deletes the rule object
func (*ContivClient) DeleteService ¶
func (c *ContivClient) DeleteService(tenantName string, appName string, serviceName string) error
DeleteService deletes the service object
func (*ContivClient) DeleteServiceInstance ¶
func (c *ContivClient) DeleteServiceInstance(tenantName string, appName string, serviceName string, instanceId string) error
DeleteServiceInstance deletes the serviceInstance object
func (*ContivClient) DeleteTenant ¶
func (c *ContivClient) DeleteTenant(tenantName string) error
DeleteTenant deletes the tenant object
func (*ContivClient) DeleteVolume ¶
func (c *ContivClient) DeleteVolume(tenantName string, volumeName string) error
DeleteVolume deletes the volume object
func (*ContivClient) DeleteVolumeProfile ¶
func (c *ContivClient) DeleteVolumeProfile(tenantName string, volumeProfileName string) error
DeleteVolumeProfile deletes the volumeProfile object
func (*ContivClient) GetApp ¶
func (c *ContivClient) GetApp(tenantName string, appName string) (*App, error)
GetApp gets the app object
func (*ContivClient) GetEndpointGroup ¶
func (c *ContivClient) GetEndpointGroup(tenantName string, networkName string, groupName string) (*EndpointGroup, error)
GetEndpointGroup gets the endpointGroup object
func (*ContivClient) GetGlobal ¶
func (c *ContivClient) GetGlobal(name string) (*Global, error)
GetGlobal gets the global object
func (*ContivClient) GetNetwork ¶
func (c *ContivClient) GetNetwork(tenantName string, networkName string) (*Network, error)
GetNetwork gets the network object
func (*ContivClient) GetPolicy ¶
func (c *ContivClient) GetPolicy(tenantName string, policyName string) (*Policy, error)
GetPolicy gets the policy object
func (*ContivClient) GetService ¶
func (c *ContivClient) GetService(tenantName string, appName string, serviceName string) (*Service, error)
GetService gets the service object
func (*ContivClient) GetServiceInstance ¶
func (c *ContivClient) GetServiceInstance(tenantName string, appName string, serviceName string, instanceId string) (*ServiceInstance, error)
GetServiceInstance gets the serviceInstance object
func (*ContivClient) GetTenant ¶
func (c *ContivClient) GetTenant(tenantName string) (*Tenant, error)
GetTenant gets the tenant object
func (*ContivClient) GetVolume ¶
func (c *ContivClient) GetVolume(tenantName string, volumeName string) (*Volume, error)
GetVolume gets the volume object
func (*ContivClient) GetVolumeProfile ¶
func (c *ContivClient) GetVolumeProfile(tenantName string, volumeProfileName string) (*VolumeProfile, error)
GetVolumeProfile gets the volumeProfile object
func (*ContivClient) PostApp ¶
func (c *ContivClient) PostApp(obj *App) error
PostApp posts the app object
func (*ContivClient) PostEndpointGroup ¶
func (c *ContivClient) PostEndpointGroup(obj *EndpointGroup) error
PostEndpointGroup posts the endpointGroup object
func (*ContivClient) PostGlobal ¶
func (c *ContivClient) PostGlobal(obj *Global) error
PostGlobal posts the global object
func (*ContivClient) PostNetwork ¶
func (c *ContivClient) PostNetwork(obj *Network) error
PostNetwork posts the network object
func (*ContivClient) PostPolicy ¶
func (c *ContivClient) PostPolicy(obj *Policy) error
PostPolicy posts the policy object
func (*ContivClient) PostRule ¶
func (c *ContivClient) PostRule(obj *Rule) error
PostRule posts the rule object
func (*ContivClient) PostService ¶
func (c *ContivClient) PostService(obj *Service) error
PostService posts the service object
func (*ContivClient) PostServiceInstance ¶
func (c *ContivClient) PostServiceInstance(obj *ServiceInstance) error
PostServiceInstance posts the serviceInstance object
func (*ContivClient) PostTenant ¶
func (c *ContivClient) PostTenant(obj *Tenant) error
PostTenant posts the tenant object
func (*ContivClient) PostVolume ¶
func (c *ContivClient) PostVolume(obj *Volume) error
PostVolume posts the volume object
func (*ContivClient) PostVolumeProfile ¶
func (c *ContivClient) PostVolumeProfile(obj *VolumeProfile) error
PostVolumeProfile posts the volumeProfile object
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 EndpointGroupLinks ¶
type Global ¶
type GlobalCallbacks ¶
type HttpApiFunc ¶
type Network ¶
type Network struct { // every object has a key Key string `json:"key,omitempty"` Encap string `json:"encap,omitempty"` Gateway string `json:"gateway,omitempty"` IsPrivate bool `json:"isPrivate,omitempty"` IsPublic bool `json:"isPublic,omitempty"` NetworkName string `json:"networkName,omitempty"` PktTag int `json:"pktTag,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 ¶
Return a pointer to network from collection
type NetworkCallbacks ¶
type NetworkLinkSets ¶
type NetworkLinks ¶
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"` }
type PolicyCallbacks ¶
type PolicyLinkSets ¶
type PolicyLinks ¶
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"` }
type RuleCallbacks ¶
type RuleLinkSets ¶
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 ¶
Return a pointer to service from collection
type ServiceCallbacks ¶
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 ServiceInstanceLinks ¶
type ServiceLinkSets ¶
type ServiceLinks ¶
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"` }
type TenantCallbacks ¶
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"` }
type VolumeCallbacks ¶
type VolumeLinkSets ¶
type VolumeLinks ¶
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 }