provision: github.com/digitalrebar/provision/models Index | Files

package models

import "github.com/digitalrebar/provision/models"

Index

Package Files

aaplbsdp.go access.go bootenv.go content.go dhcpOption.go errors.go event.go index.go info.go interface.go job.go lease.go license.go machine.go meta.go param.go plugin.go plugin_provider.go preference.go profile.go reservation.go role.go secureData.go stage.go subnet.go task.go template.go templateInfo.go tenant.go token.go user.go utils.go validate.go workflow.go

Constants

const (
    BsdpOS9       = 0
    BsdpOSX       = 1
    BsdpOSXServer = 2
    BsdpDiags     = 3
)

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")
)

func AllPrefixes Uses

func AllPrefixes() []string

func ArchEqual Uses

func ArchEqual(a, b string) bool

func DHCPOptionParser Uses

func DHCPOptionParser(code dhcp.OptionCode) (func(string) ([]byte, error), func([]byte) string)

func DecodeYaml Uses

func DecodeYaml(buf []byte, ref interface{}) error

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 Uses

func DrpSafeFuncMap() template.FuncMap

func FibBackoff Uses

func FibBackoff(thunk func() error)

func GenPatch Uses

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 Hexaddr Uses

func Hexaddr(addr net.IP) string

func MergeTemplates Uses

func MergeTemplates(root *template.Template, tmpls []TemplateInfo, e ErrorAdder) *template.Template

func Remarshal Uses

func Remarshal(src, dest interface{}) error

Remarshal remarshals src onto dest.

func SupportedArch Uses

func SupportedArch(s string) (string, bool)

func ValidMachineName Uses

func ValidMachineName(msg, s string) error

func ValidName Uses

func ValidName(msg, s string) error

func ValidParamName Uses

func ValidParamName(msg, s string) error

func ValidateIP4 Uses

func ValidateIP4(e ErrorAdder, a net.IP)

func ValidateMac Uses

func ValidateMac(e ErrorAdder, mac string)

func ValidateMaybeZeroIP4 Uses

func ValidateMaybeZeroIP4(e ErrorAdder, a net.IP)

type Access Uses

type Access struct {
    // ReadOnly tracks if the store for this object is read-only
    // read only: true
    ReadOnly bool
}

Access holds if the object is read-only or not

swagger: model

func (*Access) IsReadOnly Uses

func (a *Access) IsReadOnly() bool

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.)

type Accessor Uses

type Accessor interface {
    IsReadOnly() bool
}

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 Uses

type Action struct {
    Model   interface{}
    Plugin  string
    Command string
    Params  map[string]interface{}
}

Params is built from the caller, plus the machine, plus profiles, plus global.

This is used by the frontend to talk to the plugin.

func (*Action) Fill Uses

func (m *Action) Fill()

type Actor Uses

type Actor interface {
    Model
    CanHaveActions() bool
}

Only implement this if you want actions

type ArchInfo Uses

type ArchInfo struct {
    // IsoFile is the name of the ISO file (or other archive)
    // that contains all the necessacery 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.
    //
    // 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 aubnet
    // 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-provison is
    // the DHCP server of record.
    Loader string
}

func (*ArchInfo) Fill Uses

func (a *ArchInfo) Fill()

type AvailableAction Uses

type AvailableAction struct {
    Provider       string
    Model          string
    Command        string
    RequiredParams []string
    OptionalParams []string
}

Plugins can provide actions for machines Assumes that there are parameters on the call in addition to the machine.

swagger:model

func (*AvailableAction) Fill Uses

func (a *AvailableAction) Fill()

type BlobInfo Uses

type BlobInfo struct {
    Path string
    Size int64
}

swagger:model

type BootEnv Uses

type BootEnv struct {
    Validation
    Access
    Meta
    // The name of the boot environment.  Boot environments that install
    // an operating system must end in '-install'.
    //
    // required: true
    Name string
    // A 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 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. in rich structured text (rst).
    Documentation string
    // The OS specific information for the boot environment.
    OS  OsInfo
    // The templates that should be expanded into files for the
    // boot environment.
    //
    // 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.
    //
    // 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.
    //
    // required: true
    BootParams string
    // The list of extra required parameters for this
    // bootstate. 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
    // bootstate. 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.
    //
    // required: true
    OnlyUnknown bool
}

BootEnv encapsulates the machine-agnostic information needed by the provisioner to set up a boot environment.

swagger:model

func (*BootEnv) AuthKey Uses

func (b *BootEnv) AuthKey() string

func (*BootEnv) BootParamsFor Uses

func (b *BootEnv) BootParamsFor(arch string) string

func (*BootEnv) CanHaveActions Uses

func (b *BootEnv) CanHaveActions() bool

func (*BootEnv) Fill Uses

func (b *BootEnv) Fill()

func (*BootEnv) GetDocumentation Uses

func (b *BootEnv) GetDocumentation() string

func (*BootEnv) GetMeta Uses

func (b *BootEnv) GetMeta() Meta

func (*BootEnv) InitrdsFor Uses

func (b *BootEnv) InitrdsFor(arch string) []string

func (*BootEnv) IsoFor Uses

func (b *BootEnv) IsoFor(arch string) string

func (*BootEnv) IsoUrlFor Uses

func (b *BootEnv) IsoUrlFor(arch string) string

func (*BootEnv) KernelFor Uses

func (b *BootEnv) KernelFor(arch string) string

func (*BootEnv) Key Uses

func (b *BootEnv) Key() string

func (*BootEnv) KeyName Uses

func (b *BootEnv) KeyName() string

