1130 lines
44 KiB
Go
1130 lines
44 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"
|
|
|
|
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"`
|
|
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 {
|
|
// size of the filesystem in bytes
|
|
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"`
|
|
|
|
// 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"`
|
|
|
|
// 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"`
|
|
}
|
|
|
|
// 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"`
|
|
}
|
|
|
|
// 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"`
|
|
}
|
|
|
|
// 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/+y9e3PiuNI4/FVUPG/V7FS4XwJJ1dZ5CCEJCeQGuR62coQtbAVbciSZS7bmu78lyTY2",
|
|
"mEBmZvc85/xm/9iJbanVanW3+ibxZ8agrkcJIoJnDv/MeJBBFwnEgicLyX9NxA2GPYEpyRxmrqGFACYm",
|
|
"mmeyGTSHruegRPMpdHyUOcyUMt++ZTNY9nnzEVtkshkCXflFtcxmuGEjF8ouYuHJ91wwTCzVjeP3lLEv",
|
|
"fXeEGKBjgAVyOcAEIGjYIAAYxyYEEGFTLG7ER7X9CJ9v4UcFuvnQb7fKLYcS1JLk42ogaJpYogmda0Y9",
|
|
"xASWiIyhw1E248Ve/ZlhyFLzWRsom+E2ZOhlhoX9Ag2D+sHCBDPLHP4zUypXqrX9euOgWCpn/shmFCVS",
|
|
"YQUvIGNwoebO0JuPGTIlmACHP6JmdPSKDCH76fndeQ6F5pUiPf/uCUaIZ5CfmyEucqVM9u+cdjbDCfS4",
|
|
"TcWLXu04Tu4iF35dxyqdYOm4biNjX0DhaylJEAq6OIkRdHGuaDQqxfpBpV6v1Q5qZnWURrFPknhlMn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|
|
"+FFW6GH94005FXlALBfeZFmYlpW1slKYJqCFifXRAFxAC/3gMIqIJLzsLhpmG5w/vv3/AQAA//9LboG5",
|
|
"DIEAAA==",
|
|
}
|
|
|
|
// 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
|
|
}
|