aostypes

package
v0.0.0-...-54d5584 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 19

Documentation

Index

Constants

View Source
const (
	GenericPartition  = "generic"
	StoragesPartition = "storages"
	StatesPartition   = "states"
	ServicesPartition = "services"
	LayersPartition   = "layers"
)

Partition types.

View Source
const (
	BalancingEnabled  = "enabled"
	BalancingDisabled = "disabled"
)

BalancingPolicy types.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertRulePercents

type AlertRulePercents struct {
	MinTimeout   Duration `json:"minTimeout"`
	MinThreshold float64  `json:"minThreshold"`
	MaxThreshold float64  `json:"maxThreshold"`
}

AlertRulePercents describes alert rule.

type AlertRulePoints

type AlertRulePoints struct {
	MinTimeout   Duration `json:"minTimeout"`
	MinThreshold uint64   `json:"minThreshold"`
	MaxThreshold uint64   `json:"maxThreshold"`
}

AlertRulePoints describes alert rule.

type AlertRules

type AlertRules struct {
	RAM        *AlertRulePercents   `json:"ram,omitempty"`
	CPU        *AlertRulePercents   `json:"cpu,omitempty"`
	Partitions []PartitionAlertRule `json:"partitions,omitempty"`
	Download   *AlertRulePoints     `json:"download,omitempty"`
	Upload     *AlertRulePoints     `json:"upload,omitempty"`
}

AlertRules define service monitoring alerts rules.

type Duration

type Duration struct {
	time.Duration
}

Duration represents duration in format "00:00:00".

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() (b []byte, err error)

MarshalJSON marshals JSON Duration type.

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON unmarshals JSON Duration type.

type FirewallRule

type FirewallRule struct {
	DstIP   string `json:"dstIp"`
	DstPort string `json:"dstPort"`
	Proto   string `json:"proto"`
	SrcIP   string `json:"srcIp"`
}

FirewallRule firewall rule.

type InstanceIdent

type InstanceIdent struct {
	ServiceID string `json:"serviceId"`
	SubjectID string `json:"subjectId"`
	Instance  uint64 `json:"instance"`
}

InstanceIdent instance identification information.

type InstanceInfo

type InstanceInfo struct {
	InstanceIdent
	NetworkParameters
	UID         uint32 `json:"uid"`
	Priority    uint64 `json:"priority"`
	StoragePath string `json:"storagePath"`
	StatePath   string `json:"statePath"`
}

InstanceInfo instance information to start it.

type InstanceMonitoring

type InstanceMonitoring struct {
	InstanceIdent
	MonitoringData
}

type LayerInfo

type LayerInfo struct {
	LayerID string `json:"layerId"`
	Digest  string `json:"digest"`
	Version string `json:"version"`
	URL     string `json:"url"`
	Sha256  []byte `json:"sha256"`
	Size    uint64 `json:"size"`
}

LayerInfo layer info.

type MonitoringData

type MonitoringData struct {
	Timestamp  time.Time        `json:"timestamp"`
	RAM        uint64           `json:"ram"`
	CPU        uint64           `json:"cpu"`
	Download   uint64           `json:"download"`
	Upload     uint64           `json:"upload"`
	Partitions []PartitionUsage `json:"partitions"`
}

MonitoringData monitoring data.

type NetworkParameters

type NetworkParameters struct {
	NetworkID     string         `json:"networkId"`
	Subnet        string         `json:"subnet"`
	IP            string         `json:"ip"`
	VlanID        uint64         `json:"vlanId"`
	DNSServers    []string       `json:"dnsServers"`
	FirewallRules []FirewallRule `json:"firewallRules"`
}

NetworkParameters networks parameters.

type NodeMonitoring

type NodeMonitoring struct {
	NodeID        string               `json:"nodeId"`
	NodeData      MonitoringData       `json:"nodeData"`
	InstancesData []InstanceMonitoring `json:"instancesData"`
}

type PartitionAlertRule

type PartitionAlertRule struct {
	AlertRulePercents
	Name string `json:"name"`
}

PartitionAlertRule describes alert rule.

type PartitionUsage

type PartitionUsage struct {
	Name     string `json:"name"`
	UsedSize uint64 `json:"usedSize"`
}