func (*BootEnv) NetBoot Uses

func (b *BootEnv) NetBoot() bool

func (*BootEnv) Prefix Uses

func (b *BootEnv) Prefix() string

func (*BootEnv) SetMeta Uses

func (b *BootEnv) SetMeta(d Meta)

func (*BootEnv) SetName Uses

func (b *BootEnv) SetName(n string)

func (*BootEnv) ShaFor Uses

func (b *BootEnv) ShaFor(arch string) string

func (*BootEnv) SliceOf Uses

func (b *BootEnv) SliceOf() interface{}

func (*BootEnv) ToModels Uses

func (b *BootEnv) ToModels(obj interface{}) []Model

func (*BootEnv) Validate Uses

func (b *BootEnv) Validate()

type BootEnver Uses

type BootEnver interface {
    Model
    GetBootEnv() string
    SetBootEnv(string)
}

type BsdpBootOption Uses

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

func (*BsdpBootOption) InstallType Uses

func (bo *BsdpBootOption) InstallType() string

func (*BsdpBootOption) MarshalText Uses

func (bo *BsdpBootOption) MarshalText() ([]byte, error)

func (*BsdpBootOption) OSName Uses

func (bo *BsdpBootOption) OSName() string

func (*BsdpBootOption) String Uses

func (bo *BsdpBootOption) String() string

func (*BsdpBootOption) UnmarshalText Uses

func (bo *BsdpBootOption) UnmarshalText(buf []byte) error

type ChangeForcer Uses

type ChangeForcer interface {
    ForceChange()
    ChangeForced() bool
}

type Claim Uses

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) Contains Uses

func (a *Claim) Contains(b *Claim) bool

func (*Claim) Match Uses

func (c *Claim) Match(scope, action, specific string) bool

Match tests to see if this claim allows access for the specified scope, action, and specific item.

func (*Claim) String Uses

func (c *Claim) String() string

func (*Claim) Validate Uses

func (c *Claim) Validate(e ErrorAdder)

type Claims Uses

type Claims []claim

Claims is a compiled list of claims from a Role.

func (Claims) Contains Uses

func (a Claims) Contains(b Claims) bool

type Content Uses

type Content struct {
    // required: true
    Meta ContentMetaData `json:"meta"`

    /*
    	These are the sections:
    	tasks        map[string]*models.Task
    	bootenvs     map[string]*models.BootEnv
    	stages       map[string]*models.Stage
    	templates    map[string]*models.Template
    	profiles     map[string]*models.Profile
    	params       map[string]*models.Param
    	reservations map[string]*models.Reservation
    	subnets      map[string]*models.Subnet
    	users        map[string]*models.User
    	preferences  map[string]*models.Pref
    	plugins      map[string]*models.Plugin
    	machines     map[string]*models.Machine
    	leases       map[string]*models.Lease
    */
    Sections Sections `json:"sections"`
}

Isos??? Files??

swagger:model

func (*Content) AuthKey Uses

func (c *Content) AuthKey() string

func (*Content) Fill Uses

func (c *Content) Fill()

func (*Content) FromStore Uses

func (c *Content) FromStore(src store.Store) error

func (*Content) Key Uses

func (c *Content) Key() string

func (*Content) KeyName Uses

func (c *Content) KeyName() string

func (*Content) Prefix Uses

func (c *Content) Prefix() string

func (*Content) ToStore Uses

func (c *Content) ToStore(dest store.Store) error

type ContentMetaData Uses

type ContentMetaData struct {
    // required: true
    Name        string
    Source      string
    Description string
    Version     string

    // Optional fields
    Documentation    string
    RequiredFeatures string

    // Informational Fields
    Writable     bool
    Type         string
    Overwritable bool
}

All fields must be strings

type ContentSummary Uses

type ContentSummary struct {
    Meta     ContentMetaData `json:"meta"`
    Counts   map[string]int
    Warnings []string
}

swagger:model

func (*ContentSummary) Fill Uses

func (c *ContentSummary) Fill()

func (*ContentSummary) FromStore Uses

func (c *ContentSummary) FromStore(src store.Store)

type DhcpOption Uses

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 Uses

func DHCPOptionsInOrder(p dhcp.Packet) []*DhcpOption

func (*DhcpOption) AddToPacket Uses

func (o *DhcpOption) AddToPacket(p *dhcp.Packet) error

func (*DhcpOption) ConvertOptionValueToByte Uses

func (o *DhcpOption) ConvertOptionValueToByte(value string) ([]byte, error)

func (*DhcpOption) Fill Uses

func (o *DhcpOption) Fill(s string) error

func (*DhcpOption) FillFromPacketOpt Uses

func (o *DhcpOption) FillFromPacketOpt(buf []byte)

func (DhcpOption) RenderToDHCP Uses

func (o DhcpOption) RenderToDHCP(srcOpts map[int]string) (code byte, val []byte, err error)

func (*DhcpOption) String Uses

func (o *DhcpOption) String() string

type Docer Uses

type Docer interface {
    Model
    GetDocumentation() string
}

type Error Uses

type Error struct {
    Object Model `json:"-"`
    Model  string
    Key    string
    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 we should return for any errors. swagger:model

func NewError Uses

func NewError(t string, code int, m string) *Error

func (*Error) AddError Uses

func (e *Error) AddError(src error)

func (*Error) ContainsError Uses

func (e *Error) ContainsError() bool

func (*Error) Error Uses

func (e *Error) Error() string

func (*Error) Errorf Uses

func (e *Error) Errorf(s string, args ...interface{})

func (*Error) HasError Uses

func (e *Error) HasError() error

type ErrorAdder Uses

type ErrorAdder interface {
    Errorf(string, ...interface{})
    AddError(error)
    HasError() error
}

type Event Uses

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{}
}

