1077 lines
42 KiB
Go
1077 lines
42 KiB
Go
// Package v2 provides primitives to interact with the openapi HTTP API.
|
|
//
|
|
// Code generated by github.com/deepmap/oapi-codegen version v1.8.2 DO NOT EDIT.
|
|
package v2
|
|
|
|
import (
|
|
"bytes"
|
|
"compress/gzip"
|
|
"encoding/base64"
|
|
"fmt"
|
|
"net/http"
|
|
"net/url"
|
|
"path"
|
|
"strings"
|
|
|
|
"github.com/deepmap/oapi-codegen/pkg/runtime"
|
|
"github.com/getkin/kin-openapi/openapi3"
|
|
"github.com/labstack/echo/v4"
|
|
)
|
|
|
|
const (
|
|
BearerScopes = "Bearer.Scopes"
|
|
)
|
|
|
|
// Defines values for ComposeStatusValue.
|
|
const (
|
|
ComposeStatusValueFailure ComposeStatusValue = "failure"
|
|
|
|
ComposeStatusValuePending ComposeStatusValue = "pending"
|
|
|
|
ComposeStatusValueSuccess ComposeStatusValue = "success"
|
|
)
|
|
|
|
// Defines values for ImageStatusValue.
|
|
const (
|
|
ImageStatusValueBuilding ImageStatusValue = "building"
|
|
|
|
ImageStatusValueFailure ImageStatusValue = "failure"
|
|
|
|
ImageStatusValuePending ImageStatusValue = "pending"
|
|
|
|
ImageStatusValueRegistering ImageStatusValue = "registering"
|
|
|
|
ImageStatusValueSuccess ImageStatusValue = "success"
|
|
|
|
ImageStatusValueUploading ImageStatusValue = "uploading"
|
|
)
|
|
|
|
// Defines values for ImageTypes.
|
|
const (
|
|
ImageTypesAws ImageTypes = "aws"
|
|
|
|
ImageTypesAwsHaRhui ImageTypes = "aws-ha-rhui"
|
|
|
|
ImageTypesAwsRhui ImageTypes = "aws-rhui"
|
|
|
|
ImageTypesAwsSapRhui ImageTypes = "aws-sap-rhui"
|
|
|
|
ImageTypesAzure ImageTypes = "azure"
|
|
|
|
ImageTypesAzureEap7Rhui ImageTypes = "azure-eap7-rhui"
|
|
|
|
ImageTypesAzureRhui ImageTypes = "azure-rhui"
|
|
|
|
ImageTypesAzureSapRhui ImageTypes = "azure-sap-rhui"
|
|
|
|
ImageTypesEdgeCommit ImageTypes = "edge-commit"
|
|
|
|
ImageTypesEdgeContainer ImageTypes = "edge-container"
|
|
|
|
ImageTypesEdgeInstaller ImageTypes = "edge-installer"
|
|
|
|
ImageTypesGcp ImageTypes = "gcp"
|
|
|
|
ImageTypesGcpRhui ImageTypes = "gcp-rhui"
|
|
|
|
ImageTypesGuestImage ImageTypes = "guest-image"
|
|
|
|
ImageTypesImageInstaller ImageTypes = "image-installer"
|
|
|
|
ImageTypesIotCommit ImageTypes = "iot-commit"
|
|
|
|
ImageTypesIotContainer ImageTypes = "iot-container"
|
|
|
|
ImageTypesIotInstaller ImageTypes = "iot-installer"
|
|
|
|
ImageTypesIotRawImage ImageTypes = "iot-raw-image"
|
|
|
|
ImageTypesVsphere ImageTypes = "vsphere"
|
|
)
|
|
|
|
// Defines values for UploadStatusValue.
|
|
const (
|
|
UploadStatusValueFailure UploadStatusValue = "failure"
|
|
|
|
UploadStatusValuePending UploadStatusValue = "pending"
|
|
|
|
UploadStatusValueRunning UploadStatusValue = "running"
|
|
|
|
UploadStatusValueSuccess UploadStatusValue = "success"
|
|
)
|
|
|
|
// Defines values for UploadTypes.
|
|
const (
|
|
UploadTypesAws UploadTypes = "aws"
|
|
|
|
UploadTypesAwsS3 UploadTypes = "aws.s3"
|
|
|
|
UploadTypesAzure UploadTypes = "azure"
|
|
|
|
UploadTypesContainer UploadTypes = "container"
|
|
|
|
UploadTypesGcp UploadTypes = "gcp"
|
|
)
|
|
|
|
// AWSEC2CloneCompose defines model for AWSEC2CloneCompose.
|
|
type AWSEC2CloneCompose struct {
|
|
Region string `json:"region"`
|
|
ShareWithAccounts *[]string `json:"share_with_accounts,omitempty"`
|
|
}
|
|
|
|
// AWSEC2UploadOptions defines model for AWSEC2UploadOptions.
|
|
type AWSEC2UploadOptions struct {
|
|
Region string `json:"region"`
|
|
ShareWithAccounts []string `json:"share_with_accounts"`
|
|
SnapshotName *string `json:"snapshot_name,omitempty"`
|
|
}
|
|
|
|
// AWSEC2UploadStatus defines model for AWSEC2UploadStatus.
|
|
type AWSEC2UploadStatus struct {
|
|
Ami string `json:"ami"`
|
|
Region string `json:"region"`
|
|
}
|
|
|
|
// AWSS3UploadOptions defines model for AWSS3UploadOptions.
|
|
type AWSS3UploadOptions struct {
|
|
// If set to false (the default value), a long, obfuscated URL
|
|
// is returned. Its expiration might be sooner than for other upload
|
|
// targets.
|
|
//
|
|
// If set to true, a shorter URL is returned and
|
|
// its expiration is the same as for the other upload targets.
|
|
Public *bool `json:"public,omitempty"`
|
|
Region string `json:"region"`
|
|
}
|
|
|
|
// AWSS3UploadStatus defines model for AWSS3UploadStatus.
|
|
type AWSS3UploadStatus struct {
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
// AzureUploadOptions defines model for AzureUploadOptions.
|
|
type AzureUploadOptions struct {
|
|
// Name of the uploaded image. It must be unique in the given resource group.
|
|
// If name is omitted from the request, a random one based on a UUID is
|
|
// generated.
|
|
ImageName *string `json:"image_name,omitempty"`
|
|
|
|
// Location of the provided resource_group, where the image should be uploaded and registered.
|
|
// How to list all locations:
|
|
// https://docs.microsoft.com/en-us/cli/azure/account?view=azure-cli-latest#az_account_list_locations'
|
|
// If the location is not specified, it is deducted from the provided resource_group.
|
|
Location *string `json:"location,omitempty"`
|
|
|
|
// Name of the resource group where the image should be uploaded.
|
|
ResourceGroup string `json:"resource_group"`
|
|
|
|
// ID of subscription where the image should be uploaded.
|
|
SubscriptionId string `json:"subscription_id"`
|
|
|
|
// ID of the tenant where the image should be uploaded.
|
|
// How to find it in the Azure Portal:
|
|
// https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-how-to-find-tenant
|
|
TenantId string `json:"tenant_id"`
|
|
}
|
|
|
|
// AzureUploadStatus defines model for AzureUploadStatus.
|
|
type AzureUploadStatus struct {
|
|
ImageName string `json:"image_name"`
|
|
}
|
|
|
|
// CloneComposeBody defines model for CloneComposeBody.
|
|
type CloneComposeBody interface{}
|
|
|
|
// CloneComposeResponse defines model for CloneComposeResponse.
|
|
type CloneComposeResponse struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
Id string `json:"id"`
|
|
}
|
|
|
|
// CloneStatus defines model for CloneStatus.
|
|
type CloneStatus struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded struct due to allOf(#/components/schemas/UploadStatus)
|
|
UploadStatus `yaml:",inline"`
|
|
}
|
|
|
|
// ComposeId defines model for ComposeId.
|
|
type ComposeId struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
Id string `json:"id"`
|
|
}
|
|
|
|
// ComposeLogs defines model for ComposeLogs.
|
|
type ComposeLogs struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
ImageBuilds []interface{} `json:"image_builds"`
|
|
Koji *KojiLogs `json:"koji,omitempty"`
|
|
}
|
|
|
|
// ComposeManifests defines model for ComposeManifests.
|
|
type ComposeManifests struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
Manifests []interface{} `json:"manifests"`
|
|
}
|
|
|
|
// ComposeMetadata defines model for ComposeMetadata.
|
|
type ComposeMetadata struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
// ID (hash) of the built commit
|
|
OstreeCommit *string `json:"ostree_commit,omitempty"`
|
|
|
|
// Package list including NEVRA
|
|
Packages *[]PackageMetadata `json:"packages,omitempty"`
|
|
}
|
|
|
|
// ComposeRequest defines model for ComposeRequest.
|
|
type ComposeRequest struct {
|
|
Customizations *Customizations `json:"customizations,omitempty"`
|
|
Distribution string `json:"distribution"`
|
|
ImageRequest *ImageRequest `json:"image_request,omitempty"`
|
|
ImageRequests *[]ImageRequest `json:"image_requests,omitempty"`
|
|
Koji *Koji `json:"koji,omitempty"`
|
|
}
|
|
|
|
// ComposeStatus defines model for ComposeStatus.
|
|
type ComposeStatus struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
ImageStatus ImageStatus `json:"image_status"`
|
|
ImageStatuses *[]ImageStatus `json:"image_statuses,omitempty"`
|
|
KojiStatus *KojiStatus `json:"koji_status,omitempty"`
|
|
Status ComposeStatusValue `json:"status"`
|
|
}
|
|
|
|
// ComposeStatusError defines model for ComposeStatusError.
|
|
type ComposeStatusError struct {
|
|
Details *interface{} `json:"details,omitempty"`
|
|
Id int `json:"id"`
|
|
Reason string `json:"reason"`
|
|
}
|
|
|
|
// ComposeStatusValue defines model for ComposeStatusValue.
|
|
type ComposeStatusValue string
|
|
|
|
// Container defines model for Container.
|
|
type Container struct {
|
|
// Name to use for the container from the image
|
|
Name *string `json:"name,omitempty"`
|
|
Source string `json:"source"`
|
|
|
|
// Control TLS verifification
|
|
TlsVerify *bool `json:"tls_verify,omitempty"`
|
|
}
|
|
|
|
// ContainerUploadOptions defines model for ContainerUploadOptions.
|
|
type ContainerUploadOptions struct {
|
|
// Name for the created container image
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// Tag for the created container image
|
|
Tag *string `json:"tag,omitempty"`
|
|
}
|
|
|
|
// ContainerUploadStatus defines model for ContainerUploadStatus.
|
|
type ContainerUploadStatus struct {
|
|
// Digest of the manifest of the uploaded container on the registry
|
|
Digest string `json:"digest"`
|
|
|
|
// FQDN of the uploaded image
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
// CustomRepository defines model for CustomRepository.
|
|
type CustomRepository struct {
|
|
Baseurl *[]string `json:"baseurl,omitempty"`
|
|
CheckGpg *bool `json:"check_gpg,omitempty"`
|
|
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"`
|
|
RepoCheckGpg *bool `json:"repo_check_gpg,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"`
|
|
Packages *[]string `json:"packages,omitempty"`
|
|
|
|
// Extra repositories for packages specified in customizations. These
|
|
// repositories will only be used to depsolve and retrieve packages
|
|
// for the OS itself (they will not be available for the build root or
|
|
// any other part of the build process). The package_sets field for these
|
|
// repositories is ignored.
|
|
PayloadRepositories *[]Repository `json:"payload_repositories,omitempty"`
|
|
Services *struct {
|
|
// List of services to disable by default
|
|
Disabled *[]string `json:"disabled,omitempty"`
|
|
|
|
// List of services to enable by default
|
|
Enabled *[]string `json:"enabled,omitempty"`
|
|
} `json:"services,omitempty"`
|
|
Subscription *Subscription `json:"subscription,omitempty"`
|
|
Users *[]User `json:"users,omitempty"`
|
|
}
|
|
|
|
// A custom directory to create in the final artifact.
|
|
type Directory struct {
|
|
// Ensure that the parent directories exist
|
|
EnsureParents *bool `json:"ensure_parents,omitempty"`
|
|
|
|
// Group of the directory as a group name or a gid
|
|
Group *interface{} `json:"group,omitempty"`
|
|
|
|
// Permissions string for the directory in octal format
|
|
Mode *string `json:"mode,omitempty"`
|
|
|
|
// Path to the directory
|
|
Path string `json:"path"`
|
|
|
|
// Owner of the directory as a user name or a uid
|
|
User *interface{} `json:"user,omitempty"`
|
|
}
|
|
|
|
// Error defines model for Error.
|
|
type Error struct {
|
|
// Embedded struct due to allOf(#/components/schemas/ObjectReference)
|
|
ObjectReference `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
Code string `json:"code"`
|
|
Details *interface{} `json:"details,omitempty"`
|
|
OperationId string `json:"operation_id"`
|
|
Reason string `json:"reason"`
|
|
}
|
|
|
|
// ErrorList defines model for ErrorList.
|
|
type ErrorList struct {
|
|
// Embedded struct due to allOf(#/components/schemas/List)
|
|
List `yaml:",inline"`
|
|
// Embedded fields due to inline allOf schema
|
|
Items []Error `json:"items"`
|
|
}
|
|
|
|
// A custom file to create in the final artifact.
|
|
type File struct {
|
|
// Contents of the file as plain text
|
|
Data *string `json:"data,omitempty"`
|
|
|
|
// Ensure that the parent directories exist
|
|
EnsureParents *bool `json:"ensure_parents,omitempty"`
|
|
|
|
// Group of the file as a gid or a group name
|
|
Group *interface{} `json:"group,omitempty"`
|
|
|
|
// Permissions string for the file in octal format
|
|
Mode *string `json:"mode,omitempty"`
|
|
|
|
// Path to the file
|
|
Path string `json:"path"`
|
|
|
|
// Owner of the file as a uid or a user name
|
|
User *interface{} `json:"user,omitempty"`
|
|
}
|
|
|
|
// Filesystem defines model for Filesystem.
|
|
type Filesystem struct {
|
|
MinSize uint64 `json:"min_size"`
|
|
Mountpoint string `json:"mountpoint"`
|
|
}
|
|
|
|
// GCPUploadOptions defines model for GCPUploadOptions.
|
|
type GCPUploadOptions struct {
|
|
// Name of an existing STANDARD Storage class Bucket.
|
|
Bucket *string `json:"bucket,omitempty"`
|
|
|
|
// The name to use for the imported and shared Compute Engine image.
|
|
// The image name must be unique within the GCP project, which is used
|
|
// for the OS image upload and import. If not specified a random
|
|
// 'composer-api-<uuid>' string is used as the image name.
|
|
ImageName *string `json:"image_name,omitempty"`
|
|
|
|
// The GCP region where the OS image will be imported to and shared from.
|
|
// The value must be a valid GCP location. See https://cloud.google.com/storage/docs/locations.
|
|
// If not specified, the multi-region location closest to the source
|
|
// (source Storage Bucket location) is chosen automatically.
|
|
Region string `json:"region"`
|
|
|
|
// List of valid Google accounts to share the imported Compute Engine image with.
|
|
// Each string must contain a specifier of the account type. Valid formats are:
|
|
// - 'user:{emailid}': An email address that represents a specific
|
|
// Google account. For example, 'alice@example.com'.
|
|
// - 'serviceAccount:{emailid}': An email address that represents a
|
|
// service account. For example, 'my-other-app@appspot.gserviceaccount.com'.
|
|
// - 'group:{emailid}': An email address that represents a Google group.
|
|
// For example, 'admins@example.com'.
|
|
// - 'domain:{domain}': The G Suite domain (primary) that represents all
|
|
// the users of that domain. For example, 'google.com' or 'example.com'.
|
|
// If not specified, the imported Compute Engine image is not shared with any
|
|
// account.
|
|
ShareWithAccounts *[]string `json:"share_with_accounts,omitempty"`
|
|
}
|
|
|
|
// GCPUploadStatus defines model for GCPUploadStatus.
|
|
type GCPUploadStatus struct {
|
|
ImageName string `json:"image_name"`
|
|
ProjectId string `json:"project_id"`
|
|
}
|
|
|
|
// ImageRequest defines model for ImageRequest.
|
|
type ImageRequest struct {
|
|
Architecture string `json:"architecture"`
|
|
ImageType ImageTypes `json:"image_type"`
|
|
Ostree *OSTree `json:"ostree,omitempty"`
|
|
Repositories []Repository `json:"repositories"`
|
|
|
|
// This should really be oneOf but AWSS3UploadOptions is a subset of
|
|
// AWSEC2UploadOptions. This means that all AWSEC2UploadOptions objects
|
|
// are also valid AWSS3UploadOptionas objects which violates the oneOf
|
|
// rules. Therefore, we have to use anyOf here but be aware that it isn't
|
|
// possible to mix and match more schemas together.
|
|
UploadOptions *UploadOptions `json:"upload_options,omitempty"`
|
|
}
|
|
|
|
// ImageStatus defines model for ImageStatus.
|
|
type ImageStatus struct {
|
|
Error *ComposeStatusError `json:"error,omitempty"`
|
|
Status ImageStatusValue `json:"status"`
|
|
UploadStatus *UploadStatus `json:"upload_status,omitempty"`
|
|
}
|
|
|
|
// ImageStatusValue defines model for ImageStatusValue.
|
|
type ImageStatusValue string
|
|
|
|
// ImageTypes defines model for ImageTypes.
|
|
type ImageTypes string
|
|
|
|
// Koji defines model for Koji.
|
|
type Koji struct {
|
|
Name string `json:"name"`
|
|
Release string `json:"release"`
|
|
Server string `json:"server"`
|
|
TaskId int `json:"task_id"`
|
|
Version string `json:"version"`
|
|
}
|
|
|
|
// KojiLogs defines model for KojiLogs.
|
|
type KojiLogs struct {
|
|
Import interface{} `json:"import"`
|
|
Init interface{} `json:"init"`
|
|
}
|
|
|
|
// KojiStatus defines model for KojiStatus.
|
|
type KojiStatus struct {
|
|
BuildId *int `json:"build_id,omitempty"`
|
|
}
|
|
|
|
// List defines model for List.
|
|
type List struct {
|
|
Kind string `json:"kind"`
|
|
Page int `json:"page"`
|
|
Size int `json:"size"`
|
|
Total int `json:"total"`
|
|
}
|
|
|
|
// OSTree defines model for OSTree.
|
|
type OSTree struct {
|
|
// A URL which, if set, is used for fetching content. Implies that `url` is set as well,
|
|
// which will be used for metadata only.
|
|
Contenturl *string `json:"contenturl,omitempty"`
|
|
|
|
// Can be either a commit (example: 02604b2da6e954bd34b8b82a835e5a77d2b60ffa), or a branch-like reference (example: rhel/8/x86_64/edge)
|
|
Parent *string `json:"parent,omitempty"`
|
|
Ref *string `json:"ref,omitempty"`
|
|
|
|
// Determines whether a valid subscription manager (candlepin) identity is required to
|
|
// access this repository. Consumer certificates will be used as client certificates when
|
|
// fetching metadata and content.
|
|
Rhsm *bool `json:"rhsm,omitempty"`
|
|
Url *string `json:"url,omitempty"`
|
|
}
|
|
|
|
// ObjectReference defines model for ObjectReference.
|
|
type ObjectReference struct {
|
|
Href string `json:"href"`
|
|
Id string `json:"id"`
|
|
Kind string `json:"kind"`
|
|
}
|
|
|
|
// 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/+x9eXPiuLb4V1HxflU9XWFfEpKqqfuAkIQQsgBZh65cYcu2wJYcSWbJVH/3X0lesMEE",
|
|
"Mrdn5t77ev6Yjm3p6OjonKOzSfye0ajjUoKI4JmT3zMuZNBBArHgyUTyXx1xjWFXYEoyJ5lbaCKAiY4W",
|
|
"mWwGLaDj2ijRfAZtD2VOMqXM9+/ZDJZ93jzElplshkBHflEtsxmuWciBsotYuvI9FwwTU3Xj+D1l7GvP",
|
|
"GSMGqAGwQA4HmAAENQsEAOPYhAAibIrFrfioth/h8z38qEA3HgftVrllU4JaknxcDeQy6iImsD88Q6ZC",
|
|
"eQNWNsMtyNDrHAvrFWoa9QLaB8hnTn7LlMqVau3wqH5cLJUz37IZNdlUWMEL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qPZ+ynvao/",
|
|
"aoA02fye2LUlWRKnQT8QADsoWv4ju7iBCeZWbBMHH+7hWKy27qzyKFRU3EECAkx8HsaUADimnghvSfds",
|
|
"8dE2r2quf27yOzf54JrgVNGQLBAd2vV/zSByEDEBhKq0L9Y8G7LglCL4RVjUM60gpXE5uLn+mv+vE6Rz",
|
|
"dSLVDBPkIZeniVHiyuMPZSlquYc49dUPfXBVzxndWyiRUT54oM5I/Ccl8kAdQ40aa1QJFo+O/PvLpyMD",
|
|
"qx8QESAejg3uIPSrIyAJ7yTMheDytQ9EcXWV9E953CmPK2JtEcrEcm8I5n+nrCXFYw+hi9WVfyxz0QkM",
|
|
"KXIbcuafl0cLqInERhT9zo6OXER0vroYVMlaFPpXp7g/kowQz5+CsVswotvKt8hFuJSfkYufTupPJ/Xf",
|
|
"zUnd0E1p+k4Bj9sUGypmdVvVhnJJm9mqSUEdtNtW4hBrp07i/amiv5pDGrf7v4FADRAQ46eY/T1i5jP6",
|
|
"f56QwYiBoG2DqP4p5KaVmO2OaEPiFz0QLTpf5WO2uk9ovARq60wX1P3jRyho/i/t+pW/eA/fupTqA4i/",
|
|
"+ynFP6X4M1KMNjlISm5U5LN9h7wJmqTzfRLZAJySZ+lZSxqEd+79B9oWH07ne1QHnaaJesHlRlT3NP9G",
|
|
"ruiKhGQZF3RxXo7DLRz8iB50sf9THDkVPUAsF96sVpiVlcWxVlwmoImJ+dEAXEAT/YvDKCKS8PKlaJhd",
|
|
"cL59//8BAAD//wGZi7xIegAA",
|
|
}
|
|
|
|
// 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
|
|
}
|