Add support for RPM customizations, which currently allow to import RPM GPG key from a file installed in the image. This is e.g. done for the Azure RHUI image type. Signed-off-by: Tomáš Hozza <thozza@redhat.com>
1623 lines
62 KiB
Go
1623 lines
62 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"
|
|
|
|
UploadTypesLocal UploadTypes = "local"
|
|
|
|
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"`
|
|
Installer *Installer `json:"installer,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"`
|
|
Rpm *RPMCustomization `json:"rpm,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"`
|
|
JsonTailoring *OpenSCAPJSONTailoring `json:"json_tailoring,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"`
|
|
Installer *Installer `json:"installer,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"`
|
|
Rpm *RPMCustomization `json:"rpm,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
|
|
|
|
// ImportKeys defines model for ImportKeys.
|
|
type ImportKeys struct {
|
|
Files *[]string `json:"files,omitempty"`
|
|
}
|
|
|
|
// Installer defines model for Installer.
|
|
type Installer struct {
|
|
SudoNopasswd *[]string `json:"sudo-nopasswd,omitempty"`
|
|
Unattended *bool `json:"unattended,omitempty"`
|
|
}
|
|
|
|
// 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 {
|
|
JsonTailoring *OpenSCAPJSONTailoring `json:"json_tailoring,omitempty"`
|
|
ProfileId string `json:"profile_id"`
|
|
Tailoring *OpenSCAPTailoring `json:"tailoring,omitempty"`
|
|
}
|
|
|
|
// OpenSCAPJSONTailoring defines model for OpenSCAPJSONTailoring.
|
|
type OpenSCAPJSONTailoring struct {
|
|
Filepath string `json:"filepath"`
|
|
ProfileId string `json:"profile_id"`
|
|
}
|
|
|
|
// 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"`
|
|
}
|
|
|
|
// RPMCustomization defines model for RPMCustomization.
|
|
type RPMCustomization struct {
|
|
ImportKeys *ImportKeys `json:"import_keys,omitempty"`
|
|
}
|
|
|
|
// 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"`
|
|
|
|
// 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"`
|
|
}
|
|
|
|
// 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/+x9eXPbOLL4V0HpTVVmftF92HKqpt6T5Uu+bcl27FXKC5EQCYsEGACULM/Ld/8VDlKk",
|
|
"RF2JZ3Z2X/aPnVjE0Wh0N7ob3Y0/chb1A0oQETz36Y9cABn0kUDM/OUg+V8bcYvhQGBKcp9y19BBABMb",
|
|
"vebyOfQK/cBDqeZj6IUo9ylXyX37ls9h2edriNg0l88R6MsvqmU+xy0X+VB2EdNA/s4Fw8RR3Th+y5j7",
|
|
"MvQHiAE6BFggnwNMAIKWC8yASWiiAWJoyuWl8Ki2q+D5Fn1UQ7ceuoftatujBLUl+riaCNo2lmBC75rR",
|
|
"ADGBJSBD6HGUzwWJn/7IMeSo9SxMlM9xFzL0PMHCfYaWRUOzMWZluU//yFWqtXpjZ7e5V65Uc1/yOYWJ",
|
|
"zLHMD5AxOFVrZ+hriBmy5TAGhi9xMzp4QZaQ/fT67gKPQvtKoZ5/9wJjwHMoLEwQF4VKLv9XLjuf4wQG",
|
|
"3KXiWe92EiZ/Woi+LkKVjbBsWNehsSugCDWXpBAFfZyGCPq4ULaatfLuXm13t9HYa9j1QRbGtkTx3GLk",
|
|
"vPk1NNCt/QgJBOHAw5Zm4SEMPRG3S7N0Zwg4EkBQoD6DX4WLgOkCFPP+lgcQeJQ4eUAHw5BbUCAb3N2e",
|
|
"9w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OSKhS1LI4l0U5VkvpTWX+2hixqj1/r",
|
|
"MMj4yWb/GjbThP7vx2Sz516g54E4lC6iphmbrfdoQ6KDHogVh71qyGavXwymQB2d2Yy6uf8ImeY/dOrX",
|
|
"/uIzfOlWqg8g+dtPLv7JxdtwMVqkIMm5cZDP8hPyyjT5Qbqfj79aWKgBRckCaZXLIaL3+P4N9ZKVy/kW",
|
|
"53RkSbEL84wHtUNLvz0TlwdNh4DBABdVYSIXD3UyDQxwSZchVp4HxArRG0KlcVVpK3OBaQI6mDirJuAC",
|
|
"OugHpzEP85tnRuJp1o3z5dv/DwAA//9zvPXjzbsAAA==",
|
|
}
|
|
|
|
// 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
|
|
}
|