Event represents an action in the system. In general, the event generates for a subject of the form: type.action.key

swagger:model

func EventFor Uses

func EventFor(obj Model, action string) *Event

func (*Event) Message Uses

func (e *Event) Message() string

func (*Event) Model Uses

func (e *Event) Model() (Model, error)

func (*Event) Text Uses

func (e *Event) Text() string

type Filler Uses

type Filler interface {
    Model
    Fill()
}

type Index Uses

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 mutiple entries in the
    // index for the same key that refer to different items.
    Unique bool
}

Index holds details on the index swagger:model

type Info Uses

type Info struct {
    // required: true
    Arch string `json:"arch"`
    // required: true
    Os  string `json:"os"`
    // required: true
    Version string `json:"version"`
    // required: true
    Id  string `json:"id"`
    // required: true
    ApiPort int `json:"api_port"`
    // required: true
    FilePort int `json:"file_port"`
    // required: true
    DhcpPort int `json:"dhcp_port"`
    // required: true
    BinlPort int `json:"binl_port"`
    // required: true
    TftpPort int `json:"tftp_port"`
    // required: true
    TftpEnabled bool `json:"tftp_enabled"`
    // required: true
    DhcpEnabled bool `json:"dhcp_enabled"`
    // required: true
    BinlEnabled bool `json:"binl_enabled"`
    // required: true
    ProvisionerEnabled bool `json:"prov_enabled"`
    // required: true
    Address net.IP `json:"address"`
    // required: true
    Stats    []Stat                         `json:"stats"`
    Features []string                       `json:"features"`
    Scopes   map[string]map[string]struct{} `json:"scopes"`
    License  LicenseBundle
}

swagger:model

func (*Info) Fill Uses

func (i *Info) Fill()

type Interface Uses

type Interface struct {
    Access
    Meta
    // Name of the interface
    //
    // required: true
    Name string
    // Index of the interface
    //
    Index int
    // A List of Addresses on the interface (CIDR)
    //
    // required: true
    Addresses []string
    // The interface to use for this interface when
    // advertising or claiming access (CIDR)
    //
    ActiveAddress string
    // Possible gateway for this interface
    Gateway string
    // Possible DNS for this interface
    DnsServers []string
    // Possible DNS for domain for this interface
    DnsDomain string
}

swagger:model

func (*Interface) Fill Uses

func (i *Interface) Fill()

func (*Interface) Key Uses

func (i *Interface) Key() string

func (*Interface) KeyName Uses

func (i *Interface) KeyName() string

func (*Interface) Prefix Uses

func (i *Interface) Prefix() string

func (*Interface) SliceOf Uses

func (b *Interface) SliceOf() interface{}

func (*Interface) ToModels Uses

func (b *Interface) ToModels(obj interface{}) []Model

type Job Uses

type Job struct {
    Validation
    Access
    Meta
    // The UUID of the job.  The primary key.
    // required: true
    // swagger:strfmt uuid
    Uuid uuid.UUID
    // 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.
    // required: true
    // swagger:strfmt uuid
    Machine uuid.UUID
    // 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
    // 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 entered running.
    StartTime time.Time
    // The time the job entered failed or finished.
    EndTime time.Time
    // 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
}

swagger:model

func (*Job) AuthKey Uses

func (j *Job) AuthKey() string

func (*Job) CanHaveActions Uses

func (b *Job) CanHaveActions() bool

func (*Job) Fill Uses

func (j *Job) Fill()

func (*Job) GetMeta Uses

func (j *Job) GetMeta() Meta

func (*Job) Key Uses

func (j *Job) Key() string

func (*Job) KeyName Uses

func (j *Job) KeyName() string

func (*Job) Prefix Uses

func (j *Job) Prefix() string

func (*Job) SetMeta Uses

func (j *Job) SetMeta(d Meta)

func (*Job) SliceOf Uses

func (b *Job) SliceOf() interface{}

func (*Job) ToModels Uses

func (b *Job) ToModels(obj interface{}) []Model

func (*Job) Validate Uses

func (j *Job) Validate()

type JobAction Uses

type JobAction struct {
    // required: true
    Name string
    // required: true
    Path string
    // required: true
    Content string
    // required: true
    Meta map[string]string
}

Job Action 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. swagger:model

func (*JobAction) ValidForOS Uses

func (ja *JobAction) ValidForOS(target string) bool

type JobActions Uses

type JobActions []*JobAction

func (JobActions) FilterOS Uses

func (ja JobActions) FilterOS(forOS string) JobActions

type Lease Uses

type Lease struct {
    Validation
    Access
    Meta
    // Addr is the IP address that the lease handed out.
    //
    // required: true
    // swagger:strfmt ipv4
    Addr net.IP
    // 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
    // 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
}

swagger:model

func (*Lease) AuthKey Uses

func (l *Lease) AuthKey() string

func (*Lease) CanHaveActions Uses

func (b *Lease) CanHaveActions() bool

func (*Lease) Expire Uses

func (l *Lease) Expire()

func (*Lease) Expired Uses

func (l *Lease) Expired() bool

func (*Lease) Fake Uses

func (l *Lease) Fake() bool

func (*Lease) Fill Uses

func (l *Lease) Fill()

func (*Lease) GetMeta Uses

func (l *Lease) GetMeta() Meta

func (*Lease) Invalidate Uses

