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.
This commit is contained in:
parent
80f833a69b
commit
899d78f7e1
6 changed files with 51 additions and 33 deletions
|
|
@ -39,11 +39,6 @@ type AWSUploadRequestOptionsS3 struct {
|
|||
SecretAccessKey string `json:"secret_access_key"`
|
||||
}
|
||||
|
||||
// AWSUploadStatus defines model for AWSUploadStatus.
|
||||
type AWSUploadStatus struct {
|
||||
AmiId *string `json:"ami_id,omitempty"`
|
||||
}
|
||||
|
||||
// ComposeRequest defines model for ComposeRequest.
|
||||
type ComposeRequest struct {
|
||||
Customizations *Customizations `json:"customizations,omitempty"`
|
||||
|
|
@ -58,8 +53,7 @@ type ComposeResult struct {
|
|||
|
||||
// ComposeStatus defines model for ComposeStatus.
|
||||
type ComposeStatus struct {
|
||||
ImageStatuses *[]ImageStatus `json:"image_statuses,omitempty"`
|
||||
Status string `json:"status"`
|
||||
ImageStatus ImageStatus `json:"image_status"`
|
||||
}
|
||||
|
||||
// Customizations defines model for Customizations.
|
||||
|
|
@ -77,8 +71,8 @@ type ImageRequest struct {
|
|||
|
||||
// ImageStatus defines model for ImageStatus.
|
||||
type ImageStatus struct {
|
||||
Status string `json:"status"`
|
||||
UploadStatuses *[]UploadStatus `json:"upload_statuses,omitempty"`
|
||||
Status string `json:"status"`
|
||||
UploadStatus *UploadStatus `json:"upload_status,omitempty"`
|
||||
}
|
||||
|
||||
// Repository defines model for Repository.
|
||||
|
|
@ -101,11 +95,22 @@ type Subscription struct {
|
|||
// UploadRequest defines model for UploadRequest.
|
||||
type UploadRequest struct {
|
||||
Options interface{} `json:"options"`
|
||||
Type string `json:"type"`
|
||||
Type UploadTypes `json:"type"`
|
||||
}
|
||||
|
||||
// UploadStatus defines model for UploadStatus.
|
||||
type UploadStatus interface{}
|
||||
type UploadStatus struct {
|
||||
Status string `json:"status"`
|
||||
Type UploadTypes `json:"type"`
|
||||
}
|
||||
|
||||
// UploadTypes defines model for UploadTypes.
|
||||
type UploadTypes string
|
||||
|
||||
// List of UploadTypes
|
||||
const (
|
||||
UploadTypes_aws UploadTypes = "aws"
|
||||
)
|
||||
|
||||
// ComposeJSONBody defines parameters for Compose.
|
||||
type ComposeJSONBody ComposeRequest
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue