controllers

package
v0.0.0-...-11ae3f5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 23, 2024 License: GPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertReactAdminID

func ConvertReactAdminID(c *gin.Context, key string) string

func CreateBootentry

func CreateBootentry(c *gin.Context)

CreateBootentry @Summary Create Bootentry @Description Create a Bootentry @Accept json @Produce json @Param bootentry body models.Bootentry true "json format Bootentry" @Success 200 {object} models.Bootentry @Failure 400 {object} models.Error "Failed to create account in DB" @Failure 500 {object} models.Error "Unmarshall error" @Router /bootentries [post]

func CreateIpxeaccount

func CreateIpxeaccount(c *gin.Context)

CreateIpxeaccount @Summary Create iPXE account @Description Create a iPXE account @Accept json @Produce json @Param ipxeaccount body models.Ipxeaccount true "json format iPXE account" @Success 200 {object} models.Ipxeaccount @Failure 400 {object} models.Error "Failed to create account in DB" @Failure 500 {object} models.Error "Unmarshall error" @Router /ipxeaccount [post]

func DeleteBootentry

func DeleteBootentry(c *gin.Context)

DeleteBootentry @Summary Delete Bootentry @Description Delete Bootentry @Accept json @Produce json @Param uuid path string true "Bootentry UUID" minlength(36) maxlength(36) @Success 200 @Failure 400 {object} models.Error "Failed to parse UUID" @Failure 404 {object} models.Error "Bootentry UUID not found" @Router /Bootentries/{username} [delete]

func DeleteComputer

func DeleteComputer(c *gin.Context)

DeleteComputer @Summary Delete computer @Description Delete a computer @Accept json @Produce json @Param id path string true "Computer UUID" minlength(36) maxlength(36) @Success 200 @Failure 400 {object} models.Error "Failed to parse UUID" @Failure 404 {object} models.Error "Can not find ID" @Router /computers/{id} [delete]

func DeleteIpxeaccount

func DeleteIpxeaccount(c *gin.Context)

DeleteIpxeaccount @Summary Delete iPXE account @Description Delete a iPXE account @Accept json @Produce json @Param username path string true "Username" @Success 200 {object} models.Ipxeaccount @Failure 404 {object} models.Error "iPXE account not found" @Router /ipxeaccount/{username} [delete]

func DownloadBootentryFile

func DownloadBootentryFile(c *gin.Context)

func DownloadProtectedFile

func DownloadProtectedFile(c *gin.Context)

func DownloadPublicFile

func DownloadPublicFile(c *gin.Context)

func Downloadfile

func Downloadfile(c *gin.Context, bootentryFile *models.BootentryFile, computer *models.Computer)

func GetBootentry

func GetBootentry(c *gin.Context)

GetBootentry @Summary Get Bootentry @Description Get a Bootentry by Id @Accept json @Produce json @Param id path string true "Bootentry UUID" minlength(36) maxlength(36) @Success 200 {object} models.Bootentry @Failure 404 {object} models.Error "Computer with uuid %s not found" @Router /bootentries/{id} [get]

func GetComputer

func GetComputer(c *gin.Context)

GetComputer @Summary Get computer @Description Get a computer by Id @Accept json @Produce json @Param id path string true "Computer UUID" minlength(36) maxlength(36) @Success 200 {object} models.Computer @Failure 404 {object} models.Error "Computer with uuid %s not found" @Router /computers/{id} [get]

func GetIpxeaccount

func GetIpxeaccount(c *gin.Context)

GetIpxeaccount @Summary Get iPXE account @Description Get iPXE account by username @Accept json @Produce json @Param username path string true "Username" @Success 200 {object} models.Ipxeaccount @Failure 404 {object} models.Error "iPXE account not found" @Router /ipxeaccount/{username} [get]

func GetTFTPReader

func GetTFTPReader(config *utils.Config, db *gorm.DB) func(filename string, rf io.ReaderFrom) error

func GetTFTPWriter

func GetTFTPWriter(config *utils.Config) func(filename string, wt io.WriterTo) error

func GrubScript

func GrubScript(c *gin.Context)

func IpxeScript

func IpxeScript(c *gin.Context)

func ListBootentries

func ListBootentries(c *gin.Context)

ListBootentries @Summary List Bootentries @Description List of Bootentry filtered or not @Accept json @Produce json @Param _start query int false "Offset" @Success 200 {object} []models.Bootentry @Router /bootentries [get]

func ListComputers

func ListComputers(c *gin.Context)

ListComputers @Summary List computers @Description List of computers filtered or not @Accept json @Produce json @Param _start query int false "Offset" @Success 200 {object} []models.Computer @Router /computers [get]

func ListFilter

func ListFilter(db *gorm.DB, c *gin.Context) *gorm.DB

func ListIpxeaccount

func ListIpxeaccount(c *gin.Context)

ListIpxeaccount @Summary List iPXE account @Description List of accounts for ipxe @Accept json @Produce json @Param _start query int false "Offset" @Success 200 {object} []models.Ipxeaccount @Router /ipxeaccount [get]

func PaginationFilter

func PaginationFilter(db *gorm.DB, c *gin.Context) *gorm.DB

func SearchFields

func SearchFields(c *gin.Context) []string

func ToSnakeCase

func ToSnakeCase(str string) string

func UpdateBootentry

func UpdateBootentry(c *gin.Context)

UpdateBootentry @Summary Update Bootentry @Description Update a Bootentry @Accept json @Produce json @Param uuid path string true "Bootentry UUID" minlength(36) maxlength(36) @Param bootentry body models.Bootentry true "json format of Bootentry" @Success 200 {object} models.Bootentry @Failure 500 {object} models.Error "Unmarshall error" @Failure 400 {object} models.Error "Query uuid and uuid miss match" @Failure 404 {object} models.Error "Bootentry UUID not found" @Router /bootentries/{username} [put]

func UpdateComputer

func UpdateComputer(c *gin.Context)

UpdateComputer @Summary Update computer @Description Update a computer @Accept json @Produce json @Param id path string true "Computer UUID" minlength(36) maxlength(36) @Param computer body models.Computer true "json format computer" @Success 200 {object} models.Computer @Failure 500 {object} models.Error "Unmarshall error" @Failure 400 {object} models.Error "Query ID and UUID miss match" @Failure 404 {object} models.Error "Can not find ID" @Router /computers/{id} [put]

func UpdateIpxeaccount

func UpdateIpxeaccount(c *gin.Context)

UpdateIpxeaccount @Summary Update iPXE account @Description Update a iPXE account @Accept json @Produce json @Param username path string true "Username" @Param ipxeaccount body models.Ipxeaccount true "json format iPXE account" @Success 200 {object} models.Ipxeaccount @Failure 500 {object} models.Error "Unmarshall error" @Failure 400 {object} models.Error "Query username and username miss match" @Failure 404 {object} models.Error "iPXE account not found" @Router /ipxeaccount/{username} [put]

func UploadBootentryFile

func UploadBootentryFile(c *gin.Context)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL