1586 lines
61 KiB
Go
1586 lines
61 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 BlueprintCustomizationsPartitioningMode.
|
|
const (
|
|
BlueprintCustomizationsPartitioningModeAutoLvm BlueprintCustomizationsPartitioningMode = "auto-lvm"
|
|
|
|
BlueprintCustomizationsPartitioningModeLvm BlueprintCustomizationsPartitioningMode = "lvm"
|
|
|
|
BlueprintCustomizationsPartitioningModeRaw BlueprintCustomizationsPartitioningMode = "raw"
|
|
)
|
|
|
|
// 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"
|
|
|
|
ImageTypesIotBootableContainer ImageTypes = "iot-bootable-container"
|
|
|
|
ImageTypesIotCommit ImageTypes = "iot-commit"
|
|
|
|
ImageTypesIotContainer ImageTypes = "iot-container"
|
|
|
|
ImageTypesIotInstaller ImageTypes = "iot-installer"
|
|
|
|
ImageTypesIotRawImage ImageTypes = "iot-raw-image"
|
|
|
|
ImageTypesIotSimplifiedInstaller ImageTypes = "iot-simplified-installer"
|
|
|
|
ImageTypesLiveInstaller ImageTypes = "live-installer"
|
|
|
|
ImageTypesMinimalRaw ImageTypes = "minimal-raw"
|
|
|
|
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"`
|
|
}
|
|
|
|
// Blueprint defines model for Blueprint.
|
|
type Blueprint struct {
|
|
// Container images to embed into the final artfact
|
|
Containers *[]Container `json:"containers,omitempty"`
|
|
Customizations *BlueprintCustomizations `json:"customizations,omitempty"`
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
// The distribution to use for the compose. If left empty the host
|
|
// distro will be used.
|
|
Distro *string `json:"distro,omitempty"`
|
|
|
|
// Package groups to be installed
|
|
Groups *[]PackageGroup `json:"groups,omitempty"`
|
|
|
|
// An alias for packages, retained for backwards compatability
|
|
Modules *[]Package `json:"modules,omitempty"`
|
|
Name string `json:"name"`
|
|
|
|
// Packages to be installed
|
|
Packages *[]Package `json:"packages,omitempty"`
|
|
|
|
// A semver version number
|
|
Version *string `json:"version,omitempty"`
|
|
}
|
|
|
|
// BlueprintCustomizations defines model for BlueprintCustomizations.
|
|
type BlueprintCustomizations struct {
|
|
// Directories to create in the final artifact
|
|
Directories *[]Directory `json:"directories,omitempty"`
|
|
|
|
// FIDO device onboard configuration
|
|
Fdo *FDO `json:"fdo,omitempty"`
|
|
|
|
// Files to create in the final artifact
|
|
Files *[]BlueprintFile `json:"files,omitempty"`
|
|
|
|
// List of filesystem mountpoints to create
|
|
Filesystem *[]BlueprintFilesystem `json:"filesystem,omitempty"`
|
|
|
|
// Enable FIPS mode
|
|
Fips *bool `json:"fips,omitempty"`
|
|
|
|
// Firewalld configuration
|
|
Firewall *BlueprintFirewall `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 *BlueprintOpenSCAP `json:"openscap,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 *BlueprintCustomizationsPartitioningMode `json:"partitioning_mode,omitempty"`
|
|
|
|
// Repositories to write to /etc/yum.repos.d/ in the final image. Note
|
|
// that these are not used at build time.
|
|
Repositories *[]BlueprintRepository `json:"repositories,omitempty"`
|
|
Services *Services `json:"services,omitempty"`
|
|
|
|
// List of ssh keys
|
|
Sshkey *[]SSHKey `json:"sshkey,omitempty"`
|
|
|
|
// Timezone configuration
|
|
Timezone *Timezone `json:"timezone,omitempty"`
|
|
|
|
// List of users to create
|
|
User *[]BlueprintUser `json:"user,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 BlueprintCustomizationsPartitioningMode string
|
|
|
|
// A custom file to create in the final artifact.
|
|
type BlueprintFile struct {
|
|
// Contents of the file as plain text
|
|
Data *string `json:"data,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"`
|
|
}
|
|
|
|
// BlueprintFilesystem defines model for BlueprintFilesystem.
|
|
type BlueprintFilesystem struct {
|
|
// size of the filesystem in bytes
|
|
Minsize uint64 `json:"minsize"`
|
|
Mountpoint string `json:"mountpoint"`
|
|
}
|
|
|
|
// Firewalld configuration
|
|
type BlueprintFirewall struct {
|
|
// List of ports (or port ranges) and protocols to open
|
|
Ports *[]string `json:"ports,omitempty"`
|
|
|
|
// Firewalld services to enable or disable
|
|
Services *FirewallServices `json:"services,omitempty"`
|
|
Zones *[]FirewallZones `json:"zones,omitempty"`
|
|
}
|
|
|
|
// BlueprintOpenSCAP defines model for BlueprintOpenSCAP.
|
|
type BlueprintOpenSCAP struct {
|
|
Datastream *string `json:"datastream,omitempty"`
|
|
ProfileId string `json:"profile_id"`
|
|
Tailoring *OpenSCAPTailoring `json:"tailoring,omitempty"`
|
|
}
|
|
|
|
// BlueprintRepository defines model for BlueprintRepository.
|
|
type BlueprintRepository struct {
|
|
Baseurls *[]string `json:"baseurls,omitempty"`
|
|
Enabled *bool `json:"enabled,omitempty"`
|
|
Filename *string `json:"filename,omitempty"`
|
|
Gpgcheck *bool `json:"gpgcheck,omitempty"`
|
|
Gpgkeys *[]string `json:"gpgkeys,omitempty"`
|
|
Id string `json:"id"`
|
|
Metalink *string `json:"metalink,omitempty"`
|
|
Mirrorlist *string `json:"mirrorlist,omitempty"`
|
|
|
|
// Disables modularity filtering for this repository.
|
|
ModuleHotfixes *bool `json:"module_hotfixes,omitempty"`
|
|
Name *string `json:"name,omitempty"`
|
|
Priority *int `json:"priority,omitempty"`
|
|
RepoGpgcheck *bool `json:"repo_gpgcheck,omitempty"`
|
|
Sslverify *bool `json:"sslverify,omitempty"`
|
|
}
|
|
|
|
// BlueprintUser defines model for BlueprintUser.
|
|
type BlueprintUser struct {
|
|
Description *string `json:"description,omitempty"`
|
|
|
|
// Group id to use instead of the default
|
|
Gid *int `json:"gid,omitempty"`
|
|
|
|
// A list of additional groups to add the user to
|
|
Groups *[]string `json:"groups,omitempty"`
|
|
|
|
// The user's home directory
|
|
Home *string `json:"home,omitempty"`
|
|
|
|
// ssh public key
|
|
Key *string `json:"key,omitempty"`
|
|
Name string `json:"name"`
|
|
|
|
// If the password starts with $6$, $5$, or $2b$ it will be stored as
|
|
// an encrypted password. Otherwise it will be treated as a plain text
|
|
// password.
|
|
Password *string `json:"password,omitempty"`
|
|
|
|
// Login shell to use
|
|
Shell *string `json:"shell,omitempty"`
|
|
|
|
// User id to use instead of the default
|
|
Uid *int `json:"uid,omitempty"`
|
|
}
|
|
|
|
// 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 {
|
|
Blueprint *Blueprint `json:"blueprint,omitempty"`
|
|
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"`
|
|
ModuleHotfixes *bool `json:"module_hotfixes,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"`
|
|
|
|
// System FIPS mode setup
|
|
Fips *FIPS `json:"fips,omitempty"`
|
|
|
|
// Firewalld configuration
|
|
Firewall *FirewallCustomization `json:"firewall,omitempty"`
|
|
|
|
// List of groups to create
|
|
Groups *[]Group `json:"groups,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"`
|
|
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 {
|
|
DiMfgStringTypeMacIface *string `json:"di_mfg_string_type_mac_iface,omitempty"`
|
|
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"`
|
|
}
|
|
|
|
// System FIPS mode setup
|
|
type FIPS struct {
|
|
// Enables the system FIPS mode
|
|
Enabled *bool `json:"enabled,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 *FirewallServices `json:"services,omitempty"`
|
|
}
|
|
|
|
// Firewalld services to enable or disable
|
|
type FirewallServices struct {
|
|
// List of services to disable
|
|
Disabled *[]string `json:"disabled,omitempty"`
|
|
|
|
// List of services to enable
|
|
Enabled *[]string `json:"enabled,omitempty"`
|
|
}
|
|
|
|
// Bind a list of network sources to a zone to restrict traffic from
|
|
// those sources based on the settings of the zone.
|
|
type FirewallZones struct {
|
|
// name of the zone, if left empty the sources will apply to
|
|
// the default zone.
|
|
Name *string `json:"name,omitempty"`
|
|
|
|
// List of sources for the zone
|
|
Sources *[]string `json:"sources,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"`
|
|
}
|
|
|
|
// Package defines model for Package.
|
|
type Package struct {
|
|
// Name of the package to install. File globbing is supported,
|
|
// eg. 'openssh-*'
|
|
Name string `json:"name"`
|
|
|
|
// Optional version of the package to install. If left blank the
|
|
// latest available version will be used. Wildcards are supported
|
|
// eg. '4.11.*'
|
|
Version *string `json:"version,omitempty"`
|
|
}
|
|
|
|
// PackageGroup defines model for PackageGroup.
|
|
type PackageGroup struct {
|
|
// Package group name
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
// 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"`
|
|
|
|
// Disables modularity filtering for this repository.
|
|
ModuleHotfixes *bool `json:"module_hotfixes,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"`
|
|
|
|
// List of services to mask by default
|
|
Masked *[]string `json:"masked,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(), ¶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/+x9eXPbtrb4V8HodSbtL9oXW85M5z1Z3uTdlmzHvsr4QiREwiIBBgAly3357r/BQoqU",
|
|
"qC1xe3vvS/9oLBLLwSHOwdnxR86ifkAJIoLnPv2RCyCDPhKImV8Okv/aiFsMBwJTkvuUu4YOApjY6DWX",
|
|
"z6FX6AceSjUfQy9EuU+5Su7bt3wOyz5fQ8SmuXyOQF++US3zOW65yIeyi5gG8jkXDBNHdeP4LWPuy9Af",
|
|
"IAboEGCBfA4wAQhaLjADJqGJBoihKZeXwqParoLnW/RSDd166B62q22PEtSW6ONqImjbWIIJvWtGA8QE",
|
|
"loAMocdRPhckHv2RY8hR61mYKJ/jLmToeYKF+wwti4bmw5iV5T79I1ep1uqNnd3mXrlSzX3J5xQmMscy",
|
|
"DyBjcKrWztDXEDNky2EMDF/iZnTwg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rWYtO/KkO2ijIiOH8SxnrCiK/1X0IX0afchi5+Kqk/",
|
|
"ldS/m5K6wJuy+J0aPClTLLCY2XVMC8wla2WzJiVV/GdZpEeinaoO9KeS/mwNWbs9vpjAIOMnmf1ryExv",
|
|
"9H8/IpvdbAE9D8TBZtFumpHZeos2JDrogVhxYKiGbFbofzAF6ujMJtTN7UfINP+hU7/2F5/hSz+legGS",
|
|
"z35S8U8q3oaK0eIOkpQbB/ksPyGvTJMf3Pfz8VcLCzWgKF4gtXI5RHT12L+hXLJyOd/irIcsLnZhbiyg",
|
|
"dmjpazbiko/pEDAY4KKqpuPioU43gQEu6YqryvKAWCG6LqU0rippZS4wTUAHE2fVBFxAB/3gNOZacHOj",
|
|
"QjzNunG+fPv/AQAA//+t7x7Xl7cAAA==",
|
|
}
|
|
|
|
// 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
|
|
}
|