diff --git a/api.sh b/api.sh index 7071c783..0a7df723 100644 --- a/api.sh +++ b/api.sh @@ -5,6 +5,7 @@ npx @rtk-query/codegen-openapi ./api/config/imageBuilder.ts & npx @rtk-query/codegen-openapi ./api/config/rhsm.ts & npx @rtk-query/codegen-openapi ./api/config/contentSources.ts & npx @rtk-query/codegen-openapi ./api/config/provisioning.ts & +npx @rtk-query/codegen-openapi ./api/config/edge.ts & # Wait for all background jobs to finish wait diff --git a/api/config/edge.ts b/api/config/edge.ts new file mode 100644 index 00000000..3858d7ec --- /dev/null +++ b/api/config/edge.ts @@ -0,0 +1,13 @@ +import type { ConfigFile } from '@rtk-query/codegen-openapi'; + +const config: ConfigFile = { + schemaFile: '../schema/edge.json', + apiFile: '../../src/store/emptyEdgeApi.ts', + apiImport: 'emptyEdgeApi', + outputFile: '../../src/store/edgeApi.ts', + exportName: 'edgeApi', + hooks: true, + filterEndpoints: ['getAllImages', 'getImageStatusByID', 'getImageByID'], +}; + +export default config; diff --git a/api/schema/edge.json b/api/schema/edge.json new file mode 100644 index 00000000..3bfa3daf --- /dev/null +++ b/api/schema/edge.json @@ -0,0 +1,5722 @@ +{ + "components": { + "schemas": { + "CheckThirdPartyRepoName": { + "properties": { + "data": { + "allOf": [ + { + "$ref": "#/components/schemas/CheckThirdPartyRepoNameData" + } + ], + "description": "The data of third party repository check name result" + } + }, + "type": "object" + }, + "CheckThirdPartyRepoNameData": { + "properties": { + "isValid": { + "description": "The indicator of third party repository name validity", + "example": false, + "type": "boolean" + } + }, + "type": "object" + }, + "Commit": { + "properties": { + "arch": { + "description": "The commit architecture", + "example": "x86_64", + "type": "string" + } + }, + "type": "object" + }, + "CreateImage": { + "type": "object" + }, + "CustomPackages": { + "properties": { + "name": { + "description": "Name of custom packages", + "example": "cat", + "type": "string" + } + }, + "type": "object" + }, + "DeviceNotification": { + "properties": { + "application": { + "description": "application name", + "example": "edge-management", + "type": "string" + }, + "bundle": { + "description": "bundle name", + "example": "rhel", + "type": "string" + }, + "context": { + "description": "notification context payload data", + "example": "{\"CommitID\":\"31581\",\"UpdateID\":\"34916\"}", + "type": "string" + }, + "event_type": { + "description": "event type", + "example": "update-devices", + "type": "string" + }, + "events": { + "description": "notification events", + "items": { + "$ref": "#/components/schemas/EventNotification" + }, + "type": "array" + }, + "org_id": { + "description": "notification organization id", + "example": "11111111", + "type": "string" + }, + "recipients": { + "description": "notification recipients", + "items": { + "$ref": "#/components/schemas/RecipientNotification" + }, + "type": "array" + }, + "timestamp": { + "description": "notification timestamp", + "example": "2023-07-06T11:15:04Z", + "type": "string" + }, + "version": { + "description": "notification version", + "example": "v1.1.0", + "type": "string" + } + }, + "type": "object" + }, + "DevicesUpdate": { + "properties": { + "CommitID": { + "description": "Optional: The unique ID of the target commit", + "example": 1026, + "type": "integer" + }, + "DevicesUUID": { + "description": "List of devices uuids to update", + "example": [ + "b579a578-1a6f-48d5-8a45-21f2a656a5d4", + "1abb288d-6d88-4e2d-bdeb-fcc536be58ec" + ], + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "EventNotification": { + "properties": { + "payload": { + "description": "notification event payload", + "example": "{\"ID\":\"\"}", + "type": "string" + } + }, + "type": "object" + }, + "ImageResponse": { + "properties": { + "Account": { + "type": "string" + }, + "Commit": { + "$ref": "#/components/schemas/models.Commit" + }, + "CommitID": { + "type": "integer" + }, + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "CustomPackages": { + "items": { + "$ref": "#/components/schemas/models.Package" + }, + "type": "array" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "Description": { + "type": "string" + }, + "Distribution": { + "type": "string" + }, + "ID": { + "type": "integer" + }, + "ImageSetID": { + "description": "TODO: Wipe staging database and set to not nullable", + "type": "integer" + }, + "ImageType": { + "description": "TODO: Remove as soon as the frontend stops using", + "type": "string" + }, + "Installer": { + "$ref": "#/components/schemas/models.Installer" + }, + "InstallerID": { + "type": "integer" + }, + "Name": { + "type": "string" + }, + "OutputTypes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "Packages": { + "items": { + "$ref": "#/components/schemas/models.Package" + }, + "type": "array" + }, + "Status": { + "type": "string" + }, + "SystemsRunning": { + "description": "only for forms", + "type": "integer" + }, + "ThirdPartyRepositories": { + "items": { + "$ref": "#/components/schemas/models.ThirdPartyRepo" + }, + "type": "array" + }, + "TotalPackages": { + "description": "only for forms", + "type": "integer" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "Version": { + "type": "integer" + }, + "org_id": { + "type": "string" + }, + "request_id": { + "description": "storing for logging reference on resume", + "type": "string" + } + }, + "type": "object" + }, + "ImageValidationRequest": { + "properties": { + "ID": { + "description": "the unique ID of the image", + "example": 1029, + "type": "integer" + } + }, + "type": "object" + }, + "ImageValidationResponse": { + "properties": { + "UpdateValid": { + "example": true, + "type": "boolean" + } + }, + "type": "object" + }, + "RecipientNotification": { + "properties": { + "ignore_user_preferences": { + "description": "notification recipient to ignore user preferences", + "example": false, + "type": "boolean" + }, + "only_admins": { + "description": "notification recipient for only admins", + "example": false, + "type": "boolean" + }, + "users": { + "description": "notification recipient users", + "example": [ + "user-id" + ], + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "ThirdPartyRepo": { + "properties": { + "Description": { + "description": "The description of the third party repository", + "example": "a repo for some utilities", + "type": "string" + }, + "ID": { + "description": "The unique ID of the third party repository", + "example": 1028, + "type": "integer" + }, + "Name": { + "description": "The name of the third party repository", + "example": "my_custom_repo", + "type": "string" + }, + "URL": { + "description": "The URL of the third party repository", + "example": "https://public.example.com/my_custom_repo", + "type": "string" + } + }, + "type": "object" + }, + "ThirdPartyRepoList": { + "properties": { + "count": { + "description": "The overall count of the stored third party repositories", + "example": 25, + "type": "integer" + }, + "data": { + "description": "The data list of the third party repositories", + "items": { + "$ref": "#/components/schemas/ThirdPartyRepo" + }, + "type": "array" + } + }, + "type": "object" + }, + "Update": { + "properties": { + "ChangesRefs": { + "description": "Whether this update is changing device ostree ref", + "example": false, + "type": "boolean" + }, + "Commit": { + "allOf": [ + { + "$ref": "#/components/schemas/models.UpdateCommitAPI" + } + ], + "description": "The device Update target commit" + }, + "Devices": { + "description": "The current devices to update", + "items": { + "$ref": "#/components/schemas/UpdateDevice" + }, + "type": "array" + }, + "DispatchRecords": { + "description": "The current update dispatcher records", + "items": { + "$ref": "#/components/schemas/UpdateDispatchRecord" + }, + "type": "array" + }, + "ID": { + "description": "The unique ID of device update", + "example": 1026, + "type": "integer" + }, + "OldCommits": { + "description": "The device alternate commits from current device commit to target commit", + "items": { + "$ref": "#/components/schemas/models.UpdateCommitAPI" + }, + "type": "array" + }, + "Repo": { + "allOf": [ + { + "$ref": "#/components/schemas/UpdateRepo" + } + ], + "description": "The current repository built from this update" + }, + "Status": { + "description": "the current devices update status", + "example": "BUILDING", + "type": "string" + } + }, + "type": "object" + }, + "UpdateDevice": { + "properties": { + "Connected": { + "description": "Is the device connected", + "example": true, + "type": "boolean" + }, + "CurrentHash": { + "description": "the current device loaded commit hash", + "example": "0bd8dfe9856aa5bb1683e85f123bfe7785d45fbdb6f10372ff2c80e703400446", + "type": "string" + }, + "ID": { + "description": "The unique ID of the device", + "example": 1096, + "type": "integer" + }, + "ImageID": { + "description": "The current related image ID", + "example": 10778, + "type": "integer" + }, + "Name": { + "description": "the device inventory name", + "example": "teat-host.example.com", + "type": "string" + }, + "RHCClientID": { + "description": "The device RHC client ID", + "example": "5f9ac7d3-2264-4dad-a5a0-39c91c071c8a", + "type": "string" + }, + "UUID": { + "description": "The device inventory uuid", + "example": "54880418-b7c2-402e-93e5-287e168de7a6", + "type": "string" + }, + "UpdateAvailable": { + "description": "Whether an update is available", + "example": true, + "type": "boolean" + } + }, + "type": "object" + }, + "UpdateDispatchRecord": { + "properties": { + "DeviceID": { + "description": "The unique ID of the device being updated", + "example": 12789, + "type": "integer" + }, + "ID": { + "description": "The unique ID of the DispatcherRecord", + "example": 1089, + "type": "integer" + }, + "PlaybookDispatcherID": { + "description": "The playbook dispatcher job id", + "example": "c84cfd11-745c-4ee3-b87d-057a96732415", + "type": "string" + }, + "PlaybookURL": { + "description": "The generated playbook url", + "example": "https://console.redhat.com/api/edge/v1/updates/1026/update-playbook.yml", + "type": "string" + }, + "Reason": { + "description": "In case of failure the error reason returned by the playbook-dispatcher service", + "example": "", + "type": "string" + }, + "Status": { + "description": "The status of device update", + "example": "BUILDING", + "type": "string" + } + }, + "type": "object" + }, + "UpdateRepo": { + "properties": { + "ID": { + "description": "The unique ID of the update repository", + "example": 53218, + "type": "integer" + }, + "RepoStatus": { + "description": "The status of the device update repository building", + "example": "SUCCESS", + "type": "string" + }, + "RepoURL": { + "description": "The url of the update ostree repository", + "example": "https://storage-host.example.com/53218/upd/53218/repo", + "type": "string" + } + }, + "type": "object" + }, + "errors.BadRequest": { + "properties": { + "Code": { + "type": "string" + }, + "Status": { + "type": "integer" + }, + "Title": { + "type": "string" + } + }, + "type": "object" + }, + "errors.InternalServerError": { + "properties": { + "Code": { + "type": "string" + }, + "Status": { + "type": "integer" + }, + "Title": { + "type": "string" + } + }, + "type": "object" + }, + "errors.NotFound": { + "properties": { + "Code": { + "type": "string" + }, + "Status": { + "type": "integer" + }, + "Title": { + "type": "string" + } + }, + "type": "object" + }, + "gorm.DeletedAt": { + "properties": { + "time": { + "type": "string" + }, + "valid": { + "description": "Valid is true if Time is not NULL", + "type": "boolean" + } + }, + "type": "object" + }, + "models.CheckGroupNameParamAPI": { + "properties": { + "Name": { + "description": "device group name", + "example": "my-device-group", + "type": "string" + } + }, + "type": "object" + }, + "models.Commit": { + "properties": { + "Account": { + "type": "string" + }, + "Arch": { + "type": "string" + }, + "BlueprintToml": { + "type": "string" + }, + "BuildDate": { + "type": "string" + }, + "BuildNumber": { + "type": "integer" + }, + "ChangesRefs": { + "type": "boolean" + }, + "ComposeJobID": { + "type": "string" + }, + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "ID": { + "type": "integer" + }, + "ImageBuildHash": { + "type": "string" + }, + "ImageBuildParentHash": { + "type": "string" + }, + "ImageBuildTarURL": { + "type": "string" + }, + "InstalledPackages": { + "items": { + "$ref": "#/components/schemas/models.InstalledPackage" + }, + "type": "array" + }, + "OSTreeCommit": { + "type": "string" + }, + "OSTreeParentCommit": { + "type": "string" + }, + "OSTreeParentRef": { + "type": "string" + }, + "OSTreeRef": { + "type": "string" + }, + "Repo": { + "$ref": "#/components/schemas/models.Repo" + }, + "RepoID": { + "type": "integer" + }, + "Status": { + "type": "string" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "external": { + "type": "boolean" + }, + "name": { + "type": "string" + }, + "org_id": { + "type": "string" + } + }, + "type": "object" + }, + "models.CreateDeviceGroupAPI": { + "properties": { + "DevicesAPI": { + "description": "Devices of group", + "items": { + "$ref": "#/components/schemas/models.DeviceForDeviceGroupAPI" + }, + "type": "array" + }, + "name": { + "description": "the device group name", + "example": "my-device-group", + "type": "string" + }, + "type": { + "description": "the device group type", + "example": "static", + "type": "string" + } + }, + "type": "object" + }, + "models.Device": { + "properties": { + "Account": { + "type": "string" + }, + "AvailableHash": { + "type": "string" + }, + "Connected": { + "type": "boolean" + }, + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "CurrentHash": { + "type": "string" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "DevicesGroups": { + "items": { + "$ref": "#/components/schemas/models.DeviceGroup" + }, + "type": "array" + }, + "ID": { + "type": "integer" + }, + "ImageID": { + "type": "integer" + }, + "LastSeen": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "Name": { + "type": "string" + }, + "RHCClientID": { + "type": "string" + }, + "UUID": { + "type": "string" + }, + "UpdateAvailable": { + "type": "boolean" + }, + "UpdateTransaction": { + "items": { + "$ref": "#/components/schemas/models.UpdateTransaction" + }, + "type": "array" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "org_id": { + "type": "string" + } + }, + "type": "object" + }, + "models.DeviceAPI": { + "properties": { + "AvailableHash": { + "description": "Hash that available", + "example": "true", + "type": "string" + }, + "Connected": { + "description": "If Device connect of not", + "example": true, + "type": "boolean" + }, + "CurrentHash": { + "type": "string" + }, + "ImageID": { + "description": "image id of device`", + "example": 12834, + "type": "integer" + }, + "Name": { + "description": "Name of device", + "example": "device_name", + "type": "string" + }, + "RHCClientID": { + "description": "RHC Client ID", + "type": "string" + }, + "UUID": { + "description": "UUID of edge device", + "example": "ba-93ba-49a3-b4ae-a6c8acdc4736", + "type": "string" + }, + "UpdateAvailable": { + "description": "If there is Update available", + "example": true, + "type": "boolean" + }, + "UpdateTransaction": { + "items": { + "$ref": "#/components/schemas/models.UpdateTransaction" + }, + "type": "array" + }, + "booted": { + "description": "Booted status is referring to the LastDeployment of this device", + "example": true, + "type": "boolean" + }, + "deviceName": { + "type": "string" + }, + "devicesGroups": { + "description": "device groups", + "items": { + "$ref": "#/components/schemas/models.DeviceGroupAPI" + }, + "type": "array" + }, + "lastSeen": { + "description": "Last datetime that device updated", + "type": "string" + } + }, + "type": "object" + }, + "models.DeviceDetailsAPI": { + "properties": { + "Device": { + "allOf": [ + { + "$ref": "#/components/schemas/models.EdgeDeviceAPI" + } + ], + "description": "Details of device like name, LastSeen and more" + }, + "DeviceUpdating": { + "description": "If there is update to device", + "example": true, + "type": "boolean" + }, + "DevicesGroups": { + "description": "Device's groups", + "items": { + "$ref": "#/components/schemas/models.DeviceGroupAPI" + }, + "type": "array" + }, + "ImageInfo": { + "allOf": [ + { + "$ref": "#/components/schemas/models.ImageInfo" + } + ], + "description": "Information of device's image" + }, + "UpdateTransactions": { + "items": { + "$ref": "#/components/schemas/models.UpdateTransactionAPI" + }, + "type": "array" + } + }, + "type": "object" + }, + "models.DeviceDetailsListAPI": { + "properties": { + "count": { + "description": "total number of device", + "example": 40, + "type": "integer" + }, + "data": { + "description": "List of Devices", + "items": { + "$ref": "#/components/schemas/models.DeviceDetailsAPI" + }, + "type": "array" + }, + "total": { + "description": "total number of device", + "example": 40, + "type": "integer" + } + }, + "type": "object" + }, + "models.DeviceForDeviceGroupAPI": { + "properties": { + "UUID": { + "description": "device uuid", + "example": "68485bb8-6427-40ad-8711-93b6a5b4deac", + "type": "string" + } + }, + "type": "object" + }, + "models.DeviceGroup": { + "properties": { + "Account": { + "type": "string" + }, + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "Devices": { + "items": { + "$ref": "#/components/schemas/models.Device" + }, + "type": "array" + }, + "ID": { + "type": "integer" + }, + "Name": { + "type": "string" + }, + "Type": { + "type": "string" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "ValidUpdate": { + "type": "boolean" + }, + "org_id": { + "type": "string" + } + }, + "type": "object" + }, + "models.DeviceGroupAPI": { + "properties": { + "Devices": { + "description": "Devices that belong to the group", + "items": { + "$ref": "#/components/schemas/models.DeviceAPI" + }, + "type": "array" + }, + "Name": { + "description": "The device group name`", + "example": "device_group name", + "type": "string" + }, + "Type": { + "description": "The device group type``", + "example": "static", + "type": "string" + }, + "ValidUpdate": { + "description": "indicate if the update is valid", + "example": true, + "type": "boolean" + } + }, + "type": "object" + }, + "models.DeviceGroupViewAPI": { + "properties": { + "DeviceGroup": { + "allOf": [ + { + "$ref": "#/components/schemas/models.DeviceGroup" + } + ], + "description": "device group data" + }, + "DevicesView": { + "allOf": [ + { + "$ref": "#/components/schemas/models.DeviceGroupViewResponseAPI" + } + ], + "description": "device group detail" + } + }, + "type": "object" + }, + "models.DeviceGroupViewResponseAPI": { + "properties": { + "Devices": { + "allOf": [ + { + "$ref": "#/components/schemas/models.ImageSetImagePackagesAPI" + } + ], + "description": "all devices in a group" + }, + "Total": { + "description": "count of devices", + "example": 10, + "type": "integer" + } + }, + "type": "object" + }, + "models.DeviceViewAPI": { + "properties": { + "DeviceGroups": { + "description": "Device's groups", + "items": { + "$ref": "#/components/schemas/models.DeviceGroupAPI" + }, + "type": "array" + }, + "DeviceID": { + "description": "ID of device", + "example": 1913277, + "type": "integer" + }, + "DeviceName": { + "description": "Name of device", + "example": "device_name", + "type": "string" + }, + "DeviceUUID": { + "description": "UUID of Device", + "example": "a-8bdf-a21accb24925", + "type": "string" + }, + "DispatcherReason": { + "description": "Reason of Dispatch", + "type": "string" + }, + "DispatcherStatus": { + "description": "Status of Dispatch", + "type": "string" + }, + "ImageID": { + "description": "ID of image", + "example": 323241, + "type": "integer" + }, + "ImageName": { + "description": "Name of image", + "example": "image_name", + "type": "string" + }, + "ImageSetID": { + "description": "ID of image set", + "example": 33341, + "type": "integer" + }, + "LastSeen": { + "allOf": [ + { + "$ref": "#/components/schemas/models.EdgeAPITime" + } + ], + "description": "Last datetime that device updated" + }, + "Status": { + "description": "Status of device", + "example": "SUCCESS", + "type": "string" + }, + "UpdateAvailable": { + "description": "indicate if there is update to device", + "example": true, + "type": "boolean" + } + }, + "type": "object" + }, + "models.DeviceViewListAPI": { + "properties": { + "devices": { + "description": "List of Devices", + "items": { + "$ref": "#/components/schemas/models.DeviceViewAPI" + }, + "type": "array" + }, + "total": { + "description": "Total number of device", + "example": 40, + "type": "integer" + } + }, + "type": "object" + }, + "models.DispatchRecord": { + "properties": { + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "Device": { + "$ref": "#/components/schemas/models.Device" + }, + "DeviceID": { + "type": "integer" + }, + "ID": { + "type": "integer" + }, + "PlaybookDispatcherID": { + "type": "string" + }, + "PlaybookURL": { + "type": "string" + }, + "Reason": { + "type": "string" + }, + "Status": { + "type": "string" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + } + }, + "type": "object" + }, + "models.DispatchRecordAPI": { + "properties": { + "Device": { + "$ref": "#/components/schemas/models.DeviceAPI" + }, + "DeviceID": { + "description": "ID of device", + "example": 1913277, + "type": "integer" + }, + "PlaybookDispatcherID": { + "type": "string" + }, + "PlaybookURL": { + "type": "string" + }, + "Reason": { + "type": "string" + }, + "Status": { + "description": "Status of device", + "example": "SUCCESS", + "type": "string" + } + }, + "type": "object" + }, + "models.EdgeAPITime": { + "properties": { + "time": { + "type": "string" + }, + "valid": { + "description": "Valid is true if Time is not NULL", + "type": "boolean" + } + }, + "type": "object" + }, + "models.EdgeDeviceAPI": { + "properties": { + "AvailableHash": { + "description": "Hash that available", + "example": "true", + "type": "string" + }, + "Connected": { + "description": "If Device connect of not", + "example": true, + "type": "boolean" + }, + "CurrentHash": { + "type": "string" + }, + "DevicesGroups": { + "description": "device groups", + "items": { + "$ref": "#/components/schemas/models.DeviceGroupAPI" + }, + "type": "array" + }, + "ImageID": { + "description": "image id of device", + "example": 12834, + "type": "integer" + }, + "LastSeen": { + "allOf": [ + { + "$ref": "#/components/schemas/models.EdgeAPITime" + } + ], + "description": "Last datetime that device updated" + }, + "Name": { + "description": "Name of Edge Device", + "type": "string" + }, + "RHCClientID": { + "description": "RHC Client ID", + "type": "string" + }, + "UUID": { + "description": "UUID of edge device", + "example": "ba-93ba-49a3-b4ae-a6c8acdc4736", + "type": "string" + }, + "UpdateAvailable": { + "description": "If there is update available", + "example": true, + "type": "boolean" + }, + "UpdateTransaction": { + "items": { + "$ref": "#/components/schemas/models.UpdateTransaction" + }, + "type": "array" + }, + "booted": { + "description": "Booted status is referring to the LastDeployment of this device", + "example": true, + "type": "boolean" + }, + "deviceName": { + "description": "The device name", + "example": "test_device_api_static", + "type": "string" + } + }, + "type": "object" + }, + "models.FilterByDevicesAPI": { + "properties": { + "devices_uuid": { + "description": "Devices UUID", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "models.Image": { + "properties": { + "Account": { + "type": "string" + }, + "Commit": { + "$ref": "#/components/schemas/models.Commit" + }, + "CommitID": { + "type": "integer" + }, + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "CustomPackages": { + "items": { + "$ref": "#/components/schemas/models.Package" + }, + "type": "array" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "Description": { + "type": "string" + }, + "Distribution": { + "type": "string" + }, + "ID": { + "type": "integer" + }, + "ImageSetID": { + "description": "TODO: Wipe staging database and set to not nullable", + "type": "integer" + }, + "ImageType": { + "description": "TODO: Remove as soon as the frontend stops using", + "type": "string" + }, + "Installer": { + "$ref": "#/components/schemas/models.Installer" + }, + "InstallerID": { + "type": "integer" + }, + "Name": { + "type": "string" + }, + "OutputTypes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "Packages": { + "items": { + "$ref": "#/components/schemas/models.Package" + }, + "type": "array" + }, + "Status": { + "type": "string" + }, + "SystemsRunning": { + "description": "only for forms", + "type": "integer" + }, + "ThirdPartyRepositories": { + "items": { + "$ref": "#/components/schemas/models.ThirdPartyRepo" + }, + "type": "array" + }, + "TotalPackages": { + "description": "only for forms", + "type": "integer" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "Version": { + "type": "integer" + }, + "org_id": { + "type": "string" + }, + "request_id": { + "description": "storing for logging reference on resume", + "type": "string" + } + }, + "type": "object" + }, + "models.ImageDetailAPI": { + "properties": { + "additional_packages": { + "description": "Number of additional packages", + "example": 3, + "type": "integer" + }, + "image": { + "$ref": "#/components/schemas/models.Image" + }, + "packages": { + "description": "Number of packages", + "example": 3, + "type": "integer" + }, + "update_added": { + "description": "Number of added update", + "example": 3, + "type": "integer" + }, + "update_removed": { + "description": "Number of removed update", + "example": 2, + "type": "integer" + }, + "update_updated": { + "description": "Number of updated update", + "example": 3, + "type": "integer" + } + }, + "type": "object" + }, + "models.ImageInfo": { + "properties": { + "Count": { + "type": "integer" + }, + "Image": { + "$ref": "#/components/schemas/models.Image" + }, + "RollbackImage": { + "$ref": "#/components/schemas/models.Image" + }, + "UpdatesAvailable": { + "items": { + "$ref": "#/components/schemas/models.ImageUpdateAvailable" + }, + "type": "array" + } + }, + "type": "object" + }, + "models.ImageSetAPI": { + "properties": { + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "ID": { + "type": "integer" + }, + "Images": { + "description": "images of image set", + "items": { + "$ref": "#/components/schemas/models.Image" + }, + "type": "array" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "name": { + "description": "the image set name", + "example": "my-edge-image", + "type": "string" + }, + "version": { + "description": "the image set version", + "example": 1, + "type": "integer" + } + }, + "type": "object" + }, + "models.ImageSetDetailsResponseAPI": { + "properties": { + "Count": { + "description": "count of image-sets", + "example": 10, + "type": "integer" + }, + "Data": { + "allOf": [ + { + "$ref": "#/components/schemas/models.ImageSetImagePackagesAPI" + } + ], + "description": "all data of image-sets" + } + }, + "type": "object" + }, + "models.ImageSetDevicesAPI": { + "properties": { + "Count": { + "description": "count of image-set's devices", + "example": 10, + "type": "integer" + }, + "Data": { + "description": "Data of image set's devices", + "items": { + "type": "string" + }, + "type": "array" + } + }, + "type": "object" + }, + "models.ImageSetIDViewAPI": { + "properties": { + "ImageBuildIsoURL": { + "description": "The image-set latest available image ISO", + "example": "/api/edge/v1/storage/isos/432", + "type": "string" + }, + "ImageSet": { + "allOf": [ + { + "$ref": "#/components/schemas/models.ImageSetAPI" + } + ], + "description": "image set data" + }, + "LastImageDetails": { + "allOf": [ + { + "$ref": "#/components/schemas/models.ImageDetailAPI" + } + ], + "description": "The image-set latest image details" + } + }, + "type": "object" + }, + "models.ImageSetImageIDViewAPI": { + "properties": { + "ImageBuildIsoURL": { + "description": "The image-set latest available image ISO", + "example": "/api/edge/v1/storage/isos/432", + "type": "string" + }, + "ImageDetails": { + "allOf": [ + { + "$ref": "#/components/schemas/models.ImageDetailAPI" + } + ], + "description": "the requested image details" + }, + "ImageSet": { + "allOf": [ + { + "$ref": "#/components/schemas/models.ImageSetAPI" + } + ], + "description": "image set data" + } + }, + "type": "object" + }, + "models.ImageSetImagePackagesAPI": { + "properties": { + "image_build_iso_url": { + "description": "The image-set latest available image ISO", + "example": "/api/edge/v1/storage/isos/432", + "type": "string" + }, + "image_set": { + "allOf": [ + { + "$ref": "#/components/schemas/models.ImageSetAPI" + } + ], + "description": "image set data" + }, + "images": { + "description": "image detail", + "items": { + "$ref": "#/components/schemas/models.ImageDetailAPI" + }, + "type": "array" + } + }, + "type": "object" + }, + "models.ImageSetInstallerURLAPI": { + "properties": { + "image_build_iso_url": { + "description": "The image-set latest available image ISO", + "example": "/api/edge/v1/storage/isos/432", + "type": "string" + }, + "image_set": { + "allOf": [ + { + "$ref": "#/components/schemas/models.ImageSetAPI" + } + ], + "description": "image set data" + } + }, + "type": "object" + }, + "models.ImageSetView": { + "properties": { + "Distribution": { + "type": "string" + }, + "ID": { + "type": "integer" + }, + "ImageBuildIsoURL": { + "type": "string" + }, + "ImageID": { + "type": "integer" + }, + "Name": { + "type": "string" + }, + "OutputTypes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "Status": { + "type": "string" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "Version": { + "type": "integer" + } + }, + "type": "object" + }, + "models.ImageSetsResponseAPI": { + "properties": { + "Count": { + "description": "count of image-sets", + "example": 10, + "type": "integer" + }, + "Data": { + "description": "all data of image-sets", + "items": { + "$ref": "#/components/schemas/models.ImageSetInstallerURLAPI" + }, + "type": "array" + } + }, + "type": "object" + }, + "models.ImageSetsViewResponseAPI": { + "properties": { + "count": { + "description": "count of image-sets", + "example": 10, + "type": "integer" + }, + "data": { + "description": "data of image set view", + "items": { + "$ref": "#/components/schemas/models.ImageSetView" + }, + "type": "array" + } + }, + "type": "object" + }, + "models.ImageUpdateAvailable": { + "properties": { + "CanUpdate": { + "type": "boolean" + }, + "Image": { + "$ref": "#/components/schemas/models.Image" + }, + "PackageDiff": { + "$ref": "#/components/schemas/models.PackageDiff" + } + }, + "type": "object" + }, + "models.ImageView": { + "properties": { + "CommitCheckSum": { + "type": "string" + }, + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "ID": { + "type": "integer" + }, + "ImageBuildIsoURL": { + "type": "string" + }, + "ImageType": { + "type": "string" + }, + "Name": { + "type": "string" + }, + "OutputTypes": { + "items": { + "type": "string" + }, + "type": "array" + }, + "Status": { + "type": "string" + }, + "Version": { + "type": "integer" + } + }, + "type": "object" + }, + "models.ImagesViewDataAPI": { + "properties": { + "count": { + "description": "total number of image view data", + "example": 100, + "type": "integer" + }, + "data": { + "items": { + "$ref": "#/components/schemas/models.ImageView" + }, + "type": "array" + } + }, + "type": "object" + }, + "models.InstalledPackage": { + "properties": { + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "ID": { + "type": "integer" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "arch": { + "type": "string" + }, + "commits": { + "items": { + "$ref": "#/components/schemas/models.Commit" + }, + "type": "array" + }, + "epoch": { + "type": "string" + }, + "name": { + "type": "string" + }, + "release": { + "type": "string" + }, + "sigmd5": { + "type": "string" + }, + "signature": { + "type": "string" + }, + "type": { + "type": "string" + }, + "version": { + "type": "string" + } + }, + "type": "object" + }, + "models.Installer": { + "properties": { + "Account": { + "type": "string" + }, + "Checksum": { + "type": "string" + }, + "ComposeJobID": { + "type": "string" + }, + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "ID": { + "type": "integer" + }, + "ImageBuildISOURL": { + "type": "string" + }, + "SshKey": { + "type": "string" + }, + "Status": { + "type": "string" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "Username": { + "type": "string" + }, + "org_id": { + "type": "string" + } + }, + "type": "object" + }, + "models.Package": { + "properties": { + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "ID": { + "type": "integer" + }, + "Name": { + "type": "string" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + } + }, + "type": "object" + }, + "models.PackageDiff": { + "properties": { + "Added": { + "items": { + "$ref": "#/components/schemas/models.InstalledPackage" + }, + "type": "array" + }, + "Removed": { + "items": { + "$ref": "#/components/schemas/models.InstalledPackage" + }, + "type": "array" + }, + "Upgraded": { + "items": { + "$ref": "#/components/schemas/models.InstalledPackage" + }, + "type": "array" + } + }, + "type": "object" + }, + "models.PostDeviceForDeviceGroupAPI": { + "properties": { + "Name": { + "description": "device name", + "example": "localhost", + "type": "string" + }, + "UUID": { + "description": "device uuid", + "example": "68485bb8-6427-40ad-8711-93b6a5b4deac", + "type": "string" + } + }, + "type": "object" + }, + "models.PutGroupNameParamAPI": { + "properties": { + "Name": { + "description": "device group name", + "example": "my-device-group", + "type": "string" + }, + "Type": { + "description": "device group type", + "example": "static", + "type": "string" + } + }, + "type": "object" + }, + "models.Repo": { + "properties": { + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "ID": { + "type": "integer" + }, + "RepoStatus": { + "type": "string" + }, + "RepoURL": { + "type": "string" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + } + }, + "type": "object" + }, + "models.SuccessPlaceholderResponse": { + "type": "object" + }, + "models.ThirdPartyRepo": { + "properties": { + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "Description": { + "type": "string" + }, + "ID": { + "type": "integer" + }, + "Images": { + "items": { + "$ref": "#/components/schemas/models.Image" + }, + "type": "array" + }, + "Name": { + "type": "string" + }, + "URL": { + "type": "string" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "account": { + "type": "string" + }, + "distribution_arch": { + "type": "string" + }, + "distribution_version": { + "items": { + "type": "string" + }, + "type": "array" + }, + "gpg_key": { + "type": "string" + }, + "org_id": { + "type": "string" + }, + "package_count": { + "type": "integer" + }, + "uuid": { + "type": "string" + } + }, + "type": "object" + }, + "models.UpdateCommitAPI": { + "properties": { + "ID": { + "description": "The unique ID of the commit", + "example": 1056, + "type": "integer" + }, + "ImageBuildTarURL": { + "description": "The commit tar url", + "example": "https://storage-host.example.com/v2/99999999/tar/59794/tmp/repos/59794/repo.tar", + "type": "string" + }, + "OSTreeCommit": { + "description": "The ostree commit hash", + "example": "9bd8dfe9856aa5bb1683e85f123bfe7785d45fbdb6f10372ff2c80e703400999", + "type": "string" + }, + "OSTreeRef": { + "description": "The commit ostree ref", + "example": "rhel/9/x86_64/edge", + "type": "string" + } + }, + "type": "object" + }, + "models.UpdateTransaction": { + "properties": { + "Account": { + "type": "string" + }, + "ChangesRefs": { + "type": "boolean" + }, + "Commit": { + "$ref": "#/components/schemas/models.Commit" + }, + "CommitID": { + "type": "integer" + }, + "CreatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "DeletedAt": { + "$ref": "#/components/schemas/gorm.DeletedAt" + }, + "Devices": { + "items": { + "$ref": "#/components/schemas/models.Device" + }, + "type": "array" + }, + "DispatchRecords": { + "items": { + "$ref": "#/components/schemas/models.DispatchRecord" + }, + "type": "array" + }, + "ID": { + "type": "integer" + }, + "OldCommits": { + "items": { + "$ref": "#/components/schemas/models.Commit" + }, + "type": "array" + }, + "Repo": { + "$ref": "#/components/schemas/models.Repo" + }, + "RepoID": { + "type": "integer" + }, + "Status": { + "type": "string" + }, + "Tag": { + "type": "string" + }, + "UpdatedAt": { + "$ref": "#/components/schemas/models.EdgeAPITime" + }, + "org_id": { + "type": "string" + } + }, + "type": "object" + }, + "models.UpdateTransactionAPI": { + "properties": { + "ChangesRefs": { + "example": false, + "type": "boolean" + }, + "Commit": { + "$ref": "#/components/schemas/models.Commit" + }, + "CommitID": { + "description": "Commit ID of device", + "example": 1754, + "type": "integer" + }, + "Devices": { + "description": "List of Devices", + "items": { + "$ref": "#/components/schemas/models.DeviceAPI" + }, + "type": "array" + }, + "DispatchRecords": { + "items": { + "$ref": "#/components/schemas/models.DispatchRecordAPI" + }, + "type": "array" + }, + "OldCommits": { + "description": "Old Commit ID if the device has one", + "items": { + "$ref": "#/components/schemas/models.Commit" + }, + "type": "array" + }, + "Repo": { + "$ref": "#/components/schemas/models.Repo" + }, + "RepoID": { + "description": "Repo ID", + "example": 2256, + "type": "integer" + }, + "Status": { + "description": "Status of device", + "example": "SUCCESS", + "type": "string" + }, + "Tag": { + "description": "Tag og Device if device has one", + "example": "device_tag", + "type": "string" + } + }, + "type": "object" + } + } + }, + "info": { + "contact": {}, + "description": "API of the Edge Management application on [console.redhat.com](https://console.redhat.com)", + "license": { + "name": "MIT" + }, + "title": "Edge API", + "version": "1.0" + }, + "openapi": "3.0.3", + "paths": { + "/device-groups": { + "get": { + "description": "Returns device groups for an orgID", + "parameters": [ + { + "description": "Define sort fields: created_at, updated_at, name. To sort DESC use -", + "in": "query", + "name": "sort_by", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by name", + "in": "query", + "name": "name", + "schema": { + "type": "string" + } + }, + { + "description": "field: return number of image-set view until limit is reached. Default is 100.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return number of image-set view beginning at the offset.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.DeviceGroup" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Returns device groups for an orgID", + "tags": [ + "Device Groups" + ] + }, + "post": { + "description": "Creates a Device Group for an account.", + "operationId": "CreateDeviceGroup", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.CreateDeviceGroupAPI" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.DeviceGroupAPI" + } + } + }, + "description": "The created device groups" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Creates a Device Group for an account.", + "tags": [ + "Device Groups" + ] + } + }, + "/device-groups/checkName/{name}": { + "get": { + "description": "Validates if a group name already exists", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.CheckGroupNameParamAPI" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Validates if a group name already exists", + "tags": [ + "Device Groups" + ] + } + }, + "/device-groups/{ID}": { + "delete": { + "description": "Deletes an existing device group", + "parameters": [ + { + "description": "A unique existing Device Group", + "in": "query", + "name": "required_param", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Deletes an existing device group", + "tags": [ + "Device Groups" + ] + }, + "get": { + "description": "Returns devices groups for group identified by ID", + "parameters": [ + { + "description": "device group ID", + "in": "query", + "name": "required_param", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.DeviceGroup" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Returns devices groups for group identified by ID", + "tags": [ + "Device Groups" + ] + }, + "put": { + "description": "Updates the existing device group", + "parameters": [ + { + "description": "An unique existing Device Group", + "in": "query", + "name": "required_param", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.PutGroupNameParamAPI" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.DeviceGroup" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Updates the existing device group", + "tags": [ + "Device Groups" + ] + } + }, + "/device-groups/{ID}/details": { + "get": { + "description": "Returns details for group identified by ID", + "parameters": [ + { + "description": "device group ID", + "in": "query", + "name": "required_param", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.DeviceGroup" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Returns details for group identified by ID", + "tags": [ + "Device Groups" + ] + } + }, + "/device-groups/{ID}/devices": { + "delete": { + "description": "Deletes the requested devices from device-group", + "parameters": [ + { + "description": "Identifier of the DeviceGroup", + "in": "path", + "name": "DeviceGroupID", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Deletes the requested devices from device-group", + "tags": [ + "Device Groups" + ] + }, + "post": { + "description": "Adds devices to device group", + "parameters": [ + { + "description": "An unique existing Device Group", + "in": "query", + "name": "required_param", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.PostDeviceForDeviceGroupAPI" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Adds devices to device group", + "tags": [ + "Device Groups" + ] + } + }, + "/device-groups/{ID}/devices/{deviceID}": { + "delete": { + "description": "Deletes the requested device from the device-group", + "parameters": [ + { + "description": "Identifier of the Device Group", + "in": "path", + "name": "DeviceGroupId", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "Identifier of the Device in a Device Group", + "in": "path", + "name": "DeviceId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Deletes the requested device from the device-group", + "tags": [ + "Device Groups" + ] + } + }, + "/device-groups/{ID}/updateDevices": { + "post": { + "description": "Updates all devices that belong to a group", + "parameters": [ + { + "description": "Identifier of the DeviceGroup", + "in": "query", + "name": "required_param", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Updates all devices that belong to a group", + "tags": [ + "Device Groups" + ] + } + }, + "/device-groups/{ID}/view": { + "get": { + "description": "Returns device groups view for group identified by ID", + "parameters": [ + { + "description": "device group ID", + "in": "query", + "name": "required_param", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.DeviceGroupViewAPI" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Returns device groups view for group identified by ID", + "tags": [ + "Device Groups" + ] + } + }, + "/devices": { + "get": { + "description": "Get combined system data from Edge API and Inventory API", + "operationId": "GetDevices", + "parameters": [ + { + "description": "field: maximum devices per page", + "in": "query", + "name": "per_page", + "schema": { + "type": "integer" + } + }, + { + "description": "field: which page to query from", + "in": "query", + "name": "page", + "schema": { + "type": "integer" + } + }, + { + "description": "field: order by display_name, updated or operating_system", + "in": "query", + "name": "order_by", + "schema": { + "type": "string" + } + }, + { + "description": "field: choose to order ASC or DESC when order_by is being used", + "in": "query", + "name": "order_how", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by hostname_or_id", + "in": "query", + "name": "hostname_or_id", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.DeviceDetailsListAPI" + } + } + }, + "description": "OK" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Get All Devices.", + "tags": [ + "Devices (Systems)" + ] + } + }, + "/devices/devicesview": { + "get": { + "description": "Return all data of Devices.", + "operationId": "GetDevicesView", + "parameters": [ + { + "description": "fields: name, uuid, update_available, image_id. To sort DESC use - before the fields.", + "in": "query", + "name": "sort_by", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by name", + "in": "query", + "name": "name", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by update_available", + "in": "query", + "name": "update_available", + "schema": { + "type": "boolean" + } + }, + { + "description": "field: filter by uuid", + "in": "query", + "name": "uuid", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by creation date", + "in": "query", + "name": "created_at", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by image id", + "in": "query", + "name": "image_id", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return number of devices until limit is reached. Default is 100.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return number of devices begining at the offset.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.DeviceViewListAPI" + } + } + }, + "description": "OK" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Return all data of Devices.", + "tags": [ + "Devices (Systems)" + ] + }, + "post": { + "description": "Return all data of Devices.", + "operationId": "GetDevicesViewWithinDevices", + "parameters": [ + { + "description": "fields: name, uuid, update_available, image_id. To sort DESC use - before the fields.", + "in": "query", + "name": "sort_by", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by name", + "in": "query", + "name": "name", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by update_available", + "in": "query", + "name": "update_available", + "schema": { + "type": "boolean" + } + }, + { + "description": "field: filter by uuid", + "in": "query", + "name": "uuid", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by creation date", + "in": "query", + "name": "created_at", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by image id", + "in": "query", + "name": "image_id", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return number of devices until limit is reached. Default is 100.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return number of devices beginning at the offset.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.FilterByDevicesAPI" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.DeviceViewListAPI" + } + } + }, + "description": "OK" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Return all data of Devices.", + "tags": [ + "Devices (Systems)" + ] + } + }, + "/devices/{DeviceUUID}": { + "get": { + "description": "Get a device by UUID.", + "operationId": "GetDevice", + "parameters": [ + { + "description": "DeviceUUID", + "in": "path", + "name": "DeviceUUID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.DeviceDetailsAPI" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "The device was not found." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Get a device by UUID.", + "tags": [ + "Devices (Systems)" + ] + } + }, + "/image-sets": { + "get": { + "description": "Return the list of image sets.", + "operationId": "ListAllImageSets", + "parameters": [ + { + "description": "Define sort fields: created_at, updated_at, name. To sort DESC use -", + "in": "query", + "name": "sort_by", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by name", + "in": "query", + "name": "name", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by status", + "in": "query", + "name": "status", + "schema": { + "type": "string" + } + }, + { + "description": "field: return number of image-set view until limit is reached. Default is 100.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return number of image-set view beginning at the offset.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.ImageSetsResponseAPI" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "The Image Set was not found." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Return the list of image sets.", + "tags": [ + "Image-Sets" + ] + } + }, + "/image-sets/view": { + "get": { + "description": "Return the list of image set view.", + "parameters": [ + { + "description": "Define sort fields: created_at, updated_at, name. To sort DESC use -", + "in": "query", + "name": "sort_by", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by name", + "in": "query", + "name": "name", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by status", + "in": "query", + "name": "status", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by id", + "in": "query", + "name": "id", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return number of image-set view until limit is reached. Default is 30.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return number of image-set view beginning at the offset.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.ImageSetsViewResponseAPI" + } + } + }, + "description": "OK" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Return the list of image set view.", + "tags": [ + "Image-Sets" + ] + } + }, + "/image-sets/view/{imageSetID}/versions/{imageID}": { + "get": { + "description": "Return the image-set images view list.", + "operationId": "GetImageSetImageView", + "parameters": [ + { + "description": "the image set id", + "in": "path", + "name": "image_set_id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "the image id", + "in": "path", + "name": "image_id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.ImageSetImageIDViewAPI" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "The Image-Set or Image was not found." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Return the image-set images view list.", + "tags": [ + "Image-Sets" + ] + } + }, + "/image-sets/view/{image_set_id}": { + "get": { + "description": "Return the image-set description view.", + "operationId": "GetImageSetViewByID", + "parameters": [ + { + "description": "the image-set id", + "in": "path", + "name": "image_set_id", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.ImageSetIDViewAPI" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "The Image-Set was not found." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Return the image-set description view.", + "tags": [ + "Image-Sets" + ] + } + }, + "/image-sets/view/{image_set_id}/versions": { + "get": { + "description": "Return the image-set images view list.", + "operationId": "GetAllImageSetImagesView", + "parameters": [ + { + "description": "the image-set id", + "in": "path", + "name": "image_set_id", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "Define sort fields: created_at, version, To sort DESC use -", + "in": "query", + "name": "sort_by", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by status", + "in": "query", + "name": "status", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by version", + "in": "query", + "name": "version", + "schema": { + "type": "string" + } + }, + { + "description": "field: return number of images until limit is reached. Default is 100.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return number of images beginning at the offset.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.ImagesViewDataAPI" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "The Image-Set was not found." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Return the image-set images view list.", + "tags": [ + "Image-Sets" + ] + } + }, + "/image-sets/{imageSetID}": { + "delete": { + "description": "Delete Image Set", + "operationId": "DeleteImageSet", + "parameters": [ + { + "description": "Identifier of the ImageSet", + "in": "path", + "name": "ImageSetId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.ImageSetAPI" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "image-set was not found." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Delete Image Set", + "tags": [ + "Image-Sets" + ] + } + }, + "/image-sets/{imageSetID}/": { + "get": { + "description": "Get image set by ID", + "operationId": "GetImageSetsByID", + "parameters": [ + { + "description": "Image Set ID", + "in": "path", + "name": "imageSetID", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "Define sort fields: created_at, updated_at, name. To sort DESC use -", + "in": "query", + "name": "sort_by", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by name", + "in": "query", + "name": "name", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by status", + "in": "query", + "name": "status", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by version", + "in": "query", + "name": "version", + "schema": { + "type": "string" + } + }, + { + "description": "field: return number of image-set view until limit is reached. Default is 100.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return number of image-set view beginning at the offset.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.ImageSetDetailsResponseAPI" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "image-set was not found." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Get an image-set", + "tags": [ + "Image-Sets" + ] + } + }, + "/image-sets/{imageSetID}/devices": { + "get": { + "description": "Return device ids for an image set.", + "operationId": "GetImageSetsDevicesByID", + "parameters": [ + { + "description": "Identifier of the ImageSet", + "in": "path", + "name": "ImageSetId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.ImageSetDevicesAPI" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "The Image Set ID was not found." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Return device ids for an image set.", + "tags": [ + "Image-Sets" + ] + } + }, + "/images": { + "get": { + "description": "This is a placeholder description", + "operationId": "GetAllImages", + "parameters": [ + { + "description": "Return number of images until limit is reached.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "Return number of images beginning at the offset", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + }, + { + "description": "created_at, distribution, name,status. To sort DESC use -before the fields", + "in": "query", + "name": "sort_by", + "schema": { + "type": "string" + } + }, + { + "description": "Filter by name.", + "in": "query", + "name": "name", + "schema": { + "type": "string" + } + }, + { + "description": "Filter by status.", + "in": "query", + "name": "status", + "schema": { + "type": "string" + } + }, + { + "description": "Filter by distribution.", + "in": "query", + "name": "distribution", + "schema": { + "type": "string" + } + }, + { + "description": "Filter by creation date.", + "in": "query", + "name": "created_at", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": " The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Placeholder summary", + "tags": [ + "Images" + ] + }, + "post": { + "description": "Create an ostree commit and/or installer ISO", + "operationId": "createImage", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateImage" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Create an image", + "tags": [ + "Images" + ] + } + }, + "/images/checkImageName": { + "post": { + "description": "Create an updated ostree commit", + "operationId": "CheckImageName", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateImage" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Update an image", + "tags": [ + "Images" + ] + } + }, + "/images/{imageId}": { + "delete": { + "description": "This is a placeholder description", + "operationId": "DeleteImage", + "parameters": [ + { + "description": "Identifier of the ImageSet", + "in": "path", + "name": "imageSetID", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Placeholder summary", + "tags": [ + "Images" + ] + }, + "get": { + "description": "This is a placeholder description", + "operationId": "GetImageByID", + "parameters": [ + { + "description": "Image ID", + "in": "path", + "name": "imageId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Placeholder summary", + "tags": [ + "Images" + ] + } + }, + "/images/{imageId}/details": { + "get": { + "description": "This is a placeholder description", + "operationId": "GetImageDetailsByID", + "parameters": [ + { + "description": "Image ID", + "in": "path", + "name": "imageId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Placeholder summary", + "tags": [ + "Images" + ] + } + }, + "/images/{imageId}/installer": { + "post": { + "description": "This is a placeholder description", + "operationId": "CreateInstallerForImage", + "parameters": [ + { + "description": "Image ID", + "in": "path", + "name": "imageId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateImage" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Placeholder summary", + "tags": [ + "Images" + ] + } + }, + "/images/{imageId}/kickstart": { + "post": { + "description": "This is a placeholder description", + "operationId": "CreateKickStartForImage", + "parameters": [ + { + "description": "Image ID", + "in": "path", + "name": "imageId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateImage" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Placeholder summary", + "tags": [ + "Images" + ] + } + }, + "/images/{imageId}/metadata": { + "get": { + "description": "This is a placeholder description", + "operationId": "GetMetadataForImage", + "parameters": [ + { + "description": "Image ID", + "in": "path", + "name": "imageId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Placeholder summary", + "tags": [ + "Images" + ] + } + }, + "/images/{imageId}/repo": { + "get": { + "description": "This is a placeholder description", + "operationId": "GetRepoForImage", + "parameters": [ + { + "description": "Image ID", + "in": "path", + "name": "imageId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Placeholder summary", + "tags": [ + "Images" + ] + } + }, + "/images/{imageId}/retry": { + "post": { + "description": "Create an updated ostree commit", + "operationId": "RetryCreateImage", + "parameters": [ + { + "description": "Image ID", + "in": "path", + "name": "imageId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateImage" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "Retry is being processed" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Retries building an image from scratch", + "tags": [ + "Images" + ] + } + }, + "/images/{imageId}/status": { + "get": { + "description": "This is a placeholder description", + "operationId": "GetImageStatusByID", + "parameters": [ + { + "description": "Image Identifier", + "in": "path", + "name": "imageId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Placeholder summary", + "tags": [ + "Images" + ] + } + }, + "/images/{imageId}/update": { + "post": { + "description": "Create an updated ostree commit", + "operationId": "CreateImageUpdate", + "parameters": [ + { + "description": "Image ID", + "in": "path", + "name": "imageId", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateImage" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Update an image", + "tags": [ + "Images" + ] + } + }, + "/images/{ostreeCommitHash}/info": { + "get": { + "description": "This is a placeholder description", + "operationId": "GetImageByOstree", + "parameters": [ + { + "description": "Ostree Commit Hash", + "in": "path", + "name": "ostreeCommitHash", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.SuccessPlaceholderResponse" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Placeholder summary", + "tags": [ + "Images" + ] + } + }, + "/storage/images-repos/{imageID}/content/{repoFilePath}": { + "get": { + "description": "Redirect request to a signed and valid url for an image commit repository from the path content", + "operationId": "RedirectSignedImageCommitRepository", + "parameters": [ + { + "description": "Id to identify Image", + "in": "path", + "name": "imageID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "path to file repository", + "in": "path", + "name": "repoFilePath", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "303": { + "content": { + "application/json": { + "schema": { + "type": "string" + } + } + }, + "description": "See Other" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "Not Found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "redirect to a signed url of an image commit repository path content", + "tags": [ + "Storage" + ] + } + }, + "/storage/images-repos/{imageID}/{repoFilePath}": { + "get": { + "description": "Bring the content for a image commit in a repository path", + "operationId": "ContentImageCommitRepositoryPath", + "parameters": [ + { + "description": "Id to identify Image", + "in": "path", + "name": "imageID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "path to file repository", + "in": "path", + "name": "repoFilePath", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/octet-stream": { + "schema": { + "type": "string" + } + } + }, + "description": "Stream object from file content" + }, + "400": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "404": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "Not Found" + }, + "500": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "return the content of an image commit repository path", + "tags": [ + "Storage" + ] + } + }, + "/storage/isos/{installerID}/": { + "get": { + "description": "This method will redirect request to a signed installer iso url", + "operationId": "RedirectSignedInstaller", + "parameters": [ + { + "description": "Installer ID", + "in": "path", + "name": "installerID", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "303": { + "content": { + "application/octet-stream": { + "schema": { + "type": "string" + } + } + }, + "description": "URL to redirect" + }, + "400": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request send couln't be processed." + }, + "404": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "installer not found." + }, + "500": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Redirect to a signed installer", + "tags": [ + "Storage" + ] + } + }, + "/storage/update-repos/{updateTransactionID}/content/{repoFilePath}": { + "get": { + "description": "Method will redirect to asigned url of an update-transaction based on repository content", + "operationId": "RedirectUpdateTransactionRepositoryPath", + "parameters": [ + { + "description": "id for update transaction id", + "in": "path", + "name": "updateTransactionID", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "path to repository to be checked", + "in": "path", + "name": "repoFilePath", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "303": { + "content": { + "application/octet-stream": { + "schema": { + "type": "string" + } + } + }, + "description": "URL signed to be redirect" + }, + "400": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "404": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "Not Found" + }, + "500": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "redirect to a signed url of an update-transaction repository path content", + "tags": [ + "Storage" + ] + } + }, + "/storage/update-repos/{updateTransactionID}/{repoFilePath}": { + "get": { + "description": "Request will get access to content of an update-transaction file based on the path", + "operationId": "RedirectUpdateTransactionRepositoryContent", + "parameters": [ + { + "description": "Update Transaction Id", + "in": "path", + "name": "updateTransactionID", + "required": true, + "schema": { + "type": "integer" + } + }, + { + "description": "path for repository file", + "in": "path", + "name": "repoFilePath", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/octet-stream": { + "schema": { + "type": "string" + } + } + }, + "description": "Stream object from file content" + }, + "400": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "Bad Request" + }, + "404": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "Not Found" + }, + "500": { + "content": { + "application/octet-stream": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "Internal Server Error" + } + }, + "summary": "Return the content od an update-transaction repository path", + "tags": [ + "Storage" + ] + } + }, + "/thirdpartyrepo": { + "get": { + "description": "Lists all Third Party Repository for an account.", + "operationId": "GetAllThirdPartyRepo", + "parameters": [ + { + "description": "fields: created_at, name, updated_at. To sort DESC use - before the fields.", + "in": "query", + "name": "sort_by", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by name", + "in": "query", + "name": "name", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by creation date", + "in": "query", + "name": "created_at", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by update date", + "in": "query", + "name": "updated_at", + "schema": { + "type": "string" + } + }, + { + "description": "field: return number of repositories until limit is reached.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return number of repositories beginning at the offset.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThirdPartyRepoList" + } + } + }, + "description": "The list of third party repositories response" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Lists all Third Party Repository for an account.", + "tags": [ + "Third Party Repo" + ] + }, + "post": { + "description": "Create Third Party Repository for an account.", + "operationId": "CreateThirdPartyRepo", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThirdPartyRepo" + } + } + }, + "description": "the third party repository to create", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThirdPartyRepo" + } + } + }, + "description": "The created third party repository" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Create Third Party Repository for an account.", + "tags": [ + "Third Party Repo" + ] + } + }, + "/thirdpartyrepo/checkName/{name}": { + "get": { + "description": "Checks to see if a ThirdParty repo Name exists.", + "operationId": "CheckThirdPartyRepoName", + "parameters": [ + { + "description": "ThirdParty repo Name", + "in": "path", + "name": "name", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CheckThirdPartyRepoName" + } + } + }, + "description": "The third party repository name check result" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Checks to see if a ThirdParty repo Name exists.", + "tags": [ + "Third Party Repo" + ] + } + }, + "/thirdpartyrepo/{ID}": { + "delete": { + "description": "Delete third party repository using id.", + "operationId": "DeleteThirdPartyRepoByID", + "parameters": [ + { + "description": "An unique existing third party repository id.", + "in": "query", + "name": "ID", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThirdPartyRepo" + } + } + }, + "description": "The deleted third party repository." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "The third party repository was not found." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Delete third party repository using id.", + "tags": [ + "Third Party Repo" + ] + }, + "get": { + "description": "Get third party repository by id.", + "operationId": "GetThirdPartyRepoByID", + "parameters": [ + { + "description": "An unique existing third party repository id.", + "in": "query", + "name": "ID", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThirdPartyRepo" + } + } + }, + "description": "The requested third party repository." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "The third party repository was not found." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Get third party repository by id.", + "tags": [ + "Third Party Repo" + ] + }, + "put": { + "description": "Creates an Update for third party repository", + "operationId": "CreateThirdPartyRepoUpdate", + "parameters": [ + { + "description": "An unique existing third party repository id.", + "in": "query", + "name": "ID", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThirdPartyRepo" + } + } + }, + "description": "The third party repository update data", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ThirdPartyRepo" + } + } + }, + "description": "The updated third party repository." + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "The third party repository was not found." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Creates an Update for third party repository", + "tags": [ + "Third Party Repo" + ] + } + }, + "/updates": { + "get": { + "description": "Gets all device updates", + "operationId": "ListUpdates", + "parameters": [ + { + "description": "field: return number of updates until limit is reached. Default is 30.", + "in": "query", + "name": "limit", + "schema": { + "type": "integer" + } + }, + { + "description": "field: return updates beginning at the given offset.", + "in": "query", + "name": "offset", + "schema": { + "type": "integer" + } + }, + { + "description": "fields: created_at, updated_at. To sort DESC use - before the fields.", + "in": "query", + "name": "sort_by", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by status", + "in": "query", + "name": "status", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by creation date", + "in": "query", + "name": "created_at", + "schema": { + "type": "string" + } + }, + { + "description": "field: filter by update date", + "in": "query", + "name": "updated_at", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/Update" + }, + "type": "array" + } + } + }, + "description": "List of devices updates" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Gets all device updates", + "tags": [ + "Updates (Systems)" + ] + }, + "post": { + "description": "Executes a device update", + "operationId": "UpdateDevice", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DevicesUpdate" + } + } + }, + "description": "devices uuids to update and optional target commit id", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Update" + } + } + }, + "description": "The created device update" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error" + } + }, + "summary": "Executes a device update", + "tags": [ + "Updates (Systems)" + ] + } + }, + "/updates/device/{DeviceUUID}/updates": { + "get": { + "description": "Return list of available updates for a device.", + "operationId": "GetUpdateAvailableForDevice", + "parameters": [ + { + "description": "DeviceUUID", + "in": "path", + "name": "DeviceUUID", + "required": true, + "schema": { + "type": "string" + } + }, + { + "description": "query the latest or all updates", + "in": "query", + "name": "latest", + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/models.Image" + } + } + }, + "description": "OK" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "Return list of available updates for a device.", + "tags": [ + "Devices (Systems)" + ] + } + }, + "/updates/validate": { + "post": { + "description": "Validate if the images selection could be updated", + "operationId": "PostValidateUpdate", + "requestBody": { + "content": { + "application/json": { + "schema": { + "items": { + "$ref": "#/components/schemas/ImageValidationRequest" + }, + "type": "array" + } + } + }, + "description": "request body", + "required": true, + "x-originalParamName": "body" + }, + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/ImageValidationResponse" + } + } + }, + "description": "the validation result" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error" + } + }, + "summary": "Validate if the images selection could be updated", + "tags": [ + "Updates (Systems)" + ] + } + }, + "/updates/{updateID}": { + "get": { + "description": "Gets a single requested update.", + "operationId": "GetUpdate", + "parameters": [ + { + "description": "a unique ID to identify the update", + "in": "path", + "name": "updateID", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Update" + } + } + }, + "description": "The requested update" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "The requested update was not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error" + } + }, + "summary": "Gets a single requested update", + "tags": [ + "Updates (Systems)" + ] + } + }, + "/updates/{updateID}/notify": { + "get": { + "description": "Send a notification for a device update", + "operationId": "SendNotificationForDevice", + "parameters": [ + { + "description": "a unique ID to identify the update", + "in": "path", + "name": "updateID", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/DeviceNotification" + } + } + }, + "description": "The notification payload" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "The requested update was not found" + }, + "500": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error" + } + }, + "summary": "Send a notification for a device update", + "tags": [ + "Updates (Systems)" + ] + } + }, + "/updates/{updateID}/update-playbook.yml": { + "get": { + "description": "returns the update transaction playbook used for system update", + "operationId": "GetUpdatePlaybook", + "parameters": [ + { + "description": "a unique ID to identify the update the playbook belongs to", + "in": "path", + "name": "updateID", + "required": true, + "schema": { + "type": "integer" + } + } + ], + "responses": { + "200": { + "content": { + "text/plain": { + "schema": { + "type": "string" + } + } + }, + "description": "the playbook file content for an update" + }, + "400": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/errors.BadRequest" + } + } + }, + "description": "The request sent couldn't be processed." + }, + "404": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/errors.NotFound" + } + } + }, + "description": "the device update was not found" + }, + "500": { + "content": { + "text/plain": { + "schema": { + "$ref": "#/components/schemas/errors.InternalServerError" + } + } + }, + "description": "There was an internal server error." + } + }, + "summary": "returns the playbook yaml file for a system update", + "tags": [ + "Updates (Systems)" + ] + } + } + } +} diff --git a/src/constants.js b/src/constants.js index 1f1380f7..96cdc4fe 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,5 +1,6 @@ export const IMAGE_BUILDER_API = '/api/image-builder/v1'; export const RHSM_API = '/api/rhsm/v2'; +export const EDGE_API = '/api/edge/v1'; export const CONTENT_SOURCES_API = '/api/content-sources/v1'; export const PROVISIONING_API = '/api/provisioning/v1'; export const RHEL_8 = 'rhel-88'; diff --git a/src/store/edgeApi.ts b/src/store/edgeApi.ts new file mode 100644 index 00000000..962a994f --- /dev/null +++ b/src/store/edgeApi.ts @@ -0,0 +1,51 @@ +import { emptyEdgeApi as api } from './emptyEdgeApi'; +const injectedRtkApi = api.injectEndpoints({ + endpoints: (build) => ({ + getAllImages: build.query({ + query: (queryArg) => ({ + url: `/images`, + params: { + limit: queryArg.limit, + offset: queryArg.offset, + sort_by: queryArg.sortBy, + name: queryArg.name, + status: queryArg.status, + distribution: queryArg.distribution, + created_at: queryArg.createdAt, + }, + }), + }), + }), + overrideExisting: false, +}); +export { injectedRtkApi as edgeApi }; +export type GetAllImagesApiResponse = + /** status 200 OK */ ModelsSuccessPlaceholderResponse; +export type GetAllImagesApiArg = { + /** Return number of images until limit is reached. */ + limit?: number; + /** Return number of images beginning at the offset */ + offset?: number; + /** created_at, distribution, name,status. To sort DESC use -before the fields */ + sortBy?: string; + /** Filter by name. */ + name?: string; + /** Filter by status. */ + status?: string; + /** Filter by distribution. */ + distribution?: string; + /** Filter by creation date. */ + createdAt?: string; +}; +export type ModelsSuccessPlaceholderResponse = object; +export type ErrorsBadRequest = { + Code?: string; + Status?: number; + Title?: string; +}; +export type ErrorsInternalServerError = { + Code?: string; + Status?: number; + Title?: string; +}; +export const { useGetAllImagesQuery } = injectedRtkApi; diff --git a/src/store/emptyEdgeApi.ts b/src/store/emptyEdgeApi.ts new file mode 100644 index 00000000..58c3069e --- /dev/null +++ b/src/store/emptyEdgeApi.ts @@ -0,0 +1,10 @@ +import { createApi, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; + +import { EDGE_API } from '../constants'; + +// initialize an empty api service that we'll inject endpoints into later as needed +export const emptyEdgeApi = createApi({ + reducerPath: 'edgeApi', + baseQuery: fetchBaseQuery({ baseUrl: EDGE_API }), + endpoints: () => ({}), +}); diff --git a/src/store/index.js b/src/store/index.js index 4be7ac46..0e62b110 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -5,6 +5,7 @@ import promiseMiddleware from 'redux-promise-middleware'; import clonesSlice from './clonesSlice'; import composesSlice from './composesSlice'; import { contentSourcesApi } from './contentSourcesApi'; +import { edgeApi } from './edgeApi'; import { imageBuilderApi } from './imageBuilderApi'; import { provisioningApi } from './provisioningApi'; import { rhsmApi } from './rhsmApi'; @@ -13,6 +14,7 @@ export const reducer = { clones: clonesSlice, composes: composesSlice, [contentSourcesApi.reducerPath]: contentSourcesApi.reducer, + [edgeApi.reducerPath]: edgeApi.reducer, [imageBuilderApi.reducerPath]: imageBuilderApi.reducer, [rhsmApi.reducerPath]: rhsmApi.reducer, [provisioningApi.reducerPath]: provisioningApi.reducer, @@ -23,6 +25,7 @@ export const middleware = (getDefaultMiddleware) => getDefaultMiddleware() .concat(promiseMiddleware) .concat(contentSourcesApi.middleware) + .concat(edgeApi.middleware) .concat(imageBuilderApi.middleware) .concat(rhsmApi.middleware) .concat(provisioningApi.middleware);