1089 lines
42 KiB
Go
1089 lines
42 KiB
Go
// Package v2 provides primitives to interact with the openapi HTTP API.
|
|
//
|
|
// Code generated by github.com/deepmap/oapi-codegen version v1.8.2 DO NOT EDIT.
|
|
package v2
|
|
|
|
import (
|
|
"bytes"
|
|
"compress/gzip"
|
|
"encoding/base64"
|
|
"fmt"
|
|
"net/http"
|
|
"net/url"
|
|
"path"
|
|
"strings"
|
|
|
|
"github.com/deepmap/oapi-codegen/pkg/runtime"
|
|
"github.com/getkin/kin-openapi/openapi3"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
const (
|
|
BearerScopes = "Bearer.Scopes"
|
|
)
|
|
|
|
// Defines values for ComposeStatusValue.
|
|
const (
|
|
ComposeStatusValueFailure ComposeStatusValue = "failure"
|
|
|
|
ComposeStatusValuePending ComposeStatusValue = "pending"
|
|
|
|
ComposeStatusValueSuccess ComposeStatusValue = "success"
|
|
)
|
|
|
|
// Defines values for ImageStatusValue.
|
|
const (
|
|
ImageStatusValueBuilding ImageStatusValue = "building"
|
|
|
|
ImageStatusValueFailure ImageStatusValue = "failure"
|
|
|
|
ImageStatusValuePending ImageStatusValue = "pending"
|
|
|
|
ImageStatusValueRegistering ImageStatusValue = "registering"
|
|
|
|
ImageStatusValueSuccess ImageStatusValue = "success"
|
|
|
|
ImageStatusValueUploading ImageStatusValue = "uploading"
|
|
)
|
|
|
|
// Defines values for ImageTypes.
|
|
const (
|
|
ImageTypesAws ImageTypes = "aws"
|
|
|
|
ImageTypesAwsHaRhui ImageTypes = "aws-ha-rhui"
|
|
|
|
ImageTypesAwsRhui ImageTypes = "aws-rhui"
|
|
|
|
ImageTypesAwsSapRhui ImageTypes = "aws-sap-rhui"
|
|
|
|
ImageTypesAzure ImageTypes = "azure"
|
|
|
|
ImageTypesAzureEap7Rhui ImageTypes = "azure-eap7-rhui"
|
|
|
|
ImageTypesAzureRhui ImageTypes = "azure-rhui"
|
|
|
|
ImageTypesAzureSapRhui ImageTypes = "azure-sap-rhui"
|
|
|
|
ImageTypesEdgeCommit ImageTypes = "edge-commit"
|
|
|
|
ImageTypesEdgeContainer ImageTypes = "edge-container"
|
|
|
|
ImageTypesEdgeInstaller ImageTypes = "edge-installer"
|
|
|
|
ImageTypesGcp ImageTypes = "gcp"
|
|
|
|
ImageTypesGcpRhui ImageTypes = "gcp-rhui"
|
|
|
|
ImageTypesGuestImage ImageTypes = "guest-image"
|
|
|
|
ImageTypesImageInstaller ImageTypes = "image-installer"
|
|
|
|
ImageTypesIotCommit ImageTypes = "iot-commit"
|
|
|
|
ImageTypesIotContainer ImageTypes = "iot-container"
|
|
|
|
ImageTypesIotInstaller ImageTypes = "iot-installer"
|
|
|
|
ImageTypesIotRawImage ImageTypes = "iot-raw-image"
|
|
|
|
ImageTypesLiveInstaller ImageTypes = "live-installer"
|
|
|
|
ImageTypesVsphere ImageTypes = "vsphere"
|
|
|
|
ImageTypesVsphereOva ImageTypes = "vsphere-ova"
|
|
)
|
|
|
|
// Defines values for UploadStatusValue.
|
|
const (
|
|
UploadStatusValueFailure UploadStatusValue = "failure"
|
|
|
|
UploadStatusValuePending UploadStatusValue = "pending"
|
|
|
|
UploadStatusValueRunning UploadStatusValue = "running"
|
|
|
|
UploadStatusValueSuccess UploadStatusValue = "success"
|
|
)
|
|
|
|
// Defines values for UploadTypes.
|
|
const (
|
|
UploadTypesAws UploadTypes = "aws"
|
|
|
|
UploadTypesAwsS3 UploadTypes = "aws.s3"
|
|
|
|
UploadTypesAzure UploadTypes = "azure"
|
|
|
|
UploadTypesContainer UploadTypes = "container"
|
|
|
|
UploadTypesGcp UploadTypes = "gcp"
|
|
)
|
|
|
|
// AWSEC2CloneCompose defines model for AWSEC2CloneCompose.
|
|
type AWSEC2CloneCompose struct {
|
|
Region string `json:"region"`
|
|
ShareWithAccounts *[]string `json:"share_with_accounts,omitempty"`
|
|
}
|
|
|
|
// AWSEC2UploadOptions defines model for AWSEC2UploadOptions.
|
|
type AWSEC2UploadOptions struct {
|
|
Region string `json:"region"`
|
|
ShareWithAccounts []string `json:"share_with_accounts"`
|
|
SnapshotName *string `json:"snapshot_name,omitempty"`
|
|
}
|
|
|
|
// AWSEC2UploadStatus defines model for AWSEC2UploadStatus.
|
|
type AWSEC2UploadStatus struct {
|
|
Ami string `json:"ami"`
|
|
Region string `json:"region"`
|
|
}
|
|
|
|
// AWSS3UploadOptions defines model for AWSS3UploadOptions.
|
|
type AWSS3UploadOptions struct {
|
|
// If set to false (the default value), a long, obfuscated URL
|
|
// is returned. Its expiration might be sooner than for other upload
|
|
// targets.
|
|
//
|
|
// If set to true, a shorter URL is returned and
|
|
// its expiration is the same as for the other upload targets.
|
|
Public *bool `json:"public,omitempty"`
|
|
Region string `json:"region"`
|
|
}
|
|
|
|
// AWSS3UploadStatus defines model for AWSS3UploadStatus.
|
|
type AWSS3UploadStatus struct {
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
// AzureUploadOptions defines model for AzureUploadOptions.
|
|
type AzureUploadOptions struct {
|
|
// Name of the uploaded image. It must be unique in the given resource group.
|
|
// If name is omitted from the request, a random one based on a UUID is
|
|
// generated.
|
|
ImageName *string `json:"image_name,omitempty"`
|
|
|
|
// Location of the provided resource_group, where the image should be uploaded and registered.
|
|
// How to list all locations:
|
|
// https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az_account_list_locations'
|
|
// If the location is not specified, it is deducted from the provided resource_group.
|
|
Location *string `json:"location,omitempty"`
|
|
|
|
// Name of the resource group where the image should be uploaded.
|
|
ResourceGroup string `json:"resource_group"`
|
|
|
|
// ID of subscription where the image should be uploaded.
|
|
SubscriptionId string `json:"subscription_id"`
|
|
|
|
// ID of the tenant where the image should be uploaded.
|
|
// How to find it in the Azure Portal:
|
|
// https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-how-to-find-tenant
|
|
TenantId string `json:"tenant_id"`
|
|
}
|
|
|
|
// AzureUploadStatus defines model for AzureUploadStatus.
|
|
type AzureUploadStatus struct {
|
|
ImageName string `json:"image_name"`
|
|
}
|
|
|
|
// CloneComposeBody defines model for CloneComposeBody.
|
|
type CloneComposeBody interface{}
|
|
|
|
// CloneComposeResponse defines model for CloneComposeResponse.
|
|
type CloneComposeResponse struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
Id string `json:"id"`
|
|
}
|
|
|
|
// CloneStatus defines model for CloneStatus.
|
|
type CloneStatus struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded struct due to allOf(#/components/schemas/UploadStatus)
|
|
UploadStatus `yaml:",inline"`
|
|
}
|
|
|
|
// ComposeId defines model for ComposeId.
|
|
type ComposeId struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
Id string `json:"id"`
|
|
}
|
|
|
|
// ComposeLogs defines model for ComposeLogs.
|
|
type ComposeLogs struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
ImageBuilds []interface{} `json:"image_builds"`
|
|
Koji *KojiLogs `json:"koji,omitempty"`
|
|
}
|
|
|
|
// ComposeManifests defines model for ComposeManifests.
|
|
type ComposeManifests struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
Manifests []interface{} `json:"manifests"`
|
|
}
|
|
|
|
// ComposeMetadata defines model for ComposeMetadata.
|
|
type ComposeMetadata struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
// ID (hash) of the built commit
|
|
OstreeCommit *string `json:"ostree_commit,omitempty"`
|
|
|
|
// Package list including NEVRA
|
|
Packages *[]PackageMetadata `json:"packages,omitempty"`
|
|
}
|
|
|
|
// ComposeRequest defines model for ComposeRequest.
|
|
type ComposeRequest struct {
|
|
Customizations *Customizations `json:"customizations,omitempty"`
|
|
Distribution string `json:"distribution"`
|
|
ImageRequest *ImageRequest `json:"image_request,omitempty"`
|
|
ImageRequests *[]ImageRequest `json:"image_requests,omitempty"`
|
|
Koji *Koji `json:"koji,omitempty"`
|
|
}
|
|
|
|
// ComposeStatus defines model for ComposeStatus.
|
|
type ComposeStatus struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
ImageStatus ImageStatus `json:"image_status"`
|
|
ImageStatuses *[]ImageStatus `json:"image_statuses,omitempty"`
|
|
KojiStatus *KojiStatus `json:"koji_status,omitempty"`
|
|
Status ComposeStatusValue `json:"status"`
|
|
}
|
|
|
|
// ComposeStatusError defines model for ComposeStatusError.
|
|
type ComposeStatusError struct {
|
|
Details *interface{} `json:"details,omitempty"`
|
|
Id int `json:"id"`
|
|
Reason string `json:"reason"`
|
|
}
|
|
|
|
// ComposeStatusValue defines model for ComposeStatusValue.
|
|
type ComposeStatusValue string
|
|
|
|
// Container defines model for Container.
|
|
type Container struct {
|
|
// Name to use for the container from the image
|
|
Name *string `json:"name,omitempty"`
|
|
Source string `json:"source"`
|
|
|
|
// Control TLS verifification
|
|
TlsVerify *bool `json:"tls_verify,omitempty"`
|
|
}
|
|
|
|
// ContainerUploadOptions defines model for ContainerUploadOptions.
|
|
type ContainerUploadOptions struct {
|
|
// Name for the created container image
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// Tag for the created container image
|
|
Tag *string `json:"tag,omitempty"`
|
|
}
|
|
|
|
// ContainerUploadStatus defines model for ContainerUploadStatus.
|
|
type ContainerUploadStatus struct {
|
|
// Digest of the manifest of the uploaded container on the registry
|
|
Digest string `json:"digest"`
|
|
|
|
// FQDN of the uploaded image
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
// CustomRepository defines model for CustomRepository.
|
|
type CustomRepository struct {
|
|
Baseurl *[]string `json:"baseurl,omitempty"`
|
|
CheckGpg *bool `json:"check_gpg,omitempty"`
|
|
CheckRepoGpg *bool `json:"check_repo_gpg,omitempty"`
|
|
Enabled *bool `json:"enabled,omitempty"`
|
|
Filename *string `json:"filename,omitempty"`
|
|
Gpgkey *[]string `json:"gpgkey,omitempty"`
|
|
Id string `json:"id"`
|
|
Metalink *string `json:"metalink,omitempty"`
|
|
Mirrorlist *string `json:"mirrorlist,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
Priority *int `json:"priority,omitempty"`
|
|
SslVerify *bool `json:"ssl_verify,omitempty"`
|
|
}
|
|
|
|
// Customizations defines model for Customizations.
|
|
type Customizations struct {
|
|
Containers *[]Container `json:"containers,omitempty"`
|
|
|
|
// Extra repositories for packages specified in customizations. These
|
|
// repositories will be used to depsolve and retrieve packages. Additionally,
|
|
// these packages will be saved and imported to the `/etc/yum.repos.d/` directory
|
|
// on the image
|
|
CustomRepositories *[]CustomRepository `json:"custom_repositories,omitempty"`
|
|
Directories *[]Directory `json:"directories,omitempty"`
|
|
Files *[]File `json:"files,omitempty"`
|
|
Filesystem *[]Filesystem `json:"filesystem,omitempty"`
|
|
Openscap *OpenSCAP `json:"openscap,omitempty"`
|
|
Packages *[]string `json:"packages,omitempty"`
|
|
|
|
// Extra repositories for packages specified in customizations. These
|
|
// repositories will only be used to depsolve and retrieve packages
|
|
// for the OS itself (they will not be available for the build root or
|
|
// any other part of the build process). The package_sets field for these
|
|
// repositories is ignored.
|
|
PayloadRepositories *[]Repository `json:"payload_repositories,omitempty"`
|
|
Services *struct {
|
|
// List of services to disable by default
|
|
Disabled *[]string `json:"disabled,omitempty"`
|
|
|
|
// List of services to enable by default
|
|
Enabled *[]string `json:"enabled,omitempty"`
|
|
} `json:"services,omitempty"`
|
|
Subscription *Subscription `json:"subscription,omitempty"`
|
|
Users *[]User `json:"users,omitempty"`
|
|
}
|
|
|
|
// A custom directory to create in the final artifact.
|
|
type Directory struct {
|
|
// Ensure that the parent directories exist
|
|
EnsureParents *bool `json:"ensure_parents,omitempty"`
|
|
|
|
// Group of the directory as a group name or a gid
|
|
Group *interface{} `json:"group,omitempty"`
|
|
|
|
// Permissions string for the directory in octal format
|
|
Mode *string `json:"mode,omitempty"`
|
|
|
|
// Path to the directory
|
|
Path string `json:"path"`
|
|
|
|
// Owner of the directory as a user name or a uid
|
|
User *interface{} `json:"user,omitempty"`
|
|
}
|
|
|
|
// Error defines model for Error.
|
|
type Error struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
Code string `json:"code"`
|
|
Details *interface{} `json:"details,omitempty"`
|
|
OperationId string `json:"operation_id"`
|
|
Reason string `json:"reason"`
|
|
}
|
|
|
|
// ErrorList defines model for ErrorList.
|
|
type ErrorList struct {
|
|
// Embedded struct due to allOf(#/components/schemas/List)
|
|
List `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
Items []Error `json:"items"`
|
|
}
|
|
|
|
// A custom file to create in the final artifact.
|
|
type File struct {
|
|
// Contents of the file as plain text
|
|
Data *string `json:"data,omitempty"`
|
|
|
|
// Ensure that the parent directories exist
|
|
EnsureParents *bool `json:"ensure_parents,omitempty"`
|
|
|
|
// Group of the file as a gid or a group name
|
|
Group *interface{} `json:"group,omitempty"`
|
|
|
|
// Permissions string for the file in octal format
|
|
Mode *string `json:"mode,omitempty"`
|
|
|
|
// Path to the file
|
|
Path string `json:"path"`
|
|
|
|
// Owner of the file as a uid or a user name
|
|
User *interface{} `json:"user,omitempty"`
|
|
}
|
|
|
|
// Filesystem defines model for Filesystem.
|
|
type Filesystem struct {
|
|
MinSize uint64 `json:"min_size"`
|
|
Mountpoint string `json:"mountpoint"`
|
|
}
|
|
|
|
// GCPUploadOptions defines model for GCPUploadOptions.
|
|
type GCPUploadOptions struct {
|
|
// Name of an existing STANDARD Storage class Bucket.
|
|
Bucket *string `json:"bucket,omitempty"`
|
|
|
|
// The name to use for the imported and shared Compute Engine image.
|
|
// The image name must be unique within the GCP project, which is used
|
|
// for the OS image upload and import. If not specified a random
|
|
// 'composer-api-<uuid>' string is used as the image name.
|
|
ImageName *string `json:"image_name,omitempty"`
|
|
|
|
// The GCP region where the OS image will be imported to and shared from.
|
|
// The value must be a valid GCP location. See https://cloud.google.com/storage/docs/locations.
|
|
// If not specified, the multi-region location closest to the source
|
|
// (source Storage Bucket location) is chosen automatically.
|
|
Region string `json:"region"`
|
|
|
|
// List of valid Google accounts to share the imported Compute Engine image with.
|
|
// Each string must contain a specifier of the account type. Valid formats are:
|
|
// - 'user:{emailid}': An email address that represents a specific
|
|
// Google account. For example, 'alice@example.com'.
|
|
// - 'serviceAccount:{emailid}': An email address that represents a
|
|
// service account. For example, 'my-other-app@appspot.gserviceaccount.com'.
|
|
// - 'group:{emailid}': An email address that represents a Google group.
|
|
// For example, 'admins@example.com'.
|
|
// - 'domain:{domain}': The G Suite domain (primary) that represents all
|
|
// the users of that domain. For example, 'google.com' or 'example.com'.
|
|
// If not specified, the imported Compute Engine image is not shared with any
|
|
// account.
|
|
ShareWithAccounts *[]string `json:"share_with_accounts,omitempty"`
|
|
}
|
|
|
|
// GCPUploadStatus defines model for GCPUploadStatus.
|
|
type GCPUploadStatus struct {
|
|
ImageName string `json:"image_name"`
|
|
ProjectId string `json:"project_id"`
|
|
}
|
|
|
|
// ImageRequest defines model for ImageRequest.
|
|
type ImageRequest struct {
|
|
Architecture string `json:"architecture"`
|
|
ImageType ImageTypes `json:"image_type"`
|
|
Ostree *OSTree `json:"ostree,omitempty"`
|
|
Repositories []Repository `json:"repositories"`
|
|
|
|
// This should really be oneOf but AWSS3UploadOptions is a subset of
|
|
// AWSEC2UploadOptions. This means that all AWSEC2UploadOptions objects
|
|
// are also valid AWSS3UploadOptionas objects which violates the oneOf
|
|
// rules. Therefore, we have to use anyOf here but be aware that it isn't
|
|
// possible to mix and match more schemas together.
|
|
UploadOptions *UploadOptions `json:"upload_options,omitempty"`
|
|
}
|
|
|
|
// ImageStatus defines model for ImageStatus.
|
|
type ImageStatus struct {
|
|
Error *ComposeStatusError `json:"error,omitempty"`
|
|
Status ImageStatusValue `json:"status"`
|
|
UploadStatus *UploadStatus `json:"upload_status,omitempty"`
|
|
}
|
|
|
|
// ImageStatusValue defines model for ImageStatusValue.
|
|
type ImageStatusValue string
|
|
|
|
// ImageTypes defines model for ImageTypes.
|
|
type ImageTypes string
|
|
|
|
// Koji defines model for Koji.
|
|
type Koji struct {
|
|
Name string `json:"name"`
|
|
Release string `json:"release"`
|
|
Server string `json:"server"`
|
|
TaskId int `json:"task_id"`
|
|
Version string `json:"version"`
|
|
}
|
|
|
|
// KojiLogs defines model for KojiLogs.
|
|
type KojiLogs struct {
|
|
Import interface{} `json:"import"`
|
|
Init interface{} `json:"init"`
|
|
}
|
|
|
|
// KojiStatus defines model for KojiStatus.
|
|
type KojiStatus struct {
|
|
BuildId *int `json:"build_id,omitempty"`
|
|
}
|
|
|
|
// List defines model for List.
|
|
type List struct {
|
|
Kind string `json:"kind"`
|
|
Page int `json:"page"`
|
|
Size int `json:"size"`
|
|
Total int `json:"total"`
|
|
}
|
|
|
|
// OSTree defines model for OSTree.
|
|
type OSTree struct {
|
|
// A URL which, if set, is used for fetching content. Implies that `url` is set as well,
|
|
// which will be used for metadata only.
|
|
Contenturl *string `json:"contenturl,omitempty"`
|
|
|
|
// Can be either a commit (example: 02604b2da6e954bd34b8b82a835e5a77d2b60ffa), or a branch-like reference (example: rhel/8/x86_64/edge)
|
|
Parent *string `json:"parent,omitempty"`
|
|
Ref *string `json:"ref,omitempty"`
|
|
|
|
// Determines whether a valid subscription manager (candlepin) identity is required to
|
|
// access this repository. Consumer certificates will be used as client certificates when
|
|
// fetching metadata and content.
|
|
Rhsm *bool `json:"rhsm,omitempty"`
|
|
Url *string `json:"url,omitempty"`
|
|
}
|
|
|
|
// ObjectReference defines model for ObjectReference.
|
|
type ObjectReference struct {
|
|
Href string `json:"href"`
|
|
Id string `json:"id"`
|
|
Kind string `json:"kind"`
|
|
}
|
|
|
|
// OpenSCAP defines model for OpenSCAP.
|
|
type OpenSCAP struct {
|
|
ProfileId string `json:"profile_id"`
|
|
}
|
|
|
|
// PackageMetadata defines model for PackageMetadata.
|
|
type PackageMetadata struct {
|
|
Arch string `json:"arch"`
|
|
Epoch *string `json:"epoch,omitempty"`
|
|
Name string `json:"name"`
|
|
Release string `json:"release"`
|
|
Sigmd5 string `json:"sigmd5"`
|
|
Signature *string `json:"signature,omitempty"`
|
|
Type string `json:"type"`
|
|
Version string `json:"version"`
|
|
}
|
|
|
|
// Repository configuration.
|
|
// At least one of the 'baseurl', 'mirrorlist', 'metalink' properties must
|
|
// be specified. If more of them are specified, the order of precedence is
|
|
// the same as listed above.
|
|
type Repository struct {
|
|
Baseurl *string `json:"baseurl,omitempty"`
|
|
CheckGpg *bool `json:"check_gpg,omitempty"`
|
|
|
|
// Enables gpg verification of the repository metadata
|
|
CheckRepoGpg *bool `json:"check_repo_gpg,omitempty"`
|
|
|
|
// GPG key used to sign packages in this repository.
|
|
Gpgkey *string `json:"gpgkey,omitempty"`
|
|
IgnoreSsl *bool `json:"ignore_ssl,omitempty"`
|
|
Metalink *string `json:"metalink,omitempty"`
|
|
Mirrorlist *string `json:"mirrorlist,omitempty"`
|
|
|
|
// Naming package sets for a repository assigns it to a specific part
|
|
// (pipeline) of the build process.
|
|
PackageSets *[]string `json:"package_sets,omitempty"`
|
|
|
|
// Determines whether a valid subscription is required to access this repository.
|
|
Rhsm *bool `json:"rhsm,omitempty"`
|
|
}
|
|
|
|
// Subscription defines model for Subscription.
|
|
type Subscription struct {
|
|
ActivationKey string `json:"activation_key"`
|
|
BaseUrl string `json:"base_url"`
|
|
Insights bool `json:"insights"`
|
|
Organization string `json:"organization"`
|
|
|
|
// Optional flag to use rhc to register the system, which also always enables Insights.
|
|
Rhc *bool `json:"rhc,omitempty"`
|
|
ServerUrl string `json:"server_url"`
|
|
}
|
|
|
|
// This should really be oneOf but AWSS3UploadOptions is a subset of
|
|
// AWSEC2UploadOptions. This means that all AWSEC2UploadOptions objects
|
|
// are also valid AWSS3UploadOptionas objects which violates the oneOf
|
|
// rules. Therefore, we have to use anyOf here but be aware that it isn't
|
|
// possible to mix and match more schemas together.
|
|
type UploadOptions interface{}
|
|
|
|
// UploadStatus defines model for UploadStatus.
|
|
type UploadStatus struct {
|
|
Options interface{} `json:"options"`
|
|
Status UploadStatusValue `json:"status"`
|
|
Type UploadTypes `json:"type"`
|
|
}
|
|
|
|
// UploadStatusValue defines model for UploadStatusValue.
|
|
type UploadStatusValue string
|
|
|
|
// UploadTypes defines model for UploadTypes.
|
|
type UploadTypes string
|
|
|
|
// User defines model for User.
|
|
type User struct {
|
|
Groups *[]string `json:"groups,omitempty"`
|
|
Key *string `json:"key,omitempty"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// Page defines model for page.
|
|
type Page string
|
|
|
|
// Size defines model for size.
|
|
type Size string
|
|
|
|
// PostComposeJSONBody defines parameters for PostCompose.
|
|
type PostComposeJSONBody ComposeRequest
|
|
|
|
// PostCloneComposeJSONBody defines parameters for PostCloneCompose.
|
|
type PostCloneComposeJSONBody CloneComposeBody
|
|
|
|
// GetErrorListParams defines parameters for GetErrorList.
|
|
type GetErrorListParams struct {
|
|
// Page index
|
|
Page *Page `json:"page,omitempty"`
|
|
|
|
// Number of items in each page
|
|
Size *Size `json:"size,omitempty"`
|
|
}
|
|
|
|
// PostComposeJSONRequestBody defines body for PostCompose for application/json ContentType.
|
|
type PostComposeJSONRequestBody PostComposeJSONBody
|
|
|
|
// PostCloneComposeJSONRequestBody defines body for PostCloneCompose for application/json ContentType.
|
|
type PostCloneComposeJSONRequestBody PostCloneComposeJSONBody
|
|
|
|
// ServerInterface represents all server handlers.
|
|
type ServerInterface interface {
|
|
// The status of a cloned compose
|
|
// (GET /clones/{id})
|
|
GetCloneStatus(ctx echo.Context, id string) error
|
|
// Create compose
|
|
// (POST /compose)
|
|
PostCompose(ctx echo.Context) error
|
|
// The status of a compose
|
|
// (GET /composes/{id})
|
|
GetComposeStatus(ctx echo.Context, id string) error
|
|
// Clone an existing compose
|
|
// (POST /composes/{id}/clone)
|
|
PostCloneCompose(ctx echo.Context, id string) error
|
|
// Get logs for a compose.
|
|
// (GET /composes/{id}/logs)
|
|
GetComposeLogs(ctx echo.Context, id string) error
|
|
// Get the manifests for a compose.
|
|
// (GET /composes/{id}/manifests)
|
|
GetComposeManifests(ctx echo.Context, id string) error
|
|
// Get the metadata for a compose.
|
|
// (GET /composes/{id}/metadata)
|
|
GetComposeMetadata(ctx echo.Context, id string) error
|
|
// Get a list of all possible errors
|
|
// (GET /errors)
|
|
GetErrorList(ctx echo.Context, params GetErrorListParams) error
|
|
// Get error description
|
|
// (GET /errors/{id})
|
|
GetError(ctx echo.Context, id string) error
|
|
// Get the openapi spec in json format
|
|
// (GET /openapi)
|
|
GetOpenapi(ctx echo.Context) error
|
|
}
|
|
|
|
// ServerInterfaceWrapper converts echo contexts to parameters.
|
|
type ServerInterfaceWrapper struct {
|
|
Handler ServerInterface
|
|
}
|
|
|
|
// GetCloneStatus converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetCloneStatus(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "id" -------------
|
|
var id string
|
|
|
|
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
}
|
|
|
|
ctx.Set(BearerScopes, []string{""})
|
|
|
|
// Invoke the callback with all the unmarshalled arguments
|
|
err = w.Handler.GetCloneStatus(ctx, id)
|
|
return err
|
|
}
|
|
|
|
// PostCompose converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) PostCompose(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(BearerScopes, []string{""})
|
|
|
|
// Invoke the callback with all the unmarshalled arguments
|
|
err = w.Handler.PostCompose(ctx)
|
|
return err
|
|
}
|
|
|
|
// GetComposeStatus converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetComposeStatus(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "id" -------------
|
|
var id string
|
|
|
|
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
}
|
|
|
|
ctx.Set(BearerScopes, []string{""})
|
|
|
|
// Invoke the callback with all the unmarshalled arguments
|
|
err = w.Handler.GetComposeStatus(ctx, id)
|
|
return err
|
|
}
|
|
|
|
// PostCloneCompose converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) PostCloneCompose(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "id" -------------
|
|
var id string
|
|
|
|
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
}
|
|
|
|
// Invoke the callback with all the unmarshalled arguments
|
|
err = w.Handler.PostCloneCompose(ctx, id)
|
|
return err
|
|
}
|
|
|
|
// GetComposeLogs converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetComposeLogs(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "id" -------------
|
|
var id string
|
|
|
|
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
}
|
|
|
|
// Invoke the callback with all the unmarshalled arguments
|
|
err = w.Handler.GetComposeLogs(ctx, id)
|
|
return err
|
|
}
|
|
|
|
// GetComposeManifests converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetComposeManifests(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "id" -------------
|
|
var id string
|
|
|
|
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
}
|
|
|
|
// Invoke the callback with all the unmarshalled arguments
|
|
err = w.Handler.GetComposeManifests(ctx, id)
|
|
return err
|
|
}
|
|
|
|
// GetComposeMetadata converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetComposeMetadata(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "id" -------------
|
|
var id string
|
|
|
|
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
}
|
|
|
|
ctx.Set(BearerScopes, []string{""})
|
|
|
|
// Invoke the callback with all the unmarshalled arguments
|
|
err = w.Handler.GetComposeMetadata(ctx, id)
|
|
return err
|
|
}
|
|
|
|
// GetErrorList converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetErrorList(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(BearerScopes, []string{""})
|
|
|
|
// Parameter object where we will unmarshal all parameters from the context
|
|
var params GetErrorListParams
|
|
// ------------- Optional query parameter "page" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "page", ctx.QueryParams(), ¶ms.Page)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter page: %s", err))
|
|
}
|
|
|
|
// ------------- Optional query parameter "size" -------------
|
|
|
|
err = runtime.BindQueryParameter("form", true, false, "size", ctx.QueryParams(), ¶ms.Size)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter size: %s", err))
|
|
}
|
|
|
|
// Invoke the callback with all the unmarshalled arguments
|
|
err = w.Handler.GetErrorList(ctx, params)
|
|
return err
|
|
}
|
|
|
|
// GetError converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetError(ctx echo.Context) error {
|
|
var err error
|
|
// ------------- Path parameter "id" -------------
|
|
var id string
|
|
|
|
err = runtime.BindStyledParameterWithLocation("simple", false, "id", runtime.ParamLocationPath, ctx.Param("id"), &id)
|
|
if err != nil {
|
|
return echo.NewHTTPError(http.StatusBadRequest, fmt.Sprintf("Invalid format for parameter id: %s", err))
|
|
}
|
|
|
|
ctx.Set(BearerScopes, []string{""})
|
|
|
|
// Invoke the callback with all the unmarshalled arguments
|
|
err = w.Handler.GetError(ctx, id)
|
|
return err
|
|
}
|
|
|
|
// GetOpenapi converts echo context to params.
|
|
func (w *ServerInterfaceWrapper) GetOpenapi(ctx echo.Context) error {
|
|
var err error
|
|
|
|
ctx.Set(BearerScopes, []string{""})
|
|
|
|
// Invoke the callback with all the unmarshalled arguments
|
|
err = w.Handler.GetOpenapi(ctx)
|
|
return err
|
|
}
|
|
|
|
// This is a simple interface which specifies echo.Route addition functions which
|
|
// are present on both echo.Echo and echo.Group, since we want to allow using
|
|
// either of them for path registration
|
|
type EchoRouter interface {
|
|
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
|
|
}
|
|
|
|
// RegisterHandlers adds each server route to the EchoRouter.
|
|
func RegisterHandlers(router EchoRouter, si ServerInterface) {
|
|
RegisterHandlersWithBaseURL(router, si, "")
|
|
}
|
|
|
|
// Registers handlers, and prepends BaseURL to the paths, so that the paths
|
|
// can be served under a prefix.
|
|
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string) {
|
|
|
|
wrapper := ServerInterfaceWrapper{
|
|
Handler: si,
|
|
}
|
|
|
|
router.GET(baseURL+"/clones/:id", wrapper.GetCloneStatus)
|
|
router.POST(baseURL+"/compose", wrapper.PostCompose)
|
|
router.GET(baseURL+"/composes/:id", wrapper.GetComposeStatus)
|
|
router.POST(baseURL+"/composes/:id/clone", wrapper.PostCloneCompose)
|
|
router.GET(baseURL+"/composes/:id/logs", wrapper.GetComposeLogs)
|
|
router.GET(baseURL+"/composes/:id/manifests", wrapper.GetComposeManifests)
|
|
router.GET(baseURL+"/composes/:id/metadata", wrapper.GetComposeMetadata)
|
|
router.GET(baseURL+"/errors", wrapper.GetErrorList)
|
|
router.GET(baseURL+"/errors/:id", wrapper.GetError)
|
|
router.GET(baseURL+"/openapi", wrapper.GetOpenapi)
|
|
|
|
}
|
|
|
|
// Base64 encoded, gzipped, json marshaled Swagger object
|
|
var swaggerSpec = []string{
|
|
|
|
"H4sIAAAAAAAC/+y9eXPiuNY4/FVUPG9Vz1TYl0BSNXUfICQhhCxA1qGrr7BlW2BLjiSzZKq/+1uSF2ww",
|
|
"gcztmfvc++v5Yzq2paOjo3OOzibxR0ajjksJIoJnTv/IuJBBBwnEgicTyX91xDWGXYEpyZxm7qCJACY6",
|
|
"WmayGbSEjmujRPM5tD2UOc2UMt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8ACoaZh+cr9///wAAAP//",
|
|
"G21SOR57AAA=",
|
|
}
|
|
|
|
// GetSwagger returns the content of the embedded swagger specification file
|
|
// or error if failed to decode
|
|
func decodeSpec() ([]byte, error) {
|
|
zipped, err := base64.StdEncoding.DecodeString(strings.Join(swaggerSpec, ""))
|
|
if err != nil {
|
|
return nil, fmt.Errorf("error base64 decoding spec: %s", err)
|
|
}
|
|
zr, err := gzip.NewReader(bytes.NewReader(zipped))
|
|
if err != nil {
|
|
return nil, fmt.Errorf("error decompressing spec: %s", err)
|
|
}
|
|
var buf bytes.Buffer
|
|
_, err = buf.ReadFrom(zr)
|
|
if err != nil {
|
|
return nil, fmt.Errorf("error decompressing spec: %s", err)
|
|
}
|
|
|
|
return buf.Bytes(), nil
|
|
}
|
|
|
|
var rawSpec = decodeSpecCached()
|
|
|
|
// a naive cached of a decoded swagger spec
|
|
func decodeSpecCached() func() ([]byte, error) {
|
|
data, err := decodeSpec()
|
|
return func() ([]byte, error) {
|
|
return data, err
|
|
}
|
|
}
|
|
|
|
// Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
|
|
func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error) {
|
|
var res = make(map[string]func() ([]byte, error))
|
|
if len(pathToFile) > 0 {
|
|
res[pathToFile] = rawSpec
|
|
}
|
|
|
|
return res
|
|
}
|
|
|
|
// GetSwagger returns the Swagger specification corresponding to the generated code
|
|
// in this file. The external references of Swagger specification are resolved.
|
|
// The logic of resolving external references is tightly connected to "import-mapping" feature.
|
|
// Externally referenced files must be embedded in the corresponding golang packages.
|
|
// Urls can be supported but this task was out of the scope.
|
|
func GetSwagger() (swagger *openapi3.T, err error) {
|
|
var resolvePath = PathToRawSpec("")
|
|
|
|
loader := openapi3.NewLoader()
|
|
loader.IsExternalRefsAllowed = true
|
|
loader.ReadFromURIFunc = func(loader *openapi3.Loader, url *url.URL) ([]byte, error) {
|
|
var pathToFile = url.String()
|
|
pathToFile = path.Clean(pathToFile)
|
|
getSpec, ok := resolvePath[pathToFile]
|
|
if !ok {
|
|
err1 := fmt.Errorf("path not found: %s", pathToFile)
|
|
return nil, err1
|
|
}
|
|
return getSpec()
|
|
}
|
|
var specData []byte
|
|
specData, err = rawSpec()
|
|
if err != nil {
|
|
return
|
|
}
|
|
swagger, err = loader.LoadFromData(specData)
|
|
if err != nil {
|
|
return
|
|
}
|
|
return
|
|
}
|