model

package
v1.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

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.5.1 DO NOT EDIT.

The file implements the Entity interface on the ModelDefinition struct. This is not autogenerated.

Code generated by build/generate-golang.js; DO NOT EDIT.

Index

Constants

View Source
const ModelDefinitionStatusIgnored = Ignored

Variables

This section is empty.

Functions

This section is empty.

Types

type ImportBody

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

ImportBody defines model for ImportBody.

func (ImportBody) AsImportBody0

func (t ImportBody) AsImportBody0() (ImportBody0, error)

AsImportBody0 returns the union data inside the ImportBody as a ImportBody0

func (ImportBody) AsImportBody1

func (t ImportBody) AsImportBody1() (ImportBody1, error)

AsImportBody1 returns the union data inside the ImportBody as a ImportBody1

func (ImportBody) AsImportBody2

func (t ImportBody) AsImportBody2() (ImportBody2, error)

AsImportBody2 returns the union data inside the ImportBody as a ImportBody2

func (ImportBody) AsImportBody3

func (t ImportBody) AsImportBody3() (ImportBody3, error)

AsImportBody3 returns the union data inside the ImportBody as a ImportBody3

func (*ImportBody) FromImportBody0

func (t *ImportBody) FromImportBody0(v ImportBody0) error

FromImportBody0 overwrites any union data inside the ImportBody as the provided ImportBody0

func (*ImportBody) FromImportBody1

func (t *ImportBody) FromImportBody1(v ImportBody1) error

FromImportBody1 overwrites any union data inside the ImportBody as the provided ImportBody1

func (*ImportBody) FromImportBody2

func (t *ImportBody) FromImportBody2(v ImportBody2) error

FromImportBody2 overwrites any union data inside the ImportBody as the provided ImportBody2

func (*ImportBody) FromImportBody3

func (t *ImportBody) FromImportBody3(v ImportBody3) error

FromImportBody3 overwrites any union data inside the ImportBody as the provided ImportBody3

func (ImportBody) MarshalJSON

func (t ImportBody) MarshalJSON() ([]byte, error)

func (*ImportBody) MergeImportBody0

func (t *ImportBody) MergeImportBody0(v ImportBody0) error

MergeImportBody0 performs a merge with any union data inside the ImportBody, using the provided ImportBody0

func (*ImportBody) MergeImportBody1

func (t *ImportBody) MergeImportBody1(v ImportBody1) error

MergeImportBody1 performs a merge with any union data inside the ImportBody, using the provided ImportBody1

func (*ImportBody) MergeImportBody2

func (t *ImportBody) MergeImportBody2(v ImportBody2) error

MergeImportBody2 performs a merge with any union data inside the ImportBody, using the provided ImportBody2

func (*ImportBody) MergeImportBody3

func (t *ImportBody) MergeImportBody3(v ImportBody3) error

MergeImportBody3 performs a merge with any union data inside the ImportBody, using the provided ImportBody3

func (*ImportBody) UnmarshalJSON

func (t *ImportBody) UnmarshalJSON(b []byte) error

type ImportBody0

type ImportBody0 struct {
	// FileName Name of the file being uploaded.
	FileName string `json:"fileName" yaml:"fileName"`

	// ModelFile Supported model file formats are: .tar, .tar.gz, and .tgz. See [Import Models Documentation](https://docs.meshery.io/guides/configuration-management/importing-models#import-models-using-meshery-ui) for details
	ModelFile string `json:"modelFile" yaml:"modelFile"`
}

ImportBody0 defines model for .

type ImportBody1

type ImportBody1 struct {
	// Url A direct URL to a single model file, for example: https://raw.github.com/your-model-file.tar. Supported model file formats are: .tar, .tar.gz, and .tgz. \n\nFor bulk import of your model use the GitHub connection or CSV files. See [Import Models Documentation](https://docs.meshery.io/guides/configuration-management/importing-models#import-models-using-meshery-ui) for details
	Url string `json:"url" yaml:"url"`
}

ImportBody1 defines model for .

type ImportBody2

type ImportBody2 struct {
	// ComponentCsv Upload a CSV file containing component definitions
	ComponentCsv openapi_types.File `json:"componentCsv" yaml:"componentCsv"`

	// ModelCsv Upload a CSV file containing model definitions
	ModelCsv openapi_types.File `json:"modelCsv" yaml:"modelCsv"`

	// RelationshipCsv Upload a CSV file containing relationship definitions
	RelationshipCsv openapi_types.File `json:"relationshipCsv" yaml:"relationshipCsv"`
}

ImportBody2 defines model for .

type ImportBody3

