debian-forge-composer/internal/cloudapi/v2/openapi.v2.gen.go
Achilleas Koutsou 24b4647a14 cloudapi: add multiple upload_targets to ImageRequest
Add an upload_targets field to the image request.  This lets the API
caller specify multiple upload targets and upload options to be used.
If the upload target type does not match the upload options, the request
is invalid.

For backwards compatibility, the upload targets field is optional.  If
it is not specified, the default upload target and upload options for
the image type are assumed, which is the same as the old behaviour.

Adding an explicit selection to the request makes it possible to support
multiple upload targets for the same image type.  We plan to support
ostree commits being uploaded to both aws.s3 and pulp.

To report on the multiple upload requests, we add an upload_statuses
field to the ImageStatus response.
2023-11-17 16:48:16 +01:00

1307 lines
50 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 CustomizationsPartitioningMode.
const (
CustomizationsPartitioningModeAutoLvm CustomizationsPartitioningMode = "auto-lvm"
CustomizationsPartitioningModeLvm CustomizationsPartitioningMode = "lvm"
CustomizationsPartitioningModeRaw CustomizationsPartitioningMode = "raw"
)
// 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"
ImageTypesOci ImageTypes = "oci"
ImageTypesVsphere ImageTypes = "vsphere"
ImageTypesVsphereOva ImageTypes = "vsphere-ova"
ImageTypesWsl ImageTypes = "wsl"
)
// 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"
UploadTypesOciObjectstorage UploadTypes = "oci.objectstorage"
)
// 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"`
// Reference to the container to embed
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"`
// FIDO device onboard configuration
Fdo *FDO `json:"fdo,omitempty"`
Files *[]File `json:"files,omitempty"`
Filesystem *[]Filesystem `json:"filesystem,omitempty"`
// Firewalld configuration
Firewall *FirewallCustomization `json:"firewall,omitempty"`
// List of groups to create
Group *[]Group `json:"group,omitempty"`
// Configures the hostname
Hostname *string `json:"hostname,omitempty"`
// Ignition configuration
Ignition *Ignition `json:"ignition,omitempty"`
// Name of the installation device, currently only useful for the edge-simplified-installer type
InstallationDevice *string `json:"installation_device,omitempty"`
Kernel *Kernel `json:"kernel,omitempty"`
// Locale configuration
Locale *Locale `json:"locale,omitempty"`
Openscap *OpenSCAP `json:"openscap,omitempty"`
Packages *[]string `json:"packages,omitempty"`
// Select how the disk image will be partitioned. 'auto-lvm' will use raw unless
// there are one or more mountpoints in which case it will use LVM. 'lvm' always
// uses LVM, even when there are no extra mountpoints. 'raw' uses raw partitions
// even when there are one or more mountpoints.
PartitioningMode *CustomizationsPartitioningMode `json:"partitioning_mode,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 *Services `json:"services,omitempty"`
// List of ssh keys
Sshkey *[]SSHKey `json:"sshkey,omitempty"`
Subscription *Subscription `json:"subscription,omitempty"`
// Timezone configuration
Timezone *Timezone `json:"timezone,omitempty"`
Users *[]User `json:"users,omitempty"`
}
// Select how the disk image will be partitioned. 'auto-lvm' will use raw unless
// there are one or more mountpoints in which case it will use LVM. 'lvm' always
// uses LVM, even when there are no extra mountpoints. 'raw' uses raw partitions
// even when there are one or more mountpoints.
type CustomizationsPartitioningMode string
// 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"`
}
// FIDO device onboard configuration
type FDO struct {
DiunPubKeyHash *string `json:"diun_pub_key_hash,omitempty"`
DiunPubKeyInsecure *string `json:"diun_pub_key_insecure,omitempty"`
DiunPubKeyRootCerts *string `json:"diun_pub_key_root_certs,omitempty"`
ManufacturingServerUrl *string `json:"manufacturing_server_url,omitempty"`
}
// 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 {
// size of the filesystem in bytes
MinSize uint64 `json:"min_size"`
Mountpoint string `json:"mountpoint"`
}
// Firewalld configuration
type FirewallCustomization struct {
// List of ports (or port ranges) and protocols to open
Ports *[]string `json:"ports,omitempty"`
// Firewalld services to enable or disable
Services *struct {
// List of services to disable
Disabled *[]string `json:"disabled,omitempty"`
// List of services to enable
Enabled *[]string `json:"enabled,omitempty"`
} `json:"services,omitempty"`
}
// 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"`
}
// Group defines model for Group.
type Group struct {
// Group id of the group to create (optional)
Gid *int `json:"gid,omitempty"`
// Name of the group to create
Name string `json:"name"`
}
// Ignition configuration
type Ignition struct {
Embedded *IgnitionEmbedded `json:"embedded,omitempty"`
Firstboot *IgnitionFirstboot `json:"firstboot,omitempty"`
}
// IgnitionEmbedded defines model for IgnitionEmbedded.
type IgnitionEmbedded struct {
Config string `json:"config"`
}
// IgnitionFirstboot defines model for IgnitionFirstboot.
type IgnitionFirstboot struct {
// Provisioning URL
Url string `json:"url"`
}
// 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"`
// Size of image, in bytes. When set to 0 the image size is a minimum
// defined by the image type.
Size *uint64 `json:"size,omitempty"`
// Options for a given upload destination.
// 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"`
// The type and options for multiple upload targets. Each item defines
// a separate upload destination with its own options. Multiple
// different targets as well as multiple targets of the same kind are
// supported.
UploadTargets *[]UploadTarget `json:"upload_targets,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
// Kernel defines model for Kernel.
type Kernel struct {
// Appends arguments to the bootloader kernel command line
Append *string `json:"append,omitempty"`
// Name of the kernel to use
Name *string `json:"name,omitempty"`
}
// 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"`
}
// LocalUploadOptions defines model for LocalUploadOptions.
type LocalUploadOptions struct {
// This is used in combination with the OSBUILD_LOCALSAVE environmental
// variable on the server to enable saving the compose locally. This
// is for development use only, and is not available to users.
LocalSave bool `json:"local_save"`
}
// Locale configuration
type Locale struct {
// Sets the keyboard layout
Keyboard *string `json:"keyboard,omitempty"`
// List of locales to be installed, the first one becomes primary, subsequent ones are secondary
Languages *[]string `json:"languages,omitempty"`
}
// OCIUploadOptions defines model for OCIUploadOptions.
type OCIUploadOptions map[string]interface{}
// OCIUploadStatus defines model for OCIUploadStatus.
type OCIUploadStatus struct {
Url string `json:"url"`
}
// 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"`
Tailoring *OpenSCAPTailoring `json:"tailoring,omitempty"`
}
// OpenSCAPTailoring defines model for OpenSCAPTailoring.
type OpenSCAPTailoring struct {
Selected *[]string `json:"selected,omitempty"`
Unselected *[]string `json:"unselected,omitempty"`
}
// 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"`
}
// SSHKey defines model for SSHKey.
type SSHKey struct {
// Adds the key to the user's authorized_keys file
Key string `json:"key"`
// User to configure the ssh key for
User string `json:"user"`
}
// Services defines model for Services.
type 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"`
}
// 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"`
}
// Timezone configuration
type Timezone struct {
// List of ntp servers
Ntpservers *[]string `json:"ntpservers,omitempty"`
// Name of the timezone, defaults to UTC
Timezone *string `json:"timezone,omitempty"`
}
// Options for a given upload destination.
// 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
// UploadTarget defines model for UploadTarget.
type UploadTarget struct {
Type UploadTypes `json:"type"`
// Options for a given upload destination.
// 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"`
}
// 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(), &params.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(), &params.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/+y9e3PiONY4/FVUPG9VuivcLwlJ1dQ+hJCEBHKDXJeurLCFrWBLjiRDyFR/97ck2cYG",
"E6C7Z/bZ/fX8MR1s6ejoSOfoXOU/MwZ1PUoQETxz+GfGgwy6SCAW/LKQ/NdE3GDYE5iSzGHmGloIYGKi",
"90w2g96h6zko0XwCHR9lDjOlzPfv2QyWfd58xGaZbIZAV75RLbMZbtjIhbKLmHnyORcME0t14/gjZexL",
"3x0iBugIYIFcDjABCBo2CADGsQkBRNgUiyvxUW0/w+d7+FKBbjz0Ws1y06EENSX5uBoImiaWaELnmlEP",
"MYElIiPocJTNeLFHf2YYstR8lgbKZrgNGXqZYmG/QMOgfrAwwcwyh//MlMqVam1vv35QLJUz37IZRYlU",
"WMEDyBicqbkz9OZjhkwJJsDhW9SMDl+RIWQ/Pb87z6HQvFKk5z88wQjxDPJzU8RFrpTJ/p3TzmY4gR63",
"qXjRqx3HyZ3lwrfLWKUTLB3XdWTsCSh8zSUJQkEXJzGCLs4VjXqluH9Q2d+v1Q5qZnWYRrEtSbwwGTlu",
"ds0e6FV+Zgt4/tDBhmbhEfQdEbVLsnR7BDgSQFCgXoMvwkYg6AIU837NAggcSqwsoMORzw0okAnubjsD",
"gjlgSPiMIDMP2oID9O5hBiVo4GLLFmCIAKeUIAaEDQkYUQaosBEDvprbgAjILCR4fkAGZI6LYD6Sw3Kb",
"MoGYHA3EBgOQmAOCkwNiDiTuHLoIQK6Gkr/jw4H5aPMlGlLqIEh+flE3W85VW9FnTroojg8hG6XC//AZ",
"+pntgl1ooYhDF6S+pCgdKWpqOiITqA5y0YHrc7XOPsFvvjyaVEMLTxABDHHqMwMBi1Hfy6slloPIxaIu",
"FnInjRh1VRc5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M",
"4pPyAfTNpFf1Vw2QxpvfE6e2JEvikq1PGMAJCvR+5BQfYYK5HTvEwadnOBbzo1sXZKnogYsEBJjoPYwp",
"AXBIfRF+ddZ3xGfHvKov/H3Irz3kg88uprKG3ALRXWg68BQZiJgAQvWt7IbvQBZc/gS+CJv6lh2Efs57",
"V5df8/91jHSqLvqywphcuMvT2CjxCclPeSlquQE73aqvqnOV3x996Ukio2zwQJyR+Ce6g7sgosYGVYwV",
"1XkHyxfehQEFiLtjg6826Ww5SMKvOOVCcPnaJ6w4/zTnb35cy49zYq1gysRyLzHmfyevJdljA6aL1Rl9",
"znNRXaNkuSU+09cQondoiMRBxBT7IROYSF+bQBO8Frn+1SUyn3FGiOdvxljPGNHXX1fwRbiU2/DFbyP1",
"t5H6f81IXZJNafJOAY/rFEsiZv4VgCXhkjazeZOCulRiVVJHrJ26deIvZf35HNJ2u/6mNB2BgBi/2ezf",
"w2Z6o//nMRmMNhB0HBDliYW7ac5m6z3akOikB2JEuZkas/k1zcMZUEdnOqNu7j9CQfOfOvUrf/MZvnIp",
"1QsQf/abi39z8TZcjJZ3kOTcKMln9Ql5FTT5yX2/mH+1NNEAFSULpFUuQYQf+vgP1Es+nc73qPAgTYp1",
"g/umqekb+pL06CqxZAoY9HBefYvRxiNd8QE9rD98nlOeB8Ry4WX3hUlZaSsLiWkCWphYnw3ABbTQTw4T",
"fPcyuA87GmYdnG/f//8AAAD//7HsIbZIlAAA",
}
// 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
}