resource

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidationInstance

func ValidationInstance(instanceCreation *instancev1alpha1.ServiceInstanceCreation) error

ValidationInstance check the Instance data in memory is valid or not

Types

type IResource

type IResource interface {
	GetResourceType() Type
	GetCommonDBObject(key string) (interface{}, error)
	GetObjectProcessTime(obj interface{}) time.Time
	GetObjectStatus(obj interface{}) string
	GetObjectID(obj interface{}) string
	GetObjectListByStatusSets(status sets.String) ([]interface{}, error)
	UpdateProcessFailed(obj interface{}, status string, msg string) error
	UpdateObjProcessTime(obj interface{}, processTime time.Time) error
	GetObjUpdateTime(obj interface{}) time.Time
}

IResource of the interface to use the database and/or cluster

func GetResourceByType

func GetResourceByType(rType Type) IResource

GetResourceByType get the resource by type name

type InstanceResource

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

InstanceResource operate instance information in database and/or cluster

func (*InstanceResource) CreateInstance

func (i *InstanceResource) CreateInstance(instances []internals.ServiceInstance, param map[string]string) error

CreateInstance into database, and add event to the synchronizing list which for deploying the service instance into cluster

func (*InstanceResource) DeleteInstance

func (i *InstanceResource) DeleteInstance(clusterName, instanceName, namespace string) error

DeleteInstance in database and cluster

func (*InstanceResource) GetCommonDBObject

func (i *InstanceResource) GetCommonDBObject(pk string) (interface{}, error)

GetCommonDBObject get the data from database and return the inner structure will use in manager

func (*InstanceResource) GetInstance

func (i *InstanceResource) GetInstance(sbName, clusterName, ns, instanceName string) (models.InstanceModel, error)

GetInstance get the instance from database, and filter it by service binding name, cluster name, and namespace

func (*InstanceResource) GetInstanceInitialCondition

func (i *InstanceResource) GetInstanceInitialCondition() []internals.Condition

GetInstanceInitialCondition get the instance condition which using for the synchronizing

func (*InstanceResource) GetInstances

func (i *InstanceResource) GetInstances(sbName, clusterName, ns string) ([]models.InstanceModel, error)

GetInstances get the instance list from database, and filter it by service binding name, cluster name, and namespace

func (*InstanceResource) GetObjUpdateTime

func (i *InstanceResource) GetObjUpdateTime(obj interface{}) time.Time

GetObjUpdateTime get the service instance update timestamp

func (*InstanceResource) GetObjectID

func (i *InstanceResource) GetObjectID(obj interface{}) string

GetObjectID get the service instance id (primary key in database )

func (*InstanceResource) GetObjectListByStatusSets

func (i *InstanceResource) GetObjectListByStatusSets(status sets.String) ([]interface{}, error)

GetObjectListByStatusSets get the service instance list with the status

func (*InstanceResource) GetObjectProcessTime

func (i *InstanceResource) GetObjectProcessTime(obj interface{}) time.Time

GetObjectProcessTime get the process time for the service instance (using for synchronizing)

func (*InstanceResource) GetObjectStatus

func (i *InstanceResource) GetObjectStatus(obj interface{}) string

GetObjectStatus get the service instance status

func (*InstanceResource) GetResourceType

func (i *InstanceResource) GetResourceType() Type

GetResourceType of the service instance

func (*InstanceResource) UpdateInstallCondition

func (i *InstanceResource) UpdateInstallCondition(ins *internals.ServiceInstance,
	conType instance.InstallConditionType, status instance.ConditionStatus, msg string) error

UpdateInstallCondition of the instance

func (*InstanceResource) UpdateObjProcessTime

func (i *InstanceResource) UpdateObjProcessTime(obj interface{}, processTime time.Time) error

UpdateObjProcessTime update the process time for the service instance (using for synchronizing)

func (*InstanceResource) UpdateProcessFailed

func (i *InstanceResource) UpdateProcessFailed(obj interface{}, status string, msg string) error

