Documentation
¶
Index ¶
- func ComparePasswords(hashedPwd string, plainPwd []byte, username string) bool
- func CreateAddress(c *gin.Context)
- func CreateDeviceClass(c *gin.Context)
- func CreateGroup(key string) func(c *gin.Context)
- func CreateImage(conf *config.Config) func(c *gin.Context)
- func CreateOption(c *gin.Context)
- func CreatePool(c *gin.Context)
- func CreateUser(c *gin.Context)
- func DeleteAddress(c *gin.Context)
- func DeleteDeviceClass(c *gin.Context)
- func DeleteGroup(c *gin.Context)
- func DeleteImage(c *gin.Context)
- func DeleteOption(c *gin.Context)
- func DeletePool(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func Error(c *gin.Context, status int, err error)
- func FindPool(ip string) (*models.PoolWithAddresses, error)
- func GetAddress(c *gin.Context)
- func GetDeviceClass(c *gin.Context)
- func GetGroup(c *gin.Context)
- func GetImage(c *gin.Context)
- func GetInterfaceIpv4Addr(interfaceName string) (addr string, err error)
- func GetNextFreeIP(c *gin.Context)
- func GetOption(c *gin.Context)
- func GetPool(c *gin.Context)
- func GetPoolByRelay(c *gin.Context)
- func GetUser(c *gin.Context)
- func HashAndSalt(pwd []byte) string
- func Ks(key string) func(c *gin.Context)
- func ListAddresses(c *gin.Context)
- func ListDeviceClasses(c *gin.Context)
- func ListGroups(c *gin.Context)
- func ListImages(c *gin.Context)
- func ListOptions(c *gin.Context)
- func ListPools(c *gin.Context)
- func ListUsers(c *gin.Context)
- func PostConfig(key string) func(c *gin.Context)
- func PostConfigCertificate(e *esxcli.Executor, item models.Address, decryptedPassword string, ...) error
- func PostConfigDomain(e *esxcli.Executor, item models.Address) error
- func PostConfigID(key string) func(c *gin.Context)
- func PostConfigNTP(e *esxcli.Executor, item models.Address, host *object.HostSystem, ...) error
- func PostConfigSSH(e *esxcli.Executor, item models.Address, host *object.HostSystem, ...) error
- func PostConfigSyslog(e *esxcli.Executor, item models.Address) error
- func PostConfigVlan(e *esxcli.Executor, item models.Address) error
- func ProvisioningWorker(item models.Address, key string)
- func SaveUploadedFile(file *multipart.FileHeader, dst string) (int64, error)
- func SearchAddress(c *gin.Context)
- func SearchDeviceClass(c *gin.Context)
- func SearchOption(c *gin.Context)
- func SearchPool(c *gin.Context)
- func SearchUser(c *gin.Context)
- func UpdateAddress(c *gin.Context)
- func UpdateDeviceClass(c *gin.Context)
- func UpdateGroup(key string) func(c *gin.Context)
- func UpdateImage(c *gin.Context)
- func UpdateOption(c *gin.Context)
- func UpdatePool(c *gin.Context)
- func UpdateUser(c *gin.Context)
- func Version(version string, commit string, date string) func(c *gin.Context)
- func WriteToFile(filename string, data string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComparePasswords ¶
func CreateAddress ¶
CreateAddress Create a new addresses @Summary Create a new addresses @Tags addresses @Accept json @Produce json @Param item body models.AddressForm true "Add ip address" @Success 200 {object} models.Address @Failure 400 {object} models.APIError @Failure 500 {object} models.APIError @Router /addresses [post]
func CreateDeviceClass ¶
CreateDeviceClass Create a new device class @Summary Create a new device class @Tags device_classes @Accept json @Produce json @Param item body models.DeviceClassForm true "Add an device class" @Success 200 {object} models.DeviceClass @Failure 400 {object} models.APIError @Failure 500 {object} models.APIError @Router /device_classes [post]
func CreateGroup ¶
CreateGroup Create a new groups @Summary Create a new group @Tags groups @Accept json @Produce json @Param item body models.GroupForm true "Add ip group" @Success 200 {object} models.Group @Failure 400 {object} models.APIError @Failure 500 {object} models.APIError @Router /groups [post]
func CreateImage ¶
CreateImage Create a new images @Summary Create a new image @Tags images @Accept json @Produce json @Param item body models.ImageForm true "Add image" @Success 200 {object} models.Image @Failure 400 {object} models.APIError @Failure 500 {object} models.APIError @Router /images [post]
func CreateOption ¶
CreateOption Create a new options @Summary Create a new option @Tags options @Accept json @Produce json @Param item body models.OptionForm true "Add ip option" @Success 200 {object} models.Option @Failure 400 {object} models.APIError @Failure 500 {object} models.APIError @Router /options [post]
func CreatePool ¶
CreatePool Create a new pool @Summary Create a new pool @Tags pools @Accept json @Produce json @Param item body models.PoolForm true "Add ip pool" @Success 200 {object} models.Pool @Failure 400 {object} models.APIError @Failure 500 {object} models.APIError @Router /pools [post]
func CreateUser ¶
CreateUser Create a new user @Summary Create a new user @Tags users @Accept json @Produce json @Param item body models.UserForm true "Add an user" @Success 200 {object} models.User @Failure 400 {object} models.APIError @Failure 500 {object} models.APIError @Router /users [post]
func DeleteAddress ¶
DeleteAddress Remove an existing address @Summary Remove an existing address @Tags addresses @Accept json @Produce json @Param id path int true "Address ID" @Success 204 @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /addresses/{id} [delete]
func DeleteDeviceClass ¶
DeleteDeviceClass Remove an existing device class @Summary Remove an existing device class @Tags device_classes @Accept json @Produce json @Param id path int true "DeviceClass ID" @Success 204 @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /device_classes/{id} [delete]
func DeleteGroup ¶
DeleteGroup Remove an existing group @Summary Remove an existing group @Tags groups @Accept json @Produce json @Param id path int true "Group ID" @Success 204 @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /groups/{id} [delete]
func DeleteImage ¶
DeleteImage Remove an existing image @Summary Remove an existing image @Tags images @Accept json @Produce json @Param id path int true "Image ID" @Success 204 @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /images/{id} [delete]
func DeleteOption ¶
DeleteOption Remove an existing option @Summary Remove an existing option @Tags options @Accept json @Produce json @Param id path int true "Option ID" @Success 204 @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /options/{id} [delete]
func DeletePool ¶
DeletePool Remove an existing pool @Summary Remove an existing pool @Tags pools @Accept json @Produce json @Param id path int true "Pool ID" @Success 204 @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /pools/{id} [delete]
func DeleteUser ¶
DeleteUser Remove an existing user @Summary Remove an existing user @Tags users @Accept json @Produce json @Param id path int true "User ID" @Success 204 @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /users/{id} [delete]
func GetAddress ¶
GetAddress Get an existing address @Summary Get an existing address @Tags addresses @Accept json @Produce json @Param id path int true "Address ID" @Success 200 {object} models.Address @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /addresses/{id} [get]
func GetDeviceClass ¶
GetDeviceClass Get an existing device class @Summary Get an existing device class @Tags device_classes @Accept json @Produce json @Param id path int true "DeviceClass ID" @Success 200 {object} models.DeviceClass @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /device_classes/{id} [get]
func GetGroup ¶
GetGroup Get an existing group @Summary Get an existing group @Tags groups @Accept json @Produce json @Param id path int true "Group ID" @Success 200 {object} models.Group @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /groups/{id} [get]
func GetImage ¶
GetImage Get an existing image @Summary Get an existing image @Tags images @Accept json @Produce json @Param id path int true "Image ID" @Success 200 {object} models.Image @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /images/{id} [get]
func GetInterfaceIpv4Addr ¶
func GetNextFreeIP ¶
GetNextFreeIP Get the next free lease from a pool @Summary Get the next free lease from a pool @Tags pools @Accept json @Produce json @Param id path int true "Pool ID" @Success 200 {object} models.Address @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /pools/{id}/next [get]
func GetOption ¶
GetOption Get an existing option @Summary Get an existing option @Tags options @Accept json @Produce json @Param id path int true "Option ID" @Success 200 {object} models.Option @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /options/{id} [get]
func GetPool ¶
GetPool Get an existing pool @Summary Get an existing pool @Tags pools @Accept json @Produce json @Param id path int true "Pool ID" @Success 200 {object} models.Pool @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /pools/{id} [get]
func GetPoolByRelay ¶
GetPoolByRelay Get an existing pool by the relay host IP @Summary Get an existing pool by the relay host IP @Tags pools @Accept json @Produce json @Param relay path string true "Relay host IP" @Success 200 {object} models.Pool @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /relay/{relay} [get]
func GetUser ¶
GetUser Get an existing user @Summary Get an existing user @Tags users @Accept json @Produce json @Param id path int true "User ID" @Success 200 {object} models.User @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /users/{id} [get]
func HashAndSalt ¶
func ListAddresses ¶
ListAddresses Get a list of all addresses @Summary Get all addresses @Tags addresses @Accept json @Produce json @Success 200 {array} models.Address @Failure 500 {object} models.APIError @Router /addresses [get]
func ListDeviceClasses ¶
ListDeviceClasses Get a list of all device classes @Summary Get all device classes @Tags device_classes @Accept json @Produce json @Success 200 {array} models.DeviceClass @Failure 500 {object} models.APIError @Router /device_classes [get]
func ListGroups ¶
ListGroups Get a list of all groups @Summary Get all groups @Tags groups @Accept json @Produce json @Success 200 {array} models.Group @Failure 500 {object} models.APIError @Router /groups [get]
func ListImages ¶
ListImages Get a list of all images @Summary Get all images @Tags images @Accept json @Produce json @Success 200 {array} models.Image @Failure 500 {object} models.APIError @Router /images [get]
func ListOptions ¶
ListOptions Get a list of all options @Summary Get all options @Tags options @Accept json @Produce json @Success 200 {array} models.Option @Failure 500 {object} models.APIError @Router /options [get]
func ListPools ¶
ListPools Get a list of all pools @Summary Get all pools @Tags pools @Accept json @Produce json @Success 200 {array} models.Pool @Failure 500 {object} models.APIError @Router /pools [get]
func ListUsers ¶
ListUsers Get a list of all users @Summary Get all users @Tags users @Accept json @Produce json @Success 200 {array} models.User @Failure 500 {object} models.APIError @Router /users [get]
func PostConfig ¶
func PostConfigCertificate ¶ added in v0.4.2
func PostConfigDomain ¶ added in v0.4.2
func PostConfigID ¶ added in v0.3.10
func PostConfigNTP ¶ added in v0.4.2
func PostConfigSSH ¶ added in v0.4.2
func PostConfigSyslog ¶ added in v0.4.2
func PostConfigVlan ¶ added in v0.4.2
func ProvisioningWorker ¶
func SaveUploadedFile ¶
func SaveUploadedFile(file *multipart.FileHeader, dst string) (int64, error)
func SearchAddress ¶
SearchAddress Search for an address @Summary Search for an address @Tags addresses @Accept json @Produce json @Param item body models.Address true "Fields to search for" @Success 200 {object} models.Address @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /addresses/search [post]
func SearchDeviceClass ¶
SearchDeviceClass Search for an device class @Summary Search for an device class @Tags device_classes @Accept json @Produce json @Param item body models.DeviceClass true "Fields to search for" @Success 200 {object} models.DeviceClass @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /device_classes/search [post]
func SearchOption ¶
SearchOption Search for an option @Summary Search for an option @Tags options @Accept json @Produce json @Param item body models.Option true "Fields to search for" @Success 200 {object} models.Option @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /options/search [post]
func SearchPool ¶
SearchPool Search for an pool @Summary Search for an pool @Tags pools @Accept json @Produce json @Param item body models.Pool true "Fields to search for" @Success 200 {object} models.Pool @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /pools/search [post]
func SearchUser ¶
SearchUser Search for a user @Summary Search for a user @Tags users @Accept json @Produce json @Param item body models.User true "Fields to search for" @Success 200 {object} models.User @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /users/search [post]
func UpdateAddress ¶
UpdateAddress Update an existing address @Summary Update an existing address @Tags addresses @Accept json @Produce json @Param id path int true "Address ID" @Param item body models.AddressForm true "Update an ip address" @Success 200 {object} models.Address @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /addresses/{id} [patch]
func UpdateDeviceClass ¶
UpdateDeviceClass Update an existing device class @Summary Update an existing device class @Tags device_classes @Accept json @Produce json @Param id path int true "DeviceClass ID" @Param item body models.DeviceClassForm true "Update an ip device class" @Success 200 {object} models.DeviceClass @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /device_classes/{id} [patch]
func UpdateGroup ¶
UpdateGroup Update an existing group @Summary Update an existing group @Tags groups @Accept json @Produce json @Param id path int true "Group ID" @Param item body models.GroupForm true "Update an group" @Success 200 {object} models.Group @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /groups/{id} [patch]
func UpdateImage ¶
UpdateImage Update an existing image @Summary Update an existing image @Tags images @Accept json @Produce json @Param id path int true "Image ID" @Param item body models.ImageForm true "Update an image" @Success 200 {object} models.Image @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /images/{id} [patch]
func UpdateOption ¶
UpdateOption Update an existing option @Summary Update an existing option @Tags options @Accept json @Produce json @Param id path int true "Option ID" @Param item body models.OptionForm true "Update an option" @Success 200 {object} models.Option @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /options/{id} [patch]
func UpdatePool ¶
UpdatePool Update an existing pool @Summary Update an existing pool @Tags pools @Accept json @Produce json @Param id path int true "Pool ID" @Param item body models.PoolForm true "Update an ip pool" @Success 200 {object} models.Pool @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /pools/{id} [patch]
func UpdateUser ¶
UpdateUser Update an existing user @Summary Update an existing user @Tags users @Accept json @Produce json @Param id path int true "User ID" @Param item body models.UserForm true "Update a user" @Success 200 {object} models.User @Failure 400 {object} models.APIError @Failure 404 {object} models.APIError @Failure 500 {object} models.APIError @Router /users/{id} [patch]
func WriteToFile ¶
Types ¶
This section is empty.