Documentation ¶
Index ¶
- Constants
- Variables
- func AllPrefixes() []string
- func ArchEqual(a, b string) bool
- func ArchIn(a string, b []string) bool
- func BaseTemplate(name string) *template.Template
- func DHCPOptionParser(code dhcp.OptionCode) (func(string) ([]byte, error), func([]byte) string)
- func DecodeYaml(buf []byte, ref interface{}) error
- func DrpSafeFuncMap() template.FuncMap
- func FibBackoff(thunk func() error)
- func GenPatch(source, target interface{}, paranoid bool) (jsonpatch2.Patch, error)
- func Hexaddr(addr net.IP) string
- func IsSecureData(val interface{}) bool
- func NewUUID6() uuid.UUID
- func ParseContentPrerequisites(prereqs string) (map[string]*semver.Constraints, error)
- func ParseDuration(s, unit string) (time.Duration, error)
- func RandString(n int) string
- func Remarshal(src, dest interface{}) error
- func SetHaState(base string, state *CurrentHAState) error
- func SupportedArch(s string) (string, bool)
- func UpdateAllScopesWithRawModel(prefix string)
- func ValidEndpointName(msg, s string) error
- func ValidMachineName(msg, s string) error
- func ValidName(msg, s string) error
- func ValidNameAt(msg, s string, pos int) error
- func ValidNumber(msg, s string) error
- func ValidNumberName(msg, s string) error
- func ValidParamName(msg, s string) error
- func ValidUserName(msg, s string) error
- func ValidZoneName(msg, s string) error
- func ValidateIP4(e ErrorAdder, a net.IP)
- func ValidateInput(c *CatalogBuilderInput) error
- func ValidateMac(e ErrorAdder, mac string)
- func ValidateMaybeZeroIP4(e ErrorAdder, a net.IP)
- func ZoneValuesToRec(qname string, qtype, qclass uint16, ttl uint32, record []string) dns.RR
- type Access
- func (a *Access) GetCreatedAt() time.Time
- func (a *Access) GetCreatedBy() string
- func (a *Access) GetLastModifiedAt() time.Time
- func (a *Access) GetLastModifiedBy() string
- func (a *Access) IsReadOnly() bool
- func (a *Access) SetCreatedAt(v time.Time)
- func (a *Access) SetCreatedBy(v string)
- func (a *Access) SetLastModifiedAt(v time.Time)
- func (a *Access) SetLastModifiedBy(v string)
- func (a *Access) SetReadOnly(v bool)
- type Accessor
- type Action
- type Activity
- func (a *Activity) AuthKey() string
- func (a *Activity) CanHaveActions() bool
- func (a *Activity) Fill()
- func (a *Activity) Index() int
- func (a *Activity) Key() string
- func (a *Activity) KeyName() string
- func (a *Activity) Prefix() string
- func (a *Activity) SliceOf() interface{}
- func (a *Activity) String() string
- func (a *Activity) ToModels(obj interface{}) []Model
- func (a *Activity) Validate()
- type ActivityData
- type ActivityMeta
- type Actor
- type AgentRunner
- type Alert
- func (a *Alert) AuthKey() string
- func (a *Alert) Fill()
- func (a *Alert) GetName() string
- func (a *Alert) GetParams() map[string]interface{}
- func (a *Alert) Key() string
- func (a *Alert) KeyName() string
- func (a *Alert) Prefix() string
- func (a *Alert) SetName(s string)
- func (a *Alert) SetParams(p map[string]interface{})
- func (a *Alert) SliceOf() interface{}
- func (a *Alert) ToModels(obj interface{}) []Model
- func (a *Alert) UUID() string
- func (a *Alert) Validate()
- type ArchInfo
- type AvailableAction
- type Batch
- func (b *Batch) AuthKey() string
- func (b *Batch) CanHaveActions() bool
- func (b *Batch) Fill()
- func (b *Batch) GetMeta() Meta
- func (b *Batch) Key() string
- func (b *Batch) KeyName() string
- func (b *Batch) Prefix() string
- func (b *Batch) SetMeta(d Meta)
- func (b *Batch) SliceOf() interface{}
- func (b *Batch) ToModels(obj interface{}) []Model
- func (b *Batch) Validate()
- type BlobInfo
- type Blueprint
- func (bp *Blueprint) AuthKey() string
- func (bp *Blueprint) CanHaveActions() bool
- func (bp *Blueprint) Fill()
- func (bp *Blueprint) GetDescription() string
- func (bp *Blueprint) GetDocumentation() string
- func (bp *Blueprint) GetMeta() Meta
- func (bp *Blueprint) GetParams() map[string]interface{}
- func (bp *Blueprint) GetProfiles() []string
- func (bp *Blueprint) GetTasks() []string
- func (bp *Blueprint) Key() string
- func (bp *Blueprint) KeyName() string
- func (bp *Blueprint) Prefix() string
- func (bp *Blueprint) SetMeta(d Meta)
- func (bp *Blueprint) SetName(n string)
- func (bp *Blueprint) SetParams(p map[string]interface{})
- func (bp *Blueprint) SetProfiles(p []string)
- func (bp *Blueprint) SetTasks(t []string)
- func (bp *Blueprint) SliceOf() interface{}
- func (bp *Blueprint) ToModels(obj interface{}) []Model
- func (bp *Blueprint) Validate()
- type BootEnv
- func (b *BootEnv) AuthKey() string
- func (b *BootEnv) BootParamsFor(arch string) string
- func (b *BootEnv) CanHaveActions() bool
- func (b *BootEnv) Fill()
- func (b *BootEnv) GetDescription() string
- func (b *BootEnv) GetDocumentation() string
- func (b *BootEnv) GetMeta() Meta
- func (b *BootEnv) InitrdsFor(arch string) []string
- func (b *BootEnv) IsoFor(arch string) string
- func (b *BootEnv) IsoUrlFor(arch string) string
- func (b *BootEnv) KernelFor(arch string) string
- func (b *BootEnv) Key() string
- func (b *BootEnv) KeyName() string
- func (b *BootEnv) MergeOverrides(overrides ...BootEnvOverride) *BootEnv
- func (b *BootEnv) NetBoot() bool
- func (b *BootEnv) Prefix() string
- func (b *BootEnv) SetMeta(d Meta)
- func (b *BootEnv) SetName(n string)
- func (b *BootEnv) ShaFor(arch string) string
- func (b *BootEnv) SliceOf() interface{}
- func (b *BootEnv) ToModels(obj interface{}) []Model
- func (b *BootEnv) Validate()
- type BootEnvOverride
- type BootEnver
- type BsdpBootOption
- type Bundled
- type Bundler
- type CatalogBuilderInput
- type CatalogItem
- func (ci *CatalogItem) AuthKey() string
- func (ci *CatalogItem) Clone() *CatalogItem
- func (ci *CatalogItem) DownloadUrl(arch, os string) string
- func (ci *CatalogItem) FileName() string
- func (ci *CatalogItem) Fill()
- func (ci *CatalogItem) Key() string
- func (ci *CatalogItem) KeyName() string
- func (ci *CatalogItem) Prefix() string
- func (ci *CatalogItem) SliceOf() interface{}
- func (ci *CatalogItem) ToModels(obj interface{}) []Model
- type Cert
- type ChangeForcer
- type Claim
- type Claims
- type ClaimsList
- type Classifier
- type CloudInit
- type CloudInitv1
- type Cluster
- func (n *Cluster) AddTasks(offset int, tasks ...string) error
- func (n *Cluster) AuthKey() string
- func (n *Cluster) CanHaveActions() bool
- func (n *Cluster) DelTasks(tasks ...string)
- func (n *Cluster) Fill()
- func (n *Cluster) GetBootEnv() string
- func (n *Cluster) GetContext() string
- func (n *Cluster) GetCurrentJob() uuid.UUID
- func (n *Cluster) GetDescription() string
- func (n *Cluster) GetMeta() Meta
- func (n *Cluster) GetName() string
- func (n *Cluster) GetParams() map[string]interface{}
- func (n *Cluster) GetProfiles() []string
- func (n *Cluster) GetRunnable() bool
- func (n *Cluster) GetStage() string
- func (n *Cluster) GetState() string
- func (n *Cluster) GetTasks() []string
- func (n *Cluster) GetWorkOrderMode() bool
- func (n *Cluster) GetWorkflow() string
- func (n *Cluster) IsLocked() bool
- func (n *Cluster) Key() string
- func (n *Cluster) KeyName() string
- func (n *Cluster) Prefix() string
- func (n *Cluster) RunningTask() int
- func (n *Cluster) SetBootEnv(s string)
- func (n *Cluster) SetMeta(d Meta)
- func (n *Cluster) SetName(name string)
- func (n *Cluster) SetParams(p map[string]interface{})
- func (n *Cluster) SetProfiles(p []string)
- func (n *Cluster) SetRunnable(b bool)
- func (n *Cluster) SetStage(s string)
- func (n *Cluster) SetTasks(t []string)
- func (n *Cluster) SetWorkOrderMode(v bool)
- func (n *Cluster) SliceOf() interface{}
- func (n *Cluster) SplitTasks() (thePast []string, thePresent []string, theFuture []string)
- func (n *Cluster) ToModels(obj interface{}) []Model
- func (n *Cluster) UUID() string
- func (n *Cluster) Validate()
- type ClusterState
- type Connection
- type Connections
- type ConnectionsList
- type Content
- func (c *Content) AuthKey() string
- func (c *Content) Fill()
- func (c *Content) FromStore(src store.Store) error
- func (c *Content) GenerateMetaMap() map[string]string
- func (c *Content) GetDescription() string
- func (c *Content) GetDocumentation() string
- func (c *Content) Key() string
- func (c *Content) KeyName() string
- func (c *Content) Mangle(thunk func(string, interface{}) (interface{}, error)) error
- func (c *Content) Prefix() string
- func (c *Content) ToStore(dest store.Store) error
- type ContentMetaData
- type ContentSummary
- type Context
- func (c *Context) AuthKey() string
- func (c *Context) Fill()
- func (c *Context) GetMeta() Meta
- func (c *Context) Key() string
- func (c *Context) KeyName() string
- func (c *Context) Prefix() string
- func (c *Context) SetMeta(d Meta)
- func (c *Context) SliceOf() interface{}
- func (c *Context) ToModels(obj interface{}) []Model
- type CreatedJob
- type CurrentHAState
- type Descer
- type DhcpOption
- func (o *DhcpOption) AddToPacket(p *dhcp.Packet) error
- func (o *DhcpOption) ConvertOptionValueToByte(value string) ([]byte, error)
- func (o *DhcpOption) Fill(s string) error
- func (o *DhcpOption) FillFromPacketOpt(buf []byte)
- func (o DhcpOption) RenderToDHCP(srcOpts map[int]string) (code byte, val []byte, err error)
- func (o *DhcpOption) String() string
- type DnsRecord
- type DnsRecordField
- type Docer
- type Element
- type ElementAction
- type Endpoint
- func (e *Endpoint) AuthKey() string
- func (e *Endpoint) CanHaveActions() bool
- func (e *Endpoint) Fill()
- func (e *Endpoint) GetDescription() string
- func (e *Endpoint) GetMeta() Meta
- func (e *Endpoint) GetParams() map[string]interface{}
- func (e *Endpoint) Key() string
- func (e *Endpoint) KeyName() string
- func (e *Endpoint) Prefix() string
- func (e *Endpoint) SetMeta(d Meta)
- func (e *Endpoint) SetName(name string)
- func (e *Endpoint) SetParams(p map[string]interface{})
- func (e *Endpoint) SliceOf() interface{}
- func (e *Endpoint) ToModels(obj interface{}) []Model
- func (e *Endpoint) Validate()
- type Error
- type ErrorAdder
- type Event
- type FileData
- type Filler
- type Filter
- func (f *Filter) AuthKey() string
- func (f *Filter) CanHaveActions() bool
- func (f *Filter) Clone() *Filter
- func (f *Filter) Fill()
- func (f *Filter) GetDescription() string
- func (f *Filter) GetDocumentation() string
- func (f *Filter) Key() string
- func (f *Filter) KeyName() string
- func (f *Filter) Merge(nf *Filter)
- func (f *Filter) Prefix() string
- func (f *Filter) SetName(name string)
- func (f *Filter) SliceOf() interface{}
- func (f *Filter) ToFilterString() string
- func (f *Filter) ToModels(obj interface{}) []Model
- type GlobalHaState
- type HaPassiveState
- type IdentityProvider
- func (ip *IdentityProvider) AuthKey() string
- func (ip *IdentityProvider) CanHaveActions() bool
- func (ip *IdentityProvider) Fill()
- func (ip *IdentityProvider) GetDescription() string
- func (ip *IdentityProvider) GetDocumentation() string
- func (ip *IdentityProvider) GetMeta() Meta
- func (ip *IdentityProvider) Key() string
- func (ip *IdentityProvider) KeyName() string
- func (ip *IdentityProvider) Prefix() string
- func (ip *IdentityProvider) SetMeta(d Meta)
- func (ip *IdentityProvider) SliceOf() interface{}
- func (ip *IdentityProvider) ToModels(obj interface{}) []Model
- func (ip *IdentityProvider) Validate()
- type Index
- type Info
- type Interface
- type Job
- func (j *Job) AuthKey() string
- func (b *Job) CanHaveActions() bool
- func (j *Job) Fill()
- func (j *Job) GetMeta() Meta
- func (j *Job) Key() string
- func (j *Job) KeyName() string
- func (j *Job) Prefix() string
- func (j *Job) SetMeta(d Meta)
- func (b *Job) SliceOf() interface{}
- func (b *Job) ToModels(obj interface{}) []Model
- func (j *Job) Validate()
- type JobAction
- type JobActions
- type JobLogArchive
- func (jla *JobLogArchive) Close() error
- func (jla *JobLogArchive) Entries() (res []JobLogEntry, err error)
- func (jla *JobLogArchive) EntryFor(job uuid.Array) (res JobLogEntry, err error)
- func (jla *JobLogArchive) ImportFile(src *os.File, id, machine uuid.Array) error
- func (jla *JobLogArchive) ImportFiles(machine uuid.Array, ids []uuid.Array, paths []string) error
- func (jla *JobLogArchive) ImportReader(entry *JobLogEntry, src io.Reader) error
- func (jla *JobLogArchive) Iter(cancel context.Context) (next func() *Log, err error)
- func (jla *JobLogArchive) LogFor(job uuid.Array) (reader *Log, finalErr error)
- func (jla *JobLogArchive) RawLogEntry(job uuid.Array) (reader io.ReadSeekCloser, finalErr error)
- func (jla *JobLogArchive) Remove(ids ...uuid.Array) error
- func (jla *JobLogArchive) StreamFrom(src io.Reader) error
- func (jla *JobLogArchive) StreamOneTo(dest io.Writer, id uuid.Array) error
- func (jla *JobLogArchive) StreamSomeTo(dest io.Writer, testFn func(*JobLogEntry) bool) error
- type JobLogEntry
- func (jle *JobLogEntry) MarshalBinary() ([]byte, error)
- func (jle *JobLogEntry) ReadAt(fi io.ReaderAt, offset int64) error
- func (jle *JobLogEntry) ReadVerifiedAt(fi io.ReaderAt, offset int64, id uuid.Array) error
- func (jle *JobLogEntry) UnmarshalBinary(buf []byte) error
- func (jle *JobLogEntry) WriteAt(fi io.WriterAt, offset int64) error
- type Lab
- func (l *Lab) AuthKey() string
- func (l *Lab) CanHaveActions() bool
- func (l *Lab) Fill()
- func (l *Lab) GetDescription() string
- func (l *Lab) GetDocumentation() string
- func (l *Lab) GetMeta() Meta
- func (l *Lab) Key() string
- func (l *Lab) KeyName() string
- func (l *Lab) Prefix() string
- func (l *Lab) SetMeta(d Meta)
- func (l *Lab) SliceOf() interface{}
- func (l *Lab) ToModels(obj interface{}) []Model
- func (l *Lab) Validate()
- type LabChecklistItem
- type LabPrereqs
- type LabSection
- type LabSections
- type Lease
- func (l *Lease) AuthKey() string
- func (b *Lease) CanHaveActions() bool
- func (l *Lease) Expire()
- func (l *Lease) Expired() bool
- func (l *Lease) Fake() bool
- func (l *Lease) Fill()
- func (l *Lease) GetMeta() Meta
- func (l *Lease) Invalidate()
- func (l *Lease) Key() string
- func (l *Lease) KeyName() string
- func (l *Lease) Prefix() string
- func (l *Lease) SetMeta(d Meta)
- func (b *Lease) SliceOf() interface{}
- func (l *Lease) String() string
- func (b *Lease) ToModels(obj interface{}) []Model
- type License
- type LicenseBundle
- type Log
- type Machine
- func (m *Machine) AddTasks(offset int, tasks ...string) error
- func (m *Machine) AuthKey() string
- func (m *Machine) CanHaveActions() bool
- func (m *Machine) DelTasks(tasks ...string)
- func (m *Machine) Fill()
- func (m *Machine) GetBootEnv() string
- func (m *Machine) GetContext() string
- func (m *Machine) GetCurrentJob() uuid.UUID
- func (m *Machine) GetDescription() string
- func (m *Machine) GetMeta() Meta
- func (m *Machine) GetName() string
- func (m *Machine) GetParams() map[string]interface{}
- func (m *Machine) GetProfiles() []string
- func (m *Machine) GetRunnable() bool
- func (m *Machine) GetStage() string
- func (m *Machine) GetState() string
- func (m *Machine) GetTasks() []string
- func (m *Machine) GetWorkOrderMode() bool
- func (m *Machine) GetWorkflow() string
- func (m *Machine) IsLocked() bool
- func (m *Machine) Key() string
- func (m *Machine) KeyName() string
- func (m *Machine) Prefix() string
- func (m *Machine) RunningTask() int
- func (m *Machine) SetBootEnv(s string)
- func (m *Machine) SetMeta(d Meta)
- func (m *Machine) SetName(n string)
- func (m *Machine) SetParams(p map[string]interface{})
- func (m *Machine) SetProfiles(p []string)
- func (m *Machine) SetRunnable(b bool)
- func (m *Machine) SetStage(s string)
- func (m *Machine) SetTasks(t []string)
- func (m *Machine) SetWorkOrderMode(v bool)
- func (m *Machine) SliceOf() interface{}
- func (m *Machine) SplitTasks() (thePast []string, thePresent []string, theFuture []string)
- func (m *Machine) ToModels(obj interface{}) []Model
- func (m *Machine) UUID() string
- func (m *Machine) Validate()
- type MachineBase
- type MachineFingerprint
- type MenuGroup
- type MenuItem
- type Meta
- type MetaHaver
- type MigrateTicket
- type ModTimeSha
- func (m *ModTimeSha) Generate(fi *os.File) error
- func (m *ModTimeSha) GenerateStat(fi *os.File, stat os.FileInfo) error
- func (m *ModTimeSha) MarshalBinary() ([]byte, error)
- func (m *ModTimeSha) ReadFromXattr(fi *os.File) error
- func (m *ModTimeSha) Regenerate(fi *os.File) (bool, error)
- func (m *ModTimeSha) SaveToXattr(fi *os.File) error
- func (m *ModTimeSha) String() string
- func (m *ModTimeSha) UnmarshalBinary(buf []byte) error
- func (m *ModTimeSha) UpToDate(fi *os.File) bool
- type Model
- type NameSetter
- type NodeHaState
- type NodeInfo
- type OsInfo
- type Owned
- type Owner
- type Param
- func (p *Param) AuthKey() string
- func (p *Param) DefaultValue() (interface{}, bool)
- func (p *Param) Fill()
- func (p *Param) GetDescription() string
- func (p *Param) GetDocumentation() string
- func (p *Param) GetMeta() Meta
- func (p *Param) Key() string
- func (p *Param) KeyName() string
- func (p *Param) Prefix() string
- func (p *Param) SetMeta(d Meta)
- func (p *Param) SetName(s string)
- func (b *Param) SliceOf() interface{}
- func (b *Param) ToModels(obj interface{}) []Model
- func (p *Param) TypeValue() (interface{}, bool)
- func (p *Param) Validate()
- type Paramer
- type Partialed
- type Partialer
- type Plugin
- func (n *Plugin) AuthKey() string
- func (p *Plugin) CanHaveActions() bool
- func (n *Plugin) Fill()
- func (p *Plugin) GetDescription() string
- func (p *Plugin) GetDocumentation() string
- func (p *Plugin) GetMeta() Meta
- func (p *Plugin) GetParams() map[string]interface{}
- func (n *Plugin) Key() string
- func (n *Plugin) KeyName() string
- func (n *Plugin) Prefix() string
- func (p *Plugin) SetMeta(d Meta)
- func (p *Plugin) SetName(s string)
- func (p *Plugin) SetParams(pl map[string]interface{})
- func (p *Plugin) SliceOf() interface{}
- func (p *Plugin) ToModels(obj interface{}) []Model
- func (p *Plugin) Validate()
- type PluginProvider
- func (p *PluginProvider) AutoPlugin() *Plugin
- func (p *PluginProvider) Fill()
- func (p *PluginProvider) GetDocumentation() string
- func (p *PluginProvider) GetMeta() Meta
- func (p *PluginProvider) Key() string
- func (p *PluginProvider) KeyName() string
- func (p *PluginProvider) Prefix() string
- func (p *PluginProvider) SetMeta(d Meta)
- func (p *PluginProvider) SliceOf() interface{}
- func (p *PluginProvider) Store() (store.Store, error)
- func (p *PluginProvider) ToModels(obj interface{}) []Model
- type PluginProviderUploadInfo
- type Pool
- func (p *Pool) AuthKey() string
- func (p *Pool) CanHaveActions() bool
- func (p *Pool) Clone() *Pool
- func (p *Pool) Fill()
- func (p *Pool) GetDescription() string
- func (p *Pool) GetDocumentation() string
- func (p *Pool) Key() string
- func (p *Pool) KeyName() string
- func (p *Pool) Prefix() string
- func (p *Pool) SetName(name string)
- func (p *Pool) SliceOf() interface{}
- func (p *Pool) ToModels(obj interface{}) []Model
- func (p *Pool) Validate()
- type PoolAutoFill
- type PoolResult
- type PoolResults
- type PoolStatus
- type PoolTransitionActions
- type Pref
- type Profile
- func (p *Profile) AuthKey() string
- func (p *Profile) CanHaveActions() bool
- func (p *Profile) Fill()
- func (p *Profile) GetDescription() string
- func (p *Profile) GetDocumentation() string
- func (p *Profile) GetMeta() Meta
- func (p *Profile) GetParams() map[string]interface{}
- func (p *Profile) GetProfiles() []string
- func (p *Profile) Key() string
- func (p *Profile) KeyName() string
- func (p *Profile) Prefix() string
- func (p *Profile) SetMeta(d Meta)
- func (p *Profile) SetName(n string)
- func (p *Profile) SetParams(pl map[string]interface{})
- func (p *Profile) SetProfiles(np []string)
- func (p *Profile) SliceOf() interface{}
- func (p *Profile) ToModels(obj interface{}) []Model
- func (p *Profile) Validate()
- type Profiler
- type Query
- type RawModel
- func (r *RawModel) AddError(err error)
- func (r *RawModel) AuthKey() string
- func (r *RawModel) CanHaveActions() bool
- func (r *RawModel) ChangeForced() bool
- func (r *RawModel) ClearValidation()
- func (r *RawModel) Error() string
- func (r *RawModel) Errorf(fmtStr string, args ...interface{})
- func (r *RawModel) Fill()
- func (r *RawModel) ForceChange()
- func (r *RawModel) GetEndpoint() string
- func (r *RawModel) GetMeta() Meta
- func (r *RawModel) GetParams() map[string]interface{}
- func (r *RawModel) GetStringField(field string) (string, bool)
- func (r *RawModel) HasError() error
- func (r *RawModel) IsAvailable() bool
- func (r *RawModel) IsPartial() bool
- func (r *RawModel) IsReadOnly() bool
- func (r *RawModel) Key() string
- func (r *RawModel) KeyName() string
- func (r *RawModel) MakeError(code int, errType string, obj Model) error
- func (r *RawModel) Prefix() string
- func (r *RawModel) RestoreValidation(or *RawModel)
- func (r *RawModel) SaveValidation() *Validation
- func (r *RawModel) SetAvailable() bool
- func (r *RawModel) SetBundle(name string)
- func (r *RawModel) SetEndpoint(n string)
- func (r *RawModel) SetInvalid() bool
- func (r *RawModel) SetMeta(d Meta)
- func (r *RawModel) SetParams(p map[string]interface{})
- func (r *RawModel) SetPartial()
- func (r *RawModel) SetReadOnly(v bool)
- func (r *RawModel) SetValid() bool
- func (r *RawModel) SliceOf() interface{}
- func (r *RawModel) String() string
- func (r *RawModel) ToModels(obj interface{}) []Model
- func (r *RawModel) Useable() bool
- type Reservation
- func (r *Reservation) AuthKey() string
- func (r *Reservation) CanHaveActions() bool
- func (r *Reservation) Fill()
- func (r *Reservation) GetDescription() string
- func (r *Reservation) GetDocumentation() string
- func (r *Reservation) GetMeta() Meta
- func (r *Reservation) GetParams() map[string]interface{}
- func (r *Reservation) GetProfiles() []string
- func (r *Reservation) Key() string
- func (r *Reservation) KeyName() string
- func (r *Reservation) Prefix() string
- func (r *Reservation) SetMeta(d Meta)
- func (r *Reservation) SetParams(pl map[string]interface{})
- func (r *Reservation) SetProfiles(np []string)
- func (r *Reservation) SliceOf() interface{}
- func (r *Reservation) ToModels(obj interface{}) []Model
- func (r *Reservation) Validate()
- type ResourceBroker
- func (n *ResourceBroker) AddTasks(offset int, tasks ...string) error
- func (n *ResourceBroker) AuthKey() string
- func (n *ResourceBroker) CanHaveActions() bool
- func (n *ResourceBroker) DelTasks(tasks ...string)
- func (n *ResourceBroker) Fill()
- func (n *ResourceBroker) GetBootEnv() string
- func (n *ResourceBroker) GetContext() string
- func (n *ResourceBroker) GetCurrentJob() uuid.UUID
- func (n *ResourceBroker) GetDescription() string
- func (n *ResourceBroker) GetMeta() Meta
- func (n *ResourceBroker) GetName() string
- func (n *ResourceBroker) GetParams() map[string]interface{}
- func (n *ResourceBroker) GetProfiles() []string
- func (n *ResourceBroker) GetRunnable() bool
- func (n *ResourceBroker) GetStage() string
- func (n *ResourceBroker) GetState() string
- func (n *ResourceBroker) GetTasks() []string
- func (n *ResourceBroker) GetWorkOrderMode() bool
- func (n *ResourceBroker) GetWorkflow() string
- func (n *ResourceBroker) IsLocked() bool
- func (n *ResourceBroker) Key() string
- func (n *ResourceBroker) KeyName() string
- func (n *ResourceBroker) Prefix() string
- func (n *ResourceBroker) RunningTask() int
- func (n *ResourceBroker) SetBootEnv(s string)
- func (n *ResourceBroker) SetMeta(d Meta)
- func (n *ResourceBroker) SetName(name string)
- func (n *ResourceBroker) SetParams(p map[string]interface{})
- func (n *ResourceBroker) SetProfiles(p []string)
- func (n *ResourceBroker) SetRunnable(b bool)
- func (n *ResourceBroker) SetStage(s string)
- func (n *ResourceBroker) SetTasks(t []string)
- func (n *ResourceBroker) SetWorkOrderMode(v bool)
- func (n *ResourceBroker) SliceOf() interface{}
- func (n *ResourceBroker) SplitTasks() (thePast []string, thePresent []string, theFuture []string)
- func (n *ResourceBroker) ToModels(obj interface{}) []Model
- func (n *ResourceBroker) UUID() string
- func (n *ResourceBroker) Validate()
- type Role
- func (r *Role) AuthKey() string
- func (r *Role) Compile() Claims
- func (a *Role) Contains(b *Role) bool
- func (r *Role) Fill()
- func (r *Role) GetDescription() string
- func (r *Role) GetDocumentation() string
- func (r *Role) GetMeta() Meta
- func (r *Role) Key() string
- func (r *Role) KeyName() string
- func (r *Role) Match(scope, action, specific string) bool
- func (r *Role) Prefix() string
- func (r *Role) SetMeta(d Meta)
- func (r *Role) SliceOf() interface{}
- func (r *Role) ToModels(obj interface{}) []Model
- func (r *Role) Validate()
- type Section
- type Sections
- type SecureData
- func (s *SecureData) IsExternallyStored() bool
- func (s *SecureData) Marshal(peerPublicKey []byte, data interface{}) error
- func (s *SecureData) Open(targetPrivateKey *[32]byte) ([]byte, error)
- func (s *SecureData) Seal(peerPublicKey *[32]byte, data []byte) error
- func (s *SecureData) Unmarshal(targetPrivateKey []byte, res interface{}) error
- func (s *SecureData) Validate() error
- type Slicer
- type Stage
- func (s *Stage) AuthKey() string
- func (s *Stage) CanHaveActions() bool
- func (s *Stage) Fill()
- func (s *Stage) GetBootEnv() string
- func (s *Stage) GetDescription() string
- func (s *Stage) GetDocumentation() string
- func (s *Stage) GetMeta() Meta
- func (s *Stage) GetParams() map[string]interface{}
- func (s *Stage) GetProfiles() []string
- func (s *Stage) GetTasks() []string
- func (s *Stage) Key() string
- func (s *Stage) KeyName() string
- func (s *Stage) Prefix() string
- func (s *Stage) SetBootEnv(be string)
- func (s *Stage) SetMeta(d Meta)
- func (s *Stage) SetName(n string)
- func (s *Stage) SetParams(p map[string]interface{})
- func (s *Stage) SetProfiles(p []string)
- func (s *Stage) SetTasks(t []string)
- func (s *Stage) SliceOf() interface{}
- func (s *Stage) ToModels(obj interface{}) []Model
- func (s *Stage) Validate()
- type Stat
- type Subnet
- func (s *Subnet) AuthKey() string
- func (s *Subnet) CanHaveActions() bool
- func (s *Subnet) Fill()
- func (s *Subnet) GetDescription() string
- func (s *Subnet) GetDocumentation() string
- func (s *Subnet) GetMeta() Meta
- func (s *Subnet) GetParams() map[string]interface{}
- func (s *Subnet) GetProfiles() []string
- func (s *Subnet) Key() string
- func (s *Subnet) KeyName() string
- func (s *Subnet) Prefix() string
- func (s *Subnet) SetMeta(d Meta)
- func (s *Subnet) SetParams(pl map[string]interface{})
- func (s *Subnet) SetProfiles(np []string)
- func (s *Subnet) SliceOf() interface{}
- func (s *Subnet) ToModels(obj interface{}) []Model
- func (s *Subnet) Validate()
- type Task
- func (t *Task) AuthKey() string
- func (t *Task) CanHaveActions() bool
- func (t *Task) Fill()
- func (t *Task) GetDescription() string
- func (t *Task) GetDocumentation() string
- func (t *Task) GetMeta() Meta
- func (t *Task) Key() string
- func (t *Task) KeyName() string
- func (t *Task) Prefix() string
- func (t *Task) SetMeta(d Meta)
- func (t *Task) SetName(n string)
- func (t *Task) SliceOf() interface{}
- func (t *Task) ToModels(obj interface{}) []Model
- func (t *Task) Validate()
- type TaskDebug
- type TaskRunner
- type TaskStack
- type TaskState
- func (t *TaskState) CreateJobFrom(l logger.Logger, b, cj *Job, m *Machine, wo *WorkOrder, debug *TaskDebug, ...) (res CreatedJob)
- func (t *TaskState) EntryAt(idx int) (kind, entry string)
- func (r *TaskState) Fill()
- func (t *TaskState) HandleFailure(td *TaskDebug, j *Job) (inHandler, expandTasks bool)
- func (t *TaskState) PopError() (nothingToDo bool)
- func (r *TaskState) Validate(n ErrorAdder)
- type Tasker
- type Template
- func (t *Template) AuthKey() string
- func (b *Template) CanHaveActions() bool
- func (t *Template) Fill()
- func (t *Template) GetDescription() string
- func (t *Template) GetMeta() Meta
- func (t *Template) Key() string
- func (t *Template) KeyName() string
- func (t *Template) Prefix() string
- func (t *Template) SetMeta(d Meta)
- func (b *Template) SliceOf() interface{}
- func (b *Template) ToModels(obj interface{}) []Model
- func (t *Template) Validate()
- type TemplateInfo
- type Tenant
- func (t *Tenant) AuthKey() string
- func (t *Tenant) Fill()
- func (t *Tenant) GetDescription() string
- func (t *Tenant) GetDocumentation() string
- func (t *Tenant) GetMeta() Meta
- func (t *Tenant) Key() string
- func (t *Tenant) KeyName() string
- func (t *Tenant) Prefix() string
- func (t *Tenant) SetMeta(d Meta)
- func (t *Tenant) SliceOf() interface{}
- func (t *Tenant) ToModels(obj interface{}) []Model
- func (t *Tenant) Validate()
- type Trigger
- func (r *Trigger) AuthKey() string
- func (r *Trigger) CanHaveActions() bool
- func (r *Trigger) Fill()
- func (r *Trigger) GetDescription() string
- func (r *Trigger) GetDocumentation() string
- func (r *Trigger) GetMeta() Meta
- func (r *Trigger) GetParams() map[string]interface{}
- func (r *Trigger) GetProfiles() []string
- func (r *Trigger) Key() string
- func (r *Trigger) KeyName() string
- func (r *Trigger) Prefix() string
- func (r *Trigger) SetMeta(d Meta)
- func (r *Trigger) SetName(n string)
- func (r *Trigger) SetParams(p map[string]interface{})
- func (r *Trigger) SetProfiles(p []string)
- func (r *Trigger) SliceOf() interface{}
- func (r *Trigger) ToModels(obj interface{}) []Model
- func (r *Trigger) Validate()
- type TriggerInput
- type TriggerProvider
- func (r *TriggerProvider) AuthKey() string
- func (r *TriggerProvider) CanHaveActions() bool
- func (r *TriggerProvider) Fill()
- func (r *TriggerProvider) GetDescription() string
- func (r *TriggerProvider) GetDocumentation() string
- func (r *TriggerProvider) GetMeta() Meta
- func (r *TriggerProvider) GetParams() map[string]interface{}
- func (r *TriggerProvider) GetProfiles() []string
- func (r *TriggerProvider) Key() string
- func (r *TriggerProvider) KeyName() string
- func (r *TriggerProvider) Prefix() string
- func (r *TriggerProvider) SetMeta(d Meta)
- func (r *TriggerProvider) SetName(n string)
- func (r *TriggerProvider) SetParams(p map[string]interface{})
- func (r *TriggerProvider) SetProfiles(p []string)
- func (r *TriggerProvider) SliceOf() interface{}
- func (r *TriggerProvider) ToModels(obj interface{}) []Model
- func (r *TriggerProvider) Validate()
- type TriggerResult
- type User
- func (u *User) AuthKey() string
- func (b *User) CanHaveActions() bool
- func (u *User) ChangePassword(newPass string) error
- func (u *User) CheckPassword(pass string) bool
- func (u *User) Fill()
- func (u *User) GetDescription() string
- func (u *User) GetMeta() Meta
- func (u *User) Key() string
- func (u *User) KeyName() string
- func (u *User) Prefix() string
- func (u *User) Sanitize() Model
- func (u *User) SetMeta(d Meta)
- func (b *User) SetName(n string)
- func (b *User) SliceOf() interface{}
- func (b *User) ToModels(obj interface{}) []Model
- func (u *User) Validate()
- type UserPassword
- type UserToken
- type UxOption
- func (uo *UxOption) AuthKey() string
- func (uo *UxOption) CanHaveActions() bool
- func (uo *UxOption) Clone() *UxOption
- func (uo *UxOption) Fill()
- func (uo *UxOption) GetDescription() string
- func (uo *UxOption) GetDocumentation() string
- func (uo *UxOption) GetParams() map[string]interface{}
- func (uo *UxOption) Key() string
- func (uo *UxOption) KeyName() string
- func (uo *UxOption) Prefix() string
- func (uo *UxOption) SetName(name string)
- func (uo *UxOption) SetParams(pl map[string]interface{})
- func (uo *UxOption) SliceOf() interface{}
- func (uo *UxOption) ToModels(obj interface{}) []Model
- type UxSetting
- func (us *UxSetting) AuthKey() string
- func (us *UxSetting) CanHaveActions() bool
- func (us *UxSetting) Clone() *UxSetting
- func (us *UxSetting) Fill()
- func (us *UxSetting) GetDescription() string
- func (us *UxSetting) GetDocumentation() string
- func (us *UxSetting) GetParams() map[string]interface{}
- func (us *UxSetting) Key() string
- func (us *UxSetting) KeyName() string
- func (us *UxSetting) Prefix() string
- func (us *UxSetting) SetName(name string)
- func (us *UxSetting) SetParams(pl map[string]interface{})
- func (us *UxSetting) SliceOf() interface{}
- func (us *UxSetting) ToModels(obj interface{}) []Model
- type UxView
- func (ux *UxView) AuthKey() string
- func (ux *UxView) CanHaveActions() bool
- func (ux *UxView) Clone() *UxView
- func (ux *UxView) Fill()
- func (ux *UxView) GetDescription() string
- func (ux *UxView) GetDocumentation() string
- func (ux *UxView) GetParams() map[string]interface{}
- func (ux *UxView) Key() string
- func (ux *UxView) KeyName() string
- func (ux *UxView) Prefix() string
- func (ux *UxView) SetName(name string)
- func (ux *UxView) SetParams(pl map[string]interface{})
- func (ux *UxView) SliceOf() interface{}
- func (ux *UxView) ToModels(obj interface{}) []Model
- type ValidateSetter
- type Validation
- func (v *Validation) AddError(err error)
- func (v *Validation) ChangeForced() bool
- func (v *Validation) ClearValidation()
- func (v *Validation) Error() string
- func (v *Validation) Errorf(fmtStr string, args ...interface{})
- func (v *Validation) ForceChange()
- func (v *Validation) HasError() error
- func (v *Validation) IsAvailable() bool
- func (v *Validation) MakeError(code int, errType string, obj Model) error
- func (v *Validation) RestoreValidation(ov *Validation)
- func (v *Validation) SaveValidation() *Validation
- func (v *Validation) SetAvailable() bool
- func (v *Validation) SetInvalid() bool
- func (v *Validation) SetValid() bool
- func (v *Validation) Useable() bool
- type Validator
- type VersionSet
- func (vs *VersionSet) AuthKey() string
- func (vs *VersionSet) CanHaveActions() bool
- func (vs *VersionSet) Clone() *VersionSet
- func (vs *VersionSet) Fill()
- func (vs *VersionSet) GetDescription() string
- func (vs *VersionSet) GetDocumentation() string
- func (vs *VersionSet) Key() string
- func (vs *VersionSet) KeyName() string
- func (vs *VersionSet) Merge(nvs *VersionSet)
- func (vs *VersionSet) Prefix() string
- func (vs *VersionSet) SetName(name string)
- func (vs *VersionSet) SliceOf() interface{}
- func (vs *VersionSet) ToModels(obj interface{}) []Model
- type Whoami
- type WhoamiResult
- type WorkOrder
- func (w *WorkOrder) AddTasks(offset int, tasks ...string) error
- func (w *WorkOrder) AuthKey() string
- func (w *WorkOrder) CanHaveActions() bool
- func (w *WorkOrder) DelTasks(tasks ...string)
- func (w *WorkOrder) Fill()
- func (w *WorkOrder) GetBootEnv() string
- func (w *WorkOrder) GetContext() string
- func (w *WorkOrder) GetCurrentJob() uuid.UUID
- func (w *WorkOrder) GetMeta() Meta
- func (w *WorkOrder) GetName() string
- func (w *WorkOrder) GetParams() map[string]interface{}
- func (w *WorkOrder) GetProfiles() []string
- func (w *WorkOrder) GetRunnable() bool
- func (w *WorkOrder) GetStage() string
- func (w *WorkOrder) GetState() string
- func (w *WorkOrder) GetTasks() []string
- func (w *WorkOrder) GetWorkOrderMode() bool
- func (w *WorkOrder) GetWorkflow() string
- func (w *WorkOrder) Key() string
- func (w *WorkOrder) KeyName() string
- func (w *WorkOrder) Prefix() string
- func (w *WorkOrder) RunningTask() int
- func (w *WorkOrder) SetMeta(d Meta)
- func (w *WorkOrder) SetParams(p map[string]interface{})
- func (w *WorkOrder) SetProfiles(p []string)
- func (w *WorkOrder) SetRunnable(b bool)
- func (w *WorkOrder) SetStage(s string)
- func (w *WorkOrder) SetTasks(t []string)
- func (w *WorkOrder) SliceOf() interface{}
- func (w *WorkOrder) SplitTasks() (thePast []string, thePresent []string, theFuture []string)
- func (w *WorkOrder) ToModels(obj interface{}) []Model
- func (w *WorkOrder) Validate()
- type WorkOrderModer
- type Workflow
- func (w *Workflow) AuthKey() string
- func (w *Workflow) CanHaveActions() bool
- func (w *Workflow) Fill()
- func (w *Workflow) GetDescription() string
- func (w *Workflow) GetDocumentation() string
- func (w *Workflow) GetMeta() Meta
- func (w *Workflow) Key() string
- func (w *Workflow) KeyName() string
- func (w *Workflow) Prefix() string
- func (w *Workflow) SetMeta(d Meta)
- func (w *Workflow) SliceOf() interface{}
- func (w *Workflow) ToModels(obj interface{}) []Model
- func (w *Workflow) Validate()
- type Zone
- func (z *Zone) AddRecordFromRR(rr dns.RR) error
- func (z *Zone) AuthKey() string
- func (z *Zone) CanHaveActions() bool
- func (z *Zone) Fill()
- func (z *Zone) GetDescription() string
- func (z *Zone) GetDocumentation() string
- func (z *Zone) GetMeta() Meta
- func (z *Zone) GetName() string
- func (z *Zone) Key() string
- func (z *Zone) KeyName() string
- func (z *Zone) Prefix() string
- func (z *Zone) SetMeta(d Meta)
- func (z *Zone) SetName(n string)
- func (z *Zone) SliceOf() interface{}
- func (z *Zone) ToModels(obj interface{}) []Model
- func (z *Zone) Validate()
- type ZoneFilter
- type ZoneFilterType
- type ZoneName
- type ZoneRecord
- type ZoneType
Constants ¶
const ( BsdpOS9 = 0 BsdpOSX = 1 BsdpOSXServer = 2 BsdpDiags = 3 )
const ( // valid states BATCH_BLANK = "" BATCH_CREATED = "created" BATCH_SETUP = "setup" BATCH_RUNNING = "running" BATCH_POST = "post" BATCH_FAILED = "failed" BATCH_FINISHED = "finished" BATCH_CANCELLED = "cancelled" )
const ( // valid states JOB_BLANK = "" JOB_CREATED = "created" JOB_RUNNING = "running" JOB_FAILED = "failed" JOB_FINISHED = "finished" JOB_INCOMPLETE = "incomplete" // valid exitstates JOB_REBOOT = "reboot" JOB_POWEROFF = "poweroff" JOB_STOP = "stop" JOB_COMPLETE = "complete" )
const ( MACHINE_WORK_ORDER_SEP = `work_order:` MACHINE_WORK_ORDER_PREF = len(MACHINE_WORK_ORDER_SEP) )
const ( TASK = "task" CHROOT = "chroot" ACTION = "action" STAGE = "stage" BOOTENV = "bootenv" CONTEXT = "context" )
const LAB_ADVANCED = "advanced"
const LAB_INTERMEDIATE = "intermediate"
const LAB_INTRODUCTORY = "introductory"
const PS_BUILDING = "Building"
const PS_DESTROYING = "Destroying"
const PS_FREE = "Free"
const PS_HOLD_BUILD = "HoldBuild"
const PS_HOLD_DESTROY = "HoldDestroy"
const PS_HOLD_JOIN = "HoldJoin"
const PS_HOLD_LEAVE = "HoldLeave"
const PS_IN_USE = "InUse"
const PS_JOINING = "Joining"
const PS_LEAVING = "Leaving"
const ZFT_PKTSRC = "pktsrc"
Variables ¶
var ( BadKey = errors.New("Key must be 32 bytes long") BadNonce = errors.New("Nonce must be 24 bytes long") Corrupt = errors.New("SecureData corrupted") InvalidUri = errors.New("Invalid LookupUri format") )
var DnsIgnoreTypes = map[uint16]struct{}{ dns.TypeOPT: {}, dns.TypeAPL: {}, dns.TypeSVCB: {}, dns.TypeHTTPS: {}, }
TODO: Ignore the following records for now
var DnsRecordData = map[ZoneType]DnsRecord{}
var JOB_EVENT_HANDLER_DEPTH = 1
JOB_EVENT_HANDLER_DEPTH - defines the depth of error handling stacks. We currently don't handle errors on errors
var PoolStatuses []string = []string{
"Joining",
"HoldJoin",
"Free",
"Building",
"HoldBuild",
"InUse",
"Destroying",
"HoldDestroy",
"Leaving",
"HoldLeave",
}
PoolStatuses define the valid status for Machines in the pool
Functions ¶
func AllPrefixes ¶
func AllPrefixes() []string
AllPrefixes returns a slice containing the prefix names of all the Models.
func BaseTemplate ¶ added in v4.13.0
func DHCPOptionParser ¶
DHCPOptionParser returns the appropriate string conversion and deconversion functions for a given DHCP option code.
func DecodeYaml ¶
DecodeYaml is a helper function for dealing with user input -- when accepting input from the user, we want to treat both YAML and JSON as first-class citizens. The YAML library we use makes that easier by using the json struct tags for all marshalling and unmarshalling purposes.
Note that the REST API does not use YAML as a wire protocol, so this function should never be used to decode data coming from the provision service.
func DrpSafeFuncMap ¶
func FibBackoff ¶
func FibBackoff(thunk func() error)
FibBackoff takes function and retries it in a fibonacci backup sequence
func GenPatch ¶
func GenPatch(source, target interface{}, paranoid bool) (jsonpatch2.Patch, error)
GenPatch generates a JSON patch that will transform source into target. The generated patch will have all the applicable test clauses.
func IsSecureData ¶
func IsSecureData(val interface{}) bool
func NewUUID6 ¶ added in v4.8.0
NewUUID6 builds a time based UUID like a v1 UUID, except the sort order corresponds with the actual timestamp and it uses random numbers instead of MAC addresses. We will switch to using these for job purposes going forward, since jobs are often manipulated in ways that wind up being roughly ordered by time.
func ParseContentPrerequisites ¶
ParseContentPrerequisites is a helper that parses a Prerequisites string from the content bundle metadata and returns a map containing the comparison functions that must pass in order for the content bundle's prerequisites to be satisfied.
func ParseDuration ¶
ParseDuration parses a string into a duration and if no unit is specified, used the base passed in unit
func RandString ¶
RandString returns a random string of n characters The range of characters is limited to the base64 set
func SetHaState ¶
func SetHaState(base string, state *CurrentHAState) error
SetHaState saves state into base/ha-state.json. Any error in the process will leave the current file untouched.
func SupportedArch ¶
SupportedArch normalizes system architectures and returns whether it is one we know how to normalize.
func UpdateAllScopesWithRawModel ¶
func UpdateAllScopesWithRawModel(prefix string)
UpdateAllScopesWithRawModel adds new role scopes for a specialized RawModel
func ValidEndpointName ¶
ValidEndpointName validates that the string is a valid Endpoint Name
func ValidMachineName ¶
ValidMachineName validates that the string is a valid Machine Name
func ValidNameAt ¶ added in v4.8.0
ValidNameAt - validates name but can have @ sign in it
func ValidNumber ¶ added in v4.10.0
ValidNumber validates that the string is a number
func ValidNumberName ¶
ValidNumberName - validates name but can start with number
func ValidParamName ¶
ValidParamName validates that the string is a valid Param Name
func ValidUserName ¶
ValidUserName validates that the string is a valid Username
func ValidZoneName ¶ added in v4.13.0
func ValidateIP4 ¶
func ValidateIP4(e ErrorAdder, a net.IP)
func ValidateInput ¶ added in v4.11.0
func ValidateInput(c *CatalogBuilderInput) error
ValidateInput checks to see if required input is set; else throws an error
func ValidateMac ¶
func ValidateMac(e ErrorAdder, mac string)
func ValidateMaybeZeroIP4 ¶
func ValidateMaybeZeroIP4(e ErrorAdder, a net.IP)
Types ¶
type Access ¶
type Access struct { // ReadOnly tracks if the store for this object is read-only. // This flag is informational, and cannot be changed via the API. // // read only: true ReadOnly bool // CreatedBy stores the value of the user that created this object. // Note: This value is stored ONLY if the object was created by a user // which means that `currentUserName` needs to be populated in the authBlob CreatedBy string // CreatedAt is the time that this object was created. CreatedAt time.Time // LastModifiedBy stores the value of the user that last modified this object. // NOTE: This value is populated ONLY if the object was modified by a user // which means any actions done using machine tokens will not get tracked LastModifiedBy string // LastModifiedAt is the time that this object was last modified. LastModifiedAt time.Time }
Access holds if the object is read-only or not
swagger: model
func (*Access) GetCreatedAt ¶ added in v4.13.0
func (*Access) GetCreatedBy ¶ added in v4.13.0
func (*Access) GetLastModifiedAt ¶ added in v4.13.0
func (*Access) GetLastModifiedBy ¶ added in v4.13.0
func (*Access) IsReadOnly ¶
IsReadOnly returns whether the object is read-only. This will be set if the object comes from any content layer other than the working one (provided by a plugin or a content bundle, etc.)
func (*Access) SetCreatedAt ¶ added in v4.13.0
func (*Access) SetCreatedBy ¶ added in v4.13.0
func (*Access) SetLastModifiedAt ¶ added in v4.13.0
func (*Access) SetLastModifiedBy ¶ added in v4.13.0
func (*Access) SetReadOnly ¶
SetReadOnly sets the ReadOnly field of the model. Doing this will have no effect on the client side.
type Accessor ¶
type Accessor interface { IsReadOnly() bool SetReadOnly(bool) GetCreatedBy() string SetCreatedBy(string) GetCreatedAt() time.Time SetCreatedAt(time.Time) GetLastModifiedBy() string SetLastModifiedBy(string) GetLastModifiedAt() time.Time SetLastModifiedAt(time.Time) }
Accessor is an interface that objects that can be ReadOnly should satisfy. model object may define a Validate method that can be used to return errors about if the model is valid in the current datatracker.
type Action ¶
type Action struct { Model interface{} Plugin string Command string CommandSet string Params map[string]interface{} Job uuid.UUID `json:"Job,omitempty"` }
Action is an additional command that can be added to other Models by a Plugin.
type Activity ¶ added in v4.12.0
type Activity struct { Validation Access Owned Bundled // Id of the activity entry. Id string `index:",key"` // Type of the activity (from RawModel days) // Should be set to activities if present Type string // Span is the time window Span string // Identity is the uuid/identity of the record Identity string // Object Type ObjectType string // Number of times for this entry Count int // Platform is type of entry // Usually: meta, physical, virtual, container Platform string // Cloud is the cloud it is running in if set. Cloud string // Arch is the architecture of the machine e.g. amd64 Arch string // Context is the context of the machine e.g. "" or drpcli-runner Context string // OS is the operating system of the machine - could be off OS string // Deleted indicates if the entry was deleted. Deleted bool // Fingerprint indicates a unique machine specific identifier Fingerprint string }
Activity contains information about the activity of a machine during a time window
swagger:model
func ParseActivity ¶ added in v4.12.0
func (*Activity) CanHaveActions ¶ added in v4.12.0
type ActivityData ¶ added in v4.12.0
type ActivityData struct { MetaData *ActivityMeta MachineData []string HistoryData []string }
swagger:model
type ActivityMeta ¶ added in v4.12.0
type ActivityMeta struct { Rate string Version string OwnerId string Endpoint string EndpointMac string EndpointUuid string DropURL string Span string Generated string Machines int DataVersion string Counts map[string]int }
swagger:model
type AgentRunner ¶ added in v4.8.0
type AgentRunner interface { Paramer TaskRunner GetBootEnv() string GetStage() string GetWorkflow() string GetName() string HasFeature(string) bool GetCurrentJob() uuid.UUID GetContext() string GetRunnable() bool SetRunnable(bool) SetStage(string) GetState() string GetWorkOrderMode() bool }
AgentRunner defines the interface for an object to run in the agent.
type Alert ¶ added in v4.10.0
type Alert struct { Validation Access Owned // The UUID of the alert. // This is auto-created at Create time, and cannot change afterwards. // // required: true // swagger:strfmt uuid Uuid uuid.UUID `index:",key"` // Name is a short name for this alert. This can contain any reference // information for humans you want associated with the alert. Name string // Contents is the full information about the alert Contents string // Count is the number of times this Name has been called uniquely Count int // Notes - field for additional information about the Alert // Use this field for notes about what is done with the alert. Note string // Time of the alert. // swagger:strfmt date-time Time time.Time // Level of the alert // Range of values: Error, Warn, Info, Debug Level string // Principal is the creator of the alert. Principal string // Acknowledged - has the alert been acknowledged Acknowledged bool // AcknowledgeTime - time of acknowledgement AcknowledgeTime time.Time // AcknowledgeUser - user who acknowledged AcknowledgeUser string // Params - structure of data elements - filterable Params map[string]interface{} }
Alert represents a notification that needs to be acknowledged. The alert has data.
swagger:model
func (*Alert) SliceOf ¶ added in v4.10.0
func (a *Alert) SliceOf() interface{}
SliceOf returns a slice of these objects
type ArchInfo ¶
type ArchInfo struct { // IsoFile is the name of the ISO file (or other archive) // that contains all the necessary information to be able to // boot into this BootEnv for a given arch. // At a minimum, it must contain a kernel and initrd that // can be booted over the network. IsoFile string // Sha256 should contain the SHA256 checksum for the IsoFile. // If it does, the IsoFile will be checked upon upload to make sure // it has not been corrupted. Sha256 string // IsoUrl is the location that IsoFile can be downloaded from, if any. // This must be a full URL, including the filename. dr-provision does // not use this field internally. drpcli and the UX use this field to // provide a default source for downloading the IsoFile. // // swagger:strfmt url IsoUrl string // The partial path to the kernel for the boot environment. This // should be path that the kernel is located at in the OS ISO or // install archive. If empty, this will fall back to the top-level // Kernel field in the BootEnv // // required: true Kernel string // Partial paths to the initrds that should be loaded for the boot // environment. These should be paths that the initrds are located // at in the OS ISO or install archive. If empty, this will fall back // to the top-level Initrds field in the BootEnv // // required: true Initrds []string // A template that will be expanded to create the full list of // boot parameters for the environment. If empty, this will fall back // to the top-level BootParams field in the BootEnv // // required: true BootParams string // Loader is the bootloader that should be used for this boot // environment. If left unspecified and not overridden by a subnet // or reservation option, the following boot loaders will be used: // // * lpxelinux.0 on 386-pcbios platforms that are not otherwise using ipxe. // // * ipxe.pxe on 386-pcbios platforms that already use ipxe. // // * ipxe.efi on amd64 EFI platforms. // // * ipxe-arm64.efi on arm64 EFI platforms. // // This setting will be overridden by Subnet and Reservation // options, and it will also only be in effect when dr-provision is // the DHCP server of record. It will also be overridden by the corresponding // entry in the Loaders field of the BootEnv, if present and secure boot is enabled by // the license. Loader string }
ArchInfo tracks information required to make a BootEnv work across different system architectures. It supersedes the matching fields in the BootEnv struct and the OsInfo struct.
type AvailableAction ¶
type AvailableAction struct { Provider string Model string Command string RequiredParams []string OptionalParams []string }
AvailableAction is an Action that a Plugin instantiated by a PluginProvider. Assumes that there are parameters on the call in addition to the machine.
swagger:model
func (*AvailableAction) Fill ¶
func (a *AvailableAction) Fill()
type Batch ¶ added in v4.12.0
type Batch struct { Validation Access Meta Owned Bundled // UUID of the batch. The primary key. // required: true // swagger:strfmt uuid Uuid uuid.UUID `index:",key"` // A description of this machine. This can contain any reference // information for humans you want associated with the machine. Description string // SetupWorkOrderTemplate is the workorder to schedule work // This is started when created. // required: true SetupWorkOrderTemplate *WorkOrder `json:",omitempty"` // SetupWorkOrder is the scheduling work order that was created at create time. // swagger:strfmt uuid SetupWorkOrder uuid.UUID `json:",omitempty"` // WorkOrderTemplate is the basis for all spawned workorders WorkOrderTemplate *WorkOrder `json:",omitempty"` // PostWorkOrderTemplate is the workorder to clean-up/report/finish work // This is created when completed. PostWorkOrderTemplate *WorkOrder `json:",omitempty"` // SetupWorkOrder is the scheduling work order that was created at create time. // swagger:strfmt uuid PostWorkOrder uuid.UUID `json:",omitempty"` // State the batch is in. Must be one of "created", "setup", "running", "post", "failed", "finished", "cancelled" // required: true State string // Status is the reason for things Status string // StartTime is the time the batch started running. StartTime time.Time // EndTime is the time the batch failed or finished. EndTime time.Time // WorkOrderCounts addresses the state of the workorders - this is calculated WorkOrderCounts map[string]int }
Batch contains information on a batch that is running
swagger:model
func (*Batch) CanHaveActions ¶ added in v4.12.0
type Blueprint ¶ added in v4.9.0
type Blueprint struct { Validation Access Meta Owned Bundled // Name is the key of this particular Blueprint. // required: true Name string `index:",key"` // Tasks is a list of strings that match the same as the machine's Task list. // Actions, contexts, and stages are allowed, provided that the bootenv // does not change. Tasks []string // Description is a one-line description of the parameter. Description string // Documentation details what the parameter does, what values it can // take, what it is used for, etc. Documentation string // Profiles An array of profiles to apply to this machine in order when looking // for a parameter during rendering. Profiles []string // Params The Parameters that have been directly set on the Blueprint. Params map[string]interface{} }
Blueprint is used to build WorkOrders. It provides the initial Tasks, Profiles, and Params that are copied over to the WorkOrder when it transitions to Running.
swagger:model
func (*Blueprint) CanHaveActions ¶ added in v4.9.0
func (*Blueprint) GetDescription ¶ added in v4.9.0
GetDescription returns the object's Description
func (*Blueprint) GetDocumentation ¶ added in v4.9.0
GetDocumentaiton returns the object's Documentation
func (*Blueprint) GetProfiles ¶ added in v4.9.0
GetProfiles gets the profiles on this stage
func (*Blueprint) SetProfiles ¶ added in v4.9.0
SetProfiles sets the profiles on this stage
type BootEnv ¶
type BootEnv struct { Validation Access Meta Owned Bundled // Name is the name of the boot environment. Boot environments that install // an operating system must end in '-install'. All boot environment names must be unique. // // required: true Name string `index:",key"` // Description is a one-line description of this boot environment. This should tell what // the boot environment is for, any special considerations that // should be taken into account when using it, etc. Description string // Documentation for this boot environment. This should tell what // the boot environment is for, any special considerations that // should be taken into account when using it, etc. in rich structured text (rst). Documentation string // OS is the operating system specific information for the boot environment. OS OsInfo // Templates contains a list of templates that should be expanded into files for the // boot environment. These expanded templates will be available via TFTP and static HTTP // from dr-provision. You should take care that the final paths for the temmplates do not // overlap with ones provided by other boot environments. // // required: true Templates []TemplateInfo // The partial path to the kernel for the boot environment. This // should be path that the kernel is located at in the OS ISO or // install archive. Kernel must be non-empty for a BootEnv to be // considered net bootable. // // required: true Kernel string // Partial paths to the initrds that should be loaded for the boot // environment. These should be paths that the initrds are located // at in the OS ISO or install archive. // // required: true Initrds []string // A template that will be expanded to create the full list of // boot parameters for the environment. This list will generally be passed as command line // arguments to the Kernel as it boots up. // // required: true BootParams string // The list of extra required parameters for this // boot environment. They should be present as Machine.Params when // the bootenv is applied to the machine. // // required: true RequiredParams []string // The list of extra optional parameters for this // boot environment. They can be present as Machine.Params when // the bootenv is applied to the machine. These are more // other consumers of the bootenv to know what parameters // could additionally be applied to the bootenv by the // renderer based upon the Machine.Params // OptionalParams []string // OnlyUnknown indicates whether this bootenv can be used without a // machine. Only bootenvs with this flag set to `true` be used for // the unknownBootEnv preference. If this flag is set to True, then the // Templates provided byt this boot environment must take care to be able // to chainload into the appropriate boot environments for other machines // if the bootloader that machine is using does not support it natively. // The built-in ignore boot environment and the discovery boot environment // provided by the community content bundle should be used as references for // satisfying that requirement. // // required: true OnlyUnknown bool // Loaders contains the boot loaders that should be used for various different network // boot scenarios. It consists of a map of machine type -> partial paths to the bootloaders. // Valid machine types are: // // - 386-pcbios for x86 devices using the legacy bios. // // - amd64-uefi for x86 devices operating in UEFI mode // // - arm64-uefi for arm64 devices operating in UEFI mode // // Other machine types will be added as dr-provision gains support for them. // // If this map does not contain an entry for the machine type, the DHCP server will fall back to // the following entries in this order: // // - The Loader specified in the ArchInfo struct from this BootEnv, if it exists. // // - The value specified in the bootloaders param for the machine type specified on the machine, if it exists. // // - The value specified in the bootloaders param in the global profile, if it exists. // // - The value specified in the default value for the bootloaders param. // // - One of the following vaiues: // // - lpxelinux.0 for 386-pcbios // // - ipxe.efi for amd64-uefi // // - ipxe-arm64.efi for arm64-uefi // // required: true Loaders map[string]string // StartDelimiter is an optional start delimiter. // // required: false StartDelimiter string `json:",omitempty"` // EndDelimiter is an optional end delimiter. // // required: false EndDelimiter string `json:",omitempty"` }
BootEnv encapsulates the machine-agnostic information needed by the provisioner to set up a boot environment.
swagger:model
func (*BootEnv) BootParamsFor ¶
func (*BootEnv) CanHaveActions ¶
func (*BootEnv) GetDescription ¶
func (*BootEnv) GetDocumentation ¶
func (*BootEnv) InitrdsFor ¶
func (*BootEnv) IsoFor ¶
IsoFor is a helper function used by the backend to locate the ISO file that should be expanded to provide the install tree required for the bootenv to function.
func (*BootEnv) IsoUrlFor ¶
IsoUrlFor is a helper to return the upstream URL that the ISO for the BootEnv can be downloaded from. This generally points to a mirror location on the public Internet if one exists.
func (*BootEnv) MergeOverrides ¶
func (b *BootEnv) MergeOverrides(overrides ...BootEnvOverride) *BootEnv
MergeOverrides makes a copy of b with the override values in overrides applied in order, which whould be from leaset specific (in the global profile) to the most specific (defined directly on a Machine).
func (*BootEnv) NetBoot ¶
NetBoot returns whether this bootenv is able to boot via PXE or some other network mechanism.
type BootEnvOverride ¶
type BootEnvOverride struct { // Loaders contains the boot loaders that should be used. Any entries // here will override matching entries in the BootEnv that is being overridden. Loaders map[string]string // Override for the OSInfo field of the BootEnv that is being overridden. OS OsInfo // Additional templates that should also be rendered for the overridden BootEnv. // TemplateInfo fields with an identical Name will override the ones in the original // BootEnv. Templates []TemplateInfo }
BootEnvOverride is used to allow a BootEnv to be customized on a per-machine basis. Every entry in a bootenv-customize Param must be one of these.
type BsdpBootOption ¶
type BsdpBootOption struct { Index uint16 `plist:"Index"` Install bool `plist:"IsInstall"` OSType byte `plist:"Kind"` OSVersion string `plist:"osVersion"` Name string `plist:"Name"` Booter string `plist:"BootFile"` RootPath string `plist:"RootPath"` }
BsdpBootOption contains the information needed to boot their systems using the aapl BDSP boot protocol. Unless you are provisioning legacy Mac systems, you probably don't care about this. Apple has formally deprecated the underlying NetBoot protocol that these options enumerate: https://support.apple.com/en-us/HT208312 There does not appear to be a replacement set of protocols.
func (*BsdpBootOption) InstallType ¶
func (bo *BsdpBootOption) InstallType() string
InstallType defines the specific type of netboot is nbeing attempted.
func (*BsdpBootOption) MarshalText ¶
func (bo *BsdpBootOption) MarshalText() ([]byte, error)
func (*BsdpBootOption) OSName ¶
func (bo *BsdpBootOption) OSName() string
OSName maps the associated BSDP version flag to a useful string.
func (*BsdpBootOption) String ¶
func (bo *BsdpBootOption) String() string
func (*BsdpBootOption) UnmarshalText ¶
func (bo *BsdpBootOption) UnmarshalText(buf []byte) error
type Bundled ¶
type Bundled struct { // Bundle tracks the name of the store containing this object. // This field is read-only, and cannot be changed via the API. // // read only: true Bundle string }
Bundled holds the object's store's name
swagger: model
type CatalogBuilderInput ¶ added in v4.11.0
type CatalogBuilderInput struct { FileUrl string BaseDir string CatalogName string Meta ContentMetaData }
type CatalogItem ¶
type CatalogItem struct { Validation Access // Meta Items // Icon string // Color string // Author string // DisplayName string // License string // Copyright string // CodeSource string Meta Owned // Id is the unique ID for this catalog item. Id string `index:",key"` // Type is the type of catalog item this is. Type string Name string ActualVersion string Version string ContentType string Source string Shasum256 map[string]string NOJQSource string Tip bool HotFix bool }
CatalogItem structure that handles RawModel instead of dealing with RawModel which is how DRP is storing it.
swagger:model
func (*CatalogItem) AuthKey ¶
func (ci *CatalogItem) AuthKey() string
func (*CatalogItem) DownloadUrl ¶
func (ci *CatalogItem) DownloadUrl(arch, os string) string
DownloadUrl returns a URL that you can use to download the artifact for this catalog item. If the CatalogItem has a ContentType of `PluginProvider`, arch and os must be set appropriately for the target binary type, otherwise they can be left blank.
func (*CatalogItem) FileName ¶
func (ci *CatalogItem) FileName() string
FileName returns the recommended filename to use when writing this catalog item to disk.
func (*CatalogItem) Fill ¶
func (ci *CatalogItem) Fill()
func (*CatalogItem) Key ¶
func (ci *CatalogItem) Key() string
func (*CatalogItem) KeyName ¶
func (ci *CatalogItem) KeyName() string
func (*CatalogItem) Prefix ¶
func (ci *CatalogItem) Prefix() string
func (*CatalogItem) SliceOf ¶
func (ci *CatalogItem) SliceOf() interface{}
func (*CatalogItem) ToModels ¶
func (ci *CatalogItem) ToModels(obj interface{}) []Model
type Cert ¶
type Cert struct { Data [][]byte Key ed25519.PrivateKey // contains filtered or unexported fields }
Cert is one of the self-signed root CA entries used to secure communication between consensus cluster members. Members will trust any key signed with one of these.
func (*Cert) TLS ¶
func (c *Cert) TLS() *tls.Certificate
TLS converts the Cert into a TLS compatible certificate.
type ChangeForcer ¶
type ChangeForcer interface { ForceChange() ChangeForced() bool }
type Claim ¶
type Claim struct { Scope string `json:"scope"` Action string `json:"action"` Specific string `json:"specific"` }
Claim is an individial specifier for something we are allowed access to. User is an API user of DigitalRebar Provision swagger:model
func (*Claim) Match ¶
Match tests to see if this claim allows access for the specified scope, action, and specific item.
func (*Claim) Validate ¶
func (c *Claim) Validate(e ErrorAdder)
type ClaimsList ¶
type ClaimsList []Claims
ClaimsList is a list of Claims derived from a Role.
func (ClaimsList) Match ¶
func (c ClaimsList) Match(wanted Claims) bool
Match returns true if one of the entries in c contains wanted
type Classifier ¶ added in v4.11.0
type Classifier struct { Test string Title string Icon string Regex string Placeholder string NoAppend bool Continue bool Params map[string]interface{} }
Classifier is deprecated swagger:model
type CloudInit ¶
type CloudInit struct {
V1 CloudInitv1 `json:"v1,omitempty"`
}
Minimal Cloud Init JSON needed for Fill to collect Cloud ID
type CloudInitv1 ¶
type Cluster ¶ added in v4.8.0
type Cluster struct { Validation Access Meta Owned Bundled Partialed TaskState MachineBase }
Cluster represents a single bare-metal system that the provisioner should manage the boot environment for. swagger:model
func (*Cluster) AddTasks ¶ added in v4.8.0
AddTasks is a helper for adding tasks to the machine Tasks list in the mutable present.
func (*Cluster) CanHaveActions ¶ added in v4.8.0
CanHaveActions returns that the object can have actions
func (*Cluster) DelTasks ¶ added in v4.8.0
DelTasks allows you to delete tasks in the mutable present.
func (*Cluster) GetBootEnv ¶ added in v4.8.0
match BootEnver interface
func (*Cluster) GetContext ¶ added in v4.8.0
GetContext gets the name
func (*Cluster) GetCurrentJob ¶ added in v4.8.0
GetCurrentJob gets the name
func (*Cluster) GetDescription ¶ added in v4.8.0
func (*Cluster) GetProfiles ¶ added in v4.8.0
match Profiler interface
func (*Cluster) GetRunnable ¶ added in v4.8.0
GetRunnable sets runnable
func (*Cluster) GetWorkOrderMode ¶ added in v4.8.0
GetWorkOrderMode returns the current work order mode
func (*Cluster) GetWorkflow ¶ added in v4.8.0
GetWorkflow gets the name
func (*Cluster) RunningTask ¶ added in v4.8.0
RunningTask returns the current task index
func (*Cluster) SetBootEnv ¶ added in v4.8.0
func (*Cluster) SetProfiles ¶ added in v4.8.0
func (*Cluster) SetRunnable ¶ added in v4.8.0
SetRunnable sets runnable
func (*Cluster) SetWorkOrderMode ¶ added in v4.8.0
SetWorkOrderMode sets the work order mode
func (*Cluster) SplitTasks ¶ added in v4.8.0
SplitTasks slits the machine's Tasks list into 3 subsets:
1. the immutable past, which cannot be chnaged by task list modification
2. The mutable present, which contains tasks that can be deleted, and where tasks can be added.
3. The immutable future, which also cannot be changed.
type ClusterState ¶
type ClusterState struct { GlobalHaState Nodes []NodeInfo }
ClusterState is the overall state of a consensus cluster.
type Connection ¶ added in v4.11.0
type Connections ¶ added in v4.11.0
type Connections map[string]Connection
type ConnectionsList ¶ added in v4.11.0
type ConnectionsList []Connection
type Content ¶
type Content struct { // required: true Meta ContentMetaData `json:"meta"` // Sections is a nested map of object types to object unique identifiers to the objects // that are provided by this content bundle. Sections Sections `json:"sections"` }
Content models a content bundle. It consists of the metadata describing the content bundle and the objects that the content bundle provides. Upon being successfully loaded into dr-provision, these objects will be present and immutable until the content bundle is removed or replaced.
swagger:model
func (*Content) GenerateMetaMap ¶
func (*Content) GetDescription ¶
func (*Content) GetDocumentation ¶
type ContentMetaData ¶
type ContentMetaData struct { // Name is the name of the content bundle. Name must be unique across // all content bundles loaded into a given dr-provision instance. // required: true Name string // Version is a Semver-compliant string describing the version of // the content as a whole. If left empty, the version is assumed to // be 0.0.0 Version string // Description is a one or two line description of what the content // bundle provides. Description string `catalogBuilderDefault:"Local RackN Catalog"` // Source is mostly deprecated, replaced by Author and CodeSource. // It can be left blank. Source string // Documentation should contain Sphinx RST formatted documentation // for the content bundle describing its usage. Documentation string // RequiredFeatures is a comma-separated list of features that // dr-provision must provide for the content bundle to operate properly. // These correspond to the Features field in the Info struct. RequiredFeatures string // Prerequisites is also a comma-separated list that contains other // (possibly version-qualified) content bundles that must be present // for this content bundle to load into dr-provision. Each entry in // the Prerequisites list should be in for format of name: version // constraints. The colon and the version constraints may be // omitted if there are no version restrictions on the required // content bundle. // // See ../doc/arch/content-package.rst for more detailed info. Prerequisites string // Color is the color the Icon should show up as in the UX. Color names // must be one of the ones available from https://react.semantic-ui.com/elements/button/#types-basic-shorthand Color string `catalogBuilderDefault:"blue"` // Icon is the icon that should be used to represent this content bundle. // We use icons from https://react.semantic-ui.com/elements/icon/ Icon string `catalogBuilderDefault:"book"` // Author should contain the name of the author along with their email address. Author string `catalogBuilderDefault:"RackN"` // DisplayName is the froiendly name the UX will use by default. DisplayName string `catalogBuilderDefault:"Local RackN Catalog"` // License should be the name of the license that governs the terms the content is made available under. License string `catalogBuilderDefault:"RackN"` // Copyright is the copyright terms for this content. Copyright string `catalogBuilderDefault:"RackN"` // CodeSource should be a URL to the repository that this content was built from, if applicable. CodeSource string // Order gives a hint about the relaitve importance of this content when the UX is rendering // it. Deprecated, can be left blank. Order string `catalogBuilderDefault:"2000"` // Tags is used in the UX to categorize content bundles according to various criteria. It should // be a comma-separated list of single words. Tags string `catalogBuilderDefault:"rackn,catalog,contents,plugins"` // DocUrl should contain a link to external documentation for this content, if available. DocUrl string // Type contains what type of content bundle this is. It is read-only, and cannot be changed voa the API. Type string // Writable controls whether objects provided by this content can be modified independently via the API. // This will be false for everything but the BackingStore. It is read-only, and cannot be changed via // the API. Writable bool // Overwritable controls whether objects provided by this content store can be overridden by identically identified // objects from another content bundle. This will be false for everything but the BasicStore. // This field is read-only, and cannot be changed via the API. Overwritable bool }
ContentMetaData holds all the metadata about a content bundle that dr-provision will use to decide how to treat the content bundle.
All fields must be strings All string fields will be trimmed except Documentation.
type ContentSummary ¶
type ContentSummary struct { Meta ContentMetaData `json:"meta"` Counts map[string]int Warnings []string }
ContentSummary is a summary view of a content bundle, consisting of the content metadata, a count of each type of object the content bundle provides, and any warnings that were recorded when attempting to load the content bundle.
swagger:model
func (*ContentSummary) Fill ¶
func (c *ContentSummary) Fill()
func (*ContentSummary) FromStore ¶
func (c *ContentSummary) FromStore(src store.Store)
type Context ¶
type Context struct { Validation Access Meta Owned Bundled // Name is the name of this Context. It must be unique. Name string `index:",key"` // Image is the name of the prebuilt execution environment that the Engine should use to create // specific execution environments for this Context when Tasks should run on behalf // of a Machine. Images must contain all the tools needed to run the Tasks // that are designed to run in them, as well as a version of drpcli // with a context-aware `machines processjobs` command. Image string // Engine is the name of the Plugin that provides the functionality // needed to manage the execution environment that Tasks run in on // behalf of a given Machine in the Context. An Engine could be a // Plugin that interfaces with Docker or Podman locally, Kubernetes, // Rancher, vSphere, AWS, or any number of other things. Engine string // Description is a one-line summary of the purpose of this Context Description string // Documentation should contain any special notes or caveats to keep in mind // when using this Context. Documentation string }
Context defines an alternate task execution environment for a machine. This allows Digital Rebar to manage and run tasks against machines that mey not be able to run the Agent. See https://provision.readthedocs.io/en/latest/doc/arch/provision.html#context for more detailed information on how to make an environment for a Context.
swagger:model
type CreatedJob ¶ added in v4.8.0
type CurrentHAState ¶
type CurrentHAState struct { GlobalHaState NodeHaState }
CurrentHAState is the GlobalHaState and the NodeHaState for a particular node.
func GetHaState ¶
func GetHaState(base string) (*CurrentHAState, error)
GetHaState loads a serialized version of the CurrentHAState for a node from the directory passed in as Base. It always attempts to read from a file named ha-state.json
func (*CurrentHAState) EndpointCert ¶
func (c *CurrentHAState) EndpointCert(templateMaker func() (*x509.Certificate, error)) (*tls.Certificate, error)
EndpointCert creates a short-lived per-node certificate that is signed by the most recent root certificate.
func (*CurrentHAState) OurIp ¶
func (c *CurrentHAState) OurIp() (string, error)
OurIp returns the IP address that should be set in an endpoint certificate for host validation.
func (*CurrentHAState) Validate ¶
func (cOpts *CurrentHAState) Validate() error
Validate validates CurrentHAState to make sure is it sane.
type DhcpOption ¶
type DhcpOption struct { // Code is a DHCP Option Code. // // required: true Code byte // Value is a text/template that will be expanded // and then converted into the proper format // for the option code // // required: true Value string }
DhcpOption is a representation of a specific DHCP option. swagger:model
func DHCPOptionsInOrder ¶
func DHCPOptionsInOrder(p dhcp.Packet) (res []*DhcpOption, err error)
DHCPOptionsInOrder returns the DHCP options present in the passed-in Packet in the order they appeared, excluding the Pad and End options.
func (*DhcpOption) AddToPacket ¶
func (o *DhcpOption) AddToPacket(p *dhcp.Packet) error
func (*DhcpOption) ConvertOptionValueToByte ¶
func (o *DhcpOption) ConvertOptionValueToByte(value string) ([]byte, error)
func (*DhcpOption) Fill ¶
func (o *DhcpOption) Fill(s string) error
func (*DhcpOption) FillFromPacketOpt ¶
func (o *DhcpOption) FillFromPacketOpt(buf []byte)
func (DhcpOption) RenderToDHCP ¶
func (*DhcpOption) String ¶
func (o *DhcpOption) String() string
type DnsRecord ¶ added in v4.13.0
type DnsRecord struct { Key uint16 Min int Max int Records []DnsRecordField }
type DnsRecordField ¶ added in v4.13.0
type Element ¶
type Element struct { // Type defines the type of element // This can be: // DRP, DRPUX, File, Global, Plugin, Pref, PluginProvider, ContentPackage Type string // Version defines the short or reference version of the element. // e.g. tip, stable, v4.3.6 Version string // Name defines the name of the element. Normally, this is the // name of the the DRP, DRPUX, filename, plugin, ContentPackage, or PluginProvider Name. // For Global and Pref, these are the name of the global parameter or preference. Name string // ActualVersion is the actual catalog version referenced by this element. // This is used for translating tip and stable into a real version. // This is the source of the file element. This can be a relative or absolute path or an URL. ActualVersion string // ReplaceWritable tells whether or not content packs should replace writable content // Defaults to false. ReplaceWritable bool `json:",omitempty"` }
Element define a part of the endpoint This can be a file, a pref, global profile parameter, DRP itself, content packages, plugin_providers, or plugins.
type ElementAction ¶
type ElementAction struct { Element // Action defines what is to be done to this element. // These can be Set for Pref, Global. // These can be AddOrUpdate and Delete for the reset of the elements. // This field is ignored for the DRP and DRPUX element. It is assumed AddOrUpdate. Action string // Value defines what should be set or applied. This field is used // for the plugin, pref, global, and file elements. // // Plugin, Pref, and Global elements use this as the value for the element. // File elements use this field to determine if it should be exploded. Value interface{} }
ElementAction defines an action to take on an Element
func (*ElementAction) String ¶
func (ea *ElementAction) String() string
String prints a user-friendly format of an ElementAction
type Endpoint ¶
type Endpoint struct { Validation Access Meta Owned Bundled // Id is the name of the DRP endpoint this should match the HA pair's ID or the DRP ID of a single node. Id string `index:",key"` // Description is a string for providing a simple description Description string `json:"Description,omitempty"` // Documentation is a string for providing additional in depth information. Documentation string `json:"Documentation,omitempty"` // Params holds the access parameters - these should be secure parameters. // They are: // manager/username // manager/password // manager/url Params map[string]interface{} `json:"Params,omitempty"` // ConnectionStatus reflects the manager's state of interaction with the endpoint ConnectionStatus string `json:"ConnectionStatus,omitempty"` // VersionSet - Deprecated - was a single version set. // This should be specified within the VersionSets list VersionSet string `json:"VersionSet,omitempty"` // VersionSets replaces VersionSet - code processes both // This is the list of version sets to apply. These are merged // with the first in the list having priority over later elements in the list. VersionSets []string `json:"VersionSets,omitempty"` // Apply toggles whether the manager should update the endpoint. Apply bool `json:"Apply,omitempty"` // HaId is the HaId of the endpoint HaId string `json:"HaId,omitempty"` // Arch is the arch of the endpoint - Golang arch format. Arch string `json:"Arch,omitempty"` // Os is the os of the endpoint - Golang os format. Os string `json:"Os,omitempty"` // DRPVersion is the version of the drp endpoint running. DRPVersion string `json:"DRPVersion,omitempty"` // DRPUXVersion is the version of the ux installed on the endpoint. DRPUXVersion string `json:"DRPUXVersion,omitempty"` // Components is the list of ContentPackages and PluginProviders installed // and their versions Components []*Element `json:"Components,omitempty"` // Plugins is the list of Plugins configured on the endpoint. Plugins []*Plugin `json:"Plugins,omitempty"` // Prefs is the value of all the prefs on the endpoint. Prefs map[string]string `json:"Prefs,omitempty"` // Global is the Parameters of the global profile. Global map[string]interface{} `json:"Global,omitempty"` // Actions is the list of actions to take to make the endpoint // match the version sets on in the endpoint object. Actions []*ElementAction `json:"Actions,omitempty"` // ActionErrorCount is the number of failed actions in the action list // If the whole list is tried and no progress is made the apply will stop. ActionErrorCount int `json:"ActionErrorCount,omitempty"` }
Endpoint represents a managed Endpoint
This object is used to reflect the current state of a downstream endpoint.
It also shows the desired configuration state of the downstream endpoint through the applied versions sets.
It acts as the control point for applying updates through the Apply field. A user can also "dry-run" a set of changes to see what would happen by viewing the Actions field. This also shows remaining work while Apply is set to true.
It is similar to a machine object in that it has parameters that define how to access the endpoint and its state.
swagger:model
func (*Endpoint) CanHaveActions ¶
CanHaveActions indicates that the model can have actions
func (*Endpoint) GetDescription ¶
GetDescription returns the models Description
func (*Endpoint) GetParams ¶
GetParams returns the parameters on the Endpoint The returned map is a shallow copy.
func (*Endpoint) SetParams ¶
SetParams replaces the current parameters with a shallow copy of the input map.
func (*Endpoint) SliceOf ¶
func (e *Endpoint) SliceOf() interface{}
SliceOf returns a slice of the model
type Error ¶
type Error struct { Object Model `json:"-"` // Model is the type of object to which the error refers. It is generally // whatever thing.Prefix() would return. Model string // Key is the unique per-model identifier of the object to which the error refers. // It is generally whatever thing.Key() would return. Key string // Type is the type of error this is. There is no set definition for what this us. Type string // Messages are any additional messages related to this Error Messages []string // Code is the HTTP status code that should be used for this Error Code int }
Error is the common Error type the API returns for any error conditions.
swagger:model
func (*Error) ContainsError ¶
type ErrorAdder ¶
ErrorAdder is an interface that the various models that can collect errors for later repoting can satisfy.
type Event ¶
type Event struct { // Time of the event. // swagger:strfmt date-time Time time.Time // Type - object type Type string // Action - what happened Action string // Key - the id of the object Key string // Principal - the user or subsystem that caused the event to be emitted Principal string // Object - the data of the object. Object interface{} // Original - the data of the object before the operation (update and save only) Original interface{} }
Event represents an action in the system. In general, the event generates for a subject of the form: type.action.key
swagger:model
type Filler ¶
type Filler interface { Model Fill() }
Filler interface defines if a model can be filled/initialized
type Filter ¶ added in v4.11.0
type Filter struct { Validation Access Meta Owned Bundled // Id is the Name of the Filter Id string `index:",key"` // Documentation is an RST string defining the object Documentation string // Description is a short string description of the object Description string // Params is an unused residual of the object from previous releases Params map[string]interface{} // Object is the name of the set of objects this filter applies to. Object string // Aggregate indicates if parameters should be aggregate for search and return Aggregate bool // Decode indicates if the parameters should be decoded before returning the object Decode bool // ExcludeSelf removes self runners from the list (machines/clusters/resource_brokers) ExcludeSelf bool // GroupBy is a list of Fields or Parameters to generate groups of objects in a return list. GroupBy []string // ParamSet defines a comma-separated list of Fields or Parameters to return (can be complex functions) ParamSet string // RangeOnly indicates that counts should be returned of group-bys and no objects. RangeOnly bool // Reverse the returned list Reverse bool // Slim defines if meta, params, or specific parameters should be excluded from the object Slim string // Sort is a list of fields / parameters that should scope the list Sort []string // Queries are the tests to apply to the machine. Queries []Query }
Filter structure that handles RawModel instead of dealing with RawModel which is how DRP is storing it.
swagger:model
func (*Filter) CanHaveActions ¶ added in v4.11.0
CanHaveActions says that actions can be added to this object type
func (*Filter) GetDescription ¶ added in v4.11.0
GetDescription returns the object's Description
func (*Filter) GetDocumentation ¶ added in v4.11.0
GetDocumentaiton returns the object's Documentation
func (*Filter) Merge ¶ added in v4.11.0
Merge places the argument filter into current filter, preserving the current filter values.
func (*Filter) SliceOf ¶ added in v4.11.0
func (f *Filter) SliceOf() interface{}
SliceOf returns a slice of objects
func (*Filter) ToFilterString ¶ added in v4.11.0
ToFilterString converts the Filter into a string that can be parsed by the frontend/backend
type GlobalHaState ¶
type GlobalHaState struct { // LoadBalanced indicates that an external service is responsible for // routing traffic destined to VirtAddr to a cluster node. LoadBalanced bool // Enabled indicates whether either HA mode is operating on this cluster. // If just Enabled is set, the cluster is using the synchronous replication // protocol with manual failover. Enabled bool // ConsensusEnabled indicates that this cluster is operating on the Raft // based replication protocol with automatic failover. ConsensusEnabled bool // ConsensusJoin is the API URL of the current active node in a consensus // cluster. It may be unset if the cluster nodes cannot agree who should // be the active node, or if the cluster is operating using the sync replication // protocol. ConsensusJoin string // VirtAddr is the IP address that the cluster should appear to have from the // perspective of clients and third parties. VirtAddr string // ServerHostname is the DNS name for the DRP endpoint that managed systems should use. ServerHostname string // ActiveUri is the API URL of cthe cluster as built from the virtual addr. ActiveUri string // Token is an API authentication token that can be sued to perform cluster operations. Token string // HaID is the ID of the cluster as a whole. HaID string // Valid indicates that this state is valid and has been consistency checked. Valid bool // Roots is a list of self-signed trust roots that consensus nodes will use // to verify communication. These roots are automatically created and rotated // on a regular basis. Roots []Cert }
GlobalHaState is the consensus state shared by all members of a consensus cluster.
func (*GlobalHaState) FillTls ¶
func (g *GlobalHaState) FillTls() error
func (*GlobalHaState) RotateRoot ¶
func (g *GlobalHaState) RotateRoot(templateMaker func() (*x509.Certificate, error)) (err error)
RotateRoot adds a new self-signed root certificate to the beginning of g.Roots, and removes any expired certificates.
type HaPassiveState ¶
type HaPassiveState struct { // required: true Id string `json:"id"` // required: true Address string `json:"address"` // required: true State string `json:"state"` // required: true Electable bool `json:"electable"` }
HaPassiveState the state of the passive node
swagger:model
type IdentityProvider ¶ added in v4.8.0
type IdentityProvider struct { Validation Access Meta Owned Bundled // Name is the name of this identity provider // // required: true Name string // A description of this Identity Provider. This should tell what it is for, // any special considerations that should be taken into account when // using it, etc. Description string // Documentation of this Identity Provider. This should tell what // the identity provider is for, any special considerations that // should be taken into account when using it, etc. in rich structured text (rst). Documentation string // MetaDataUrl - URL to get the metadata for this IdP - instead of MetaDataBlob MetaDataUrl string // MetaDataBlob - String form of the metadata - instead of MetaDataUrl MetaDataBlob string // UserAttribute - specifies the attribute in the Assertions to use as username UserAttribute string // GroupAttribute - specifies the attribute in the Assertions to use as group memberships GroupAttribute string // GroupToRoles - defines the group names that map to DRP Roles GroupToRoles map[string][]string // DefaultRole - defines the default role to give these users DefaultRole string // DenyIfNoGroups - defines if the auth should fail if no groups are found in the GroupAttribute DenyIfNoGroups bool // DisplayName - The name to display to user DisplayName string // LogoPath - The path on DRP or the URL to the logo icon LogoPath string }
IdentityProvider tracks SAML identity providers
swagger:model
func (*IdentityProvider) AuthKey ¶ added in v4.8.0
func (ip *IdentityProvider) AuthKey() string
func (*IdentityProvider) CanHaveActions ¶ added in v4.8.0
func (ip *IdentityProvider) CanHaveActions() bool
func (*IdentityProvider) Fill ¶ added in v4.8.0
func (ip *IdentityProvider) Fill()
func (*IdentityProvider) GetDescription ¶ added in v4.8.0
func (ip *IdentityProvider) GetDescription() string
GetDescription returns the object's description
func (*IdentityProvider) GetDocumentation ¶ added in v4.8.0
func (ip *IdentityProvider) GetDocumentation() string
GetDocumentation returns the object's documentation
func (*IdentityProvider) GetMeta ¶ added in v4.8.0
func (ip *IdentityProvider) GetMeta() Meta
func (*IdentityProvider) Key ¶ added in v4.8.0
func (ip *IdentityProvider) Key() string
func (*IdentityProvider) KeyName ¶ added in v4.8.0
func (ip *IdentityProvider) KeyName() string
func (*IdentityProvider) Prefix ¶ added in v4.8.0
func (ip *IdentityProvider) Prefix() string
func (*IdentityProvider) SetMeta ¶ added in v4.8.0
func (ip *IdentityProvider) SetMeta(d Meta)
func (*IdentityProvider) SliceOf ¶ added in v4.8.0
func (ip *IdentityProvider) SliceOf() interface{}
func (*IdentityProvider) ToModels ¶ added in v4.8.0
func (ip *IdentityProvider) ToModels(obj interface{}) []Model
func (*IdentityProvider) Validate ¶ added in v4.8.0
func (ip *IdentityProvider) Validate()
Validate makes sure that the object is valid (outside of references)
type Index ¶
type Index struct { // Type gives you a rough idea of how the string used to query // this index should be formatted. Type string // Unique tells you whether there can be multiple entries in the // index for the same key that refer to different items. Unique bool // Unordered tells you whether this index cannot be sorted. Unordered bool // Regex indicates whether you can use the Re filter with this index Regex bool }
Index holds details on the index swagger:model
type Info ¶
type Info struct { // Arch is the system architecture of the running dr-provision endpoint. // It is the same value that would be return by runtime.GOARCH // required: true Arch string `json:"arch"` // Os is the operating system the dr-provision endpoint is running on. // It is the same value returned by runtime.GOARCH // required: true Os string `json:"os"` // Version is the full version of dr-provision. // required: true Version string `json:"version"` // Id is the local ID for this dr-provision. If not overridden by // an environment variable or a command line argument, it will // be the lowest MAC address of all the physical nics attached to the system. // required: true Id string `json:"id"` // LocalId is the same as Id, except it is always the MAC address form. // required: true LocalId string `json:"local_id"` // Uuid is the same as uuid of the endpoint // required: true Uuid string `json:"uuid"` // HaId is the user-assigned high-availability ID for this endpoint. // All endpoints in the same HA cluster must have the same HaId. // required: true HaId string `json:"ha_id"` // ApiPort is the TCP port that the API lives on. Defaults to 8092 // required: true ApiPort int `json:"api_port"` // ExtraApiPorts is any additional ports that the API is also // acessible on. If no extra ports are specified, this field will be omitted. ExtraApiPorts []int `json:"extra_api_ports,omitempty"` // FilePort is the TCP port that the static file HTTP server lives on. // Defaults to 8091 // required: true FilePort int `json:"file_port"` // ExtraFilePorts is any additional ports that static file HTTP server is also // acessible on. If no extra ports are specified, this field will be omitted. ExtraFilePorts []int `json:"extra_file_ports,omitempty"` // SecureFilePort is the TCP port that the static file HTTPS server lives on. // Defaults to 8090 // required: true SecureFilePort int `json:"secure_file_port"` // ExtraSecureFilePorts is any additional ports that the static file HTTPS server is also // acessible on. If no extra ports are specified, this field will be omitted. ExtraSecureFilePorts []int `json:"extra_secure_file_ports,omitempty"` // DhcpPort is the UDP port that the DHCPv4 server listens on. // Defaults to 67 // required: true DhcpPort int `json:"dhcp_port"` // BinlPort is the UDP port that the BINL server listens on. // Defaults to 4011 // required: true DnsPort int `json:"dns_port"` // required: true BinlPort int `json:"binl_port"` // TftpPort is the UDP port that the TFTP server listens on. // Defaults to 69, dude. // required: true TftpPort int `json:"tftp_port"` // TftpEnabled is true if the TFTP server is enabled. // required: true TftpEnabled bool `json:"tftp_enabled"` // DhcpEnabled is true if the DHCP server is enabled. // required: true DhcpEnabled bool `json:"dhcp_enabled"` // BinlEnabled is true if the BINL server is enabled. // required: true BinlEnabled bool `json:"binl_enabled"` // ProvisionerEnabled is true if the static file HTTP server is enabled. // required: true ProvisionerEnabled bool `json:"prov_enabled"` // SecureProvisionerEnabled is true if the static file HTTPS server is enabled. // required: true SecureProvisionerEnabled bool `json:"secure_prov_enabled"` // Address is the IP address that the system appears to listen on. // If a default address was assigned via environment variable or command line, // it will be that address, otherwise it will be the IP address of the interface // that has the default IPv4 route. // required: true DnsEnabled bool `json:"dns_enabled"` // required: true Address net.IP `json:"address"` // ServerHostname is the DNS name for the DRP endpoint that managed systems should use. // If a default hostname was assigned via environment variable or command line, // it will be that hostname, otherwise it will be an empty string ServerHostname string `json:"server_hostname"` // Manager indicates whether this dr-provision can act as a manager of // other dr-provision instances. // required: true Manager bool `json:"manager"` // Stats lists some basic object statistics. // required: true Stats []Stat `json:"stats"` // Features is a list of features implemented in this dr-provision endpoint. // Clients should use this field when determining what features are available // on anu given dr-provision instance. Features []string `json:"features"` // Scopes lists all static permission scopes available. Scopes map[string]map[string]struct{} `json:"scopes"` // License is an embedded copy of the licenses present on the system. License LicenseBundle // Errors returns the current system errors. // required: true Errors []string `json:"errors"` // HaEnabled indicates if High Availability is enabled HaEnabled bool `json:"ha_enabled"` // HaVirtualAddress is the Virtual IP Address of the systems HaVirtualAddress string `json:"ha_virtual_address"` // HaIsActive indicates Active (true) or Passive (false) // required: true HaIsActive bool `json:"ha_is_active"` // HaStatus indicates current state // For Active, Up is the only value. // For Passive, Connecting, Syncing, In-Sync // required: true HaStatus string `json:"ha_status"` // HaActiveId is the id of current active node HaActiveId string `json:"ha_active_id"` // HaPassiveState is a list of passive node's and their current state // This is only valid from the Active node HaPassiveState []*HaPassiveState `json:"ha_passive_state"` // ClusterState is the current state of the consensus cluster that this // node is a member of. As of v4.6, all nodes are in at least a single-node cluster ClusterState ClusterState }
Info contains information on how the running instance of dr-provision is configured.
For passive nodes, the license, scopes, and stats are not filled in.
swagger:model
func (*Info) HasFeature ¶
HasFeature is a helper function to determine if a requested feature is present.
type Interface ¶
type Interface struct { Access Meta // Name of the interface // // required: true Name string // Index of the interface. This is OS specific. Index int // Addresses contains the IPv4 and IPv6 addresses bound to this interface in no particular order. // // required: true Addresses []string // ActiveAddress is our best guess at the address that should be used for "normal" incoming traffic // on this interface. ActiveAddress string // Gateway is our best guess about the IP address that traffic forwarded through this interface should // be sent to. Gateway string // DnsServers is a list of DNS server that hsould be used when resolving addresses via this interface. DnsServers []string // DnsDomain is the domain that this system appears to be in on this interface. DnsDomain string }
Interface represents a network interface that is present on the server running dr-provision. It is primarily used by the UX to help generate Subnets.
swagger:model
type Job ¶
type Job struct { Validation Access Meta Owned Bundled // The UUID of the job. The primary key. // required: true // swagger:strfmt uuid Uuid uuid.UUID `index:",key"` // The UUID of the previous job to run on this machine. // swagger:strfmt uuid Previous uuid.UUID // The machine the job was created for. This field must be the UUID of the machine. // It must be set if Independent is false. // swagger:strfmt uuid Machine uuid.UUID // The work order the job was created for. This field must be the UUID of the work order. // It must be set if Independent is false and the job is being run on behalf of a WorkOrder. // swagger:strfmt uuid WorkOrder uuid.UUID `json:",omitempty"` // The task the job was created for. This will be the name of the task. // read only: true Task string // The stage that the task was created in. // read only: true Stage string // Context is the context the job was created to run in. Context string // The state the job is in. Must be one of "created", "running", "failed", "finished", "incomplete" // required: true State string // The final disposition of the job. // Can be one of "reboot","poweroff","stop", or "complete" // Other substates may be added as time goes on ExitState string // The time the job started running. StartTime time.Time // The time the job failed or finished. EndTime time.Time // Archived indicates whether the complete log for the job can be // retrieved via the API. If Archived is true, then the log cannot // be retrieved. // // required: true Archived bool // Whether the job is the "current one" for the machine or if it has been superceded. // // required: true Current bool // The current index is the machine CurrentTask that created this job. // // required: true // read only: true CurrentIndex int // The next task index that should be run when this job finishes. It is used // in conjunction with the machine CurrentTask to implement the server side of the // machine agent state machine. // // required: true // read only: true NextIndex int // The workflow that the task was created in. // read only: true Workflow string // The bootenv that the task was created in. // read only: true BootEnv string // ExtraClaims is the expanded list of extra Claims that were added to the // default machine Claims via the ExtraRoles field on the Task that the Job // was created to run. ExtraClaims []*Claim `json:"ExtraClaims,omitempty"` // Token is the JWT token that should be used when running this Job. If not // present or empty, the Agent running the Job will use its ambient Token // instead. If set, the Token will only be valid for the current Job. Token string `json:"Token,omitempty"` // ResultErrors is a list of error from the task. This is filled in by the // task if it is written to do so. This tracks results without requiring // job logs. ResultErrors []string // Independent indicates that this Job was created to track something besides a task being // executed by an agent. Most of the task state sanity checking performed by the job lifecycle // checking will be skipped -- in particular, the job need not be associated with a Workorder or a Machine, // it will be permitted to have multiple simultaneous Jobs in flight for the same Target, and State will // be ignored for job cleanup purposes. Independent bool `json:"Independent,omitempty"` // TargetPrefix is the Prefix of the Object that an Independent job was invoked against. // It must be set if Independent is true. TargetPrefix string `json:"TargetPrefix,omitempty"` // TargetKey is the Key of the Object that an Independent job was invoked against. // It may be empty if TargetPrefix is "system". TargetKey string `json:"TargetKey,omitempty"` // Action contains the expanded Action information if this Job was created as part of Action processing. Action *Action `json:"Action,omitempty"` }
Job contains information on a Job that is running for a specific Task on a Machine.
swagger:model
func (*Job) CanHaveActions ¶
type JobAction ¶
type JobAction struct { // Name is the name of this particular JobAction. It is taken from // the name of the corresponding Template on the Task this Action was rendered from. // required: true Name string // Path is the location that Content should be written to on disk. // // If Path is absolute, it will be written in that location. // // If Path is relative, it will be written relative to the temporary direcory created // for running the Job in. // // If Path is empty, then Content is interpreted as a script to be run. // required: true Path string // Content is the rendered version of the Template on the Task corresponding to this // JobAction. // required: true Content string // Meta is a copt of the Meta field of the corresponding Template from the Task this Job was built from. // required: true Meta map[string]string }
JobAction is something that job runner will need to do. If path is specified, then the runner will place the contents into that location. If path is not specified, then the runner will attempt to bash exec the contents.
JobAction is generated by rendering a Template on a Task against a specific Machine. swagger:model
func (*JobAction) ValidForOS ¶
type JobActions ¶
type JobActions []*JobAction
func (JobActions) FilterOS ¶
func (ja JobActions) FilterOS(forOS string) JobActions
type JobLogArchive ¶ added in v4.10.0
type JobLogArchive struct {
// contains filtered or unexported fields
}
JobLogArchive is the in-memory representation of a job log archive. It allows for an unlimited number of parallel log read operations and sequential log archival operations. It only holds the archive open as long as operations are pending. Individual job logs are compressed using seekable zstd.
func OpenJobLogArchive ¶ added in v4.10.0
func OpenJobLogArchive(name string, encoders, decoders *sync.Pool) (*JobLogArchive, error)
OpenJobLogArchive opens a JobLogArchive. It is up to the caller to ensure that only one process has a JobLogArchive open for updates at any time.
encoders, if not nil, must be a *sync.Pool of *zstd.Encoder.
decoders, if not nil, must be a *sync.Pool of *zstd.Decoder. If either of those is not true, then the job log archive routines will panic.
func (*JobLogArchive) Close ¶ added in v4.10.0
func (jla *JobLogArchive) Close() error
func (*JobLogArchive) Entries ¶ added in v4.10.0
func (jla *JobLogArchive) Entries() (res []JobLogEntry, err error)
Entries fetches all the job logs stored in this archive.
func (*JobLogArchive) EntryFor ¶ added in v4.10.0
func (jla *JobLogArchive) EntryFor(job uuid.Array) (res JobLogEntry, err error)
EntryFor fetches a single JobLogEntry from the JobLogArchive. It should be used when you just want the log metadata.
func (*JobLogArchive) ImportFile ¶ added in v4.10.0
ImportFile imports a loose file from the filesystem into the archive. Only one ImportFile can happen at a time.
func (*JobLogArchive) ImportFiles ¶ added in v4.10.0
func (*JobLogArchive) ImportReader ¶ added in v4.10.0
func (jla *JobLogArchive) ImportReader(entry *JobLogEntry, src io.Reader) error
ImportReader imports an uncompressed job log from src using the metadata in entry. src must have exactly entry.UncompressedSize data available to read, and entry.CompressedSize will be calculated on the fly.
func (*JobLogArchive) Iter ¶ added in v4.10.0
func (jla *JobLogArchive) Iter(cancel context.Context) (next func() *Log, err error)
func (*JobLogArchive) LogFor ¶ added in v4.10.0
func (jla *JobLogArchive) LogFor(job uuid.Array) (reader *Log, finalErr error)
LogFor returns a Log from the archive. Remember to close the log when you are finished with it.
func (*JobLogArchive) RawLogEntry ¶ added in v4.10.0
func (jla *JobLogArchive) RawLogEntry(job uuid.Array) (reader io.ReadSeekCloser, finalErr error)
func (*JobLogArchive) Remove ¶ added in v4.10.0
func (jla *JobLogArchive) Remove(ids ...uuid.Array) error
func (*JobLogArchive) StreamFrom ¶ added in v4.10.0
func (jla *JobLogArchive) StreamFrom(src io.Reader) error
func (*JobLogArchive) StreamOneTo ¶ added in v4.10.0
func (*JobLogArchive) StreamSomeTo ¶ added in v4.10.0
func (jla *JobLogArchive) StreamSomeTo(dest io.Writer, testFn func(*JobLogEntry) bool) error
type JobLogEntry ¶ added in v4.10.0
type JobLogEntry struct { JobID uuid.Array // ID of the job. A 16 byte array. MachineID uuid.Array // ID of the machine that owns the job. A 16 byte array ShaSum [32]byte // SHA256sum of the uncompressed job log. 32 bytes ModTime time.Time // Marshalled time.Time value. We always reserve 16 bytes, but it may be smaller. CompressedSize uint64 // Size of the compressed job log. 8 bytes UncompressedSize uint64 // Uncompressed size of the job log. Also 8 bytes. }
Header for completed job log entries. Unfinished job logs are stored raw on the filesystem.
func (*JobLogEntry) MarshalBinary ¶ added in v4.10.0
func (jle *JobLogEntry) MarshalBinary() ([]byte, error)
MarshalBinary marshals a JobLogEntry into its on-disk representation.
func (*JobLogEntry) ReadAt ¶ added in v4.10.0
func (jle *JobLogEntry) ReadAt(fi io.ReaderAt, offset int64) error
ReadAt reads a JobLogEntry from the specified offset in the passed-in file.
func (*JobLogEntry) ReadVerifiedAt ¶ added in v4.10.0
func (*JobLogEntry) UnmarshalBinary ¶ added in v4.10.0
func (jle *JobLogEntry) UnmarshalBinary(buf []byte) error
UnmarshalBinaty unmarshals a from its on-disk representation.
type Lab ¶ added in v4.10.0
type Lab struct { Validation Access Meta Owned Bundled // Id The ID of the lab. It must be a number stored as a string Id string `index:",key"` // Type The object type. **Must be `labs`** Type string // Documentation is an additional doc field for labs. Documentation string // Name of the Lab Summary Section Name string // Objective is the content of this Lab Step Objective string // Description of the Lab Summary Section Description string `json:",omitempty"` // Time An amount of time, like '15 minutes', that the lab should take to complete." Time int // Concepts is a list of concepts this Lab covers Concepts []string // Tags is a list of tags to define this Lab Tags []string // Difficulty of this Lab. Difficulty string // VideoUrl is a link to a video content of the lab VideoUrl string `json:",omitempty"` // Prereqs The prerequisites of this Lab. Prereqs *LabPrereqs `json:",omitempty"` // Enabled indicates if the lab should be shown in the UX Enabled bool `json:",omitempty"` // LabSection is the Main first section LabSection LabSection }
Lab defines a training/instructional component for the RackN training system.
The lab defines a set of steps and other things to help teach or demostrate a use.
swagger:model
func (*Lab) AuthKey ¶ added in v4.10.0
AuthKey defines the authentication / authorization field for this object
func (*Lab) CanHaveActions ¶ added in v4.10.0
CanHaveActions defines if the object can have actions in DRP
func (*Lab) GetDescription ¶ added in v4.10.0
GetDescription returns the object's Description
func (*Lab) GetDocumentation ¶ added in v4.10.0
GetDocumentaiton returns the object's Documentation
func (*Lab) SliceOf ¶ added in v4.10.0
func (l *Lab) SliceOf() interface{}
SliceOf creates a slice of this object type
type LabChecklistItem ¶ added in v4.10.0
type LabChecklistItem struct { // Label defines a short item to do Label string // Description defines an optional longer description of the checklist item Description string `json:",omitempty"` }
LabChecklistItem defines a checklist item for a Lab
type LabPrereqs ¶ added in v4.10.0
type LabPrereqs struct { // Labs is a list of Lab Ids required before this Lab. Labs []string `json:",omitempty"` // Checklist is a list of additional non-lab work items Checklist []LabChecklistItem `json:",omitempty"` }
LabPrereqs defines a set of things that are needed for this Lab.
type LabSection ¶ added in v4.10.0
type LabSection struct { // Name of the Lab Summary Section Name string `json:",omitempty"` // Objective is the content of this Lab Step Objective string `json:",omitempty"` // Description of the Lab Summary Section Description string `json:",omitempty"` // Tabbed indicates grouping of the sections should be tabbed Tabbed string `json:",omitempty"` // Sections of the Lab Section Sections LabSections `json:",omitempty"` }
LabSection defines a sction of the summary
type Lease ¶
type Lease struct { Validation Access Meta Owned Bundled // Addr is the IP address that the lease handed out. // // required: true // swagger:strfmt ipv4 Addr net.IP `index:",key"` // NextServer is the IP address that we should have the machine talk to // next. In most cases, this will be our address. // // required: false // swagger:strfmt ipv4 NextServer net.IP // Via is the IP address used to select which subnet the lease belongs to. // It is either an address present on a local interface that dr-provision is // listening on, or the GIADDR field of the DHCP request. // // required: false // swagger:strfmt ipv4 Via net.IP // Token is the unique token for this lease based on the // Strategy this lease used. // // required: true Token string // Duration is the time in seconds for which a lease can be valid. // ExpireTime is calculated from Duration. Duration int32 // ExpireTime is the time at which the lease expires and is no // longer valid The DHCP renewal time will be half this, and the // DHCP rebind time will be three quarters of this. // // required: true // swagger:strfmt date-time ExpireTime time.Time // Strategy is the leasing strategy that will be used determine what to use from // the DHCP packet to handle lease management. // // required: true Strategy string // State is the current state of the lease. This field is for informational // purposes only. // // read only: true // required: true State string // Options are the DHCP options that the Lease is running with. Options []DhcpOption // ProvidedOptions are the DHCP options the last Discover or Offer packet // for this lease provided to us. ProvidedOptions []DhcpOption // SkipBoot indicates that the DHCP system is allowed to offer // boot options for whatever boot protocol the machine wants to // use. // // read only: true SkipBoot bool // MachineUuid is set when the lease is created on a machine object only. // // required: false MachineUuid uuid.UUID `json:",omitempty"` }
Lease tracks DHCP leases. swagger:model
func (*Lease) CanHaveActions ¶
func (*Lease) Invalidate ¶
func (l *Lease) Invalidate()
type License ¶
type License struct { Name string Version string Data interface{} PurchaseDate time.Time StartDate time.Time SoftExpireDate time.Time HardExpireDate time.Time ContractTerminationDate time.Time ShortLicense string LongLicense string Active, Expired bool }
License is used to authorize acess to extended dr-provision features and functionality.
type LicenseBundle ¶
type LicenseBundle struct { Contact string ContactEmail string ContactId string Owner string OwnerEmail string OwnerId string Grantor string GrantorEmail string Version string GenerationVersion string Endpoints []string `json:",omitempty"` // MaxDrpVersion is the highest major/minor version to allow. // For example, v4.3 would mean any v4.3.* release or previous. MaxDrpVersion string Licenses []License }
LicenseBundle is a collection of Licenses.
type Log ¶ added in v4.10.0
type Log struct { io.ReadSeeker *seekable.Decoder JobLogEntry // contains filtered or unexported fields }
Log is used to access an archived job log. It can act as an io.ReadSeekCloser for the log contents.
type Machine ¶
type Machine struct { Validation Access Meta Owned Bundled Partialed TaskState MachineBase }
Machine represents a single bare-metal system that the provisioner should manage the boot environment for. swagger:model
func (*Machine) AddTasks ¶
AddTasks is a helper for adding tasks to the machine Tasks list in the mutable present.
func (*Machine) CanHaveActions ¶
CanHaveActions returns that the object can have actions
func (*Machine) GetContext ¶ added in v4.8.0
GetContext gets the name
func (*Machine) GetCurrentJob ¶ added in v4.8.0
GetCurrentJob gets the name
func (*Machine) GetDescription ¶
func (*Machine) GetRunnable ¶ added in v4.8.0
GetRunnable sets runnable
func (*Machine) GetWorkOrderMode ¶ added in v4.8.0
GetWorkOrderMode returns the current work order mode
func (*Machine) GetWorkflow ¶ added in v4.8.0
GetWorkflow gets the name
func (*Machine) RunningTask ¶
func (*Machine) SetBootEnv ¶
func (*Machine) SetProfiles ¶
func (*Machine) SetRunnable ¶ added in v4.8.0
SetRunnable sets runnable
func (*Machine) SetWorkOrderMode ¶ added in v4.8.0
SetWorkOrderMode sets the work order mode
func (*Machine) SplitTasks ¶
SplitTasks slits the machine's Tasks list into 3 subsets:
1. the immutable past, which cannot be changed by task list modification
2. The mutable present, which contains tasks that can be deleted, and where tasks can be added.
3. The immutable future, which also cannot be changed.
type MachineBase ¶ added in v4.8.0
type MachineBase struct { // The name of the machine. This must be unique across all // machines, and by convention it is the FQDN of the machine, // although nothing enforces that. // // required: true // swagger:strfmt hostname Name string `index:",uniq"` // A description of this machine. This can contain any reference // information for humans you want associated with the machine. Description string // The UUID of the machine. // This is auto-created at Create time, and cannot change afterwards. // // required: true // swagger:strfmt uuid Uuid uuid.UUID `index:",key"` // The IPv4 address of the machine that should be used for PXE // purposes. Note that this field does not directly tie into DHCP // leases or reservations -- the provisioner relies solely on this // address when determining what to render for a specific machine. // Address is updated automatically by the DHCP system if // HardwareAddrs is filled out. // // swagger:strfmt ipv4 Address net.IP // The boot environment that the machine should boot into. This // must be the name of a boot environment present in the backend. // If this field is not present or blank, the global default bootenv // will be used instead. BootEnv string // An array of profiles to apply to this machine in order when looking // for a parameter during rendering. Profiles []string // The Parameters that have been directly set on the Machine. Params map[string]interface{} // Secret for machine token revocation. Changing the secret will invalidate // all existing tokens for this machine Secret string `index:",ignore"` // OS is the operating system that the node is running in. It is updated by Sledgehammer and by // the various OS install tasks. // OS string // HardwareAddrs is a list of MAC addresses we expect that the system might boot from. // This must be filled out to enable MAC address based booting from the various bootenvs, // and must be updated if the MAC addresses for a system change for whatever reason. // HardwareAddrs []string // Workflow is the workflow that is currently responsible for processing machine tasks. // // required: true Workflow string // Arch is the machine architecture. It should be an arch that can // be fed into $GOARCH. // // required: true Arch string // Locked indicates that changes to the Machine by users are not // allowed, except for unlocking the machine, which will always // generate an Audit event. // // required: true Locked bool // Fingerprint is a collection of data that can (in theory) be used to uniquely identify // a machine based on various DMI information. This (in conjunction with HardwareAddrs) // is used to uniquely identify a Machine using a score based on how many total items in the Fingerprint // match. Fingerprint MachineFingerprint `index:",ignore"` // Pool contains the pool the machine is in. // Unset machines will join the default Pool Pool string // PoolAllocated defines if the machine is allocated in this pool // This is a calculated field. PoolAllocated bool // PoolStatus contains the status of this machine in the Pool. // Values are defined in Pool.PoolStatuses PoolStatus PoolStatus // WorkflowComplete indicates if the workflow is complete WorkflowComplete bool // WorkOrderMode indicates if the machine is action mode WorkOrderMode bool // PendingWorkOrders is the number of work orders for this // Machine that are in the 'created' state. PendingWorkOrders int // RunningWorkOrders is the number of work orders for this // Machine that are in the 'running' state. RunningWorkOrders int }
MachineBase is the core of a machine-like thing
type MachineFingerprint ¶
type MachineFingerprint struct { // DMI.System.Manufacturer + DMI.System.ProductName + DMI.System.SerialNumber, SHA256 hashed // Hash must not be zero-length to match. 25 points SSNHash []byte // DMI.System.Manufacturer + DMI.System.ProductName + DMI.Chassis[0].SerialNumber, SHA256 hashed // Hash must not be zero-length to match. 25 points CSNHash []byte // Cloud-init file in /run/cloud-init/instance-data.json // String from ID of '.v1.cloud_name' + '.v1.instance_id'. 500 point match CloudInstanceID string // DMI.System.UUID, not hashed. Must be non zero length and must be a non-zero UUID. 50 point match SystemUUID string // MemoryIds is an array of SHA256sums if the following fields in each // entry of the DMI.Memory.Devices array concatenated together: // * Manufacturer // * PartNumber // * SerialNumber // Each hash must not be zero length // Score is % matched. MemoryIds [][]byte }
MachineFingerprint defines a set of values that identify a machine. These can be compared to build a likely score of matching.
func (*MachineFingerprint) Fill ¶
func (m *MachineFingerprint) Fill()
type MenuGroup ¶ added in v4.11.0
type MenuGroup struct { Id string `json:",omitempty"` Title string `json:",omitempty"` Items []MenuItem `json:",omitempty"` }
MenuItem defines a new navigation menu. swagger:model
type MenuItem ¶ added in v4.11.0
type MenuItem struct { Id string `json:",omitempty"` Title string `json:",omitempty"` Filter string `json:",omitempty"` GroupBy []string `json:",omitempty"` To string `json:",omitempty"` Overwrite string `json:",omitempty"` Icon string `json:",omitempty"` Color string `json:",omitempty"` HasObject string `json:",omitempty"` HasFlag string `json:",omitempty"` }
MenuItem defines a new navigation menu. swagger:model
type Meta ¶
Meta holds information about arbitrary things. Initial usage will be for UX elements.
swagger: model
func (Meta) AddFeature ¶
func (Meta) ClearFeatures ¶
func (m Meta) ClearFeatures()
func (Meta) HasFeature ¶
func (Meta) MergeFeatures ¶
func (Meta) RemoveFeature ¶
type MigrateTicket ¶ added in v4.10.0
type ModTimeSha ¶
func (*ModTimeSha) GenerateStat ¶
func (*ModTimeSha) MarshalBinary ¶
func (m *ModTimeSha) MarshalBinary() ([]byte, error)
func (*ModTimeSha) ReadFromXattr ¶
func (m *ModTimeSha) ReadFromXattr(fi *os.File) error
func (*ModTimeSha) Regenerate ¶
func (m *ModTimeSha) Regenerate(fi *os.File) (bool, error)
func (*ModTimeSha) SaveToXattr ¶
func (m *ModTimeSha) SaveToXattr(fi *os.File) error
func (*ModTimeSha) String ¶
func (m *ModTimeSha) String() string
func (*ModTimeSha) UnmarshalBinary ¶
func (m *ModTimeSha) UnmarshalBinary(buf []byte) error
type Model ¶
Model is the interface that pretty much all non-Error objects returned by the API satisfy.
type NameSetter ¶
NameSetter interface if the model can change names
type NodeHaState ¶
type NodeHaState struct { // ConsensusID us the unique autogenerated ID for this node. // Once set, it must not be changed, or else other nodes in // a cluster will not recognize this node. ConsensusID uuid.UUID // VirtInterface is the network interface that the global VirtAddr // will be added on when this node si the active node, and removed from // when this node is no longer the active node. VirtInterface string // VirtInterfaceScript will be called whenever VirtAddr must be added // or removed from VirtInterface. If empty, a default set of scripts // will be sued that are appropriate to the OS type dr-provision is running on. VirtInterfaceScript string // ConsensusAddr is the addr:port that other nodes should attempt to contact // this node no when operating in consensus mode. All communication over these // ports will be secured using TLS 1.3 using per-node short-lived certs signed // by the certs in the global Roots field. ConsensusAddr string // ApiUrl is the URL that can be used to contact this node's API directly. ApiUrl string // Passive indicates that this node is not responsible for handling client connections // or writes via the API. Passive bool // Observer indicates that this node cannot become the active node. It is used when // a node should act as a live backup and a consensus tiebreaker. Observer bool // Version is the full version of dr-provision that is running on the node. Version string // ShaSum is the SHA256 checksum of the running dr-provision binary on the node. ShaSum []byte }
NodeHaState tracks the HA state for an individual node.
type NodeInfo ¶
type NodeInfo struct { NodeHaState // Offline indicates that leadership could not be transferred to // this node in the most recent election, despite it being the best candidate. // If a node is marks as Offline, it will stay that way until the node // updates its state with the current leader. Offline bool // LastArtifactCommitHandled tracks how up to date a node is compared to the current // cluster leader. Artifact handling is allowed to happen asynchronusly from the rest // of Raft based replication due to the potentially large size of artifacts. In the event // of a leadership transfer, the first node that is not Offline with the highest // LastArtifactCommitHandled value will be chosen as the new cluster leader. If that // node is not also an Observer, it will become the new active dr-provision node. If // it is an Observer, it will wait for one of the operating Passive nodes to catch up to it, // and then transfer leadership to it. LastArtifactCommitHandled uint64 // LastConnTime is the last time the leader was able to dial this node. LastConnTime time.Time }
NodeInfo is used to associate an URI to be used to talk to the dr-provision API for a particular Raft node.
type OsInfo ¶
type OsInfo struct { // The name of the OS this BootEnv has. It should be formatted as // family-version. // // required: true Name string // The family of operating system (linux distro lineage, etc) Family string // The codename of the OS, if any. Codename string // The version of the OS, if any. Version string // The name of the ISO that the OS should install from. If // non-empty, this is assumed to be for the amd64 hardware // architecture. IsoFile string // The SHA256 of the ISO file. Used to check for corrupt downloads. // If non-empty, this is assumed to be for the amd64 hardware // architecture. IsoSha256 string // The URL that the ISO can be downloaded from, if any. If // non-empty, this is assumed to be for the amd64 hardware // architecture. // // swagger:strfmt uri IsoUrl string // SupportedArchitectures maps from hardware architecture (named // according to the distro architecture naming scheme) to the // architecture-specific parameters for this OS. If // SupportedArchitectures is left empty, then the system assumes // that the BootEnv only supports amd64 platforms. SupportedArchitectures map[string]ArchInfo }
OsInfo holds information about the operating system this BootEnv maps to. Most of this information is optional for now. swagger:model
func (OsInfo) FamilyName ¶
FamilyName is a helper that figures out the family (read: distro name) of the OS. It uses Family if set, the first part of the Name otherwise.
func (OsInfo) FamilyType ¶
FamilyType figures out the lineage of the OS. If the OS is descended from RHEL, then "rhel" is returned. If the OS is descended from Debian, then "debian" is returned, otherwise FamilyName() is returned. Return values of this function are subject to change as support for new distros is brought onboard.
func (OsInfo) FamilyVersion ¶
FamilyVersion figures out the version of the OS. It returns the Version field if set, and the second part of the OS name if not set. This should be a Semver-ish version string, not a codename, release name, or similar item.
type Owned ¶
type Owned struct { // Endpoint tracks the owner of the object among DRP endpoints // read only: true Endpoint string }
Owned holds the info about which DRP Endpoint owns this object
swagger: model
func (*Owned) GetEndpoint ¶
GetEndpoint returns the name of the owning DRP Endpoint
func (*Owned) SetEndpoint ¶
SetEndpoint sets the model's Endpoint
type Owner ¶
model object may define a GetEndpoint() method that can be used to return the owner for the object
type Param ¶
type Param struct { Validation Access Meta Owned Bundled // Name is the name of the param. Params must be uniquely named. // // required: true Name string `index:",key"` // Description is a one-line description of the parameter. Description string // Documentation details what the parameter does, what values it can // take, what it is used for, etc. Documentation string // Secure implies that any API interactions with this Param // will deal with SecureData values. // // required: true Secure bool // Schema must be a valid JSONSchema as of draft v4. // // required: true Schema interface{} }
Param represents metadata about a Parameter or a Preference. Specifically, it contains a description of what the information is for, detailed documentation about the param, and a JSON schema that the param must match to be considered valid. swagger:model
func (*Param) DefaultValue ¶
func (*Param) GetDescription ¶
func (*Param) GetDocumentation ¶
type Paramer ¶
type Paramer interface { Model GetParams() map[string]interface{} SetParams(map[string]interface{}) }
Paramer interface defines if the model has parameters
type Partialed ¶
type Partialed struct { // Partial tracks if the object is not complete when returned. // read only: true Partial bool }
Partialed holds if the object is partially filled in.
swagger: model
func (*Partialed) ClearPartial ¶ added in v4.8.0
func (p *Partialed) ClearPartial()
ClearPartial clears the partial flag
type Partialer ¶
type Partialer interface { IsPartial() bool SetPartial() ClearPartial() }
Partialer is an interface that objects that are partially returned.
type Plugin ¶
type Plugin struct { Validation Access Meta Owned Bundled Partialed // The name of the plugin instance. THis must be unique across all // plugins. // // required: true Name string `index:",key"` // A description of this plugin. This can contain any reference // information for humans you want associated with the plugin. Description string // Documentation of this plugin. This should tell what // the plugin is for, any special considerations that // should be taken into account when using it, etc. in rich structured text (rst). Documentation string // Any additional parameters that may be needed to configure // the plugin. Params map[string]interface{} // The plugin provider for this plugin // // required: true Provider string // Error unrelated to the object validity, but the execution // of the plugin. PluginErrors []string }
Plugin represents a single instance of a running plugin. This contains the configuration need to start this plugin instance. swagger:model
func (*Plugin) CanHaveActions ¶
func (*Plugin) GetDescription ¶
func (*Plugin) GetDocumentation ¶
type PluginProvider ¶
type PluginProvider struct { Meta // Name is the unique name of the PluginProvider. // Each Plugin provider must have a unique Name. Name string `index:",key"` // The version of the PluginProvider. This is a semver compatible string. Version string // This is used to indicate what version the plugin is built for // This is effectively the API version of the protocol that // plugin providers use to communicate with dr-provision. // Right now, all plugin providers must set this to version 4, // which is the only supported protocol version. PluginVersion int // If AutoStart is true, a Plugin will be created for this // Provider at provider definition time, if one is not already present. AutoStart bool // HasPlugin is deprecated, plugin provider binaries should use a websocket // event stream instead. HasPublish bool // AvailableActions lists the actions that this PluginProvider // can take. AvailableActions []AvailableAction // RequiredParams and OptionalParams // are Params that must be present on a Plugin for the Provider // to operate. RequiredParams []string OptionalParams []string // Object prefixes that can be accessed by this plugin. // The interface can be empty struct{} or a JSONSchema draft v4 // This allows PluginProviders to define custom Object types that dr-provision will // store and check the validity of. StoreObjects map[string]interface{} // Documentation of this plugin provider. This should tell what // the plugin provider is for, any special considerations that // should be taken into account when using it, etc. in rich structured text (rst). Documentation string // Content Bundle Yaml string - can be optional or empty Content string }
Plugin Provider describes the available functions that could be instantiated by a plugin. swagger:model
func (*PluginProvider) AutoPlugin ¶
func (p *PluginProvider) AutoPlugin() *Plugin
AutoPlugin - builds a plugin model if auto start is true, otherwise nil
func (*PluginProvider) Fill ¶
func (p *PluginProvider) Fill()
func (*PluginProvider) GetDocumentation ¶
func (p *PluginProvider) GetDocumentation() string
func (*PluginProvider) GetMeta ¶
func (p *PluginProvider) GetMeta() Meta
func (*PluginProvider) Key ¶
func (p *PluginProvider) Key() string
func (*PluginProvider) KeyName ¶
func (p *PluginProvider) KeyName() string
func (*PluginProvider) Prefix ¶
func (p *PluginProvider) Prefix() string
func (*PluginProvider) SetMeta ¶
func (p *PluginProvider) SetMeta(d Meta)
func (*PluginProvider) SliceOf ¶
func (p *PluginProvider) SliceOf() interface{}
func (*PluginProvider) Store ¶
func (p *PluginProvider) Store() (store.Store, error)
Store extracts the content bundle in the Content field of the PluginProvider into a Store.
func (*PluginProvider) ToModels ¶
func (p *PluginProvider) ToModels(obj interface{}) []Model
type PluginProviderUploadInfo ¶
swagger:model
type Pool ¶
type Pool struct { Validation Access Meta Owned Bundled Id string `index:",key"` Description string `json:",omitempty"` Documentation string `json:",omitempty"` ParentPool string `json:",omitempty"` EnterActions *PoolTransitionActions `json:",omitempty"` ExitActions *PoolTransitionActions `json:",omitempty"` AllocateActions *PoolTransitionActions `json:",omitempty"` ReleaseActions *PoolTransitionActions `json:",omitempty"` AutoFill *PoolAutoFill `json:",omitempty"` }
* Pool defines the basics of the pool. This is a static object * that can be shared through content packs and version sets. * * Membership is dynamic and truth is from the machines' state. * * The transition actions are used on machines moving through the * pool (into and out of, allocated and released). * EnterActions * ExitActions * AllocateActions * ReleaseActions * * Params are used to provide default values. * * AutoFill Parameters are: * UseAutoFill bool * MinFree int32 * MaxFree int32 * CreateParameters map[string]interface{} * AcquirePool string
func (*Pool) CanHaveActions ¶
func (*Pool) GetDescription ¶
func (*Pool) GetDocumentation ¶
type PoolAutoFill ¶
type PoolAutoFill struct { UseAutoFill bool `json:"UseAutoFill,omitempty"` MinFree int32 `json:"MinFree,omitempty"` MaxFree int32 `json:"MaxFree,omitempty"` CreateParameters map[string]interface{} `json:"CreateParameters,omitempty"` AcquirePool string `json:"AcquirePool,omitempty"` ReturnPool string `json:"ReturnPool,omitempty"` }
PoolAutoFill are rules for dynamic pool sizing
type PoolResult ¶
type PoolResult struct { Name string Uuid string Allocated bool Status PoolStatus }
PoolResult is the common return structure most operations
type PoolResults ¶
type PoolResults map[PoolStatus][]*PoolResult
PoolResults is dynamically built provide membership and status.
type PoolStatus ¶
type PoolStatus string
type PoolTransitionActions ¶
type PoolTransitionActions struct { Workflow string `json:",omitempty"` AddProfiles []string `json:",omitempty"` AddParameters map[string]interface{} `json:",omitempty"` RemoveProfiles []string `json:",omitempty"` RemoveParameters []string `json:",omitempty"` }
PoolTransitionActions define the default actions that should happen to a machine upon movement through the pool.
type Pref ¶
Pref tracks a global DigitalRebar Provision preference -- things like the bootenv to use for unknown systems trying to PXE boot to us, the default bootenv for known systems, etc.
type Profile ¶
type Profile struct { Validation Access Meta Owned Bundled Partialed // The name of the profile. This must be unique across all // profiles. // // required: true Name string `index:",key"` // A description of this profile. This can contain any reference // information for humans you want associated with the profile. Description string // Documentation of this profile. This should tell what // the profile is for, any special considerations that // should be taken into account when using it, etc. in rich structured text (rst). Documentation string // Any additional parameters that may be needed to expand templates // for BootEnv, as documented by that boot environment's // RequiredParams and OptionalParams. Params map[string]interface{} // Additional Profiles that should be considered for parameters Profiles []string }
Profile represents a set of key/values to use in template expansion.
There is one special profile named 'global' that acts as a global set of parameters for the system.
These can be assigned to a machine's profile list. swagger:model
func (*Profile) CanHaveActions ¶
CanHaveActions indicates if the object is allowed to have actions
func (*Profile) GetDescription ¶
GetDescription returns the object's description
func (*Profile) GetDocumentation ¶
GetDocumentation returns the object's documentation
func (*Profile) GetParams ¶
GetParams returns the current parameters for this profile matches Paramer interface
func (*Profile) GetProfiles ¶
GetProfiles returns the profiles on this profile
func (*Profile) SetParams ¶
SetParams sets the current parameters for this profile matches Paramer interface
func (*Profile) SetProfiles ¶
SetProfiles sets the profiles on this profile
func (*Profile) SliceOf ¶
func (p *Profile) SliceOf() interface{}
SliceOf returns an empty slice of this type of objects
type Query ¶ added in v4.11.0
type Query struct { // Name is the field / parameter to lookup Name string // Op is the operation to apply to the field // Options are =,Eq,Re,Nin,In,Gt,... Op string // Value is the string value of the item to test. // The operator will convert to the field type as needed. Value string }
Query is a Field/parameter, an operator, and a value to test against.
swagger:model
type RawModel ¶
type RawModel map[string]interface{}
RawModel is a raw model that Plugins can specialize to save custom data in the dr-provision backing store.
func (*RawModel) CanHaveActions ¶
func (*RawModel) ChangeForced ¶
func (*RawModel) ClearValidation ¶
func (r *RawModel) ClearValidation()
func (*RawModel) ForceChange ¶
func (r *RawModel) ForceChange()
func (*RawModel) GetStringField ¶
Helpers to get fields
func (*RawModel) IsAvailable ¶
func (*RawModel) RestoreValidation ¶
func (*RawModel) SaveValidation ¶
func (r *RawModel) SaveValidation() *Validation
Validator Interface
func (*RawModel) SetAvailable ¶
func (*RawModel) SetEndpoint ¶
func (*RawModel) SetInvalid ¶
func (*RawModel) SetPartial ¶
func (r *RawModel) SetPartial()
func (*RawModel) SetReadOnly ¶
type Reservation ¶
type Reservation struct { Validation Access Meta Owned Bundled // Addr is the IP address permanently assigned to the strategy/token combination. // // required: true // swagger:strfmt ipv4 Addr net.IP `index:",key"` // A description of this Reservation. This should tell what it is for, // any special considerations that should be taken into account when // using it, etc. Description string // Documentation of this reservation. This should tell what // the reservation is for, any special considerations that // should be taken into account when using it, etc. in rich structured text (rst). Documentation string // Token is the unique identifier that the strategy for this Reservation should use. // // required: true Token string // Subnet is the name of the Subnet that this Reservation is associated with. // This property is read-only. // Subnet string // NextServer is the address the server should contact next. You // should only set this if you want to talk to a DHCP or TFTP server // other than the one provided by dr-provision. // // required: false // swagger:strfmt ipv4 NextServer net.IP // Options is the list of DHCP options that apply to this Reservation Options []DhcpOption // Strategy is the leasing strategy that will be used determine what to use from // the DHCP packet to handle lease management. // // required: true Strategy string // Scoped indicates that this reservation is tied to a particular Subnet, // as determined by the reservation's Addr. // // required: true Scoped bool // Duration is the time in seconds for which a lease can be valid. // ExpireTime is calculated from Duration. Duration int32 // Allocated indicates this is a reapable reservation Allocated bool `json:"Allocated,omitempty"` // Machine is the associated machine Machine uuid.UUID `json:"Machine,omitempty"` // Parameter is the parameter that this address should be stored in for the machine if specified Parameter string `json:"Parameter,omitempty"` // Params are any additional parameters that may be needed to expand templates // for BootEnv, as documented by that boot environment's // RequiredParams and OptionalParams. Params map[string]interface{} // Profiles that should be considered for parameters Profiles []string // PrefixParameter a string that should be the beginning of a set of option-based parameters PrefixParameter string `json:",omitempty"` // SkipDAD will cause the DHCP server to skip duplicate address detection via ping testing // when in discovery phase. Only set this if you know this reservation can never conflict // with any other system. SkipDAD bool }
Reservation tracks persistent DHCP IP address reservations.
swagger:model
func (*Reservation) AuthKey ¶
func (r *Reservation) AuthKey() string
func (*Reservation) CanHaveActions ¶
func (r *Reservation) CanHaveActions() bool
func (*Reservation) Fill ¶
func (r *Reservation) Fill()
func (*Reservation) GetDescription ¶
func (r *Reservation) GetDescription() string
GetDescription returns the object's description
func (*Reservation) GetDocumentation ¶
func (r *Reservation) GetDocumentation() string
GetDocumentation returns the object's documentation
func (*Reservation) GetMeta ¶
func (r *Reservation) GetMeta() Meta
func (*Reservation) GetParams ¶ added in v4.13.0
func (r *Reservation) GetParams() map[string]interface{}
Match Paramer interface GetParams returns the current parameters for this profile matches Paramer interface
func (*Reservation) GetProfiles ¶ added in v4.13.0
func (r *Reservation) GetProfiles() []string
match Profiler interface GetProfiles returns the profiles on this profile
func (*Reservation) Key ¶
func (r *Reservation) Key() string
func (*Reservation) KeyName ¶
func (r *Reservation) KeyName() string
func (*Reservation) Prefix ¶
func (r *Reservation) Prefix() string
func (*Reservation) SetMeta ¶
func (r *Reservation) SetMeta(d Meta)
func (*Reservation) SetParams ¶ added in v4.13.0
func (r *Reservation) SetParams(pl map[string]interface{})
SetParams sets the current parameters for this profile matches Paramer interface
func (*Reservation) SetProfiles ¶ added in v4.13.0
func (r *Reservation) SetProfiles(np []string)
SetProfiles sets the profiles on this profile
func (*Reservation) SliceOf ¶
func (r *Reservation) SliceOf() interface{}
func (*Reservation) ToModels ¶
func (r *Reservation) ToModels(obj interface{}) []Model
func (*Reservation) Validate ¶ added in v4.13.0
func (r *Reservation) Validate()
type ResourceBroker ¶ added in v4.8.0
type ResourceBroker struct { Validation Access Meta Owned Bundled Partialed TaskState MachineBase }
ResourceBroker represents a single bare-metal system that the provisioner should manage the boot environment for. swagger:model
func (*ResourceBroker) AddTasks ¶ added in v4.8.0
func (n *ResourceBroker) AddTasks(offset int, tasks ...string) error
AddTasks is a helper for adding tasks to the machine Tasks list in the mutable present.
func (*ResourceBroker) AuthKey ¶ added in v4.8.0
func (n *ResourceBroker) AuthKey() string
func (*ResourceBroker) CanHaveActions ¶ added in v4.8.0
func (n *ResourceBroker) CanHaveActions() bool
CanHaveActions returns that the object can have actions
func (*ResourceBroker) DelTasks ¶ added in v4.8.0
func (n *ResourceBroker) DelTasks(tasks ...string)
DelTasks allows you to delete tasks in the mutable present.
func (*ResourceBroker) Fill ¶ added in v4.8.0
func (n *ResourceBroker) Fill()
func (*ResourceBroker) GetBootEnv ¶ added in v4.8.0
func (n *ResourceBroker) GetBootEnv() string
match BootEnver interface
func (*ResourceBroker) GetContext ¶ added in v4.8.0
func (n *ResourceBroker) GetContext() string
GetContext gets the name
func (*ResourceBroker) GetCurrentJob ¶ added in v4.8.0
func (n *ResourceBroker) GetCurrentJob() uuid.UUID
GetCurrentJob gets the name
func (*ResourceBroker) GetDescription ¶ added in v4.8.0
func (n *ResourceBroker) GetDescription() string
func (*ResourceBroker) GetMeta ¶ added in v4.8.0
func (n *ResourceBroker) GetMeta() Meta
func (*ResourceBroker) GetName ¶ added in v4.8.0
func (n *ResourceBroker) GetName() string
GetName gets the name
func (*ResourceBroker) GetParams ¶ added in v4.8.0
func (n *ResourceBroker) GetParams() map[string]interface{}
match Param interface
func (*ResourceBroker) GetProfiles ¶ added in v4.8.0
func (n *ResourceBroker) GetProfiles() []string
match Profiler interface
func (*ResourceBroker) GetRunnable ¶ added in v4.8.0
func (n *ResourceBroker) GetRunnable() bool
GetRunnable sets runnable
func (*ResourceBroker) GetStage ¶ added in v4.8.0
func (n *ResourceBroker) GetStage() string
GetStage gets the name
func (*ResourceBroker) GetState ¶ added in v4.8.0
func (n *ResourceBroker) GetState() string
GetState returns fake state
func (*ResourceBroker) GetTasks ¶ added in v4.8.0
func (n *ResourceBroker) GetTasks() []string
GetTasks returns the task list
func (*ResourceBroker) GetWorkOrderMode ¶ added in v4.8.0
func (n *ResourceBroker) GetWorkOrderMode() bool
GetWorkOrderMode returns the current work order mode
func (*ResourceBroker) GetWorkflow ¶ added in v4.8.0
func (n *ResourceBroker) GetWorkflow() string
GetWorkflow gets the name
func (*ResourceBroker) IsLocked ¶ added in v4.8.0
func (n *ResourceBroker) IsLocked() bool
func (*ResourceBroker) Key ¶ added in v4.8.0
func (n *ResourceBroker) Key() string
func (*ResourceBroker) KeyName ¶ added in v4.8.0
func (n *ResourceBroker) KeyName() string
func (*ResourceBroker) Prefix ¶ added in v4.8.0
func (n *ResourceBroker) Prefix() string
func (*ResourceBroker) RunningTask ¶ added in v4.8.0
func (n *ResourceBroker) RunningTask() int
RunningTask returns the current task index
func (*ResourceBroker) SetBootEnv ¶ added in v4.8.0
func (n *ResourceBroker) SetBootEnv(s string)
func (*ResourceBroker) SetMeta ¶ added in v4.8.0
func (n *ResourceBroker) SetMeta(d Meta)
func (*ResourceBroker) SetName ¶ added in v4.8.0
func (n *ResourceBroker) SetName(name string)
SetName sets the name
func (*ResourceBroker) SetParams ¶ added in v4.8.0
func (n *ResourceBroker) SetParams(p map[string]interface{})
func (*ResourceBroker) SetProfiles ¶ added in v4.8.0
func (n *ResourceBroker) SetProfiles(p []string)
func (*ResourceBroker) SetRunnable ¶ added in v4.8.0
func (n *ResourceBroker) SetRunnable(b bool)
SetRunnable sets runnable
func (*ResourceBroker) SetStage ¶ added in v4.8.0
func (n *ResourceBroker) SetStage(s string)
SetStage sets the name
func (*ResourceBroker) SetTasks ¶ added in v4.8.0
func (n *ResourceBroker) SetTasks(t []string)
SetTasks sets the task list
func (*ResourceBroker) SetWorkOrderMode ¶ added in v4.8.0
func (n *ResourceBroker) SetWorkOrderMode(v bool)
SetWorkOrderMode sets the work order mode
func (*ResourceBroker) SliceOf ¶ added in v4.8.0
func (n *ResourceBroker) SliceOf() interface{}
func (*ResourceBroker) SplitTasks ¶ added in v4.8.0
func (n *ResourceBroker) SplitTasks() (thePast []string, thePresent []string, theFuture []string)
SplitTasks slits the machine's Tasks list into 3 subsets:
1. the immutable past, which cannot be chnaged by task list modification
2. The mutable present, which contains tasks that can be deleted, and where tasks can be added.
3. The immutable future, which also cannot be changed.
func (*ResourceBroker) ToModels ¶ added in v4.8.0
func (n *ResourceBroker) ToModels(obj interface{}) []Model
func (*ResourceBroker) UUID ¶ added in v4.8.0
func (n *ResourceBroker) UUID() string
func (*ResourceBroker) Validate ¶ added in v4.8.0
func (n *ResourceBroker) Validate()
type Role ¶
type Role struct { Validation Access Meta Owned Bundled // Name is the name of the user // // required: true Name string `index:",key"` // Claims that the role support. Claims []*Claim // Description of role Description string // Documentation of this role. This should tell what // the role is for, any special considerations that // should be taken into account when using it, etc. in rich structured text (rst). Documentation string }
Role is used to determine which operations on which API endpoints are permitted.
swagger:model
func (*Role) Contains ¶
Role a contains role b if a can be used to satisfy all requests b can satisfy
func (*Role) GetDescription ¶
GetDescription returns the object's Description
func (*Role) GetDocumentation ¶
GetDocumentaiton returns the object's Documentation
type SecureData ¶
type SecureData struct { // Key is the ephemeral public key created by Seal(). It must not // be modified after Seal() has completed, and it must be 32 bytes // long. Key []byte // Nonce must be 24 bytes of cryptographically random numbers. It is // populated by Seal(), and must not be modified afterwards. Nonce []byte // Payload is the encrypted payload generated by Seal(). It must // not be modified, and will be 16 bytes longer than the unencrypted // data. Payload []byte // LookupUri is combination of a plugin name and a path to where the secrets // are stored. Defaults to "" which means local storage and ensures backwards // compatibility. // example: "plugin://path?param1=val1¶m2=val2" LookupUri string `json:",omitempty"` }
SecureData is used to store and send access controlled Param values to the locations they are needed at. SecureData uses a simple encryption mechanism based on the NACL Box API (as implemented by libsodium, golang.org/x/crypto/nacl/box, and many others).
All fields in this struct will be marshalled into JSON as base64 encoded strings.
swagger:model
func (*SecureData) IsExternallyStored ¶ added in v4.8.0
func (s *SecureData) IsExternallyStored() bool
IsExternallyStored returns true if the SecureData object contains a reference to an external source.
func (*SecureData) Marshal ¶
func (s *SecureData) Marshal(peerPublicKey []byte, data interface{}) error
Marshal marshals the passed-in data into JSON and calls Seal() with peerPublicKey and the marshalled data.
func (*SecureData) Open ¶
func (s *SecureData) Open(targetPrivateKey *[32]byte) ([]byte, error)
Open opens a sealed SecureData item. It takes the private key that matches the peerPublicKey passed to the Seal() operation. If the SecureData object has not been corrupted or tampered with, Open() will return the decrypted data , otherwise it will return an error.
Open performs the following operations internally:
- Validate that the lengths of all the fields of the SecureData struct are within expected ranges. This is not required for correctness, but it alows us to return nicer errors.
- Extract the stored ephemeral public key and nonce from the SecureData object.
- Decrypt Payload using the extracted nonce, the extracted public key, and the passed-in private key.
- If any errors were returned in the decrypt process, return a Corrupt error, otherwise return the decrypted data.
func (*SecureData) Seal ¶
func (s *SecureData) Seal(peerPublicKey *[32]byte, data []byte) error
Seal takes curve25519 public key advertised by where the payload should be stored, and fills in the SecureData with the data required for the Open operation to succeed.
Seal performs the following operations internally:
- Generate ephemeral cuve25519 public and private keys from the system's cryptographically secure random number generator.
- Generate a 24 byte nonce from the same random number generator used to create the keys.
- Encrypt the data using the peer public key, the ephemeral private key, and the generated nonce.
- Populate s.Key with the ephemeral public key, s.Nonce with the generated nonce, and s.Payload with the encrypted data.
func (*SecureData) Unmarshal ¶
func (s *SecureData) Unmarshal(targetPrivateKey []byte, res interface{}) error
func (*SecureData) Validate ¶
func (s *SecureData) Validate() error
Validate makes sure that the lengths we expect for the Key and Nonce are correct.
type Stage ¶
type Stage struct { Validation Access Meta Owned Bundled Partialed // The name of the stage. // // required: true Name string `index:",key"` // A description of this stage. This should tell what it is for, // any special considerations that should be taken into account when // using it, etc. Description string // Documentation of this stage. This should tell what // the stage is for, any special considerations that // should be taken into account when using it, etc. in rich structured text (rst). Documentation string // The templates that should be expanded into files for the stage. // // required: true Templates []TemplateInfo // The list of extra required parameters for this // stage. They should be present as Machine.Params when // the stage is applied to the machine. // // required: true RequiredParams []string // The list of extra optional parameters for this // stage. They can be present as Machine.Params when // the stage is applied to the machine. These are more // other consumers of the stage to know what parameters // could additionally be applied to the stage by the // renderer based upon the Machine.Params // OptionalParams []string // OutputParams are that parameters that are possibly set by the Task OutputParams []string `json:"OutputParams,omitempty"` // Params contains parameters for the stage. // This allows the machine to access these values while in this stage. Params map[string]interface{} // The BootEnv the machine should be in to run this stage. // If the machine is not in this bootenv, the bootenv of the // machine will be changed. // // required: true BootEnv string // The list of initial machine tasks that the stage should run Tasks []string // The list of profiles a machine should use while in this stage. // These are used after machine profiles, but before global. Profiles []string // Flag to indicate if a node should be PXE booted on this // transition into this Stage. The nextbootpxe and reboot // machine actions will be called if present and Reboot is true Reboot bool // This flag is deprecated and will always be TRUE. RunnerWait bool }
Stage encapsulates a set of tasks and profiles to apply to a Machine in a BootEnv.
swagger:model
func (*Stage) CanHaveActions ¶
CanHaveActions returns if the object can have actions from plugins
func (*Stage) GetBootEnv ¶
GetBootEnv gets the name of the bootenv on this stage
func (*Stage) GetDescription ¶
GetDescription returns the object's Description
func (*Stage) GetDocumentation ¶
GetDocumentaiton returns the object's Documentation
func (*Stage) GetProfiles ¶
GetProfiles gets the profiles on this stage
func (*Stage) SetBootEnv ¶
SetBootEnv sets the bootenv on the stage
func (*Stage) SetProfiles ¶
SetProfiles sets the profiles on this stage
func (*Stage) SliceOf ¶
func (s *Stage) SliceOf() interface{}
SliceOf returns an empty slice of this type of objects
type Stat ¶
type Stat struct { // required: true Name string `json:"name"` // required: true Count int `json:"count"` }
Stat contains a basic statistic about dr-provision
swagger:model
type Subnet ¶
type Subnet struct { Validation Access Meta Owned Bundled // Name is the name of the subnet. // Subnet names must be unique // // required: true Name string `index:",key"` // A description of this Subnet. This should tell what it is for, // any special considerations that should be taken into account when // using it, etc. Description string // Documentation of this subnet. This should tell what // the subnet is for, any special considerations that // should be taken into account when using it, etc. in rich structured text (rst). Documentation string // Enabled indicates if the subnet should hand out leases or continue operating // leases if already running. // // required: true Enabled bool // Proxy indicates if the subnet should act as a proxy DHCP server. // If true, the subnet will not manage ip addresses but will send // offers to requests. It is an error for Proxy and Unmanaged to be // true. // // required: true Proxy bool // Unmanaged indicates that dr-provision will never send // boot-related options to machines that get leases from this // subnet. If false, dr-provision will send whatever boot-related // options it would normally send. It is an error for Unmanaged and // Proxy to both be true. // // required: true Unmanaged bool // Subnet is the network address in CIDR form that all leases // acquired in its range will use for options, lease times, and NextServer settings // by default // // required: true // pattern: ^([0-9]+\.){3}[0-9]+/[0-9]+$ Subnet string // NextServer is the address of the next server in the DHCP/TFTP/PXE // chain. You should only set this if you want to transfer control // to a different DHCP or TFTP server. // // required: true // swagger:strfmt ipv4 NextServer net.IP // ActiveStart is the first non-reserved IP address we will hand // non-reserved leases from. // // required: true // swagger:strfmt ipv4 ActiveStart net.IP // ActiveEnd is the last non-reserved IP address we will hand // non-reserved leases from. // // required: true // swagger:strfmt ipv4 ActiveEnd net.IP // ActiveLeaseTime is the default lease duration in seconds // we will hand out to leases that do not have a reservation. // // required: true ActiveLeaseTime int32 // ReservedLeasTime is the default lease time we will hand out // to leases created from a reservation in our subnet. // // required: true ReservedLeaseTime int32 // OnlyReservations indicates that we will only allow leases for which // there is a preexisting reservation. // // required: true OnlyReservations bool Options []DhcpOption // Strategy is the leasing strategy that will be used determine what to use from // the DHCP packet to handle lease management. // // required: true Strategy string // Pickers is list of methods that will allocate IP addresses. // Each string must refer to a valid address picking strategy. The current ones are: // // "none", which will refuse to hand out an address and refuse // to try any remaining strategies. // // "hint", which will try to reuse the address that the DHCP // packet is requesting, if it has one. If the request does // not have a requested address, "hint" will fall through to // the next strategy. Otherwise, it will refuse to try any // remaining strategies whether or not it can satisfy the // request. This should force the client to fall back to // DHCPDISCOVER with no requsted IP address. "hint" will reuse // expired leases and unexpired leases that match on the // requested address, strategy, and token. // // "nextFree", which will try to create a Lease with the next // free address in the subnet active range. It will fall // through to the next strategy if it cannot find a free IP. // "nextFree" only considers addresses that do not have a // lease, whether or not the lease is expired. // // "mostExpired" will try to recycle the most expired lease in the subnet's active range. // // All of the address allocation strategies do not consider // any addresses that are reserved, as lease creation will be // handled by the reservation instead. // // We will consider adding more address allocation strategies in the future. // // required: true Pickers []string // AllocateStart is the first IP address we will hand out on allocation calls // 0.0.0.0/unset means first address in CIDR // // swagger:strfmt ipv4 AllocateStart net.IP `json:"AllocateStart,omitempty"` // AllocateEnd is the last IP address we will hand out on allocation calls // 0.0.0.0/unset means last address in CIDR // // swagger:strfmt ipv4 AllocateEnd net.IP `json:"AllocateEnd,omitempty"` // Params are any additional parameters that may be needed to expand templates // for BootEnv, as documented by that boot environment's // RequiredParams and OptionalParams. Params map[string]interface{} // Profiles that should be considered for parameters Profiles []string // PrefixParameter a string that should be the beginning of a set of option-based parameters PrefixParameter string `json:",omitempty"` // SkipDAD will cause the DHCP server to skip duplicate address detection via ping testing // when in discovery phase. Only set this if you know nothing in this subnet will ever // have address conflicts with any other system. SkipDAD bool }
Subnet represents a DHCP Subnet.
swagger:model
func (*Subnet) CanHaveActions ¶
func (*Subnet) GetDescription ¶
GetDescription returns the object's Description
func (*Subnet) GetDocumentation ¶
GetDocumentaiton returns the object's Documentation
func (*Subnet) GetParams ¶ added in v4.13.0
Match Paramer interface GetParams returns the current parameters for this profile matches Paramer interface
func (*Subnet) GetProfiles ¶ added in v4.13.0
match Profiler interface GetProfiles returns the profiles on this profile
func (*Subnet) SetParams ¶ added in v4.13.0
SetParams sets the current parameters for this profile matches Paramer interface
func (*Subnet) SetProfiles ¶ added in v4.13.0
SetProfiles sets the profiles on this profile
type Task ¶
type Task struct { Validation Access Meta Owned Bundled // Name is the name of this Task. Task names must be globally unique // // required: true Name string `index:",key"` // Description is a one-line description of this Task. Description string // Documentation should describe in detail what this task should do on a machine. Documentation string // Templates lists the templates that need to be rendered for the Task. // // required: true Templates []TemplateInfo // RequiredParams is the list of parameters that are required to be present on // Machine.Params or in a profile attached to the machine. // // required: true RequiredParams []string // OptionalParams are extra optional parameters that a template rendered for // the Task may use. // // required: true OptionalParams []string // OutputParams are that parameters that are possibly set by the Task OutputParams []string `json:"OutputParams,omitempty"` // Prerequisites are tasks that must have been run in the current // BootEnv before this task can be run. Prerequisites []string // ExtraRoles is a list of Roles whose Claims should be added to the default // set of allowable Claims when a Job based on this task is running. ExtraRoles []string `json:"ExtraRoles,omitempty"` // ExtraClaims is a raw list of Claims that should be added to the default // set of allowable Claims when a Job based on this task is running. // Any extra claims added here will be added _after_ any added by ExtraRoles ExtraClaims []*Claim `json:"ExtraClaims,omitempty"` // ExtraDuration defines the number of seconds the generated token should be allowed. // 0 implies 720 hours. // -1 implies "infinite" - well 3 years // positvie implies number of seconds ExtraDuration int `json:"ExtraDuration,omitempty"` }
Task is a thing that can run on a Machine.
swagger:model
func (*Task) CanHaveActions ¶
func (*Task) GetDescription ¶
GetDescription returns the object's Description
func (*Task) GetDocumentation ¶
GetDocumentaiton returns the object's Documentation
type TaskDebug ¶ added in v4.8.0
type TaskDebug struct { SingleStep bool StopAt []string Skip []string Retry map[string]int ErrorHandlers map[string][]string }
func (*TaskDebug) ShouldSkip ¶ added in v4.8.0
func (*TaskDebug) ShouldStopAt ¶ added in v4.8.0
type TaskRunner ¶
TaskRunner interface defines if the object can run tasks
type TaskStack ¶
type TaskStack struct { CurrentTask int TaskList []string // swagger:strfmt uuid CurrentJob uuid.UUID }
TaskStack contains a stack of tasks. This is used by job error handling code.
type TaskState ¶ added in v4.8.0
type TaskState struct { // Runnable indicates that this is Runnable. Runnable bool // The UUID of the job that is currently running. // // swagger:strfmt uuid CurrentJob uuid.UUID // Contexts contains the name of the current execution context. // An empty string indicates that an agent running on a Machine should be executing tasks, // and any other value means that an agent running with its context set for this value should // be executing tasks. Context string // The stage that this is currently in. Stage string // The current tasks that are being processed. Tasks []string // The index into the Tasks list for the task that is currently // running (if a task is running) or the next task that will run (if // no task is currently running). If -1, then the first task will // run next, and if it is equal to the length of the Tasks list then // all the tasks have finished running. // // required: true CurrentTask int // This tracks the number of retry attempts for the current task. // When a task succeeds, the retry value is reset. RetryTaskAttempt int // This list of previous task lists and current tasks to handle errors. // Upon completing the list, the previous task list will be executed. // // This will be capped to a depth of 1. Error failures can not be handled. TaskErrorStacks []*TaskStack // The state the current job is in. Must be one of "created", "failed", "finished", "incomplete" JobState string // The final disposition of the current job. // Can be one of "reboot","poweroff","stop", or "complete" // Other substates may be added as time goes on JobExitState string // ResultErrors is a list of error from the task. This is filled in by the // task if it is written to do so. This tracks results without requiring // job logs. JobResultErrors []string }
func (*TaskState) CreateJobFrom ¶ added in v4.8.0
func (*TaskState) HandleFailure ¶ added in v4.8.0
func (*TaskState) Validate ¶ added in v4.8.0
func (r *TaskState) Validate(n ErrorAdder)
type Template ¶
type Template struct { Validation Access Meta Owned Bundled // ID is a unique identifier for this template. It cannot change once it is set. // // required: true ID string `index:",key"` // A description of this template Description string // Contents is the raw template. It must be a valid template // according to text/template. // // required: true Contents string // StartDelimiter is an optional start delimiter. // // required: false StartDelimiter string `json:",omitempty"` // EndDelimiter is an optional end delimiter. // // required: false EndDelimiter string `json:",omitempty"` }
Template represents a template that will be associated with a boot environment.
swagger:model
func (*Template) CanHaveActions ¶
func (*Template) GetDescription ¶
GetDescription returns the object's Description
type TemplateInfo ¶
type TemplateInfo struct { // Name of the template // // required: true Name string // A text/template that specifies how to create // the final path the template should be // written to. // // required: true Path string // Link optionally references another file to put at // the path location. Link string // ID of the template that should be expanded. Either // this or Contents should be set // // required: false ID string // Contents that should be used when this template needs // to be expanded. Either this or ID should be set. // // required: false Contents string // Meta for the TemplateInfo. This can be used by the job running // system and the bootenvs to handle OS, arch, and firmware differences. // // required: false Meta map[string]string PathTmpl *template.Template `json:"-"` LinkTmpl *template.Template `json:"-"` // StartDelimiter is an optional start delimiter. // // required: false StartDelimiter string `json:",omitempty"` // EndDelimiter is an optional end delimiter. // // required: false EndDelimiter string `json:",omitempty"` }
TemplateInfo holds information on the templates in the boot environment that will be expanded into files.
swagger:model
func (*TemplateInfo) Id ¶
func (ti *TemplateInfo) Id() string
func (*TemplateInfo) LinkTemplate ¶
func (ti *TemplateInfo) LinkTemplate() *template.Template
func (*TemplateInfo) PathTemplate ¶
func (ti *TemplateInfo) PathTemplate() *template.Template
func (*TemplateInfo) SanityCheck ¶
func (ti *TemplateInfo) SanityCheck(idx int, e ErrorAdder, missingPathOK bool)
type Tenant ¶
type Tenant struct { Validation Access Meta Owned Bundled Name string `index:",key"` Description string // Documentation of this tenant. This should tell what // the tenant is for, any special considerations that // should be taken into account when using it, etc. in rich structured text (rst). Documentation string Members map[string][]string Users []string }
swagger:model
func (*Tenant) GetDescription ¶
GetDescription returns the object's Description
func (*Tenant) GetDocumentation ¶
GetDocumentaiton returns the object's Documentation
type Trigger ¶ added in v4.9.0
type Trigger struct { Validation Access Meta Owned Bundled // Name is the key of this particular Trigger. // required: true Name string `index:",key"` // TriggerProvider is the name of the method of this trigger TriggerProvider string // Filter is a "list"-style filter string to find machines to apply the cron too // Filter is already assumed to have WorkOrderMode == true && Runnable == true Filter string // Blueprint is template to apply Blueprint string // Description is a one-line description of the parameter. Description string // Documentation details what the parameter does, what values it can // take, what it is used for, etc. Documentation string // WorkOrderProfiles to apply to this machine in order when looking // for a parameter during rendering. WorkOrderProfiles []string // WorkOrderParams that have been directly set on the Trigger and will be moved to the work order. WorkOrderParams map[string]interface{} // Enabled is this Trigger enabled Enabled bool // Params parameters to tweak the TriggerProvider Params map[string]interface{} // Profiles to tweak the TriggerProvider Profiles []string // StoreDataInParameter if set tells the triggers data to be stored in the parameter in the Params of the work_order. StoreDataInParameter string // MergeDataIntoParams if true causes the data from the trigger to be merged into the Params of the work_order. MergeDataIntoParams bool // QueueMode if true causes work_orders to be created without a machine, but with a filter for delayed operation QueueMode bool // AllInFilter if true cause a work_order created for all machines in the filter AllInFilter bool // FilterCount defines the number of machines to apply the work_order to. Only one work_order per trigger fire. FilterCount int }
Trigger defines a server-side work_order to apply Blueprints to matching Machines. Machines are collected by the Filter clause.
swagger:model
func (*Trigger) CanHaveActions ¶ added in v4.9.0
func (*Trigger) GetDescription ¶ added in v4.9.0
GetDescription returns the object's Description
func (*Trigger) GetDocumentation ¶ added in v4.9.0
GetDocumentation returns the object's Documentation
func (*Trigger) GetProfiles ¶ added in v4.9.0
GetProfiles gets the profiles on this stage
func (*Trigger) SetProfiles ¶ added in v4.9.0
SetProfiles sets the profiles on this stage
type TriggerInput ¶ added in v4.9.0
type TriggerInput struct { Method string Header map[string][]string Url *url.URL Data []byte Triggers []*Trigger }
TriggerInput defines the input data for a plugin action that is a trigger
type TriggerProvider ¶ added in v4.9.0
type TriggerProvider struct { Validation Access Meta Owned Bundled // Name is the key of this particular TriggerProvider. // required: true Name string `index:",key"` // Description is a one-line description of the parameter. Description string // Documentation details what the parameter does, what values it can // take, what it is used for, etc. Documentation string // Profiles to apply to this machine in order when looking // for a parameter during rendering. Profiles []string // Params that have been directly set on the TriggerProvider. Params map[string]interface{} // Method defines the method used on that URL Method string // RequiredParameters define the values that must be in Params on the Trigger RequiredParameters []string // OptionalParameters define the optional values that can be in Params on the Trigger OptionalParameters []string // NoURL indicates that a URL should NOT be created NoURL bool }
TriggerProvider defines a type of trigger and its required and optional parameters. This is usually provided by plugins, but system versions exist.
swagger:model
func (*TriggerProvider) AuthKey ¶ added in v4.9.0
func (r *TriggerProvider) AuthKey() string
func (*TriggerProvider) CanHaveActions ¶ added in v4.9.0
func (r *TriggerProvider) CanHaveActions() bool
func (*TriggerProvider) Fill ¶ added in v4.9.0
func (r *TriggerProvider) Fill()
func (*TriggerProvider) GetDescription ¶ added in v4.9.0
func (r *TriggerProvider) GetDescription() string
GetDescription returns the object's Description
func (*TriggerProvider) GetDocumentation ¶ added in v4.9.0
func (r *TriggerProvider) GetDocumentation() string
GetDocumentaiton returns the object's Documentation
func (*TriggerProvider) GetMeta ¶ added in v4.9.0
func (r *TriggerProvider) GetMeta() Meta
func (*TriggerProvider) GetParams ¶ added in v4.9.0
func (r *TriggerProvider) GetParams() map[string]interface{}
GetParams gets the parameters on this stage
func (*TriggerProvider) GetProfiles ¶ added in v4.9.0
func (r *TriggerProvider) GetProfiles() []string
GetProfiles gets the profiles on this stage
func (*TriggerProvider) Key ¶ added in v4.9.0
func (r *TriggerProvider) Key() string
func (*TriggerProvider) KeyName ¶ added in v4.9.0
func (r *TriggerProvider) KeyName() string
func (*TriggerProvider) Prefix ¶ added in v4.9.0
func (r *TriggerProvider) Prefix() string
func (*TriggerProvider) SetMeta ¶ added in v4.9.0
func (r *TriggerProvider) SetMeta(d Meta)
func (*TriggerProvider) SetName ¶ added in v4.9.0
func (r *TriggerProvider) SetName(n string)
SetName sets the name of the object
func (*TriggerProvider) SetParams ¶ added in v4.9.0
func (r *TriggerProvider) SetParams(p map[string]interface{})
SetParams sets the parameters on this stage
func (*TriggerProvider) SetProfiles ¶ added in v4.9.0
func (r *TriggerProvider) SetProfiles(p []string)
SetProfiles sets the profiles on this stage
func (*TriggerProvider) SliceOf ¶ added in v4.9.0
func (r *TriggerProvider) SliceOf() interface{}
func (*TriggerProvider) ToModels ¶ added in v4.9.0
func (r *TriggerProvider) ToModels(obj interface{}) []Model
func (*TriggerProvider) Validate ¶ added in v4.9.0
func (r *TriggerProvider) Validate()
type TriggerResult ¶ added in v4.9.0
type TriggerResult struct { Data []byte Code int Header map[string][]string HasCount bool Count int }
TriggerResult defines the result to send back to the trigger caller Events should be sent if the trigger fires
type User ¶
type User struct { Validation Access Meta Owned Bundled // Name is the name of the user // // required: true Name string `index:",key"` // Description of user Description string // PasswordHash is the scrypt-hashed version of the user's Password. // PasswordHash []byte `json:",omitempty" index:",ignore"` // Token secret - this is used when generating user token's to // allow for revocation by the grantor or the grantee. Changing this // will invalidate all existing tokens that have this user as a user // or a grantor. Secret string `index:",ignore"` // Roles is a list of Roles this User has. // Roles []string }
User is an API user of DigitalRebar Provision swagger:model
func (*User) CanHaveActions ¶
func (*User) ChangePassword ¶
func (*User) CheckPassword ¶
func (*User) GetDescription ¶
GetDescription returns the object's Description
type UserToken ¶
UserToken is an auth token for a specific User. The Token section can be used for bearer authentication.
swagger:model
type UxOption ¶ added in v4.11.0
type UxOption struct { Validation Access Meta Owned Bundled // Id is the name of the object Id string `index:",key"` // Documentation is an RST string defining the object Documentation string // Description is a short string description of the object Description string // Params is an unused residual of the object from previous releases Params map[string]interface{} Kind string Global bool Role bool User bool Hidden bool Default string }
UxOption defines a potential option that the UX should control. UxSetting instantiates the Option.
DEPRECATED: NOT USED.
swagger:model
func (*UxOption) CanHaveActions ¶ added in v4.11.0
CanHaveActions says that actions can be added to this object type
func (*UxOption) Fill ¶ added in v4.11.0
func (uo *UxOption) Fill()
Fill initializes and empty object
func (*UxOption) GetDescription ¶ added in v4.11.0
GetDescription returns the object's Description
func (*UxOption) GetDocumentation ¶ added in v4.11.0
GetDocumentaiton returns the object's Documentation
func (*UxOption) GetParams ¶ added in v4.13.8
GetParams returns the current parameters for this profile matches Paramer interface
func (*UxOption) SetParams ¶ added in v4.13.8
SetParams sets the current parameters for this profile matches Paramer interface
type UxSetting ¶ added in v4.11.0
type UxSetting struct { Validation Access Meta Owned Bundled // Id is the Name of the object Id string `index:",key"` // Documentation is an RST string defining the object Documentation string // Description is a short string description of the object Description string // Params is an unused residual of the object from previous releases Params map[string]interface{} // Option is the refrence to the UxOption Option string // Target is the entity that this applies to user, role, or global // user is specified as user++<user name> // role is specified as role++<role name> Target string // Value is the value of the option Value string }
UxSetting defines an instance of a UxOption.
swagger:model
func (*UxSetting) AuthKey ¶ added in v4.11.0
AuthKey returns the field of the Object to use for Auth
func (*UxSetting) CanHaveActions ¶ added in v4.11.0
CanHaveActions says that actions can be added to this object type
func (*UxSetting) Fill ¶ added in v4.11.0
func (us *UxSetting) Fill()
Fill initializes and empty object
func (*UxSetting) GetDescription ¶ added in v4.11.0
GetDescription returns the object's Description
func (*UxSetting) GetDocumentation ¶ added in v4.11.0
GetDocumentaiton returns the object's Documentation
func (*UxSetting) GetParams ¶ added in v4.13.8
GetParams returns the current parameters for this profile matches Paramer interface
func (*UxSetting) SetParams ¶ added in v4.13.8
SetParams sets the current parameters for this profile matches Paramer interface
type UxView ¶ added in v4.11.0
type UxView struct { Validation Access Meta Owned Bundled // Id is the Name of the Filter Id string `index:",key"` // Documentation is an RST string defining the object Documentation string // Description is a short string description of the object Description string // Params is an unused residual of the object from previous releases Params map[string]interface{} // ApplicableRoles defines the roles that this view shows up for. // e.g. superuser means that it will be available for users with the superuser role. ApplicableRoles []string // Airgap is not used. Moved to license. // Deprecated Airgap bool // LandingPage defines the default navigation route // None or "" will open the system page. // if it starts with http, it will navigate to the Overiew page. // Otherwise, it will go to the machine's page. LandingPage string // ShowActiviation is not used. Moved to license. // Deprecated ShowActiviation bool // BrandingImage defines a files API path that should point to an image file. // This replaces the RackN logo. BrandingImage string // Menu defines the menu elements. Menu []MenuGroup MachineFields []string BulkTabs []string // Columns defines the custom colums for a MenuItem Id Columns map[string][]string HideEditObjects []string WorkflowsRestriction []string StagesRestriction []string TasksRestriction []string ProfilesRestriction []string ParamsRestriction []string // Classifiers is deprecated Classifiers []Classifier }
UxView structure that handles RawModel instead of dealing with RawModel which is how DRP is storing it.
swagger:model
func (*UxView) CanHaveActions ¶ added in v4.11.0
CanHaveActions says that actions can be added to this object type
func (*UxView) GetDescription ¶ added in v4.11.0
GetDescription returns the object's Description
func (*UxView) GetDocumentation ¶ added in v4.11.0
GetDocumentaiton returns the object's Documentation
func (*UxView) GetParams ¶ added in v4.13.8
GetParams returns the current parameters for this profile matches Paramer interface
func (*UxView) SetParams ¶ added in v4.13.8
SetParams sets the current parameters for this profile matches Paramer interface
type ValidateSetter ¶
type Validation ¶
type Validation struct { // Validated tracks whether or not the model has been validated. // read only: true Validated bool // Available tracks whether or not the model passed validation. // read only: true Available bool // If there are any errors in the validation process, they will be // available here. // read only: true Errors []string // contains filtered or unexported fields }
Validation holds information about whether the current model is valid or not. It is designed to be embedded into structs that need post-operation validation.
swagger: model
func (*Validation) AddError ¶
func (v *Validation) AddError(err error)
func (*Validation) ChangeForced ¶
func (v *Validation) ChangeForced() bool
func (*Validation) ClearValidation ¶
func (v *Validation) ClearValidation()
func (*Validation) Error ¶
func (v *Validation) Error() string
func (*Validation) Errorf ¶
func (v *Validation) Errorf(fmtStr string, args ...interface{})
func (*Validation) ForceChange ¶
func (v *Validation) ForceChange()
func (*Validation) HasError ¶
func (v *Validation) HasError() error
func (*Validation) IsAvailable ¶
func (v *Validation) IsAvailable() bool
func (*Validation) MakeError ¶
func (v *Validation) MakeError(code int, errType string, obj Model) error
func (*Validation) RestoreValidation ¶
func (v *Validation) RestoreValidation(ov *Validation)
func (*Validation) SaveValidation ¶
func (v *Validation) SaveValidation() *Validation
func (*Validation) SetAvailable ¶
func (v *Validation) SetAvailable() bool
func (*Validation) SetInvalid ¶
func (v *Validation) SetInvalid() bool
func (*Validation) SetValid ¶
func (v *Validation) SetValid() bool
func (*Validation) Useable ¶
func (v *Validation) Useable() bool
type Validator ¶
type Validator interface { Validate() ClearValidation() Useable() bool IsAvailable() bool HasError() error }
model object may define a Validate method that can be used to return errors about if the model is valid in the current datatracker.
type VersionSet ¶
type VersionSet struct { Validation Access Meta Owned Bundled Id string `index:",key"` Documentation string Description string Apply bool DRPVersion string DRPUXVersion string Components []*Element Plugins []*Plugin Prefs map[string]string Files []*FileData Global map[string]interface{} }
VersionSet structure that handles RawModel instead of dealing with RawModel which is how DRP is storing it.
An element with Version = ignore means leave it loaded.
func (*VersionSet) AuthKey ¶
func (vs *VersionSet) AuthKey() string
func (*VersionSet) CanHaveActions ¶
func (vs *VersionSet) CanHaveActions() bool
func (*VersionSet) Fill ¶
func (vs *VersionSet) Fill()
func (*VersionSet) GetDescription ¶
func (vs *VersionSet) GetDescription() string
GetDescription returns the object's Description
func (*VersionSet) GetDocumentation ¶
func (vs *VersionSet) GetDocumentation() string
GetDocumentaiton returns the object's Documentation
func (*VersionSet) Key ¶
func (vs *VersionSet) Key() string
func (*VersionSet) KeyName ¶
func (vs *VersionSet) KeyName() string
func (*VersionSet) Merge ¶
func (vs *VersionSet) Merge(nvs *VersionSet)
func (*VersionSet) Prefix ¶
func (vs *VersionSet) Prefix() string
func (*VersionSet) SetName ¶
func (vs *VersionSet) SetName(name string)
SetName sets the name. In this case, it sets Id.
func (*VersionSet) SliceOf ¶
func (vs *VersionSet) SliceOf() interface{}
func (*VersionSet) ToModels ¶
func (vs *VersionSet) ToModels(obj interface{}) []Model
type Whoami ¶
type Whoami struct { Result WhoamiResult Fingerprint MachineFingerprint MacAddrs []string OnDiskUUID string }
Whoami contains the elements used toi fingerprint a machine, along with the results of the fingerprint comparison request
func (*Whoami) Fill ¶
Fill fills out the MacAddrs list and the MachineFingerprint from the DMI information on the machine.
func (*Whoami) FromMachine ¶
FromMachine extracts the Fingerprint and HardwareAddrs fields from a Machine and populates Whoami with it.
func (*Whoami) Score ¶
Score calculates how closely the passed in Whoami matches a candidate Machine. In the current implementation, Score awards points based on the following criteria:
* 25 points if the Machine has an SSNHash that matches the one in the Whoami
* 25 points if the Machine has a CSNHash that matches the one in the Whoami
* 50 points if the Machine has a SystemUUID that matches the one in the Whoami
* 500 points if CloudInstanceID matches, but this must be unique.
* 0 to 100 points varying depending on how many memory DIMMs from the machine fingerprint are present in Whoami.
* 0 to 100 points varying depending on how many HardwareAddrs from the Machine are present in Whoami.
* 1000 points if the machine UUID matches OnDiskUUID
If the score is less than 100 at the end of the scoring process, it is rounded down to zero. The intent is to be resilient in the face of hardware changes:
* SSNHash, CSNHash, and SystemUUID come from the motherboard.
* MemoryIds are generated deterministically from the DIMMs installed in the system
* MacAddrs comes from the physical Ethernet devices in the system.
type WhoamiResult ¶
type WorkOrder ¶ added in v4.8.0
type WorkOrder struct { Validation Access Meta Owned Bundled TaskState // Uuid is the key of this particular WorkOrder. // required: true // swagger:strfmt uuid Uuid uuid.UUID `index:",key"` // Blueprint defines the tasks and base parameters for this action // required: true Blueprint string // State The state the async action is in. Must be one of "created", "running", "failed", "finished", "cancelled" // required: true State string // Status is a short text snippet for humans explaining the current state. Status string // CreateTime is the time the work order was created. This is // distinct from StartTime, as there may be a significant delay before // the workorder starts running. CreateTime time.Time // StartTime The time the async action started running. StartTime time.Time // EndTime The time the async action failed or finished or cancelled. EndTime time.Time // Machine is the key of the machine running the WorkOrder // swagger:strfmt uuid Machine uuid.UUID `index:",shard"` // Archived indicates whether the complete log for the async action can be // retrieved via the API. If Archived is true, then the log cannot // be retrieved. // // required: true Archived bool // Profiles An array of profiles to apply to this machine in order when looking // for a parameter during rendering. Profiles []string // Params that have been directly set on the Machine. Params map[string]interface{} // Filter is a list filter for this WorkOrder Filter string }
WorkOrder is custom workflow-like element that defines parameters and an Blueprint that acts as a basis for expanding into tasks. Think of it like a Workflow with the following differences:
- Workorders are oneshot -- once they fail, finish, or are cancelled they cannot be restarted.
* Workorders are machine specific and do not have a unique Name.
* Workorders do not execute in any defined order.
- Workorders are not allowed to cause the agent to exit by any means. Any non-success exit from a job created from a workflow just means that the workorder has failed. This will eventually be enforced on the client side.
- BootEnv changes to a Machine that is running WorkOrders are not allowed. Any API calls to do so will fail, and any attempts to run a WorkOrder that includes a BootEnv change will fail.
- WorkOrders are late-bound -- the Tasks list changes they make to a machine are not fully calculated until the WorkOrder transitions to Running.
swagger:model
func (*WorkOrder) AddTasks ¶ added in v4.8.0
AddTasks is a helper for adding tasks to the machine Tasks list in the mutable present.
func (*WorkOrder) CanHaveActions ¶ added in v4.8.0
func (*WorkOrder) DelTasks ¶ added in v4.8.0
DelTasks allows you to delete tasks in the mutable present.
func (*WorkOrder) GetBootEnv ¶ added in v4.8.0
GetBootEnv gets the state
func (*WorkOrder) GetContext ¶ added in v4.8.0
GetContext gets the name
func (*WorkOrder) GetCurrentJob ¶ added in v4.8.0
GetCurrentJob gets the name
func (*WorkOrder) GetProfiles ¶ added in v4.8.0
GetProfiles gets the profiles on this stage
func (*WorkOrder) GetRunnable ¶ added in v4.8.0
GetRunnable sets runnable
func (*WorkOrder) GetWorkOrderMode ¶ added in v4.8.0
GetWorkOrderMode gets fake workorder state
func (*WorkOrder) GetWorkflow ¶ added in v4.8.0
GetWorkflow gets the name
func (*WorkOrder) RunningTask ¶ added in v4.8.0
func (*WorkOrder) SetProfiles ¶ added in v4.8.0
SetProfiles sets the profiles on this stage
func (*WorkOrder) SetRunnable ¶ added in v4.8.0
SetRunnable sets runnable
func (*WorkOrder) SplitTasks ¶ added in v4.8.0
SplitTasks slits the machine's Tasks list into 3 subsets:
1. the immutable past, which cannot be changed by task list modification
2. The mutable present, which contains tasks that can be deleted, and where tasks can be added.
3. The immutable future, which also cannot be changed.
type WorkOrderModer ¶ added in v4.8.0
type WorkOrderModer interface { TaskRunner GetWorkOrderMode() bool SetWorkOrderMode(bool) }
WorkOrderModer interface defines if an object has a work order mode.
type Workflow ¶
type Workflow struct { Validation Access Meta Owned Bundled Name string `index:",key"` Description string Documentation string Stages []string }
Workflow contains a list of Stages. When it is applied to a Machine, that machine's Tasks list is populated with the contents of the Stages in the Workflow.
swagger:model
func (*Workflow) CanHaveActions ¶
func (*Workflow) GetDescription ¶
GetDescription returns the object's Description
func (*Workflow) GetDocumentation ¶
GetDocumentaiton returns the object's Documentation
type Zone ¶ added in v4.13.0
type Zone struct { Validation Access Meta Owned Bundled // Name is the name of the zone. Name string `index:",key"` // Description describes the zone Description string // Documentation describes the zone Documentation string // Origin is the base name of the zone (e.g. rackn.test.) Origin string // Base zone for this zone // Filters is a list of source IP filters for this zone Filters []*ZoneFilter // Matchers // Priority is the numeric priority from low to high when evalulating requests Priority int // Lower first // Forwarders are the request forwarders when a fallthrough happens in this zone Forwarders []string // Forwarders for this zone. // Continue indicates if this should be the stopping point Continue bool // Should the next zone be processed. // TTL of the record - if 0 => uses 3600 as default TTL uint32 // Records contains the data to return Records []*ZoneRecord }
Zone contains a list of records for DNS.
swagger:model
func (*Zone) AddRecordFromRR ¶ added in v4.13.0
AddRecordFromRR converts an RR into a ZoneRecord on the Zone
func (*Zone) AuthKey ¶ added in v4.13.0
AuthKey returns the object's field that handles auth limitation
func (*Zone) CanHaveActions ¶ added in v4.13.0
CanHaveActions indicates that the object can have actions
func (*Zone) GetDescription ¶ added in v4.13.0
GetDescription returns the object's Description
func (*Zone) GetDocumentation ¶ added in v4.13.0
GetDocumentaiton returns the object's Documentation
func (*Zone) SliceOf ¶ added in v4.13.0
func (z *Zone) SliceOf() interface{}
SliceOf creates an empty slice of Zones
type ZoneFilter ¶ added in v4.13.0
type ZoneFilter struct { // Type is the type for filter: pktsrc, ... Type ZoneFilterType // Filter string dependent upon Type Filter string }
ZoneFilter contains a filter for the DNS packet to apply to the zone.
swagger:model
type ZoneFilterType ¶ added in v4.13.0
type ZoneFilterType string
ZoneFilterType is the type of filter
func (ZoneFilterType) IsValid ¶ added in v4.13.0
func (zfn ZoneFilterType) IsValid() bool
IsValid indicates if the ZoneFilterType is valid
type ZoneName ¶ added in v4.13.0
type ZoneName string
ZoneName is a key in the DNS namespace Use the dns.TypeToString map for valid values
type ZoneRecord ¶ added in v4.13.0
type ZoneRecord struct { // Type of record - SOA, NS, MX, CNAME, A, PTR, AAAA Type ZoneType // Name of record - This can contain template pieces Name ZoneName // TTL of the record - 0 means use the zone ttl TTL uint32 // Value of record - This can contain template pieces. Value []string }
ZoneRecord contains an individual record for a DNS zone
swagger:model
func (*ZoneRecord) Validate ¶ added in v4.13.0
func (zr *ZoneRecord) Validate() []error
Validate ensures the record is valid
type ZoneType ¶ added in v4.13.0
type ZoneType string
ZoneType is a type of record
func ParseZoneType ¶ added in v4.13.0
Source Files ¶
- aaplbsdp.go
- access.go
- activity.go
- alert.go
- batch.go
- blueprint.go
- bootenv.go
- bundle.go
- catalogItem.go
- catalog_builder.go
- cluster.go
- connection.go
- content.go
- context.go
- dhcpOption.go
- endpoint.go
- errors.go
- event.go
- filter.go
- ha-state.go
- identity_provider.go
- index.go
- info.go
- interface.go
- job.go
- jobLogArchive.go
- lab.go
- lease.go
- license.go
- machine.go
- meta.go
- modtimesha.go
- owner.go
- param.go
- partial.go
- plugin.go
- plugin_provider.go
- pool.go
- preference.go
- profile.go
- raw_model.go
- reservation.go
- resource_broker.go
- role.go
- secureData.go
- stage.go
- subnet.go
- task.go
- taskState.go
- template.go
- templateInfo.go
- tenant.go
- token.go
- trigger.go
- trigger_provider.go
- user.go
- utils.go
- ux_option.go
- ux_setting.go
- ux_view.go
- validate.go
- version_set.go
- whoami.go
- work_order.go
- workflow.go
- zone.go