Commit graph

14 commits

Author SHA1 Message Date
Tomas Hozza
4a47ad36af Cloud API: fix image_status.status value for running compose
Previously, the Cloud API endpoint `/v1/compose/{id}` return value's
`image_status.status` for a running worker job was "running", which didn't
comply with the Cloud API specification. Equivalents allowed by the API
specification are "building", "uploading" or "registering".

As a result, the Image Builder API also does not comply in this regard
to its specification, because it currently just copies the status value
string returned by osbuild-composer.

Define the `image_status.status` as a reusable type in the Cloud API
specification. This forces openapi to generate an explicit type for it,
which can be then explicitly used in the code, instead of plain strings.

Return "building", instead of "running"  for running compose.

Modify api integration test to check for all valid `image_status.status`
values for a compose.

Add News entry explaining this change.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-03-26 11:59:07 +01:00
Chloe Kaubisch
500533116a cloudapi: single uploadrequest
Change imageRequest to accept a single uploadRequest instead of
an array of uploadRequests.
2021-03-09 16:42:33 +01:00
Ondřej Budai
9ca1b0a8b6 api/cloud: add support for azure
This commit adds support for uploading images directly to Azure using the
cloud API.

The UploadStatus part is currently not implemented and will be added in a
follow-up PR.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2021-03-06 15:40:48 +00:00
Tomas Hozza
319400c280 cloudapi: implement GCP target results and include UploadOptions
Return GCP-specific target results form the worker, similar as it is
done for AWS.

Extend Cloud API to allow GCP-specific upload Options.

Modify Cloud API to return UploadOptions as part of the UploadStatus.

Modify Cloud API integration test to check returned upload Options and
upload Type.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-03-04 15:44:04 +01:00
Chloe Kaubisch
f091af55d8 cloudapi: add targetresults
Add the TargetResult struct to OSBuildJobResult. Include the 'options'
interface on TargetResult to contain target-specific information,
for example amiID and region from AWS. Expose 'options' on a status
call as an UploadStatus field. Add logic to support AWS within this
format, which can be used as a template for other targets.
2021-03-02 13:22:11 +01:00
Tomas Hozza
94d399f010 cloudapi: Add support for GCP as upload target
Add support for GCP as an upload target to the internal API.

Extend the cloudapi to allow GCP as an upload target in the compose
request. Regenerate the cloudapi go code. Added GCP-specific upload
result component in the API definition, similar to AWS. It is not yet
used, but it will be once returning a target-specific result from
worker is supported.

Add support for GCP upload target to the worker job implementation.

Signed-off-by: Tomas Hozza <thozza@redhat.com>
2021-02-25 18:44:21 +00:00
Martin Sehnoutka
f98e231f64 cloudapi: extend the API spec with /version and /openapi.json
These endpoints are useful for clients while exploring the API. They are
also required for deploying the service into clouddot.
2021-02-12 14:25:19 +01:00
Tom Gundersen
e513905424 cloudapi: add support for additional packages
Optionally allow a pacakge set to be included in the compose request.

The specified packages are added to the base packages before
depsolving. As the base packages differ between the image types
the package customizations may have different results on the different
images part of the compose request.

Signed-off-by: Tom Gundersen <teg@jklm.no>
2021-02-11 14:12:11 +01:00
Chloe Kaubisch
899d78f7e1
cloudapi: expose upload status
Expose a more detailed job status result - specifically, include upload status
alongside image status. Expand openapi.yml accordingly and add an UploadStatus
field to the OSBuildJobResult struct. At the moment, only represent the
"success" and "failure" states of UploadStatus - to differentiate between
"pending" and "running" would involve significant design decisions and should be
addressed in a separate commit.
2021-02-05 12:34:28 +01:00
Sanne Raymaekers
22c9f6af61 cloudapi: Share an ec2 snapshot/ami with an account 2020-11-26 13:08:18 +00:00
Chloe Kaubisch
6388aaff4c cloudapi: add support for mirrorlist and metalink repos
Previously, baseurl was required in openapi.yaml. In order to add support
for metalink and mirrorlist repos as well, make all optional, since openapi
does not support mutually exclusive parameters. Instead, enforce this logic
in server.go, and if no repo has been specified, return a 400 bad request error.
2020-11-26 14:07:59 +01:00
Lars Karlitski
31f4d9efe8 cloudapi: return statuses as specified in openapi spec
Don't use common.State anymore, because it has different values from
what's defined in openapi.yml. It makes sense to have these strings
defined in the same package as the spec — ideally, the code generator
would make them for us.

While at it, add a "running" status.

Fix the api.sh test to use these new statuses. Thanks to Ondřej Budai
for an additional fix there.
2020-11-09 14:17:19 +01:00
sanne raymaekers
d5938d52b2 cloudapi: Add rhsm parameter to repository 2020-09-22 11:38:28 +02:00
sanne raymaekers
9ca50ae3ac osbuild-composer-cloud: introduce the cloud-specific service 2020-09-22 11:38:28 +02:00