UpdateProcessFailed update the service instance status to Failed

type ServiceBindingResource

type ServiceBindingResource struct {
	mo.ServiceBindingOperation
	// contains filtered or unexported fields
}

ServiceBindingResource operate service information in database and/or cluster

func (*ServiceBindingResource) CreateServiceBinding

func (s *ServiceBindingResource) CreateServiceBinding(serviceBinding internals.ServiceBinding) error

CreateServiceBinding create the service binding into cluster and insert the record to the database

func (*ServiceBindingResource) DeleteServiceBinding

func (s *ServiceBindingResource) DeleteServiceBinding(bindingName, clusterName string) error

DeleteServiceBinding use the service binding name and cluster name to delete the service binding

func (*ServiceBindingResource) DeleteServiceInCluster

func (s *ServiceBindingResource) DeleteServiceInCluster(_, _ string) (string, error)

DeleteServiceInCluster delete the service in cluster

func (*ServiceBindingResource) GetCommonDBObject

func (s *ServiceBindingResource) GetCommonDBObject(pk string) (interface{}, error)

GetCommonDBObject get the service binding information from the database

func (*ServiceBindingResource) GetInternalServiceBinding

func (s *ServiceBindingResource) GetInternalServiceBinding(serviceBindingName string,
	clusterName string) (*internals.ServiceBinding, error)

GetInternalServiceBinding get the ServiceBinding as the internal format

func (*ServiceBindingResource) GetObjUpdateTime

func (s *ServiceBindingResource) GetObjUpdateTime(obj interface{}) time.Time

GetObjUpdateTime get the object update timestamp

func (*ServiceBindingResource) GetObjectID

func (s *ServiceBindingResource) GetObjectID(obj interface{}) string

GetObjectID get the service binding's id

func (*ServiceBindingResource) GetObjectListByStatusSets

func (s *ServiceBindingResource) GetObjectListByStatusSets(status sets.String) ([]interface{}, error)

GetObjectListByStatusSets get the object list

func (*ServiceBindingResource) GetObjectProcessTime

func (s *ServiceBindingResource) GetObjectProcessTime(obj interface{}) time.Time

GetObjectProcessTime get the service binding process timestamp

func (*ServiceBindingResource) GetObjectStatus

func (s *ServiceBindingResource) GetObjectStatus(obj interface{}) string

GetObjectStatus get the ServiceBinding status

func (*ServiceBindingResource) GetResourceType

func (s *ServiceBindingResource) GetResourceType() Type

GetResourceType get the resource type, and it is service binding

func (*ServiceBindingResource) GetServiceBinding

func (s *ServiceBindingResource) GetServiceBinding(name, clusterName string,
	detail bool) (*instancev1alpha1.CloudNativeServiceInstance, error)

GetServiceBinding use name, clusterId to get the service binding information

func (*ServiceBindingResource) GetServiceBindings

func (s *ServiceBindingResource) GetServiceBindings(clusterName string) ([]instancev1alpha1.CloudNativeServiceInstance, error)

GetServiceBindings get service bindings of this cluster

func (*ServiceBindingResource) IsServiceBindingDeployed

func (s *ServiceBindingResource) IsServiceBindingDeployed(name, cluster string) bool

IsServiceBindingDeployed does the service binding has already deployed to the target cluster

func (*ServiceBindingResource) UpdateObjProcessTime

func (s *ServiceBindingResource) UpdateObjProcessTime(obj interface{}, processTime time.Time) error

UpdateObjProcessTime update the process timestamp

func (*ServiceBindingResource) UpdateProcessFailed

func (s *ServiceBindingResource) UpdateProcessFailed(obj interface{}, status string, msg string) error

UpdateProcessFailed update the object to failed status

type Type

type Type string

Type of the service instance and binding resource

const (
	// ServiceInstanceType the service instance resource type name
	ServiceInstanceType Type = "instance"
	// ServiceBindingType the service binding resource type name
	ServiceBindingType Type = "servicebinding"
)

Jump to

Keyboard shortcuts

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