Typescript: Add types for API schema

This commit adds types for the APIs that we currently query using RTK
Query. The OpenAPI schema were converted to Typescript types using the
openapi-typescript package: https://www.npmjs.com/package/openapi-typescript

In the future, we would like to add a script to a /tools directory that
will automatically generate the types from the schema. That isn't
possible now because the OpenAPI schema on consoledot require
authorization to acccess, but exposing them without auth is on the
roadmap and once that is complete we will add a script to automate the
process of generating these types.
This commit is contained in:
lucasgarfield 2023-06-19 14:43:43 +02:00 committed by Lucas Garfield
parent c33cc6ef70
commit 0fd3f285c6
6 changed files with 4479 additions and 0 deletions

View file

@ -0,0 +1,970 @@
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
export interface paths {
"/popular_repositories/": {
/**
* List Popular Repositories
* @description Get popular repositories
*/
get: operations["listPopularRepositories"];
};
"/repositories/": {
/**
* List Repositories
* @description list repositories
*/
get: operations["listRepositories"];
/**
* Create Repository
* @description create a repository
*/
post: operations["createRepository"];
};
"/repositories/bulk_create/": {
/**
* Bulk create repositories
* @description bulk create repositories
*/
post: operations["bulkCreateRepositories"];
};
"/repositories/{uuid}": {
/**
* Get Repository
* @description Get information about a Repository
*/
get: operations["getRepository"];
/**
* Update Repository
* @description Fully update a repository
*/
put: operations["fullUpdateRepository"];
/** Delete a repository */
delete: operations["deleteRepository"];
/**
* Partial Update Repository
* @description Partially Update a repository
*/
patch: operations["partialUpdateRepository"];
};
"/repositories/{uuid}/introspect/": {
/** introspect a repository */
post: operations["introspect"];
};
"/repositories/{uuid}/rpms": {
/**
* List Repositories RPMs
* @description list repositories RPMs
*/
get: operations["listRepositoriesRpms"];
};
"/repository_parameters/": {
/**
* List Repository Parameters
* @description get repository parameters (Versions and Architectures)
*/
get: operations["listRepositoryParameters"];
};
"/repository_parameters/external_gpg_key": {
/**
* Fetch gpgkey from URL
* @description Fetch gpgkey from URL
*/
post: operations["fetchGpgKey"];
};
"/repository_parameters/validate/": {
/**
* Validate parameters prior to creating a repository
* @description Validate parameters prior to creating a repository, including checking if remote yum metadata is present
*/
post: operations["validateRepositoryParameters"];
};
"/rpms/names": {
/**
* Search RPMs
* @description Search RPMs for a given list of repositories as URLs or UUIDs
*/
post: operations["searchRpm"];
};
}
export type webhooks = Record<string, never>;
export interface components {
schemas: {
"api.FetchGPGKeyResponse": {
/** @description The downloaded GPG Keys from the provided url. */
gpg_key?: string;
};
"api.GenericAttributeValidationResponse": {
/** @description Error message if the attribute is not valid */
error?: string;
/** @description Skipped if the attribute is not passed in for validation */
skipped?: boolean;
/** @description Valid if not skipped and the provided attribute is valid */
valid?: boolean;
};
"api.Links": {
/** @description Path to first page of results */
first?: string;
/** @description Path to last page of results */
last?: string;
/** @description Path to next page of results */
next?: string;
/** @description Path to previous page of results */
prev?: string;
};
"api.PopularRepositoriesCollectionResponse": {
data?: (components["schemas"]["api.PopularRepositoryResponse"])[];
links?: components["schemas"]["api.Links"];
meta?: components["schemas"]["api.ResponseMetadata"];
};
"api.PopularRepositoryResponse": {
/**
* @description Architecture to restrict client usage to
* @example x86_64
*/
distribution_arch?: string;
/**
* @description Versions to restrict client usage to
* @example [
* "7",
* "8"
* ]
*/
distribution_versions?: (string)[];
/** @description Existing reference name for repository */
existing_name?: string;
/** @description GPG key for repository */
gpg_key?: string;
/** @description Verify packages */
metadata_verification?: boolean;
/** @description Suggested name of the popular repository */
suggested_name?: string;
/** @description URL of the remote yum repository */
url?: string;
/** @description UUID of the repository if it exists for the user */
uuid?: string;
};
"api.RepositoryCollectionResponse": {
/** @description Requested Data */
data?: (components["schemas"]["api.RepositoryResponse"])[];
links?: components["schemas"]["api.Links"];
meta?: components["schemas"]["api.ResponseMetadata"];
};
"api.RepositoryIntrospectRequest": {
/** @description Reset the failed introspections count */
reset_count?: boolean;
};
"api.RepositoryParameterResponse": {
/** @description Architectures available for repository creation */
distribution_arches?: (components["schemas"]["config.DistributionArch"])[];
/** @description Versions available for repository creation */
distribution_versions?: (components["schemas"]["config.DistributionVersion"])[];
};
"api.RepositoryRequest": {
/**
* @description Architecture to restrict client usage to
* @example x86_64
*/
distribution_arch?: string;
/**
* @description Versions to restrict client usage to
* @example [
* "7",
* "8"
* ]
*/
distribution_versions?: (string)[];
/** @description GPG key for repository */
gpg_key?: string;
/** @description Verify packages */
metadata_verification?: boolean;
/** @description Name of the remote yum repository */
name?: string;
/** @description URL of the remote yum repository */
url?: string;
};
"api.RepositoryResponse": {
/** @description Account ID of the owner */
account_id?: string;
/**
* @description Architecture to restrict client usage to
* @example x86_64
*/
distribution_arch?: string;
/**
* @description Versions to restrict client usage to
* @example [
* "7",
* "8"
* ]
*/
distribution_versions?: (string)[];
/** @description Number of consecutive failed introspections */
failed_introspections_count?: number;
/** @description GPG key for repository */
gpg_key?: string;
/** @description Error of last attempted introspection */
last_introspection_error?: string;
/** @description Timestamp of last attempted introspection */
last_introspection_time?: string;
/** @description Timestamp of last successful introspection */
last_success_introspection_time?: string;
/** @description Timestamp of last introspection that had updates */
last_update_introspection_time?: string;
/** @description Verify packages */
metadata_verification?: boolean;
/** @description Name of the remote yum repository */
name?: string;
/** @description Organization ID of the owner */
org_id?: string;
/** @description Number of packages last read in the repository */
package_count?: number;
/** @description Status of repository introspection (Valid, Invalid, Unavailable, Pending) */
status?: string;
/** @description URL of the remote yum repository */
url?: string;
/** @description UUID of the object */
uuid?: string;
};
"api.RepositoryRpm": {
/** @description The Architecture of the rpm */
arch?: string;
/** @description The checksum of the rpm */
checksum?: string;
/** @description The epoch of the rpm */
epoch?: number;
/** @description The rpm package name */
name?: string;
/** @description The release of the rpm */
release?: string;
/** @description The summary of the rpm */
summary?: string;
/** @description Identifier of the rpm */
uuid?: string;
/** @description The version of the rpm */
version?: string;
};
"api.RepositoryRpmCollectionResponse": {
/** @description List of rpms */
data?: (components["schemas"]["api.RepositoryRpm"])[];
links?: components["schemas"]["api.Links"];
meta?: components["schemas"]["api.ResponseMetadata"];
};
"api.RepositoryValidationRequest": {
/** @description GPGKey of the remote yum repository */
gpg_key?: string;
/** @description If set, attempt to validate the yum metadata with the specified GPG Key */
metadata_verification?: boolean;
/** @description Name of the remote yum repository */
name?: string;
/** @description URL of the remote yum repository */
url?: string;
/** @description If set, this is an "Update" validation */
uuid?: string;
};
"api.RepositoryValidationResponse": {
gpg_key?: components["schemas"]["api.GenericAttributeValidationResponse"];
name?: components["schemas"]["api.GenericAttributeValidationResponse"];
url?: components["schemas"]["api.UrlValidationResponse"];
};
"api.ResponseMetadata": {
/** @description Total count of results */
count?: number;
/** @description Limit of results used for the request */
limit?: number;
/** @description Offset into results used for the request */
offset?: number;
};
"api.SearchRpmRequest": {
/** @description Maximum number of records to return for the search */
limit?: number;
/** @description Search string to search rpm names */
search?: string;
/** @description URLs of repositories to search */
urls?: (string)[];
/** @description List of RepositoryConfig UUIDs to search */
uuids?: (string)[];
};
"api.SearchRpmResponse": {
/** @description Package name found */
package_name?: string;
/** @description Summary of the package found */
summary?: string;
};
"api.UrlValidationResponse": {
/** @description Error message if the attribute is not valid */
error?: string;
/** @description If the metadata cannot be fetched successfully, the http code that is returned if the http request was completed */
http_code?: number;
/** @description True if the metadata can be fetched successfully */
metadata_present?: boolean;
/** @description True if a repomd.xml.sig file was found in the repository */
metadata_signature_present?: boolean;
/** @description Skipped if the URL is not passed in for validation */
skipped?: boolean;
/** @description Valid if not skipped and the provided attribute is valid */
valid?: boolean;
};
"config.DistributionArch": {
/** @description Static label of the architecture */
label?: string;
/** @description Human-readable form of the architecture */
name?: string;
};
"config.DistributionVersion": {
/** @description Static label of the version */
label?: string;
/** @description Human-readable form of the version */
name?: string;
};
"errors.ErrorResponse": {
errors?: (components["schemas"]["errors.HandlerError"])[];
};
"errors.HandlerError": {
/** @description An explanation specific to the problem */
detail?: string;
/** @description HTTP status code applicable to the error */
status?: number;
/** @description A summary of the problem */
title?: string;
};
};
responses: never;
parameters: never;
requestBodies: never;
headers: never;
pathItems: never;
}
export type external = Record<string, never>;
export interface operations {
/**
* List Popular Repositories
* @description Get popular repositories
*/
listPopularRepositories: {
responses: {
/** @description OK */
200: {
content: {
"application/json": components["schemas"]["api.PopularRepositoriesCollectionResponse"];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/**
* List Repositories
* @description list repositories
*/
listRepositories: {
parameters: {
query?: {
/** @description Offset into the list of results to return in the response */
offset?: number;
/** @description Limit the number of items returned */
limit?: number;
/** @description Comma separated list of architecture to optionally filter-on (e.g. 'x86_64,s390x' would return Repositories with x86_64 or s390x only) */
version?: string;
/** @description Comma separated list of versions to optionally filter-on (e.g. '7,8' would return Repositories with versions 7 or 8 only) */
arch?: string;
/** @description Filter by compatible arch (e.g. 'x86_64' would return Repositories with the 'x86_64' arch and Repositories where arch is not set) */
available_for_version?: string;
/** @description Filter by compatible version (e.g. 7 would return Repositories with the version 7 or where version is not set) */
available_for_arch?: string;
/** @description Search term for name and url. */
search?: string;
/** @description Filter repositories by name using an exact match */
name?: string;
/** @description Filter repositories by name using an exact match */
url?: string;
/** @description Sets the sort order of the results */
sort_by?: string;
/** @description Comma separated list of statuses to optionally filter on */
status?: string;
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components["schemas"]["api.RepositoryCollectionResponse"];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/**
* Create Repository
* @description create a repository
*/
createRepository: {
/** @description request body */
requestBody: {
content: {
"application/json": components["schemas"]["api.RepositoryRequest"];
};
};
responses: {
/** @description Created */
201: {
headers: {
/** @description resource URL */
Location?: string;
};
content: {
"application/json": components["schemas"]["api.RepositoryResponse"];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/**
* Bulk create repositories
* @description bulk create repositories
*/
bulkCreateRepositories: {
/** @description request body */
requestBody: {
content: {
"application/json": (components["schemas"]["api.RepositoryRequest"])[];
};
};
responses: {
/** @description Created */
201: {
headers: {
/** @description resource URL */
Location?: string;
};
content: {
"application/json": (components["schemas"]["api.RepositoryResponse"])[];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/**
* Get Repository
* @description Get information about a Repository
*/
getRepository: {
parameters: {
path: {
/** @description Identifier of the Repository */
uuid: string;
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components["schemas"]["api.RepositoryResponse"];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/**
* Update Repository
* @description Fully update a repository
*/
fullUpdateRepository: {
parameters: {
path: {
/** @description Identifier of the Repository */
uuid: string;
};
};
/** @description request body */
requestBody: {
content: {
"application/json": components["schemas"]["api.RepositoryRequest"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components["schemas"]["api.RepositoryResponse"];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/** Delete a repository */
deleteRepository: {
parameters: {
path: {
/** @description Identifier of the Repository */
uuid: string;
};
};
responses: {
/** @description Repository was successfully deleted */
204: never;
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/**
* Partial Update Repository
* @description Partially Update a repository
*/
partialUpdateRepository: {
parameters: {
path: {
/** @description Identifier of the Repository */
uuid: string;
};
};
/** @description request body */
requestBody: {
content: {
"application/json": components["schemas"]["api.RepositoryRequest"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components["schemas"]["api.RepositoryResponse"];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/** introspect a repository */
introspect: {
parameters: {
path: {
/** @description Identifier of the Repository */
uuid: string;
};
};
/** @description request body */
requestBody?: {
content: {
"*/*": components["schemas"]["api.RepositoryIntrospectRequest"];
};
};
responses: {
/** @description Introspection was successfully queued */
204: never;
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/**
* List Repositories RPMs
* @description list repositories RPMs
*/
listRepositoriesRpms: {
parameters: {
query?: {
/** @description Limit the number of items returned */
limit?: number;
/** @description Offset into the list of results to return in the response */
offset?: number;
/** @description Search term for name. */
search?: string;
/** @description Sets the sort order of the results. */
sort_by?: string;
};
path: {
/** @description Identifier of the Repository */
uuid: string;
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": components["schemas"]["api.RepositoryRpmCollectionResponse"];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/**
* List Repository Parameters
* @description get repository parameters (Versions and Architectures)
*/
listRepositoryParameters: {
responses: {
/** @description OK */
200: {
content: {
"application/json": components["schemas"]["api.RepositoryParameterResponse"];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/**
* Fetch gpgkey from URL
* @description Fetch gpgkey from URL
*/
fetchGpgKey: {
responses: {
/** @description OK */
200: {
content: {
"application/json": components["schemas"]["api.FetchGPGKeyResponse"];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/**
* Validate parameters prior to creating a repository
* @description Validate parameters prior to creating a repository, including checking if remote yum metadata is present
*/
validateRepositoryParameters: {
/** @description request body */
requestBody: {
content: {
"application/json": (components["schemas"]["api.RepositoryValidationRequest"])[];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": (components["schemas"]["api.RepositoryValidationResponse"])[];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
/**
* Search RPMs
* @description Search RPMs for a given list of repositories as URLs or UUIDs
*/
searchRpm: {
/** @description request body */
requestBody: {
content: {
"application/json": components["schemas"]["api.SearchRpmRequest"];
};
};
responses: {
/** @description OK */
200: {
content: {
"application/json": (components["schemas"]["api.SearchRpmResponse"])[];
};
};
/** @description Bad Request */
400: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Unauthorized */
401: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Not Found */
404: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
/** @description Internal Server Error */
500: {
content: {
"application/json": components["schemas"]["errors.ErrorResponse"];
};
};
};
};
}

View file

@ -0,0 +1,787 @@
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
export interface paths {
"/version": {
/**
* get the service version
* @description get the service version
*/
get: operations["getVersion"];
};
"/ready": {
/** return the readiness */
get: operations["getReadiness"];
};
"/openapi.json": {
/** get the openapi json specification */
get: operations["getOpenapiJson"];
};
"/distributions": {
/** get the available distributions */
get: operations["getDistributions"];
};
"/architectures/{distribution}": {
/** get the architectures and their image types available for a given distribution */
get: operations["getArchitectures"];
};
"/composes": {
/** get a collection of previous compose requests for the logged in user */
get: {
parameters: {
query?: {
/** @description max amount of composes, default 100 */
limit?: number;
/** @description composes page offset, default 0 */
offset?: number;
};
};
responses: {
/** @description a list of composes */
200: {
content: {
"application/json": components["schemas"]["ComposesResponse"];
};
};
};
};
};
"/composes/{composeId}": {
/**
* get status of an image compose
* @description status of an image compose
*/
get: operations["getComposeStatus"];
/**
* delete a compose
* @description Deletes a compose, the compose will still count towards quota.
*/
delete: operations["deleteCompose"];
parameters: {
path: {
/** @description Id of compose */
composeId: string;
};
};
};
"/composes/{composeId}/metadata": {
/**
* get metadata of an image compose
* @description metadata for an image compose
*/
get: operations["getComposeMetadata"];
};
"/composes/{composeId}/clone": {
/**
* clone a compose
* @description Clones a compose. Only composes with the 'aws' image type currently support cloning.
*/
post: operations["cloneCompose"];
};
"/composes/{composeId}/clones": {
/**
* get clones of a compose
* @description Returns a list of all the clones which were started for a compose
*/
get: operations["getComposeClones"];
};
"/clones/{id}": {
/**
* get status of a compose clone
* @description status of a clone
*/
get: operations["getCloneStatus"];
};
"/compose": {
/**
* compose image
* @description compose image
*/
post: operations["composeImage"];
};
"/packages": {
get: {
parameters: {
query: {
/** @description distribution to look up packages for */
distribution: components["schemas"]["Distributions"];
/** @description architecture to look up packages for */
architecture: "x86_64" | "aarch64";
/** @description packages to look for */
search: string;
/** @description max amount of packages, default 100 */
limit?: number;
/** @description packages page offset, default 0 */
offset?: number;
};
};
responses: {
/** @description a list of packages */
200: {
content: {
"application/json": components["schemas"]["PackagesResponse"];
};
};
};
};
};
}
export type webhooks = Record<string, never>;
export interface components {
schemas: {
HTTPError: {
title: string;
detail: string;
};
HTTPErrorList: {
errors: (components["schemas"]["HTTPError"])[];
};
Version: {
version: string;
};
Readiness: {
readiness: string;
};
DistributionsResponse: (components["schemas"]["DistributionItem"])[];
DistributionItem: {
/** @example Red Hat Enterprise Linux (RHEL) 8.4 */
description: string;
/** @example rhel-84 */
name: string;
};
Architectures: (components["schemas"]["ArchitectureItem"])[];
ArchitectureItem: {
/** @example x86_64 */
arch: string;
image_types: (string)[];
/** @description Base repositories for the given distribution and architecture. */
repositories: (components["schemas"]["Repository"])[];
};
ComposeStatus: {
image_status: components["schemas"]["ImageStatus"];
request: components["schemas"]["ComposeRequest"];
};
ImageStatus: {
/**
* @example success
* @enum {string}
*/
status: "success" | "failure" | "pending" | "building" | "uploading" | "registering";
upload_status?: components["schemas"]["UploadStatus"];
error?: components["schemas"]["ComposeStatusError"];
};
ComposeStatusError: {
id: number;
reason: string;
details?: unknown;
};
UploadStatus: {
/** @enum {string} */
status: "success" | "failure" | "pending" | "running";
type: components["schemas"]["UploadTypes"];
options: components["schemas"]["AWSUploadStatus"] | components["schemas"]["AWSS3UploadStatus"] | components["schemas"]["GCPUploadStatus"] | components["schemas"]["AzureUploadStatus"];
};
AWSUploadStatus: {
/** @example ami-0c830793775595d4b */
ami: string;
/** @example eu-west-1 */
region: string;
};
AWSS3UploadStatus: {
url: string;
};
GCPUploadStatus: {
/** @example ascendant-braid-303513 */
project_id: string;
/** @example my-image */
image_name: string;
};
AzureUploadStatus: {
/** @example my-image */
image_name: string;
};
ComposeRequest: {
distribution: components["schemas"]["Distributions"];
/** @example MyImageName */
image_name?: string;
/** @description Array of exactly one image request. Having more image requests in one compose is currently not supported. */
image_requests: (components["schemas"]["ImageRequest"])[];
customizations?: components["schemas"]["Customizations"];
};
/** @enum {string} */
Distributions: "rhel-8" | "rhel-84" | "rhel-85" | "rhel-86" | "rhel-87" | "rhel-88" | "rhel-9" | "rhel-90" | "rhel-91" | "rhel-92" | "centos-8" | "centos-9" | "fedora-35" | "fedora-36" | "fedora-37" | "fedora-38";
ImageRequest: {
/**
* @description CPU architecture of the image, x86_64 and aarch64 are currently supported.
*
* @enum {string}
*/
architecture: "x86_64" | "aarch64";
image_type: components["schemas"]["ImageTypes"];
upload_request: components["schemas"]["UploadRequest"];
ostree?: components["schemas"]["OSTree"];
};
/** @enum {string} */
ImageTypes: "aws" | "azure" | "edge-commit" | "edge-installer" | "gcp" | "guest-image" | "image-installer" | "vsphere" | "ami" | "rhel-edge-commit" | "rhel-edge-installer" | "vhd";
ComposesResponse: {
meta: {
count: number;
};
links: {
/** @example /api/image-builder/v1/composes?limit=10&offset=0 */
first: string;
/** @example /api/image-builder/v1/composes?limit=10&offset=10 */
last: string;
};
data: (components["schemas"]["ComposesResponseItem"])[];
};
ComposesResponseItem: {
/** Format: uuid */
id: string;
request: unknown;
created_at: string;
image_name?: string;
};
ComposeResponse: {
/** Format: uuid */
id: string;
};
UploadRequest: {
type: components["schemas"]["UploadTypes"];
options: components["schemas"]["AWSUploadRequestOptions"] | components["schemas"]["AWSS3UploadRequestOptions"] | components["schemas"]["GCPUploadRequestOptions"] | components["schemas"]["AzureUploadRequestOptions"];
};
/** @enum {string} */
UploadTypes: "aws" | "gcp" | "azure" | "aws.s3";
AWSUploadRequestOptions: {
/**
* @example [
* "123456789012"
* ]
*/
share_with_accounts?: (string)[];
/**
* @example [
* "12345"
* ]
*/
share_with_sources?: (string)[];
};
AWSS3UploadRequestOptions: Record<string, never>;
GCPUploadRequestOptions: {
/**
* @description List of valid Google accounts to share the imported Compute Node 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 Node image is not shared with any
* account.
*
* @example [
* "user:alice@example.com",
* "serviceAccount:my-other-app@appspot.gserviceaccount.com",
* "group:admins@example.com",
* "domain:example.com"
* ]
*/
share_with_accounts: (string)[];
};
AzureUploadRequestOptions: {
/**
* @description ID of the source that will be used to resolve the tenant and subscription IDs.
* Do not provide a tenant_id or subscription_id when providing a source_id.
*
* @example 12345
*/
source_id?: string;
/**
* @description ID of the tenant where the image should be uploaded. This link explains how
* to find it in the Azure Portal:
* https://docs.microsoft.com/en-us/azure/active-directory/fundamentals/active-directory-how-to-find-tenant
* When providing a tenant_id, also be sure to provide a subscription_id and do not include a source_id.
*
* @example 5c7ef5b6-1c3f-4da0-a622-0b060239d7d7
*/
tenant_id?: string;
/**
* @description ID of subscription where the image should be uploaded.
* When providing a subscription_id, also be sure to provide a tenant_id and do not include a source_id.
*
* @example 4e5d8b2c-ab24-4413-90c5-612306e809e2
*/
subscription_id?: string;
/**
* @description Name of the resource group where the image should be uploaded.
*
* @example ToucanResourceGroup
*/
resource_group: string;
/**
* @description Name of the created image.
* Must begin with a letter or number, end with a letter, number or underscore, and may contain only letters, numbers, underscores, periods, or hyphens.
* The total length is limited to 60 characters.
*
* @example LinuxImage
*/
image_name?: string;
};
Customizations: {
subscription?: components["schemas"]["Subscription"];
/**
* @example [
* "postgresql"
* ]
*/
packages?: (string)[];
payload_repositories?: (components["schemas"]["Repository"])[];
custom_repositories?: (components["schemas"]["CustomRepository"])[];
filesystem?: (components["schemas"]["Filesystem"])[];
/** @description list of users that a customer can add, also specifying their respective groups and SSH keys */
users?: (components["schemas"]["User"])[];
};
User: {
/** @example user1 */
name: string;
/** @example ssh-rsa AAAAB3NzaC1 */
ssh_key: string;
};
Filesystem: {
/** @example /var */
mountpoint: string;
/** @example 1024 */
min_size: unknown;
};
Subscription: {
/** @example 2040324 */
organization: number;
/**
* Format: password
* @example my-secret-key
*/
"activation-key": string;
/** @example subscription.rhsm.redhat.com */
"server-url": string;
/** @example http://cdn.redhat.com/ */
"base-url": string;
/** @example true */
insights: boolean;
/**
* @description Optional flag to use rhc to register the system, which also always enables Insights.
*
* @default false
* @example true
*/
rhc?: boolean;
};
OSTree: {
url?: string;
/**
* @description 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;
/** @example rhel/8/x86_64/edge */
ref?: string;
/**
* @description Can be either a commit (example: 02604b2da6e954bd34b8b82a835e5a77d2b60ffa), or a branch-like reference (example: rhel/8/x86_64/edge)
*
* @example rhel/8/x86_64/edge
*/
parent?: string;
/**
* @description 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?: boolean;
};
PackagesResponse: {
meta: {
count: number;
};
links: {
/** @example /api/image-builder/v1/packages?limit=10&offset=0&distribution.... */
first: string;
/** @example /api/image-builder/v1/packages?limit=10&offset=10&distribution.... */
last: string;
};
data: (components["schemas"]["Package"])[];
};
Package: {
name: string;
summary: string;
};
ComposeMetadata: {
/** @description Package list including NEVRA */
packages?: (components["schemas"]["PackageMetadata"])[];
/** @description ID (hash) of the built commit */
ostree_commit?: string;
};
PackageMetadata: {
type: string;
name: string;
version: string;
release: string;
epoch?: string;
arch: string;
sigmd5: string;
signature?: string;
};
Repository: {
rhsm: boolean;
/**
* Format: uri
* @example https://cdn.redhat.com/content/dist/rhel8/8/x86_64/baseos/os/
*/
baseurl?: string;
/**
* Format: uri
* @example http://mirrorlist.centos.org/?release=8-stream&arch=aarch64&repo=BaseOS
*/
mirrorlist?: string;
/**
* Format: uri
* @example https://mirrors.fedoraproject.org/metalink?repo=fedora-32&arch=x86_64
*/
metalink?: string;
gpgkey?: string;
check_gpg?: boolean;
/**
* @description Enables gpg verification of the repository metadata
*
* @default false
*/
check_repo_gpg?: boolean;
ignore_ssl?: boolean;
};
/**
* @description Repository configuration for custom repositories.
* 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. Id is required.
*/
CustomRepository: {
id: string;
name?: string;
filename?: string;
/**
* @example [
* "https://cdn.redhat.com/content/dist/rhel8/8/x86_64/baseos/os/"
* ]
*/
baseurl?: (string)[];
/**
* Format: uri
* @example http://mirrorlist.centos.org/?release=8-stream&arch=aarch64&repo=BaseOS
*/
mirrorlist?: string;
/**
* Format: uri
* @example https://mirrors.fedoraproject.org/metalink?repo=fedora-32&arch=x86_64
*/
metalink?: string;
/**
* @description GPG key used to sign packages in this repository. Can be a gpg key or a URL
* @example [
* "-----BEGIN PGP PUBLIC KEY BLOCK-----\n\nmQINBGAcScoBEADLf8YHkezJ6adlMYw7aGGIlJalt8Jj2x/B2K+hIfIuxGtpVj7e\nLRgDU76jaT5pVD5mFMJ3pkeneR/cTmqqQkNyQshX2oQXwEzUSb1CNMCfCGgkX8Q2\nzZkrIcCrF0Q2wrKblaudhU+iVanADsm18YEqsb5AU37dtUrM3QYdWg9R+XiPfV8R\nKBjT03vVBOdMSsY39LaCn6Ip1Ovp8IEo/IeEVY1qmCOPAaK0bJH3ufg4Cueks+TS\nwQWTeCLxuZL6OMXoOPKwvMQfxbg1XD8vuZ0Ktj/cNH2xau0xmsAu9HJpekvOPRxl\nyqtjyZfroVieFypwZgvQwtnnM8/gSEu/JVTrY052mEUT7Ccb74kcHFTFfMklnkG/\n0fU4ARa504H3xj0ktbe3vKcPXoPOuKBVsHSv00UGYAyPeuy+87cU/YEhM7k3SVKj\n6eIZgyiMO0wl1YGDRKculwks9A+ulkg1oTb4s3zmZvP07GoTxW42jaK5WS+NhZee\n860XoVhbc1KpS+jfZojsrEtZ8PbUZ+YvF8RprdWArjHbJk2JpRKAxThxsQAsBhG1\n0Lux2WaMB0g2I5PcMdJ/cqjo08ccrjBXuixWri5iu9MXp8qT/fSzNmsdIgn8/qZK\ni8Qulfu77uqhW/wt2btnitgRsqjhxMujYU4Zb4hktF8hKU/XX742qhL5KwARAQAB\ntDFGZWRvcmEgKDM1KSA8ZmVkb3JhLTM1LXByaW1hcnlAZmVkb3JhcHJvamVjdC5v\ncmc+iQJOBBMBCAA4FiEEeH6mrhFH7uVsQLMM20Y5cZhnxY8FAmAcScoCGw8FCwkI\nBwIGFQoJCAsCBBYCAwECHgECF4AACgkQ20Y5cZhnxY+NYA/7BYpglySAZYHhjyKh\n/+f6zPfVvbH20Eq3kI7OFBN0nLX+BU1muvS+qTuS3WLrB3m3GultpKREJKLtm5ED\n1rGzXAoT1yp9YI8LADdMCCOyjAjsoWU87YUuC+/bnjrTeR2LROCfyPC76W985iOV\nm5S+bsQDw7C2LrldAM4MDuoyZ1SitGaZ4KQLVt+TEa14isYSGCjzo7PY8V3JOk50\ngqWg82N/bm2EzS7T83WEDb1lvj4IlvxgIqKeg11zXYxmrYSZJJCfvzf+lNS6uxgH\njx/J0ylZ2LibGr6GAAyO9UWrAZSwSM0EcjT8wECnxkSDuyqmWwVvNBXuEIV8Oe3Y\nMiU1fJN8sd7DpsFx5M+XdnMnQS+HrjTPKD3mWrlAdnEThdYV8jZkpWhDys3/99eO\nhk0rLny0jNwkauf/iU8Oc6XvMkjLRMJg5U9VKyJuWWtzwXnjMN5WRFBqK4sZomMM\nftbTH1+5ybRW/A3vBbaxRW2t7UzNjczekSZEiaLN9L/HcJCIR1QF8682DdAlEF9d\nk2gQiYSQAaaJ0JJAzHvRkRJLLgK2YQYiHNVy2t3JyFfsram5wSCWOfhPeIyLBTZJ\nvrpNlPbefsT957Tf2BNIugzZrC5VxDSKkZgRh1VGvSIQnCyzkQy6EU2qPpiW59G/\nhPIXZrKocK3KLS9/izJQTRltjMA=\n=PfT7\n-----END PGP PUBLIC KEY BLOCK-----\n"
* ]
*/
gpgkey?: (string)[];
check_gpg?: boolean;
check_repo_gpg?: boolean;
enabled?: boolean;
priority?: number;
ssl_verify?: boolean;
};
ClonesResponse: {
meta: {
count: number;
};
links: {
/** @example /api/image-builder/v1/composes?limit=10&offset=0 */
first: string;
/** @example /api/image-builder/v1/composes?limit=10&offset=10 */
last: string;
};
data: (components["schemas"]["ClonesResponseItem"])[];
};
ClonesResponseItem: {
/** Format: uuid */
id: string;
request: unknown;
created_at: string;
};
CloneRequest: components["schemas"]["AWSEC2Clone"];
AWSEC2Clone: {
/**
* @description A region as described in
* https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html#concepts-regions
*/
region: string;
/**
* @description An array of AWS account IDs as described in
* https://docs.aws.amazon.com/IAM/latest/UserGuide/console_account-alias.html
*
* @example [
* "123456789012"
* ]
*/
share_with_accounts?: (string)[];
/**
* @example [
* "12345"
* ]
*/
share_with_sources?: (string)[];
};
CloneResponse: {
/**
* Format: uuid
* @example 123e4567-e89b-12d3-a456-426655440000
*/
id: string;
};
};
responses: never;
parameters: never;
requestBodies: never;
headers: never;
pathItems: never;
}
export type external = Record<string, never>;
export interface operations {
/**
* get the service version
* @description get the service version
*/
getVersion: {
responses: {
/** @description a service version */
200: {
content: {
"application/json": components["schemas"]["Version"];
};
};
};
};
/** return the readiness */
getReadiness: {
responses: {
/** @description readiness */
200: {
content: {
"application/json": components["schemas"]["Readiness"];
};
};
};
};
/** get the openapi json specification */
getOpenapiJson: {
responses: {
/** @description returns this document */
200: {
content: {
"application/json": Record<string, never>;
};
};
};
};
/** get the available distributions */
getDistributions: {
responses: {
/** @description a list of available distributions */
200: {
content: {
"application/json": components["schemas"]["DistributionsResponse"];
};
};
};
};
/** get the architectures and their image types available for a given distribution */
getArchitectures: {
parameters: {
path: {
/**
* @description distribution for which to look up available architectures
* @example rhel-84
*/
distribution: string;
};
};
responses: {
/** @description a list of available architectures and their associated image types */
200: {
content: {
"application/json": components["schemas"]["Architectures"];
};
};
};
};
/**
* get status of an image compose
* @description status of an image compose
*/
getComposeStatus: {
parameters: {
path: {
/** @description Id of compose */
composeId: string;
};
};
responses: {
/** @description compose status */
200: {
content: {
"application/json": components["schemas"]["ComposeStatus"];
};
};
};
};
/**
* delete a compose
* @description Deletes a compose, the compose will still count towards quota.
*/
deleteCompose: {
parameters: {
path: {
/** @description Id of compose */
composeId: string;
};
};
responses: {
/** @description OK */
200: never;
};
};
/**
* get metadata of an image compose
* @description metadata for an image compose
*/
getComposeMetadata: {
parameters: {
path: {
/** @description Id of compose metadata to get */
composeId: string;
};
};
responses: {
/** @description compose metadata */
200: {
content: {
"application/json": components["schemas"]["ComposeMetadata"];
};
};
};
};
/**
* clone a compose
* @description Clones a compose. Only composes with the 'aws' image type currently support cloning.
*/
cloneCompose: {
parameters: {
path: {
/** @description Id of compose to clone */
composeId: string;
};
};
/** @description details of the new clone */
requestBody: {
content: {
"application/json": components["schemas"]["CloneRequest"];
};
};
responses: {
/** @description cloning has started */
201: {
content: {
"application/json": components["schemas"]["CloneResponse"];
};
};
};
};
/**
* get clones of a compose
* @description Returns a list of all the clones which were started for a compose
*/
getComposeClones: {
parameters: {
query?: {
/** @description max amount of clones, default 100 */
limit?: number;
/** @description clones page offset, default 0 */
offset?: number;
};
path: {
/** @description Id of compose to get the clones of */
composeId: string;
};
};
responses: {
/** @description compose clones */
200: {
content: {
"application/json": components["schemas"]["ClonesResponse"];
};
};
};
};
/**
* get status of a compose clone
* @description status of a clone
*/
getCloneStatus: {
parameters: {
path: {
/** @description Id of clone status to get */
id: string;
};
};
responses: {
/** @description clone status */
200: {
content: {
"application/json": components["schemas"]["UploadStatus"];
};
};
};
};
/**
* compose image
* @description compose image
*/
composeImage: {
/** @description details of image to be composed */
requestBody: {
content: {
"application/json": components["schemas"]["ComposeRequest"];
};
};
responses: {
/** @description compose has started */
201: {
content: {
"application/json": components["schemas"]["ComposeResponse"];
};
};
/** @description the compose request is malformed */
400: {
content: {
"application/json": components["schemas"]["HTTPErrorList"];
};
};
};
};
}

14
types/api/index.ts Normal file
View file

@ -0,0 +1,14 @@
import { components as imageBuilderComponents } from './imageBuilderSchema';
import { components as provisioningComponents } from './provisioningSchema';
import { components as rhsmComponents } from './rhsmSchema';
import { components as contentSourcesComponents } from './contentSourcesSchema';
export type ActivationKeys = rhsmComponents["schemas"]["ActivationKeys"];
export type Architectures = imageBuilderComponents["schemas"]["Architectures"];
export type ClonesResponse = imageBuilderComponents["schemas"]["ClonesResponse"];
export type ComposeStatus = imageBuilderComponents["schemas"]["ComposeStatus"];
export type ComposesResponse = imageBuilderComponents["schemas"]["ComposesResponse"];
export type UploadStatus = imageBuilderComponents["schemas"]["UploadStatus"];
export type SourceResponse = provisioningComponents["schemas"]["v1.SourceResponse"];
export type SourceUploadInfoResponse = provisioningComponents["schemas"]["v1.SourceUploadInfoResponse"]
export type RepositoryCollectionResponse = contentSourcesComponents["schemas"]["api.RepositoryCollectionResponse"]

View file

@ -0,0 +1,620 @@
/**
* This file was auto-generated by openapi-typescript.
* Do not make direct changes to the file.
*/
export interface paths {
"/availability_status/sources": {
/** @description Schedules a background operation of Sources availability check. These checks are are performed in separate process at it's own pace. Results are sent via Kafka to Sources. There is no output from this REST operation available, no tracking of jobs is possible. */
post: operations["availabilityStatus"];
};
"/instance_types/{PROVIDER}": {
/** @description Return a list of instance types for particular provider. A region must be provided. A zone must be provided for Azure. */
get: operations["getInstanceTypeListAll"];
};
"/pubkeys": {
/** @description A pubkey represents an SSH public portion of a key pair with name and body. This operation returns list of all pubkeys for particular account. */
get: operations["getPubkeyList"];
/** @description A pubkey represents an SSH public portion of a key pair with name and body. When pubkey is created, it is stored in the Provisioning database. Pubkeys are uploaded to clouds when an instance is launched. Some fields (e.g. type or fingerprint) are read only. */
post: operations["createPubkey"];
};
"/pubkeys/{ID}": {
/** @description A pubkey represents an SSH public portion of a key pair with name and body. Pubkeys must have unique name and body (SSH public key fingerprint) per each account. Pubkey type is detected during create operation as well as fingerprints. Currently two types are supported: RSA and ssh-ed25519. Also, two fingerprint types are calculated: standard SHA fingerprint and legacy MD5 fingerprint available under fingerprint_legacy field. Fingerprints are used to check uniqueness of key. */
get: operations["getPubkeyById"];
/** @description A pubkey represents an SSH public portion of a key pair with name and body. If a pubkey was uploaded to one or more clouds, the deletion request will attempt to delete those SSH keys from all clouds. This means in order to delete a pubkey the account must have valid credentials to all cloud accounts the pubkey was uploaded to, otherwise the delete operation will fail and the pubkey will not be deleted from Provisioning database. This operation returns no body. */
delete: operations["removePubkeyById"];
};
"/reservations": {
/** @description A reservation is a way to activate a job, keeps all data needed for a job to start. This operation returns list of all reservations for particular account. To get a reservation with common fields, use /reservations/ID. To get a detailed reservation with all fields which are different per provider, use /reservations/aws/ID. */
get: operations["getReservationsList"];
};
"/reservations/aws": {
/** @description A reservation is a way to activate a job, keeps all data needed for a job to start. An AWS reservation is a reservation created for an AWS job. Image Builder UUID image is required, the service will also launch any AMI image prefixed with "ami-". Optionally, AWS EC2 launch template ID can be provided. All flags set through this endpoint override template values. Public key must exist prior calling this endpoint and ID must be provided, even when AWS EC2 launch template provides ssh-keys. Public key will be always be overwritten. */
post: operations["createAwsReservation"];
};
"/reservations/aws/{ID}": {
/** @description Return an AWS reservation with details by id */
get: operations["getAWSReservationByID"];
};
"/reservations/azure": {
/** @description A reservation is a way to activate a job, keeps all data needed for a job to start. An Azure reservation is a reservation created for an Azure job. Image Builder UUID image is required and needs to be stored under same account as provided by SourceID. */
post: operations["createAzureReservation"];
};
"/reservations/azure/{ID}": {
/** @description Return an Azure reservation with details by id */
get: operations["getAzureReservationByID"];
};
"/reservations/noop": {
/** @description A reservation is a way to activate a job, keeps all data needed for a job to start. A Noop reservation actually does nothing and immediately finish background job. This reservation has no input payload */
post: operations["createNoopReservation"];
};
"/reservations/{ID}": {
/** @description Return a generic reservation by id */
get: operations["getReservationByID"];
};
"/sources": {
/** @description Cloud credentials are kept in the sources application. This endpoint lists available sources for the particular account per individual type (AWS, Azure, ...). All the fields in the response are optional and can be omitted if Sources application also omits them. */
get: operations["getSourceList"];
};
"/sources/{ID}/account_identity": {
/**
* @deprecated
* @description This endpoint is deprecated. Please use upload_info instead
*/
get: operations["getSourceAccountIdentity"];
};
"/sources/{ID}/instance_types": {
/**
* @deprecated
* @description Deprecated endpoint, use /instance_types instead.
*/
get: operations["getInstanceTypeList"];
};
"/sources/{ID}/launch_templates": {
/**
* @description Return a list of launch templates.
* A launch template is a configuration set with a name that is available through hyperscaler API. When creating reservations, launch template can be provided in order to set additional configuration for instances.
* Currently only AWS Launch Templates are supported.
*/
get: operations["getLaunchTemplatesList"];
};
"/sources/{ID}/upload_info": {
/**
* @description Provides all necessary information to upload an image for given Source. Typically, this is account number, subscription ID but some hyperscaler types also provide additional data.
* The response contains "provider" field which can be one of aws, azure or gcp and then exactly one field named "aws", "azure" or "gcp". Enum is not used due to limitation of the language (Go).
* Some types may perform more than one calls (e.g. Azure) so latency might be increased. Caching of static information is performed to improve latency of consequent calls.
*/
get: operations["getSourceUploadInfo"];
};
}
export type webhooks = Record<string, never>;
export interface components {
schemas: {
"v1.AWSReservationRequest": {
/** Format: int32 */
amount?: number;
image_id?: string;
instance_type?: string;
launch_template_id?: string;
name?: string;
poweroff?: boolean;
/** Format: int64 */
pubkey_id?: number;
region?: string;
source_id?: string;
};
"v1.AWSReservationResponse": {
/** Format: int32 */
amount?: number;
aws_reservation_id?: string;
image_id?: string;
instance_type?: string;
instances?: ({
detail?: {
public_dns?: string;
public_ipv4?: string;
};
instance_id?: string;
})[];
launch_template_id?: string;
name?: string;
poweroff?: boolean;
/** Format: int64 */
pubkey_id?: number;
region?: string;
/** Format: int64 */
reservation_id?: number;
source_id?: string;
};
"v1.AccountIDTypeResponse": {
aws?: {
account_id?: string;
};
};
"v1.AvailabilityStatusRequest": {
source_id?: string;
};
"v1.AzureReservationRequest": {
/** Format: int64 */
amount?: number;
image_id?: string;
instance_size?: string;
location?: string;
name?: string;
poweroff?: boolean;
/** Format: int64 */
pubkey_id?: number;
source_id?: string;
};
"v1.AzureReservationResponse": {
/** Format: int64 */
amount?: number;
image_id?: string;
instance_size?: string;
instances?: ({
detail?: {
public_dns?: string;
public_ipv4?: string;
};
instance_id?: string;
})[];
location?: string;
name?: string;
poweroff?: boolean;
/** Format: int64 */
pubkey_id?: number;
/** Format: int64 */
reservation_id?: number;
source_id?: string;
};
"v1.InstanceTypeResponse": {
architecture?: string;
azure?: {
gen_v1?: boolean;
gen_v2?: boolean;
};
/** Format: int32 */
cores?: number;
/** Format: int64 */
memory_mib?: number;
name?: string;
/** Format: int64 */
storage_gb?: number;
supported?: boolean;
/** Format: int32 */
vcpus?: number;
};
"v1.LaunchTemplatesResponse": {
id?: string;
name?: string;
};
"v1.NoopReservationResponse": {
/** Format: int64 */
reservation_id?: number;
};
"v1.PubkeyRequest": {
body?: string;
name?: string;
};
"v1.PubkeyResponse": {
body?: string;
fingerprint?: string;
fingerprint_legacy?: string;
/** Format: int64 */
id?: number;
name?: string;
type?: string;
};
"v1.ReservationResponse": {
/** Format: date-time */
created_at?: string;
error?: string;
/** Format: date-time */
finished_at?: string | null;
/** Format: int64 */
id?: number;
provider?: number;
status?: string;
/** Format: int32 */
step?: number;
step_titles?: (string)[];
/** Format: int32 */
steps?: number;
success?: boolean | null;
};
"v1.ResponseError": {
build_time?: string;
edge_id?: string;
environment?: string;
error?: string;
msg?: string;
trace_id?: string;
version?: string;
};
"v1.SourceResponse": {
id?: string;
name?: string;
source_type_id?: string;
uid?: string;
};
"v1.SourceUploadInfoResponse": {
aws?: {
account_id?: string;
} | null;
azure?: {
resource_groups?: (string)[];
subscription_id?: string;
tenant_id?: string;
} | null;
provider?: string;
};
};
responses: {
/** @description The request's parameters are not valid */
BadRequest: {
content: {
"application/json": components["schemas"]["v1.ResponseError"];
};
};
/** @description The server encountered an internal error */
InternalError: {
content: {
"application/json": components["schemas"]["v1.ResponseError"];
};
};
/** @description The requested resource was not found */
NotFound: {
content: {
"application/json": components["schemas"]["v1.ResponseError"];
};
};
};
parameters: never;
requestBodies: never;
headers: never;
pathItems: never;
}
export type external = Record<string, never>;
export interface operations {
/** @description Schedules a background operation of Sources availability check. These checks are are performed in separate process at it's own pace. Results are sent via Kafka to Sources. There is no output from this REST operation available, no tracking of jobs is possible. */
availabilityStatus: {
/** @description availability status request with source id */
requestBody: {
content: {
"application/json": components["schemas"]["v1.AvailabilityStatusRequest"];
};
};
responses: {
/** @description Returned on success, empty response. */
200: never;
500: components["responses"]["InternalError"];
};
};
/** @description Return a list of instance types for particular provider. A region must be provided. A zone must be provided for Azure. */
getInstanceTypeListAll: {
parameters: {
query: {
/** @description Region to list instance types within. This is required. */
region: string;
/** @description Availability zone (or location) to list instance types within. Not applicable for AWS EC2 as all zones within a region are the same (will lead to an error when used). Required for Azure. */
zone?: string;
};
path: {
/** @description Cloud provider: aws, azure */
PROVIDER: string;
};
};
responses: {
/** @description Return on success. Instance types have a field "supported" that indicates whether that particular type is supported by Red Hat. Typically, instances with less than 1.5 GiB RAM are not supported, but other rules may apply. */
200: {
content: {
"application/json": (components["schemas"]["v1.InstanceTypeResponse"])[];
};
};
404: components["responses"]["NotFound"];
500: components["responses"]["InternalError"];
};
};
/** @description A pubkey represents an SSH public portion of a key pair with name and body. This operation returns list of all pubkeys for particular account. */
getPubkeyList: {
responses: {
/** @description Returned on success. */
200: {
content: {
"application/json": (components["schemas"]["v1.PubkeyResponse"])[];
};
};
500: components["responses"]["InternalError"];
};
};
/** @description A pubkey represents an SSH public portion of a key pair with name and body. When pubkey is created, it is stored in the Provisioning database. Pubkeys are uploaded to clouds when an instance is launched. Some fields (e.g. type or fingerprint) are read only. */
createPubkey: {
/** @description request body */
requestBody: {
content: {
"application/json": components["schemas"]["v1.PubkeyRequest"];
};
};
responses: {
/** @description Returned on success. */
200: {
content: {
"application/json": components["schemas"]["v1.PubkeyResponse"];
};
};
500: components["responses"]["InternalError"];
};
};
/** @description A pubkey represents an SSH public portion of a key pair with name and body. Pubkeys must have unique name and body (SSH public key fingerprint) per each account. Pubkey type is detected during create operation as well as fingerprints. Currently two types are supported: RSA and ssh-ed25519. Also, two fingerprint types are calculated: standard SHA fingerprint and legacy MD5 fingerprint available under fingerprint_legacy field. Fingerprints are used to check uniqueness of key. */
getPubkeyById: {
parameters: {
path: {
/** @description Database ID to search for */
ID: number;
};
};
responses: {
/** @description Returned on success */
200: {
content: {
"application/json": components["schemas"]["v1.PubkeyResponse"];
};
};
404: components["responses"]["NotFound"];
500: components["responses"]["InternalError"];
};
};
/** @description A pubkey represents an SSH public portion of a key pair with name and body. If a pubkey was uploaded to one or more clouds, the deletion request will attempt to delete those SSH keys from all clouds. This means in order to delete a pubkey the account must have valid credentials to all cloud accounts the pubkey was uploaded to, otherwise the delete operation will fail and the pubkey will not be deleted from Provisioning database. This operation returns no body. */
removePubkeyById: {
parameters: {
path: {
/** @description Database ID of resource. */
ID: number;
};
};
responses: {
/** @description The Pubkey was deleted successfully. */
204: never;
404: components["responses"]["NotFound"];
500: components["responses"]["InternalError"];
};
};
/** @description A reservation is a way to activate a job, keeps all data needed for a job to start. This operation returns list of all reservations for particular account. To get a reservation with common fields, use /reservations/ID. To get a detailed reservation with all fields which are different per provider, use /reservations/aws/ID. */
getReservationsList: {
responses: {
/** @description Returned on success. */
200: {
content: {
"application/json": (components["schemas"]["v1.ReservationResponse"])[];
};
};
500: components["responses"]["InternalError"];
};
};
/** @description A reservation is a way to activate a job, keeps all data needed for a job to start. An AWS reservation is a reservation created for an AWS job. Image Builder UUID image is required, the service will also launch any AMI image prefixed with "ami-". Optionally, AWS EC2 launch template ID can be provided. All flags set through this endpoint override template values. Public key must exist prior calling this endpoint and ID must be provided, even when AWS EC2 launch template provides ssh-keys. Public key will be always be overwritten. */
createAwsReservation: {
/** @description aws request body */
requestBody: {
content: {
"application/json": components["schemas"]["v1.AWSReservationRequest"];
};
};
responses: {
/** @description Returned on success. */
200: {
content: {
"application/json": components["schemas"]["v1.AWSReservationResponse"];
};
};
500: components["responses"]["InternalError"];
};
};
/** @description Return an AWS reservation with details by id */
getAWSReservationByID: {
parameters: {
path: {
/** @description Reservation ID, must be an AWS reservation otherwise 404 is returned */
ID: number;
};
};
responses: {
/** @description Returns detailed reservation information for an AWS reservation. */
200: {
content: {
"application/json": components["schemas"]["v1.AWSReservationResponse"];
};
};
404: components["responses"]["NotFound"];
500: components["responses"]["InternalError"];
};
};
/** @description A reservation is a way to activate a job, keeps all data needed for a job to start. An Azure reservation is a reservation created for an Azure job. Image Builder UUID image is required and needs to be stored under same account as provided by SourceID. */
createAzureReservation: {
/** @description aws request body */
requestBody: {
content: {
"application/json": components["schemas"]["v1.AzureReservationRequest"];
};
};
responses: {
/** @description Returned on success. */
200: {
content: {
"application/json": components["schemas"]["v1.AzureReservationResponse"];
};
};
500: components["responses"]["InternalError"];
};
};
/** @description Return an Azure reservation with details by id */
getAzureReservationByID: {
parameters: {
path: {
/** @description Reservation ID, must be an Azure reservation otherwise 404 is returned */
ID: number;
};
};
responses: {
/** @description Returns detailed reservation information for an Azure reservation. */
200: {
content: {
"application/json": components["schemas"]["v1.AzureReservationResponse"];
};
};
404: components["responses"]["NotFound"];
500: components["responses"]["InternalError"];
};
};
/** @description A reservation is a way to activate a job, keeps all data needed for a job to start. A Noop reservation actually does nothing and immediately finish background job. This reservation has no input payload */
createNoopReservation: {
responses: {
/** @description Returned on success. */
200: {
content: {
"application/json": components["schemas"]["v1.NoopReservationResponse"];
};
};
500: components["responses"]["InternalError"];
};
};
/** @description Return a generic reservation by id */
getReservationByID: {
parameters: {
path: {
/** @description Reservation ID */
ID: number;
};
};
responses: {
/** @description Returns generic reservation information like status or creation time. */
200: {
content: {
"application/json": components["schemas"]["v1.ReservationResponse"];
};
};
404: components["responses"]["NotFound"];
500: components["responses"]["InternalError"];
};
};
/** @description Cloud credentials are kept in the sources application. This endpoint lists available sources for the particular account per individual type (AWS, Azure, ...). All the fields in the response are optional and can be omitted if Sources application also omits them. */
getSourceList: {
parameters: {
query?: {
provider?: "aws" | "azure" | "gcp";
};
};
responses: {
/** @description Returned on success. */
200: {
content: {
"application/json": (components["schemas"]["v1.SourceResponse"])[];
};
};
500: components["responses"]["InternalError"];
};
};
/**
* @deprecated
* @description This endpoint is deprecated. Please use upload_info instead
*/
getSourceAccountIdentity: {
parameters: {
path: {
/** @description Source ID from Sources Database */
ID: number;
};
};
responses: {
/** @description Return on success. */
200: {
content: {
"application/json": components["schemas"]["v1.AccountIDTypeResponse"];
};
};
404: components["responses"]["NotFound"];
500: components["responses"]["InternalError"];
};
};
/**
* @deprecated
* @description Deprecated endpoint, use /instance_types instead.
*/
getInstanceTypeList: {
parameters: {
query: {
/** @description Hyperscaler region */
region: string;
};
path: {
/** @description Source ID from Sources Database */
ID: number;
};
};
responses: {
/** @description Return on success. */
200: {
content: {
"application/json": (components["schemas"]["v1.InstanceTypeResponse"])[];
};
};
404: components["responses"]["NotFound"];
500: components["responses"]["InternalError"];
};
};
/**
* @description Return a list of launch templates.
* A launch template is a configuration set with a name that is available through hyperscaler API. When creating reservations, launch template can be provided in order to set additional configuration for instances.
* Currently only AWS Launch Templates are supported.
*/
getLaunchTemplatesList: {
parameters: {
query: {
/** @description Hyperscaler region */
region: string;
};
path: {
/** @description Source ID from Sources Database */
ID: number;
};
};
responses: {
/** @description Return on success. */
200: {
content: {
"application/json": (components["schemas"]["v1.LaunchTemplatesResponse"])[];
};
};
404: components["responses"]["NotFound"];
500: components["responses"]["InternalError"];
};
};
/**
* @description Provides all necessary information to upload an image for given Source. Typically, this is account number, subscription ID but some hyperscaler types also provide additional data.
* The response contains "provider" field which can be one of aws, azure or gcp and then exactly one field named "aws", "azure" or "gcp". Enum is not used due to limitation of the language (Go).
* Some types may perform more than one calls (e.g. Azure) so latency might be increased. Caching of static information is performed to improve latency of consequent calls.
*/
getSourceUploadInfo: {
parameters: {
path: {
/** @description Source ID from Sources Database */
ID: number;
};
};
responses: {
/** @description Return on success. */
200: {
content: {
"application/json": components["schemas"]["v1.SourceUploadInfoResponse"];
};
};
404: components["responses"]["NotFound"];
500: components["responses"]["InternalError"];
};
};
}

2087
types/api/rhsmSchema.ts Normal file

File diff suppressed because it is too large Load diff

1
types/index.ts Normal file
View file

@ -0,0 +1 @@
export * from './api';