models

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package models contains shared models for the FLUIDOS environment.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregatable

type Aggregatable struct {
	MinCount int `json:"minCount"`
	MaxCount int `json:"maxCount"`
}

Aggregatable represents the aggregation properties of a Flavour, such as the minimum instance count.

type Characteristics

type Characteristics struct {
	CPU               resource.Quantity `json:"cpu,omitempty"`
	Memory            resource.Quantity `json:"memory,omitempty"`
	Pods              resource.Quantity `json:"pods,omitempty"`
	PersistentStorage resource.Quantity `json:"storage,omitempty"`
	EphemeralStorage  resource.Quantity `json:"ephemeralStorage,omitempty"`
	Gpu               resource.Quantity `json:"gpu,omitempty"`
	Architecture      string            `json:"architecture,omitempty"`
}

Characteristics represents the characteristics of a Flavour, such as CPU and RAM.

type Contract

type Contract struct {
	ContractID        string            `json:"contractID"`
	TransactionID     string            `json:"transactionID"`
	Flavour           Flavour           `json:"flavour"`
	Buyer             NodeIdentity      `json:"buyerID"`
	BuyerClusterID    string            `json:"buyerClusterID"`
	Seller            NodeIdentity      `json:"seller"`
	SellerCredentials LiqoCredentials   `json:"sellerCredentials"`
	ExpirationTime    string            `json:"expirationTime,omitempty"`
	ExtraInformation  map[string]string `json:"extraInformation,omitempty"`
	Partition         *Partition        `json:"partition,omitempty"`
}

Contract represents a Contract object with its characteristics.

type Flavour

type Flavour struct {
	FlavourID       string          `json:"flavourID"`
	ProviderID      string          `json:"providerID"`
	Type            string          `json:"type"`
	Characteristics Characteristics `json:"characteristics"`
	Policy          Policy          `json:"policy"`
	Owner           NodeIdentity    `json:"owner"`
	Price           Price           `json:"price"`
	ExpirationTime  time.Time       `json:"expirationTime"`
	OptionalFields  OptionalFields  `json:"optionalFields"`
}

Flavour represents a Flavour object with its characteristics and policies.

type LiqoCredentials

type LiqoCredentials struct {
	ClusterID   string `json:"clusterID"`
	ClusterName string `json:"clusterName"`
	Token       string `json:"token"`
	Endpoint    string `json:"endpoint"`
}

LiqoCredentials contains the credentials of a Liqo cluster to enstablish a peering.

type MatchSelector

type MatchSelector struct {
	CPU              resource.Quantity `json:"cpu,omitempty"`
	Memory           resource.Quantity `json:"memory,omitempty"`
	Pods             resource.Quantity `json:"pods,omitempty"`
	Storage          resource.Quantity `json:"storage,omitempty"`
	EphemeralStorage resource.Quantity `json:"ephemeralStorage,omitempty"`
	Gpu              resource.Quantity `json:"gpu,omitempty"`
}

MatchSelector represents the criteria for selecting Flavours through a strict match.

type NodeIdentity

type NodeIdentity struct {
	NodeID string `json:"ID"`
	IP     string `json:"IP"`
	Domain string `json:"domain"`
}

NodeIdentity represents the owner of a Flavour, with associated ID, IP, and domain name.

type NodeInfo

type NodeInfo struct {
	UID             string          `json:"uid"`
	Name            string          `json:"name"`
	Architecture    string          `json:"architecture"`
	OperatingSystem string          `json:"os"`
	ResourceMetrics ResourceMetrics `json:"resources"`
}

NodeInfo represents a node and its resources.

type OptionalFields

type OptionalFields struct {
	Availability bool   `json:"availability,omitempty"`
	WorkerID     string `json:"workerID"`
}

OptionalFields represents the optional fields of a Flavour, such as availability.

type Partition

type Partition struct {
	Architecture     string            `json:"architecture"`
	CPU              resource.Quantity `json:"cpu"`
	Memory           resource.Quantity `json:"memory"`
	Pods             resource.Quantity `json:"pods"`
	EphemeralStorage resource.Quantity `json:"ephemeral-storage,omitempty"`
	Gpu              resource.Quantity `json:"gpu,omitempty"`
	Storage          resource.Quantity `json:"storage,omitempty"`
}

