package
0.0.0-20240910131244-13d20f98e541
Repository: https://github.com/redhatinsights/edge-api.git
Documentation: pkg.go.dev
# Packages
FIXME: golangci-lint nolint:revive.
# Functions
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].
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].
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].
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].
CheckThirdPartyRepoName validates a repo name @Summary Checks to see if a ThirdParty repo Name exists.
CreateDeviceGroup is the route to create a new device group @Summary Creates a Device Group for an account.
CreateImage creates an image on hosted image builder.
CreateImageUpdate creates an update for an existing image on hosted image builder.
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].
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].
CreateRepoForImage creates a repo for an Image.
No description provided by the author
CreateThirdPartyRepo creates Third Party Repository @Summary Create Third Party Repository for an account.
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].
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].
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].
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].
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].
DeleteThirdPartyRepoByID deletes the third party repository using ID @Summary Delete third party repository using id.
DeviceCtx is a handler for Device requests.
DeviceGroupCtx is a handler to Device Group requests.
DeviceGroupDetailsCtx is a handler to Device Group Details requests.
DeviceGroupDeviceCtx is a handler to DeviceGroup Device requests.
GetAllContentSourcesRepositories return all the content source repositories if imageID is given in the url return the image of the corresponding repositories.
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.
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.
GetAllImageSetImagesView handle the image-set images view @ID GetAllImageSetImagesView @Summary Return the image-set images view list.
GetAllThirdPartyRepo return all the ThirdPartyRepo @Summary Lists all Third Party Repository for an account.
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.
GetDeviceDBInfo return the device data on EdgeAPI DB.
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].
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].
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].
GetDeviceImageInfo returns the information of a running image.
GetDevices return the device data both on Edge API and InventoryAPI @ID GetDevices @Summary Get All Devices.
GetDevicesView returns all data needed to display customers devices @ID GetDevicesView @Summary Return all data of Devices.
GetDevicesViewWithinDevices returns all data needed to display customers devices @ID GetDevicesViewWithinDevices @Summary Return all data of Devices.
No description provided by the author
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].
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].
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].
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].
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].
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].
GetImageSetImageView handle the image-set image view @ID GetImageSetImageView @Summary Return the image-set images view list.
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.
GetImageSetsDevicesByID gets all devices related to an imageset @ID GetImageSetsDevicesByID @Summary Return device ids for an image set.
GetImageSetsView return a list of image-sets view @Summary Return the list of image set view.
GetImageSetViewByID handle the image-set view @ID GetImageSetViewByID @Summary Return the image-set description view.
GetImageStatusByID returns the image status.
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.
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].
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].
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].
GetQueryParamsArray get the name of the service and return the supported query params.
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].
GetThirdPartyRepoByID gets the Third Party repository by ID from the database @Summary Get third party repository by id.
GetUpdateAvailableForDevice returns if exists update for the current image at the device.
GetUpdateByID obtains an update from the database for an orgID @Summary Gets a single requested update @ID GetUpdate @Description Gets a single requested update.
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].
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.
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].
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].
ImageByIDCtx is a handler for Image requests.
ImageByOSTreeHashCtx is a handler for Images but adds finding images by Ostree Hash.
ImageSetCtx provides the handler for Image Sets.
ImageSetImageViewCtx provides the handler for Image view details.
ImageSetViewCtx provides the handler for ImageSet view details.
InstallerByIDCtx is a handler for Installer ISOs requests.
InventoryGroupsCtx a handler for updates inventory groups requests.
ListAllImageSets return the list of image sets and images @ID ListAllImageSets @Summary Return the list of image sets.
MakeDeviceGroupsRouter adds support for device groups operations.
MakeDevicesRouter adds support for operations on update.
MakeImageSetsRouter adds support for operations on image-sets.
MakeImagesRouter adds support for operations on images.
MakeStorageRouter adds support for external storage.
No description provided by the author
MakeThirdPartyRepoRouter adds support for operation on ThirdPartyRepo.
MakeUpdatesRouter adds support for operations on update.
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].
No description provided by the author
ResumeCreateImage retries the image creation.
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].
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].
SendNotificationForImage TMP route to validate.
StatusOK returns a simple 200 status code.
ThirdPartyRepoCtx is a handler to Third Party Repository requests.
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].
UpdateCtx is a handler for Update requests.
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].
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].
UpdateTransactionCtx is a handler for Update transaction requests.
ValidateAccessPermission is a permission validator to routes requests.
No description provided by the author
ValidateGetAllDeviceGroupsFilterParams validate the query params that sent to /device-groups endpoint.
ValidateGetAllDevicesFilterParams validate the query params that sent to /devices endpoint.
ValidateGetAllImagesSearchParams validate the query params that sent to /images endpoint.
ValidateGetDevicesViewFilterParams validate the query parameters that sent to /devicesview endpoint.
ValidateGetUpdatesFilterParams validate the query params that sent to /updates endpoint.
ValidateQueryParams validate the query params from the url are supported.
ValidateStorageImage validate storage image and return the request path.
ValidateStorageUpdateTransaction validate storage update transaction and return the request path.
No description provided by the author
# Constants
UpdateContextKey is the key to Update Context handler.
# Variables
No description provided by the author
# Structs
CheckImageNameResponse indicates whether the image exists.
A CreateImageRequest model.
No description provided by the author
A CreateTPRepoRequest model.
DeviceContext implements context interfaces so we can shuttle around multiple values.
ImageDetail return the structure to inform package info to images.
ImageSetDevices contains the count and data for a list of Imagesets.
ImageSetImagePackages return info related to details on images from imageset.
ImageSetInstallerURL returns Imageset structure with last installer available.
InventoryData represents the structure of inventory response.
InventoryResponse represents the structure of inventory data on response.
No description provided by the author
No description provided by the author
ValidateUpdateResponse indicates whether or not the image can be updated.