Documentation
¶
Index ¶
- Constants
- func ConvertBlueprintArrayToJSON(blueprints []*Blueprint) (string, error)
- func ConvertBlueprintDefinitionArrayToJSON(sds []*BlueprintDefinition) (string, error)
- func ConvertBlueprintHistoryArrayToJSON(histories []*BlueprintHistory) (string, error)
- func ConvertColonyArrayToJSON(colonies []*Colony) (string, error)
- func ConvertCronArrayToJSON(crons []*Cron) (string, error)
- func ConvertExecutorArrayToJSON(executors []*Executor) (string, error)
- func ConvertFileArrayToJSON(files []*File) (string, error)
- func ConvertFileDataArrayToJSON(fileDataArr []*FileData) (string, error)
- func ConvertFunctionArrayToJSON(functions []*Function) (string, error)
- func ConvertGeneratorArrayToJSON(generators []*Generator) (string, error)
- func ConvertLabelArrayToJSON(labels []*Label) (string, error)
- func ConvertLocationArrayToJSON(locations []*Location) (string, error)
- func ConvertLogArrayToJSON(logs []*Log) (string, error)
- func ConvertProcessArrayToJSON(processes []*Process) (string, error)
- func ConvertProcessGraphArrayToJSON(processGraphs []*ProcessGraph) (string, error)
- func ConvertSnapshotArrayToJSON(snapshots []*Snapshot) (string, error)
- func ConvertUserArrayToJSON(users []*User) (string, error)
- func GenerateRandomID() string
- func IsAttributeArraysEqual(attributes1 []Attribute, attributes2 []Attribute) bool
- func IsColonyArraysEqual(colonies1 []*Colony, colonies2 []*Colony) bool
- func IsCronArraysEqual(crons1 []*Cron, crons2 []*Cron) bool
- func IsExecutorArraysEqual(executors1 []*Executor, executors2 []*Executor) bool
- func IsFileArraysEqual(files1 []*File, files2 []*File) bool
- func IsFileDataArraysEqual(fileDataArr1 []*FileData, fileDataArr2 []*FileData) bool
- func IsFunctionArraysEqual(functions1 []*Function, functions2 []*Function) bool
- func IsGeneratorArraysEqual(generators1 []*Generator, generators2 []*Generator) bool
- func IsHardwareArraysEqual(hw1 []Hardware, hw2 []Hardware) bool
- func IsHardwareEqual(hw1 Hardware, hw2 Hardware) bool
- func IsLabelArraysEqual(labels1 []*Label, labels2 []*Label) bool
- func IsLocationArraysEqual(locations1 []*Location, locations2 []*Location) bool
- func IsLogArraysEqual(logs1 []*Log, logs2 []*Log) bool
- func IsProcessArraysEqual(processes1 []*Process, processes2 []*Process) bool
- func IsProcessGraphArraysEqual(processGraphs1 []*ProcessGraph, processGraphs2 []*ProcessGraph) bool
- func IsProjectEqual(project1 Project, project2 Project) bool
- func IsProjectsEqual(projects1 map[string]Project, projects2 map[string]Project) bool
- func IsSnapshotArraysEqual(snapshots1 []*Snapshot, snapshots2 []*Snapshot) bool
- func IsSoftwareArraysEqual(sw1 []Software, sw2 []Software) bool
- func IsSoftwareEqual(sw1 Software, sw2 Software) bool
- func IsUserArraysEqual(users1 []*User, users2 []*User) bool
- func ValidateBlueprintAgainstSchema(blueprint *Blueprint, schema *ValidationSchema) error
- type Allocations
- type Attribute
- type BackendInfo
- type Blueprint
- func (r *Blueprint) Diff(other *Blueprint) *BlueprintDiff
- func (r *Blueprint) GetSpec(key string) (interface{}, bool)
- func (r *Blueprint) GetStatus(key string) (interface{}, bool)
- func (r *Blueprint) SetSpec(key string, value interface{})
- func (r *Blueprint) SetStatus(key string, value interface{})
- func (r *Blueprint) ToJSON() (string, error)
- func (r *Blueprint) Validate() error
- func (r *Blueprint) ValidateAgainstSD(sd *BlueprintDefinition) error
- type BlueprintDefinition
- func ConvertJSONToBlueprintDefinition(jsonString string) (*BlueprintDefinition, error)
- func ConvertJSONToBlueprintDefinitionArray(jsonString string) ([]*BlueprintDefinition, error)
- func CreateBlueprintDefinition(name, group, version, kind, plural, scope, executorType, functionName string) *BlueprintDefinition
- type BlueprintDefinitionNames
- type BlueprintDefinitionSpec
- type BlueprintDiff
- type BlueprintHistory
- type BlueprintMetadata
- type Capabilities
- type ChangeType
- type ColoniesError
- type Colony
- type Conditions
- type ConflictResolution
- type Cron
- type Data
- type Edge
- type Executor
- func ConvertJSONToExecutor(jsonString string) (*Executor, error)
- func ConvertJSONToExecutorArray(jsonString string) ([]*Executor, error)
- func CreateExecutor(id string, executorType string, name string, colonyName string, ...) *Executor
- func CreateExecutorFromDB(id string, executorType string, name string, colonyName string, state int, ...) *Executor
- func (executor *Executor) Approve()
- func (executor *Executor) Equals(executor2 *Executor) bool
- func (executor *Executor) IsApproved() bool
- func (executor *Executor) IsPending() bool
- func (executor *Executor) IsRejected() bool
- func (executor *Executor) IsUnregistered() bool
- func (executor *Executor) Reject()
- func (executor *Executor) SetColonyName(colonyName string)
- func (executor *Executor) SetID(id string)
- func (executor *Executor) ToJSON() (string, error)
- func (executor *Executor) Unregister()
- type Failure
- type FieldChange
- type File
- type FileData
- type Filesystem
- type Function
- type FunctionSpec
- type GPU
- type Generator
- type GeneratorArg
- type GraphNode
- type HandlerSpec
- type Hardware
- type Label
- type Location
- type Log
- type OnClose
- type OnStart
- type Position
- type Process
- func ConvertJSONToProcess(jsonString string) (*Process, error)
- func ConvertJSONToProcessArray(jsonString string) ([]*Process, error)
- func CreateProcess(funcSpec *FunctionSpec) *Process
- func CreateProcessFromDB(funcSpec *FunctionSpec, id string, assignedExecutorID string, isAssigned bool, ...) *Process
- func (process *Process) AddChild(childID string)
- func (process *Process) AddParent(parentID string)
- func (process *Process) Assign()
- func (process *Process) Clone() *Process
- func (process *Process) Equals(process2 *Process) bool
- func (process *Process) ProcessingTime() time.Duration
- func (process *Process) SetAssignedExecutorID(executorID string)
- func (process *Process) SetAttributes(attributes []Attribute)
- func (process *Process) SetEndTime(endTime time.Time)
- func (process *Process) SetProcessGraphID(processGraphID string)
- func (process *Process) SetStartTime(startTime time.Time)
- func (process *Process) SetState(state int)
- func (process *Process) SetSubmissionTime(submissionTime time.Time)
- func (process *Process) ToJSON() (string, error)
- func (process *Process) Unassign()
- func (process *Process) WaitingTime() time.Duration
- type ProcessGraph
- func ConvertJSONToProcessGraph(jsonString string) (*ProcessGraph, error)
- func ConvertJSONToProcessGraphArray(jsonString string) ([]*ProcessGraph, error)
- func ConvertJSONToProcessGraphWithStorage(jsonString string) (*ProcessGraph, error)
- func CreateProcessGraph(colonyName string) (*ProcessGraph, error)
- func (graph *ProcessGraph) AddRoot(processID string)
- func (graph *ProcessGraph) Depth(childProcessID string) (int, error)
- func (graph *ProcessGraph) Equals(graph2 *ProcessGraph) bool
- func (graph *ProcessGraph) FailedProcesses() (int, error)
- func (graph *ProcessGraph) GetRoot(childProcessID string) (*Process, error)
- func (graph *ProcessGraph) Iterate(visitFunc func(process *Process) error) error
- func (graph *ProcessGraph) Leaves() ([]string, error)
- func (graph *ProcessGraph) Processes() (int, error)
- func (graph *ProcessGraph) Resolve() error
- func (graph *ProcessGraph) RunningProcesses() (int, error)
- func (graph *ProcessGraph) SetStorage(storage ProcessGraphStorage)
- func (graph *ProcessGraph) SuccessfulProcesses() (int, error)
- func (graph *ProcessGraph) ToJSON() (string, error)
- func (graph *ProcessGraph) UpdateProcessIDs() error
- func (graph *ProcessGraph) WaitForParents() (int, error)
- func (graph *ProcessGraph) WaitProcesses() (int, error)
- type ProcessGraphStorage
- type Project
- type Reconciliation
- type ReconciliationAction
- type Reference
- type S3Object
- type SchemaProperty
- type ServerInfo
- type Snapshot
- type SnapshotMount
- type Software
- type Statistics
- type Style
- type SyncDirMount
- type User
- type ValidationSchema
- type WorkflowSpec
Constants ¶
const ( IN int = 0 OUT = 1 ERR = 2 ENV = 3 )
const ( PENDING int = 0 APPROVED = 1 REJECTED = 2 UNREGISTERED = 3 )
const ( WAITING int = 0 RUNNING = 1 SUCCESS = 2 FAILED = 3 )
const NOTSET = -1
Variables ¶
This section is empty.
Functions ¶
func ConvertBlueprintArrayToJSON ¶ added in v1.9.3
ConvertBlueprintArrayToJSON converts a slice of Blueprints to JSON
func ConvertBlueprintDefinitionArrayToJSON ¶ added in v1.9.3
func ConvertBlueprintDefinitionArrayToJSON(sds []*BlueprintDefinition) (string, error)
ConvertBlueprintDefinitionArrayToJSON converts a slice of BlueprintDefinitions to JSON
func ConvertBlueprintHistoryArrayToJSON ¶ added in v1.9.3
func ConvertBlueprintHistoryArrayToJSON(histories []*BlueprintHistory) (string, error)
ConvertBlueprintHistoryArrayToJSON converts BlueprintHistory array to JSON
func ConvertCronArrayToJSON ¶
func ConvertExecutorArrayToJSON ¶ added in v1.0.1
func ConvertFileArrayToJSON ¶ added in v1.5.0
func ConvertFileDataArrayToJSON ¶ added in v1.7.4
func ConvertFunctionArrayToJSON ¶ added in v1.0.1
func ConvertLabelArrayToJSON ¶ added in v1.5.0
func ConvertLocationArrayToJSON ¶ added in v1.9.6
func ConvertLogArrayToJSON ¶ added in v1.4.0
func ConvertProcessGraphArrayToJSON ¶
func ConvertProcessGraphArrayToJSON(processGraphs []*ProcessGraph) (string, error)
func ConvertSnapshotArrayToJSON ¶ added in v1.5.0
func ConvertUserArrayToJSON ¶ added in v1.7.0
func GenerateRandomID ¶
func GenerateRandomID() string
func IsAttributeArraysEqual ¶
func IsColonyArraysEqual ¶
func IsCronArraysEqual ¶
func IsExecutorArraysEqual ¶ added in v1.0.1
func IsFileArraysEqual ¶ added in v1.5.0
func IsFileDataArraysEqual ¶ added in v1.7.4
func IsFunctionArraysEqual ¶ added in v1.0.1
func IsGeneratorArraysEqual ¶
func IsHardwareArraysEqual ¶ added in v1.9.6
func IsHardwareEqual ¶ added in v1.9.6
func IsLabelArraysEqual ¶ added in v1.5.0
func IsLocationArraysEqual ¶ added in v1.9.6
func IsLogArraysEqual ¶ added in v1.4.0
func IsProcessArraysEqual ¶
func IsProcessGraphArraysEqual ¶
func IsProcessGraphArraysEqual(processGraphs1 []*ProcessGraph, processGraphs2 []*ProcessGraph) bool
func IsProjectEqual ¶ added in v1.7.8
func IsProjectsEqual ¶ added in v1.7.8
func IsSnapshotArraysEqual ¶ added in v1.5.0
func IsSoftwareArraysEqual ¶ added in v1.9.6
func IsSoftwareEqual ¶ added in v1.9.6
func IsUserArraysEqual ¶ added in v1.7.0
func ValidateBlueprintAgainstSchema ¶ added in v1.9.3
func ValidateBlueprintAgainstSchema(blueprint *Blueprint, schema *ValidationSchema) error
ValidateBlueprintAgainstSchema validates a Blueprint's spec against a BlueprintDefinition's schema
Types ¶
type Allocations ¶ added in v1.7.3
type Attribute ¶
type Attribute struct {
ID string `json:"attributeid"`
TargetID string `json:"targetid"`
TargetColonyName string `json:"targetcolonyname"`
TargetProcessGraphID string `json:"targetprocessgraphid"`
State int `json:"state"`
AttributeType int `json:"attributetype"`
Key string `json:"key"`
Value string `json:"value"`
}
func ConvertJSONToAttribute ¶
func CreateAttribute ¶
func (*Attribute) GenerateID ¶
func (attribute *Attribute) GenerateID()
type BackendInfo ¶ added in v1.9.0
type Blueprint ¶ added in v1.9.3
type Blueprint struct {
ID string `json:"blueprintid"`
Kind string `json:"kind"`
Metadata BlueprintMetadata `json:"metadata"`
Spec map[string]interface{} `json:"spec"`
Status map[string]interface{} `json:"status,omitempty"`
}
Blueprint is a generic container for blueprints
func ConvertJSONToBlueprint ¶ added in v1.9.3
ConvertJSONToBlueprint parses JSON to Blueprint
func ConvertJSONToBlueprintArray ¶ added in v1.9.3
ConvertJSONToBlueprintArray parses JSON to a slice of Blueprints
func CreateBlueprint ¶ added in v1.9.3
CreateBlueprint creates a new blueprint
func (*Blueprint) Diff ¶ added in v1.9.3
func (r *Blueprint) Diff(other *Blueprint) *BlueprintDiff
Diff computes the differences between this blueprint and another
func (*Blueprint) ValidateAgainstSD ¶ added in v1.9.3
func (r *Blueprint) ValidateAgainstSD(sd *BlueprintDefinition) error
ValidateAgainstSD validates the Blueprint against its BlueprintDefinition schema
type BlueprintDefinition ¶ added in v1.9.3
type BlueprintDefinition struct {
ID string `json:"blueprintdefinitionid"`
Kind string `json:"kind"`
Metadata BlueprintMetadata `json:"metadata"`
Spec BlueprintDefinitionSpec `json:"spec"`
}
BlueprintDefinition defines a blueprint type
func ConvertJSONToBlueprintDefinition ¶ added in v1.9.3
func ConvertJSONToBlueprintDefinition(jsonString string) (*BlueprintDefinition, error)
ConvertJSONToBlueprintDefinition parses JSON to BlueprintDefinition
func ConvertJSONToBlueprintDefinitionArray ¶ added in v1.9.3
func ConvertJSONToBlueprintDefinitionArray(jsonString string) ([]*BlueprintDefinition, error)
ConvertJSONToBlueprintDefinitionArray parses JSON to a slice of BlueprintDefinitions
func CreateBlueprintDefinition ¶ added in v1.9.3
func CreateBlueprintDefinition(name, group, version, kind, plural, scope, executorType, functionName string) *BlueprintDefinition
CreateBlueprintDefinition creates a new BlueprintDefinition
func (*BlueprintDefinition) GetAPIVersion ¶ added in v1.9.3
func (sd *BlueprintDefinition) GetAPIVersion() string
GetAPIVersion returns the full API version
func (*BlueprintDefinition) ToJSON ¶ added in v1.9.3
func (sd *BlueprintDefinition) ToJSON() (string, error)
ToJSON converts to JSON string
func (*BlueprintDefinition) Validate ¶ added in v1.9.3
func (sd *BlueprintDefinition) Validate() error
Validate validates the BlueprintDefinition
type BlueprintDefinitionNames ¶ added in v1.9.3
type BlueprintDefinitionNames struct {
Kind string `json:"kind"`
ListKind string `json:"listKind"`
Singular string `json:"singular"`
Plural string `json:"plural"`
ShortNames []string `json:"shortNames,omitempty"`
}
BlueprintDefinitionNames defines blueprint names
type BlueprintDefinitionSpec ¶ added in v1.9.3
type BlueprintDefinitionSpec struct {
Group string `json:"group"`
Version string `json:"version"`
Names BlueprintDefinitionNames `json:"names"`
Scope string `json:"scope"` // "Namespaced" or "Cluster"
Schema *ValidationSchema `json:"schema,omitempty"`
Handler HandlerSpec `json:"handler"`
}
BlueprintDefinitionSpec defines the specification for a BlueprintDefinition
type BlueprintDiff ¶ added in v1.9.3
type BlueprintDiff struct {
SpecChanges []FieldChange `json:"specChanges,omitempty"`
StatusChanges []FieldChange `json:"statusChanges,omitempty"`
MetadataChanges []FieldChange `json:"metadataChanges,omitempty"`
HasChanges bool `json:"hasChanges"`
}
BlueprintDiff contains the differences between two blueprints
func (*BlueprintDiff) GetFieldChange ¶ added in v1.9.3
func (sd *BlueprintDiff) GetFieldChange(path string) *FieldChange
GetFieldChange retrieves a specific field change
func (*BlueprintDiff) HasFieldChange ¶ added in v1.9.3
func (sd *BlueprintDiff) HasFieldChange(path string) bool
HasFieldChange checks if a specific field has changed
func (*BlueprintDiff) OnlyMetadataChanged ¶ added in v1.9.3
func (sd *BlueprintDiff) OnlyMetadataChanged() bool
OnlyMetadataChanged returns true if only metadata changed
func (*BlueprintDiff) OnlyStatusChanged ¶ added in v1.9.3
func (sd *BlueprintDiff) OnlyStatusChanged() bool
OnlyStatusChanged returns true if only status changed
type BlueprintHistory ¶ added in v1.9.3
type BlueprintHistory struct {
ID string `json:"historyid"`
BlueprintID string `json:"blueprintid"`
Kind string `json:"kind"`
Namespace string `json:"namespace"`
Name string `json:"name"`
Generation int64 `json:"generation"`
Spec map[string]interface{} `json:"spec"`
Status map[string]interface{} `json:"status,omitempty"`
Timestamp time.Time `json:"timestamp"`
ChangedBy string `json:"changedby"` // Executor or User ID
ChangeType string `json:"changetype"` // "create", "update", "delete"
}
BlueprintHistory represents a historical snapshot of a blueprint
func ConvertJSONToBlueprintHistory ¶ added in v1.9.3
func ConvertJSONToBlueprintHistory(jsonString string) (*BlueprintHistory, error)
ConvertJSONToBlueprintHistory converts JSON to BlueprintHistory
func ConvertJSONToBlueprintHistoryArray ¶ added in v1.9.3
func ConvertJSONToBlueprintHistoryArray(jsonString string) ([]*BlueprintHistory, error)
ConvertJSONToBlueprintHistoryArray converts JSON array to BlueprintHistory array
func CreateBlueprintHistory ¶ added in v1.9.3
func CreateBlueprintHistory(blueprint *Blueprint, changedBy string, changeType string) *BlueprintHistory
CreateBlueprintHistory creates a new BlueprintHistory from a Blueprint
func (*BlueprintHistory) ToJSON ¶ added in v1.9.3
func (sh *BlueprintHistory) ToJSON() (string, error)
ToJSON converts BlueprintHistory to JSON
type BlueprintMetadata ¶ added in v1.9.3
type BlueprintMetadata struct {
Name string `json:"name"`
ColonyName string `json:"colonyname"`
LocationName string `json:"locationname,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
Annotations map[string]string `json:"annotations,omitempty"`
Generation int64 `json:"generation,omitempty"`
CreatedAt time.Time `json:"createdAt,omitempty"`
UpdatedAt time.Time `json:"updatedAt,omitempty"`
LastReconciliationProcess string `json:"lastReconciliationProcess,omitempty"`
LastReconciliationTime time.Time `json:"lastReconciliationTime,omitempty"`
}
BlueprintMetadata contains metadata for blueprints
type Capabilities ¶ added in v1.4.0
type ChangeType ¶ added in v1.9.0
type ChangeType string
ChangeType defines the type of change
const ( ChangeAdded ChangeType = "added" ChangeModified ChangeType = "modified" ChangeRemoved ChangeType = "removed" )
type ColoniesError ¶ added in v1.1.2
func (*ColoniesError) Error ¶ added in v1.1.2
func (e *ColoniesError) Error() string
type Conditions ¶
type Conditions struct {
ColonyName string `json:"colonyname"`
ExecutorNames []string `json:"executornames"`
ExecutorType string `json:"executortype"`
LocationName string `json:"locationname,omitempty"` // Optional filter by location
Dependencies []string `json:"dependencies"`
Nodes int `json:"nodes"`
CPU string `json:"cpu"`
Processes int `json:"processes"`
ProcessesPerNode int `json:"processespernode"`
Memory string `json:"mem"`
Storage string `json:"storage"`
GPU GPU `json:"gpu"`
WallTime int64 `json:"walltime"`
}
type ConflictResolution ¶ added in v1.6.1
type Cron ¶
type Cron struct {
ID string `json:"cronid"`
InitiatorID string `json:"initiatorid"`
InitiatorName string `json:"initiatorname"`
ColonyName string `json:"colonyname"`
Name string `json:"name"`
CronExpression string `json:"cronexpression"`
Interval int `json:"interval"`
Random bool `json:"random"`
NextRun time.Time `json:"nextrun"`
LastRun time.Time `json:"lastrun"`
WorkflowSpec string `json:"workflowspec"`
PrevProcessGraphID string `json:"prevprocessgraphid"`
WaitForPrevProcessGraph bool `json:"waitforprevprocessgraph"`
CheckerPeriod int `json:"checkerperiod"`
}
func ConvertJSONToCron ¶
func ConvertJSONToCronArray ¶
func CreateCron ¶
func (*Cron) HasExpired ¶
type Executor ¶ added in v1.0.1
type Executor struct {
ID string `json:"executorid"`
Type string `json:"executortype"`
Name string `json:"executorname"`
ColonyName string `json:"colonyname"`
State int `json:"state"`
RequireFuncReg bool `json:"requirefuncreg"`
CommissionTime time.Time `json:"commissiontime"`
LastHeardFromTime time.Time `json:"lastheardfromtime"`
LocationName string `json:"locationname,omitempty"` // Reference to a Location entity
Capabilities Capabilities `json:"capabilities"`
Allocations Allocations `json:"allocations"`
BlueprintID string `json:"blueprintid,omitempty"` // Reference to Blueprint (for managed executors)
BlueprintGen int64 `json:"blueprintgen,omitempty"` // Blueprint generation this executor belongs to
}
func ConvertJSONToExecutor ¶ added in v1.0.1
func ConvertJSONToExecutorArray ¶ added in v1.0.1
func CreateExecutor ¶ added in v1.0.1
func CreateExecutorFromDB ¶ added in v1.0.1
func (*Executor) IsApproved ¶ added in v1.0.1
func (*Executor) IsRejected ¶ added in v1.0.1
func (*Executor) IsUnregistered ¶ added in v1.9.3
func (*Executor) SetColonyName ¶ added in v1.7.0
func (*Executor) Unregister ¶ added in v1.9.3
func (executor *Executor) Unregister()
type FieldChange ¶ added in v1.9.0
type FieldChange struct {
Path string `json:"path"`
OldValue interface{} `json:"oldValue,omitempty"`
NewValue interface{} `json:"newValue,omitempty"`
Type ChangeType `json:"type"`
}
FieldChange represents a change to a specific field
type File ¶ added in v1.5.0
type File struct {
ID string `json:"fileid"`
ColonyName string `json:"colonyname"`
Label string `json:"label"`
Name string `json:"name"`
Size int64 `json:"size"`
SequenceNumber int64 `json:"sequencenr"`
Checksum string `json:"checksum"`
ChecksumAlg string `json:"checksumalg"`
Reference Reference `json:"ref"`
Added time.Time `json:"added"`
}
func ConvertJSONToFile ¶ added in v1.5.0
func ConvertJSONToFileArray ¶ added in v1.5.0
type FileData ¶ added in v1.7.4
type FileData struct {
Name string `json:"name"`
Checksum string `json:"checksum"`
Size int64 `json:"size"`
S3Filename string `json:"s3filename"`
}
func ConvertJSONToFileData ¶ added in v1.7.4
func ConvertJSONToFileDataArray ¶ added in v1.7.4
type Filesystem ¶ added in v1.6.0
type Filesystem struct {
Mount string `json:"mount"`
SnapshotMounts []SnapshotMount `json:"snapshots"`
SyncDirMounts []SyncDirMount `json:"dirs"`
}
type Function ¶ added in v1.0.1
type Function struct {
FunctionID string `json:"functionid"`
ExecutorName string `json:"executorname"`
ExecutorType string `json:"executortype"`
ColonyName string `json:"colonyname"`
FuncName string `json:"funcname"`
Counter int `json:"counter"`
MinWaitTime float64 `json:"minwaittime"`
MaxWaitTime float64 `json:"maxwaittime"`
MinExecTime float64 `json:"minexectime"`
MaxExecTime float64 `json:"maxexectime"`
AvgWaitTime float64 `json:"avgwaittime"`
AvgExecTime float64 `json:"avgexectime"`
}
func ConvertJSONToFunction ¶ added in v1.0.1
func ConvertJSONToFunctionArray ¶ added in v1.0.1
func CreateFunction ¶ added in v1.0.1
type FunctionSpec ¶ added in v1.0.1
type FunctionSpec struct {
NodeName string `json:"nodename"`
FuncName string `json:"funcname"`
Args []interface{} `json:"args"`
KwArgs map[string]interface{} `json:"kwargs"`
Priority int `json:"priority"`
MaxWaitTime int `json:"maxwaittime"`
MaxExecTime int `json:"maxexectime"`
MaxRetries int `json:"maxretries"`
Conditions Conditions `json:"conditions"`
Label string `json:"label"`
Filesystem Filesystem `json:"fs"`
Env map[string]string `json:"env"`
Channels []string `json:"channels,omitempty"`
}
func ConvertJSONToFunctionSpec ¶ added in v1.0.1
func ConvertJSONToFunctionSpec(jsonString string) (*FunctionSpec, error)
func CreateEmptyFunctionSpec ¶ added in v1.0.1
func CreateEmptyFunctionSpec() *FunctionSpec
func CreateFunctionSpec ¶ added in v1.0.1
func CreateFunctionSpec(nodeName string, funcName string, args []interface{}, kwargs map[string]interface{}, colonyName string, executorNames []string, executorType string, maxWaitTime int, maxExecTime int, maxRetries int, env map[string]string, dependencies []string, priority int, label string) *FunctionSpec
func (*FunctionSpec) AddDependency ¶ added in v1.0.1
func (funcSpec *FunctionSpec) AddDependency(dependency string)
func (*FunctionSpec) Equals ¶ added in v1.0.1
func (funcSpec *FunctionSpec) Equals(funcSpec2 *FunctionSpec) bool
func (*FunctionSpec) ToJSON ¶ added in v1.0.1
func (funcSpec *FunctionSpec) ToJSON() (string, error)
type Generator ¶
type Generator struct {
ID string `json:"generatorid"`
InitiatorID string `json:"initiatorid"`
InitiatorName string `json:"initiatorname"`
ColonyName string `json:"colonyname"`
Name string `json:"name"`
WorkflowSpec string `json:"workflowspec"`
Trigger int `json:"trigger"`
Timeout int `json:"timeout"`
FirstPack time.Time `json:"firstpack"`
LastRun time.Time `json:"lastrun"`
QueueSize int `json:"queuesize"`
CheckerPeriod int `json:"checkerperiod"`
}
func ConvertJSONToGenerator ¶
func CreateGenerator ¶
type GeneratorArg ¶
func CreateGeneratorArg ¶
func CreateGeneratorArg(generatorID string, colonyName string, arg string) *GeneratorArg
type HandlerSpec ¶ added in v1.9.0
type HandlerSpec struct {
ExecutorType string `json:"executorType"`
FunctionName string `json:"functionName"`
ReconcileInterval int `json:"reconcileInterval,omitempty"`
}
HandlerSpec defines the executor handler
type Hardware ¶ added in v1.4.0
type Hardware struct {
Model string `json:"model"`
Nodes int `json:"nodes"`
CPU string `json:"cpu"`
Cores int `json:"cores"`
Memory string `json:"mem"`
Storage string `json:"storage"`
GPU GPU `json:"gpu"`
Platform string `json:"platform"` // "linux", "darwin", "windows"
Architecture string `json:"architecture"` // "amd64", "arm64", "riscv64"
Network []string `json:"network"` // Local network addresses (e.g., "192.168.1.100", "10.0.0.5")
}
type Label ¶ added in v1.5.0
func ConvertJSONToLabel ¶ added in v1.5.0
func ConvertJSONToLabelArray ¶ added in v1.5.0
type Location ¶
type Location struct {
ID string `json:"locationid"`
Name string `json:"name"`
ColonyName string `json:"colonyname"`
Description string `json:"description"`
Long float64 `json:"long"`
Lat float64 `json:"lat"`
}
Location represents a deployment site where executors can be bound
func ConvertJSONToLocation ¶ added in v1.9.6
func ConvertJSONToLocationArray ¶ added in v1.9.6
func CreateLocation ¶ added in v1.9.6
type Log ¶ added in v1.4.0
type Log struct {
ProcessID string `json:"processid"`
ColonyName string `json:"colonyname"`
ExecutorName string `json:"executorname"`
Message string `json:"message"`
Timestamp int64 `json:"timestamp"` // UTC Unix time
}
func ConvertJSONToLog ¶ added in v1.4.0
func ConvertJSONToLogArray ¶ added in v1.4.0
type Process ¶
type Process struct {
ID string `json:"processid"`
InitiatorID string `json:"initiatorid"`
InitiatorName string `json:"initiatorname"`
AssignedExecutorID string `json:"assignedexecutorid"`
IsAssigned bool `json:"isassigned"`
State int `json:"state"`
PriorityTime int64 `json:"prioritytime"`
SubmissionTime time.Time `json:"submissiontime"`
StartTime time.Time `json:"starttime"`
EndTime time.Time `json:"endtime"`
WaitDeadline time.Time `json:"waitdeadline"`
ExecDeadline time.Time `json:"execdeadline"`
Retries int `json:"retries"`
Attributes []Attribute `json:"attributes"`
FunctionSpec FunctionSpec `json:"spec"`
WaitForParents bool `json:"waitforparents"`
Parents []string `json:"parents"`
Children []string `json:"children"`
ProcessGraphID string `json:"processgraphid"`
Input []interface{} `json:"in"`
Output []interface{} `json:"out"`
Errors []string `json:"errors"`
}
func ConvertJSONToProcess ¶
func CreateProcess ¶
func CreateProcess(funcSpec *FunctionSpec) *Process
func CreateProcessFromDB ¶
func CreateProcessFromDB(funcSpec *FunctionSpec, id string, assignedExecutorID string, isAssigned bool, state int, priorityTime int64, submissionTime time.Time, startTime time.Time, endTime time.Time, waitDeadline time.Time, execDeadline time.Time, errors []string, retries int, attributes []Attribute) *Process
func (*Process) ProcessingTime ¶
func (*Process) SetAssignedExecutorID ¶ added in v1.0.1
func (*Process) SetAttributes ¶
func (*Process) SetEndTime ¶
func (*Process) SetProcessGraphID ¶
func (*Process) SetStartTime ¶
func (*Process) SetSubmissionTime ¶
-50000 - 50000
func (*Process) WaitingTime ¶
type ProcessGraph ¶
type ProcessGraph struct {
ID string `json:"processgraphid"`
InitiatorID string `json:"initiatorid"`
InitiatorName string `json:"initiatorname"`
ColonyName string `json:"colonyname"`
Roots []string `json:"rootprocessids"`
State int `json:"state"`
SubmissionTime time.Time `json:"submissiontime"`
StartTime time.Time `json:"starttime"`
EndTime time.Time `json:"endtime"`
ProcessIDs []string `json:"processids"`
Nodes []GraphNode `json:"nodes"`
Edges []Edge `json:"edges"`
// contains filtered or unexported fields
}
func ConvertJSONToProcessGraph ¶
func ConvertJSONToProcessGraph(jsonString string) (*ProcessGraph, error)
func ConvertJSONToProcessGraphArray ¶
func ConvertJSONToProcessGraphArray(jsonString string) ([]*ProcessGraph, error)
func ConvertJSONToProcessGraphWithStorage ¶
func ConvertJSONToProcessGraphWithStorage(jsonString string) (*ProcessGraph, error)
func CreateProcessGraph ¶
func CreateProcessGraph(colonyName string) (*ProcessGraph, error)
func (*ProcessGraph) AddRoot ¶
func (graph *ProcessGraph) AddRoot(processID string)
func (*ProcessGraph) Equals ¶
func (graph *ProcessGraph) Equals(graph2 *ProcessGraph) bool
func (*ProcessGraph) FailedProcesses ¶
func (graph *ProcessGraph) FailedProcesses() (int, error)
func (*ProcessGraph) GetRoot ¶
func (graph *ProcessGraph) GetRoot(childProcessID string) (*Process, error)
func (*ProcessGraph) Iterate ¶
func (graph *ProcessGraph) Iterate(visitFunc func(process *Process) error) error
func (*ProcessGraph) Leaves ¶
func (graph *ProcessGraph) Leaves() ([]string, error)
func (*ProcessGraph) Processes ¶
func (graph *ProcessGraph) Processes() (int, error)
func (*ProcessGraph) Resolve ¶
func (graph *ProcessGraph) Resolve() error
func (*ProcessGraph) RunningProcesses ¶
func (graph *ProcessGraph) RunningProcesses() (int, error)
func (*ProcessGraph) SetStorage ¶
func (graph *ProcessGraph) SetStorage(storage ProcessGraphStorage)
func (*ProcessGraph) SuccessfulProcesses ¶
func (graph *ProcessGraph) SuccessfulProcesses() (int, error)
func (*ProcessGraph) ToJSON ¶
func (graph *ProcessGraph) ToJSON() (string, error)
func (*ProcessGraph) UpdateProcessIDs ¶
func (graph *ProcessGraph) UpdateProcessIDs() error
func (*ProcessGraph) WaitForParents ¶
func (graph *ProcessGraph) WaitForParents() (int, error)
func (*ProcessGraph) WaitProcesses ¶
func (graph *ProcessGraph) WaitProcesses() (int, error)
type ProcessGraphStorage ¶
type Reconciliation ¶ added in v1.9.0
type Reconciliation struct {
Old *Blueprint `json:"old,omitempty"`
New *Blueprint `json:"new,omitempty"`
Diff *BlueprintDiff `json:"diff,omitempty"`
Action ReconciliationAction `json:"action"`
}
Reconciliation contains the old and new state of a blueprint with computed diff
func CreateReconciliation ¶ added in v1.9.0
func CreateReconciliation(old, new *Blueprint) *Reconciliation
CreateReconciliation creates a Reconciliation from old and new blueprints
type ReconciliationAction ¶ added in v1.9.0
type ReconciliationAction string
ReconciliationAction defines the CRUD operation to perform
const ( ReconciliationCreate ReconciliationAction = "create" ReconciliationUpdate ReconciliationAction = "update" ReconciliationDelete ReconciliationAction = "delete" ReconciliationNoop ReconciliationAction = "noop" )
type S3Object ¶ added in v1.5.0
type S3Object struct {
Server string `json:"server"`
Port int `json:"port"`
TLS bool `json:"tls"`
AccessKey string `json:"accesskey"`
SecretKey string `json:"secretkey"`
Region string `json:"region"`
EncryptionKey string `json:"encryptionkey"`
EncryptionAlg string `json:"encryptionalg"`
Object string `json:"object"`
Bucket string `json:"bucket"`
}
type SchemaProperty ¶ added in v1.9.0
type SchemaProperty struct {
Type string `json:"type,omitempty"`
Description string `json:"description,omitempty"`
Enum []interface{} `json:"enum,omitempty"`
Default interface{} `json:"default,omitempty"`
Properties map[string]SchemaProperty `json:"properties,omitempty"`
Items *SchemaProperty `json:"items,omitempty"`
}
SchemaProperty defines a schema property
type ServerInfo ¶ added in v1.9.0
type ServerInfo struct {
BuildVersion string `json:"buildversion"`
BuildTime string `json:"buildtime"`
Backends []BackendInfo `json:"backends"`
}
func CreateServerInfo ¶ added in v1.9.0
func CreateServerInfo(buildVersion string, buildTime string) *ServerInfo
func CreateServerInfoFromJSON ¶ added in v1.9.0
func CreateServerInfoFromJSON(jsonString string) (*ServerInfo, error)
func (*ServerInfo) AddBackend ¶ added in v1.9.0
func (*ServerInfo) ToJSON ¶ added in v1.9.0
func (s *ServerInfo) ToJSON() (string, error)
func (*ServerInfo) ToJSONIndent ¶ added in v1.9.0
func (s *ServerInfo) ToJSONIndent() (string, error)
type Snapshot ¶ added in v1.5.0
type Snapshot struct {
ID string `json:"snapshotid"`
ColonyName string `json:"colonyname"`
Label string `json:"label"`
Name string `json:"name"`
FileIDs []string `json:"fileids"`
Added time.Time `json:"added"`
}
func ConvertJSONToSnapshot ¶ added in v1.5.0
func ConvertJSONToSnapshotsArray ¶ added in v1.5.0
type SnapshotMount ¶ added in v1.6.0
type Statistics ¶
type Statistics struct {
Colonies int `json:"colonies"`
Executors int `json:"executors"`
ActiveExecutors int `json:"activeexecutors"`
UnregisteredExecutors int `json:"unregisteredexecutors"`
WaitingProcesses int `json:"waitingprocesses"`
RunningProcesses int `json:"runningprocesses"`
SuccessfulProcesses int `json:"successfulprocesses"`
FailedProcesses int `json:"failedprocesses"`
WaitingWorkflows int `json:"waitingworkflows"`
RunningWorkflows int `json:"runningworkflows"`
SuccessfulWorkflows int `json:"successfulworkflows"`
FailedWorkflows int `json:"failedworkflows"`
}
func ConvertJSONToStatistics ¶
func ConvertJSONToStatistics(jsonString string) (*Statistics, error)
func CreateStatistics ¶
func (*Statistics) Equals ¶
func (stat *Statistics) Equals(stat2 *Statistics) bool
func (*Statistics) ToJSON ¶
func (stat *Statistics) ToJSON() (string, error)
type SyncDirMount ¶ added in v1.6.0
type SyncDirMount struct {
Label string `json:"label"`
Dir string `json:"dir"`
KeepFiles bool `json:"keepfiles"`
ConflictResolution ConflictResolution `json:"onconflicts"`
}
type User ¶ added in v1.7.0
type User struct {
ColonyName string `json:"colonyname"`
ID string `json:"userid"`
Name string `json:"name"`
Email string `json:"email"`
Phone string `json:"phone"`
}
func ConvertJSONToUser ¶ added in v1.7.0
func ConvertJSONToUserArray ¶ added in v1.7.0
func CreateUser ¶ added in v1.7.0
type ValidationSchema ¶ added in v1.9.0
type ValidationSchema struct {
Type string `json:"type,omitempty"`
Properties map[string]SchemaProperty `json:"properties,omitempty"`
Required []string `json:"required,omitempty"`
}
ValidationSchema defines JSON Schema validation
type WorkflowSpec ¶
type WorkflowSpec struct {
ColonyName string `json:"colonyname"`
FunctionSpecs []FunctionSpec `json:"functionspecs"`
}
func ConvertJSONToWorkflowSpec ¶
func ConvertJSONToWorkflowSpec(jsonString string) (*WorkflowSpec, error)
func CreateWorkflowSpec ¶
func CreateWorkflowSpec(colonyName string) *WorkflowSpec
func (*WorkflowSpec) AddFunctionSpec ¶ added in v1.0.1
func (workflowSpec *WorkflowSpec) AddFunctionSpec(funcSpec *FunctionSpec)
func (*WorkflowSpec) Equals ¶
func (workflowSpec *WorkflowSpec) Equals(workflowSpec2 *WorkflowSpec) bool
func (*WorkflowSpec) ToJSON ¶
func (workflowSpec *WorkflowSpec) ToJSON() (string, error)