func (l *Lease) Invalidate()

func (*Lease) Key Uses

func (l *Lease) Key() string

func (*Lease) KeyName Uses

func (l *Lease) KeyName() string

func (*Lease) Prefix Uses

func (l *Lease) Prefix() string

func (*Lease) SetMeta Uses

func (l *Lease) SetMeta(d Meta)

func (*Lease) SliceOf Uses

func (b *Lease) SliceOf() interface{}

func (*Lease) String Uses

func (l *Lease) String() string

func (*Lease) ToModels Uses

func (b *Lease) ToModels(obj interface{}) []Model

type License Uses

type License struct {
    Name            string
    Version         string
    Data            interface{}
    PurchaseDate    time.Time
    StartDate       time.Time
    SoftExpireDate  time.Time
    HardExpireDate  time.Time
    ShortLicense    string
    LongLicense     string
    Active, Expired bool
}

func (*License) Check Uses

func (l *License) Check(ref time.Time) (active, expired bool)

type LicenseBundle Uses

type LicenseBundle struct {
    Contact           string
    ContactEmail      string
    ContactId         string
    Owner             string
    OwnerEmail        string
    OwnerId           string
    Grantor           string
    GrantorEmail      string
    GenerationVersion string

    Licenses []License
}

type Machine Uses

type Machine struct {
    Validation
    Access
    Meta
    // 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
    // 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
    // The UUID of the job that is currently running on the machine.
    //
    // swagger:strfmt uuid
    CurrentJob uuid.UUID
    // 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.
    //
    // swagger:strfmt ipv4
    Address net.IP
    // An optional value to indicate tasks and profiles to apply.
    Stage string
    // 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 Machine specific Profile Data - only used for the map (name and other
    // fields not used - THIS IS DEPRECATED AND WILL GO AWAY.
    // Data will migrated from this struct to Params and then cleared.
    Profile Profile
    // Replaces the Profile.
    Params map[string]interface{}
    // The tasks this machine has to run.
    Tasks []string
    // required: true
    CurrentTask int
    // Indicates if the machine can run jobs or not.  Failed jobs mark the machine
    // not runnable.
    //
    // required: true
    Runnable bool

    // Secret for machine token revocation.  Changing the secret will invalidate
    // all existing tokens for this machine
    Secret string
    // OS is the operating system that the node is running in
    //
    OS  string
    // HardwareAddrs is a list of MAC addresses we expect that the system might boot from.
    //
    //
    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
}

Machine represents a single bare-metal system that the provisioner should manage the boot environment for. swagger:model

func (*Machine) AddTasks Uses

func (b *Machine) AddTasks(offset int, tasks ...string) error

func (*Machine) AuthKey Uses

func (n *Machine) AuthKey() string

func (*Machine) CanHaveActions Uses

func (b *Machine) CanHaveActions() bool

func (*Machine) DelTasks Uses

func (b *Machine) DelTasks(tasks ...string)

func (*Machine) Fill Uses

func (n *Machine) Fill()

func (*Machine) GetBootEnv Uses

func (b *Machine) GetBootEnv() string

match BootEnver interface

func (*Machine) GetMeta Uses

func (n *Machine) GetMeta() Meta

func (*Machine) GetParams Uses

func (b *Machine) GetParams() map[string]interface{}

match Paramer interface

func (*Machine) GetProfiles Uses

func (b *Machine) GetProfiles() []string

match Profiler interface

func (*Machine) GetTasks Uses

func (b *Machine) GetTasks() []string

match TaskRunner interface

func (*Machine) Key Uses

func (n *Machine) Key() string

func (*Machine) KeyName Uses

func (n *Machine) KeyName() string

func (*Machine) Prefix Uses

func (n *Machine) Prefix() string

func (*Machine) RunningTask Uses

func (b *Machine) RunningTask() int

func (*Machine) SetBootEnv Uses

func (b *Machine) SetBootEnv(s string)

func (*Machine) SetMeta Uses

func (n *Machine) SetMeta(d Meta)

func (*Machine) SetName Uses

func (b *Machine) SetName(n string)

func (*Machine) SetParams Uses

func (b *Machine) SetParams(p map[string]interface{})

func (*Machine) SetProfiles Uses

func (b *Machine) SetProfiles(p []string)

func (*Machine) SetTasks Uses

func (b *Machine) SetTasks(t []string)

func (*Machine) SliceOf Uses

func (b *Machine) SliceOf() interface{}

func (*Machine) SplitTasks Uses

func (b *Machine) SplitTasks() (thePast []string, thePresent []string, theFuture []string)

func (*Machine) ToModels Uses

func (b *Machine) ToModels(obj interface{}) []Model

func (*Machine) UUID Uses

func (n *Machine) UUID() string

func (*Machine) Validate Uses

func (n *Machine) Validate()

type Meta Uses

type Meta map[string]string

Meta holds information about arbitrary things. Initial usage will be for UX elements.

swagger: model

func (Meta) AddFeature Uses

func (m Meta) AddFeature(flag string)

func (Meta) ClearFeatures Uses

func (m Meta) ClearFeatures()

func (Meta) Features Uses

func (m Meta) Features() []string

func (Meta) HasFeature Uses

func (m Meta) HasFeature(flag string) bool

func (Meta) MergeFeatures Uses

func (m Meta) MergeFeatures(other []string)

func (Meta) RemoveFeature Uses

func (m Meta) RemoveFeature(flag string)

type MetaHaver Uses

type MetaHaver interface {
    Model
    GetMeta() Meta
    SetMeta(Meta)
}

type Model Uses

