Documentation ¶
Overview ¶
Package model provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.3.0 DO NOT EDIT.
The file implements the Entity interface on the ModelDefinition struct. This is not autogenerated.
Index ¶
- type Model
- type ModelDefinition
- func (m *ModelDefinition) Create(db *database.Handler, hostID uuid.UUID) (uuid.UUID, error)
- func (m *ModelDefinition) GenerateID() (uuid.UUID, error)
- func (m *ModelDefinition) GetEntityDetail() string
- func (m ModelDefinition) GetID() uuid.UUID
- func (m ModelDefinition) TableName() string
- func (m ModelDefinition) Type() entity.EntityType
- func (m *ModelDefinition) UpdateStatus(db *database.Handler, status entity.EntityStatus) error
- func (m ModelDefinition) WriteModelDefinition(modelDefPath string, outputType string) error
- type ModelDefinitionMetadataCapabilitiesEntityState
- type ModelDefinitionMetadataCapabilitiesStatus
- type ModelDefinitionRegistrantStatus
- type ModelDefinitionStatus
- type ModelDefinition_Metadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Model ¶
type Model struct { // Version Version of the model as defined by the registrant. Version string `json:"version" yaml:"version"` }
type ModelDefinition ¶
type ModelDefinition struct { // Category Category of the model. Category category.CategoryDefinition `json:"category" yaml:"category" gorm:"foreignKey:CategoryId;references:Id"` CategoryId uuid.UUID `json:"-" yaml:"-" gorm:"categoryID"` // Description Description of the model. Description string `json:"description,omitempty" yaml:"description,omitempty"` // DisplayName Human-readable name for the model. DisplayName string `json:"displayName" yaml:"displayName"` // Id Uniquely identifies the entity (i.e. component) as defined in a declaration (i.e. design). Id uuid.UUID `json:"id" yaml:"id"` // Metadata Metadata containing additional information associated with the model. Metadata *ModelDefinition_Metadata `gorm:"type:bytes;serializer:json" json:"metadata,omitempty" yaml:"metadata"` // Model Registrant-defined data associated with the model. Properties pertain to the software being managed (e.g. Kubernetes v1.31) Model Model `gorm:"type:bytes;serializer:json" json:"model,omitempty" yaml:"model"` // Name The unique name for the model within the scope of a registrant. Name string `json:"name" yaml:"name"` // Registrant Meshplay Connections are managed and unmanaged resources that either through discovery or manual entry are tracked by Meshplay. Learn more at https://docs-meshplay.khulnasoft.com/concepts/logical/connections Registrant connection.Connection `gorm:"foreignKey:RegistrantId;references:Id" json:"registrant" yaml:"registrant"` RegistrantId uuid.UUID `json:"connection_id" gorm:"column:connection_id" yaml:"connection_id"` // SchemaVersion Specifies the version of the schema used for the definition. SchemaVersion string `json:"schemaVersion" yaml:"schemaVersion"` // Status Status of model, including: // - duplicate: this component is a duplicate of another. The component that is to be the canonical reference and that is duplicated by other components should not be assigned the 'duplicate' status. // - maintenance: model is unavailable for a period of time. // - enabled: model is available for use for all users of this Meshplay Server. // - ignored: model is unavailable for use for all users of this Meshplay Server. Status ModelDefinitionStatus `json:"status" yaml:"status"` // SubCategory Sub-category of the model. SubCategory string `json:"subCategory,omitempty" yaml:"subCategory,omitempty"` // Version Version of the model definition. Version string `json:"version" yaml:"version"` Components interface{} `json:"components" gorm:"-" yaml:"components"` // To prevent cyclic error, the type is changed to interface, it doesn't affect registration // Edited on purpose Relationships interface{} `json:"relationships" gorm:"-" yaml:"relationships"` }
ModelDefinition Meshplay Models serve as a portable unit of packaging to define managed entities, their relationships, and capabilities.
func (*ModelDefinition) GenerateID ¶
func (m *ModelDefinition) GenerateID() (uuid.UUID, error)
func (*ModelDefinition) GetEntityDetail ¶
func (m *ModelDefinition) GetEntityDetail() string
func (ModelDefinition) GetID ¶
func (m ModelDefinition) GetID() uuid.UUID
func (ModelDefinition) TableName ¶
func (m ModelDefinition) TableName() string
func (ModelDefinition) Type ¶
func (m ModelDefinition) Type() entity.EntityType
func (*ModelDefinition) UpdateStatus ¶
func (m *ModelDefinition) UpdateStatus(db *database.Handler, status entity.EntityStatus) error
func (ModelDefinition) WriteModelDefinition ¶
func (m ModelDefinition) WriteModelDefinition(modelDefPath string, outputType string) error
WriteModelDefinition writes out the model to the given `modelDefPath` in the `outputType` format. `outputType` can be `yaml` or `json`. Usage: model.WriteModelDefinition("./modelName/model.yaml", "yaml")
type ModelDefinitionMetadataCapabilitiesEntityState ¶
type ModelDefinitionMetadataCapabilitiesEntityState string
ModelDefinitionMetadataCapabilitiesEntityState defines model for ModelDefinition.Metadata.Capabilities.EntityState.
const ( Declaration ModelDefinitionMetadataCapabilitiesEntityState = "declaration" Instance ModelDefinitionMetadataCapabilitiesEntityState = "instance" )
Defines values for ModelDefinitionMetadataCapabilitiesEntityState.
type ModelDefinitionMetadataCapabilitiesStatus ¶
type ModelDefinitionMetadataCapabilitiesStatus string
ModelDefinitionMetadataCapabilitiesStatus Status of the capability
const ( ModelDefinitionMetadataCapabilitiesStatusDisabled ModelDefinitionMetadataCapabilitiesStatus = "disabled" ModelDefinitionMetadataCapabilitiesStatusEnabled ModelDefinitionMetadataCapabilitiesStatus = "enabled" )
Defines values for ModelDefinitionMetadataCapabilitiesStatus.
type ModelDefinitionRegistrantStatus ¶
type ModelDefinitionRegistrantStatus string
ModelDefinitionRegistrantStatus Connection Status
const ( Connected ModelDefinitionRegistrantStatus = "connected" Deleted ModelDefinitionRegistrantStatus = "deleted" Disconnected ModelDefinitionRegistrantStatus = "disconnected" Discovered ModelDefinitionRegistrantStatus = "discovered" Ignored ModelDefinitionRegistrantStatus = "ignored" Maintenance ModelDefinitionRegistrantStatus = "maintenance" NotFound ModelDefinitionRegistrantStatus = "not found" Registered ModelDefinitionRegistrantStatus = "registered" )
Defines values for ModelDefinitionRegistrantStatus.
type ModelDefinitionStatus ¶
type ModelDefinitionStatus string
ModelDefinitionStatus Status of model, including: - duplicate: this component is a duplicate of another. The component that is to be the canonical reference and that is duplicated by other components should not be assigned the 'duplicate' status. - maintenance: model is unavailable for a period of time. - enabled: model is available for use for all users of this Meshplay Server. - ignored: model is unavailable for use for all users of this Meshplay Server.
const ( ModelDefinitionStatusDuplicate ModelDefinitionStatus = "duplicate" ModelDefinitionStatusEnabled ModelDefinitionStatus = "enabled" ModelDefinitionStatusIgnored ModelDefinitionStatus = "ignored" )
Defines values for ModelDefinitionStatus.
type ModelDefinition_Metadata ¶
type ModelDefinition_Metadata struct { // Capabilities Meshplay manages entities in accordance with their specific capabilities. This field explicitly identifies those capabilities largely by what actions a given component supports; e.g. metric-scrape, sub-interface, and so on. This field is extensible. Entities may define a broad array of capabilities, which are in-turn dynamically interpretted by Meshplay for full lifecycle management. Capabilities *[]capability.Capability `json:"capabilities,omitempty" yaml:"capabilities"` // IsAnnotation Indicates whether the model and its entities should be treated as deployable entities or as logical representations. IsAnnotation *bool `json:"isAnnotation" yaml:"isAnnotation"` // PrimaryColor Primary color associated with the model. PrimaryColor *string `json:"primaryColor" yaml:"primaryColor"` // SecondaryColor Secondary color associated with the model. SecondaryColor *string `json:"secondaryColor" yaml:"secondaryColor"` // SvgColor SVG representation of the model in colored format. SvgColor string `json:"svgColor" yaml:"svgColor"` // SvgComplete SVG representation of the complete model. SvgComplete *string `json:"svgComplete,omitempty" yaml:"svgComplete,omitempty"` // SvgWhite SVG representation of the model in white color. SvgWhite string `json:"svgWhite" yaml:"svgWhite"` AdditionalProperties map[string]interface{} `json:"-" yaml:"-"` }
ModelDefinition_Metadata Metadata containing additional information associated with the model.
func (ModelDefinition_Metadata) Get ¶
func (a ModelDefinition_Metadata) Get(fieldName string) (value interface{}, found bool)
Getter for additional properties for ModelDefinition_Metadata. Returns the specified element and whether it was found
func (ModelDefinition_Metadata) MarshalJSON ¶
func (a ModelDefinition_Metadata) MarshalJSON() ([]byte, error)
Override default JSON handling for ModelDefinition_Metadata to handle AdditionalProperties
func (*ModelDefinition_Metadata) Set ¶
func (a *ModelDefinition_Metadata) Set(fieldName string, value interface{})
Setter for additional properties for ModelDefinition_Metadata
func (*ModelDefinition_Metadata) UnmarshalJSON ¶
func (a *ModelDefinition_Metadata) UnmarshalJSON(b []byte) error
Override default JSON handling for ModelDefinition_Metadata to handle AdditionalProperties