PartitionUsage partition usage information.

type RequestedResources

type RequestedResources struct {
	CPU     *uint64 `json:"cpu"`
	RAM     *uint64 `json:"ram"`
	Storage *uint64 `json:"storage"`
	State   *uint64 `json:"state"`
}

RequestedResources requested service resources (in absolute values: dmips, bytes).

type ResourceRatiosInfo

type ResourceRatiosInfo struct {
	CPU     *float64 `json:"cpu"`
	RAM     *float64 `json:"ram"`
	Storage *float64 `json:"storage"`
	State   *float64 `json:"state"`
}

ResourceRatiosInfo resource ratios info.

type RunParameters

type RunParameters struct {
	StartInterval   Duration `json:"startInterval,omitempty"`
	StartBurst      uint     `json:"startBurst,omitempty"`
	RestartInterval Duration `json:"restartInterval,omitempty"`
}

RunParameters service startup parameters.

type ServiceConfig

type ServiceConfig struct {
	Created            time.Time                    `json:"created"`
	Author             string                       `json:"author"`
	SkipResourceLimits bool                         `json:"skipResourceLimits"`
	Hostname           *string                      `json:"hostname,omitempty"`
	BalancingPolicy    string                       `json:"balancingPolicy"`
	Runners            []string                     `json:"runners"`
	RunParameters      RunParameters                `json:"runParameters,omitempty"`
	Sysctl             map[string]string            `json:"sysctl,omitempty"`
	OfflineTTL         Duration                     `json:"offlineTtl,omitempty"`
	Quotas             ServiceQuotas                `json:"quotas"`
	RequestedResources *RequestedResources          `json:"requestedResources"`
	AllowedConnections map[string]struct{}          `json:"allowedConnections,omitempty"`
	Devices            []ServiceDevice              `json:"devices,omitempty"`
	Resources          []string                     `json:"resources,omitempty"`
	Permissions        map[string]map[string]string `json:"permissions,omitempty"`
	AlertRules         *AlertRules                  `json:"alertRules,omitempty"`
}

ServiceConfig Aos service configuration.

type ServiceDevice

type ServiceDevice struct {
	Name        string `json:"name"`
	Permissions string `json:"permissions"`
}

ServiceDevice struct with service divices rules.

type ServiceInfo

type ServiceInfo struct {
	ServiceID  string `json:"serviceId"`
	ProviderID string `json:"providerId"`
	Version    string `json:"version"`
	GID        uint32 `json:"gid"`
	URL        string `json:"url"`
	Sha256     []byte `json:"sha256"`
	Size       uint64 `json:"size"`
}

ServiceInfo service info.

type ServiceManifest

type ServiceManifest struct {
	imagespec.Manifest
	AosService *imagespec.Descriptor `json:"aosService,omitempty"`
}

ServiceManifest Aos service manifest.

type ServiceQuotas

type ServiceQuotas struct {
	CPUDMIPSLimit *uint64 `json:"cpuDmipsLimit,omitempty"`
	RAMLimit      *uint64 `json:"ramLimit,omitempty"`
	PIDsLimit     *uint64 `json:"pidsLimit,omitempty"`
	NoFileLimit   *uint64 `json:"noFileLimit,omitempty"`
	TmpLimit      *uint64 `json:"tmpLimit,omitempty"`
	StateLimit    *uint64 `json:"stateLimit,omitempty"`
	StorageLimit  *uint64 `json:"storageLimit,omitempty"`
	UploadSpeed   *uint64 `json:"uploadSpeed,omitempty"`
	DownloadSpeed *uint64 `json:"downloadSpeed,omitempty"`
	UploadLimit   *uint64 `json:"uploadLimit,omitempty"`
	DownloadLimit *uint64 `json:"downloadLimit,omitempty"`
}

ServiceQuotas service quotas representation.

type Time

type Time struct {
	time.Time
}

Time represents time in format "00:00:00".

func (Time) MarshalJSON

func (t Time) MarshalJSON() (b []byte, err error)

MarshalJSON marshals JSON Time type.

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON unmarshals JSON Time type.

Jump to

Keyboard shortcuts

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