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

package models

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

Index

Package Files

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

func All Uses

func All() []Model

func Hexaddr Uses

func Hexaddr(addr net.IP) string

func MergeTemplates Uses

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

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

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

type AvailableAction struct {
    Provider       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

type BootEnv Uses

type BootEnv struct {
    Validation
    Access
    MetaData
    // 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
    // shoudl be taken into account when using it, etc.
    Description 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) Key Uses

func (b *BootEnv) Key() string

func (*BootEnv) Prefix Uses

func (b *BootEnv) Prefix() string

type BootEnvs Uses

type BootEnvs []*BootEnv

func (BootEnvs) Elem Uses

func (s BootEnvs) Elem() Model

func (BootEnvs) Fill Uses

func (s BootEnvs) Fill(m []Model)

func (BootEnvs) Items Uses

func (s BootEnvs) Items() []Model

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

func (c *Content) Key() string

func (*Content) Prefix Uses

func (c *Content) Prefix() string

type ContentMetaData Uses

type ContentMetaData struct {
    MetaData

    // required: true
    Name        string
    Source      string
    Description string
    Version     string

    // Informational Fields
    Writable     bool
    Type         string
    Overwritable bool
}

type ContentSummary Uses

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

swagger:model

type Contents Uses

type Contents []*Content

func (Contents) Elem Uses

func (s Contents) Elem() Model

func (Contents) Fill Uses

func (s Contents) Fill(m []Model)

func (Contents) Items Uses

func (s Contents) Items() []Model

type DhcpOption Uses

type DhcpOption struct {
    // Code is a DHCP Option Code.
    //
    // required: true
    Code dhcp.OptionCode
    // 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 (*DhcpOption) ConvertOptionValueToByte Uses

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

func (*DhcpOption) RenderToDHCP Uses

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

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 `json:"-"`
    // contains filtered or unexported fields
}

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

    // 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 (*Event) Model Uses

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

func (*Event) Text Uses

func (e *Event) Text() string

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
    TftpEnabled bool `json:"tftp_enabled"`
    // required: true
    DhcpEnabled bool `json:"dhcp_enabled"`
    // required: true
    ProvisionerEnabled bool `json:"prov_enabled"`
    // required: true
    Stats []*Stat `json:"stats"`
}

swagger:model

type Interface Uses

type Interface struct {
    Access
    MetaData
    // 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
}

swagger:model

func (*Interface) Key Uses

func (i *Interface) Key() string

func (*Interface) Prefix Uses

func (i *Interface) Prefix() string

type Interfaces Uses

type Interfaces []*Interface

func (Interfaces) Elem Uses

func (s Interfaces) Elem() Model

func (Interfaces) Fill Uses

func (s Interfaces) Fill(m []Model)

func (Interfaces) Items Uses

func (s Interfaces) Items() []Model

type Job Uses

type Job struct {
    Validation
    Access
    MetaData
    // 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 time the job entered running.
    StartTime time.Time
    // The time the job entered failed or finished.
    EndTime time.Time
    // required: true
    Archived bool
    // DRP Filesystem path to the log for this job
    // read only: true
    LogPath string
}

swagger:model

func (*Job) AuthKey Uses

func (j *Job) AuthKey() string

func (*Job) Key Uses

func (j *Job) Key() string

func (*Job) Prefix Uses

func (j *Job) Prefix() string

type JobAction Uses