type Model interface {
    Prefix() string
    Key() string
    KeyName() string
}

func All Uses

func All() []Model

func Clone Uses

func Clone(m Model) Model

type NameSetter Uses

type NameSetter interface {
    Model
    SetName(string)
}

type OsInfo Uses

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.
    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 Uses

func (o OsInfo) FamilyName() string

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 Uses

func (o OsInfo) FamilyType() string

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 Uses

func (o OsInfo) FamilyVersion() string

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.

func (OsInfo) VersionEq Uses

func (o OsInfo) VersionEq(other string) bool

VersionEq returns true of this OS version is equal to the degree of accuracy implied by other -- o.Version(7.3) is VersionEq to 7 and 7.3, but not 7.3.11

type Param Uses

type Param struct {
    Validation
    Access
    Meta
    // Name is the name of the param.  Params must be uniquely named.
    //
    // required: true
    Name 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
    // 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) AuthKey Uses

func (p *Param) AuthKey() string

func (*Param) DefaultValue Uses

func (p *Param) DefaultValue() (interface{}, bool)

func (*Param) Fill Uses

func (p *Param) Fill()

func (*Param) GetDocumentation Uses

func (p *Param) GetDocumentation() string

func (*Param) GetMeta Uses

func (p *Param) GetMeta() Meta

func (*Param) Key Uses

func (p *Param) Key() string

func (*Param) KeyName Uses

func (p *Param) KeyName() string

func (*Param) Prefix Uses

func (p *Param) Prefix() string

func (*Param) SetMeta Uses

func (p *Param) SetMeta(d Meta)

func (*Param) SetName Uses

func (p *Param) SetName(s string)

func (*Param) SliceOf Uses

func (b *Param) SliceOf() interface{}

func (*Param) ToModels Uses

func (b *Param) ToModels(obj interface{}) []Model

func (*Param) TypeValue Uses

func (p *Param) TypeValue() (interface{}, bool)

func (*Param) Validate Uses

func (p *Param) Validate()

type Paramer Uses

type Paramer interface {
    Model
    GetParams() map[string]interface{}
    SetParams(map[string]interface{})
}

type Plugin Uses

type Plugin struct {
    Validation
    Access
    Meta
    // The name of the plugin instance.  THis must be unique across all
    // plugins.
    //
    // required: true
    Name string
    // 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) AuthKey Uses

func (n *Plugin) AuthKey() string

func (*Plugin) CanHaveActions Uses

func (p *Plugin) CanHaveActions() bool

func (*Plugin) Fill Uses

func (n *Plugin) Fill()

func (*Plugin) GetDocumentation Uses

func (p *Plugin) GetDocumentation() string

func (*Plugin) GetMeta Uses

func (p *Plugin) GetMeta() Meta

func (*Plugin) GetParams Uses

func (p *Plugin) GetParams() map[string]interface{}

match Paramer interface

func (*Plugin) Key Uses

func (n *Plugin) Key() string

func (*Plugin) KeyName Uses

func (n *Plugin) KeyName() string

func (*Plugin) Prefix Uses

func (n *Plugin) Prefix() string

func (*Plugin) SetMeta Uses

func (p *Plugin) SetMeta(d Meta)

func (*Plugin) SetName Uses

func (p *Plugin) SetName(s string)

func (*Plugin) SetParams Uses

func (p *Plugin) SetParams(pl map[string]interface{})

func (*Plugin) SliceOf Uses

func (p *Plugin) SliceOf() interface{}

func (*Plugin) ToModels Uses

func (p *Plugin) ToModels(obj interface{}) []Model

func (*Plugin) Validate Uses

func (p *Plugin) Validate()

type PluginProvider Uses

type PluginProvider struct {
    Meta

    Name    string
    Version string

    // This is used to indicate what version the plugin is built for
    PluginVersion int

    HasPublish       bool
    AvailableActions []AvailableAction

    RequiredParams []string
    OptionalParams []string

    // 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) Fill Uses

func (p *PluginProvider) Fill()

func (*PluginProvider) GetDocumentation Uses

func (p *PluginProvider) GetDocumentation() string

func (*PluginProvider) GetMeta Uses

func (p *PluginProvider) GetMeta() Meta

func (*PluginProvider) Key Uses

func (p *PluginProvider) Key() string

func (*PluginProvider) KeyName Uses

func (p *PluginProvider) KeyName() string

func (*PluginProvider) Prefix Uses

func (p *PluginProvider) Prefix() string

func (*PluginProvider) SetMeta Uses

func (p *PluginProvider) SetMeta(d Meta)

func (*PluginProvider) SliceOf Uses

func (p *PluginProvider) SliceOf() interface{}

func (*PluginProvider) ToModels Uses

func (p *PluginProvider) ToModels(obj interface{}) []Model

type PluginProviderUploadInfo Uses

type PluginProviderUploadInfo struct {
    Path string `json:"path"`
    Size int64  `json:"size"`
}

swagger:model

type Pref Uses

type Pref struct {
    Meta
    Name string
    Val  string
}

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.

func (*Pref) AuthKey Uses

func (p *Pref) AuthKey() string

func (*Pref) Fill Uses

func (p *Pref) Fill()

func (*Pref) Key Uses

func (p *Pref) Key() string

func (*Pref) KeyName Uses

func (p *Pref) KeyName() string

func (*Pref) Prefix Uses

func (p *Pref) Prefix() string

func (*Pref) SliceOf Uses

func (b *Pref) SliceOf() interface{}

func (*Pref) ToModels Uses

func (b *Pref) ToModels(obj interface{}) []Model

type Profile Uses

type Profile struct {
    Validation
    Access
    Meta
    // The name of the profile.  This must be unique across all
    // profiles.
    //
    // required: true
    Name string
    // 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{}
}

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) AuthKey Uses

func (p *Profile) AuthKey() string

func (*Profile) CanHaveActions Uses

func (p *Profile) CanHaveActions() bool

func (*Profile) Fill Uses

func (p *Profile) Fill()

func (*Profile) GetMeta Uses

func (p *Profile) GetMeta() Meta

func (*Profile) GetParams Uses

func (p *Profile) GetParams() map[string]interface{}

match Paramer interface

func (*Profile) Key Uses

func (p *Profile) Key() string

func (*Profile) KeyName Uses

func (p *Profile) KeyName() string

func (*Profile) Prefix Uses

func (p *Profile) Prefix() string

func (*Profile) SetMeta Uses

func (p *Profile) SetMeta(d Meta)

func (*Profile) SetName Uses

func (p *Profile) SetName(n string)

func (*Profile) SetParams Uses

func (p *Profile) SetParams(pl map[string]interface{})

func (*Profile) SliceOf Uses

func (p *Profile) SliceOf() interface{}

func (*Profile) ToModels Uses

func (p *Profile) ToModels(obj interface{}) []Model

func (*Profile) Validate Uses

func (p *Profile) Validate()

type Profiler Uses

type Profiler interface {
    Model
    GetProfiles() []string
    SetProfiles([]string)
}

type Reservation Uses

type Reservation struct {
    Validation
    Access
    Meta
    // Addr is the IP address permanently assigned to the strategy/token combination.
    //
    // required: true
    // swagger:strfmt ipv4
    Addr net.IP
    // 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
}

Reservation tracks persistent DHCP IP address reservations.

swagger:model

func (*Reservation) AuthKey Uses

func (r *Reservation) AuthKey() string

func (*Reservation) CanHaveActions Uses

func (r *Reservation) CanHaveActions() bool

func (*Reservation) Fill Uses

func (r *Reservation) Fill()

func (*Reservation) GetDocumentation Uses

func (r *Reservation) GetDocumentation() string

func (*Reservation) GetMeta Uses

func (r *Reservation) GetMeta() Meta

func (*Reservation) Key Uses

func (r *Reservation) Key() string

func (*Reservation) KeyName Uses

func (r *Reservation) KeyName() string

func (*Reservation) Prefix Uses

func (r *Reservation) Prefix() string

func (*Reservation) SetMeta Uses

func (r *Reservation) SetMeta(d Meta)

func (*Reservation) SliceOf Uses

func (r *Reservation) SliceOf() interface{}

func (*Reservation) ToModels Uses

func (r *Reservation) ToModels(obj interface{}) []Model

type Role Uses

type Role struct {
    Validation
    Access
    Meta
    // Name is the name of the user
    //
    // required: true
    Name string
    // 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 API endpoints are available. swagger:model

func MakeRole Uses

func MakeRole(name string, claims ...string) *Role

func (*Role) AuthKey Uses

func (r *Role) AuthKey() string

func (*Role) Compile Uses

func (r *Role) Compile() Claims

func (*Role) Contains Uses

func (a *Role) Contains(b *Role) bool

Role a contains role b if a can be used to satisfy all requests b can satisfy

func (*Role) Fill Uses

func (r *Role) Fill()

func (*Role) GetDocumentation Uses

func (r *Role) GetDocumentation() string

func (*Role) GetMeta Uses

func (r *Role) GetMeta() Meta

func (*Role) Key Uses

func (r *Role) Key() string

func (*Role) KeyName Uses

func (r *Role) KeyName() string

func (*Role) Match Uses

func (r *Role) Match(scope, action, specific string) bool

func (*Role) Prefix Uses

func (r *Role) Prefix() string

func (*Role) SetMeta Uses

func (r *Role) SetMeta(d Meta)

func (*Role) SliceOf Uses

func (r *Role) SliceOf() interface{}

func (*Role) ToModels Uses

func (r *Role) ToModels(obj interface{}) []Model

func (*Role) Validate Uses

func (r *Role) Validate()

type Section Uses

type Section map[string]interface{}

type Sections Uses

type Sections map[string]Section

type SecureData Uses

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
}

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) Marshal Uses

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 Uses

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 Uses

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 Uses

func (s *SecureData) Unmarshal(targetPrivateKey []byte, res interface{}) error

func (*SecureData) Validate Uses

func (s *SecureData) Validate() error

Validate makes sure that the lengths we expect for the Key and Nonce are correct.

type Slicer Uses

type Slicer interface {
    Filler
    SliceOf() interface{}
    ToModels(interface{}) []Model
}

func New Uses

func New(kind string) (Slicer, error)

type Stage Uses

type Stage struct {
    Validation
    Access
    Meta
    // The name of the stage.
    //
    // required: true
    Name string
    // 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
    // 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) AuthKey Uses

func (s *Stage) AuthKey() string

func (*Stage) CanHaveActions Uses

func (b *Stage) CanHaveActions() bool

func (*Stage) Fill Uses

func (s *Stage) Fill()

func (*Stage) GetBootEnv Uses

func (b *Stage) GetBootEnv() string

match BootEnver interface

func (*Stage) GetDocumentation Uses

func (s *Stage) GetDocumentation() string

func (*Stage) GetMeta Uses

func (s *Stage) GetMeta() Meta

func (*Stage) GetProfiles Uses

func (b *Stage) GetProfiles() []string

match Profiler interface

func (*Stage) GetTasks Uses

func (b *Stage) GetTasks() []string

match TaskRunner interface

func (*Stage) Key Uses

func (s *Stage) Key() string

func (*Stage) KeyName Uses

func (s *Stage) KeyName() string

func (*Stage) Prefix Uses

func (s *Stage) Prefix() string

func (*Stage) SetBootEnv Uses

func (b *Stage) SetBootEnv(s string)

func (*Stage) SetMeta Uses

func (s *Stage) SetMeta(d Meta)

func (*Stage) SetName Uses

func (b *Stage) SetName(n string)

func (*Stage) SetProfiles Uses

func (b *Stage) SetProfiles(p []string)

func (*Stage) SetTasks Uses

func (b *Stage) SetTasks(t []string)

func (*Stage) SliceOf Uses

func (b *Stage) SliceOf() interface{}

func (*Stage) ToModels Uses

func (b *Stage) ToModels(obj interface{}) []Model

func (*Stage) Validate Uses

func (s *Stage) Validate()

type Stat Uses

type Stat struct {
    // required: true
    Name string `json:"name"`
    // required: true
    Count int `json:"count"`
}

swagger:model

type Subnet Uses

type Subnet struct {
    Validation
    Access
    Meta
    // Name is the name of the subnet.
    // Subnet names must be unique
    //
    // required: true
    Name string
    // 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
}

Subnet represents a DHCP Subnet

swagger:model

func (*Subnet) AuthKey Uses

func (s *Subnet) AuthKey() string

func (*Subnet) CanHaveActions Uses

func (b *Subnet) CanHaveActions() bool

func (*Subnet) Fill Uses

func (s *Subnet) Fill()

func (*Subnet) GetDocumentation Uses

func (s *Subnet) GetDocumentation() string

func (*Subnet) GetMeta Uses

func (s *Subnet) GetMeta() Meta

func (*Subnet) Key Uses

func (s *Subnet) Key() string

func (*Subnet) KeyName Uses

func (s *Subnet) KeyName() string

func (*Subnet) Prefix Uses

func (s *Subnet) Prefix() string

func (*Subnet) SetMeta Uses

func (s *Subnet) SetMeta(d Meta)

func (*Subnet) SliceOf Uses

func (b *Subnet) SliceOf() interface{}

func (*Subnet) ToModels Uses

func (b *Subnet) ToModels(obj interface{}) []Model

func (*Subnet) Validate Uses

func (s *Subnet) Validate()

type Task Uses

type Task struct {
    Validation
    Access
    Meta
    // Name is the name of this Task.  Task names must be globally unique
    //
    // required: true
    Name string
    // 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
}

Task is a thing that can run on a Machine.

swagger:model

func (*Task) AuthKey Uses

func (t *Task) AuthKey() string

func (*Task) CanHaveActions Uses

func (t *Task) CanHaveActions() bool

func (*Task) Fill Uses

func (t *Task) Fill()

func (*Task) GetDocumentation Uses

func (t *Task) GetDocumentation() string

func (*Task) GetMeta Uses

func (t *Task) GetMeta() Meta

func (*Task) Key Uses

func (t *Task) Key() string

func (*Task) KeyName Uses

func (t *Task) KeyName() string

func (*Task) Prefix Uses

func (t *Task) Prefix() string

func (*Task) SetMeta Uses

func (t *Task) SetMeta(d Meta)

func (*Task) SetName Uses

func (t *Task) SetName(n string)

func (*Task) SliceOf Uses

func (t *Task) SliceOf() interface{}

func (*Task) ToModels Uses

func (t *Task) ToModels(obj interface{}) []Model

func (*Task) Validate Uses

func (t *Task) Validate()

type TaskRunner Uses

type TaskRunner interface {
    Tasker
    RunningTask() int
}

type Tasker Uses

type Tasker interface {
    Model
    GetTasks() []string
    SetTasks([]string)
}

type Template Uses

type Template struct {
    Validation
    Access
    Meta
    // ID is a unique identifier for this template.  It cannot change once it is set.
    //
    // required: true
    ID  string
    // 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
}

Template represents a template that will be associated with a boot environment.

swagger:model

func (*Template) AuthKey Uses

func (t *Template) AuthKey() string

func (*Template) CanHaveActions Uses

func (b *Template) CanHaveActions() bool

func (*Template) Fill Uses

func (t *Template) Fill()

func (*Template) GetMeta Uses

func (t *Template) GetMeta() Meta

func (*Template) Key Uses

func (t *Template) Key() string

func (*Template) KeyName Uses

func (t *Template) KeyName() string

func (*Template) Prefix Uses

func (t *Template) Prefix() string

func (*Template) SetMeta Uses

func (t *Template) SetMeta(d Meta)

func (*Template) SliceOf Uses

func (b *Template) SliceOf() interface{}

func (*Template) ToModels Uses

func (b *Template) ToModels(obj interface{}) []Model

func (*Template) Validate Uses

func (t *Template) Validate()

type TemplateInfo Uses

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
    // The ID of the template that should be expanded.  Either
    // this or Contents should be set
    //
    // required: false
    ID  string
    // The contents that should be used when this template needs
    // to be expanded.  Either this or ID should be set.
    //
    // required: false
    Contents string
    // Metadata 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
    // contains filtered or unexported fields
}

TemplateInfo holds information on the templates in the boot environment that will be expanded into files.

swagger:model

func (*TemplateInfo) Id Uses

func (ti *TemplateInfo) Id() string

func (*TemplateInfo) PathTemplate Uses

func (ti *TemplateInfo) PathTemplate() *template.Template

func (*TemplateInfo) SanityCheck Uses

func (ti *TemplateInfo) SanityCheck(idx int, e ErrorAdder, missingPathOK bool)

type Tenant Uses

type Tenant struct {
    Validation
    Access
    Meta
    Name        string
    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) AuthKey Uses

func (t *Tenant) AuthKey() string

func (*Tenant) Fill Uses

func (t *Tenant) Fill()

func (*Tenant) GetDocumentation Uses

func (t *Tenant) GetDocumentation() string

func (*Tenant) GetMeta Uses

func (t *Tenant) GetMeta() Meta

func (*Tenant) Key Uses

func (t *Tenant) Key() string

func (*Tenant) KeyName Uses

func (t *Tenant) KeyName() string

func (*Tenant) Prefix Uses

func (t *Tenant) Prefix() string

func (*Tenant) SetMeta Uses

func (t *Tenant) SetMeta(d Meta)

func (*Tenant) SliceOf Uses

func (t *Tenant) SliceOf() interface{}

func (*Tenant) ToModels Uses

func (t *Tenant) ToModels(obj interface{}) []Model

func (*Tenant) Validate Uses

func (t *Tenant) Validate()

type User Uses

type User struct {
    Validation
    Access
    Meta
    // Name is the name of the user
    //
    // required: true
    Name string
    // Description of user
    Description string
    // PasswordHash is the scrypt-hashed version of the user's Password.
    //
    PasswordHash []byte `json:",omitempty"`
    // 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
    // Roles is a list of Roles this User has.
    //
    Roles []string
}

User is an API user of DigitalRebar Provision swagger:model

func (*User) AuthKey Uses

func (u *User) AuthKey() string

func (*User) CanHaveActions Uses

func (b *User) CanHaveActions() bool

func (*User) CheckPassword Uses

func (u *User) CheckPassword(pass string) bool

func (*User) Fill Uses

func (u *User) Fill()

func (*User) GetMeta Uses

func (u *User) GetMeta() Meta

func (*User) Key Uses

func (u *User) Key() string

func (*User) KeyName Uses

func (u *User) KeyName() string

func (*User) Prefix Uses

func (u *User) Prefix() string

func (*User) Sanitize Uses

func (u *User) Sanitize() Model

func (*User) SetMeta Uses

func (u *User) SetMeta(d Meta)

func (*User) SetName Uses

func (b *User) SetName(n string)

func (*User) SliceOf Uses

func (b *User) SliceOf() interface{}

func (*User) ToModels Uses

func (b *User) ToModels(obj interface{}) []Model

func (*User) Validate Uses

func (u *User) Validate()

type UserPassword Uses

type UserPassword struct {
    Password string
}

swagger:model

type UserToken Uses

type UserToken struct {
    Token string
    Info  Info
}

swagger:model

type ValidateSetter Uses

type ValidateSetter interface {
    SetValid() bool
    SetAvailable() bool
}

type Validation Uses

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 Uses

func (v *Validation) AddError(err error)

func (*Validation) ChangeForced Uses

func (v *Validation) ChangeForced() bool

func (*Validation) ClearValidation Uses

func (v *Validation) ClearValidation()

func (*Validation) Error Uses

func (v *Validation) Error() string

func (*Validation) Errorf Uses

func (v *Validation) Errorf(fmtStr string, args ...interface{})

func (*Validation) ForceChange Uses

func (v *Validation) ForceChange()

func (*Validation) HasError Uses

func (v *Validation) HasError() error

func (*Validation) IsAvailable Uses

func (v *Validation) IsAvailable() bool

func (*Validation) MakeError Uses

func (v *Validation) MakeError(code int, errType string, obj Model) error

func (*Validation) RestoreValidation Uses

func (v *Validation) RestoreValidation(ov *Validation)

func (*Validation) SaveValidation Uses

func (v *Validation) SaveValidation() *Validation

func (*Validation) SetAvailable Uses

func (v *Validation) SetAvailable() bool

func (*Validation) SetInvalid Uses

func (v *Validation) SetInvalid() bool

func (*Validation) SetValid Uses

func (v *Validation) SetValid() bool

func (*Validation) Useable Uses

func (v *Validation) Useable() bool

type Validator Uses

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 Workflow Uses

type Workflow struct {
    Validation
    Access
    Meta
    Name          string
    Description   string
    Documentation string
    Stages        []string
}

func (*Workflow) AuthKey Uses

func (w *Workflow) AuthKey() string

func (*Workflow) CanHaveActions Uses

func (w *Workflow) CanHaveActions() bool

func (*Workflow) Fill Uses

func (w *Workflow) Fill()

func (*Workflow) GetDocumentation Uses

func (w *Workflow) GetDocumentation() string

func (*Workflow) GetMeta Uses

func (w *Workflow) GetMeta() Meta

func (*Workflow) Key Uses

func (w *Workflow) Key() string

func (*Workflow) KeyName Uses

func (w *Workflow) KeyName() string

func (*Workflow) Prefix Uses

func (w *Workflow) Prefix() string

func (*Workflow) SetMeta Uses

func (w *Workflow) SetMeta(d Meta)

func (*Workflow) SliceOf Uses

func (w *Workflow) SliceOf() interface{}

func (*Workflow) ToModels Uses

func (w *Workflow) ToModels(obj interface{}) []Model

func (*Workflow) Validate Uses

func (w *Workflow) Validate()

Package models imports 28 packages (graph) and is imported by 12 packages. Updated 2018-10-21. Refresh now. Tools for package owners.