debian-forge-composer/internal/cloudapi/v2/openapi.v2.gen.go
Gianluca Zuccarelli b711e302ba cloudapi: add pulp upload target
Add the pulp.ostree upload target to the cloud API and enable it for
edge/iot commits.

Co-Authored-By: Achilleas Koutsou <achilleas@koutsou.net>
2023-11-17 16:48:16 +01:00

1327 lines
51 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"
UploadTypesPulpOstree UploadTypes = "pulp.ostree"
)
// 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"`
UploadStatuses *[]UploadStatus `json:"upload_statuses,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"`
}
// PulpOSTreeUploadOptions defines model for PulpOSTreeUploadOptions.
type PulpOSTreeUploadOptions struct {
// Basepath for distributing the repository
Basepath string `json:"basepath"`
// Repository to import the ostree commit to
Repository *string `json:"repository,omitempty"`
ServerAddress *string `json:"server_address,omitempty"`
}
// PulpOSTreeUploadStatus defines model for PulpOSTreeUploadStatus.
type PulpOSTreeUploadStatus struct {
RepoUrl string `json:"repo_url"`
}
// 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+flE3W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RgxIe3BShHGITxGAo3JW8D0wa9bFT7TXFLG7g8GXB",
"dU25CD/HpIUM4iL8sNOv4fjkJ0m+J49PKcy+L8mb0q8evW2mLX3wEtiQy/VjApn/NqHD5t8j+S15fkue",
"DSVPIDTSJM2vUp620JdCGq5RlBIfxdlIVYoA/z+mLCUolbKDknT5rTD9Flv/oQrTSvmlDcG41pSiv8S/",
"KbmRPIkJq/9DUuQv0L0Wv9b5d2tfad/2TNlS6jIyNJ3ffzNEqtxGf4woXa4J9C4K6mbOJD4pX+XfTHpV",
"f9UAabz5PXFqS7Ikbn77hAGcoLrzR07xESaY27FDHHx6hmMxP7p1NZ8KQbhIQICJ3sOYEgCH1Bfhp5B9",
"R3x2zKvi1N+H/NpDPvgWaCpryC0QXdCno1eRgYgJIFR/KsDwHciCG8nAF2FT37KD+NF57+rya/6/jpFO",
"1e1zVhjYC3d5Ghslvmv6KS9FLTdgp1v1qX+uiguiz49JZJQNHogzEv9ufHBBSdTYoIqxoksCguULL2iB",
"AsTdscGnxHSqHiThp8VyIbh87RNWnH8v9jc/ruXHObFWMGViuZcY87+T15LssQHTxYrUPue5qChWstwS",
"n+m7MdE7NETiIGKK/ZAJTKTv3KAJXotc/+pmo884I8TzN2OsZ4zok8Qr+CJcym344reR+ttI/b9mpC7J",
"pjR5p4DHdYolETP/NMWScEmb2bxJQd1IsirTI9ZOXVnyl7L+fA5pu11/6JyOQECM32z272EzvdH/85gM",
"RhsIOg6Iks3C3TRns/UebUh00gMxosRQjdn87vDhDKijM51RN/cfoaD5T536lb/5DF+5lOoFiD/7zcW/",
"uXgbLkbLO0hybpTks/qEvAqa/OS+X8y/WppogIqSBdIqlyDCr8/8B+oln07ne1T1kCbFusEl6NT0DX1z",
"f3QPXTIFDHo4rz4QauORLjeBHtZf488pzwNiufALDIVJWWkrC4lpAlqYWJ8NwAW00E8OE3yMNbikPRpm",
"HZxv3///AAAA//+4oHJX3ZYAAA==",
}
// 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
}