Partition represents the partitioning properties of a Flavour.

type Partitionable

type Partitionable struct {
	CPUMinimum    resource.Quantity `json:"cpuMinimum"`
	MemoryMinimum resource.Quantity `json:"memoryMinimum"`
	PodsMinimum   resource.Quantity `json:"podsMinimum"`
	CPUStep       resource.Quantity `json:"cpuStep"`
	MemoryStep    resource.Quantity `json:"memoryStep"`
	PodsStep      resource.Quantity `json:"podsStep"`
}

Partitionable represents the partitioning properties of a Flavour, such as the minimum and incremental values of CPU and RAM.

type Policy

type Policy struct {
	Partitionable *Partitionable `json:"partitionable,omitempty"`
	Aggregatable  *Aggregatable  `json:"aggregatable,omitempty"`
}

Policy represents the policy associated with a Flavour, which can be either Partitionable or Aggregatable.

type Price

type Price struct {
	Amount   string `json:"amount"`
	Currency string `json:"currency"`
	Period   string `json:"period"`
}

Price represents the price of a Flavour, with the amount, currency, and period associated.

type PurchaseRequest

type PurchaseRequest struct {
	TransactionID string `json:"transactionID"`
}

PurchaseRequest is the request model for purchasing a Flavour.

type RangeSelector

type RangeSelector struct {
	MinCPU     resource.Quantity `json:"minCpu,omitempty"`
	MinMemory  resource.Quantity `json:"minMemory,omitempty"`
	MinPods    resource.Quantity `json:"minPods,omitempty"`
	MinStorage resource.Quantity `json:"minStorage,omitempty"`
	MinEph     resource.Quantity `json:"minEph,omitempty"`
	MinGpu     resource.Quantity `json:"minGpu,omitempty"`
	MaxCPU     resource.Quantity `json:"maxCpu,omitempty"`
	MaxMemory  resource.Quantity `json:"maxMemory,omitempty"`
	MaxPods    resource.Quantity `json:"maxPods,omitempty"`
	MaxStorage resource.Quantity `json:"maxStorage,omitempty"`
	MaxEph     resource.Quantity `json:"maxEph,omitempty"`
	MaxGpu     resource.Quantity `json:"maxGpu,omitempty"`
}

RangeSelector represents the criteria for selecting Flavours through a range.

type ReserveRequest

type ReserveRequest struct {
	FlavourID string       `json:"flavourID"`
	Buyer     NodeIdentity `json:"buyerID"`
	ClusterID string       `json:"clusterID"`
	Partition *Partition   `json:"partition,omitempty"`
}

ReserveRequest is the request model for reserving a Flavour.

type ResourceMetrics

type ResourceMetrics struct {
	CPUTotal         resource.Quantity `json:"totalCPU"`
	CPUAvailable     resource.Quantity `json:"availableCPU"`
	MemoryTotal      resource.Quantity `json:"totalMemory"`
	MemoryAvailable  resource.Quantity `json:"availableMemory"`
	PodsTotal        resource.Quantity `json:"totalPods"`
	PodsAvailable    resource.Quantity `json:"availablePods"`
	EphemeralStorage resource.Quantity `json:"ephemeralStorage"`
}

ResourceMetrics represents resources of a certain node.

type ResponsePurchase

type ResponsePurchase struct {
	Contract Contract `json:"contract"`
	Status   string   `json:"status"`
}

ResponsePurchase contain information after purchase a Flavour.

type Selector

type Selector struct {
	FlavourType   string         `json:"type,omitempty"`
	Architecture  string         `json:"architecture,omitempty"`
	RangeSelector *RangeSelector `json:"rangeSelector,omitempty"`
	MatchSelector *MatchSelector `json:"matchSelector,omitempty"`
}

Selector represents the criteria for selecting Flavours.

type Transaction

type Transaction struct {
	TransactionID string       `json:"transactionID"`
	FlavourID     string       `json:"flavourID"`
	Partition     *Partition   `json:"partition,omitempty"`
	Buyer         NodeIdentity `json:"buyer"`
	ClusterID     string       `json:"clusterID"`
	StartTime     string       `json:"startTime"`
}

Transaction contains information regarding the transaction for a flavour.

Jump to

Keyboard shortcuts

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