type JobAction struct {
    // required: true
    Name string
    // required: true
    Path string
    // required: true
    Content 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

type Jobs Uses

type Jobs []*Job

func (Jobs) Elem Uses

func (s Jobs) Elem() Model

func (Jobs) Fill Uses

func (s Jobs) Fill(m []Model)

func (Jobs) Items Uses

func (s Jobs) Items() []Model

type Lease Uses

type Lease struct {
    Validation
    Access
    MetaData
    // Addr is the IP address that the lease handed out.
    //
    // required: true
    // swagger:strfmt ipv4
    Addr net.IP
    // Token is the unique token for this lease based on the
    // Strategy this lease used.
    //
    // required: true
    Token string
    // 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
}

swagger:model

func (*Lease) AuthKey Uses

func (l *Lease) AuthKey() string

func (*Lease) Key Uses

func (l *Lease) Key() string

func (*Lease) Prefix Uses

func (l *Lease) Prefix() string

type Leases Uses

type Leases []*Lease

func (Leases) Elem Uses

func (s Leases) Elem() Model

func (Leases) Fill Uses

func (s Leases) Fill(m []Model)

func (Leases) Items Uses

func (s Leases) Items() []Model

type Machine Uses

type Machine struct {
    Validation
    Access
    MetaData
    // 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
    Profile Profile
    // 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
}

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

func (*Machine) AuthKey Uses

func (n *Machine) AuthKey() string

func (*Machine) Key Uses

func (n *Machine) Key() string

func (*Machine) Prefix Uses

func (n *Machine) Prefix() string

func (*Machine) UUID Uses

func (n *Machine) UUID() string

type MachineAction Uses

type MachineAction struct {
    Name    string
    Uuid    uuid.UUID
    Address net.IP
    BootEnv 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.

type Machines Uses

type Machines []*Machine

func (Machines) Elem Uses

func (s Machines) Elem() Model

func (Machines) Fill Uses

func (s Machines) Fill(m []Model)

func (Machines) Items Uses

func (s Machines) Items() []Model

type MetaData Uses

type MetaData struct {
    Meta map[string]string
}

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

swagger: model

type Model Uses

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

func Clone Uses

func Clone(m Model) (Model, error)

func New Uses

func New(kind string) (Model, error)

type Models Uses

type Models interface {
    Elem() Model
    Items() []Model
    Fill([]Model)
}

type OsInfo Uses

type OsInfo struct {
    // The name of the OS this BootEnv has.
    //
    // 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.
    IsoFile string
    // The SHA256 of the ISO file.  Used to check for corrupt downloads.
    IsoSha256 string
    // The URL that the ISO can be downloaded from, if any.
    //
    // swagger:strfmt uri
    IsoUrl string
}

OsInfo holds information about the operating system this BootEnv maps to. Most of this information is optional for now. swagger:model

type Param Uses

type Param struct {
    Validation
    Access
    MetaData
    // 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
    // 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) Key Uses

func (p *Param) Key() string

func (*Param) Prefix Uses

func (p *Param) Prefix() string

func (*Param) ValidateSchema Uses

func (p *Param) ValidateSchema() error

type Params Uses

type Params []*Param

func (Params) Elem Uses

func (s Params) Elem() Model

func (Params) Fill Uses

func (s Params) Fill(m []Model)

func (Params) Items Uses

func (s Params) Items() []Model

type Plugin Uses

type Plugin struct {
    Validation
    Access
    MetaData
    // 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
    // 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) Key Uses

func (n *Plugin) Key() string

func (*Plugin) Prefix Uses

func (n *Plugin) Prefix() string

type PluginClientReply Uses

type PluginClientReply struct {
    Id   int
    Code int
    Data []byte
}

If code == 0,2xx, then success and call should json decode. If code != 0,2xx, then error and data is Error.

func (*PluginClientReply) Error Uses

func (r *PluginClientReply) Error() *Error

func (*PluginClientReply) HasError Uses

func (r *PluginClientReply) HasError() bool

type PluginClientRequest Uses

type PluginClientRequest struct {
    Id     int
    Action string
    Data   []byte
}

Id of request, and JSON blob

type PluginProvider Uses

type PluginProvider struct {
    MetaData

    Name    string
    Version string

    HasPublish       bool
    AvailableActions []*AvailableAction

    RequiredParams []string
    OptionalParams []string

    // Ensure that these are in the system.
    Parameters []*Param
}

Plugin Provider describes the available functions that could be instantiated by a plugin. swagger:model

type PluginProviderUploadInfo Uses

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

swagger:model

type Pref Uses

type Pref struct {
    MetaData
    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) Key Uses

func (p *Pref) Key() string

func (*Pref) Prefix Uses

func (p *Pref) Prefix() string

type Prefs Uses

type Prefs []*Pref

func (Prefs) Elem Uses

func (s Prefs) Elem() Model

func (Prefs) Fill Uses

func (s Prefs) Fill(m []Model)

func (Prefs) Items Uses

func (s Prefs) Items() []Model

type Profile Uses

type Profile struct {
    Validation
    Access
    MetaData
    // 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
    // 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) Key Uses

func (p *Profile) Key() string

func (*Profile) Prefix Uses

func (p *Profile) Prefix() string

type Profiles Uses

type Profiles []*Profile

func (Profiles) Elem Uses

func (s Profiles) Elem() Model

func (Profiles) Fill Uses

func (s Profiles) Fill(m []Model)

func (Profiles) Items Uses

func (s Profiles) Items() []Model

type Reservation Uses

type Reservation struct {
    Validation
    Access
    MetaData
    // Addr is the IP address permanently assigned to the strategy/token combination.
    //
    // required: true
    // swagger:strfmt ipv4
    Addr net.IP
    // Token is the unique identifier that the strategy for this Reservation should use.
    //
    // required: true
    Token string
    // NextServer is the address the server should contact next.
    //
    // 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
}

Reservation tracks persistent DHCP IP address reservations.

swagger:model

func (*Reservation) AuthKey Uses

func (r *Reservation) AuthKey() string

func (*Reservation) Key Uses

func (r *Reservation) Key() string

func (*Reservation) Prefix Uses

func (r *Reservation) Prefix() string

type Reservations Uses

type Reservations []*Reservation

func (Reservations) Elem Uses

func (s Reservations) Elem() Model

func (Reservations) Fill Uses

func (s Reservations) Fill(m []Model)

func (Reservations) Items Uses

func (s Reservations) Items() []Model

type Section Uses

type Section map[string]interface{}

type Sections Uses

type Sections map[string]Section

type Stage Uses

type Stage struct {
    Validation
    Access
    MetaData
    // 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
    // shoudl be taken into account when using it, etc.
    Description string
    // The templates that should be expanded into files for the stage.
    //
    // required: true
    Templates []TemplateInfo
    // 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
    // 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
    // Flag to indicate if the runner should wait for more tasks
    // while in this stage.
    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) Key Uses

func (s *Stage) Key() string

func (*Stage) Prefix Uses

func (s *Stage) Prefix() string

type Stages Uses

type Stages []*Stage

func (Stages) Elem Uses

func (s Stages) Elem() Model

func (Stages) Fill Uses

func (s Stages) Fill(m []Model)

func (Stages) Items Uses

func (s Stages) Items() []Model

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
    MetaData
    // Name is the name of the subnet.
    // Subnet names must be unique
    //
    // required: true
    Name string
    // Enabled indicates if the subnet should hand out leases or continue operating
    // leases if already running.
    //
    // required: true
    Enabled 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
    //
    // 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 ant
    // reamining 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) Key Uses

func (s *Subnet) Key() string

func (*Subnet) Prefix Uses

func (s *Subnet) Prefix() string

type Subnets Uses

type Subnets []*Subnet

func (Subnets) Elem Uses

func (s Subnets) Elem() Model

func (Subnets) Fill Uses

func (s Subnets) Fill(m []Model)

func (Subnets) Items Uses

func (s Subnets) Items() []Model

type Task Uses

type Task struct {
    Validation
    Access
    MetaData
    // 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) Key Uses

func (t *Task) Key() string

func (*Task) Prefix Uses

func (t *Task) Prefix() string

type Tasks Uses

type Tasks []*Task

func (Tasks) Elem Uses

func (s Tasks) Elem() Model

func (Tasks) Fill Uses

func (s Tasks) Fill(m []Model)

func (Tasks) Items Uses

func (s Tasks) Items() []Model

type Template Uses

type Template struct {
    Validation
    Access
    MetaData
    // 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) Key Uses

func (t *Template) Key() string

func (*Template) Prefix Uses

func (t *Template) Prefix() string

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
    // 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

type Templates Uses

type Templates []*Template

func (Templates) Elem Uses

func (s Templates) Elem() Model

func (Templates) Fill Uses

func (s Templates) Fill(m []Model)

func (Templates) Items Uses

func (s Templates) Items() []Model

type User Uses

type User struct {
    Validation
    Access
    MetaData
    // Name is the name of the user
    //
    // required: true
    Name string
    // PasswordHash is the scrypt-hashed version of the user's Password.
    //
    PasswordHash []byte `json:",omitempty"`
}

User is an API user of DigitalRebar Provision swagger:model

func (*User) AuthKey Uses

func (u *User) AuthKey() string

func (*User) CheckPassword Uses

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

func (*User) Key Uses

func (u *User) Key() string

func (*User) Prefix Uses

func (u *User) Prefix() string

func (*User) Sanitize Uses

func (u *User) Sanitize() Model

type UserPassword Uses

type UserPassword struct {
    Password string
}

swagger:model

type UserToken Uses

type UserToken struct {
    Token string
    Info  Info
}

swagger:model

type Users Uses

type Users []*User

func (Users) Elem Uses

func (s Users) Elem() Model

func (Users) Fill Uses

func (s Users) Fill(m []Model)

func (Users) Items Uses

func (s Users) Items() []Model

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

Package models imports 15 packages (graph) and is imported by 7 packages. Updated 2017-10-17. Refresh now. Tools for package owners.