type ImportBody3 struct {
	// Url URI to the source code or package of the model.
	Url string `json:"url" yaml:"url"`
}

ImportBody3 defines model for .

type ImportRequest

type ImportRequest struct {
	ImportBody ImportBody `json:"importBody" yaml:"importBody"`

	// Register The register of the importrequest.
	Register bool `json:"register" yaml:"register"`

	// UploadType Choose the method you prefer to upload your model file. Select 'File Import' or 'CSV Import' if you have the file on your local system or 'URL Import' if you have the file hosted online.
	UploadType ImportRequestUploadType `json:"uploadType" yaml:"uploadType"`
}

ImportRequest defines model for ImportRequest.

type ImportRequestUploadType

type ImportRequestUploadType string

ImportRequestUploadType Choose the method you prefer to upload your model file. Select 'File Import' or 'CSV Import' if you have the file on your local system or 'URL Import' if you have the file hosted online.

const (
	Csv       ImportRequestUploadType = "csv"
	File      ImportRequestUploadType = "file"
	Url       ImportRequestUploadType = "url"
	UrlImport ImportRequestUploadType = "urlImport"
)

Defines values for ImportRequestUploadType.

type MeshModelModelsPage

type MeshModelModelsPage struct {
	// Models The models of the meshmodelmodelspage.
	Models *[]map[string]interface{} `json:"models,omitempty" yaml:"models,omitempty"`

	// Page Current page number of the result set.
	Page *int `json:"page,omitempty" yaml:"page,omitempty"`

	// PageSize Number of items per page.
	PageSize *int `json:"pageSize,omitempty" yaml:"pageSize,omitempty"`

	// TotalCount Total number of items available.
	TotalCount *int `json:"totalCount,omitempty" yaml:"totalCount,omitempty"`
}

MeshModelModelsPage Page of mesh models matching the list-endpoint query.

type Model

type Model struct {
	// Version A valid semantic version string between 5 and 100 characters. The pattern allows for a major.minor.patch version followed by an optional pre-release tag like '-alpha' or '-beta.2' and an optional build metadata tag like '+build.1'.
	Version core.SemverString `json:"version" yaml:"version"`
}

Model Registrant-defined data associated with the model. Properties pertain to the software being managed (e.g. Kubernetes v1.31).

func (*Model) EventCategory

func (*Model) EventCategory() string

type ModelDefinition

type ModelDefinition struct {
	// Id A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	ID core.Uuid `json:"id" yaml:"id"`

	// SchemaVersion API version of the object, optionally prefixed with an API group (e.g. "group.example.io/v1beta1" or bare "v1beta1").
	SchemaVersion core.VersionString `json:"schemaVersion" yaml:"schemaVersion"`

	// Version A valid semantic version string between 5 and 100 characters. The pattern allows for a major.minor.patch version followed by an optional pre-release tag like '-alpha' or '-beta.2' and an optional build metadata tag like '+build.1'.
	Version core.SemverString `json:"version" yaml:"version"`

	// Name The unique name for the model within the scope of a registrant.
	Name string `json:"name" yaml:"name"`

	// DisplayName Human-readable name for the model.
	DisplayName string `json:"displayName" yaml:"displayName"`

	// Description Description of the model.
	Description string `json:"description,omitempty" yaml:"description,omitempty"`

	// 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 Meshery Server.
	// - ignored: model is unavailable for use for all users of this Meshery Server.
	Status ModelDefinitionStatus `json:"status" yaml:"status"`

	// CategoryId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	CategoryId core.Uuid `gorm:"categoryID" json:"-" yaml:"-"`

	// Registrant Meshery Connections are managed and unmanaged resources that either through discovery or manual entry are tracked by Meshery. Learn more at https://docs.meshery.io/concepts/logical/connections
	Registrant connectionv1beta1.Connection `gorm:"foreignKey:RegistrantId;references:ID" json:"registrant" yaml:"registrant"`

	// RegistrantId A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	RegistrantId core.Uuid `gorm:"column:connection_id" json:"registrantId" yaml:"registrantId"`

	// Category Category of the model.
	Category categoryv1beta1.CategoryDefinition `gorm:"foreignKey:CategoryId;references:ID" json:"category" yaml:"category"`

	// SubCategory Sub category of the model determines the secondary grouping.
	SubCategory subcategoryv1beta1.SubCategoryDefinition `json:"subCategory" yaml:"subCategory"`

	// Metadata Metadata containing additional information associated with the model.
	Metadata *ModelDefinition_Metadata `gorm:"type:bytes;serializer:json" json:"metadata" 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" yaml:"model"`

	// ComponentsCount Number of components associated with the model.
	ComponentsCount int `gorm:"-" json:"componentsCount" yaml:"componentsCount"`

	// RelationshipsCount Number of relationships associated with the model.
	RelationshipsCount int `gorm:"-" json:"relationshipsCount" yaml:"relationshipsCount"`

	// CreatedAt Timestamp when the resource was created.
	CreatedAt core.CreatedAt `db:"created_at" json:"createdAt" yaml:"createdAt,omitempty"`

	// UpdatedAt Timestamp when the resource was updated.
	UpdatedAt core.UpdatedAt `db:"updated_at" json:"updatedAt" yaml:"updatedAt,omitempty"`

	// Components The components of the model.
	Components interface{} `gorm:"-" json:"components" yaml:"components"`

	// Relationships The relationships of the model.
	Relationships interface{} `gorm:"-" json:"relationships" yaml:"relationships"`
}

