v1

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ObjectTypeAttachedObjectReference string = "AttachedObjectReference"

	AttachedObjectStreamName = "attachedObjectStream"

	AttachedObjectReferenceSubject       = "attachedObjectReference.*"
	AttachedObjectReferenceCreateSubject = "attachedObjectReference.create"
	AttachedObjectReferenceUpdateSubject = "attachedObjectReference.update"
	AttachedObjectReferenceDeleteSubject = "attachedObjectReference.delete"

	PathAttachedObjectReferences = "/v1/attached-object-references"
)
View Source
const (
	ObjectTypeWorkloadInstance string = "WorkloadInstance"

	WorkloadStreamName = "workloadStream"

	WorkloadInstanceSubject       = "workloadInstance.*"
	WorkloadInstanceCreateSubject = "workloadInstance.create"
	WorkloadInstanceUpdateSubject = "workloadInstance.update"
	WorkloadInstanceDeleteSubject = "workloadInstance.delete"

	PathWorkloadInstances = "/v1/workload-instances"
)

Variables

This section is empty.

Functions

func GetAttachedObjectReferenceSubjects

func GetAttachedObjectReferenceSubjects() []string

GetAttachedObjectReferenceSubjects returns the NATS subjects for attached object references.

func GetAttachedObjectSubjects

func GetAttachedObjectSubjects() []string

GetAttachedObjectSubjects returns the NATS subjects for all attached object objects.

func GetSubjectByReconcilerName

func GetSubjectByReconcilerName(name string) (string, error)

GetSubjectByReconcilerName returns the subject for a reconciler's name.

func GetWorkloadInstanceSubjects

func GetWorkloadInstanceSubjects() []string

GetWorkloadInstanceSubjects returns the NATS subjects for workload instances.

func GetWorkloadSubjects

func GetWorkloadSubjects() []string

GetWorkloadSubjects returns the NATS subjects for all workload objects.

Types

type AttachedObjectReference

type AttachedObjectReference struct {
	v0.Common `swaggerignore:"true" mapstructure:",squash"`

	// The object type of the base object.
	ObjectType *string `json:"ObjectType,omitempty" query:"objecttype" gorm:"not null" validate:"required"`

	// The object ID of the base object.
	ObjectID *uint `json:"ObjectID,omitempty" query:"objectid" gorm:"not null" validate:"required"`

	// The object type of the attached object.
	AttachedObjectType *string `json:"AttachedObjectType,omitempty" query:"attachedobjecttype" gorm:"not null" validate:"required"`

	// The object ID of the attached object.
	AttachedObjectID *uint `json:"AttachedObjectID,omitempty" query:"attachedobjectid" gorm:"not null" validate:"required"`
}

AttachedObjectReference is a reference to an attached object.

func (*AttachedObjectReference) DecodeNotifObject

func (aor *AttachedObjectReference) DecodeNotifObject(object interface{}) error

DecodeNotifObject takes the threeport object in the form of a map[string]interface and returns the typed object by marshalling into JSON and then unmarshalling into the typed object. We are not using the mapstructure library here as that requires custom decode hooks to manage fields with non-native go types.

func (*AttachedObjectReference) GetID

func (aor *AttachedObjectReference) GetID() uint

GetID returns the unique ID for the object.

func (*AttachedObjectReference) NotificationPayload

func (aor *AttachedObjectReference) NotificationPayload(
	operation notifications.NotificationOperation,
	requeue bool,
	creationTime int64,
) (*[]byte, error)

NotificationPayload returns the notification payload that is delivered to the controller when a change is made. It includes the object as presented by the client when the change was made.

func (AttachedObjectReference) String

func (aor AttachedObjectReference) String() string

String returns a string representation of the ojbect.

type WorkloadInstance

type WorkloadInstance struct {
	v0.Common         `swaggerignore:"true" mapstructure:",squash"`
	v0.Instance       `mapstructure:",squash"`
	v0.Reconciliation `mapstructure:",squash"`

	// The kubernetes runtime to which the workload is deployed.
	KubernetesRuntimeInstanceID *uint `json:"KubernetesRuntimeInstanceID,omitempty" query:"kubernetesruntimeinstanceid" gorm:"not null" validate:"required"`

	// The definition used to configure the workload instance.
	WorkloadDefinitionID *uint `json:"WorkloadDefinitionID,omitempty" query:"workloaddefinitionid" gorm:"not null" validate:"required"`

	// The associated workload resource definitions that are derived.
	WorkloadResourceInstances []*v0.WorkloadResourceInstance `json:"WorkloadResourceInstances,omitempty" validate:"optional,association"`

	// The latest status of a workload instance.
	Status *string `json:"Status,omitempty" query:"status" validate:"optional"`

	// All events generated for the workload instance that aren't related to a
	// particular workload resource instance.
	Events []*v0.WorkloadEvent `json:"Events,omitempty" query:"events" validate:"optional"`
}

WorkloadInstance is a deployed instance of a workload.

func (*WorkloadInstance) DecodeNotifObject

func (wi *WorkloadInstance) DecodeNotifObject(object interface{}) error

DecodeNotifObject takes the threeport object in the form of a map[string]interface and returns the typed object by marshalling into JSON and then unmarshalling into the typed object. We are not using the mapstructure library here as that requires custom decode hooks to manage fields with non-native go types.

func (*WorkloadInstance) GetID

func (wi *WorkloadInstance) GetID() uint

GetID returns the unique ID for the object.

func (*WorkloadInstance) NotificationPayload

func (wi *WorkloadInstance) NotificationPayload(
	operation notifications.NotificationOperation,
	requeue bool,
	creationTime int64,
) (*[]byte, error)

NotificationPayload returns the notification payload that is delivered to the controller when a change is made. It includes the object as presented by the client when the change was made.

func (WorkloadInstance) String

func (wi WorkloadInstance) String() string

String returns a string representation of the ojbect.

Jump to

Keyboard shortcuts

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