Documentation ¶
Index ¶
- Constants
- Variables
- func MachineLiveliness(ds *datastore.RethinkStore, logger *slog.Logger) error
- func NewAudit(log *slog.Logger, a auditing.Auditing) *restful.WebService
- func NewFilesystemLayout(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService
- func NewFirewall(log *slog.Logger, ds *datastore.RethinkStore, pub bus.Publisher, ...) (*restful.WebService, error)
- func NewFirmware(log *slog.Logger, ds *datastore.RethinkStore, s3Client *s3server.Client) (*restful.WebService, error)
- func NewIP(log *slog.Logger, ds *datastore.RethinkStore, ep *bus.Endpoints, ...) (*restful.WebService, error)
- func NewImage(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService
- func NewMachine(log *slog.Logger, ds *datastore.RethinkStore, pub bus.Publisher, ...) (*restful.WebService, error)
- func NewNetwork(log *slog.Logger, ds *datastore.RethinkStore, ipamer ipam.IPAMer, ...) *restful.WebService
- func NewPartition(log *slog.Logger, ds *datastore.RethinkStore, tc TopicCreator) *restful.WebService
- func NewProject(log *slog.Logger, ds *datastore.RethinkStore, mdc mdm.Client) *restful.WebService
- func NewSize(log *slog.Logger, ds *datastore.RethinkStore, mdc mdm.Client) *restful.WebService
- func NewSizeImageConstraint(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService
- func NewSwitch(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService
- func NewTenant(log *slog.Logger, mdc mdm.Client) *restful.WebService
- func NewUser(log *slog.Logger, userGetter security.UserGetter) *restful.WebService
- func NewVPN(log *slog.Logger, headscaleClient *headscale.HeadscaleClient) *restful.WebService
- func ResurrectMachines(ctx context.Context, ds *datastore.RethinkStore, publisher bus.Publisher, ...) error
- type Allocation
- type Allocator
- type MachineAllocation
- type TenantEnsurer
- type TopicCreator
- type UserDirectory
Constants ¶
const ( // ASNMin is the minimum asn defined according to // https://en.wikipedia.org/wiki/Autonomous_system_(Internet) ASNMin = uint32(4200000000) // ASNBase is the offset for all Machine ASN´s ASNBase = uint32(4210000000) // ASNMax defines the maximum allowed asn // https://en.wikipedia.org/wiki/Autonomous_system_(Internet) ASNMax = uint32(4294967294) )
Variables ¶
var BasePath = "/"
BasePath is the URL base path for the metal-api
Functions ¶
func MachineLiveliness ¶ added in v0.5.7
func MachineLiveliness(ds *datastore.RethinkStore, logger *slog.Logger) error
MachineLiveliness evaluates whether machines are still alive or if they have died
func NewFilesystemLayout ¶ added in v0.15.0
func NewFilesystemLayout(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService
NewFilesystemLayout returns a webservice for filesystem specific endpoints.
func NewFirewall ¶
func NewFirewall( log *slog.Logger, ds *datastore.RethinkStore, pub bus.Publisher, ipamer ipam.IPAMer, ep *bus.Endpoints, mdc mdm.Client, userGetter security.UserGetter, headscaleClient *headscale.HeadscaleClient, ) (*restful.WebService, error)
NewFirewall returns a webservice for firewall specific endpoints.
func NewFirmware ¶ added in v0.13.1
func NewFirmware(log *slog.Logger, ds *datastore.RethinkStore, s3Client *s3server.Client) (*restful.WebService, error)
NewFirmware returns a webservice for firmware specific endpoints.
func NewIP ¶
func NewIP(log *slog.Logger, ds *datastore.RethinkStore, ep *bus.Endpoints, ipamer ipam.IPAMer, mdc mdm.Client) (*restful.WebService, error)
NewIP returns a webservice for ip specific endpoints.
func NewImage ¶
func NewImage(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService
NewImage returns a webservice for image specific endpoints.
func NewMachine ¶
func NewMachine( log *slog.Logger, ds *datastore.RethinkStore, pub bus.Publisher, ep *bus.Endpoints, ipamer ipam.IPAMer, mdc mdm.Client, s3Client *s3server.Client, userGetter security.UserGetter, reasonMinLength uint, headscaleClient *headscale.HeadscaleClient, ipmiSuperUser metal.MachineIPMISuperUser, ) (*restful.WebService, error)
NewMachine returns a webservice for machine specific endpoints.
func NewNetwork ¶
func NewNetwork(log *slog.Logger, ds *datastore.RethinkStore, ipamer ipam.IPAMer, mdc mdm.Client) *restful.WebService
NewNetwork returns a webservice for network specific endpoints.
func NewPartition ¶
func NewPartition(log *slog.Logger, ds *datastore.RethinkStore, tc TopicCreator) *restful.WebService
NewPartition returns a webservice for partition specific endpoints.
func NewProject ¶
func NewProject(log *slog.Logger, ds *datastore.RethinkStore, mdc mdm.Client) *restful.WebService
NewProject returns a webservice for project specific endpoints.
func NewSize ¶
func NewSize(log *slog.Logger, ds *datastore.RethinkStore, mdc mdm.Client) *restful.WebService
NewSize returns a webservice for size specific endpoints.
func NewSizeImageConstraint ¶ added in v0.16.3
func NewSizeImageConstraint(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService
NewSize returns a webservice for size specific endpoints.
func NewSwitch ¶
func NewSwitch(log *slog.Logger, ds *datastore.RethinkStore) *restful.WebService
NewSwitch returns a webservice for switch specific endpoints.
func NewUser ¶ added in v0.15.7
func NewUser(log *slog.Logger, userGetter security.UserGetter) *restful.WebService
NewUser returns a webservice for user specific endpoints.
func NewVPN ¶ added in v0.20.0
func NewVPN( log *slog.Logger, headscaleClient *headscale.HeadscaleClient, ) *restful.WebService
NewVPN returns a webservice for VPN specific endpoints.
func ResurrectMachines ¶
func ResurrectMachines(ctx context.Context, ds *datastore.RethinkStore, publisher bus.Publisher, ep *bus.Endpoints, ipamer ipam.IPAMer, headscaleClient *headscale.HeadscaleClient, logger *slog.Logger) error
ResurrectMachines attempts to resurrect machines that are obviously dead
Types ¶
type Allocation ¶
type Allocation <-chan MachineAllocation
An Allocation is a queue of allocated machines. You can read the machines to get the next allocated one.
type Allocator ¶
type Allocator func(Allocation) error
An Allocator is a callback for some piece of code if this wants to read allocated machines.
type MachineAllocation ¶
The MachineAllocation contains the allocated machine or an error.
type TenantEnsurer ¶
type TenantEnsurer struct {
// contains filtered or unexported fields
}
TenantEnsurer holds allowed tenants and a list of path suffixes that
func NewTenantEnsurer ¶
func NewTenantEnsurer(log *slog.Logger, tenants, excludedPathSuffixes []string) TenantEnsurer
NewTenantEnsurer creates a new ensurer with the given tenants.
func (*TenantEnsurer) EnsureAllowedTenantFilter ¶
func (e *TenantEnsurer) EnsureAllowedTenantFilter(req *restful.Request, resp *restful.Response, chain *restful.FilterChain)
EnsureAllowedTenantFilter checks if the tenant of the user is allowed.
type TopicCreator ¶ added in v0.8.0
TopicCreator creates a topic for messaging.
type UserDirectory ¶
type UserDirectory struct {
// contains filtered or unexported fields
}
UserDirectory is the directory of users
func NewUserDirectory ¶
func NewUserDirectory(providerTenant string) *UserDirectory
NewUserDirectory creates a new user directory with default users
func (*UserDirectory) Get ¶
func (ud *UserDirectory) Get(user string) security.User
Get a user by its user name.
func (*UserDirectory) UserNames ¶
func (ud *UserDirectory) UserNames() []string
UserNames returns the list of user names in the directory.
Source Files ¶
- asn.go
- async-actor.go
- audit-service.go
- filesystem-service.go
- firewall-service.go
- firmware-service.go
- image-service.go
- ip-service.go
- machine-service.go
- network-service.go
- partition-service.go
- project-service.go
- service.go
- size-service.go
- sizeimageconstraint-service.go
- switch-service.go
- tenant-service.go
- user-service.go
- vpn-service.go
- vrf.go