ModelDefinition Meshery Models serve as a portable unit of packaging to define managed entities, their relationships, and capabilities.

func (*ModelDefinition) Create added in v1.1.1

func (m *ModelDefinition) Create(db *database.Handler, hostID uuid.UUID) (uuid.UUID, error)

func (*ModelDefinition) GenerateID added in v1.1.1

func (m *ModelDefinition) GenerateID() (uuid.UUID, error)

func (*ModelDefinition) GetEntityDetail added in v1.1.1

func (m *ModelDefinition) GetEntityDetail() string

func (ModelDefinition) GetID added in v1.1.1

func (m ModelDefinition) GetID() uuid.UUID

func (*ModelDefinition) ReplaceSVGData added in v1.1.1

func (m *ModelDefinition) ReplaceSVGData(baseDir string) error

func (ModelDefinition) TableName added in v1.1.1

func (m ModelDefinition) TableName() string

func (ModelDefinition) ToReference added in v1.1.1

func (m ModelDefinition) ToReference() ModelReference

func (ModelDefinition) Type added in v1.1.1

func (*ModelDefinition) UpdateStatus added in v1.1.1

func (m *ModelDefinition) UpdateStatus(db *database.Handler, status entity.EntityStatus) error

func (ModelDefinition) WriteModelDefinition added in v1.1.1

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 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 Meshery Server. - ignored: model is unavailable for use for all users of this Meshery Server.

const (
	Duplicate ModelDefinitionStatus = "duplicate"
	Enabled   ModelDefinitionStatus = "enabled"
	Ignored   ModelDefinitionStatus = "ignored"
)

Defines values for ModelDefinitionStatus.

type ModelDefinition_Metadata

type ModelDefinition_Metadata struct {
	// Capabilities Capabilities associated with the model
	Capabilities *[]capabilityv1beta1.Capability `json:"capabilities,omitempty" yaml:"capabilities,omitempty"`

	// 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"`

	// SvgWhite SVG representation of the model in white color.
	SvgWhite string `json:"svgWhite" yaml:"svgWhite"`

	// 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" yaml:"svgComplete"`

	// Shape The shape of the node's body. Note that each shape fits within the specified width and height, and so you may have to adjust width and height if you desire an equilateral shape (i.e. width !== height for several equilateral shapes)
	Shape                *core.Shape            `json:"shape,omitempty" yaml:"shape,omitempty"`
	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

type ModelReference

type ModelReference struct {
	// DisplayName Human-readable name for the model.
	DisplayName string `json:"displayName" yaml:"displayName"`

	// Id A Universally Unique Identifier used to uniquely identify entities in Meshery. The UUID core definition is used across different schemas.
	ID core.Uuid `json:"id" yaml:"id"`

	// Model Registrant-defined data associated with the model. Properties pertain to the software being managed (e.g. Kubernetes v1.31).
	Model Model `json:"model" yaml:"model"`

	// Name The unique name for the model within the scope of a registrant.
	Name       string              `json:"name" yaml:"name"`
	Registrant RegistrantReference `json:"registrant" yaml:"registrant"`

	// Version A valid semantic version string between 5 and 100 characters. The pattern allows for a major.minor.patch version followed by an optional pre-release tag like '-alpha' or '-beta.2' and an optional build metadata tag like '+build.1'.
	Version core.SemverString `json:"version" yaml:"version"`
}

ModelReference Reference to the specific registered model to which the component belongs and from which model version, category, and other properties may be referenced. Learn more at https://docs.meshery.io/concepts/models

type RegistrantReference

type RegistrantReference struct {
	// Kind Kind of the registrant.
	Kind string `json:"kind" yaml:"kind"`
}

RegistrantReference defines model for RegistrantReference.

Jump to

Keyboard shortcuts

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