Documentation ¶
Overview ¶
FIXME: golangci-lint nolint:gocritic,govet,revive,staticcheck,typecheck
FIXME: golangci-lint nolint:govet,revive
FIXME: golangci-lint nolint:errcheck,gosimple,govet,revive,typecheck
nolint:gocritic,govet,revive
FIXME: golangci-lint nolint:revive,unused
FIXME: golangci-lint nolint:revive
FIXME: golangci-lint nolint:revive
FIXME: golangci-lint nolint:gocritic,govet,revive
FIXME: golangci-lint nolint:gocritic,revive,typecheck
FIXME: golangci-lint nolint:govet,revive
Index ¶
- Constants
- Variables
- func AddDeviceGroupDevices(w http.ResponseWriter, r *http.Request)
- func AddUpdate(w http.ResponseWriter, r *http.Request)
- func CheckGroupName(w http.ResponseWriter, r *http.Request)
- func CheckImageName(w http.ResponseWriter, r *http.Request)
- func CheckThirdPartyRepoName(w http.ResponseWriter, r *http.Request)
- func CreateDeviceGroup(w http.ResponseWriter, r *http.Request)
- func CreateImage(w http.ResponseWriter, r *http.Request)
- func CreateImageUpdate(w http.ResponseWriter, r *http.Request)
- func CreateInstallerForImage(w http.ResponseWriter, r *http.Request)
- func CreateKickStartForImage(w http.ResponseWriter, r *http.Request)
- func CreateRepoForImage(w http.ResponseWriter, r *http.Request)
- func CreateRepoForImageJobHandler(ctx context.Context, job *jobs.Job)
- func CreateThirdPartyRepo(w http.ResponseWriter, r *http.Request)
- func DeleteDeviceGroupByID(w http.ResponseWriter, r *http.Request)
- func DeleteDeviceGroupManyDevices(w http.ResponseWriter, r *http.Request)
- func DeleteDeviceGroupOneDevice(w http.ResponseWriter, r *http.Request)
- func DeleteImage(w http.ResponseWriter, r *http.Request)
- func DeleteImageSet(w http.ResponseWriter, r *http.Request)
- func DeleteThirdPartyRepoByID(w http.ResponseWriter, r *http.Request)
- func DeviceCtx(next http.Handler) http.Handler
- func DeviceGroupCtx(next http.Handler) http.Handler
- func DeviceGroupDetailsCtx(next http.Handler) http.Handler
- func DeviceGroupDeviceCtx(next http.Handler) http.Handler
- func GetAllContentSourcesRepositories(w http.ResponseWriter, r *http.Request)
- func GetAllDeviceGroups(w http.ResponseWriter, r *http.Request)
- func GetAllImageSetImagesView(w http.ResponseWriter, r *http.Request)
- func GetAllImages(w http.ResponseWriter, r *http.Request)
- func GetAllThirdPartyRepo(w http.ResponseWriter, r *http.Request)
- func GetDevice(w http.ResponseWriter, r *http.Request)
- func GetDeviceDBInfo(w http.ResponseWriter, r *http.Request)
- func GetDeviceGroupByID(w http.ResponseWriter, r *http.Request)
- func GetDeviceGroupDetailsByID(w http.ResponseWriter, r *http.Request)
- func GetDeviceGroupDetailsByIDView(w http.ResponseWriter, r *http.Request)
- func GetDeviceImageInfo(w http.ResponseWriter, r *http.Request)
- func GetDeviceUpdateImagesFilters(r *http.Request) models.DeviceUpdateImagesFilters
- func GetDevices(w http.ResponseWriter, r *http.Request)
- func GetDevicesView(w http.ResponseWriter, r *http.Request)
- func GetDevicesViewWithinDevices(w http.ResponseWriter, r *http.Request)
- func GetEnforceEdgeGroups(w http.ResponseWriter, r *http.Request)
- func GetImageByID(w http.ResponseWriter, r *http.Request)
- func GetImageByOstree(w http.ResponseWriter, r *http.Request)
- func GetImageDetailsByID(w http.ResponseWriter, r *http.Request)
- func GetImageRepoFile(w http.ResponseWriter, r *http.Request)
- func GetImageRepoFileContent(w http.ResponseWriter, r *http.Request)
- func GetImageSetImageView(w http.ResponseWriter, r *http.Request)
- func GetImageSetViewByID(w http.ResponseWriter, r *http.Request)
- func GetImageSetsByID(w http.ResponseWriter, r *http.Request)
- func GetImageSetsDevicesByID(w http.ResponseWriter, r *http.Request)
- func GetImageSetsView(w http.ResponseWriter, r *http.Request)
- func GetImageStatusByID(w http.ResponseWriter, r *http.Request)
- func GetImageWithIdentity(w http.ResponseWriter, r *http.Request) (*models.Image, identity.XRHID, error)
- func GetInstallerIsoStorageContent(w http.ResponseWriter, r *http.Request)
- func GetInventoryGroupDevicesUpdateInfo(w http.ResponseWriter, r *http.Request)
- func GetMetadataForImage(w http.ResponseWriter, r *http.Request)
- func GetQueryParamsArray(endpoint string) []string
- func GetRepoForImage(w http.ResponseWriter, r *http.Request)
- func GetThirdPartyRepoByID(w http.ResponseWriter, r *http.Request)
- func GetUpdateAvailableForDevice(w http.ResponseWriter, r *http.Request)
- func GetUpdateByID(w http.ResponseWriter, r *http.Request)
- func GetUpdatePlaybook(w http.ResponseWriter, r *http.Request)
- func GetUpdateTransactionRepoFile(w http.ResponseWriter, r *http.Request)
- func GetUpdateTransactionRepoFileContent(w http.ResponseWriter, r *http.Request)
- func GetUpdates(w http.ResponseWriter, r *http.Request)
- func ImageByIDCtx(next http.Handler) http.Handler
- func ImageByOSTreeHashCtx(next http.Handler) http.Handler
- func ImageSetCtx(next http.Handler) http.Handler
- func ImageSetImageViewCtx(next http.Handler) http.Handler
- func ImageSetViewCtx(next http.Handler) http.Handler
- func InstallerByIDCtx(next http.Handler) http.Handler
- func InventoryGroupsCtx(next http.Handler) http.Handler
- func ListAllImageSets(w http.ResponseWriter, r *http.Request)
- func MakeDeviceGroupsRouter(sub chi.Router)
- func MakeDevicesRouter(sub chi.Router)
- func MakeImageSetsRouter(sub chi.Router)
- func MakeImagesRouter(sub chi.Router)
- func MakeStorageRouter(sub chi.Router)
- func MakeStorageRouterWithoutFilesService(sub chi.Router)
- func MakeThirdPartyRepoRouter(sub chi.Router)
- func MakeUpdatesRouter(sub chi.Router)
- func PostValidateUpdate(w http.ResponseWriter, r *http.Request)
- func ProcessInstallerJobHandler(ctx context.Context, job *jobs.Job)
- func ResumeCreateImage(w http.ResponseWriter, r *http.Request)
- func RetryCreateImage(w http.ResponseWriter, r *http.Request)
- func SendNotificationForDevice(w http.ResponseWriter, r *http.Request)
- func SendNotificationForImage(w http.ResponseWriter, r *http.Request)
- func StatusOK(w http.ResponseWriter, r *http.Request)
- func ThirdPartyRepoCtx(next http.Handler) http.Handler
- func UpdateAllDevicesFromGroup(w http.ResponseWriter, r *http.Request)
- func UpdateCtx(next http.Handler) http.Handler
- func UpdateDeviceGroup(w http.ResponseWriter, r *http.Request)
- func UpdateThirdPartyRepo(w http.ResponseWriter, r *http.Request)
- func UpdateTransactionCtx(next http.Handler) http.Handler
- func ValidateAccessPermission(next http.Handler) http.Handler
- func ValidateDeviceUpdateImagesFilterParams(next http.Handler) http.Handler
- func ValidateGetAllDeviceGroupsFilterParams(next http.Handler) http.Handler
- func ValidateGetAllDevicesFilterParams(next http.Handler) http.Handler
- func ValidateGetAllImagesSearchParams(next http.Handler) http.Handler
- func ValidateGetDevicesViewFilterParams(next http.Handler) http.Handler
- func ValidateGetUpdatesFilterParams(next http.Handler) http.Handler
- func ValidateQueryParams(endpoint string) func(next http.Handler) http.Handler
- func ValidateStorageImage(w http.ResponseWriter, r *http.Request) string
- func ValidateStorageUpdateTransaction(w http.ResponseWriter, r *http.Request) string
- func WithFileService(ctx context.Context, fileService services.FilesService) context.Context
- type CheckImageNameResponse
- type CreateImageRequest
- type CreateRepoForImageJob
- type CreateTPRepoRequest
- type DeviceContext
- type ImageDetail
- type ImageSetDevices
- type ImageSetImagePackages
- type ImageSetInstallerURL
- type InventoryData
- type InventoryResponse
- type ProcessInstallerJob
- type UpdateRepo
- type ValidateUpdateResponse
Constants ¶
const UpdateContextKey updateContextKey = iota
UpdateContextKey is the key to Update Context handler
Variables ¶
var UpdateTransCache = cache.NewMemoryCache[string, UpdateRepo](time.Duration(15 * time.Minute))
Functions ¶
func AddDeviceGroupDevices ¶
func AddDeviceGroupDevices(w http.ResponseWriter, r *http.Request)
AddDeviceGroupDevices Adds devices to device group @Summary Adds devices to device group @Description Adds devices to device group @Tags Device Groups @Accept json @Produce json @Param required_param query int true "An unique existing Device Group" example(1080) @Param required_param body body models.PostDeviceForDeviceGroupAPI true "request body" @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest @Failure 500 {object} errors.InternalServerError @Router /device-groups/{ID}/devices [post]
func AddUpdate ¶
func AddUpdate(w http.ResponseWriter, r *http.Request)
AddUpdate updates a device @Summary Executes a device update @ID UpdateDevice @Description Executes a device update @Tags Updates (Systems) @Accept json @Produce json @Param body body models.DevicesUpdateAPI true "devices uuids to update and optional target commit id" @Success 200 {object} models.UpdateAPI "The created device update" @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed" @Failure 500 {object} errors.InternalServerError "There was an internal server error" @Router /updates [post]
func CheckGroupName ¶
func CheckGroupName(w http.ResponseWriter, r *http.Request)
CheckGroupName Validates if a group name already exists @Summary Validates if a group name already exists @Description Validates if a group name already exists @Tags Device Groups @Accept json @Produce json @Param body body models.CheckGroupNameParamAPI true "request body" @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest @Failure 500 {object} errors.InternalServerError @Router /device-groups/checkName/{name} [get]
func CheckImageName ¶
func CheckImageName(w http.ResponseWriter, r *http.Request)
CheckImageName verifies that ImageName exists @Summary Update an image @ID CheckImageName @Description Create an updated ostree commit @Tags Images @Accept json @Produce json @Param body body models.CreateImageAPI true "request body" @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/checkImageName [post]
func CheckThirdPartyRepoName ¶
func CheckThirdPartyRepoName(w http.ResponseWriter, r *http.Request)
CheckThirdPartyRepoName validates a repo name @Summary Checks to see if a ThirdParty repo Name exists. @ID CheckThirdPartyRepoName @Description Checks to see if a ThirdParty repo Name exists. @Tags Third Party Repo @Accept json @Produce json @Param name path string true "ThirdParty repo Name" example(my_custom_repo) @Success 200 {object} models.CheckThirdPartyRepoNameAPI "The third party repository name check result" @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /thirdpartyrepo/checkName/{name} [get]
func CreateDeviceGroup ¶
func CreateDeviceGroup(w http.ResponseWriter, r *http.Request)
CreateDeviceGroup is the route to create a new device group @Summary Creates a Device Group for an account. @ID CreateDeviceGroup @Description Creates a Device Group for an account. @Tags Device Groups @Accept json @Produce json @Param body body models.CreateDeviceGroupAPI true "request body" @Success 200 {object} models.DeviceGroupAPI "The created device groups" @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /device-groups [post]
func CreateImage ¶
func CreateImage(w http.ResponseWriter, r *http.Request)
CreateImage creates an image on hosted image builder. It always creates a commit on Image Builder. Then we create our repo with the ostree commit and if needed, create the installer. @Summary Create an image @ID createImage @Description Create an ostree commit and/or installer ISO @Tags Images @Accept json @Produce json @Param body body models.CreateImageAPI true "request body" @Success 200 {object} models.ImageResponseAPI @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images [post]
func CreateImageUpdate ¶
func CreateImageUpdate(w http.ResponseWriter, r *http.Request)
CreateImageUpdate creates an update for an existing image on hosted image builder. CreateImage creates an image on hosted image builder. It always creates a commit on Image Builder. Then we create our repo with the ostree commit and if needed, create the installer. CreateImageUpdate godocs @Summary Update an image @ID CreateImageUpdate @Description Create an updated ostree commit @Tags Images @Accept json @Produce json @Param body body models.CreateImageAPI true "request body" @Param imageId path int true "Image ID" example(1234) @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/{imageId}/update [post]
func CreateInstallerForImage ¶
func CreateInstallerForImage(w http.ResponseWriter, r *http.Request)
CreateInstallerForImage creates an installer for an Image It requires a created image and a repo with a successful status @Summary Placeholder summary @ID CreateInstallerForImage @Description This is a placeholder description @Tags Images @Accept json @Produce json @Param body body models.CreateImageAPI true "request body" @Param imageId path int true "Image ID" example(1234) @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/{imageId}/installer [post]
func CreateKickStartForImage ¶
func CreateKickStartForImage(w http.ResponseWriter, r *http.Request)
CreateKickStartForImage creates a kickstart file for an existent image @Summary Placeholder summary @ID CreateKickStartForImage @Description This is a placeholder description @Tags Images @Accept json @Produce json @Param body body models.CreateImageAPI true "request body" @Param imageId path int true "Image ID" example(1234) @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/{imageId}/kickstart [post]
func CreateRepoForImage ¶
func CreateRepoForImage(w http.ResponseWriter, r *http.Request)
CreateRepoForImage creates a repo for an Image
func CreateThirdPartyRepo ¶
func CreateThirdPartyRepo(w http.ResponseWriter, r *http.Request)
CreateThirdPartyRepo creates Third Party Repository @Summary Create Third Party Repository for an account. @ID CreateThirdPartyRepo @Description Create Third Party Repository for an account. @Tags Third Party Repo @Accept json @Produce json @Param body body models.ThirdPartyRepoAPI true "the third party repository to create" @Success 200 {object} models.ThirdPartyRepoAPI "The created third party repository" @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /thirdpartyrepo [post]
func DeleteDeviceGroupByID ¶
func DeleteDeviceGroupByID(w http.ResponseWriter, r *http.Request)
DeleteDeviceGroupByID Deletes an existing device group @Summary Deletes an existing device group @Description Deletes an existing device group @Tags Device Groups @Accept json @Produce json @Param required_param query int true "A unique existing Device Group" example(1080) @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest @Failure 500 {object} errors.InternalServerError @Router /device-groups/{ID} [delete]
func DeleteDeviceGroupManyDevices ¶
func DeleteDeviceGroupManyDevices(w http.ResponseWriter, r *http.Request)
DeleteDeviceGroupManyDevices Deletes the requested devices from device-group @Summary Deletes the requested devices from device-group @Description Deletes the requested devices from device-group @Tags Device Groups @Accept json @Produce json @Param DeviceGroupID path int true "Identifier of the DeviceGroup" @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest @Failure 500 {object} errors.InternalServerError @Router /device-groups/{ID}/devices [delete]
func DeleteDeviceGroupOneDevice ¶
func DeleteDeviceGroupOneDevice(w http.ResponseWriter, r *http.Request)
DeleteDeviceGroupOneDevice Deletes the requested device from the device-group @Summary Deletes the requested device from the device-group @Description Deletes the requested device from the device-group @Tags Device Groups @Accept json @Produce json @Param DeviceGroupId path int true "Identifier of the Device Group" @Param DeviceId path int true "Identifier of the Device in a Device Group" @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest @Failure 500 {object} errors.InternalServerError @Router /device-groups/{ID}/devices/{deviceID} [delete]
func DeleteImage ¶
func DeleteImage(w http.ResponseWriter, r *http.Request)
DeleteImage soft deletes an image @Summary Placeholder summary @ID DeleteImage @Description This is a placeholder description @Tags Images @Accept json @Produce json @Param imageSetID path int true "Identifier of the ImageSet" @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/{imageId} [delete]
func DeleteImageSet ¶
func DeleteImageSet(w http.ResponseWriter, r *http.Request)
DeleteImageSet deletes an imageset @ID DeleteImageSet @Summary Delete Image Set @Description Delete Image Set @Tags Image-Sets @Accept json @Produce json @Param imageSetID path int true "Identifier of the ImageSet" @Success 200 {object} models.ImageSetAPI @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 404 {object} errors.NotFound "image-set was not found." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /image-sets/{imageSetID} [delete]
func DeleteThirdPartyRepoByID ¶
func DeleteThirdPartyRepoByID(w http.ResponseWriter, r *http.Request)
DeleteThirdPartyRepoByID deletes the third party repository using ID @Summary Delete third party repository using id. @ID DeleteThirdPartyRepoByID @Description Delete third party repository using id. @Tags Third Party Repo @Accept json @Produce json @Param ID query int true "An unique existing third party repository id." example(1080) @Success 200 {object} models.ThirdPartyRepoAPI "The deleted third party repository." @Failure 404 {object} errors.NotFound "The third party repository was not found." @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /thirdpartyrepo/{ID} [delete]
func DeviceGroupCtx ¶
DeviceGroupCtx is a handler to Device Group requests
func DeviceGroupDetailsCtx ¶
DeviceGroupDetailsCtx is a handler to Device Group Details requests
func DeviceGroupDeviceCtx ¶
DeviceGroupDeviceCtx is a handler to DeviceGroup Device requests
func GetAllContentSourcesRepositories ¶
func GetAllContentSourcesRepositories(w http.ResponseWriter, r *http.Request)
GetAllContentSourcesRepositories return all the content source repositories if imageID is given in the url return the image of the corresponding repositories
func GetAllDeviceGroups ¶
func GetAllDeviceGroups(w http.ResponseWriter, r *http.Request)
GetAllDeviceGroups Returns device groups for an orgID @Summary Returns device groups for an orgID @Description Returns device groups for an orgID @Tags Device Groups @Accept json @Produce json @Param sort_by query string false "Define sort fields: created_at, updated_at, name. To sort DESC use -" @Param name query string false "field: filter by name" @Param limit query int false "field: return number of image-set view until limit is reached. Default is 100." @Param offset query int false "field: return number of image-set view beginning at the offset." @Success 200 {object} models.DeviceGroup @Failure 400 {object} errors.BadRequest @Failure 500 {object} errors.InternalServerError @Router /device-groups [get]
func GetAllImageSetImagesView ¶
func GetAllImageSetImagesView(w http.ResponseWriter, r *http.Request)
GetAllImageSetImagesView handle the image-set images view @ID GetAllImageSetImagesView @Summary Return the image-set images view list. @Description Return the image-set images view list. @Tags Image-Sets @Accept json @Produce json @Param image_set_id path int true "the image-set id" @Param sort_by query string false "Define sort fields: created_at, version, To sort DESC use -" @Param status query string false "field: filter by status" @Param version query string false "field: filter by version" @Param limit query int false "field: return number of images until limit is reached. Default is 100." @Param offset query int false "field: return number of images beginning at the offset." @Success 200 {object} models.ImagesViewDataAPI @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 404 {object} errors.NotFound "The Image-Set was not found." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /image-sets/view/{image_set_id}/versions [get]
func GetAllImages ¶
func GetAllImages(w http.ResponseWriter, r *http.Request)
GetAllImages image objects from the database for an orgID @Summary Placeholder summary @ID GetAllImages @Description This is a placeholder description @Tags Images @Accept json @Produce json @Param limit query int false "Return number of images until limit is reached." example(1200) @Param offset query int false "Return number of images beginning at the offset" example(42) @Param sort_by query string false "created_at, distribution, name,status. To sort DESC use -before the fields" example(-created_at) @Param name query string false "Filter by name." example(cat) @Param status query string false "Filter by status." example(BUILDING) @Param distribution query string false "Filter by distribution." example(xrhel-92) @Param created_at query string false "Filter by creation date." example(2023-05-03) @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest " The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images [get]
func GetAllThirdPartyRepo ¶
func GetAllThirdPartyRepo(w http.ResponseWriter, r *http.Request)
GetAllThirdPartyRepo return all the ThirdPartyRepo @Summary Lists all Third Party Repository for an account. @ID GetAllThirdPartyRepo @Description Lists all Third Party Repository for an account. @Tags Third Party Repo @Accept json @Produce json @Param sort_by query string false "fields: created_at, name, updated_at. To sort DESC use - before the fields." example(-name) @Param name query string false "field: filter by name" example(my_repo) @Param created_at query string false "field: filter by creation date" example(2003-10-01) @Param updated_at query string false "field: filter by update date" example(2003-10-01) @Param limit query int false "field: return number of repositories until limit is reached." example(50) @Param offset query int false "field: return number of repositories beginning at the offset." example(0) @Success 200 {object} models.ThirdPartyRepoListAPI "The list of third party repositories response" @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /thirdpartyrepo [get]
func GetDevice ¶
func GetDevice(w http.ResponseWriter, r *http.Request)
GetDevice returns all available information that edge api has about a device It returns the information stored on our database and the device ID on our side, if any. Returns the information of a running image and previous image in case of a rollback. Returns updates available to a device. Returns updates transactions for that device, if any. @ID GetDevice @Summary Get a device by UUID. @Description Get a device by UUID. @Tags Devices (Systems) @Accept json @Produce json @Param DeviceUUID path string true "DeviceUUID" @Success 200 {object} models.DeviceDetailsAPI @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 404 {object} errors.NotFound "The device was not found." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /devices/{DeviceUUID} [get]
func GetDeviceDBInfo ¶
func GetDeviceDBInfo(w http.ResponseWriter, r *http.Request)
GetDeviceDBInfo return the device data on EdgeAPI DB
func GetDeviceGroupByID ¶
func GetDeviceGroupByID(w http.ResponseWriter, r *http.Request)
GetDeviceGroupByID Returns device groups for group identified by ID @Summary Returns devices groups for group identified by ID @Description Returns devices groups for group identified by ID @Tags Device Groups @Accept json @Produce json @Param required_param query int false "device group ID" @Success 200 {object} models.DeviceGroup @Failure 400 {object} errors.BadRequest @Failure 500 {object} errors.InternalServerError @Router /device-groups/{ID} [get]
func GetDeviceGroupDetailsByID ¶
func GetDeviceGroupDetailsByID(w http.ResponseWriter, r *http.Request)
GetDeviceGroupDetailsByID Returns details for group identified by ID @Summary Returns details for group identified by ID @Description Returns details for group identified by ID @Tags Device Groups @Accept json @Produce json @Param required_param query int true "device group ID" example(123) @Success 200 {object} models.DeviceGroup @Failure 400 {object} errors.BadRequest @Failure 500 {object} errors.InternalServerError @Router /device-groups/{ID}/details [get]
func GetDeviceGroupDetailsByIDView ¶
func GetDeviceGroupDetailsByIDView(w http.ResponseWriter, r *http.Request)
GetDeviceGroupDetailsByIDView Returns devices groups view for group identified by ID @Summary Returns device groups view for group identified by ID @Description Returns device groups view for group identified by ID @Tags Device Groups @Accept json @Produce json @Param required_param query int false "device group ID" @Success 200 {object} models.DeviceGroupViewAPI @Failure 400 {object} errors.BadRequest @Failure 500 {object} errors.InternalServerError @Router /device-groups/{ID}/view [get]
func GetDeviceImageInfo ¶
func GetDeviceImageInfo(w http.ResponseWriter, r *http.Request)
GetDeviceImageInfo returns the information of a running image
func GetDeviceUpdateImagesFilters ¶
func GetDeviceUpdateImagesFilters(r *http.Request) models.DeviceUpdateImagesFilters
func GetDevices ¶
func GetDevices(w http.ResponseWriter, r *http.Request)
GetDevices return the device data both on Edge API and InventoryAPI @ID GetDevices @Summary Get All Devices. @Description Get combined system data from Edge API and Inventory API @Tags Devices (Systems) @Accept json @Produce json @Param per_page query int false "field: maximum devices per page" @Param page query int false "field: which page to query from" @Param order_by query string false "field: order by display_name, updated or operating_system" @Param order_how query string false "field: choose to order ASC or DESC when order_by is being used" @Param hostname_or_id query string false "field: filter by hostname_or_id" @Success 200 {object} models.DeviceDetailsListAPI @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /devices [get]
func GetDevicesView ¶
func GetDevicesView(w http.ResponseWriter, r *http.Request)
GetDevicesView returns all data needed to display customers devices @ID GetDevicesView @Summary Return all data of Devices. @Description Return all data of Devices. @Tags Devices (Systems) @Accept json @Produce json @Param sort_by query string false "fields: name, uuid, update_available, image_id. To sort DESC use - before the fields." @Param name query string false "field: filter by name" @Param update_available query boolean false "field: filter by update_available" @Param uuid query string false "field: filter by uuid" @Param created_at query string false "field: filter by creation date" @Param image_id query int false "field: filter by image id" @Param limit query int false "field: return number of devices until limit is reached. Default is 100." @Param offset query int false "field: return number of devices begining at the offset." @Success 200 {object} models.DeviceViewListResponseAPI @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /devices/devicesview [get]
func GetDevicesViewWithinDevices ¶
func GetDevicesViewWithinDevices(w http.ResponseWriter, r *http.Request)
GetDevicesViewWithinDevices returns all data needed to display customers devices @ID GetDevicesViewWithinDevices @Summary Return all data of Devices. @Description Return all data of Devices. @Tags Devices (Systems) @Accept json @Produce json @Param body body models.FilterByDevicesAPI true "request body" @Param sort_by query string false "fields: name, uuid, update_available, image_id. To sort DESC use - before the fields." @Param name query string false "field: filter by name" @Param update_available query boolean false "field: filter by update_available" @Param uuid query string false "field: filter by uuid" @Param created_at query string false "field: filter by creation date" @Param image_id query int false "field: filter by image id" @Param limit query int false "field: return number of devices until limit is reached. Default is 100." @Param offset query int false "field: return number of devices beginning at the offset." @Success 200 {object} models.DeviceViewListResponseAPI @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /devices/devicesview [post]
func GetEnforceEdgeGroups ¶
func GetEnforceEdgeGroups(w http.ResponseWriter, r *http.Request)
GetEnforceEdgeGroups Returns whether the edge groups is enforced for the current organization @Summary Returns whether the edge groups is enforced for the current organization @Description Returns whether the edge groups is enforced for the current organization @Tags Device Groups @Accept json @Produce json @Success 200 {object} models.EnforceEdgeGroupsAPI @Failure 400 {object} errors.BadRequest @Router /device-groups/enforce-edge-groups [get]
func GetImageByID ¶
func GetImageByID(w http.ResponseWriter, r *http.Request)
GetImageByID obtains an image from the database for an orgID @Summary Placeholder summary @ID GetImageByID @Description This is a placeholder description @Tags Images @Accept json @Produce json @Param imageId path int true "Image ID" example(1234) @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/{imageId} [get]
func GetImageByOstree ¶
func GetImageByOstree(w http.ResponseWriter, r *http.Request)
GetImageByOstree obtains an image from the database for an orgID based on Commit Ostree @Summary Placeholder summary @ID GetImageByOstree @Description This is a placeholder description @Tags Images @Accept json @Produce json @Param ostreeCommitHash path string true "Ostree Commit Hash" example(9bd8dfe9856aa5bb1683e85f123bfe7785d45fbdb6f10372ff2c80e703400999) @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/{ostreeCommitHash}/info [get]
func GetImageDetailsByID ¶
func GetImageDetailsByID(w http.ResponseWriter, r *http.Request)
GetImageDetailsByID obtains an image from the database for an orgID @Summary Placeholder summary @ID GetImageDetailsByID @Description This is a placeholder description @Tags Images @Accept json @Produce json @Param imageId path int true "Image ID" example(1234) @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/{imageId}/details [get]
func GetImageRepoFile ¶
func GetImageRepoFile(w http.ResponseWriter, r *http.Request)
GetImageRepoFile return the content of an image commit repository path @Summary return the content of an image commit repository path @ID ContentImageCommitRepositoryPath @Description Bring the content for a image commit in a repository path @Tags Storage @Accept json @Produce octet-stream @Param imageID path string true "Id to identify Image" @Param repoFilePath path string true "path to file repository" @Success 200 {string} string "Stream object from file content" @Failure 400 {object} errors.BadRequest @Failure 404 {object} errors.NotFound @Failure 500 {object} errors.InternalServerError @Router /storage/images-repos/{imageID}/{repoFilePath} [get]
func GetImageRepoFileContent ¶
func GetImageRepoFileContent(w http.ResponseWriter, r *http.Request)
GetImageRepoFileContent redirect to a signed url of an image commit repository path content @Summary redirect to a signed url of an image commit repository path content @Description Redirect request to a signed and valid url for an image commit repository from the path content @ID RedirectSignedImageCommitRepository @Tags Storage @Accept json @Produce json @Param imageID path string true "Id to identify Image" @Param repoFilePath path string true "path to file repository" @Success 303 {string} url response @Failure 400 {object} errors.BadRequest @Failure 404 {object} errors.NotFound @Failure 500 {object} errors.InternalServerError @Router /storage/images-repos/{imageID}/content/{repoFilePath} [get]
func GetImageSetImageView ¶
func GetImageSetImageView(w http.ResponseWriter, r *http.Request)
GetImageSetImageView handle the image-set image view @ID GetImageSetImageView @Summary Return the image-set images view list. @Description Return the image-set images view list. @Tags Image-Sets @Accept json @Produce json @Param imageSetID path int true "the image set id" @Param imageID path int true "the image id" @Success 200 {object} models.ImageSetImageIDViewAPI @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 404 {object} errors.NotFound "The Image-Set or Image was not found." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /image-sets/view/{imageSetID}/versions/{imageID} [get]
func GetImageSetViewByID ¶
func GetImageSetViewByID(w http.ResponseWriter, r *http.Request)
GetImageSetViewByID handle the image-set view @ID GetImageSetViewByID @Summary Return the image-set description view. @Description Return the image-set description view. @Tags Image-Sets @Accept json @Produce json @Param image_set_id path int true "the image-set id" @Success 200 {object} models.ImageSetIDViewAPI @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 404 {object} errors.NotFound "The Image-Set was not found." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /image-sets/view/{image_set_id} [get]
func GetImageSetsByID ¶
func GetImageSetsByID(w http.ResponseWriter, r *http.Request)
GetImageSetsByID returns the list of Image Sets by a given Image Set ID @ID GetImageSetsByID @Summary Get an image-set @Description Get image set by ID @Tags Image-Sets @Accept json @Produce json @Param imageSetID path int true "Image Set ID" @Param sort_by query string false "Define sort fields: created_at, updated_at, name. To sort DESC use -" @Param name query string false "field: filter by name" @Param status query string false "field: filter by status" @Param version query string false "field: filter by version" @Param limit query int false "field: return number of image-set view until limit is reached. Default is 100." @Param offset query int false "field: return number of image-set view beginning at the offset." @Success 200 {object} models.ImageSetDetailsResponseAPI @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 404 {object} errors.NotFound "image-set was not found." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /image-sets/{imageSetID}/ [get]
func GetImageSetsDevicesByID ¶
func GetImageSetsDevicesByID(w http.ResponseWriter, r *http.Request)
GetImageSetsDevicesByID gets all devices related to an imageset @ID GetImageSetsDevicesByID @Summary Return device ids for an image set. @Description Return device ids for an image set. @Tags Image-Sets @Accept json @Produce json @Param ImageSetId path int true "Identifier of the ImageSet" @Success 200 {object} models.ImageSetDevicesAPI @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 404 {object} errors.NotFound "The Image Set ID was not found." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /image-sets/{imageSetID}/devices [get]
func GetImageSetsView ¶
func GetImageSetsView(w http.ResponseWriter, r *http.Request)
GetImageSetsView return a list of image-sets view @Summary Return the list of image set view. @Description Return the list of image set view. @Tags Image-Sets @Accept json @Produce json @Param sort_by query string false "Define sort fields: created_at, updated_at, name. To sort DESC use -" @Param name query string false "field: filter by name" @Param status query string false "field: filter by status" @Param id query int false "field: filter by id" @Param limit query int false "field: return number of image-set view until limit is reached. Default is 30." @Param offset query int false "field: return number of image-set view beginning at the offset." @Success 200 {object} models.ImageSetsViewResponseAPI @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /image-sets/view [get]
func GetImageStatusByID ¶
func GetImageStatusByID(w http.ResponseWriter, r *http.Request)
GetImageStatusByID returns the image status. @Summary Placeholder summary @ID GetImageStatusByID @Description This is a placeholder description @Tags Images @Accept json @Produce json @Param imageId path int true "Image Identifier" example(1234) @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/{imageId}/status [get]
func GetImageWithIdentity ¶
func GetImageWithIdentity(w http.ResponseWriter, r *http.Request) (*models.Image, identity.XRHID, error)
GetImageWithIdentity pre-populates the image with OrgID, requestID and also returns an identity header This is used by every image endpoint, so it reduces copy/paste risk
func GetInstallerIsoStorageContent ¶
func GetInstallerIsoStorageContent(w http.ResponseWriter, r *http.Request)
GetInstallerIsoStorageContent redirect to a signed installer iso url @Summary Redirect to a signed installer @ID RedirectSignedInstaller @Description This method will redirect request to a signed installer iso url @Tags Storage @Accept json @Produce octet-stream @Param installerID path string true "Installer ID" @Success 303 {string} string "URL to redirect" @Failure 400 {object} errors.BadRequest "The request send couln't be processed." @Failure 404 {object} errors.NotFound "installer not found." @Failure 500 {object} errors.InternalServerError @Router /storage/isos/{installerID}/ [get]
func GetInventoryGroupDevicesUpdateInfo ¶
func GetInventoryGroupDevicesUpdateInfo(w http.ResponseWriter, r *http.Request)
GetInventoryGroupDevicesUpdateInfo returns inventory group update info @Summary Gets the inventory group update info @ID GetInventoryGroupDevicesUpdateInfo @Description Gets the inventory group update info @Tags Updates (Systems) @Accept json @Produce json @Param GroupUUID path string true "a unique uuid to identify the inventory group" @Success 200 {object} models.InventoryGroupDevicesUpdateInfoResponseAPI "The requested inventory group update info" @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed" @Failure 404 {object} errors.NotFound "The requested inventory group was not found" @Failure 500 {object} errors.InternalServerError "There was an internal server error" @Router /inventory-groups/{GroupUUID}/update-info [get]
func GetMetadataForImage ¶
func GetMetadataForImage(w http.ResponseWriter, r *http.Request)
GetMetadataForImage gets the metadata from image-builder on /metadata endpoint @Summary Placeholder summary @ID GetMetadataForImage @Description This is a placeholder description @Tags Images @Accept json @Produce json @Param imageId path int true "Image ID" example(1234) @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/{imageId}/metadata [get]
func GetQueryParamsArray ¶
GetQueryParamsArray get the name of the service and return the supported query params
func GetRepoForImage ¶
func GetRepoForImage(w http.ResponseWriter, r *http.Request)
GetRepoForImage gets the repository for an Image @Summary Placeholder summary @ID GetRepoForImage @Description This is a placeholder description @Tags Images @Accept json @Produce json @Param imageId path int true "Image ID" example(1234) @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/{imageId}/repo [get]
func GetThirdPartyRepoByID ¶
func GetThirdPartyRepoByID(w http.ResponseWriter, r *http.Request)
GetThirdPartyRepoByID gets the Third Party repository by ID from the database @Summary Get third party repository by id. @ID GetThirdPartyRepoByID @Description Get third party repository by id. @Tags Third Party Repo @Accept json @Produce json @Param ID query int true "An unique existing third party repository id." example(1080) @Success 200 {object} models.ThirdPartyRepoAPI "The requested third party repository." @Failure 404 {object} errors.NotFound "The third party repository was not found." @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /thirdpartyrepo/{ID} [get]
func GetUpdateAvailableForDevice ¶
func GetUpdateAvailableForDevice(w http.ResponseWriter, r *http.Request)
GetUpdateAvailableForDevice returns if exists update for the current image at the device. @ID GetUpdateAvailableForDevice @Summary Return list of available updates for a device. @Description Return list of available updates for a device. @Tags Devices (Systems) @Accept json @Produce json @Param DeviceUUID path string true "DeviceUUID" @Param latest query string false "query the latest or all updates" @Success 200 {object} models.Image @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /updates/device/{DeviceUUID}/updates [get]
func GetUpdateByID ¶
func GetUpdateByID(w http.ResponseWriter, r *http.Request)
GetUpdateByID obtains an update from the database for an orgID @Summary Gets a single requested update @ID GetUpdate @Description Gets a single requested update. @Tags Updates (Systems) @Accept json @Produce json @Param updateID path int true "a unique ID to identify the update" example(1042) @Success 200 {object} models.UpdateAPI "The requested update" @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed" @Failure 404 {object} errors.NotFound "The requested update was not found" @Failure 500 {object} errors.InternalServerError "There was an internal server error" @Router /updates/{updateID} [get]
func GetUpdatePlaybook ¶
func GetUpdatePlaybook(w http.ResponseWriter, r *http.Request)
GetUpdatePlaybook returns the playbook for an update transaction @Summary returns the playbook yaml file for a system update @ID GetUpdatePlaybook @Description returns the update transaction playbook used for system update @Tags Updates (Systems) @Accept json @Produce plain @Param updateID path int true "a unique ID to identify the update the playbook belongs to" example(1042) @Success 200 {string} string "the playbook file content for an update" @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 404 {object} errors.NotFound "the device update was not found" @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /updates/{updateID}/update-playbook.yml [get]
func GetUpdateTransactionRepoFile ¶
func GetUpdateTransactionRepoFile(w http.ResponseWriter, r *http.Request)
GetUpdateTransactionRepoFile return the content of an update-transaction repository path @Summary Return the content od an update-transaction repository path @ID RedirectUpdateTransactionRepositoryContent @Description Request will get access to content of an update-transaction file based on the path @Tags Storage @Accept json @Produce octet-stream @Param updateTransactionID path int true "Update Transaction Id" @Param repoFilePath path int true "path for repository file" @Success 200 {string} string "Stream object from file content" @Failure 400 {object} errors.BadRequest @Failure 404 {object} errors.NotFound @Failure 500 {object} errors.InternalServerError @Router /storage/update-repos/{updateTransactionID}/{repoFilePath} [get]
func GetUpdateTransactionRepoFileContent ¶
func GetUpdateTransactionRepoFileContent(w http.ResponseWriter, r *http.Request)
GetUpdateTransactionRepoFileContent redirect to a signed url of an update-transaction repository path content @Summary redirect to a signed url of an update-transaction repository path content @ID RedirectUpdateTransactionRepositoryPath @Description Method will redirect to asigned url of an update-transaction based on repository content @Tags Storage @Accept json @Produce octet-stream @Param updateTransactionID path int true "id for update transaction id" @Param repoFilePath path string true "path to repository to be checked" @Success 303 {string} string "URL signed to be redirect" @Failure 400 {object} errors.BadRequest @Failure 404 {object} errors.NotFound @Failure 500 {object} errors.InternalServerError @Router /storage/update-repos/{updateTransactionID}/content/{repoFilePath} [get]
func GetUpdates ¶
func GetUpdates(w http.ResponseWriter, r *http.Request)
GetUpdates returns the updates for the device @Summary Gets all device updates @ID ListUpdates @Description Gets all device updates @Tags Updates (Systems) @Accept json @Produce json @Param limit query int false "field: return number of updates until limit is reached. Default is 30." example(20) @Param offset query int false "field: return updates beginning at the given offset." example(30) @Param sort_by query string false "fields: created_at, updated_at. To sort DESC use - before the fields." example(-created_at) @Param status query string false "field: filter by status" example(BUILDING) @Param created_at query string false "field: filter by creation date" example(2023-05-03) @Param updated_at query string false "field: filter by update date" example(2023-05-04) @Success 200 {object} []models.UpdateAPI "List of devices updates" @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /updates [get]
func ImageByIDCtx ¶
ImageByIDCtx is a handler for Image requests
func ImageByOSTreeHashCtx ¶
ImageByOSTreeHashCtx is a handler for Images but adds finding images by Ostree Hash
func ImageSetCtx ¶
ImageSetCtx provides the handler for Image Sets
func ImageSetImageViewCtx ¶
ImageSetImageViewCtx provides the handler for Image view details
func ImageSetViewCtx ¶
ImageSetViewCtx provides the handler for ImageSet view details
func InstallerByIDCtx ¶
InstallerByIDCtx is a handler for Installer ISOs requests
func InventoryGroupsCtx ¶
InventoryGroupsCtx a handler for updates inventory groups requests
func ListAllImageSets ¶
func ListAllImageSets(w http.ResponseWriter, r *http.Request)
ListAllImageSets return the list of image sets and images @ID ListAllImageSets @Summary Return the list of image sets. @Description Return the list of image sets. @Tags Image-Sets @Accept json @Produce json @Param sort_by query string false "Define sort fields: created_at, updated_at, name. To sort DESC use -" @Param name query string false "field: filter by name" @Param status query string false "field: filter by status" @Param limit query int false "field: return number of image-set view until limit is reached. Default is 100." @Param offset query int false "field: return number of image-set view beginning at the offset." @Success 200 {object} models.ImageSetsResponseAPI @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 404 {object} errors.NotFound "The Image Set was not found." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /image-sets [get]
func MakeDeviceGroupsRouter ¶
func MakeDeviceGroupsRouter(sub chi.Router)
MakeDeviceGroupsRouter adds support for device groups operations
func MakeDevicesRouter ¶
func MakeDevicesRouter(sub chi.Router)
MakeDevicesRouter adds support for operations on update
func MakeImageSetsRouter ¶
func MakeImageSetsRouter(sub chi.Router)
MakeImageSetsRouter adds support for operations on image-sets
func MakeImagesRouter ¶
func MakeImagesRouter(sub chi.Router)
MakeImagesRouter adds support for operations on images
func MakeStorageRouter ¶
func MakeStorageRouter(sub chi.Router)
MakeStorageRouter adds support for external storage
func MakeStorageRouterWithoutFilesService ¶
func MakeStorageRouterWithoutFilesService(sub chi.Router)
func MakeThirdPartyRepoRouter ¶
func MakeThirdPartyRepoRouter(sub chi.Router)
MakeThirdPartyRepoRouter adds support for operation on ThirdPartyRepo
func MakeUpdatesRouter ¶
func MakeUpdatesRouter(sub chi.Router)
MakeUpdatesRouter adds support for operations on update
func PostValidateUpdate ¶
func PostValidateUpdate(w http.ResponseWriter, r *http.Request)
PostValidateUpdate validate that images can be updated @Summary Validate if the images selection could be updated @ID PostValidateUpdate @Description Validate if the images selection could be updated @Tags Updates (Systems) @Accept json @Produce json @Param body body []models.ImageValidationRequestAPI true "request body" @Success 200 {object} models.ImageValidationResponseAPI "the validation result" @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed" @Failure 500 {object} errors.InternalServerError "There was an internal server error" @Router /updates/validate [post]
func ResumeCreateImage ¶
func ResumeCreateImage(w http.ResponseWriter, r *http.Request)
ResumeCreateImage retries the image creation
func RetryCreateImage ¶
func RetryCreateImage(w http.ResponseWriter, r *http.Request)
RetryCreateImage retries the image creation @Summary Retries building an image from scratch @ID RetryCreateImage @Description Create an updated ostree commit @Tags Images @Accept json @Produce json @Param body body models.CreateImageAPI true "request body" @Param imageId path int true "Image ID" example(1234) @Success 201 {object} models.SuccessPlaceholderResponse "Retry is being processed" @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /images/{imageId}/retry [post]
func SendNotificationForDevice ¶
func SendNotificationForDevice(w http.ResponseWriter, r *http.Request)
SendNotificationForDevice TMP route to validate @Summary Send a notification for a device update @ID SendNotificationForDevice @Description Send a notification for a device update @Tags Updates (Systems) @Accept json @Produce json @Param updateID path int true "a unique ID to identify the update" example(1042) @Success 200 {object} models.DeviceNotificationAPI "The notification payload" @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed" @Failure 404 {object} errors.NotFound "The requested update was not found" @Failure 500 {object} errors.InternalServerError "There was an internal server error" @Router /updates/{updateID}/notify [get]
func SendNotificationForImage ¶
func SendNotificationForImage(w http.ResponseWriter, r *http.Request)
SendNotificationForImage TMP route to validate
func StatusOK ¶
func StatusOK(w http.ResponseWriter, r *http.Request)
StatusOK returns a simple 200 status code
func ThirdPartyRepoCtx ¶
ThirdPartyRepoCtx is a handler to Third Party Repository requests
func UpdateAllDevicesFromGroup ¶
func UpdateAllDevicesFromGroup(w http.ResponseWriter, r *http.Request)
UpdateAllDevicesFromGroup Updates all devices that belong to a group @Summary Updates all devices that belong to a group @Description Updates all devices that belong to a group @Tags Device Groups @Accept json @Produce json @Param required_param query int true "Identifier of the DeviceGroup" @Success 200 {object} models.SuccessPlaceholderResponse @Failure 400 {object} errors.BadRequest @Failure 500 {object} errors.InternalServerError @Router /device-groups/{ID}/updateDevices [post]
func UpdateDeviceGroup ¶
func UpdateDeviceGroup(w http.ResponseWriter, r *http.Request)
UpdateDeviceGroup Updates the existing device group @Summary Updates the existing device group @Description Updates the existing device group @Tags Device Groups @Accept json @Produce json @Param required_param query int true "An unique existing Device Group" example(1080) @Param body body models.PutGroupNameParamAPI true "request body" @Success 200 {object} models.DeviceGroup @Failure 400 {object} errors.BadRequest @Failure 500 {object} errors.InternalServerError @Router /device-groups/{ID} [put]
func UpdateThirdPartyRepo ¶
func UpdateThirdPartyRepo(w http.ResponseWriter, r *http.Request)
UpdateThirdPartyRepo updates the existing third party repository @Summary Creates an Update for third party repository @ID CreateThirdPartyRepoUpdate @Description Creates an Update for third party repository @Tags Third Party Repo @Accept json @Produce json @Param ID query int true "An unique existing third party repository id." example(1080) @Param body body models.ThirdPartyRepoAPI true "The third party repository update data" @Success 200 {object} models.ThirdPartyRepoAPI "The updated third party repository." @Failure 404 {object} errors.NotFound "The third party repository was not found." @Failure 400 {object} errors.BadRequest "The request sent couldn't be processed." @Failure 500 {object} errors.InternalServerError "There was an internal server error." @Router /thirdpartyrepo/{ID} [put]
func UpdateTransactionCtx ¶
UpdateTransactionCtx is a handler for Update transaction requests
func ValidateAccessPermission ¶
ValidateAccessPermission is a permission validator to routes requests
func ValidateGetAllDeviceGroupsFilterParams ¶
ValidateGetAllDeviceGroupsFilterParams validate the query params that sent to /device-groups endpoint
func ValidateGetAllDevicesFilterParams ¶
ValidateGetAllDevicesFilterParams validate the query params that sent to /devices endpoint
func ValidateGetAllImagesSearchParams ¶
ValidateGetAllImagesSearchParams validate the query params that sent to /images endpoint
func ValidateGetDevicesViewFilterParams ¶
ValidateGetDevicesViewFilterParams validate the query parameters that sent to /devicesview endpoint
func ValidateGetUpdatesFilterParams ¶
ValidateGetUpdatesFilterParams validate the query params that sent to /updates endpoint
func ValidateQueryParams ¶
ValidateQueryParams validate the query params from the url are supported
func ValidateStorageImage ¶
func ValidateStorageImage(w http.ResponseWriter, r *http.Request) string
ValidateStorageImage validate storage image and return the request path
func ValidateStorageUpdateTransaction ¶
func ValidateStorageUpdateTransaction(w http.ResponseWriter, r *http.Request) string
ValidateStorageUpdateTransaction validate storage update transaction and return the request path
func WithFileService ¶
Types ¶
type CheckImageNameResponse ¶
type CheckImageNameResponse struct {
ImageExists bool `json:"ImageExists"`
}
CheckImageNameResponse indicates whether the image exists
type CreateImageRequest ¶
type CreateImageRequest struct { // The image to create. // // in: body // required: true Image *models.Image }
A CreateImageRequest model.
type CreateRepoForImageJob ¶
type CreateRepoForImageJob struct {
ImageID uint
}
type CreateTPRepoRequest ¶
type CreateTPRepoRequest struct {
Repo *models.ThirdPartyRepo
}
A CreateTPRepoRequest model.
type DeviceContext ¶
type DeviceContext struct {
DeviceUUID string
}
DeviceContext implements context interfaces so we can shuttle around multiple values
type ImageDetail ¶
type ImageDetail struct { Image *models.Image `json:"image"` AdditionalPackages int `json:"additional_packages"` Packages int `json:"packages"` UpdateAdded int `json:"update_added"` UpdateRemoved int `json:"update_removed"` UpdateUpdated int `json:"update_updated"` }
ImageDetail return the structure to inform package info to images
type ImageSetDevices ¶
ImageSetDevices contains the count and data for a list of Imagesets
type ImageSetImagePackages ¶
type ImageSetImagePackages struct { ImageSetData models.ImageSet `json:"image_set"` Images []ImageDetail `json:"images"` ImageBuildISOURL string `json:"image_build_iso_url"` }
ImageSetImagePackages return info related to details on images from imageset
type ImageSetInstallerURL ¶
type ImageSetInstallerURL struct { ImageSetData models.ImageSet `json:"image_set"` ImageBuildISOURL *string `json:"image_build_iso_url"` }
ImageSetInstallerURL returns Imageset structure with last installer available
type InventoryData ¶
type InventoryData struct { Total int Count int Page int PerPage int Results []InventoryResponse }
InventoryData represents the structure of inventory response
type InventoryResponse ¶
type InventoryResponse struct { ID string DeviceName string LastSeen string ImageInfo *models.ImageInfo }
InventoryResponse represents the structure of inventory data on response
type ProcessInstallerJob ¶
type UpdateRepo ¶
type ValidateUpdateResponse ¶
type ValidateUpdateResponse struct {
UpdateValid bool `json:"UpdateValid"`
}
ValidateUpdateResponse indicates whether or not the image can be updated