From 67590aa27d115910dc46de684d8b0e29abe722d8 Mon Sep 17 00:00:00 2001 From: Chaim Lev-Ari Date: Sun, 31 May 2026 14:51:52 +0300 Subject: [PATCH] feat(api): auto generate typescript definition from api docs [BE-9222] (#2468) --- Makefile | 4 + api/api.md | 2 +- api/http/handler/handler.go | 2 +- app/global-axios.d.ts | 24 - app/portainer/services/dockerMaxApiVersion.ts | 7 +- .../dockerMaxApiVersionInterceptor.ts | 8 +- app/react/components/buttons/Button.tsx | 3 +- .../generated-api/portainer/client.gen.ts | 27 + .../portainer/client/client.gen.ts | 172 + .../generated-api/portainer/client/index.ts | 23 + .../portainer/client/types.gen.ts | 207 + .../portainer/client/utils.gen.ts | 216 + .../generated-api/portainer/core/auth.gen.ts | 42 + .../portainer/core/bodySerializer.gen.ts | 96 + .../portainer/core/params.gen.ts | 181 + .../portainer/core/pathSerializer.gen.ts | 180 + .../portainer/core/queryKeySerializer.gen.ts | 136 + .../portainer/core/serverSentEvents.gen.ts | 265 + .../generated-api/portainer/core/types.gen.ts | 118 + .../generated-api/portainer/core/utils.gen.ts | 143 + .../generated-api/portainer/sdk.gen.ts | 10077 +++++++++ .../generated-api/portainer/types.gen.ts | 18135 ++++++++++++++++ .../generated-api/portainer/zod.gen.ts | 5855 +++++ app/react/portainer/services/axios/axios.ts | 2 - .../services/axios/configure-hey-api.ts | 10 + app/setup-tests/mock-codemirror.tsx | 115 +- app/setup-tests/mock-localizeDate.ts | 37 +- eslint.config.mjs | 3 +- openapi-ts.config.ts | 37 + package.json | 6 +- pnpm-lock.yaml | 469 +- tsconfig.generated.json | 25 + tsconfig.json | 42 +- vitest.config.mts | 6 +- webpack/webpack.common.js | 4 +- 35 files changed, 36420 insertions(+), 259 deletions(-) delete mode 100644 app/global-axios.d.ts create mode 100644 app/react/portainer/generated-api/portainer/client.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/client/client.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/client/index.ts create mode 100644 app/react/portainer/generated-api/portainer/client/types.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/client/utils.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/core/auth.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/core/bodySerializer.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/core/params.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/core/pathSerializer.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/core/queryKeySerializer.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/core/serverSentEvents.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/core/types.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/core/utils.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/sdk.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/types.gen.ts create mode 100644 app/react/portainer/generated-api/portainer/zod.gen.ts create mode 100644 app/react/portainer/services/axios/configure-hey-api.ts create mode 100644 openapi-ts.config.ts create mode 100644 tsconfig.generated.json diff --git a/Makefile b/Makefile index 64f40ad337..adb4a36a29 100644 --- a/Makefile +++ b/Makefile @@ -121,6 +121,10 @@ docs-serve: docs-build ## Serve docs locally with Swagger UI on port 8080 -e SWAGGER_JSON=/foo/swagger.yaml \ -v $(PWD)/dist/docs:/foo \ swaggerapi/swagger-ui + +.PHONY: generate-api +generate-api: docs-validate ## Generate API client and types from OpenAPI spec + pnpm generate-api ##@ Helpers .PHONY: help diff --git a/api/api.md b/api/api.md index 37de9baa9d..8e53c4046c 100644 --- a/api/api.md +++ b/api/api.md @@ -53,7 +53,7 @@ To do so, use the `/endpoints/{id}/docker` endpoint. Note that this endpoint is # Private Registry When using a private registry, include a Base64-encoded JSON string in the request header. The header parameter name is `X-Registry-Auth` and the value should encode the following structure: ‘{"registryId":\}’ where `` is the ID of the registry where the repository was created. - + Example encoded value: ``` diff --git a/api/http/handler/handler.go b/api/http/handler/handler.go index 8910190c18..33d3417733 100644 --- a/api/http/handler/handler.go +++ b/api/http/handler/handler.go @@ -80,7 +80,7 @@ type Handler struct { // @title PortainerCE API // @version 2.43.0 -// @description.markdown api-description.md +// @description.markdown // @x-tagGroups [{"name":"Access Control","tags":["auth","roles","team_memberships","teams","users"]},{"name":"Administration","tags":["backup","ldap","motd","settings","status","system","ssl","upload"]},{"name":"Docker","tags":["templates","custom_templates","docker","registries","resource_controls","stacks","webhooks","websocket"]},{"name":"Edge Compute","tags":["edge_agent","edge_groups","edge_jobs","edge","edge_stacks"]},{"name":"Environment Management","tags":["endpoint_groups","endpoints","tags"]},{"name":"GitOps","tags":["gitops"]},{"name":"Kubernetes","tags":["helm","kubernetes"]}] // @termsOfService diff --git a/app/global-axios.d.ts b/app/global-axios.d.ts deleted file mode 100644 index 63e5b16810..0000000000 --- a/app/global-axios.d.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { - MaxDockerAPIVersionKey, - MaxDockerAPIVersionType, -} from './portainer/services/dockerMaxApiVersion'; - -export * from 'axios'; - -declare module 'axios' { - interface CreateAxiosDefaults { - /** - * require to define a default max Docker API Version when creating an axios instance - */ - [MaxDockerAPIVersionKey]: MaxDockerAPIVersionType; - } - - interface AxiosRequestConfig { - /** - * represents the maximum Docker API version supported for the request - * - * the default will be used when not specified in the request config - */ - [MaxDockerAPIVersionKey]?: MaxDockerAPIVersionType; - } -} diff --git a/app/portainer/services/dockerMaxApiVersion.ts b/app/portainer/services/dockerMaxApiVersion.ts index c5b6bf7610..80ff7eccb9 100644 --- a/app/portainer/services/dockerMaxApiVersion.ts +++ b/app/portainer/services/dockerMaxApiVersion.ts @@ -1,7 +1,2 @@ -// Key used in axios types definitions -export const MaxDockerAPIVersionKey = 'maxDockerAPIVersion' as const; - -export type DockerAPIVersionType = number; - // this is the version we are using with the generated API types -export const MAX_DOCKER_API_VERSION: DockerAPIVersionType = 1.47; +export const MAX_DOCKER_API_VERSION = 1.47; diff --git a/app/portainer/services/dockerMaxApiVersionInterceptor.ts b/app/portainer/services/dockerMaxApiVersionInterceptor.ts index d7635e9283..ba3da404a3 100644 --- a/app/portainer/services/dockerMaxApiVersionInterceptor.ts +++ b/app/portainer/services/dockerMaxApiVersionInterceptor.ts @@ -8,7 +8,6 @@ import { MAX_DOCKER_API_VERSION } from './dockerMaxApiVersion'; const envVersionAxios = Axios.create({ baseURL: 'api', - maxDockerAPIVersion: MAX_DOCKER_API_VERSION, }); // setup a cache for the intermediary request sent by the interceptor @@ -43,17 +42,16 @@ export async function dockerMaxAPIVersionInterceptor( ); const apiVersion = parseFloat(data.ApiVersion ?? '0'); - const { maxDockerAPIVersion } = config; - if (apiVersion > maxDockerAPIVersion) { + if (apiVersion > MAX_DOCKER_API_VERSION) { config.url = config.url?.replace( /docker/, - `docker/v${maxDockerAPIVersion}` + `docker/v${MAX_DOCKER_API_VERSION}` ); } } return config; - } catch (err) { + } catch { // if the interceptor errors, return the original config return rawConfig; } diff --git a/app/react/components/buttons/Button.tsx b/app/react/components/buttons/Button.tsx index 0d7f921245..2a04cf4f2d 100644 --- a/app/react/components/buttons/Button.tsx +++ b/app/react/components/buttons/Button.tsx @@ -30,8 +30,7 @@ type Color = type Size = 'xsmall' | 'small' | 'medium' | 'large'; export interface Props - extends AriaAttributes, - AutomationTestingProps { + extends AriaAttributes, AutomationTestingProps { icon?: ReactNode | ComponentType; color?: Color; diff --git a/app/react/portainer/generated-api/portainer/client.gen.ts b/app/react/portainer/generated-api/portainer/client.gen.ts new file mode 100644 index 0000000000..26e283a71d --- /dev/null +++ b/app/react/portainer/generated-api/portainer/client.gen.ts @@ -0,0 +1,27 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { createClientConfig } from '@/react/portainer/services/axios/configure-hey-api'; + +import { + type ClientOptions, + type Config, + createClient, + createConfig, +} from './client'; +import type { ClientOptions as ClientOptions2 } from './types.gen'; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = ( + override?: Config +) => Config & T>; + +export const client = createClient( + createClientConfig(createConfig({ throwOnError: true })) +); diff --git a/app/react/portainer/generated-api/portainer/client/client.gen.ts b/app/react/portainer/generated-api/portainer/client/client.gen.ts new file mode 100644 index 0000000000..adce8b9c3c --- /dev/null +++ b/app/react/portainer/generated-api/portainer/client/client.gen.ts @@ -0,0 +1,172 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { AxiosError, AxiosInstance, RawAxiosRequestHeaders } from 'axios'; +import axios from 'axios'; + +import { createSseClient } from '../core/serverSentEvents.gen'; +import type { HttpMethod } from '../core/types.gen'; +import { getValidRequestBody } from '../core/utils.gen'; +import type { Client, Config, RequestOptions } from './types.gen'; +import { + buildUrl, + createConfig, + mergeConfigs, + mergeHeaders, + setAuthParams, +} from './utils.gen'; + +export const createClient = (config: Config = {}): Client => { + let _config = mergeConfigs(createConfig(), config); + + let instance: AxiosInstance; + + if (_config.axios && !('Axios' in _config.axios)) { + instance = _config.axios; + } else { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { auth, ...configWithoutAuth } = _config; + instance = axios.create(configWithoutAuth); + } + + const getConfig = (): Config => ({ ..._config }); + + const setConfig = (config: Config): Config => { + _config = mergeConfigs(_config, config); + instance.defaults = { + ...instance.defaults, + ..._config, + // @ts-expect-error + headers: mergeHeaders(instance.defaults.headers, _config.headers), + }; + return getConfig(); + }; + + const beforeRequest = async < + TData = unknown, + ThrowOnError extends boolean = boolean, + Url extends string = string, + >( + options: RequestOptions + ) => { + const opts = { + ..._config, + ...options, + axios: options.axios ?? _config.axios ?? instance, + headers: mergeHeaders(_config.headers, options.headers), + }; + + if (opts.security) { + await setAuthParams(opts); + } + + if (opts.requestValidator) { + await opts.requestValidator(opts); + } + + if (opts.body !== undefined && opts.bodySerializer) { + opts.body = opts.bodySerializer(opts.body); + } + + const url = buildUrl(opts); + + return { opts, url }; + }; + + // @ts-expect-error + const request: Client['request'] = async (options) => { + const { opts, url } = await beforeRequest(options); + try { + // assign Axios here for consistency with fetch + const _axios = opts.axios!; + // eslint-disable-next-line @typescript-eslint/no-unused-vars + const { auth, ...optsWithoutAuth } = opts; + const response = await _axios({ + ...optsWithoutAuth, + baseURL: '', // the baseURL is already included in `url` + data: getValidRequestBody(opts), + headers: opts.headers as RawAxiosRequestHeaders, + // let `paramsSerializer()` handle query params if it exists + params: opts.paramsSerializer ? opts.query : undefined, + url, + }); + + let { data } = response; + + if (opts.responseType === 'json') { + if (opts.responseValidator) { + await opts.responseValidator(data); + } + + if (opts.responseTransformer) { + data = await opts.responseTransformer(data); + } + } + + return { + ...response, + data: data ?? {}, + }; + } catch (error) { + const e = error as AxiosError; + if (opts.throwOnError) { + throw e; + } + // @ts-expect-error + e.error = e.response?.data ?? {}; + return e; + } + }; + + const makeMethodFn = + (method: Uppercase) => (options: RequestOptions) => + request({ ...options, method }); + + const makeSseFn = + (method: Uppercase) => async (options: RequestOptions) => { + const { opts, url } = await beforeRequest(options); + return createSseClient({ + ...opts, + body: opts.body as BodyInit | null | undefined, + headers: opts.headers as Record, + method, + serializedBody: getValidRequestBody(opts) as + | BodyInit + | null + | undefined, + // @ts-expect-error + signal: opts.signal, + url, + }); + }; + + const _buildUrl: Client['buildUrl'] = (options) => + buildUrl({ axios: instance, ..._config, ...options }); + + return { + buildUrl: _buildUrl, + connect: makeMethodFn('CONNECT'), + delete: makeMethodFn('DELETE'), + get: makeMethodFn('GET'), + getConfig, + head: makeMethodFn('HEAD'), + instance, + options: makeMethodFn('OPTIONS'), + patch: makeMethodFn('PATCH'), + post: makeMethodFn('POST'), + put: makeMethodFn('PUT'), + request, + setConfig, + sse: { + connect: makeSseFn('CONNECT'), + delete: makeSseFn('DELETE'), + get: makeSseFn('GET'), + head: makeSseFn('HEAD'), + options: makeSseFn('OPTIONS'), + patch: makeSseFn('PATCH'), + post: makeSseFn('POST'), + put: makeSseFn('PUT'), + trace: makeSseFn('TRACE'), + }, + trace: makeMethodFn('TRACE'), + } as Client; +}; diff --git a/app/react/portainer/generated-api/portainer/client/index.ts b/app/react/portainer/generated-api/portainer/client/index.ts new file mode 100644 index 0000000000..7bd7b98807 --- /dev/null +++ b/app/react/portainer/generated-api/portainer/client/index.ts @@ -0,0 +1,23 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type { Auth } from '../core/auth.gen'; +export type { QuerySerializerOptions } from '../core/bodySerializer.gen'; +export { + formDataBodySerializer, + jsonBodySerializer, + urlSearchParamsBodySerializer, +} from '../core/bodySerializer.gen'; +export { buildClientParams } from '../core/params.gen'; +export { serializeQueryKeyValue } from '../core/queryKeySerializer.gen'; +export { createClient } from './client.gen'; +export type { + Client, + ClientOptions, + Config, + CreateClientConfig, + Options, + RequestOptions, + RequestResult, + TDataShape, +} from './types.gen'; +export { createConfig } from './utils.gen'; diff --git a/app/react/portainer/generated-api/portainer/client/types.gen.ts b/app/react/portainer/generated-api/portainer/client/types.gen.ts new file mode 100644 index 0000000000..8147ac3aeb --- /dev/null +++ b/app/react/portainer/generated-api/portainer/client/types.gen.ts @@ -0,0 +1,207 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { + AxiosError, + AxiosInstance, + AxiosRequestHeaders, + AxiosResponse, + AxiosStatic, + CreateAxiosDefaults, +} from 'axios'; + +import type { Auth } from '../core/auth.gen'; +import type { + ServerSentEventsOptions, + ServerSentEventsResult, +} from '../core/serverSentEvents.gen'; +import type { + Client as CoreClient, + Config as CoreConfig, +} from '../core/types.gen'; + +export interface Config + extends + Omit, + CoreConfig { + /** + * Axios implementation. You can use this option to provide either an + * `AxiosStatic` or an `AxiosInstance`. + * + * @default axios + */ + axios?: AxiosStatic | AxiosInstance; + /** + * Base URL for all requests made by this client. + */ + baseURL?: T['baseURL']; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: + | AxiosRequestHeaders + | Record< + string, + | string + | number + | boolean + | (string | number | boolean)[] + | null + | undefined + | unknown + >; + /** + * Throw an error instead of returning it in the response? + * + * @default false + */ + throwOnError?: T['throwOnError']; +} + +export interface RequestOptions< + TData = unknown, + ThrowOnError extends boolean = boolean, + Url extends string = string, +> + extends + Config<{ + throwOnError: ThrowOnError; + }>, + Pick< + ServerSentEventsOptions, + | 'onRequest' + | 'onSseError' + | 'onSseEvent' + | 'sseDefaultRetryDelay' + | 'sseMaxRetryAttempts' + | 'sseMaxRetryDelay' + > { + /** + * Any body that you want to add to your request. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#body} + */ + body?: unknown; + path?: Record; + query?: Record; + /** + * Security mechanism(s) to use for the request. + */ + security?: ReadonlyArray; + url: Url; +} + +export interface ClientOptions { + baseURL?: string; + throwOnError?: boolean; +} + +export type RequestResult< + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = boolean, +> = ThrowOnError extends true + ? Promise< + AxiosResponse< + TData extends Record ? TData[keyof TData] : TData + > + > + : Promise< + | (AxiosResponse< + TData extends Record ? TData[keyof TData] : TData + > & { + error: undefined; + }) + | (AxiosError< + TError extends Record ? TError[keyof TError] : TError + > & { + data: undefined; + error: TError extends Record + ? TError[keyof TError] + : TError; + }) + >; + +type MethodFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, +>( + options: Omit, 'method'> +) => RequestResult; + +type SseFn = < + TData = unknown, + // eslint-disable-next-line @typescript-eslint/no-unused-vars + _TError = unknown, + ThrowOnError extends boolean = false, +>( + options: Omit, 'method'> +) => Promise>; + +type RequestFn = < + TData = unknown, + TError = unknown, + ThrowOnError extends boolean = false, +>( + options: Omit, 'method'> & + Pick>, 'method'> +) => RequestResult; + +type BuildUrlFn = < + TData extends { + path?: Record; + query?: Record; + url: string; + }, +>( + options: TData & + Pick< + RequestOptions, + 'axios' | 'baseURL' | 'paramsSerializer' | 'querySerializer' + > +) => string; + +export type Client = CoreClient< + RequestFn, + Config, + MethodFn, + BuildUrlFn, + SseFn +> & { + instance: AxiosInstance; +}; + +/** + * The `createClientConfig()` function will be called on client initialization + * and the returned object will become the client's initial configuration. + * + * You may want to initialize your client this way instead of calling + * `setConfig()`. This is useful for example if you're using Next.js + * to ensure your client always has the correct values. + */ +export type CreateClientConfig = ( + override?: Config +) => Config & T>; + +export interface TDataShape { + body?: unknown; + headers?: unknown; + path?: unknown; + query?: unknown; + url: string; +} + +type OmitKeys = Pick>; + +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, + TResponse = unknown, +> = OmitKeys< + RequestOptions, + 'body' | 'path' | 'query' | 'url' +> & + ([TData] extends [never] ? unknown : Omit); diff --git a/app/react/portainer/generated-api/portainer/client/utils.gen.ts b/app/react/portainer/generated-api/portainer/client/utils.gen.ts new file mode 100644 index 0000000000..c5a76a1de0 --- /dev/null +++ b/app/react/portainer/generated-api/portainer/client/utils.gen.ts @@ -0,0 +1,216 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import { getAuthToken } from '../core/auth.gen'; +import type { QuerySerializerOptions } from '../core/bodySerializer.gen'; +import { + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from '../core/pathSerializer.gen'; +import { getUrl } from '../core/utils.gen'; +import type { + Client, + ClientOptions, + Config, + RequestOptions, +} from './types.gen'; + +export const createQuerySerializer = ({ + parameters = {}, + ...args +}: QuerySerializerOptions = {}) => { + const querySerializer = (queryParams: T) => { + const search: string[] = []; + if (queryParams && typeof queryParams === 'object') { + for (const name in queryParams) { + const value = queryParams[name]; + + if (value === undefined || value === null) { + continue; + } + + const options = parameters[name] || args; + + if (Array.isArray(value)) { + const serializedArray = serializeArrayParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: 'form', + value, + ...options.array, + }); + if (serializedArray) search.push(serializedArray); + } else if (typeof value === 'object') { + const serializedObject = serializeObjectParam({ + allowReserved: options.allowReserved, + explode: true, + name, + style: 'deepObject', + value: value as Record, + ...options.object, + }); + if (serializedObject) search.push(serializedObject); + } else { + const serializedPrimitive = serializePrimitiveParam({ + allowReserved: options.allowReserved, + name, + value: value as string, + }); + if (serializedPrimitive) search.push(serializedPrimitive); + } + } + } + return search.join('&'); + }; + return querySerializer; +}; + +const checkForExistence = ( + options: Pick & { + headers: Record; + }, + name?: string +): boolean => { + if (!name) { + return false; + } + if (name in options.headers || options.query?.[name]) { + return true; + } + if ( + 'Cookie' in options.headers && + options.headers['Cookie'] && + typeof options.headers['Cookie'] === 'string' + ) { + return options.headers['Cookie'].includes(`${name}=`); + } + return false; +}; + +export async function setAuthParams( + options: Pick & { + headers: Record; + } +): Promise { + for (const auth of options.security ?? []) { + if (checkForExistence(options, auth.name)) { + continue; + } + const token = await getAuthToken(auth, options.auth); + + if (!token) { + continue; + } + + const name = auth.name ?? 'Authorization'; + + switch (auth.in) { + case 'query': + if (!options.query) { + options.query = {}; + } + options.query[name] = token; + break; + case 'cookie': { + const value = `${name}=${token}`; + if ('Cookie' in options.headers && options.headers['Cookie']) { + options.headers['Cookie'] = `${options.headers['Cookie']}; ${value}`; + } else { + options.headers['Cookie'] = value; + } + break; + } + case 'header': + default: + options.headers[name] = token; + break; + } + } +} + +export const buildUrl: Client['buildUrl'] = (options) => { + const instanceBaseUrl = options.axios?.defaults?.baseURL; + + const baseUrl = + options.baseURL && typeof options.baseURL === 'string' + ? options.baseURL + : instanceBaseUrl; + + return getUrl({ + baseUrl: baseUrl as string, + path: options.path, + // let `paramsSerializer()` handle query params if it exists + query: !options.paramsSerializer ? options.query : undefined, + querySerializer: + typeof options.querySerializer === 'function' + ? options.querySerializer + : createQuerySerializer(options.querySerializer), + url: options.url, + }); +}; + +export const mergeConfigs = (a: Config, b: Config): Config => { + const config = { ...a, ...b }; + config.headers = mergeHeaders(a.headers, b.headers); + return config; +}; + +/** + * Special Axios headers keywords allowing to set headers by request method. + */ +export const axiosHeadersKeywords = [ + 'common', + 'delete', + 'get', + 'head', + 'patch', + 'post', + 'put', +] as const; + +export const mergeHeaders = ( + ...headers: Array['headers'] | undefined> +): Record => { + const mergedHeaders: Record = {}; + for (const header of headers) { + if (!header || typeof header !== 'object') { + continue; + } + + const iterator = Object.entries(header); + + for (const [key, value] of iterator) { + if ( + axiosHeadersKeywords.includes( + key as (typeof axiosHeadersKeywords)[number] + ) && + typeof value === 'object' + ) { + mergedHeaders[key] = { + ...(mergedHeaders[key] as Record), + ...value, + }; + } else if (value === null) { + delete mergedHeaders[key]; + } else if (Array.isArray(value)) { + for (const v of value) { + // @ts-expect-error + mergedHeaders[key] = [...(mergedHeaders[key] ?? []), v as string]; + } + } else if (value !== undefined) { + // assume object headers are meant to be JSON stringified, i.e., their + // content value in OpenAPI specification is 'application/json' + mergedHeaders[key] = + typeof value === 'object' ? JSON.stringify(value) : (value as string); + } + } + } + return mergedHeaders; +}; + +export const createConfig = ( + override: Config & T> = {} +): Config & T> => ({ + ...override, +}); diff --git a/app/react/portainer/generated-api/portainer/core/auth.gen.ts b/app/react/portainer/generated-api/portainer/core/auth.gen.ts new file mode 100644 index 0000000000..8eafe1fe35 --- /dev/null +++ b/app/react/portainer/generated-api/portainer/core/auth.gen.ts @@ -0,0 +1,42 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type AuthToken = string | undefined; + +export interface Auth { + /** + * Which part of the request do we use to send the auth? + * + * @default 'header' + */ + in?: 'header' | 'query' | 'cookie'; + /** + * Header or query parameter name. + * + * @default 'Authorization' + */ + name?: string; + scheme?: 'basic' | 'bearer'; + type: 'apiKey' | 'http'; +} + +export const getAuthToken = async ( + auth: Auth, + callback: ((auth: Auth) => Promise | AuthToken) | AuthToken +): Promise => { + const token = + typeof callback === 'function' ? await callback(auth) : callback; + + if (!token) { + return; + } + + if (auth.scheme === 'bearer') { + return `Bearer ${token}`; + } + + if (auth.scheme === 'basic') { + return `Basic ${btoa(token)}`; + } + + return token; +}; diff --git a/app/react/portainer/generated-api/portainer/core/bodySerializer.gen.ts b/app/react/portainer/generated-api/portainer/core/bodySerializer.gen.ts new file mode 100644 index 0000000000..e36384160e --- /dev/null +++ b/app/react/portainer/generated-api/portainer/core/bodySerializer.gen.ts @@ -0,0 +1,96 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { + ArrayStyle, + ObjectStyle, + SerializerOptions, +} from './pathSerializer.gen'; + +export type QuerySerializer = (query: Record) => string; + +export type BodySerializer = (body: unknown) => unknown; + +type QuerySerializerOptionsObject = { + allowReserved?: boolean; + array?: Partial>; + object?: Partial>; +}; + +export type QuerySerializerOptions = QuerySerializerOptionsObject & { + /** + * Per-parameter serialization overrides. When provided, these settings + * override the global array/object settings for specific parameter names. + */ + parameters?: Record; +}; + +const serializeFormDataPair = ( + data: FormData, + key: string, + value: unknown +): void => { + if (typeof value === 'string' || value instanceof Blob) { + data.append(key, value); + } else if (value instanceof Date) { + data.append(key, value.toISOString()); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +const serializeUrlSearchParamsPair = ( + data: URLSearchParams, + key: string, + value: unknown +): void => { + if (typeof value === 'string') { + data.append(key, value); + } else { + data.append(key, JSON.stringify(value)); + } +}; + +export const formDataBodySerializer = { + bodySerializer: (body: unknown): FormData => { + const data = new FormData(); + + Object.entries(body as Record).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeFormDataPair(data, key, v)); + } else { + serializeFormDataPair(data, key, value); + } + }); + + return data; + }, +}; + +export const jsonBodySerializer = { + bodySerializer: (body: unknown): string => + JSON.stringify(body, (_key, value) => + typeof value === 'bigint' ? value.toString() : value + ), +}; + +export const urlSearchParamsBodySerializer = { + bodySerializer: (body: unknown): string => { + const data = new URLSearchParams(); + + Object.entries(body as Record).forEach(([key, value]) => { + if (value === undefined || value === null) { + return; + } + if (Array.isArray(value)) { + value.forEach((v) => serializeUrlSearchParamsPair(data, key, v)); + } else { + serializeUrlSearchParamsPair(data, key, value); + } + }); + + return data.toString(); + }, +}; diff --git a/app/react/portainer/generated-api/portainer/core/params.gen.ts b/app/react/portainer/generated-api/portainer/core/params.gen.ts new file mode 100644 index 0000000000..ac5035ecfe --- /dev/null +++ b/app/react/portainer/generated-api/portainer/core/params.gen.ts @@ -0,0 +1,181 @@ +// This file is auto-generated by @hey-api/openapi-ts + +type Slot = 'body' | 'headers' | 'path' | 'query'; + +export type Field = + | { + in: Exclude; + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If omitted, we use the same value as `key`. + */ + map?: string; + } + | { + in: Extract; + /** + * Key isn't required for bodies. + */ + key?: string; + map?: string; + } + | { + /** + * Field name. This is the name we want the user to see and use. + */ + key: string; + /** + * Field mapped name. This is the name we want to use in the request. + * If `in` is omitted, `map` aliases `key` to the transport layer. + */ + map: Slot; + }; + +export interface Fields { + allowExtra?: Partial>; + args?: ReadonlyArray; +} + +export type FieldsConfig = ReadonlyArray; + +const extraPrefixesMap: Record = { + $body_: 'body', + $headers_: 'headers', + $path_: 'path', + $query_: 'query', +}; +const extraPrefixes = Object.entries(extraPrefixesMap); + +type KeyMap = Map< + string, + | { + in: Slot; + map?: string; + } + | { + in?: never; + map: Slot; + } +>; + +const buildKeyMap = (fields: FieldsConfig, map?: KeyMap): KeyMap => { + if (!map) { + map = new Map(); + } + + for (const config of fields) { + if ('in' in config) { + if (config.key) { + map.set(config.key, { + in: config.in, + map: config.map, + }); + } + } else if ('key' in config) { + map.set(config.key, { + map: config.map, + }); + } else if (config.args) { + buildKeyMap(config.args, map); + } + } + + return map; +}; + +interface Params { + body: unknown; + headers: Record; + path: Record; + query: Record; +} + +const stripEmptySlots = (params: Params) => { + for (const [slot, value] of Object.entries(params)) { + if ( + value && + typeof value === 'object' && + !Array.isArray(value) && + !Object.keys(value).length + ) { + delete params[slot as Slot]; + } + } +}; + +export const buildClientParams = ( + args: ReadonlyArray, + fields: FieldsConfig +) => { + const params: Params = { + body: Object.create(null), + headers: Object.create(null), + path: Object.create(null), + query: Object.create(null), + }; + + const map = buildKeyMap(fields); + + let config: FieldsConfig[number] | undefined; + + for (const [index, arg] of args.entries()) { + if (fields[index]) { + config = fields[index]; + } + + if (!config) { + continue; + } + + if ('in' in config) { + if (config.key) { + const field = map.get(config.key)!; + const name = field.map || config.key; + if (field.in) { + (params[field.in] as Record)[name] = arg; + } + } else { + params.body = arg; + } + } else { + for (const [key, value] of Object.entries(arg ?? {})) { + const field = map.get(key); + + if (field) { + if (field.in) { + const name = field.map || key; + (params[field.in] as Record)[name] = value; + } else { + params[field.map] = value; + } + } else { + const extra = extraPrefixes.find(([prefix]) => + key.startsWith(prefix) + ); + + if (extra) { + const [prefix, slot] = extra; + (params[slot] as Record)[ + key.slice(prefix.length) + ] = value; + } else if ('allowExtra' in config && config.allowExtra) { + for (const [slot, allowed] of Object.entries(config.allowExtra)) { + if (allowed) { + (params[slot as Slot] as Record)[key] = value; + break; + } + } + } + } + } + } + } + + stripEmptySlots(params); + + return params; +}; diff --git a/app/react/portainer/generated-api/portainer/core/pathSerializer.gen.ts b/app/react/portainer/generated-api/portainer/core/pathSerializer.gen.ts new file mode 100644 index 0000000000..5bf31e4fc8 --- /dev/null +++ b/app/react/portainer/generated-api/portainer/core/pathSerializer.gen.ts @@ -0,0 +1,180 @@ +// This file is auto-generated by @hey-api/openapi-ts + +interface SerializeOptions + extends SerializePrimitiveOptions, SerializerOptions {} + +interface SerializePrimitiveOptions { + allowReserved?: boolean; + name: string; +} + +export interface SerializerOptions { + /** + * @default true + */ + explode: boolean; + style: T; +} + +export type ArrayStyle = 'form' | 'spaceDelimited' | 'pipeDelimited'; +export type ArraySeparatorStyle = ArrayStyle | MatrixStyle; +type MatrixStyle = 'label' | 'matrix' | 'simple'; +export type ObjectStyle = 'form' | 'deepObject'; +type ObjectSeparatorStyle = ObjectStyle | MatrixStyle; + +interface SerializePrimitiveParam extends SerializePrimitiveOptions { + value: string; +} + +export const separatorArrayExplode = (style: ArraySeparatorStyle) => { + switch (style) { + case 'label': + return '.'; + case 'matrix': + return ';'; + case 'simple': + return ','; + default: + return '&'; + } +}; + +export const separatorArrayNoExplode = (style: ArraySeparatorStyle) => { + switch (style) { + case 'form': + return ','; + case 'pipeDelimited': + return '|'; + case 'spaceDelimited': + return '%20'; + default: + return ','; + } +}; + +export const separatorObjectExplode = (style: ObjectSeparatorStyle) => { + switch (style) { + case 'label': + return '.'; + case 'matrix': + return ';'; + case 'simple': + return ','; + default: + return '&'; + } +}; + +export const serializeArrayParam = ({ + allowReserved, + explode, + name, + style, + value, +}: SerializeOptions & { + value: unknown[]; +}) => { + if (!explode) { + const joinedValues = ( + allowReserved ? value : value.map((v) => encodeURIComponent(v as string)) + ).join(separatorArrayNoExplode(style)); + switch (style) { + case 'label': + return `.${joinedValues}`; + case 'matrix': + return `;${name}=${joinedValues}`; + case 'simple': + return joinedValues; + default: + return `${name}=${joinedValues}`; + } + } + + const separator = separatorArrayExplode(style); + const joinedValues = value + .map((v) => { + if (style === 'label' || style === 'simple') { + return allowReserved ? v : encodeURIComponent(v as string); + } + + return serializePrimitiveParam({ + allowReserved, + name, + value: v as string, + }); + }) + .join(separator); + return style === 'label' || style === 'matrix' + ? separator + joinedValues + : joinedValues; +}; + +export const serializePrimitiveParam = ({ + allowReserved, + name, + value, +}: SerializePrimitiveParam) => { + if (value === undefined || value === null) { + return ''; + } + + if (typeof value === 'object') { + throw new Error( + 'Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.' + ); + } + + return `${name}=${allowReserved ? value : encodeURIComponent(value)}`; +}; + +export const serializeObjectParam = ({ + allowReserved, + explode, + name, + style, + value, + valueOnly, +}: SerializeOptions & { + value: Record | Date; + valueOnly?: boolean; +}) => { + if (value instanceof Date) { + return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`; + } + + if (style !== 'deepObject' && !explode) { + let values: string[] = []; + Object.entries(value).forEach(([key, v]) => { + values = [ + ...values, + key, + allowReserved ? (v as string) : encodeURIComponent(v as string), + ]; + }); + const joinedValues = values.join(','); + switch (style) { + case 'form': + return `${name}=${joinedValues}`; + case 'label': + return `.${joinedValues}`; + case 'matrix': + return `;${name}=${joinedValues}`; + default: + return joinedValues; + } + } + + const separator = separatorObjectExplode(style); + const joinedValues = Object.entries(value) + .map(([key, v]) => + serializePrimitiveParam({ + allowReserved, + name: style === 'deepObject' ? `${name}[${key}]` : key, + value: v as string, + }) + ) + .join(separator); + return style === 'label' || style === 'matrix' + ? separator + joinedValues + : joinedValues; +}; diff --git a/app/react/portainer/generated-api/portainer/core/queryKeySerializer.gen.ts b/app/react/portainer/generated-api/portainer/core/queryKeySerializer.gen.ts new file mode 100644 index 0000000000..5c1cf34a06 --- /dev/null +++ b/app/react/portainer/generated-api/portainer/core/queryKeySerializer.gen.ts @@ -0,0 +1,136 @@ +// This file is auto-generated by @hey-api/openapi-ts + +/** + * JSON-friendly union that mirrors what Pinia Colada can hash. + */ +export type JsonValue = + | null + | string + | number + | boolean + | JsonValue[] + | { [key: string]: JsonValue }; + +/** + * Replacer that converts non-JSON values (bigint, Date, etc.) to safe substitutes. + */ +export const queryKeyJsonReplacer = (_key: string, value: unknown) => { + if ( + value === undefined || + typeof value === 'function' || + typeof value === 'symbol' + ) { + return undefined; + } + if (typeof value === 'bigint') { + return value.toString(); + } + if (value instanceof Date) { + return value.toISOString(); + } + return value; +}; + +/** + * Safely stringifies a value and parses it back into a JsonValue. + */ +export const stringifyToJsonValue = (input: unknown): JsonValue | undefined => { + try { + const json = JSON.stringify(input, queryKeyJsonReplacer); + if (json === undefined) { + return undefined; + } + return JSON.parse(json) as JsonValue; + } catch { + return undefined; + } +}; + +/** + * Detects plain objects (including objects with a null prototype). + */ +const isPlainObject = (value: unknown): value is Record => { + if (value === null || typeof value !== 'object') { + return false; + } + const prototype = Object.getPrototypeOf(value as object); + return prototype === Object.prototype || prototype === null; +}; + +/** + * Turns URLSearchParams into a sorted JSON object for deterministic keys. + */ +const serializeSearchParams = (params: URLSearchParams): JsonValue => { + const entries = Array.from(params.entries()).sort(([a], [b]) => + a.localeCompare(b) + ); + const result: Record = {}; + + for (const [key, value] of entries) { + const existing = result[key]; + if (existing === undefined) { + result[key] = value; + continue; + } + + if (Array.isArray(existing)) { + (existing as string[]).push(value); + } else { + result[key] = [existing, value]; + } + } + + return result; +}; + +/** + * Normalizes any accepted value into a JSON-friendly shape for query keys. + */ +export const serializeQueryKeyValue = ( + value: unknown +): JsonValue | undefined => { + if (value === null) { + return null; + } + + if ( + typeof value === 'string' || + typeof value === 'number' || + typeof value === 'boolean' + ) { + return value; + } + + if ( + value === undefined || + typeof value === 'function' || + typeof value === 'symbol' + ) { + return undefined; + } + + if (typeof value === 'bigint') { + return value.toString(); + } + + if (value instanceof Date) { + return value.toISOString(); + } + + if (Array.isArray(value)) { + return stringifyToJsonValue(value); + } + + if ( + typeof URLSearchParams !== 'undefined' && + value instanceof URLSearchParams + ) { + return serializeSearchParams(value); + } + + if (isPlainObject(value)) { + return stringifyToJsonValue(value); + } + + return undefined; +}; diff --git a/app/react/portainer/generated-api/portainer/core/serverSentEvents.gen.ts b/app/react/portainer/generated-api/portainer/core/serverSentEvents.gen.ts new file mode 100644 index 0000000000..536db4e904 --- /dev/null +++ b/app/react/portainer/generated-api/portainer/core/serverSentEvents.gen.ts @@ -0,0 +1,265 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Config } from './types.gen'; + +export type ServerSentEventsOptions = Omit< + RequestInit, + 'method' +> & + Pick & { + /** + * Fetch API implementation. You can use this option to provide a custom + * fetch instance. + * + * @default globalThis.fetch + */ + fetch?: typeof fetch; + /** + * Implementing clients can call request interceptors inside this hook. + */ + onRequest?: (url: string, init: RequestInit) => Promise; + /** + * Callback invoked when a network or parsing error occurs during streaming. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param error The error that occurred. + */ + onSseError?: (error: unknown) => void; + /** + * Callback invoked when an event is streamed from the server. + * + * This option applies only if the endpoint returns a stream of events. + * + * @param event Event streamed from the server. + * @returns Nothing (void). + */ + onSseEvent?: (event: StreamEvent) => void; + serializedBody?: RequestInit['body']; + /** + * Default retry delay in milliseconds. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 3000 + */ + sseDefaultRetryDelay?: number; + /** + * Maximum number of retry attempts before giving up. + */ + sseMaxRetryAttempts?: number; + /** + * Maximum retry delay in milliseconds. + * + * Applies only when exponential backoff is used. + * + * This option applies only if the endpoint returns a stream of events. + * + * @default 30000 + */ + sseMaxRetryDelay?: number; + /** + * Optional sleep function for retry backoff. + * + * Defaults to using `setTimeout`. + */ + sseSleepFn?: (ms: number) => Promise; + url: string; + }; + +export interface StreamEvent { + data: TData; + event?: string; + id?: string; + retry?: number; +} + +export type ServerSentEventsResult< + TData = unknown, + TReturn = void, + TNext = unknown, +> = { + stream: AsyncGenerator< + TData extends Record ? TData[keyof TData] : TData, + TReturn, + TNext + >; +}; + +export function createSseClient({ + onRequest, + onSseError, + onSseEvent, + responseTransformer, + responseValidator, + sseDefaultRetryDelay, + sseMaxRetryAttempts, + sseMaxRetryDelay, + sseSleepFn, + url, + ...options +}: ServerSentEventsOptions): ServerSentEventsResult { + let lastEventId: string | undefined; + + const sleep = + sseSleepFn ?? + ((ms: number) => new Promise((resolve) => setTimeout(resolve, ms))); + + const createStream = async function* () { + let retryDelay: number = sseDefaultRetryDelay ?? 3000; + let attempt = 0; + const signal = options.signal ?? new AbortController().signal; + + while (true) { + if (signal.aborted) break; + + attempt++; + + const headers = + options.headers instanceof Headers + ? options.headers + : new Headers(options.headers as Record | undefined); + + if (lastEventId !== undefined) { + headers.set('Last-Event-ID', lastEventId); + } + + try { + const requestInit: RequestInit = { + redirect: 'follow', + ...options, + body: options.serializedBody, + headers, + signal, + }; + let request = new Request(url, requestInit); + if (onRequest) { + request = await onRequest(url, requestInit); + } + // fetch must be assigned here, otherwise it would throw the error: + // TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation + const _fetch = options.fetch ?? globalThis.fetch; + const response = await _fetch(request); + + if (!response.ok) + throw new Error( + `SSE failed: ${response.status} ${response.statusText}` + ); + + if (!response.body) throw new Error('No body in SSE response'); + + const reader = response.body + .pipeThrough(new TextDecoderStream()) + .getReader(); + + let buffer = ''; + + const abortHandler = () => { + try { + reader.cancel(); + } catch { + // noop + } + }; + + signal.addEventListener('abort', abortHandler); + + try { + while (true) { + const { done, value } = await reader.read(); + if (done) break; + buffer += value; + buffer = buffer.replace(/\r\n?/g, '\n'); // normalize line endings + + const chunks = buffer.split('\n\n'); + buffer = chunks.pop() ?? ''; + + for (const chunk of chunks) { + const lines = chunk.split('\n'); + const dataLines: Array = []; + let eventName: string | undefined; + + for (const line of lines) { + if (line.startsWith('data:')) { + dataLines.push(line.replace(/^data:\s*/, '')); + } else if (line.startsWith('event:')) { + eventName = line.replace(/^event:\s*/, ''); + } else if (line.startsWith('id:')) { + lastEventId = line.replace(/^id:\s*/, ''); + } else if (line.startsWith('retry:')) { + const parsed = Number.parseInt( + line.replace(/^retry:\s*/, ''), + 10 + ); + if (!Number.isNaN(parsed)) { + retryDelay = parsed; + } + } + } + + let data: unknown; + let parsedJson = false; + + if (dataLines.length) { + const rawData = dataLines.join('\n'); + try { + data = JSON.parse(rawData); + parsedJson = true; + } catch { + data = rawData; + } + } + + if (parsedJson) { + if (responseValidator) { + await responseValidator(data); + } + + if (responseTransformer) { + data = await responseTransformer(data); + } + } + + onSseEvent?.({ + data, + event: eventName, + id: lastEventId, + retry: retryDelay, + }); + + if (dataLines.length) { + yield data as any; + } + } + } + } finally { + signal.removeEventListener('abort', abortHandler); + reader.releaseLock(); + } + + break; // exit loop on normal completion + } catch (error) { + // connection failed or aborted; retry after delay + onSseError?.(error); + + if ( + sseMaxRetryAttempts !== undefined && + attempt >= sseMaxRetryAttempts + ) { + break; // stop after firing error + } + + // exponential backoff: double retry each attempt, cap at 30s + const backoff = Math.min( + retryDelay * 2 ** (attempt - 1), + sseMaxRetryDelay ?? 30000 + ); + await sleep(backoff); + } + } + }; + + const stream = createStream(); + + return { stream }; +} diff --git a/app/react/portainer/generated-api/portainer/core/types.gen.ts b/app/react/portainer/generated-api/portainer/core/types.gen.ts new file mode 100644 index 0000000000..1b766e9de7 --- /dev/null +++ b/app/react/portainer/generated-api/portainer/core/types.gen.ts @@ -0,0 +1,118 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { Auth, AuthToken } from './auth.gen'; +import type { + BodySerializer, + QuerySerializer, + QuerySerializerOptions, +} from './bodySerializer.gen'; + +export type HttpMethod = + | 'connect' + | 'delete' + | 'get' + | 'head' + | 'options' + | 'patch' + | 'post' + | 'put' + | 'trace'; + +export type Client< + RequestFn = never, + Config = unknown, + MethodFn = never, + BuildUrlFn = never, + SseFn = never, +> = { + /** + * Returns the final request URL. + */ + buildUrl: BuildUrlFn; + getConfig: () => Config; + request: RequestFn; + setConfig: (config: Config) => Config; +} & { + [K in HttpMethod]: MethodFn; +} & ([SseFn] extends [never] + ? { sse?: never } + : { sse: { [K in HttpMethod]: SseFn } }); + +export interface Config { + /** + * Auth token or a function returning auth token. The resolved value will be + * added to the request payload as defined by its `security` array. + */ + auth?: ((auth: Auth) => Promise | AuthToken) | AuthToken; + /** + * A function for serializing request body parameter. By default, + * {@link JSON.stringify()} will be used. + */ + bodySerializer?: BodySerializer | null; + /** + * An object containing any HTTP headers that you want to pre-populate your + * `Headers` object with. + * + * {@link https://developer.mozilla.org/docs/Web/API/Headers/Headers#init See more} + */ + headers?: + | RequestInit['headers'] + | Record< + string, + | string + | number + | boolean + | (string | number | boolean)[] + | null + | undefined + | unknown + >; + /** + * The request method. + * + * {@link https://developer.mozilla.org/docs/Web/API/fetch#method See more} + */ + method?: Uppercase; + /** + * A function for serializing request query parameters. By default, arrays + * will be exploded in form style, objects will be exploded in deepObject + * style, and reserved characters are percent-encoded. + * + * This method will have no effect if the native `paramsSerializer()` Axios + * API function is used. + * + * {@link https://swagger.io/docs/specification/serialization/#query View examples} + */ + querySerializer?: QuerySerializer | QuerySerializerOptions; + /** + * A function validating request data. This is useful if you want to ensure + * the request conforms to the desired shape, so it can be safely sent to + * the server. + */ + requestValidator?: (data: unknown) => Promise; + /** + * A function transforming response data before it's returned. This is useful + * for post-processing data, e.g., converting ISO strings into Date objects. + */ + responseTransformer?: (data: unknown) => Promise; + /** + * A function validating response data. This is useful if you want to ensure + * the response conforms to the desired shape, so it can be safely passed to + * the transformers and returned to the user. + */ + responseValidator?: (data: unknown) => Promise; +} + +type IsExactlyNeverOrNeverUndefined = [T] extends [never] + ? true + : [T] extends [never | undefined] + ? [undefined] extends [T] + ? false + : true + : false; + +export type OmitNever> = { + [K in keyof T as IsExactlyNeverOrNeverUndefined extends true + ? never + : K]: T[K]; +}; diff --git a/app/react/portainer/generated-api/portainer/core/utils.gen.ts b/app/react/portainer/generated-api/portainer/core/utils.gen.ts new file mode 100644 index 0000000000..818980851f --- /dev/null +++ b/app/react/portainer/generated-api/portainer/core/utils.gen.ts @@ -0,0 +1,143 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import type { BodySerializer, QuerySerializer } from './bodySerializer.gen'; +import { + type ArraySeparatorStyle, + serializeArrayParam, + serializeObjectParam, + serializePrimitiveParam, +} from './pathSerializer.gen'; + +export interface PathSerializer { + path: Record; + url: string; +} + +export const PATH_PARAM_RE = /\{[^{}]+\}/g; + +export const defaultPathSerializer = ({ path, url: _url }: PathSerializer) => { + let url = _url; + const matches = _url.match(PATH_PARAM_RE); + if (matches) { + for (const match of matches) { + let explode = false; + let name = match.substring(1, match.length - 1); + let style: ArraySeparatorStyle = 'simple'; + + if (name.endsWith('*')) { + explode = true; + name = name.substring(0, name.length - 1); + } + + if (name.startsWith('.')) { + name = name.substring(1); + style = 'label'; + } else if (name.startsWith(';')) { + name = name.substring(1); + style = 'matrix'; + } + + const value = path[name]; + + if (value === undefined || value === null) { + continue; + } + + if (Array.isArray(value)) { + url = url.replace( + match, + serializeArrayParam({ explode, name, style, value }) + ); + continue; + } + + if (typeof value === 'object') { + url = url.replace( + match, + serializeObjectParam({ + explode, + name, + style, + value: value as Record, + valueOnly: true, + }) + ); + continue; + } + + if (style === 'matrix') { + url = url.replace( + match, + `;${serializePrimitiveParam({ + name, + value: value as string, + })}` + ); + continue; + } + + const replaceValue = encodeURIComponent( + style === 'label' ? `.${value as string}` : (value as string) + ); + url = url.replace(match, replaceValue); + } + } + return url; +}; + +export const getUrl = ({ + baseUrl, + path, + query, + querySerializer, + url: _url, +}: { + baseUrl?: string; + path?: Record; + query?: Record; + querySerializer: QuerySerializer; + url: string; +}) => { + const pathUrl = _url.startsWith('/') ? _url : `/${_url}`; + let url = (baseUrl ?? '') + pathUrl; + if (path) { + url = defaultPathSerializer({ path, url }); + } + let search = query ? querySerializer(query) : ''; + if (search.startsWith('?')) { + search = search.substring(1); + } + if (search) { + url += `?${search}`; + } + return url; +}; + +export function getValidRequestBody(options: { + body?: unknown; + bodySerializer?: BodySerializer | null; + serializedBody?: unknown; +}) { + const hasBody = options.body !== undefined; + const isSerializedBody = hasBody && options.bodySerializer; + + if (isSerializedBody) { + if ('serializedBody' in options) { + const hasSerializedBody = + options.serializedBody !== undefined && options.serializedBody !== ''; + + return hasSerializedBody ? options.serializedBody : null; + } + + // not all clients implement a serializedBody property (i.e., client-axios) + return options.body !== '' ? options.body : null; + } + + // plain/text body + if (hasBody) { + return options.body; + } + + // no body was provided + return undefined; +} diff --git a/app/react/portainer/generated-api/portainer/sdk.gen.ts b/app/react/portainer/generated-api/portainer/sdk.gen.ts new file mode 100644 index 0000000000..2085433477 --- /dev/null +++ b/app/react/portainer/generated-api/portainer/sdk.gen.ts @@ -0,0 +1,10077 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import * as z from 'zod'; + +import { + type Client, + formDataBodySerializer, + type Options as Options2, + type TDataShape, +} from './client'; +import { client } from './client.gen'; +import type { + AuthenticateUserData, + AuthenticateUserErrors, + AuthenticateUserResponses, + BackupData, + BackupErrors, + BackupResponses, + CreateKubernetesIngressData, + CreateKubernetesIngressErrors, + CreateKubernetesIngressResponses, + CreateKubernetesNamespaceData, + CreateKubernetesNamespaceErrors, + CreateKubernetesNamespaceResponses, + CreateKubernetesServiceData, + CreateKubernetesServiceErrors, + CreateKubernetesServiceResponses, + CurrentUserInspectData, + CurrentUserInspectErrors, + CurrentUserInspectResponses, + CustomTemplateCreateFileData, + CustomTemplateCreateFileErrors, + CustomTemplateCreateFileResponses, + CustomTemplateCreateRepositoryData, + CustomTemplateCreateRepositoryErrors, + CustomTemplateCreateRepositoryResponses, + CustomTemplateCreateStringData, + CustomTemplateCreateStringErrors, + CustomTemplateCreateStringResponses, + CustomTemplateDeleteData, + CustomTemplateDeleteErrors, + CustomTemplateDeleteResponses, + CustomTemplateFileData, + CustomTemplateFileErrors, + CustomTemplateFileResponses, + CustomTemplateGitFetchData, + CustomTemplateGitFetchErrors, + CustomTemplateGitFetchResponses, + CustomTemplateInspectData, + CustomTemplateInspectErrors, + CustomTemplateInspectResponses, + CustomTemplateListData, + CustomTemplateListErrors, + CustomTemplateListResponses, + CustomTemplateUpdateData, + CustomTemplateUpdateErrors, + CustomTemplateUpdateResponses, + DeleteClusterRoleBindingsData, + DeleteClusterRoleBindingsErrors, + DeleteClusterRoleBindingsResponses, + DeleteClusterRolesData, + DeleteClusterRolesErrors, + DeleteClusterRolesResponses, + DeleteCronJobsData, + DeleteCronJobsErrors, + DeleteCronJobsResponses, + DeleteJobsData, + DeleteJobsErrors, + DeleteJobsResponses, + DeleteKubernetesIngressesData, + DeleteKubernetesIngressesErrors, + DeleteKubernetesIngressesResponses, + DeleteKubernetesNamespaceData, + DeleteKubernetesNamespaceErrors, + DeleteKubernetesNamespaceResponses, + DeleteKubernetesPersistentVolumeClaimsData, + DeleteKubernetesPersistentVolumeClaimsErrors, + DeleteKubernetesPersistentVolumeClaimsResponses, + DeleteKubernetesPersistentVolumesData, + DeleteKubernetesPersistentVolumesErrors, + DeleteKubernetesPersistentVolumesResponses, + DeleteKubernetesPodData, + DeleteKubernetesPodErrors, + DeleteKubernetesPodResponses, + DeleteKubernetesServicesData, + DeleteKubernetesServicesErrors, + DeleteKubernetesServicesResponses, + DeleteKubernetesStorageClassesData, + DeleteKubernetesStorageClassesErrors, + DeleteKubernetesStorageClassesResponses, + DeleteRoleBindingsData, + DeleteRoleBindingsErrors, + DeleteRoleBindingsResponses, + DeleteRolesData, + DeleteRolesErrors, + DeleteRolesResponses, + DeleteServiceAccountsData, + DeleteServiceAccountsErrors, + DeleteServiceAccountsResponses, + DeleteWebhooksByIdData, + DeleteWebhooksByIdErrors, + DeleteWebhooksByIdResponses, + DescribeResourceData, + DescribeResourceErrors, + DescribeResourceResponses, + DockerContainerGpusInspectData, + DockerContainerGpusInspectErrors, + DockerContainerGpusInspectResponses, + DockerDashboardData, + DockerDashboardErrors, + DockerDashboardResponses, + DockerImagesListData, + DockerImagesListErrors, + DockerImagesListResponses, + DrainNodeData, + DrainNodeErrors, + DrainNodeResponses, + EdgeGroupCreateData, + EdgeGroupCreateErrors, + EdgeGroupCreateResponses, + EdgeGroupDeleteData, + EdgeGroupDeleteErrors, + EdgeGroupDeleteResponses, + EdgeGroupInspectData, + EdgeGroupInspectErrors, + EdgeGroupInspectResponses, + EdgeGroupListData, + EdgeGroupListErrors, + EdgeGroupListResponses, + EdgeGroupUpdateData, + EdgeGroupUpdateErrors, + EdgeGroupUpdateResponses, + EdgeJobCreateFileData, + EdgeJobCreateFileErrors, + EdgeJobCreateFileResponses, + EdgeJobCreateStringData, + EdgeJobCreateStringErrors, + EdgeJobCreateStringResponses, + EdgeJobDeleteData, + EdgeJobDeleteErrors, + EdgeJobDeleteResponses, + EdgeJobFileData, + EdgeJobFileErrors, + EdgeJobFileResponses, + EdgeJobInspectData, + EdgeJobInspectErrors, + EdgeJobInspectResponses, + EdgeJobListData, + EdgeJobListErrors, + EdgeJobListResponses, + EdgeJobTaskLogsInspectData, + EdgeJobTaskLogsInspectErrors, + EdgeJobTaskLogsInspectResponses, + EdgeJobTasksClearData, + EdgeJobTasksClearErrors, + EdgeJobTasksClearResponses, + EdgeJobTasksCollectData, + EdgeJobTasksCollectErrors, + EdgeJobTasksCollectResponses, + EdgeJobTasksListData, + EdgeJobTasksListErrors, + EdgeJobTasksListResponses, + EdgeJobUpdateData, + EdgeJobUpdateErrors, + EdgeJobUpdateResponses, + EdgeStackCreateFileData, + EdgeStackCreateFileErrors, + EdgeStackCreateFileResponses, + EdgeStackCreateRepositoryData, + EdgeStackCreateRepositoryErrors, + EdgeStackCreateRepositoryResponses, + EdgeStackCreateStringData, + EdgeStackCreateStringErrors, + EdgeStackCreateStringResponses, + EdgeStackDeleteData, + EdgeStackDeleteErrors, + EdgeStackDeleteResponses, + EdgeStackFileData, + EdgeStackFileErrors, + EdgeStackFileResponses, + EdgeStackInspectData, + EdgeStackInspectErrors, + EdgeStackInspectResponses, + EdgeStackListData, + EdgeStackListErrors, + EdgeStackListResponses, + EdgeStackStatusUpdateData, + EdgeStackStatusUpdateErrors, + EdgeStackStatusUpdateResponses, + EdgeStackUpdateData, + EdgeStackUpdateErrors, + EdgeStackUpdateResponses, + EndpointAssociationDeleteData, + EndpointAssociationDeleteErrors, + EndpointAssociationDeleteResponses, + EndpointCreateData, + EndpointCreateErrors, + EndpointCreateGlobalKeyData, + EndpointCreateGlobalKeyErrors, + EndpointCreateGlobalKeyResponses, + EndpointCreateResponses, + EndpointDeleteBatchData, + EndpointDeleteBatchErrors, + EndpointDeleteBatchResponses, + EndpointDeleteData, + EndpointDeleteErrors, + EndpointDeleteResponses, + EndpointDockerhubStatusData, + EndpointDockerhubStatusErrors, + EndpointDockerhubStatusResponses, + EndpointForceUpdateServiceData, + EndpointForceUpdateServiceErrors, + EndpointForceUpdateServiceResponses, + EndpointGroupAddEndpointData, + EndpointGroupAddEndpointErrors, + EndpointGroupAddEndpointResponses, + EndpointGroupDeleteData, + EndpointGroupDeleteEndpointData, + EndpointGroupDeleteEndpointErrors, + EndpointGroupDeleteEndpointResponses, + EndpointGroupDeleteErrors, + EndpointGroupDeleteResponses, + EndpointGroupListData, + EndpointGroupListErrors, + EndpointGroupListResponses, + EndpointGroupUpdateData, + EndpointGroupUpdateErrors, + EndpointGroupUpdateResponses, + EndpointInspectData, + EndpointInspectErrors, + EndpointInspectResponses, + EndpointListData, + EndpointListErrors, + EndpointListResponses, + EndpointRegistriesListData, + EndpointRegistriesListErrors, + EndpointRegistriesListResponses, + EndpointRegistryAccessData, + EndpointRegistryAccessErrors, + EndpointRegistryAccessResponses, + EndpointSettingsUpdateData, + EndpointSettingsUpdateErrors, + EndpointSettingsUpdateResponses, + EndpointSnapshotData, + EndpointSnapshotErrors, + EndpointSnapshotResponses, + EndpointSnapshotsData, + EndpointSnapshotsErrors, + EndpointSnapshotsResponses, + EndpointSummaryCountsData, + EndpointSummaryCountsErrors, + EndpointSummaryCountsResponses, + EndpointUpdateData, + EndpointUpdateErrors, + EndpointUpdateRelationsData, + EndpointUpdateRelationsErrors, + EndpointUpdateRelationsResponses, + EndpointUpdateResponses, + GetAllKubernetesApplicationsCountData, + GetAllKubernetesApplicationsCountErrors, + GetAllKubernetesApplicationsCountResponses, + GetAllKubernetesApplicationsData, + GetAllKubernetesApplicationsErrors, + GetAllKubernetesApplicationsResponses, + GetAllKubernetesClusterIngressesCountData, + GetAllKubernetesClusterIngressesCountErrors, + GetAllKubernetesClusterIngressesCountResponses, + GetAllKubernetesClusterIngressesData, + GetAllKubernetesClusterIngressesErrors, + GetAllKubernetesClusterIngressesResponses, + GetAllKubernetesClusterRoleBindingsData, + GetAllKubernetesClusterRoleBindingsErrors, + GetAllKubernetesClusterRoleBindingsResponses, + GetAllKubernetesClusterRolesData, + GetAllKubernetesClusterRolesErrors, + GetAllKubernetesClusterRolesResponses, + GetAllKubernetesConfigMapsCountData, + GetAllKubernetesConfigMapsCountErrors, + GetAllKubernetesConfigMapsCountResponses, + GetAllKubernetesConfigMapsData, + GetAllKubernetesConfigMapsErrors, + GetAllKubernetesConfigMapsResponses, + GetAllKubernetesEventsData, + GetAllKubernetesEventsErrors, + GetAllKubernetesEventsResponses, + GetAllKubernetesIngressControllersData, + GetAllKubernetesIngressControllersErrors, + GetAllKubernetesIngressControllersResponses, + GetAllKubernetesIngressesData, + GetAllKubernetesIngressesErrors, + GetAllKubernetesIngressesResponses, + GetAllKubernetesPersistentVolumeClaimsData, + GetAllKubernetesPersistentVolumeClaimsErrors, + GetAllKubernetesPersistentVolumeClaimsResponses, + GetAllKubernetesPersistentVolumesData, + GetAllKubernetesPersistentVolumesErrors, + GetAllKubernetesPersistentVolumesResponses, + GetAllKubernetesServicesCountData, + GetAllKubernetesServicesCountErrors, + GetAllKubernetesServicesCountResponses, + GetAllKubernetesStorageClassesData, + GetAllKubernetesStorageClassesErrors, + GetAllKubernetesStorageClassesResponses, + GetAllKubernetesVolumesCountData, + GetAllKubernetesVolumesCountErrors, + GetAllKubernetesVolumesCountResponses, + GetAllKubernetesVolumesData, + GetAllKubernetesVolumesErrors, + GetAllKubernetesVolumesResponses, + GetApplicationsResourcesData, + GetApplicationsResourcesErrors, + GetApplicationsResourcesResponses, + GetEndpointGroupsByIdData, + GetEndpointGroupsByIdErrors, + GetEndpointGroupsByIdResponses, + GetKubernetesConfigData, + GetKubernetesConfigErrors, + GetKubernetesConfigMapData, + GetKubernetesConfigMapErrors, + GetKubernetesConfigMapResponses, + GetKubernetesConfigResponses, + GetKubernetesCronJobsData, + GetKubernetesCronJobsErrors, + GetKubernetesCronJobsResponses, + GetKubernetesDashboardData, + GetKubernetesDashboardErrors, + GetKubernetesDashboardResponses, + GetKubernetesEventsForNamespaceData, + GetKubernetesEventsForNamespaceErrors, + GetKubernetesEventsForNamespaceResponses, + GetKubernetesIngressControllersByNamespaceData, + GetKubernetesIngressControllersByNamespaceErrors, + GetKubernetesIngressControllersByNamespaceResponses, + GetKubernetesIngressData, + GetKubernetesIngressErrors, + GetKubernetesIngressResponses, + GetKubernetesJobsData, + GetKubernetesJobsErrors, + GetKubernetesJobsResponses, + GetKubernetesMaxResourceLimitsData, + GetKubernetesMaxResourceLimitsErrors, + GetKubernetesMaxResourceLimitsResponses, + GetKubernetesMetricsForAllNodesData, + GetKubernetesMetricsForAllNodesErrors, + GetKubernetesMetricsForAllNodesResponses, + GetKubernetesMetricsForAllPodsData, + GetKubernetesMetricsForAllPodsErrors, + GetKubernetesMetricsForAllPodsResponses, + GetKubernetesMetricsForNodeData, + GetKubernetesMetricsForNodeErrors, + GetKubernetesMetricsForNodeResponses, + GetKubernetesMetricsForPodData, + GetKubernetesMetricsForPodErrors, + GetKubernetesMetricsForPodResponses, + GetKubernetesNamespaceData, + GetKubernetesNamespaceErrors, + GetKubernetesNamespaceResponses, + GetKubernetesNamespacesCountData, + GetKubernetesNamespacesCountErrors, + GetKubernetesNamespacesCountResponses, + GetKubernetesNamespacesData, + GetKubernetesNamespacesErrors, + GetKubernetesNamespacesResponses, + GetKubernetesNodesLimitsData, + GetKubernetesNodesLimitsErrors, + GetKubernetesNodesLimitsResponses, + GetKubernetesPersistentVolumeClaimData, + GetKubernetesPersistentVolumeClaimErrors, + GetKubernetesPersistentVolumeClaimResponses, + GetKubernetesPersistentVolumeClaimsInNamespaceData, + GetKubernetesPersistentVolumeClaimsInNamespaceErrors, + GetKubernetesPersistentVolumeClaimsInNamespaceResponses, + GetKubernetesPersistentVolumeData, + GetKubernetesPersistentVolumeErrors, + GetKubernetesPersistentVolumeResponses, + GetKubernetesRbacStatusData, + GetKubernetesRbacStatusErrors, + GetKubernetesRbacStatusResponses, + GetKubernetesRoleBindingsData, + GetKubernetesRoleBindingsErrors, + GetKubernetesRoleBindingsResponses, + GetKubernetesRolesData, + GetKubernetesRolesErrors, + GetKubernetesRolesResponses, + GetKubernetesSecretData, + GetKubernetesSecretErrors, + GetKubernetesSecretResponses, + GetKubernetesSecretsCountData, + GetKubernetesSecretsCountErrors, + GetKubernetesSecretsCountResponses, + GetKubernetesSecretsData, + GetKubernetesSecretsErrors, + GetKubernetesSecretsResponses, + GetKubernetesServiceAccountData, + GetKubernetesServiceAccountErrors, + GetKubernetesServiceAccountResponses, + GetKubernetesServiceAccountsData, + GetKubernetesServiceAccountsErrors, + GetKubernetesServiceAccountsResponses, + GetKubernetesServicesByNamespaceData, + GetKubernetesServicesByNamespaceErrors, + GetKubernetesServicesByNamespaceResponses, + GetKubernetesServicesData, + GetKubernetesServicesErrors, + GetKubernetesServicesResponses, + GetKubernetesStorageClassData, + GetKubernetesStorageClassErrors, + GetKubernetesStorageClassResponses, + GetKubernetesVersionData, + GetKubernetesVersionErrors, + GetKubernetesVersionResponses, + GetKubernetesVolumeData, + GetKubernetesVolumeErrors, + GetKubernetesVolumeResponses, + GetKubernetesVolumesInNamespaceData, + GetKubernetesVolumesInNamespaceErrors, + GetKubernetesVolumesInNamespaceResponses, + GetWebhooksData, + GetWebhooksErrors, + GetWebhooksResponses, + GetWebsocketAttachData, + GetWebsocketAttachErrors, + GetWebsocketAttachResponses, + GetWebsocketExecData, + GetWebsocketExecErrors, + GetWebsocketExecResponses, + GetWebsocketKubernetesShellData, + GetWebsocketKubernetesShellErrors, + GetWebsocketKubernetesShellResponses, + GetWebsocketPodData, + GetWebsocketPodErrors, + GetWebsocketPodResponses, + GitOperationRepoFilePreviewData, + GitOperationRepoFilePreviewErrors, + GitOperationRepoFilePreviewResponses, + GitOpsSourceGetData, + GitOpsSourceGetErrors, + GitOpsSourceGetResponses, + GitOpsSourcesCreateGitData, + GitOpsSourcesCreateGitErrors, + GitOpsSourcesCreateGitResponses, + GitOpsSourcesDeleteData, + GitOpsSourcesDeleteErrors, + GitOpsSourcesDeleteResponses, + GitOpsSourcesListData, + GitOpsSourcesListErrors, + GitOpsSourcesListResponses, + GitOpsSourcesSummaryData, + GitOpsSourcesSummaryErrors, + GitOpsSourcesSummaryResponses, + GitOpsSourcesUpdateGitData, + GitOpsSourcesUpdateGitErrors, + GitOpsSourcesUpdateGitResponses, + GitOpsWorkflowsListData, + GitOpsWorkflowsListErrors, + GitOpsWorkflowsListResponses, + GitOpsWorkflowsSummaryData, + GitOpsWorkflowsSummaryErrors, + GitOpsWorkflowsSummaryResponses, + HelmDeleteData, + HelmDeleteErrors, + HelmDeleteResponses, + HelmGetData, + HelmGetErrors, + HelmGetHistoryData, + HelmGetHistoryErrors, + HelmGetHistoryResponses, + HelmGetResponses, + HelmInstallData, + HelmInstallErrors, + HelmInstallResponses, + HelmListData, + HelmListErrors, + HelmListResponses, + HelmRepoSearchData, + HelmRepoSearchErrors, + HelmRepoSearchResponses, + HelmRollbackData, + HelmRollbackErrors, + HelmRollbackResponses, + HelmShowData, + HelmShowErrors, + HelmShowResponses, + HelmUserRepositoriesListData, + HelmUserRepositoriesListErrors, + HelmUserRepositoriesListResponses, + HelmUserRepositoryCreateData, + HelmUserRepositoryCreateErrors, + HelmUserRepositoryCreateResponses, + HelmUserRepositoryDeleteData, + HelmUserRepositoryDeleteErrors, + HelmUserRepositoryDeleteResponses, + KubernetesNamespacesToggleSystemData, + KubernetesNamespacesToggleSystemErrors, + KubernetesNamespacesToggleSystemResponses, + LdapCheckData, + LdapCheckErrors, + LdapCheckResponses, + LogoutData, + LogoutErrors, + LogoutResponses, + MotdData, + MotdResponses, + PostEndpointGroupsData, + PostEndpointGroupsErrors, + PostEndpointGroupsResponses, + PostEndpointsByIdDockerV2BrowsePutData, + PostEndpointsByIdDockerV2BrowsePutErrors, + PostEndpointsByIdDockerV2BrowsePutResponses, + PostWebhooksByIdData, + PostWebhooksByIdErrors, + PostWebhooksByIdResponses, + PostWebhooksData, + PostWebhooksErrors, + PostWebhooksResponses, + PutWebhooksByIdData, + PutWebhooksByIdErrors, + PutWebhooksByIdResponses, + RegistryConfigureData, + RegistryConfigureErrors, + RegistryConfigureResponses, + RegistryCreateData, + RegistryCreateErrors, + RegistryCreateResponses, + RegistryDeleteData, + RegistryDeleteErrors, + RegistryDeleteResponses, + RegistryInspectData, + RegistryInspectErrors, + RegistryInspectResponses, + RegistryListData, + RegistryListErrors, + RegistryListResponses, + RegistryPingData, + RegistryPingErrors, + RegistryPingResponses, + RegistryUpdateData, + RegistryUpdateErrors, + RegistryUpdateResponses, + ResizeKubernetesPersistentVolumeClaimData, + ResizeKubernetesPersistentVolumeClaimErrors, + ResizeKubernetesPersistentVolumeClaimResponses, + ResourceControlCreateData, + ResourceControlCreateErrors, + ResourceControlCreateResponses, + ResourceControlDeleteData, + ResourceControlDeleteErrors, + ResourceControlDeleteResponses, + ResourceControlUpdateData, + ResourceControlUpdateErrors, + ResourceControlUpdateResponses, + RestartKubernetesPodData, + RestartKubernetesPodErrors, + RestartKubernetesPodResponses, + RestoreData, + RestoreErrors, + RestoreResponses, + RoleListData, + RoleListErrors, + RoleListResponses, + SetDefaultKubernetesStorageClassData, + SetDefaultKubernetesStorageClassErrors, + SetDefaultKubernetesStorageClassResponses, + SettingsInspectData, + SettingsInspectErrors, + SettingsInspectResponses, + SettingsPublicData, + SettingsPublicErrors, + SettingsPublicResponses, + SettingsUpdateData, + SettingsUpdateErrors, + SettingsUpdateResponses, + SslInspectData, + SslInspectErrors, + SslInspectResponses, + SslUpdateData, + SslUpdateErrors, + SslUpdateResponses, + StackAssociateData, + StackAssociateErrors, + StackAssociateResponses, + StackCreateDockerStandaloneFileData, + StackCreateDockerStandaloneFileErrors, + StackCreateDockerStandaloneFileResponses, + StackCreateDockerStandaloneRepositoryData, + StackCreateDockerStandaloneRepositoryErrors, + StackCreateDockerStandaloneRepositoryResponses, + StackCreateDockerStandaloneStringData, + StackCreateDockerStandaloneStringErrors, + StackCreateDockerStandaloneStringResponses, + StackCreateDockerSwarmFileData, + StackCreateDockerSwarmFileErrors, + StackCreateDockerSwarmFileResponses, + StackCreateDockerSwarmRepositoryData, + StackCreateDockerSwarmRepositoryErrors, + StackCreateDockerSwarmRepositoryResponses, + StackCreateDockerSwarmStringData, + StackCreateDockerSwarmStringErrors, + StackCreateDockerSwarmStringResponses, + StackCreateKubernetesFileData, + StackCreateKubernetesFileErrors, + StackCreateKubernetesFileResponses, + StackCreateKubernetesGitData, + StackCreateKubernetesGitErrors, + StackCreateKubernetesGitResponses, + StackCreateKubernetesUrlData, + StackCreateKubernetesUrlErrors, + StackCreateKubernetesUrlResponses, + StackDeleteData, + StackDeleteErrors, + StackDeleteKubernetesByNameData, + StackDeleteKubernetesByNameErrors, + StackDeleteKubernetesByNameResponses, + StackDeleteResponses, + StackFileInspectData, + StackFileInspectErrors, + StackFileInspectResponses, + StackGitRedeployData, + StackGitRedeployErrors, + StackGitRedeployResponses, + StackInspectData, + StackInspectErrors, + StackInspectResponses, + StackListData, + StackListErrors, + StackListResponses, + StackMigrateData, + StackMigrateErrors, + StackMigrateResponses, + StackStartData, + StackStartErrors, + StackStartResponses, + StackStopData, + StackStopErrors, + StackStopResponses, + StackUpdateData, + StackUpdateErrors, + StackUpdateGitData, + StackUpdateGitErrors, + StackUpdateGitResponses, + StackUpdateResponses, + SystemInfoData, + SystemInfoErrors, + SystemInfoResponses, + SystemNodesCountData, + SystemNodesCountErrors, + SystemNodesCountResponses, + SystemStatusData, + SystemStatusResponses, + SystemUpgradeData, + SystemUpgradeResponses, + SystemVersionData, + SystemVersionResponses, + TagCreateData, + TagCreateErrors, + TagCreateResponses, + TagDeleteData, + TagDeleteErrors, + TagDeleteResponses, + TagListData, + TagListErrors, + TagListResponses, + TeamCreateData, + TeamCreateErrors, + TeamCreateResponses, + TeamDeleteData, + TeamDeleteErrors, + TeamDeleteResponses, + TeamInspectData, + TeamInspectErrors, + TeamInspectResponses, + TeamListData, + TeamListErrors, + TeamListResponses, + TeamMembershipCreateData, + TeamMembershipCreateErrors, + TeamMembershipCreateResponses, + TeamMembershipDeleteData, + TeamMembershipDeleteErrors, + TeamMembershipDeleteResponses, + TeamMembershipListData, + TeamMembershipListErrors, + TeamMembershipListResponses, + TeamMembershipsData, + TeamMembershipsErrors, + TeamMembershipsResponses, + TeamMembershipUpdateData, + TeamMembershipUpdateErrors, + TeamMembershipUpdateResponses, + TeamUpdateData, + TeamUpdateErrors, + TeamUpdateResponses, + TemplateFileData, + TemplateFileErrors, + TemplateFileResponses, + TemplateListData, + TemplateListErrors, + TemplateListResponses, + UpdateKubernetesIngressControllersByNamespaceData, + UpdateKubernetesIngressControllersByNamespaceErrors, + UpdateKubernetesIngressControllersByNamespaceResponses, + UpdateKubernetesIngressControllersData, + UpdateKubernetesIngressControllersErrors, + UpdateKubernetesIngressControllersResponses, + UpdateKubernetesIngressData, + UpdateKubernetesIngressErrors, + UpdateKubernetesIngressResponses, + UpdateKubernetesNamespaceData, + UpdateKubernetesNamespaceDeprecatedData, + UpdateKubernetesNamespaceDeprecatedErrors, + UpdateKubernetesNamespaceDeprecatedResponses, + UpdateKubernetesNamespaceErrors, + UpdateKubernetesNamespaceResponses, + UpdateKubernetesPersistentVolumeReclaimPolicyData, + UpdateKubernetesPersistentVolumeReclaimPolicyErrors, + UpdateKubernetesPersistentVolumeReclaimPolicyResponses, + UpdateKubernetesServiceAccountImagePullSecretsData, + UpdateKubernetesServiceAccountImagePullSecretsErrors, + UpdateKubernetesServiceAccountImagePullSecretsResponses, + UpdateKubernetesServiceData, + UpdateKubernetesServiceErrors, + UpdateKubernetesServiceResponses, + UploadTlsData, + UploadTlsErrors, + UploadTlsResponses, + UserAdminCheckData, + UserAdminCheckErrors, + UserAdminCheckResponses, + UserAdminInitData, + UserAdminInitErrors, + UserAdminInitResponses, + UserCreateData, + UserCreateErrors, + UserCreateResponses, + UserDeleteData, + UserDeleteErrors, + UserDeleteResponses, + UserEffectiveAccessInspectData, + UserEffectiveAccessInspectErrors, + UserEffectiveAccessInspectResponses, + UserGenerateApiKeyData, + UserGenerateApiKeyErrors, + UserGenerateApiKeyResponses, + UserGetApiKeysData, + UserGetApiKeysErrors, + UserGetApiKeysResponses, + UserInspectData, + UserInspectErrors, + UserInspectResponses, + UserListData, + UserListErrors, + UserListResponses, + UserMembershipsInspectData, + UserMembershipsInspectErrors, + UserMembershipsInspectResponses, + UserRemoveApiKeyData, + UserRemoveApiKeyErrors, + UserRemoveApiKeyResponses, + UserUpdateData, + UserUpdateErrors, + UserUpdatePasswordData, + UserUpdatePasswordErrors, + UserUpdatePasswordResponses, + UserUpdateResponses, + ValidateOAuthData, + ValidateOAuthErrors, + ValidateOAuthResponses, + WebhookInvokeData, + WebhookInvokeErrors, + WebhookInvokeResponses, +} from './types.gen'; +import { + zAuthenticateUserBody, + zAuthenticateUserResponse, + zBackupBody, + zCreateKubernetesIngressBody, + zCreateKubernetesIngressPath, + zCreateKubernetesIngressResponse, + zCreateKubernetesNamespaceBody, + zCreateKubernetesNamespacePath, + zCreateKubernetesNamespaceResponse, + zCreateKubernetesServiceBody, + zCreateKubernetesServicePath, + zCreateKubernetesServiceResponse, + zCurrentUserInspectResponse, + zCustomTemplateCreateFileBody, + zCustomTemplateCreateFileResponse, + zCustomTemplateCreateRepositoryBody, + zCustomTemplateCreateRepositoryResponse, + zCustomTemplateCreateStringBody, + zCustomTemplateCreateStringResponse, + zCustomTemplateDeletePath, + zCustomTemplateDeleteResponse, + zCustomTemplateFilePath, + zCustomTemplateFileResponse, + zCustomTemplateGitFetchPath, + zCustomTemplateGitFetchResponse, + zCustomTemplateInspectPath, + zCustomTemplateInspectResponse, + zCustomTemplateListQuery, + zCustomTemplateListResponse, + zCustomTemplateUpdateBody, + zCustomTemplateUpdatePath, + zCustomTemplateUpdateResponse, + zDeleteClusterRoleBindingsBody, + zDeleteClusterRoleBindingsPath, + zDeleteClusterRoleBindingsResponse, + zDeleteClusterRolesBody, + zDeleteClusterRolesPath, + zDeleteClusterRolesResponse, + zDeleteCronJobsBody, + zDeleteCronJobsPath, + zDeleteCronJobsResponse, + zDeleteJobsBody, + zDeleteJobsPath, + zDeleteJobsResponse, + zDeleteKubernetesIngressesBody, + zDeleteKubernetesIngressesPath, + zDeleteKubernetesIngressesResponse, + zDeleteKubernetesNamespacePath, + zDeleteKubernetesNamespaceResponse, + zDeleteKubernetesPersistentVolumeClaimsBody, + zDeleteKubernetesPersistentVolumeClaimsPath, + zDeleteKubernetesPersistentVolumeClaimsResponse, + zDeleteKubernetesPersistentVolumesBody, + zDeleteKubernetesPersistentVolumesPath, + zDeleteKubernetesPersistentVolumesResponse, + zDeleteKubernetesPodPath, + zDeleteKubernetesPodResponse, + zDeleteKubernetesServicesBody, + zDeleteKubernetesServicesPath, + zDeleteKubernetesServicesResponse, + zDeleteKubernetesStorageClassesBody, + zDeleteKubernetesStorageClassesPath, + zDeleteKubernetesStorageClassesResponse, + zDeleteRoleBindingsBody, + zDeleteRoleBindingsPath, + zDeleteRoleBindingsResponse, + zDeleteRolesBody, + zDeleteRolesPath, + zDeleteRolesResponse, + zDeleteServiceAccountsBody, + zDeleteServiceAccountsPath, + zDeleteServiceAccountsResponse, + zDeleteWebhooksByIdPath, + zDescribeResourcePath, + zDescribeResourceQuery, + zDescribeResourceResponse, + zDockerContainerGpusInspectPath, + zDockerContainerGpusInspectResponse, + zDockerDashboardPath, + zDockerDashboardResponse2, + zDockerImagesListPath, + zDockerImagesListQuery, + zDockerImagesListResponse, + zDrainNodePath, + zDrainNodeResponse, + zEdgeGroupCreateBody, + zEdgeGroupCreateResponse, + zEdgeGroupDeletePath, + zEdgeGroupDeleteResponse, + zEdgeGroupInspectPath, + zEdgeGroupInspectResponse, + zEdgeGroupListResponse, + zEdgeGroupUpdateBody, + zEdgeGroupUpdatePath, + zEdgeGroupUpdateResponse, + zEdgeJobCreateFileBody, + zEdgeJobCreateFileResponse, + zEdgeJobCreateStringBody, + zEdgeJobCreateStringResponse, + zEdgeJobDeletePath, + zEdgeJobDeleteResponse, + zEdgeJobFilePath, + zEdgeJobFileResponse, + zEdgeJobInspectPath, + zEdgeJobInspectResponse, + zEdgeJobListResponse, + zEdgeJobTaskLogsInspectPath, + zEdgeJobTaskLogsInspectResponse, + zEdgeJobTasksClearPath, + zEdgeJobTasksClearResponse, + zEdgeJobTasksCollectPath, + zEdgeJobTasksCollectResponse, + zEdgeJobTasksListPath, + zEdgeJobTasksListResponse, + zEdgeJobUpdateBody, + zEdgeJobUpdatePath, + zEdgeJobUpdateResponse, + zEdgeStackCreateFileBody, + zEdgeStackCreateFileQuery, + zEdgeStackCreateFileResponse, + zEdgeStackCreateRepositoryBody, + zEdgeStackCreateRepositoryQuery, + zEdgeStackCreateRepositoryResponse, + zEdgeStackCreateStringBody, + zEdgeStackCreateStringQuery, + zEdgeStackCreateStringResponse, + zEdgeStackDeletePath, + zEdgeStackDeleteResponse, + zEdgeStackFilePath, + zEdgeStackFileResponse, + zEdgeStackInspectPath, + zEdgeStackInspectResponse, + zEdgeStackListQuery, + zEdgeStackListResponse, + zEdgeStackStatusUpdateBody, + zEdgeStackStatusUpdatePath, + zEdgeStackStatusUpdateResponse, + zEdgeStackUpdateBody, + zEdgeStackUpdatePath, + zEdgeStackUpdateResponse, + zEndpointAssociationDeletePath, + zEndpointAssociationDeleteResponse, + zEndpointCreateBody, + zEndpointCreateGlobalKeyResponse, + zEndpointCreateResponse, + zEndpointDeleteBatchBody, + zEndpointDeleteBatchResponse, + zEndpointDeletePath, + zEndpointDeleteResponse, + zEndpointDockerhubStatusPath, + zEndpointDockerhubStatusResponse, + zEndpointForceUpdateServiceBody, + zEndpointForceUpdateServicePath, + zEndpointForceUpdateServiceResponse, + zEndpointGroupAddEndpointPath, + zEndpointGroupAddEndpointResponse, + zEndpointGroupDeleteEndpointPath, + zEndpointGroupDeleteEndpointResponse, + zEndpointGroupDeletePath, + zEndpointGroupDeleteResponse, + zEndpointGroupListQuery, + zEndpointGroupListResponse, + zEndpointGroupUpdateBody, + zEndpointGroupUpdatePath, + zEndpointGroupUpdateResponse, + zEndpointInspectPath, + zEndpointInspectQuery, + zEndpointInspectResponse, + zEndpointListQuery, + zEndpointListResponse, + zEndpointRegistriesListPath, + zEndpointRegistriesListQuery, + zEndpointRegistriesListResponse, + zEndpointRegistryAccessBody, + zEndpointRegistryAccessPath, + zEndpointRegistryAccessResponse, + zEndpointSettingsUpdateBody, + zEndpointSettingsUpdatePath, + zEndpointSettingsUpdateResponse, + zEndpointSnapshotPath, + zEndpointSnapshotResponse, + zEndpointSnapshotsResponse, + zEndpointSummaryCountsResponse, + zEndpointUpdateBody, + zEndpointUpdatePath, + zEndpointUpdateRelationsBody, + zEndpointUpdateRelationsResponse, + zEndpointUpdateResponse, + zGetAllKubernetesApplicationsCountPath, + zGetAllKubernetesApplicationsCountResponse, + zGetAllKubernetesApplicationsPath, + zGetAllKubernetesApplicationsQuery, + zGetAllKubernetesApplicationsResponse, + zGetAllKubernetesClusterIngressesCountPath, + zGetAllKubernetesClusterIngressesCountResponse, + zGetAllKubernetesClusterIngressesPath, + zGetAllKubernetesClusterIngressesQuery, + zGetAllKubernetesClusterIngressesResponse, + zGetAllKubernetesClusterRoleBindingsPath, + zGetAllKubernetesClusterRoleBindingsResponse, + zGetAllKubernetesClusterRolesPath, + zGetAllKubernetesClusterRolesResponse, + zGetAllKubernetesConfigMapsCountPath, + zGetAllKubernetesConfigMapsCountResponse, + zGetAllKubernetesConfigMapsPath, + zGetAllKubernetesConfigMapsQuery, + zGetAllKubernetesConfigMapsResponse, + zGetAllKubernetesEventsPath, + zGetAllKubernetesEventsQuery, + zGetAllKubernetesEventsResponse, + zGetAllKubernetesIngressControllersPath, + zGetAllKubernetesIngressControllersQuery, + zGetAllKubernetesIngressControllersResponse, + zGetAllKubernetesIngressesPath, + zGetAllKubernetesIngressesResponse, + zGetAllKubernetesPersistentVolumeClaimsPath, + zGetAllKubernetesPersistentVolumeClaimsResponse, + zGetAllKubernetesPersistentVolumesPath, + zGetAllKubernetesPersistentVolumesResponse, + zGetAllKubernetesServicesCountPath, + zGetAllKubernetesServicesCountResponse, + zGetAllKubernetesStorageClassesPath, + zGetAllKubernetesStorageClassesResponse, + zGetAllKubernetesVolumesCountPath, + zGetAllKubernetesVolumesCountResponse, + zGetAllKubernetesVolumesPath, + zGetAllKubernetesVolumesQuery, + zGetAllKubernetesVolumesResponse, + zGetApplicationsResourcesPath, + zGetApplicationsResourcesQuery, + zGetApplicationsResourcesResponse, + zGetEndpointGroupsByIdPath, + zGetEndpointGroupsByIdResponse, + zGetKubernetesConfigMapPath, + zGetKubernetesConfigMapResponse, + zGetKubernetesConfigQuery, + zGetKubernetesCronJobsPath, + zGetKubernetesCronJobsResponse, + zGetKubernetesDashboardPath, + zGetKubernetesDashboardResponse, + zGetKubernetesEventsForNamespacePath, + zGetKubernetesEventsForNamespaceQuery, + zGetKubernetesEventsForNamespaceResponse, + zGetKubernetesIngressControllersByNamespacePath, + zGetKubernetesIngressControllersByNamespaceResponse, + zGetKubernetesIngressPath, + zGetKubernetesIngressResponse, + zGetKubernetesJobsPath, + zGetKubernetesJobsQuery, + zGetKubernetesJobsResponse, + zGetKubernetesMaxResourceLimitsPath, + zGetKubernetesMaxResourceLimitsResponse, + zGetKubernetesMetricsForAllNodesPath, + zGetKubernetesMetricsForAllNodesResponse, + zGetKubernetesMetricsForAllPodsPath, + zGetKubernetesMetricsForAllPodsResponse, + zGetKubernetesMetricsForNodePath, + zGetKubernetesMetricsForNodeResponse, + zGetKubernetesMetricsForPodPath, + zGetKubernetesMetricsForPodResponse, + zGetKubernetesNamespacePath, + zGetKubernetesNamespaceQuery, + zGetKubernetesNamespaceResponse, + zGetKubernetesNamespacesCountPath, + zGetKubernetesNamespacesCountResponse, + zGetKubernetesNamespacesPath, + zGetKubernetesNamespacesQuery, + zGetKubernetesNamespacesResponse, + zGetKubernetesNodesLimitsPath, + zGetKubernetesNodesLimitsResponse, + zGetKubernetesPersistentVolumeClaimPath, + zGetKubernetesPersistentVolumeClaimResponse, + zGetKubernetesPersistentVolumeClaimsInNamespacePath, + zGetKubernetesPersistentVolumeClaimsInNamespaceResponse, + zGetKubernetesPersistentVolumePath, + zGetKubernetesPersistentVolumeResponse, + zGetKubernetesRbacStatusPath, + zGetKubernetesRbacStatusResponse, + zGetKubernetesRoleBindingsPath, + zGetKubernetesRoleBindingsResponse, + zGetKubernetesRolesPath, + zGetKubernetesRolesResponse, + zGetKubernetesSecretPath, + zGetKubernetesSecretResponse, + zGetKubernetesSecretsCountPath, + zGetKubernetesSecretsCountResponse, + zGetKubernetesSecretsPath, + zGetKubernetesSecretsQuery, + zGetKubernetesSecretsResponse, + zGetKubernetesServiceAccountPath, + zGetKubernetesServiceAccountResponse, + zGetKubernetesServiceAccountsPath, + zGetKubernetesServiceAccountsResponse, + zGetKubernetesServicesByNamespacePath, + zGetKubernetesServicesByNamespaceResponse, + zGetKubernetesServicesPath, + zGetKubernetesServicesQuery, + zGetKubernetesServicesResponse, + zGetKubernetesStorageClassPath, + zGetKubernetesStorageClassResponse, + zGetKubernetesVersionPath, + zGetKubernetesVersionResponse, + zGetKubernetesVolumePath, + zGetKubernetesVolumeResponse, + zGetKubernetesVolumesInNamespacePath, + zGetKubernetesVolumesInNamespaceQuery, + zGetKubernetesVolumesInNamespaceResponse, + zGetWebhooksQuery, + zGetWebhooksResponse, + zGetWebsocketAttachQuery, + zGetWebsocketExecQuery, + zGetWebsocketKubernetesShellQuery, + zGetWebsocketPodQuery, + zGitOperationRepoFilePreviewBody, + zGitOperationRepoFilePreviewResponse, + zGitOpsSourceGetPath, + zGitOpsSourceGetResponse, + zGitOpsSourcesCreateGitBody, + zGitOpsSourcesCreateGitResponse, + zGitOpsSourcesDeletePath, + zGitOpsSourcesDeleteResponse, + zGitOpsSourcesListQuery, + zGitOpsSourcesListResponse, + zGitOpsSourcesSummaryResponse, + zGitOpsSourcesUpdateGitBody, + zGitOpsSourcesUpdateGitPath, + zGitOpsSourcesUpdateGitResponse, + zGitOpsWorkflowsListQuery, + zGitOpsWorkflowsListResponse, + zGitOpsWorkflowsSummaryResponse, + zHelmDeletePath, + zHelmDeleteQuery, + zHelmDeleteResponse, + zHelmGetHistoryPath, + zHelmGetHistoryQuery, + zHelmGetHistoryResponse, + zHelmGetPath, + zHelmGetQuery, + zHelmGetResponse, + zHelmInstallBody, + zHelmInstallPath, + zHelmInstallQuery, + zHelmInstallResponse, + zHelmListPath, + zHelmListQuery, + zHelmListResponse, + zHelmRepoSearchQuery, + zHelmRepoSearchResponse, + zHelmRollbackPath, + zHelmRollbackQuery, + zHelmRollbackResponse, + zHelmShowPath, + zHelmShowQuery, + zHelmShowResponse, + zHelmUserRepositoriesListPath, + zHelmUserRepositoriesListResponse, + zHelmUserRepositoryCreateBody, + zHelmUserRepositoryCreatePath, + zHelmUserRepositoryCreateResponse, + zHelmUserRepositoryDeletePath, + zHelmUserRepositoryDeleteResponse, + zKubernetesNamespacesToggleSystemBody, + zKubernetesNamespacesToggleSystemPath, + zKubernetesNamespacesToggleSystemResponse, + zLdapCheckBody, + zLdapCheckResponse, + zLogoutResponse, + zMotdResponse, + zPostEndpointGroupsBody, + zPostEndpointGroupsResponse, + zPostEndpointsByIdDockerV2BrowsePutBody, + zPostEndpointsByIdDockerV2BrowsePutPath, + zPostEndpointsByIdDockerV2BrowsePutQuery, + zPostEndpointsByIdDockerV2BrowsePutResponse, + zPostWebhooksBody, + zPostWebhooksByIdPath, + zPostWebhooksResponse, + zPutWebhooksByIdBody, + zPutWebhooksByIdPath, + zPutWebhooksByIdResponse, + zRegistryConfigureBody, + zRegistryConfigurePath, + zRegistryConfigureResponse, + zRegistryCreateBody, + zRegistryCreateResponse, + zRegistryDeletePath, + zRegistryDeleteResponse, + zRegistryInspectPath, + zRegistryInspectResponse, + zRegistryListResponse, + zRegistryPingBody, + zRegistryPingResponse, + zRegistryUpdateBody, + zRegistryUpdatePath, + zRegistryUpdateResponse, + zResizeKubernetesPersistentVolumeClaimBody, + zResizeKubernetesPersistentVolumeClaimPath, + zResizeKubernetesPersistentVolumeClaimResponse, + zResourceControlCreateBody, + zResourceControlCreateResponse, + zResourceControlDeletePath, + zResourceControlDeleteResponse, + zResourceControlUpdateBody, + zResourceControlUpdatePath, + zResourceControlUpdateResponse, + zRestartKubernetesPodPath, + zRestartKubernetesPodResponse, + zRestoreBody, + zRoleListResponse, + zSetDefaultKubernetesStorageClassPath, + zSetDefaultKubernetesStorageClassResponse, + zSettingsInspectResponse, + zSettingsPublicResponse, + zSettingsUpdateBody, + zSettingsUpdateResponse, + zSslInspectResponse, + zSslUpdateBody, + zSslUpdateResponse, + zStackAssociatePath, + zStackAssociateQuery, + zStackAssociateResponse, + zStackCreateDockerStandaloneFileBody, + zStackCreateDockerStandaloneFileQuery, + zStackCreateDockerStandaloneFileResponse, + zStackCreateDockerStandaloneRepositoryBody, + zStackCreateDockerStandaloneRepositoryQuery, + zStackCreateDockerStandaloneRepositoryResponse, + zStackCreateDockerStandaloneStringBody, + zStackCreateDockerStandaloneStringQuery, + zStackCreateDockerStandaloneStringResponse, + zStackCreateDockerSwarmFileBody, + zStackCreateDockerSwarmFileQuery, + zStackCreateDockerSwarmFileResponse, + zStackCreateDockerSwarmRepositoryBody, + zStackCreateDockerSwarmRepositoryQuery, + zStackCreateDockerSwarmRepositoryResponse, + zStackCreateDockerSwarmStringBody, + zStackCreateDockerSwarmStringQuery, + zStackCreateDockerSwarmStringResponse, + zStackCreateKubernetesFileBody, + zStackCreateKubernetesFileQuery, + zStackCreateKubernetesFileResponse, + zStackCreateKubernetesGitBody, + zStackCreateKubernetesGitQuery, + zStackCreateKubernetesGitResponse, + zStackCreateKubernetesUrlBody, + zStackCreateKubernetesUrlQuery, + zStackCreateKubernetesUrlResponse, + zStackDeleteKubernetesByNamePath, + zStackDeleteKubernetesByNameQuery, + zStackDeleteKubernetesByNameResponse, + zStackDeletePath, + zStackDeleteQuery, + zStackDeleteResponse, + zStackFileInspectPath, + zStackFileInspectResponse, + zStackGitRedeployBody, + zStackGitRedeployPath, + zStackGitRedeployQuery, + zStackGitRedeployResponse, + zStackInspectPath, + zStackInspectResponse, + zStackListQuery, + zStackListResponse, + zStackMigrateBody, + zStackMigratePath, + zStackMigrateQuery, + zStackMigrateResponse, + zStackStartPath, + zStackStartQuery, + zStackStartResponse, + zStackStopPath, + zStackStopQuery, + zStackStopResponse, + zStackUpdateBody, + zStackUpdateGitBody, + zStackUpdateGitPath, + zStackUpdateGitQuery, + zStackUpdateGitResponse, + zStackUpdatePath, + zStackUpdateQuery, + zStackUpdateResponse, + zSystemInfoResponse, + zSystemNodesCountResponse2, + zSystemStatusResponse, + zSystemUpgradeResponse, + zSystemVersionResponse2, + zTagCreateBody, + zTagCreateResponse, + zTagDeletePath, + zTagDeleteResponse, + zTagListResponse, + zTeamCreateBody, + zTeamCreateResponse, + zTeamDeletePath, + zTeamDeleteResponse, + zTeamInspectPath, + zTeamInspectResponse, + zTeamListQuery, + zTeamListResponse, + zTeamMembershipCreateBody, + zTeamMembershipCreateResponse, + zTeamMembershipDeletePath, + zTeamMembershipDeleteResponse, + zTeamMembershipListResponse, + zTeamMembershipsPath, + zTeamMembershipsResponse, + zTeamMembershipUpdateBody, + zTeamMembershipUpdatePath, + zTeamMembershipUpdateResponse, + zTeamUpdateBody, + zTeamUpdatePath, + zTeamUpdateResponse, + zTemplateFilePath, + zTemplateFileResponse, + zTemplateListResponse, + zUpdateKubernetesIngressBody, + zUpdateKubernetesIngressControllersBody, + zUpdateKubernetesIngressControllersByNamespaceBody, + zUpdateKubernetesIngressControllersByNamespacePath, + zUpdateKubernetesIngressControllersByNamespaceResponse, + zUpdateKubernetesIngressControllersPath, + zUpdateKubernetesIngressControllersResponse, + zUpdateKubernetesIngressPath, + zUpdateKubernetesIngressResponse, + zUpdateKubernetesNamespaceBody, + zUpdateKubernetesNamespaceDeprecatedBody, + zUpdateKubernetesNamespaceDeprecatedPath, + zUpdateKubernetesNamespaceDeprecatedResponse, + zUpdateKubernetesNamespacePath, + zUpdateKubernetesNamespaceResponse, + zUpdateKubernetesPersistentVolumeReclaimPolicyBody, + zUpdateKubernetesPersistentVolumeReclaimPolicyPath, + zUpdateKubernetesPersistentVolumeReclaimPolicyResponse, + zUpdateKubernetesServiceAccountImagePullSecretsBody, + zUpdateKubernetesServiceAccountImagePullSecretsPath, + zUpdateKubernetesServiceAccountImagePullSecretsResponse, + zUpdateKubernetesServiceBody, + zUpdateKubernetesServicePath, + zUpdateKubernetesServiceResponse, + zUploadTlsBody, + zUploadTlsPath, + zUploadTlsResponse, + zUserAdminCheckResponse, + zUserAdminInitBody, + zUserAdminInitResponse, + zUserCreateBody, + zUserCreateResponse, + zUserDeletePath, + zUserDeleteResponse, + zUserEffectiveAccessInspectPath, + zUserEffectiveAccessInspectResponse, + zUserGenerateApiKeyBody, + zUserGenerateApiKeyPath, + zUserGenerateApiKeyResponse, + zUserGetApiKeysPath, + zUserGetApiKeysResponse, + zUserInspectPath, + zUserInspectResponse, + zUserListQuery, + zUserListResponse, + zUserMembershipsInspectPath, + zUserMembershipsInspectResponse, + zUserRemoveApiKeyPath, + zUserRemoveApiKeyResponse, + zUserUpdateBody, + zUserUpdatePasswordBody, + zUserUpdatePasswordPath, + zUserUpdatePasswordResponse, + zUserUpdatePath, + zUserUpdateResponse, + zValidateOAuthBody, + zValidateOAuthResponse, + zWebhookInvokePath, +} from './zod.gen'; + +export type Options< + TData extends TDataShape = TDataShape, + ThrowOnError extends boolean = boolean, + TResponse = unknown, +> = Options2 & { + /** + * You can provide a client instance returned by `createClient()` instead of + * individual options. This might be also useful if you want to implement a + * custom client. + */ + client?: Client; + /** + * You can pass arbitrary values through the `meta` object. This can be + * used to access values that aren't defined as part of the SDK function. + */ + meta?: Record; +}; + +/** + * Authenticate + * + * **Access policy**: public + * Use this environment(endpoint) to authenticate against Portainer using a username and password. + */ +export const authenticateUser = ( + options: Options +) => + (options.client ?? client).post< + AuthenticateUserResponses, + AuthenticateUserErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zAuthenticateUserBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zAuthenticateUserResponse.parseAsync(data), + url: '/auth', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Logout + * + * **Access policy**: public + */ +export const logout = ( + options?: Options +) => + (options?.client ?? client).post( + { + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => await zLogoutResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/auth/logout', + ...options, + } + ); + +/** + * Authenticate with OAuth + * + * **Access policy**: public + */ +export const validateOAuth = ( + options: Options +) => + (options.client ?? client).post< + ValidateOAuthResponses, + ValidateOAuthErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zValidateOAuthBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zValidateOAuthResponse.parseAsync(data), + url: '/auth/oauth/validate', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Creates an archive with a system data snapshot that could be used to restore the system. + * + * Creates an archive with a system data snapshot that could be used to restore the system. + * **Access policy**: admin + */ +export const backup = ( + options?: Options +) => + (options?.client ?? client).post( + { + requestValidator: async (data) => + await z + .object({ + body: zBackupBody.optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/backup', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options?.headers, + }, + } + ); + +/** + * List available custom templates + * + * List available custom templates. + * **Access policy**: authenticated + */ +export const customTemplateList = ( + options: Options +) => + (options.client ?? client).get< + CustomTemplateListResponses, + CustomTemplateListErrors, + ThrowOnError + >({ + querySerializer: { parameters: { type: { array: { explode: false } } } }, + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zCustomTemplateListQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zCustomTemplateListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/custom_templates', + ...options, + }); + +/** + * Remove a template + * + * Remove a template. + * **Access policy**: authenticated + */ +export const customTemplateDelete = ( + options: Options +) => + (options.client ?? client).delete< + CustomTemplateDeleteResponses, + CustomTemplateDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zCustomTemplateDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zCustomTemplateDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/custom_templates/{id}', + ...options, + }); + +/** + * Inspect a custom template + * + * Retrieve details about a template. + * **Access policy**: authenticated + */ +export const customTemplateInspect = ( + options: Options +) => + (options.client ?? client).get< + CustomTemplateInspectResponses, + CustomTemplateInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zCustomTemplateInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zCustomTemplateInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/custom_templates/{id}', + ...options, + }); + +/** + * Update a template + * + * Update a template. + * **Access policy**: authenticated + */ +export const customTemplateUpdate = ( + options: Options +) => + (options.client ?? client).put< + CustomTemplateUpdateResponses, + CustomTemplateUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zCustomTemplateUpdateBody, + path: zCustomTemplateUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zCustomTemplateUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/custom_templates/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get Template stack file content. + * + * Retrieve the content of the Stack file for the specified custom template + * **Access policy**: authenticated + */ +export const customTemplateFile = ( + options: Options +) => + (options.client ?? client).get< + CustomTemplateFileResponses, + CustomTemplateFileErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zCustomTemplateFilePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zCustomTemplateFileResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/custom_templates/{id}/file', + ...options, + }); + +/** + * Fetch the latest config file content based on custom template's git repository configuration + * + * Retrieve details about a template created from git repository method. + * **Access policy**: authenticated + */ +export const customTemplateGitFetch = ( + options: Options +) => + (options.client ?? client).put< + CustomTemplateGitFetchResponses, + CustomTemplateGitFetchErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zCustomTemplateGitFetchPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zCustomTemplateGitFetchResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/custom_templates/{id}/git_fetch', + ...options, + }); + +/** + * Create a custom template + * + * Create a custom template. + * **Access policy**: authenticated + */ +export const customTemplateCreateFile = ( + options: Options +) => + (options.client ?? client).post< + CustomTemplateCreateFileResponses, + CustomTemplateCreateFileErrors, + ThrowOnError + >({ + ...formDataBodySerializer, + requestValidator: async (data) => + await z + .object({ + body: zCustomTemplateCreateFileBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zCustomTemplateCreateFileResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/custom_templates/create/file', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + +/** + * Create a custom template + * + * Create a custom template. + * **Access policy**: authenticated + */ +export const customTemplateCreateRepository = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).post< + CustomTemplateCreateRepositoryResponses, + CustomTemplateCreateRepositoryErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zCustomTemplateCreateRepositoryBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zCustomTemplateCreateRepositoryResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/custom_templates/create/repository', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Create a custom template + * + * Create a custom template. + * **Access policy**: authenticated + */ +export const customTemplateCreateString = ( + options: Options +) => + (options.client ?? client).post< + CustomTemplateCreateStringResponses, + CustomTemplateCreateStringErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zCustomTemplateCreateStringBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zCustomTemplateCreateStringResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/custom_templates/create/string', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Fetch container gpus data + * + * **Access policy**: + */ +export const dockerContainerGpusInspect = ( + options: Options +) => + (options.client ?? client).get< + DockerContainerGpusInspectResponses, + DockerContainerGpusInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zDockerContainerGpusInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zDockerContainerGpusInspectResponse.parseAsync(data), + security: [{ name: 'Authorization', type: 'apiKey' }], + url: '/docker/{environmentId}/containers/{containerId}/gpus', + ...options, + }); + +/** + * Get counters for the dashboard + * + * **Access policy**: restricted + */ +export const dockerDashboard = ( + options: Options +) => + (options.client ?? client).get< + DockerDashboardResponses, + DockerDashboardErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zDockerDashboardPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zDockerDashboardResponse2.parseAsync(data), + security: [{ name: 'Authorization', type: 'apiKey' }], + url: '/docker/{environmentId}/dashboard', + ...options, + }); + +/** + * Fetch images + * + * **Access policy**: + */ +export const dockerImagesList = ( + options: Options +) => + (options.client ?? client).get< + DockerImagesListResponses, + DockerImagesListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zDockerImagesListPath, + query: zDockerImagesListQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zDockerImagesListResponse.parseAsync(data), + security: [{ name: 'Authorization', type: 'apiKey' }], + url: '/docker/{environmentId}/images', + ...options, + }); + +/** + * list EdgeGroups + * + * **Access policy**: administrator + */ +export const edgeGroupList = ( + options?: Options +) => + (options?.client ?? client).get< + EdgeGroupListResponses, + EdgeGroupListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeGroupListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_groups', + ...options, + }); + +/** + * Create an EdgeGroup + * + * **Access policy**: administrator + */ +export const edgeGroupCreate = ( + options: Options +) => + (options.client ?? client).post< + EdgeGroupCreateResponses, + EdgeGroupCreateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEdgeGroupCreateBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeGroupCreateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_groups', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Deletes an EdgeGroup + * + * **Access policy**: administrator + */ +export const edgeGroupDelete = ( + options: Options +) => + (options.client ?? client).delete< + EdgeGroupDeleteResponses, + EdgeGroupDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeGroupDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEdgeGroupDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_groups/{id}', + ...options, + }); + +/** + * Inspects an EdgeGroup + * + * **Access policy**: administrator + */ +export const edgeGroupInspect = ( + options: Options +) => + (options.client ?? client).get< + EdgeGroupInspectResponses, + EdgeGroupInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeGroupInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeGroupInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_groups/{id}', + ...options, + }); + +/** + * Updates an EdgeGroup + * + * **Access policy**: administrator + */ +export const edgeGroupUpdate = ( + options: Options +) => + (options.client ?? client).put< + EdgeGroupUpdateResponses, + EdgeGroupUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEdgeGroupUpdateBody, + path: zEdgeGroupUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeGroupUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_groups/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Fetch EdgeJobs list + * + * **Access policy**: administrator + */ +export const edgeJobList = ( + options?: Options +) => + (options?.client ?? client).get< + EdgeJobListResponses, + EdgeJobListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeJobListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_jobs', + ...options, + }); + +/** + * Delete an EdgeJob + * + * **Access policy**: administrator + */ +export const edgeJobDelete = ( + options: Options +) => + (options.client ?? client).delete< + EdgeJobDeleteResponses, + EdgeJobDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeJobDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEdgeJobDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_jobs/{id}', + ...options, + }); + +/** + * Inspect an EdgeJob + * + * **Access policy**: administrator + */ +export const edgeJobInspect = ( + options: Options +) => + (options.client ?? client).get< + EdgeJobInspectResponses, + EdgeJobInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeJobInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeJobInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_jobs/{id}', + ...options, + }); + +/** + * Update an EdgeJob + * + * **Access policy**: administrator + */ +export const edgeJobUpdate = ( + options: Options +) => + (options.client ?? client).put< + EdgeJobUpdateResponses, + EdgeJobUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEdgeJobUpdateBody, + path: zEdgeJobUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeJobUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_jobs/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Fetch a file of an EdgeJob + * + * **Access policy**: administrator + */ +export const edgeJobFile = ( + options: Options +) => + (options.client ?? client).get< + EdgeJobFileResponses, + EdgeJobFileErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeJobFilePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeJobFileResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_jobs/{id}/file', + ...options, + }); + +/** + * Fetch the list of tasks on an EdgeJob + * + * **Access policy**: administrator + */ +export const edgeJobTasksList = ( + options: Options +) => + (options.client ?? client).get< + EdgeJobTasksListResponses, + EdgeJobTasksListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeJobTasksListPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeJobTasksListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_jobs/{id}/tasks', + ...options, + }); + +/** + * Clear the log for a specifc task on an EdgeJob + * + * **Access policy**: administrator + */ +export const edgeJobTasksClear = ( + options: Options +) => + (options.client ?? client).delete< + EdgeJobTasksClearResponses, + EdgeJobTasksClearErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeJobTasksClearPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEdgeJobTasksClearResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_jobs/{id}/tasks/{taskID}/logs', + ...options, + }); + +/** + * Fetch the log for a specifc task on an EdgeJob + * + * **Access policy**: administrator + */ +export const edgeJobTaskLogsInspect = ( + options: Options +) => + (options.client ?? client).get< + EdgeJobTaskLogsInspectResponses, + EdgeJobTaskLogsInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeJobTaskLogsInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeJobTaskLogsInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_jobs/{id}/tasks/{taskID}/logs', + ...options, + }); + +/** + * Collect the log for a specifc task on an EdgeJob + * + * **Access policy**: administrator + */ +export const edgeJobTasksCollect = ( + options: Options +) => + (options.client ?? client).post< + EdgeJobTasksCollectResponses, + EdgeJobTasksCollectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeJobTasksCollectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEdgeJobTasksCollectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_jobs/{id}/tasks/{taskID}/logs', + ...options, + }); + +/** + * Create an EdgeJob from a file + * + * **Access policy**: administrator + */ +export const edgeJobCreateFile = ( + options: Options +) => + (options.client ?? client).post< + EdgeJobCreateFileResponses, + EdgeJobCreateFileErrors, + ThrowOnError + >({ + ...formDataBodySerializer, + requestValidator: async (data) => + await z + .object({ + body: zEdgeJobCreateFileBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeJobCreateFileResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_jobs/create/file', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + +/** + * Create an EdgeJob from a text + * + * **Access policy**: administrator + */ +export const edgeJobCreateString = ( + options: Options +) => + (options.client ?? client).post< + EdgeJobCreateStringResponses, + EdgeJobCreateStringErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEdgeJobCreateStringBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeJobCreateStringResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_jobs/create/string', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Fetches the list of EdgeStacks + * + * **Access policy**: administrator + */ +export const edgeStackList = ( + options?: Options +) => + (options?.client ?? client).get< + EdgeStackListResponses, + EdgeStackListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zEdgeStackListQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeStackListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_stacks', + ...options, + }); + +/** + * Delete an EdgeStack + * + * **Access policy**: administrator + */ +export const edgeStackDelete = ( + options: Options +) => + (options.client ?? client).delete< + EdgeStackDeleteResponses, + EdgeStackDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeStackDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEdgeStackDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_stacks/{id}', + ...options, + }); + +/** + * Inspect an EdgeStack + * + * **Access policy**: administrator + */ +export const edgeStackInspect = ( + options: Options +) => + (options.client ?? client).get< + EdgeStackInspectResponses, + EdgeStackInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeStackInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeStackInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_stacks/{id}', + ...options, + }); + +/** + * Update an EdgeStack + * + * **Access policy**: administrator + */ +export const edgeStackUpdate = ( + options: Options +) => + (options.client ?? client).put< + EdgeStackUpdateResponses, + EdgeStackUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEdgeStackUpdateBody, + path: zEdgeStackUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeStackUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_stacks/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Fetches the stack file for an EdgeStack + * + * **Access policy**: administrator + */ +export const edgeStackFile = ( + options: Options +) => + (options.client ?? client).get< + EdgeStackFileResponses, + EdgeStackFileErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEdgeStackFilePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeStackFileResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_stacks/{id}/file', + ...options, + }); + +/** + * Update an EdgeStack status + * + * Authorized only if the request is done by an Edge Environment(Endpoint) + */ +export const edgeStackStatusUpdate = ( + options: Options +) => + (options.client ?? client).put< + EdgeStackStatusUpdateResponses, + EdgeStackStatusUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEdgeStackStatusUpdateBody, + path: zEdgeStackStatusUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeStackStatusUpdateResponse.parseAsync(data), + url: '/edge_stacks/{id}/status', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Create an EdgeStack from file + * + * **Access policy**: administrator + */ +export const edgeStackCreateFile = ( + options: Options +) => + (options.client ?? client).post< + EdgeStackCreateFileResponses, + EdgeStackCreateFileErrors, + ThrowOnError + >({ + ...formDataBodySerializer, + requestValidator: async (data) => + await z + .object({ + body: zEdgeStackCreateFileBody, + path: z.never().optional(), + query: zEdgeStackCreateFileQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeStackCreateFileResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_stacks/create/file', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + +/** + * Create an EdgeStack from a git repository + * + * **Access policy**: administrator + */ +export const edgeStackCreateRepository = ( + options: Options +) => + (options.client ?? client).post< + EdgeStackCreateRepositoryResponses, + EdgeStackCreateRepositoryErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEdgeStackCreateRepositoryBody, + path: z.never().optional(), + query: zEdgeStackCreateRepositoryQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeStackCreateRepositoryResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_stacks/create/repository', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Create an EdgeStack from a text + * + * **Access policy**: administrator + */ +export const edgeStackCreateString = ( + options: Options +) => + (options.client ?? client).post< + EdgeStackCreateStringResponses, + EdgeStackCreateStringErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEdgeStackCreateStringBody, + path: z.never().optional(), + query: zEdgeStackCreateStringQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEdgeStackCreateStringResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/edge_stacks/create/string', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * List Environment(Endpoint) groups + * + * List all environment(endpoint) groups based on the current user authorizations. Will + * return all environment(endpoint) groups if using an administrator account otherwise it will + * only return authorized environment(endpoint) groups. + * **Access policy**: restricted + */ +export const endpointGroupList = ( + options?: Options +) => + (options?.client ?? client).get< + EndpointGroupListResponses, + EndpointGroupListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zEndpointGroupListQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointGroupListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoint_groups', + ...options, + }); + +/** + * Create an Environment(Endpoint) Group + * + * Create a new environment(endpoint) group. + * **Access policy**: administrator + */ +export const postEndpointGroups = ( + options: Options +) => + (options.client ?? client).post< + PostEndpointGroupsResponses, + PostEndpointGroupsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zPostEndpointGroupsBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zPostEndpointGroupsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoint_groups', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Remove an environment(endpoint) group + * + * Remove an environment(endpoint) group. + * **Access policy**: administrator + */ +export const endpointGroupDelete = ( + options: Options +) => + (options.client ?? client).delete< + EndpointGroupDeleteResponses, + EndpointGroupDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEndpointGroupDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEndpointGroupDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoint_groups/{id}', + ...options, + }); + +/** + * Inspect an Environment(Endpoint) group + * + * Retrieve details abont an environment(endpoint) group. + * **Access policy**: administrator + */ +export const getEndpointGroupsById = ( + options: Options +) => + (options.client ?? client).get< + GetEndpointGroupsByIdResponses, + GetEndpointGroupsByIdErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetEndpointGroupsByIdPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetEndpointGroupsByIdResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoint_groups/{id}', + ...options, + }); + +/** + * Update an environment(endpoint) group + * + * Update an environment(endpoint) group. + * **Access policy**: administrator + */ +export const endpointGroupUpdate = ( + options: Options +) => + (options.client ?? client).put< + EndpointGroupUpdateResponses, + EndpointGroupUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEndpointGroupUpdateBody, + path: zEndpointGroupUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointGroupUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoint_groups/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Removes environment(endpoint) from an environment(endpoint) group + * + * **Access policy**: administrator + */ +export const endpointGroupDeleteEndpoint = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).delete< + EndpointGroupDeleteEndpointResponses, + EndpointGroupDeleteEndpointErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEndpointGroupDeleteEndpointPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEndpointGroupDeleteEndpointResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoint_groups/{id}/endpoints/{endpointId}', + ...options, + }); + +/** + * Add an environment(endpoint) to an environment(endpoint) group + * + * Add an environment(endpoint) to an environment(endpoint) group + * **Access policy**: administrator + */ +export const endpointGroupAddEndpoint = ( + options: Options +) => + (options.client ?? client).put< + EndpointGroupAddEndpointResponses, + EndpointGroupAddEndpointErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEndpointGroupAddEndpointPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEndpointGroupAddEndpointResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoint_groups/{id}/endpoints/{endpointId}', + ...options, + }); + +/** + * List environments(endpoints) + * + * List all environments(endpoints) based on the current user authorizations. Will + * return all environments(endpoints) if using an administrator or team leader account otherwise it will + * only return authorized environments(endpoints). + * **Access policy**: restricted + */ +export const endpointList = ( + options?: Options +) => + (options?.client ?? client).get< + EndpointListResponses, + EndpointListErrors, + ThrowOnError + >({ + querySerializer: { + parameters: { + groupIds: { array: { explode: false } }, + status: { array: { explode: false } }, + types: { array: { explode: false } }, + tagIds: { array: { explode: false } }, + endpointIds: { array: { explode: false } }, + excludeIds: { array: { explode: false } }, + excludeGroupIds: { array: { explode: false } }, + agentVersions: { array: { explode: false } }, + edgeGroupIds: { array: { explode: false } }, + excludeEdgeGroupIds: { array: { explode: false } }, + }, + }, + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zEndpointListQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints', + ...options, + }); + +/** + * Create a new environment(endpoint) + * + * Create a new environment(endpoint) that will be used to manage an environment(endpoint). + * **Access policy**: administrator + */ +export const endpointCreate = ( + options: Options +) => + (options.client ?? client).post< + EndpointCreateResponses, + EndpointCreateErrors, + ThrowOnError + >({ + ...formDataBodySerializer, + requestValidator: async (data) => + await z + .object({ + body: zEndpointCreateBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointCreateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + +/** + * Remove an environment + * + * Remove the environment associated to the specified identifier and optionally clean-up associated resources. + * **Access policy**: Administrator only. + */ +export const endpointDelete = ( + options: Options +) => + (options.client ?? client).delete< + EndpointDeleteResponses, + EndpointDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEndpointDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEndpointDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}', + ...options, + }); + +/** + * Inspect an environment(endpoint) + * + * Retrieve details about an environment(endpoint). + * **Access policy**: restricted + */ +export const endpointInspect = ( + options: Options +) => + (options.client ?? client).get< + EndpointInspectResponses, + EndpointInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEndpointInspectPath, + query: zEndpointInspectQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}', + ...options, + }); + +/** + * Update an environment(endpoint) + * + * Update an environment(endpoint). + * **Access policy**: authenticated + */ +export const endpointUpdate = ( + options: Options +) => + (options.client ?? client).put< + EndpointUpdateResponses, + EndpointUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEndpointUpdateBody, + path: zEndpointUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * De-association an edge environment(endpoint) + * + * De-association an edge environment(endpoint). + * **Access policy**: administrator + */ +export const endpointAssociationDelete = ( + options: Options +) => + (options.client ?? client).put< + EndpointAssociationDeleteResponses, + EndpointAssociationDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEndpointAssociationDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEndpointAssociationDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/association', + ...options, + }); + +/** + * Upload a file under a specific path on the file system of an environment (endpoint) + * + * Use this environment(endpoint) to upload TLS files. + * **Access policy**: administrator + */ +export const postEndpointsByIdDockerV2BrowsePut = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).post< + PostEndpointsByIdDockerV2BrowsePutResponses, + PostEndpointsByIdDockerV2BrowsePutErrors, + ThrowOnError + >({ + ...formDataBodySerializer, + requestValidator: async (data) => + await z + .object({ + body: zPostEndpointsByIdDockerV2BrowsePutBody, + path: zPostEndpointsByIdDockerV2BrowsePutPath, + query: zPostEndpointsByIdDockerV2BrowsePutQuery.optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zPostEndpointsByIdDockerV2BrowsePutResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/docker/v2/browse/put', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + +/** + * fetch docker pull limits + * + * get docker pull limits for a docker hub registry in the environment + * **Access policy**: + */ +export const endpointDockerhubStatus = ( + options: Options +) => + (options.client ?? client).get< + EndpointDockerhubStatusResponses, + EndpointDockerhubStatusErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEndpointDockerhubStatusPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointDockerhubStatusResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/dockerhub/{registryId}', + ...options, + }); + +/** + * force update a docker service + * + * force update a docker service + * **Access policy**: authenticated + */ +export const endpointForceUpdateService = ( + options: Options +) => + (options.client ?? client).put< + EndpointForceUpdateServiceResponses, + EndpointForceUpdateServiceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEndpointForceUpdateServiceBody, + path: zEndpointForceUpdateServicePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointForceUpdateServiceResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/forceupdateservice', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * List Helm Releases + * + * **Access policy**: authenticated + */ +export const helmList = ( + options: Options +) => + (options.client ?? client).get< + HelmListResponses, + HelmListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zHelmListPath, + query: zHelmListQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => await zHelmListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/kubernetes/helm', + ...options, + }); + +/** + * Install Helm Chart + * + * **Access policy**: authenticated + */ +export const helmInstall = ( + options: Options +) => + (options.client ?? client).post< + HelmInstallResponses, + HelmInstallErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zHelmInstallBody, + path: zHelmInstallPath, + query: zHelmInstallQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zHelmInstallResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/kubernetes/helm', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Delete Helm Release + * + * **Access policy**: authenticated + */ +export const helmDelete = ( + options: Options +) => + (options.client ?? client).delete< + HelmDeleteResponses, + HelmDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zHelmDeletePath, + query: zHelmDeleteQuery.optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zHelmDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/kubernetes/helm/{release}', + ...options, + }); + +/** + * Get a helm release + * + * Get details of a helm release by release name + * **Access policy**: authenticated + */ +export const helmGet = ( + options: Options +) => + (options.client ?? client).get( + { + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zHelmGetPath, + query: zHelmGetQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zHelmGetResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/kubernetes/helm/{release}', + ...options, + } + ); + +/** + * Get a historical list of releases + * + * Get a historical list of releases by release name + * **Access policy**: authenticated + */ +export const helmGetHistory = ( + options: Options +) => + (options.client ?? client).get< + HelmGetHistoryResponses, + HelmGetHistoryErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zHelmGetHistoryPath, + query: zHelmGetHistoryQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zHelmGetHistoryResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/kubernetes/helm/{release}/history', + ...options, + }); + +/** + * Rollback a helm release + * + * Rollback a helm release to a previous revision + * **Access policy**: authenticated + */ +export const helmRollback = ( + options: Options +) => + (options.client ?? client).post< + HelmRollbackResponses, + HelmRollbackErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zHelmRollbackPath, + query: zHelmRollbackQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zHelmRollbackResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/kubernetes/helm/{release}/rollback', + ...options, + }); + +/** + * List Registries on environment + * + * List all registries based on the current user authorizations in current environment. + * **Access policy**: authenticated + */ +export const endpointRegistriesList = ( + options: Options +) => + (options.client ?? client).get< + EndpointRegistriesListResponses, + EndpointRegistriesListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEndpointRegistriesListPath, + query: zEndpointRegistriesListQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointRegistriesListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/registries', + ...options, + }); + +/** + * update registry access for environment + * + * **Access policy**: authenticated + */ +export const endpointRegistryAccess = ( + options: Options +) => + (options.client ?? client).put< + EndpointRegistryAccessResponses, + EndpointRegistryAccessErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEndpointRegistryAccessBody, + path: zEndpointRegistryAccessPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEndpointRegistryAccessResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/registries/{registryId}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Update settings for an environment(endpoint) + * + * Update settings for an environment(endpoint). + * **Access policy**: authenticated + */ +export const endpointSettingsUpdate = ( + options: Options +) => + (options.client ?? client).put< + EndpointSettingsUpdateResponses, + EndpointSettingsUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEndpointSettingsUpdateBody, + path: zEndpointSettingsUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointSettingsUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/settings', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Snapshots an environment(endpoint) + * + * Snapshots an environment(endpoint) + * **Access policy**: administrator + */ +export const endpointSnapshot = ( + options: Options +) => + (options.client ?? client).post< + EndpointSnapshotResponses, + EndpointSnapshotErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zEndpointSnapshotPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEndpointSnapshotResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/{id}/snapshot', + ...options, + }); + +/** + * Remove multiple environments + * + * Remove multiple environments and optionally clean-up associated resources. + * **Access policy**: Administrator only. + */ +export const endpointDeleteBatch = ( + options: Options +) => + (options.client ?? client).post< + EndpointDeleteBatchResponses, + EndpointDeleteBatchErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEndpointDeleteBatchBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointDeleteBatchResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Create or retrieve the endpoint for an EdgeID + */ +export const endpointCreateGlobalKey = ( + options?: Options +) => + (options?.client ?? client).post< + EndpointCreateGlobalKeyResponses, + EndpointCreateGlobalKeyErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEndpointCreateGlobalKeyResponse.parseAsync(data), + url: '/endpoints/global-key', + ...options, + }); + +/** + * Update relations for a list of environments + * + * Update relations for a list of environments + * Edge groups, tags and environment group can be updated. + * + * **Access policy**: administrator + */ +export const endpointUpdateRelations = ( + options: Options +) => + (options.client ?? client).put< + EndpointUpdateRelationsResponses, + EndpointUpdateRelationsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zEndpointUpdateRelationsBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEndpointUpdateRelationsResponse.parseAsync(data), + security: [{ name: 'Authorization', type: 'apiKey' }], + url: '/endpoints/relations', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Snapshot all environments(endpoints) + * + * Snapshot all environments(endpoints) + * **Access policy**: administrator + */ +export const endpointSnapshots = ( + options?: Options +) => + (options?.client ?? client).post< + EndpointSnapshotsResponses, + EndpointSnapshotsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zEndpointSnapshotsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/snapshot', + ...options, + }); + +/** + * Get environment summary counts + * + * Returns counts of environments by status (up, down) and ungrouped environments (unassigned), plus breakdowns by group, type, and health. + * **Access policy**: restricted + */ +export const endpointSummaryCounts = ( + options?: Options +) => + (options?.client ?? client).get< + EndpointSummaryCountsResponses, + EndpointSummaryCountsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zEndpointSummaryCountsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/endpoints/summary', + ...options, + }); + +/** + * preview the content of target file in the git repository + * + * Retrieve the compose file content based on git repository configuration + * **Access policy**: authenticated + */ +export const gitOperationRepoFilePreview = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).post< + GitOperationRepoFilePreviewResponses, + GitOperationRepoFilePreviewErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zGitOperationRepoFilePreviewBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGitOperationRepoFilePreviewResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/gitops/repo/file/preview', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * List all GitOps sources + * + * Returns a deduplicated list of git repositories used across all GitOps workflows. + * **Access policy**: authenticated + */ +export const gitOpsSourcesList = ( + options?: Options +) => + (options?.client ?? client).get< + GitOpsSourcesListResponses, + GitOpsSourcesListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zGitOpsSourcesListQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGitOpsSourcesListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/gitops/sources', + ...options, + }); + +/** + * Delete a source + * + * Deletes an existing GitOps source. Returns 409 if the source is referenced by any workflow. + * **Access policy**: admin + */ +export const gitOpsSourcesDelete = ( + options: Options +) => + (options.client ?? client).delete< + GitOpsSourcesDeleteResponses, + GitOpsSourcesDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGitOpsSourcesDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zGitOpsSourcesDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/gitops/sources/{id}', + ...options, + }); + +/** + * Get a GitOps source by ID + * + * Returns a single GitOps source with its connection settings and linked workflows. + * **Access policy**: admin + */ +export const gitOpsSourceGet = ( + options: Options +) => + (options.client ?? client).get< + GitOpsSourceGetResponses, + GitOpsSourceGetErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGitOpsSourceGetPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGitOpsSourceGetResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/gitops/sources/{id}', + ...options, + }); + +/** + * Update a Git source + * + * Updates an existing GitOps source backed by a Git repository. + * **Access policy**: admin + */ +export const gitOpsSourcesUpdateGit = ( + options: Options +) => + (options.client ?? client).put< + GitOpsSourcesUpdateGitResponses, + GitOpsSourcesUpdateGitErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zGitOpsSourcesUpdateGitBody, + path: zGitOpsSourcesUpdateGitPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGitOpsSourcesUpdateGitResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/gitops/sources/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Create a Git source + * + * Creates a new GitOps source backed by a Git repository. + * **Access policy**: admin + */ +export const gitOpsSourcesCreateGit = ( + options: Options +) => + (options.client ?? client).post< + GitOpsSourcesCreateGitResponses, + GitOpsSourcesCreateGitErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zGitOpsSourcesCreateGitBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGitOpsSourcesCreateGitResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/gitops/sources/git', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Summarize GitOps source status counts + * + * Returns a count of sources per status. + * **Access policy**: authenticated + */ +export const gitOpsSourcesSummary = ( + options?: Options +) => + (options?.client ?? client).get< + GitOpsSourcesSummaryResponses, + GitOpsSourcesSummaryErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGitOpsSourcesSummaryResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/gitops/sources/summary', + ...options, + }); + +/** + * List all GitOps workflows + * + * Returns a unified list of all stacks that have GitOps (GitConfig) configured. + * **Access policy**: authenticated + */ +export const gitOpsWorkflowsList = ( + options?: Options +) => + (options?.client ?? client).get< + GitOpsWorkflowsListResponses, + GitOpsWorkflowsListErrors, + ThrowOnError + >({ + querySerializer: { + parameters: { endpointIds: { array: { explode: false } } }, + }, + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zGitOpsWorkflowsListQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGitOpsWorkflowsListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/gitops/workflows', + ...options, + }); + +/** + * Summarize GitOps workflow status counts + * + * Returns a count of workflows per status across all environments. + * **Access policy**: authenticated + */ +export const gitOpsWorkflowsSummary = ( + options?: Options +) => + (options?.client ?? client).get< + GitOpsWorkflowsSummaryResponses, + GitOpsWorkflowsSummaryErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGitOpsWorkflowsSummaryResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/gitops/workflows/summary', + ...options, + }); + +/** + * Get a list of applications across all namespaces in the cluster. If the nodeName is provided, it will return the applications running on that node. + * + * Get a list of applications across all namespaces in the cluster. If the nodeName is provided, it will return the applications running on that node. + * **Access policy**: authenticated + */ +export const getAllKubernetesApplications = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesApplicationsResponses, + GetAllKubernetesApplicationsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesApplicationsPath, + query: zGetAllKubernetesApplicationsQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesApplicationsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/applications', + ...options, + }); + +/** + * Get Applications count + * + * Get the count of Applications across all namespaces in the cluster. If the nodeName is provided, it will return the count of applications running on that node. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesApplicationsCount = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesApplicationsCountResponses, + GetAllKubernetesApplicationsCountErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesApplicationsCountPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesApplicationsCountResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/applications/count', + ...options, + }); + +/** + * Delete cluster role bindings + * + * Delete the provided list of cluster role bindings. + * **Access policy**: Authenticated user. + */ +export const deleteClusterRoleBindings = ( + options: Options +) => + (options.client ?? client).post< + DeleteClusterRoleBindingsResponses, + DeleteClusterRoleBindingsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteClusterRoleBindingsBody, + path: zDeleteClusterRoleBindingsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteClusterRoleBindingsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/cluster_role_bindings/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Delete cluster roles + * + * Delete the provided list of cluster roles. + * **Access policy**: Authenticated user. + */ +export const deleteClusterRoles = ( + options: Options +) => + (options.client ?? client).post< + DeleteClusterRolesResponses, + DeleteClusterRolesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteClusterRolesBody, + path: zDeleteClusterRolesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteClusterRolesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/cluster_roles/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get a list of kubernetes cluster role bindings + * + * Get a list of kubernetes cluster role bindings within the given environment at the cluster level. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesClusterRoleBindings = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesClusterRoleBindingsResponses, + GetAllKubernetesClusterRoleBindingsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesClusterRoleBindingsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesClusterRoleBindingsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/clusterrolebindings', + ...options, + }); + +/** + * Get a list of kubernetes cluster roles + * + * Get a list of kubernetes cluster roles within the given environment at the cluster level. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesClusterRoles = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesClusterRolesResponses, + GetAllKubernetesClusterRolesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesClusterRolesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesClusterRolesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/clusterroles', + ...options, + }); + +/** + * Get a list of ConfigMaps + * + * Get a list of ConfigMaps across all namespaces in the cluster. For non-admin users, it will only return ConfigMaps based on the namespaces that they have access to. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesConfigMaps = ( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesConfigMapsResponses, + GetAllKubernetesConfigMapsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesConfigMapsPath, + query: zGetAllKubernetesConfigMapsQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesConfigMapsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/configmaps', + ...options, + }); + +/** + * Get ConfigMaps count + * + * Get the count of ConfigMaps across all namespaces in the cluster. For non-admin users, it will only return the count of ConfigMaps based on the namespaces that they have access to. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesConfigMapsCount = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesConfigMapsCountResponses, + GetAllKubernetesConfigMapsCountErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesConfigMapsCountPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesConfigMapsCountResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/configmaps/count', + ...options, + }); + +/** + * Get a list of kubernetes Cron Jobs + * + * Get a list of kubernetes Cron Jobs that the user has access to. + * **Access policy**: Authenticated user. + */ +export const getKubernetesCronJobs = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesCronJobsResponses, + GetKubernetesCronJobsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesCronJobsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesCronJobsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/cron_jobs', + ...options, + }); + +/** + * Delete Cron Jobs + * + * Delete the provided list of Cron Jobs. + * **Access policy**: Authenticated user. + */ +export const deleteCronJobs = ( + options: Options +) => + (options.client ?? client).post< + DeleteCronJobsResponses, + DeleteCronJobsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteCronJobsBody, + path: zDeleteCronJobsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteCronJobsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/cron_jobs/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get the dashboard summary data + * + * Get the dashboard summary data which is simply a count of a range of different commonly used kubernetes resources. + * **Access policy**: Authenticated user. + */ +export const getKubernetesDashboard = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesDashboardResponses, + GetKubernetesDashboardErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesDashboardPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesDashboardResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/dashboard', + ...options, + }); + +/** + * Get a description of a kubernetes resource + * + * Get a description of a kubernetes resource. + * **Access policy**: Authenticated user. + */ +export const describeResource = ( + options: Options +) => + (options.client ?? client).get< + DescribeResourceResponses, + DescribeResourceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zDescribeResourcePath, + query: zDescribeResourceQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zDescribeResourceResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/describe', + ...options, + }); + +/** + * Gets kubernetes events + * + * Get events by query param resourceId + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesEvents = ( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesEventsResponses, + GetAllKubernetesEventsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesEventsPath, + query: zGetAllKubernetesEventsQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesEventsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/events', + ...options, + }); + +/** + * Get a list of ingress controllers + * + * Get a list of ingress controllers for the given environment. If the allowedOnly query parameter is set, only ingress controllers that are allowed by the environment's ingress configuration will be returned. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesIngressControllers = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesIngressControllersResponses, + GetAllKubernetesIngressControllersErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesIngressControllersPath, + query: zGetAllKubernetesIngressControllersQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesIngressControllersResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/ingresscontrollers', + ...options, + }); + +/** + * Update (block/unblock) ingress controllers + * + * Update (block/unblock) ingress controllers for the provided environment. + * **Access policy**: Authenticated user. + */ +export const updateKubernetesIngressControllers = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).put< + UpdateKubernetesIngressControllersResponses, + UpdateKubernetesIngressControllersErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUpdateKubernetesIngressControllersBody, + path: zUpdateKubernetesIngressControllersPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zUpdateKubernetesIngressControllersResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/ingresscontrollers', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get kubernetes ingresses at the cluster level + * + * Get kubernetes ingresses at the cluster level for the provided environment. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesClusterIngresses = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesClusterIngressesResponses, + GetAllKubernetesClusterIngressesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesClusterIngressesPath, + query: zGetAllKubernetesClusterIngressesQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesClusterIngressesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/ingresses', + ...options, + }); + +/** + * Get Ingresses count + * + * Get the number of kubernetes ingresses within the given environment. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesClusterIngressesCount = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesClusterIngressesCountResponses, + GetAllKubernetesClusterIngressesCountErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesClusterIngressesCountPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesClusterIngressesCountResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/ingresses/count', + ...options, + }); + +/** + * Delete one or more Ingresses + * + * Delete one or more Ingresses in the provided environment. + * **Access policy**: Authenticated user. + */ +export const deleteKubernetesIngresses = ( + options: Options +) => + (options.client ?? client).post< + DeleteKubernetesIngressesResponses, + DeleteKubernetesIngressesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteKubernetesIngressesBody, + path: zDeleteKubernetesIngressesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteKubernetesIngressesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/ingresses/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get a list of kubernetes Jobs + * + * Get a list of kubernetes Jobs that the user has access to. + * **Access policy**: Authenticated user. + */ +export const getKubernetesJobs = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesJobsResponses, + GetKubernetesJobsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesJobsPath, + query: zGetKubernetesJobsQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesJobsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/jobs', + ...options, + }); + +/** + * Delete Jobs + * + * Delete the provided list of Jobs. + * **Access policy**: Authenticated user. + */ +export const deleteJobs = ( + options: Options +) => + (options.client ?? client).post< + DeleteJobsResponses, + DeleteJobsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteJobsBody, + path: zDeleteJobsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteJobsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/jobs/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get max CPU and memory limits of all nodes within k8s cluster + * + * Get max CPU and memory limits (unused resources) of all nodes within k8s cluster. + * **Access policy**: Authenticated user. + */ +export const getKubernetesMaxResourceLimits = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesMaxResourceLimitsResponses, + GetKubernetesMaxResourceLimitsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesMaxResourceLimitsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesMaxResourceLimitsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/max_resource_limits', + ...options, + }); + +/** + * Get the total resource requests and limits of all applications + * + * Get the total CPU (cores) and memory (bytes) requests and limits of all applications across all namespaces. + * **Access policy**: Authenticated user. + */ +export const getApplicationsResources = ( + options: Options +) => + (options.client ?? client).get< + GetApplicationsResourcesResponses, + GetApplicationsResourcesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetApplicationsResourcesPath, + query: zGetApplicationsResourcesQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetApplicationsResourcesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/metrics/applications_resources', + ...options, + }); + +/** + * Get a list of nodes with their live metrics + * + * Get a list of metrics associated with all nodes of a cluster. + * **Access policy**: Authenticated user. + */ +export const getKubernetesMetricsForAllNodes = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesMetricsForAllNodesResponses, + GetKubernetesMetricsForAllNodesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesMetricsForAllNodesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesMetricsForAllNodesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/metrics/nodes', + ...options, + }); + +/** + * Get live metrics for a node + * + * Get live metrics for the specified node. + * **Access policy**: Authenticated user. + */ +export const getKubernetesMetricsForNode = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesMetricsForNodeResponses, + GetKubernetesMetricsForNodeErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesMetricsForNodePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesMetricsForNodeResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/metrics/nodes/{name}', + ...options, + }); + +/** + * Get a list of pods with their live metrics + * + * Get a list of pods with their live metrics for the specified namespace. + * **Access policy**: Authenticated user. + */ +export const getKubernetesMetricsForAllPods = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesMetricsForAllPodsResponses, + GetKubernetesMetricsForAllPodsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesMetricsForAllPodsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesMetricsForAllPodsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/metrics/pods/{namespace}', + ...options, + }); + +/** + * Get live metrics for a pod + * + * Get live metrics for the specified pod. + * **Access policy**: Authenticated user. + */ +export const getKubernetesMetricsForPod = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesMetricsForPodResponses, + GetKubernetesMetricsForPodErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesMetricsForPodPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesMetricsForPodResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/metrics/pods/{namespace}/{name}', + ...options, + }); + +/** + * Delete a kubernetes namespace + * + * Delete a kubernetes namespace within the given environment. + * **Access policy**: Authenticated user. + */ +export const deleteKubernetesNamespace = ( + options: Options +) => + (options.client ?? client).delete< + DeleteKubernetesNamespaceResponses, + DeleteKubernetesNamespaceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zDeleteKubernetesNamespacePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteKubernetesNamespaceResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces', + ...options, + }); + +/** + * Get a list of namespaces + * + * Get a list of all namespaces within the given environment based on the user role and permissions. If the user is an admin, they can access all namespaces. If the user is not an admin, they can only access namespaces that they have access to. + * **Access policy**: Authenticated user. + */ +export const getKubernetesNamespaces = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesNamespacesResponses, + GetKubernetesNamespacesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesNamespacesPath, + query: zGetKubernetesNamespacesQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesNamespacesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces', + ...options, + }); + +/** + * Create a namespace + * + * Create a namespace within the given environment. + * **Access policy**: Authenticated user. + */ +export const createKubernetesNamespace = ( + options: Options +) => + (options.client ?? client).post< + CreateKubernetesNamespaceResponses, + CreateKubernetesNamespaceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zCreateKubernetesNamespaceBody, + path: zCreateKubernetesNamespacePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zCreateKubernetesNamespaceResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Update a namespace + * + * Update a namespace within the given environment. + * **Access policy**: Authenticated user. + */ +export const updateKubernetesNamespaceDeprecated = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).put< + UpdateKubernetesNamespaceDeprecatedResponses, + UpdateKubernetesNamespaceDeprecatedErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUpdateKubernetesNamespaceDeprecatedBody, + path: zUpdateKubernetesNamespaceDeprecatedPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zUpdateKubernetesNamespaceDeprecatedResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get namespace details + * + * Get namespace details for the provided namespace within the given environment. + * **Access policy**: Authenticated user. + */ +export const getKubernetesNamespace = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesNamespaceResponses, + GetKubernetesNamespaceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesNamespacePath, + query: zGetKubernetesNamespaceQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesNamespaceResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}', + ...options, + }); + +/** + * Update a namespace + * + * Update a namespace within the given environment. + * **Access policy**: Authenticated user. + */ +export const updateKubernetesNamespace = ( + options: Options +) => + (options.client ?? client).put< + UpdateKubernetesNamespaceResponses, + UpdateKubernetesNamespaceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUpdateKubernetesNamespaceBody, + path: zUpdateKubernetesNamespacePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zUpdateKubernetesNamespaceResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get a ConfigMap + * + * Get a ConfigMap by name for a given namespace. + * **Access policy**: Authenticated user. + */ +export const getKubernetesConfigMap = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesConfigMapResponses, + GetKubernetesConfigMapErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesConfigMapPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesConfigMapResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/configmaps/{configmap}', + ...options, + }); + +/** + * Gets kubernetes events for namespace + * + * Get events by optional query param resourceId for a given namespace. + * **Access policy**: Authenticated user. + */ +export const getKubernetesEventsForNamespace = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesEventsForNamespaceResponses, + GetKubernetesEventsForNamespaceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesEventsForNamespacePath, + query: zGetKubernetesEventsForNamespaceQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesEventsForNamespaceResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/events', + ...options, + }); + +/** + * Get a list ingress controllers by namespace + * + * Get a list of ingress controllers for the given environment in the provided namespace. + * **Access policy**: Authenticated user. + */ +export const getKubernetesIngressControllersByNamespace = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesIngressControllersByNamespaceResponses, + GetKubernetesIngressControllersByNamespaceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesIngressControllersByNamespacePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesIngressControllersByNamespaceResponse.parseAsync( + data + ), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/ingresscontrollers', + ...options, + }); + +/** + * Update (block/unblock) ingress controllers by namespace + * + * Update (block/unblock) ingress controllers by namespace for the provided environment. + * **Access policy**: Authenticated user. + */ +export const updateKubernetesIngressControllersByNamespace = < + ThrowOnError extends boolean = true, +>( + options: Options< + UpdateKubernetesIngressControllersByNamespaceData, + ThrowOnError + > +) => + (options.client ?? client).put< + UpdateKubernetesIngressControllersByNamespaceResponses, + UpdateKubernetesIngressControllersByNamespaceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUpdateKubernetesIngressControllersByNamespaceBody, + path: zUpdateKubernetesIngressControllersByNamespacePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zUpdateKubernetesIngressControllersByNamespaceResponse.parseAsync( + data + ), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/ingresscontrollers', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get a list of Ingresses + * + * Get a list of Ingresses. If namespace is provided, it will return the list of Ingresses in that namespace. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesIngresses = ( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesIngressesResponses, + GetAllKubernetesIngressesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesIngressesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesIngressesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/ingresses', + ...options, + }); + +/** + * Create an Ingress + * + * Create an Ingress for the provided environment. + * **Access policy**: Authenticated user. + */ +export const createKubernetesIngress = ( + options: Options +) => + (options.client ?? client).post< + CreateKubernetesIngressResponses, + CreateKubernetesIngressErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zCreateKubernetesIngressBody, + path: zCreateKubernetesIngressPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zCreateKubernetesIngressResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/ingresses', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Update an Ingress + * + * Update an Ingress for the provided environment. + * **Access policy**: Authenticated user. + */ +export const updateKubernetesIngress = ( + options: Options +) => + (options.client ?? client).put< + UpdateKubernetesIngressResponses, + UpdateKubernetesIngressErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUpdateKubernetesIngressBody, + path: zUpdateKubernetesIngressPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zUpdateKubernetesIngressResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/ingresses', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get an Ingress by name + * + * Get an Ingress by name for the provided environment. + * **Access policy**: Authenticated user. + */ +export const getKubernetesIngress = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesIngressResponses, + GetKubernetesIngressErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesIngressPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesIngressResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/ingresses/{ingress}', + ...options, + }); + +/** + * Get PersistentVolumeClaims in a namespace + * + * Get a list of PersistentVolumeClaims in the specified namespace. + * **Access policy**: Authenticated user. + */ +export const getKubernetesPersistentVolumeClaimsInNamespace = < + ThrowOnError extends boolean = true, +>( + options: Options< + GetKubernetesPersistentVolumeClaimsInNamespaceData, + ThrowOnError + > +) => + (options.client ?? client).get< + GetKubernetesPersistentVolumeClaimsInNamespaceResponses, + GetKubernetesPersistentVolumeClaimsInNamespaceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesPersistentVolumeClaimsInNamespacePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesPersistentVolumeClaimsInNamespaceResponse.parseAsync( + data + ), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/persistent_volume_claims', + ...options, + }); + +/** + * Get a specific PersistentVolumeClaim + * + * Get a PersistentVolumeClaim by name within a namespace. + * **Access policy**: Authenticated user. + */ +export const getKubernetesPersistentVolumeClaim = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesPersistentVolumeClaimResponses, + GetKubernetesPersistentVolumeClaimErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesPersistentVolumeClaimPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesPersistentVolumeClaimResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/persistent_volume_claims/{name}', + ...options, + }); + +/** + * Delete a kubernetes pod + * + * Delete a single Kubernetes pod in the given namespace. The owning + * controller (Deployment, StatefulSet, DaemonSet, ...) is responsible + * for recreating the pod. For naked pods the pod is removed permanently. + * **Access policy**: Authenticated user. + */ +export const deleteKubernetesPod = ( + options: Options +) => + (options.client ?? client).delete< + DeleteKubernetesPodResponses, + DeleteKubernetesPodErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zDeleteKubernetesPodPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteKubernetesPodResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/pods/{name}', + ...options, + }); + +/** + * Restart all containers in a Kubernetes pod + * + * Restart all containers in a single Kubernetes pod in place using + * the Kubernetes 1.35 alpha pod-restart subresource. The pod itself + * is preserved. Requires the cluster to expose the corresponding + * subresource (and the matching feature gate to be enabled). + * **Access policy**: Authenticated user. + */ +export const restartKubernetesPod = ( + options: Options +) => + (options.client ?? client).post< + RestartKubernetesPodResponses, + RestartKubernetesPodErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zRestartKubernetesPodPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zRestartKubernetesPodResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/pods/{name}/restart', + ...options, + }); + +/** + * Get a Secret + * + * Get a Secret by name for a given namespace. + * **Access policy**: Authenticated user. + */ +export const getKubernetesSecret = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesSecretResponses, + GetKubernetesSecretErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesSecretPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesSecretResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/secrets/{secret}', + ...options, + }); + +/** + * Get a kubernetes service account + * + * Get a kubernetes service account in the given namespace. + * **Access policy**: Authenticated user. + */ +export const getKubernetesServiceAccount = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesServiceAccountResponses, + GetKubernetesServiceAccountErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesServiceAccountPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesServiceAccountResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/service_accounts/{name}', + ...options, + }); + +/** + * Update image pull secrets for a service account + * + * Replace the imagePullSecrets list on a service account with the provided list. + * **Access policy**: Authenticated user. + */ +export const updateKubernetesServiceAccountImagePullSecrets = < + ThrowOnError extends boolean = true, +>( + options: Options< + UpdateKubernetesServiceAccountImagePullSecretsData, + ThrowOnError + > +) => + (options.client ?? client).put< + UpdateKubernetesServiceAccountImagePullSecretsResponses, + UpdateKubernetesServiceAccountImagePullSecretsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUpdateKubernetesServiceAccountImagePullSecretsBody, + path: zUpdateKubernetesServiceAccountImagePullSecretsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zUpdateKubernetesServiceAccountImagePullSecretsResponse.parseAsync( + data + ), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/service_accounts/{name}/image_pull_secrets', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get a list of services for a given namespace + * + * Get a list of services for a given namespace. + * **Access policy**: Authenticated user. + */ +export const getKubernetesServicesByNamespace = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesServicesByNamespaceResponses, + GetKubernetesServicesByNamespaceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesServicesByNamespacePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesServicesByNamespaceResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/services', + ...options, + }); + +/** + * Create a service + * + * Create a service within a given namespace + * **Access policy**: Authenticated user. + */ +export const createKubernetesService = ( + options: Options +) => + (options.client ?? client).post< + CreateKubernetesServiceResponses, + CreateKubernetesServiceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zCreateKubernetesServiceBody, + path: zCreateKubernetesServicePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zCreateKubernetesServiceResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/services', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Update a service + * + * Update a service within a given namespace. + * **Access policy**: Authenticated user. + */ +export const updateKubernetesService = ( + options: Options +) => + (options.client ?? client).put< + UpdateKubernetesServiceResponses, + UpdateKubernetesServiceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUpdateKubernetesServiceBody, + path: zUpdateKubernetesServicePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zUpdateKubernetesServiceResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/services', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Toggle the system state for a namespace + * + * Toggle the system state for a namespace + * **Access policy**: Administrator or environment administrator. + */ +export const kubernetesNamespacesToggleSystem = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).put< + KubernetesNamespacesToggleSystemResponses, + KubernetesNamespacesToggleSystemErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zKubernetesNamespacesToggleSystemBody, + path: zKubernetesNamespacesToggleSystemPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zKubernetesNamespacesToggleSystemResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/system', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get Kubernetes volumes within a namespace in the given Portainer environment + * + * Get a list of kubernetes volumes within the specified namespace in the given environment (Endpoint). The Endpoint ID must be a valid Portainer environment identifier. + * **Access policy**: Authenticated user. + */ +export const getKubernetesVolumesInNamespace = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesVolumesInNamespaceResponses, + GetKubernetesVolumesInNamespaceErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesVolumesInNamespacePath, + query: zGetKubernetesVolumesInNamespaceQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesVolumesInNamespaceResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/{namespace}/volumes', + ...options, + }); + +/** + * Get the total number of kubernetes namespaces within the given Portainer environment. + * + * Get the total number of kubernetes namespaces within the given environment, including the system namespaces. The total count depends on the user's role and permissions. + * **Access policy**: Authenticated user. + */ +export const getKubernetesNamespacesCount = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesNamespacesCountResponses, + GetKubernetesNamespacesCountErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesNamespacesCountPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesNamespacesCountResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/namespaces/count', + ...options, + }); + +/** + * Drain a Kubernetes node + * + * Drain a Kubernetes node by safely evicting all pods from the node, preparing it for maintenance or removal + * **Access policy**: authenticated + */ +export const drainNode = ( + options: Options +) => + (options.client ?? client).post< + DrainNodeResponses, + DrainNodeErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zDrainNodePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDrainNodeResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/nodes/{name}/drain', + ...options, + }); + +/** + * Get CPU and memory limits of all nodes within k8s cluster + * + * Get CPU and memory limits of all nodes within k8s cluster. + * **Access policy**: Authenticated user. + */ +export const getKubernetesNodesLimits = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesNodesLimitsResponses, + GetKubernetesNodesLimitsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesNodesLimitsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesNodesLimitsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/nodes_limits', + ...options, + }); + +/** + * Get all PersistentVolumeClaims + * + * Get a list of all PersistentVolumeClaims within the given environment. Scoped by namespace for non-admin users. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesPersistentVolumeClaims = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesPersistentVolumeClaimsResponses, + GetAllKubernetesPersistentVolumeClaimsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesPersistentVolumeClaimsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesPersistentVolumeClaimsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/persistent_volume_claims', + ...options, + }); + +/** + * Delete PersistentVolumeClaims + * + * Delete the provided list of PersistentVolumeClaims. + * **Access policy**: Authenticated user. + */ +export const deleteKubernetesPersistentVolumeClaims = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).post< + DeleteKubernetesPersistentVolumeClaimsResponses, + DeleteKubernetesPersistentVolumeClaimsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteKubernetesPersistentVolumeClaimsBody, + path: zDeleteKubernetesPersistentVolumeClaimsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteKubernetesPersistentVolumeClaimsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/persistent_volume_claims/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Resize a PersistentVolumeClaim + * + * Resize a PVC to a new size. The StorageClass must support volume expansion. + * **Access policy**: Authenticated user. + */ +export const resizeKubernetesPersistentVolumeClaim = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).put< + ResizeKubernetesPersistentVolumeClaimResponses, + ResizeKubernetesPersistentVolumeClaimErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zResizeKubernetesPersistentVolumeClaimBody, + path: zResizeKubernetesPersistentVolumeClaimPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zResizeKubernetesPersistentVolumeClaimResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/persistent_volume_claims/resize', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get all PersistentVolumes in the cluster + * + * Get a list of all PersistentVolumes in the given environment. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesPersistentVolumes = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesPersistentVolumesResponses, + GetAllKubernetesPersistentVolumesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesPersistentVolumesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesPersistentVolumesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/persistent_volumes', + ...options, + }); + +/** + * Get a specific PersistentVolume + * + * Get a PersistentVolume by name in the given environment. + * **Access policy**: Authenticated user. + */ +export const getKubernetesPersistentVolume = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesPersistentVolumeResponses, + GetKubernetesPersistentVolumeErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesPersistentVolumePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesPersistentVolumeResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/persistent_volumes/{name}', + ...options, + }); + +/** + * Delete PersistentVolumes + * + * Delete the provided list of PersistentVolumes. + * **Access policy**: Authenticated user. + */ +export const deleteKubernetesPersistentVolumes = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).post< + DeleteKubernetesPersistentVolumesResponses, + DeleteKubernetesPersistentVolumesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteKubernetesPersistentVolumesBody, + path: zDeleteKubernetesPersistentVolumesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteKubernetesPersistentVolumesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/persistent_volumes/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Update reclaim policy of a PersistentVolume + * + * Update the reclaim policy of a PersistentVolume. + * **Access policy**: Authenticated user. + */ +export const updateKubernetesPersistentVolumeReclaimPolicy = < + ThrowOnError extends boolean = true, +>( + options: Options< + UpdateKubernetesPersistentVolumeReclaimPolicyData, + ThrowOnError + > +) => + (options.client ?? client).put< + UpdateKubernetesPersistentVolumeReclaimPolicyResponses, + UpdateKubernetesPersistentVolumeReclaimPolicyErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUpdateKubernetesPersistentVolumeReclaimPolicyBody, + path: zUpdateKubernetesPersistentVolumeReclaimPolicyPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zUpdateKubernetesPersistentVolumeReclaimPolicyResponse.parseAsync( + data + ), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/persistent_volumes/reclaim_policy', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Check if RBAC is enabled + * + * Check if RBAC is enabled in the specified Kubernetes cluster. + * **Access policy**: Authenticated user. + */ +export const getKubernetesRbacStatus = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesRbacStatusResponses, + GetKubernetesRbacStatusErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesRbacStatusPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesRbacStatusResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/rbac_enabled', + ...options, + }); + +/** + * Delete role bindings + * + * Delete the provided list of role bindings. + * **Access policy**: Authenticated user. + */ +export const deleteRoleBindings = ( + options: Options +) => + (options.client ?? client).post< + DeleteRoleBindingsResponses, + DeleteRoleBindingsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteRoleBindingsBody, + path: zDeleteRoleBindingsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteRoleBindingsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/role_bindings/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get a list of kubernetes role bindings + * + * Get a list of kubernetes role bindings that the user has access to. + * **Access policy**: Authenticated user. + */ +export const getKubernetesRoleBindings = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesRoleBindingsResponses, + GetKubernetesRoleBindingsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesRoleBindingsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesRoleBindingsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/rolebindings', + ...options, + }); + +/** + * Get a list of kubernetes roles + * + * Get a list of kubernetes roles that the user has access to. + * **Access policy**: Authenticated user. + */ +export const getKubernetesRoles = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesRolesResponses, + GetKubernetesRolesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesRolesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesRolesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/roles', + ...options, + }); + +/** + * Delete roles + * + * Delete the provided list of roles. + * **Access policy**: Authenticated user. + */ +export const deleteRoles = ( + options: Options +) => + (options.client ?? client).post< + DeleteRolesResponses, + DeleteRolesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteRolesBody, + path: zDeleteRolesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteRolesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/roles/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get a list of Secrets + * + * Get a list of Secrets for a given namespace. If isUsed is set to true, information about the applications that use the secrets is also returned. + * **Access policy**: Authenticated user. + */ +export const getKubernetesSecrets = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesSecretsResponses, + GetKubernetesSecretsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesSecretsPath, + query: zGetKubernetesSecretsQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesSecretsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/secrets', + ...options, + }); + +/** + * Get Secrets count + * + * Get the count of Secrets across all namespaces that the user has access to. + * **Access policy**: Authenticated user. + */ +export const getKubernetesSecretsCount = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesSecretsCountResponses, + GetKubernetesSecretsCountErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesSecretsCountPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesSecretsCountResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/secrets/count', + ...options, + }); + +/** + * Delete service accounts + * + * Delete the provided list of service accounts. + * **Access policy**: Authenticated user. + */ +export const deleteServiceAccounts = ( + options: Options +) => + (options.client ?? client).post< + DeleteServiceAccountsResponses, + DeleteServiceAccountsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteServiceAccountsBody, + path: zDeleteServiceAccountsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteServiceAccountsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/service_accounts/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get a list of kubernetes service accounts + * + * Get a list of kubernetes service accounts that the user has access to. + * **Access policy**: Authenticated user. + */ +export const getKubernetesServiceAccounts = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetKubernetesServiceAccountsResponses, + GetKubernetesServiceAccountsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesServiceAccountsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesServiceAccountsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/serviceaccounts', + ...options, + }); + +/** + * Get a list of services + * + * Get a list of services that the user has access to. + * **Access policy**: Authenticated user. + */ +export const getKubernetesServices = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesServicesResponses, + GetKubernetesServicesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesServicesPath, + query: zGetKubernetesServicesQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesServicesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/services', + ...options, + }); + +/** + * Get services count + * + * Get the count of services that the user has access to. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesServicesCount = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesServicesCountResponses, + GetAllKubernetesServicesCountErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesServicesCountPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesServicesCountResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/services/count', + ...options, + }); + +/** + * Delete services + * + * Delete the provided list of services. + * **Access policy**: Authenticated user. + */ +export const deleteKubernetesServices = ( + options: Options +) => + (options.client ?? client).post< + DeleteKubernetesServicesResponses, + DeleteKubernetesServicesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteKubernetesServicesBody, + path: zDeleteKubernetesServicesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteKubernetesServicesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/services/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get all StorageClasses + * + * Get a list of all StorageClasses in the given environment. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesStorageClasses = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesStorageClassesResponses, + GetAllKubernetesStorageClassesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesStorageClassesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesStorageClassesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/storage_classes', + ...options, + }); + +/** + * Get a specific StorageClass + * + * Get a StorageClass by name in the given environment. + * **Access policy**: Authenticated user. + */ +export const getKubernetesStorageClass = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesStorageClassResponses, + GetKubernetesStorageClassErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesStorageClassPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesStorageClassResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/storage_classes/{name}', + ...options, + }); + +/** + * Set a StorageClass as default + * + * Set the specified StorageClass as the cluster default, removing default from any other. + * **Access policy**: Authenticated user. + */ +export const setDefaultKubernetesStorageClass = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).put< + SetDefaultKubernetesStorageClassResponses, + SetDefaultKubernetesStorageClassErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zSetDefaultKubernetesStorageClassPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zSetDefaultKubernetesStorageClassResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/storage_classes/{name}/default', + ...options, + }); + +/** + * Delete StorageClasses + * + * Delete the provided list of StorageClasses. + * **Access policy**: Authenticated user. + */ +export const deleteKubernetesStorageClasses = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).post< + DeleteKubernetesStorageClassesResponses, + DeleteKubernetesStorageClassesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zDeleteKubernetesStorageClassesBody, + path: zDeleteKubernetesStorageClassesPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zDeleteKubernetesStorageClassesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/storage_classes/delete', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get the Kubernetes cluster version and Portainer-relevant capabilities + * + * Get the Kubernetes cluster version (major, minor, gitVersion, ...) + * as reported by the cluster's discovery API, augmented with capability + * flags Portainer uses to gate UI features (e.g. supportsPodRestart). + * **Access policy**: Authenticated user. + */ +export const getKubernetesVersion = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesVersionResponses, + GetKubernetesVersionErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesVersionPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesVersionResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/version', + ...options, + }); + +/** + * Get Kubernetes volumes within the given Portainer environment + * + * Get a list of all kubernetes volumes within the given environment (Endpoint). The Endpoint ID must be a valid Portainer environment identifier. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesVolumes = ( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesVolumesResponses, + GetAllKubernetesVolumesErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesVolumesPath, + query: zGetAllKubernetesVolumesQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesVolumesResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/volumes', + ...options, + }); + +/** + * Get a Kubernetes volume within the given Portainer environment + * + * Get a Kubernetes volume within the given environment (Endpoint). The Endpoint ID must be a valid Portainer environment identifier. + * **Access policy**: Authenticated user. + */ +export const getKubernetesVolume = ( + options: Options +) => + (options.client ?? client).get< + GetKubernetesVolumeResponses, + GetKubernetesVolumeErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetKubernetesVolumePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetKubernetesVolumeResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/volumes/{namespace}/{volume}', + ...options, + }); + +/** + * Get the total number of kubernetes volumes within the given Portainer environment. + * + * Get the total number of kubernetes volumes within the given environment (Endpoint). The total count depends on the user's role and permissions. The Endpoint ID must be a valid Portainer environment identifier. + * **Access policy**: Authenticated user. + */ +export const getAllKubernetesVolumesCount = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetAllKubernetesVolumesCountResponses, + GetAllKubernetesVolumesCountErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zGetAllKubernetesVolumesCountPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetAllKubernetesVolumesCountResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/{id}/volumes/count', + ...options, + }); + +/** + * Generate a kubeconfig file + * + * Generate a kubeconfig file that allows a client to communicate with the Kubernetes API server + * **Access policy**: Authenticated user. + */ +export const getKubernetesConfig = ( + options?: Options +) => + (options?.client ?? client).get< + GetKubernetesConfigResponses, + GetKubernetesConfigErrors, + ThrowOnError + >({ + querySerializer: { + parameters: { + ids: { array: { explode: false } }, + excludeIds: { array: { explode: false } }, + }, + }, + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zGetKubernetesConfigQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/kubernetes/config', + ...options, + }); + +/** + * Test LDAP connectivity + * + * Test LDAP connectivity using LDAP details + * **Access policy**: administrator + */ +export const ldapCheck = ( + options: Options +) => + (options.client ?? client).post< + LdapCheckResponses, + LdapCheckErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zLdapCheckBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zLdapCheckResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/ldap/check', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * fetches the message of the day + * + * **Access policy**: restricted + */ +export const motd = ( + options?: Options +) => + (options?.client ?? client).get({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => await zMotdResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/motd', + ...options, + }); + +/** + * List Registries + * + * List all registries based on the current user authorizations. + * Will return all registries if using an administrator account otherwise it + * will only return authorized registries. + * **Access policy**: restricted + */ +export const registryList = ( + options?: Options +) => + (options?.client ?? client).get< + RegistryListResponses, + RegistryListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zRegistryListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/registries', + ...options, + }); + +/** + * Create a new registry + * + * Create a new registry. + * **Access policy**: restricted + */ +export const registryCreate = ( + options: Options +) => + (options.client ?? client).post< + RegistryCreateResponses, + RegistryCreateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zRegistryCreateBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zRegistryCreateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/registries', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Remove a registry + * + * Remove a registry + * **Access policy**: restricted + */ +export const registryDelete = ( + options: Options +) => + (options.client ?? client).delete< + RegistryDeleteResponses, + RegistryDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zRegistryDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zRegistryDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/registries/{id}', + ...options, + }); + +/** + * Inspect a registry + * + * Retrieve details about a registry. + * **Access policy**: restricted + */ +export const registryInspect = ( + options: Options +) => + (options.client ?? client).get< + RegistryInspectResponses, + RegistryInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zRegistryInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zRegistryInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/registries/{id}', + ...options, + }); + +/** + * Update a registry + * + * Update a registry + * **Access policy**: restricted + */ +export const registryUpdate = ( + options: Options +) => + (options.client ?? client).put< + RegistryUpdateResponses, + RegistryUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zRegistryUpdateBody, + path: zRegistryUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zRegistryUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/registries/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Configures a registry + * + * Configures a registry. + * **Access policy**: restricted + */ +export const registryConfigure = ( + options: Options +) => + (options.client ?? client).post< + RegistryConfigureResponses, + RegistryConfigureErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zRegistryConfigureBody, + path: zRegistryConfigurePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zRegistryConfigureResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/registries/{id}/configure', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Test registry connection + * + * Test connection to a registry with provided credentials + * **Access policy**: authenticated + */ +export const registryPing = ( + options: Options +) => + (options.client ?? client).post< + RegistryPingResponses, + RegistryPingErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zRegistryPingBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zRegistryPingResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/registries/ping', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Create a new resource control + * + * Create a new resource control to restrict access to a Docker resource. + * **Access policy**: administrator + */ +export const resourceControlCreate = ( + options: Options +) => + (options.client ?? client).post< + ResourceControlCreateResponses, + ResourceControlCreateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zResourceControlCreateBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zResourceControlCreateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/resource_controls', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Remove a resource control + * + * Remove a resource control. + * **Access policy**: administrator + */ +export const resourceControlDelete = ( + options: Options +) => + (options.client ?? client).delete< + ResourceControlDeleteResponses, + ResourceControlDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zResourceControlDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zResourceControlDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/resource_controls/{id}', + ...options, + }); + +/** + * Update a resource control + * + * Update a resource control + * **Access policy**: authenticated + */ +export const resourceControlUpdate = ( + options: Options +) => + (options.client ?? client).put< + ResourceControlUpdateResponses, + ResourceControlUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zResourceControlUpdateBody, + path: zResourceControlUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zResourceControlUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/resource_controls/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Triggers a system restore using provided backup file + * + * Triggers a system restore using provided backup file + * **Access policy**: public + */ +export const restore = ( + options: Options +) => + (options.client ?? client).post< + RestoreResponses, + RestoreErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zRestoreBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + url: '/restore', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * List roles + * + * List all roles available for use + * **Access policy**: administrator + */ +export const roleList = ( + options?: Options +) => + (options?.client ?? client).get< + RoleListResponses, + RoleListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => await zRoleListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/roles', + ...options, + }); + +/** + * Retrieve Portainer settings + * + * Retrieve Portainer settings. + * **Access policy**: administrator + */ +export const settingsInspect = ( + options?: Options +) => + (options?.client ?? client).get< + SettingsInspectResponses, + SettingsInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zSettingsInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/settings', + ...options, + }); + +/** + * Update Portainer settings + * + * Update Portainer settings. + * **Access policy**: administrator + */ +export const settingsUpdate = ( + options: Options +) => + (options.client ?? client).put< + SettingsUpdateResponses, + SettingsUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zSettingsUpdateBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zSettingsUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/settings', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Retrieve Portainer public settings + * + * Retrieve public settings. Returns a small set of settings that are not reserved to administrators only. + * **Access policy**: public + */ +export const settingsPublic = ( + options?: Options +) => + (options?.client ?? client).get< + SettingsPublicResponses, + SettingsPublicErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zSettingsPublicResponse.parseAsync(data), + url: '/settings/public', + ...options, + }); + +/** + * Inspect the ssl settings + * + * Retrieve the ssl settings. + * **Access policy**: administrator + */ +export const sslInspect = ( + options?: Options +) => + (options?.client ?? client).get< + SslInspectResponses, + SslInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zSslInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/ssl', + ...options, + }); + +/** + * Update the ssl settings + * + * Update the ssl settings. + * **Access policy**: administrator + */ +export const sslUpdate = ( + options: Options +) => + (options.client ?? client).put< + SslUpdateResponses, + SslUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zSslUpdateBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zSslUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/ssl', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * List stacks + * + * List all stacks based on the current user authorizations. + * Will return all stacks if using an administrator account otherwise it + * will only return the list of stacks the user have access to. + * Limited stacks will not be returned by this endpoint. + * **Access policy**: authenticated + */ +export const stackList = ( + options?: Options +) => + (options?.client ?? client).get< + StackListResponses, + StackListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zStackListQuery.optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zStackListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks', + ...options, + }); + +/** + * Remove a stack + * + * Remove a stack. + * **Access policy**: restricted + */ +export const stackDelete = ( + options: Options +) => + (options.client ?? client).delete< + StackDeleteResponses, + StackDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zStackDeletePath, + query: zStackDeleteQuery, + }) + .parseAsync(data), + responseValidator: async (data) => + await zStackDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/{id}', + ...options, + }); + +/** + * Inspect a stack + * + * Retrieve details about a stack. + * **Access policy**: restricted + */ +export const stackInspect = ( + options: Options +) => + (options.client ?? client).get< + StackInspectResponses, + StackInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zStackInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/{id}', + ...options, + }); + +/** + * Update a stack + * + * Update a stack, only for file based stacks. + * **Access policy**: authenticated + */ +export const stackUpdate = ( + options: Options +) => + (options.client ?? client).put< + StackUpdateResponses, + StackUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zStackUpdateBody, + path: zStackUpdatePath, + query: zStackUpdateQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Associate an orphaned stack to a new environment(endpoint) + * + * **Access policy**: administrator + */ +export const stackAssociate = ( + options: Options +) => + (options.client ?? client).put< + StackAssociateResponses, + StackAssociateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zStackAssociatePath, + query: zStackAssociateQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackAssociateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/{id}/associate', + ...options, + }); + +/** + * Retrieve the content of the Stack file for the specified stack + * + * Get Stack file content. + * **Access policy**: restricted + */ +export const stackFileInspect = ( + options: Options +) => + (options.client ?? client).get< + StackFileInspectResponses, + StackFileInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zStackFileInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackFileInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/{id}/file', + ...options, + }); + +/** + * Update a stack's Git configs + * + * Update the Git settings in a stack, e.g., RepositoryReferenceName and AutoUpdate + * **Access policy**: authenticated + */ +export const stackUpdateGit = ( + options: Options +) => + (options.client ?? client).post< + StackUpdateGitResponses, + StackUpdateGitErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zStackUpdateGitBody, + path: zStackUpdateGitPath, + query: zStackUpdateGitQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackUpdateGitResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/{id}/git', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Redeploy a stack + * + * Pull and redeploy a stack via Git + * **Access policy**: authenticated + */ +export const stackGitRedeploy = ( + options: Options +) => + (options.client ?? client).put< + StackGitRedeployResponses, + StackGitRedeployErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zStackGitRedeployBody, + path: zStackGitRedeployPath, + query: zStackGitRedeployQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackGitRedeployResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/{id}/git/redeploy', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Migrate a stack to another environment(endpoint) + * + * Migrate a stack from an environment(endpoint) to another environment(endpoint). It will re-create the stack inside the target environment(endpoint) before removing the original stack. + * **Access policy**: authenticated + */ +export const stackMigrate = ( + options: Options +) => + (options.client ?? client).post< + StackMigrateResponses, + StackMigrateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zStackMigrateBody, + path: zStackMigratePath, + query: zStackMigrateQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackMigrateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/{id}/migrate', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Starts a stopped Stack + * + * Starts a stopped Stack. + * **Access policy**: authenticated + */ +export const stackStart = ( + options: Options +) => + (options.client ?? client).post< + StackStartResponses, + StackStartErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zStackStartPath, + query: zStackStartQuery, + }) + .parseAsync(data), + responseValidator: async (data) => + await zStackStartResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/{id}/start', + ...options, + }); + +/** + * Stops a stopped Stack + * + * Stops a stopped Stack. + * **Access policy**: authenticated + */ +export const stackStop = ( + options: Options +) => + (options.client ?? client).post< + StackStopResponses, + StackStopErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zStackStopPath, + query: zStackStopQuery, + }) + .parseAsync(data), + responseValidator: async (data) => + await zStackStopResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/{id}/stop', + ...options, + }); + +/** + * Deploy a new kubernetes stack from a git repository + * + * Deploy a new stack into a Docker environment specified via the environment identifier. + * **Access policy**: authenticated + */ +export const stackCreateKubernetesGit = ( + options: Options +) => + (options.client ?? client).post< + StackCreateKubernetesGitResponses, + StackCreateKubernetesGitErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zStackCreateKubernetesGitBody, + path: z.never().optional(), + query: zStackCreateKubernetesGitQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackCreateKubernetesGitResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/create/kubernetes/repository', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Deploy a new kubernetes stack from a file + * + * Deploy a new stack into a Docker environment specified via the environment identifier. + * **Access policy**: authenticated + */ +export const stackCreateKubernetesFile = ( + options: Options +) => + (options.client ?? client).post< + StackCreateKubernetesFileResponses, + StackCreateKubernetesFileErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zStackCreateKubernetesFileBody, + path: z.never().optional(), + query: zStackCreateKubernetesFileQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackCreateKubernetesFileResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/create/kubernetes/string', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Deploy a new kubernetes stack from a url + * + * Deploy a new stack into a Docker environment specified via the environment identifier. + * **Access policy**: authenticated + */ +export const stackCreateKubernetesUrl = ( + options: Options +) => + (options.client ?? client).post< + StackCreateKubernetesUrlResponses, + StackCreateKubernetesUrlErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zStackCreateKubernetesUrlBody, + path: z.never().optional(), + query: zStackCreateKubernetesUrlQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackCreateKubernetesUrlResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/create/kubernetes/url', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Deploy a new compose stack from a file + * + * Deploy a new stack into a Docker environment specified via the environment identifier. + * **Access policy**: authenticated + */ +export const stackCreateDockerStandaloneFile = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).post< + StackCreateDockerStandaloneFileResponses, + StackCreateDockerStandaloneFileErrors, + ThrowOnError + >({ + ...formDataBodySerializer, + requestValidator: async (data) => + await z + .object({ + body: zStackCreateDockerStandaloneFileBody, + path: z.never().optional(), + query: zStackCreateDockerStandaloneFileQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackCreateDockerStandaloneFileResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/create/standalone/file', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + +/** + * Deploy a new compose stack from repository + * + * Deploy a new stack into a Docker environment specified via the environment identifier. + * **Access policy**: authenticated + */ +export const stackCreateDockerStandaloneRepository = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).post< + StackCreateDockerStandaloneRepositoryResponses, + StackCreateDockerStandaloneRepositoryErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zStackCreateDockerStandaloneRepositoryBody, + path: z.never().optional(), + query: zStackCreateDockerStandaloneRepositoryQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackCreateDockerStandaloneRepositoryResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/create/standalone/repository', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Deploy a new compose stack from a text + * + * Deploy a new stack into a Docker environment specified via the environment identifier. + * **Access policy**: authenticated + */ +export const stackCreateDockerStandaloneString = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).post< + StackCreateDockerStandaloneStringResponses, + StackCreateDockerStandaloneStringErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zStackCreateDockerStandaloneStringBody, + path: z.never().optional(), + query: zStackCreateDockerStandaloneStringQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackCreateDockerStandaloneStringResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/create/standalone/string', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Deploy a new swarm stack from a file + * + * Deploy a new stack into a Docker environment specified via the environment identifier. + * **Access policy**: authenticated + */ +export const stackCreateDockerSwarmFile = ( + options: Options +) => + (options.client ?? client).post< + StackCreateDockerSwarmFileResponses, + StackCreateDockerSwarmFileErrors, + ThrowOnError + >({ + ...formDataBodySerializer, + requestValidator: async (data) => + await z + .object({ + body: zStackCreateDockerSwarmFileBody.optional(), + path: z.never().optional(), + query: zStackCreateDockerSwarmFileQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackCreateDockerSwarmFileResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/create/swarm/file', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + +/** + * Deploy a new swarm stack from a git repository + * + * Deploy a new stack into a Docker environment specified via the environment identifier. + * **Access policy**: authenticated + */ +export const stackCreateDockerSwarmRepository = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).post< + StackCreateDockerSwarmRepositoryResponses, + StackCreateDockerSwarmRepositoryErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zStackCreateDockerSwarmRepositoryBody, + path: z.never().optional(), + query: zStackCreateDockerSwarmRepositoryQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackCreateDockerSwarmRepositoryResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/create/swarm/repository', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Deploy a new swarm stack from a text + * + * Deploy a new stack into a Docker environment specified via the environment identifier. + * **Access policy**: authenticated + */ +export const stackCreateDockerSwarmString = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).post< + StackCreateDockerSwarmStringResponses, + StackCreateDockerSwarmStringErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zStackCreateDockerSwarmStringBody, + path: z.never().optional(), + query: zStackCreateDockerSwarmStringQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zStackCreateDockerSwarmStringResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/create/swarm/string', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Remove Kubernetes stacks by name + * + * Remove a stack. + * **Access policy**: restricted + */ +export const stackDeleteKubernetesByName = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).delete< + StackDeleteKubernetesByNameResponses, + StackDeleteKubernetesByNameErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zStackDeleteKubernetesByNamePath, + query: zStackDeleteKubernetesByNameQuery, + }) + .parseAsync(data), + responseValidator: async (data) => + await zStackDeleteKubernetesByNameResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/stacks/name/{name}', + ...options, + }); + +/** + * Webhook for triggering stack updates from git + * + * **Access policy**: public + */ +export const webhookInvoke = ( + options: Options +) => + (options.client ?? client).post< + WebhookInvokeResponses, + WebhookInvokeErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zWebhookInvokePath, + query: z.never().optional(), + }) + .parseAsync(data), + url: '/stacks/webhooks/{webhookID}', + ...options, + }); + +/** + * Retrieve system info + * + * **Access policy**: authenticated + */ +export const systemInfo = ( + options?: Options +) => + (options?.client ?? client).get< + SystemInfoResponses, + SystemInfoErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zSystemInfoResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/system/info', + ...options, + }); + +/** + * Retrieve the count of nodes + * + * **Access policy**: authenticated + */ +export const systemNodesCount = ( + options?: Options +) => + (options?.client ?? client).get< + SystemNodesCountResponses, + SystemNodesCountErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zSystemNodesCountResponse2.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/system/nodes', + ...options, + }); + +/** + * Check Portainer status + * + * Retrieve Portainer status + * **Access policy**: public + */ +export const systemStatus = ( + options?: Options +) => + (options?.client ?? client).get( + { + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zSystemStatusResponse.parseAsync(data), + url: '/system/status', + ...options, + } + ); + +/** + * Upgrade Portainer to BE + * + * Upgrade Portainer to BE + * **Access policy**: administrator + */ +export const systemUpgrade = ( + options?: Options +) => + (options?.client ?? client).post< + SystemUpgradeResponses, + unknown, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zSystemUpgradeResponse.parseAsync(data), + url: '/system/upgrade', + ...options, + }); + +/** + * Check for portainer updates + * + * Check if portainer has an update available + * **Access policy**: authenticated + */ +export const systemVersion = ( + options?: Options +) => + (options?.client ?? client).get< + SystemVersionResponses, + unknown, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zSystemVersionResponse2.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/system/version', + ...options, + }); + +/** + * List tags + * + * List tags. + * **Access policy**: authenticated + */ +export const tagList = ( + options?: Options +) => + (options?.client ?? client).get< + TagListResponses, + TagListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => await zTagListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/tags', + ...options, + }); + +/** + * Create a new tag + * + * Create a new tag. + * **Access policy**: administrator + */ +export const tagCreate = ( + options: Options +) => + (options.client ?? client).post< + TagCreateResponses, + TagCreateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zTagCreateBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zTagCreateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/tags', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Remove a tag + * + * Remove a tag. + * **Access policy**: administrator + */ +export const tagDelete = ( + options: Options +) => + (options.client ?? client).delete< + TagDeleteResponses, + TagDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zTagDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zTagDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/tags/{id}', + ...options, + }); + +/** + * List team memberships + * + * List team memberships. Access is only available to administrators and team leaders. + * **Access policy**: administrator + */ +export const teamMembershipList = ( + options?: Options +) => + (options?.client ?? client).get< + TeamMembershipListResponses, + TeamMembershipListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zTeamMembershipListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/team_memberships', + ...options, + }); + +/** + * Create a new team membership + * + * Create a new team memberships. Access is only available to administrators leaders of the associated team. + * **Access policy**: administrator + */ +export const teamMembershipCreate = ( + options: Options +) => + (options.client ?? client).post< + TeamMembershipCreateResponses, + TeamMembershipCreateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zTeamMembershipCreateBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zTeamMembershipCreateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/team_memberships', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Remove a team membership + * + * Remove a team membership. Access is only available to administrators leaders of the associated team. + * **Access policy**: administrator + */ +export const teamMembershipDelete = ( + options: Options +) => + (options.client ?? client).delete< + TeamMembershipDeleteResponses, + TeamMembershipDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zTeamMembershipDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zTeamMembershipDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/team_memberships/{id}', + ...options, + }); + +/** + * Update a team membership + * + * Update a team membership. Access is only available to administrators or leaders of the associated team. + * **Access policy**: administrator or leaders of the associated team + */ +export const teamMembershipUpdate = ( + options: Options +) => + (options.client ?? client).put< + TeamMembershipUpdateResponses, + TeamMembershipUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zTeamMembershipUpdateBody, + path: zTeamMembershipUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zTeamMembershipUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/team_memberships/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * List teams + * + * List teams. For non-administrator users, will only list the teams they are member of. + * **Access policy**: restricted + */ +export const teamList = ( + options?: Options +) => + (options?.client ?? client).get< + TeamListResponses, + TeamListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zTeamListQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => await zTeamListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/teams', + ...options, + }); + +/** + * Create a new team + * + * Create a new team. + * **Access policy**: administrator + */ +export const teamCreate = ( + options: Options +) => + (options.client ?? client).post< + TeamCreateResponses, + TeamCreateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zTeamCreateBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zTeamCreateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/teams', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Remove a team + * + * Remove a team. + * **Access policy**: administrator + */ +export const teamDelete = ( + options: Options +) => + (options.client ?? client).delete< + TeamDeleteResponses, + TeamDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zTeamDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zTeamDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/teams/{id}', + ...options, + }); + +/** + * Inspect a team + * + * Retrieve details about a team. Access is only available for administrator and leaders of that team. + * **Access policy**: administrator + */ +export const teamInspect = ( + options: Options +) => + (options.client ?? client).get< + TeamInspectResponses, + TeamInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zTeamInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zTeamInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/teams/{id}', + ...options, + }); + +/** + * Update a team + * + * Update a team. + * **Access policy**: administrator + */ +export const teamUpdate = ( + options: Options +) => + (options.client ?? client).put< + TeamUpdateResponses, + TeamUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zTeamUpdateBody, + path: zTeamUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zTeamUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/teams/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * List team memberships + * + * List team memberships. Access is only available to administrators and team leaders. + * **Access policy**: restricted + */ +export const teamMemberships = ( + options: Options +) => + (options.client ?? client).get< + TeamMembershipsResponses, + TeamMembershipsErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zTeamMembershipsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zTeamMembershipsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/teams/{id}/memberships', + ...options, + }); + +/** + * List available templates + * + * List available templates. + * **Access policy**: authenticated + */ +export const templateList = ( + options?: Options +) => + (options?.client ?? client).get< + TemplateListResponses, + TemplateListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zTemplateListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/templates', + ...options, + }); + +/** + * Get a template's file + * + * Get a template's file + * **Access policy**: authenticated + */ +export const templateFile = ( + options: Options +) => + (options.client ?? client).post< + TemplateFileResponses, + TemplateFileErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zTemplateFilePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zTemplateFileResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/templates/{id}/file', + ...options, + }); + +/** + * Search Helm Charts + * + * **Access policy**: authenticated + */ +export const helmRepoSearch = ( + options: Options +) => + (options.client ?? client).get< + HelmRepoSearchResponses, + HelmRepoSearchErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zHelmRepoSearchQuery, + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zHelmRepoSearchResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/templates/helm', + ...options, + }); + +/** + * Show Helm Chart Information + * + * **Access policy**: authenticated + */ +export const helmShow = ( + options: Options +) => + (options.client ?? client).get< + HelmShowResponses, + HelmShowErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zHelmShowPath, + query: zHelmShowQuery, + }) + .parseAsync(data), + responseType: 'text', + responseValidator: async (data) => await zHelmShowResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/templates/helm/{command}', + ...options, + }); + +/** + * Upload TLS files + * + * Use this environment(endpoint) to upload TLS files. + * **Access policy**: administrator + */ +export const uploadTls = ( + options: Options +) => + (options.client ?? client).post< + UploadTlsResponses, + UploadTlsErrors, + ThrowOnError + >({ + ...formDataBodySerializer, + requestValidator: async (data) => + await z + .object({ + body: zUploadTlsBody, + path: zUploadTlsPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zUploadTlsResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/upload/tls/{certificate}', + ...options, + headers: { + 'Content-Type': null, + ...options.headers, + }, + }); + +/** + * List users + * + * List Portainer users. + * Non-administrator users will only be able to list other non-administrator user accounts. + * User passwords are filtered out, and should never be accessible. + * **Access policy**: restricted + */ +export const userList = ( + options?: Options +) => + (options?.client ?? client).get< + UserListResponses, + UserListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zUserListQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => await zUserListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users', + ...options, + }); + +/** + * Create a new user + * + * Create a new Portainer user. + * Only administrators can create users. + * **Access policy**: restricted + */ +export const userCreate = ( + options: Options +) => + (options.client ?? client).post< + UserCreateResponses, + UserCreateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUserCreateBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zUserCreateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Remove a user + * + * Remove a user. + * **Access policy**: administrator + */ +export const userDelete = ( + options: Options +) => + (options.client ?? client).delete< + UserDeleteResponses, + UserDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zUserDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zUserDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/{id}', + ...options, + }); + +/** + * Inspect a user + * + * Retrieve details about a user. + * User passwords are filtered out, and should never be accessible. + * **Access policy**: authenticated + */ +export const userInspect = ( + options: Options +) => + (options.client ?? client).get< + UserInspectResponses, + UserInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zUserInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zUserInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/{id}', + ...options, + }); + +/** + * Update a user + * + * Update user details. A regular user account can only update his details. + * A regular user account cannot change their username or role. + * **Access policy**: authenticated + */ +export const userUpdate = ( + options: Options +) => + (options.client ?? client).put< + UserUpdateResponses, + UserUpdateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUserUpdateBody, + path: zUserUpdatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zUserUpdateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Inspect a user's effective access on every environment + * + * Returns the resolved role for each environment the user can access, + * following the policy precedence used by the access viewer + * (user-endpoint, user-group, team-endpoint, team-group). + * Environments where the user has no role are omitted. + * **Access policy**: restricted + */ +export const userEffectiveAccessInspect = ( + options: Options +) => + (options.client ?? client).get< + UserEffectiveAccessInspectResponses, + UserEffectiveAccessInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zUserEffectiveAccessInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zUserEffectiveAccessInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/{id}/effective-access', + ...options, + }); + +/** + * List a users helm repositories + * + * Inspect a user helm repositories. + * **Access policy**: authenticated + */ +export const helmUserRepositoriesList = ( + options: Options +) => + (options.client ?? client).get< + HelmUserRepositoriesListResponses, + HelmUserRepositoriesListErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zHelmUserRepositoriesListPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zHelmUserRepositoriesListResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/{id}/helm/repositories', + ...options, + }); + +/** + * Create a user helm repository + * + * Create a user helm repository. + * **Access policy**: authenticated + */ +export const helmUserRepositoryCreate = ( + options: Options +) => + (options.client ?? client).post< + HelmUserRepositoryCreateResponses, + HelmUserRepositoryCreateErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zHelmUserRepositoryCreateBody, + path: zHelmUserRepositoryCreatePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zHelmUserRepositoryCreateResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/{id}/helm/repositories', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Delete a users helm repositoryies + * + * **Access policy**: authenticated + */ +export const helmUserRepositoryDelete = ( + options: Options +) => + (options.client ?? client).delete< + HelmUserRepositoryDeleteResponses, + HelmUserRepositoryDeleteErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zHelmUserRepositoryDeletePath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zHelmUserRepositoryDeleteResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/{id}/helm/repositories/{repositoryID}', + ...options, + }); + +/** + * Inspect a user memberships + * + * Inspect a user memberships. + * **Access policy**: restricted + */ +export const userMembershipsInspect = ( + options: Options +) => + (options.client ?? client).get< + UserMembershipsInspectResponses, + UserMembershipsInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zUserMembershipsInspectPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zUserMembershipsInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/{id}/memberships', + ...options, + }); + +/** + * Update password for a user + * + * Update password for the specified user. + * **Access policy**: authenticated + */ +export const userUpdatePassword = ( + options: Options +) => + (options.client ?? client).put< + UserUpdatePasswordResponses, + UserUpdatePasswordErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUserUpdatePasswordBody, + path: zUserUpdatePasswordPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zUserUpdatePasswordResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/{id}/passwd', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Get all API keys for a user + * + * Gets all API keys for a user. + * Only the calling user or admin can retrieve api-keys. + * **Access policy**: authenticated + */ +export const userGetApiKeys = ( + options: Options +) => + (options.client ?? client).get< + UserGetApiKeysResponses, + UserGetApiKeysErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zUserGetApiKeysPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zUserGetApiKeysResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/{id}/tokens', + ...options, + }); + +/** + * Generate an API key for a user + * + * Generates an API key for a user. + * Only the calling user can generate a token for themselves. + * Password is required only for internal authentication. + * **Access policy**: restricted + */ +export const userGenerateApiKey = ( + options: Options +) => + (options.client ?? client).post< + UserGenerateApiKeyResponses, + UserGenerateApiKeyErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUserGenerateApiKeyBody, + path: zUserGenerateApiKeyPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zUserGenerateApiKeyResponse.parseAsync(data), + security: [{ name: 'Authorization', type: 'apiKey' }], + url: '/users/{id}/tokens', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Remove an api-key associated to a user + * + * Remove an api-key associated to a user.. + * Only the calling user or admin can remove api-key. + * **Access policy**: authenticated + */ +export const userRemoveApiKey = ( + options: Options +) => + (options.client ?? client).delete< + UserRemoveApiKeyResponses, + UserRemoveApiKeyErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zUserRemoveApiKeyPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zUserRemoveApiKeyResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/{id}/tokens/{keyID}', + ...options, + }); + +/** + * Check administrator account existence + * + * Check if an administrator account exists in the database. + * **Access policy**: public + */ +export const userAdminCheck = ( + options?: Options +) => + (options?.client ?? client).get< + UserAdminCheckResponses, + UserAdminCheckErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseValidator: async (data) => + await zUserAdminCheckResponse.parseAsync(data), + url: '/users/admin/check', + ...options, + }); + +/** + * Initialize administrator account + * + * Initialize the 'admin' user account. + * **Access policy**: public + */ +export const userAdminInit = ( + options: Options +) => + (options.client ?? client).post< + UserAdminInitResponses, + UserAdminInitErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zUserAdminInitBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zUserAdminInitResponse.parseAsync(data), + url: '/users/admin/init', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Inspect the current user user + * + * Retrieve details about the current user. + * User passwords are filtered out, and should never be accessible. + * **Access policy**: authenticated + */ +export const currentUserInspect = ( + options?: Options +) => + (options?.client ?? client).get< + CurrentUserInspectResponses, + CurrentUserInspectErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zCurrentUserInspectResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/users/me', + ...options, + }); + +/** + * List webhooks + * + * **Access policy**: authenticated + */ +export const getWebhooks = ( + options?: Options +) => + (options?.client ?? client).get< + GetWebhooksResponses, + GetWebhooksErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zGetWebhooksQuery.optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zGetWebhooksResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/webhooks', + ...options, + }); + +/** + * Create a webhook + * + * **Access policy**: authenticated + */ +export const postWebhooks = ( + options: Options +) => + (options.client ?? client).post< + PostWebhooksResponses, + PostWebhooksErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zPostWebhooksBody, + path: z.never().optional(), + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zPostWebhooksResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/webhooks', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Delete a webhook + * + * **Access policy**: authenticated + */ +export const deleteWebhooksById = ( + options: Options +) => + (options.client ?? client).delete< + DeleteWebhooksByIdResponses, + DeleteWebhooksByIdErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zDeleteWebhooksByIdPath, + query: z.never().optional(), + }) + .parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/webhooks/{id}', + ...options, + }); + +/** + * Execute a webhook + * + * Acts on a passed in token UUID to restart the docker service + * **Access policy**: public + */ +export const postWebhooksById = ( + options: Options +) => + (options.client ?? client).post< + PostWebhooksByIdResponses, + PostWebhooksByIdErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: zPostWebhooksByIdPath, + query: z.never().optional(), + }) + .parseAsync(data), + url: '/webhooks/{id}', + ...options, + }); + +/** + * Update a webhook + * + * **Access policy**: authenticated + */ +export const putWebhooksById = ( + options: Options +) => + (options.client ?? client).put< + PutWebhooksByIdResponses, + PutWebhooksByIdErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: zPutWebhooksByIdBody, + path: zPutWebhooksByIdPath, + query: z.never().optional(), + }) + .parseAsync(data), + responseType: 'json', + responseValidator: async (data) => + await zPutWebhooksByIdResponse.parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/webhooks/{id}', + ...options, + headers: { + 'Content-Type': 'application/json', + ...options.headers, + }, + }); + +/** + * Attach a websocket + * + * If the nodeName query parameter is present, the request will be proxied to the underlying agent environment(endpoint). + * If the nodeName query parameter is not specified, the request will be upgraded to the websocket protocol and + * an AttachStart operation HTTP request will be created and hijacked. + * **Access policy**: authenticated + */ +export const getWebsocketAttach = ( + options: Options +) => + (options.client ?? client).get< + GetWebsocketAttachResponses, + GetWebsocketAttachErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zGetWebsocketAttachQuery, + }) + .parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/websocket/attach', + ...options, + }); + +/** + * Execute a websocket + * + * If the nodeName query parameter is present, the request will be proxied to the underlying agent environment(endpoint). + * If the nodeName query parameter is not specified, the request will be upgraded to the websocket protocol and + * an ExecStart operation HTTP request will be created and hijacked. + */ +export const getWebsocketExec = ( + options: Options +) => + (options.client ?? client).get< + GetWebsocketExecResponses, + GetWebsocketExecErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zGetWebsocketExecQuery, + }) + .parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/websocket/exec', + ...options, + }); + +/** + * Execute a websocket on kubectl shell pod + * + * The request will be upgraded to the websocket protocol. The request will proxy input from the client to the pod via long-lived websocket connection. + * **Access policy**: authenticated + */ +export const getWebsocketKubernetesShell = < + ThrowOnError extends boolean = true, +>( + options: Options +) => + (options.client ?? client).get< + GetWebsocketKubernetesShellResponses, + GetWebsocketKubernetesShellErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zGetWebsocketKubernetesShellQuery, + }) + .parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/websocket/kubernetes-shell', + ...options, + }); + +/** + * Execute a websocket on pod + * + * The request will be upgraded to the websocket protocol. + * **Access policy**: authenticated + */ +export const getWebsocketPod = ( + options: Options +) => + (options.client ?? client).get< + GetWebsocketPodResponses, + GetWebsocketPodErrors, + ThrowOnError + >({ + requestValidator: async (data) => + await z + .object({ + body: z.never().optional(), + path: z.never().optional(), + query: zGetWebsocketPodQuery, + }) + .parseAsync(data), + security: [ + { name: 'X-API-KEY', type: 'apiKey' }, + { name: 'Authorization', type: 'apiKey' }, + ], + url: '/websocket/pod', + ...options, + }); diff --git a/app/react/portainer/generated-api/portainer/types.gen.ts b/app/react/portainer/generated-api/portainer/types.gen.ts new file mode 100644 index 0000000000..8ca040fd9e --- /dev/null +++ b/app/react/portainer/generated-api/portainer/types.gen.ts @@ -0,0 +1,18135 @@ +// This file is auto-generated by @hey-api/openapi-ts + +export type ClientOptions = { + baseURL: `${string}://${string}/api` | (string & {}); +}; + +export type WorkflowsWorkflowStatusObject = { + artifact?: WorkflowsWorkflowPhaseStatus; + source?: WorkflowsWorkflowPhaseStatus; + target?: WorkflowsWorkflowPhaseStatus; +}; + +export const WorkflowsStatus = { + /** + * StatusHealthy + */ + STATUS_HEALTHY: 'healthy', + /** + * StatusSyncing + */ + STATUS_SYNCING: 'syncing', + /** + * StatusError + */ + STATUS_ERROR: 'error', + /** + * StatusPaused + */ + STATUS_PAUSED: 'paused', + /** + * StatusUnknown + */ + STATUS_UNKNOWN: 'unknown', +} as const; + +export type WorkflowsStatus = + (typeof WorkflowsStatus)[keyof typeof WorkflowsStatus]; + +export type WorkflowsWorkflowPhaseStatus = { + error?: string; + status?: WorkflowsStatus; +}; + +export type WorkflowsWorkflow = { + autoUpdate?: PortainerAutoUpdateSettings; + creationDate?: number; + gitConfig?: GittypesRepoConfig; + id?: number; + lastSyncDate?: number; + name?: string; + platform?: WorkflowsDeploymentPlatform; + status?: WorkflowsWorkflowStatusObject; + target?: WorkflowsTarget; + type?: WorkflowsType; +}; + +export const WorkflowsType = { + /** + * TypeStack + */ + TYPE_STACK: 'stack' /** + * TypeEdgeStack + */, + TYPE_EDGE_STACK: 'edgeStack', +} as const; + +export type WorkflowsType = (typeof WorkflowsType)[keyof typeof WorkflowsType]; + +export type WorkflowsTarget = { + edgeGroupIds?: Array; + endpointId?: number; + groupStatus?: { + [key: string]: WorkflowsStatus; + }; + namespace?: string; + resolvedEndpointIds?: Array; +}; + +export const WorkflowsDeploymentPlatform = { + /** + * DeploymentPlatformDockerStandalone + */ + DEPLOYMENT_PLATFORM_DOCKER_STANDALONE: 'dockerStandalone', + /** + * DeploymentPlatformDockerSwarm + */ + DEPLOYMENT_PLATFORM_DOCKER_SWARM: 'dockerSwarm', + /** + * DeploymentPlatformKubernetes + */ + DEPLOYMENT_PLATFORM_KUBERNETES: 'kubernetes', +} as const; + +export type WorkflowsDeploymentPlatform = + (typeof WorkflowsDeploymentPlatform)[keyof typeof WorkflowsDeploymentPlatform]; + +export type GittypesGitAuthentication = { + AuthorizationType?: number; + /** + * Git credentials identifier when the value is not 0 + * When the value is 0, Username and Password are set without using saved credential + * This is introduced since 2.15.0 + */ + GitCredentialID?: number; + Password?: string; + Provider?: number; + Username?: string; +}; + +export type GittypesRepoConfig = { + /** + * Git credentials + */ + Authentication?: GittypesGitAuthentication; + /** + * ConfigFilePath is the path to the config file within the repository. + * NOTE: For stacks, this mirrors Stack.EntryPoint and the two are kept in sync by stackUpdateGit. + */ + ConfigFilePath?: string; + /** + * Repository hash + */ + ConfigHash?: string; + /** + * The reference name + */ + ReferenceName?: string; + /** + * TLSSkipVerify skips SSL verification when cloning the Git repository + */ + TLSSkipVerify?: boolean; + /** + * The repo url + */ + URL?: string; +}; + +export type PortainerAutoUpdateSettings = { + /** + * Pull latest image + */ + ForcePullImage?: boolean; + /** + * Force update ignores repo changes + */ + ForceUpdate?: boolean; + /** + * Auto update interval + */ + Interval?: string; + /** + * Autoupdate job id + */ + JobID?: string; + /** + * A UUID generated from client + */ + Webhook?: string; +}; + +export type WorkflowsStatusSummary = { + error?: number; + healthy?: number; + paused?: number; + syncing?: number; + unknown?: number; +}; + +export type WebhooksWebhookUpdatePayload = { + RegistryID?: number; +}; + +export type WebhooksWebhookCreatePayload = { + EndpointID?: number; + RegistryID?: number; + ResourceID?: string; + /** + * Type of webhook (1 - service) + */ + WebhookType?: PortainerWebhookType; +}; + +export const PortainerWebhookType = { + /** + * _ + */ + '': 0 /** + * ServiceWebhook + */, + SERVICE_WEBHOOK: 1, +} as const; + +export type PortainerWebhookType = + (typeof PortainerWebhookType)[keyof typeof PortainerWebhookType]; + +export type V1Beta1PodMetricsList = { + /** + * APIVersion defines the versioned schema of this representation of an object. + * Servers should convert recognized schemas to the latest internal value, and + * may reject unrecognized values. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * +optional + */ + apiVersion?: string; + /** + * List of pod metrics. + */ + items?: Array; + /** + * Kind is a string value representing the REST resource this object represents. + * Servers may infer this from the endpoint the client submits requests to. + * Cannot be updated. + * In CamelCase. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * +optional + */ + kind?: string; + /** + * Standard list metadata. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + */ + metadata?: V1ListMeta; +}; + +export type V1ListMeta = { + /** + * continue may be set if the user set a limit on the number of items returned, and indicates that + * the server has more data available. The value is opaque and may be used to issue another request + * to the endpoint that served this list to retrieve the next set of available objects. Continuing a + * consistent list may not be possible if the server configuration has changed or more than a few + * minutes have passed. The resourceVersion field returned when using this continue value will be + * identical to the value in the first response, unless you have received this token from an error + * message. + */ + continue?: string; + /** + * remainingItemCount is the number of subsequent items in the list which are not included in this + * list response. If the list request contained label or field selectors, then the number of + * remaining items is unknown and the field will be left unset and omitted during serialization. + * If the list is complete (either because it is not chunking or because this is the last chunk), + * then there are no more remaining items and this field will be left unset and omitted during + * serialization. + * Servers older than v1.15 do not set this field. + * The intended use of the remainingItemCount is *estimating* the size of a collection. Clients + * should not rely on the remainingItemCount to be set or to be exact. + * +optional + */ + remainingItemCount?: number; + /** + * String that identifies the server's internal version of this object that + * can be used by clients to determine when objects have changed. + * Value must be treated as opaque by clients and passed unmodified back to the server. + * Populated by the system. + * Read-only. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + * +optional + */ + resourceVersion?: string; + /** + * Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. + * +optional + */ + selfLink?: string; +}; + +export type V1Duration = { + 'time.Duration'?: + | -9223372036854776000 + | 9223372036854776000 + | 1 + | 1000 + | 1000000 + | 1000000000 + | 60000000000 + | 3600000000000; +}; + +export type V1OwnerReference = { + /** + * API version of the referent. + */ + apiVersion?: string; + /** + * If true, AND if the owner has the "foregroundDeletion" finalizer, then + * the owner cannot be deleted from the key-value store until this + * reference is removed. + * See https://kubernetes.io/docs/concepts/architecture/garbage-collection/#foreground-deletion + * for how the garbage collector interacts with this field and enforces the foreground deletion. + * Defaults to false. + * To set this field, a user needs "delete" permission of the owner, + * otherwise 422 (Unprocessable Entity) will be returned. + * +optional + */ + blockOwnerDeletion?: boolean; + /** + * If true, this reference points to the managing controller. + * +optional + */ + controller?: boolean; + /** + * Kind of the referent. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + */ + kind?: string; + /** + * Name of the referent. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names + */ + name?: string; + /** + * UID of the referent. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids + */ + uid?: string; +}; + +export const V1ManagedFieldsOperationType = { + /** + * ManagedFieldsOperationApply + */ + MANAGED_FIELDS_OPERATION_APPLY: 'Apply' /** + * ManagedFieldsOperationUpdate + */, + MANAGED_FIELDS_OPERATION_UPDATE: 'Update', +} as const; + +export type V1ManagedFieldsOperationType = + (typeof V1ManagedFieldsOperationType)[keyof typeof V1ManagedFieldsOperationType]; + +export type V1FieldsV1 = { + [key: string]: unknown; +}; + +export type V1ManagedFieldsEntry = { + /** + * APIVersion defines the version of this resource that this field set + * applies to. The format is "group/version" just like the top-level + * APIVersion field. It is necessary to track the version of a field + * set because it cannot be automatically converted. + */ + apiVersion?: string; + /** + * FieldsType is the discriminator for the different fields format and version. + * There is currently only one possible value: "FieldsV1" + */ + fieldsType?: string; + /** + * FieldsV1 holds the first JSON version format as described in the "FieldsV1" type. + * +optional + */ + fieldsV1?: V1FieldsV1; + /** + * Manager is an identifier of the workflow managing these fields. + */ + manager?: string; + /** + * Operation is the type of operation which lead to this ManagedFieldsEntry being created. + * The only valid values for this field are 'Apply' and 'Update'. + */ + operation?: V1ManagedFieldsOperationType; + /** + * Subresource is the name of the subresource used to update that object, or + * empty string if the object was updated through the main resource. The + * value of this field is used to distinguish between managers, even if they + * share the same name. For example, a status update will be distinct from a + * regular update using the same manager name. + * Note that the APIVersion field is not related to the Subresource field and + * it always corresponds to the version of the main resource. + */ + subresource?: string; + /** + * Time is the timestamp of when the ManagedFields entry was added. The + * timestamp will also be updated if a field is added, the manager + * changes any of the owned fields value or removes a field. The + * timestamp does not update when a field is removed from the entry + * because another manager took it over. + * +optional + */ + time?: string; +}; + +export type V1ObjectMeta = { + /** + * Annotations is an unstructured key value map stored with a resource that may be + * set by external tools to store and retrieve arbitrary metadata. They are not + * queryable and should be preserved when modifying objects. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations + * +optional + */ + annotations?: { + [key: string]: string; + }; + /** + * CreationTimestamp is a timestamp representing the server time when this object was + * created. It is not guaranteed to be set in happens-before order across separate operations. + * Clients may not set this value. It is represented in RFC3339 form and is in UTC. + * + * Populated by the system. + * Read-only. + * Null for lists. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + * +optional + */ + creationTimestamp?: string; + /** + * Number of seconds allowed for this object to gracefully terminate before + * it will be removed from the system. Only set when deletionTimestamp is also set. + * May only be shortened. + * Read-only. + * +optional + */ + deletionGracePeriodSeconds?: number; + /** + * DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This + * field is set by the server when a graceful deletion is requested by the user, and is not + * directly settable by a client. The resource is expected to be deleted (no longer visible + * from resource lists, and not reachable by name) after the time in this field, once the + * finalizers list is empty. As long as the finalizers list contains items, deletion is blocked. + * Once the deletionTimestamp is set, this value may not be unset or be set further into the + * future, although it may be shortened or the resource may be deleted prior to this time. + * For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react + * by sending a graceful termination signal to the containers in the pod. After that 30 seconds, + * the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, + * remove the pod from the API. In the presence of network partitions, this object may still + * exist after this timestamp, until an administrator or automated process can determine the + * resource is fully terminated. + * If not set, graceful deletion of the object has not been requested. + * + * Populated by the system when a graceful deletion is requested. + * Read-only. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + * +optional + */ + deletionTimestamp?: string; + /** + * Must be empty before the object is deleted from the registry. Each entry + * is an identifier for the responsible component that will remove the entry + * from the list. If the deletionTimestamp of the object is non-nil, entries + * in this list can only be removed. + * Finalizers may be processed and removed in any order. Order is NOT enforced + * because it introduces significant risk of stuck finalizers. + * finalizers is a shared field, any actor with permission can reorder it. + * If the finalizer list is processed in order, then this can lead to a situation + * in which the component responsible for the first finalizer in the list is + * waiting for a signal (field value, external system, or other) produced by a + * component responsible for a finalizer later in the list, resulting in a deadlock. + * Without enforced ordering finalizers are free to order amongst themselves and + * are not vulnerable to ordering changes in the list. + * +optional + * +patchStrategy=merge + * +listType=set + */ + finalizers?: Array; + /** + * GenerateName is an optional prefix, used by the server, to generate a unique + * name ONLY IF the Name field has not been provided. + * If this field is used, the name returned to the client will be different + * than the name passed. This value will also be combined with a unique suffix. + * The provided value has the same validation rules as the Name field, + * and may be truncated by the length of the suffix required to make the value + * unique on the server. + * + * If this field is specified and the generated name exists, the server will return a 409. + * + * Applied only if Name is not specified. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#idempotency + * +optional + */ + generateName?: string; + /** + * A sequence number representing a specific generation of the desired state. + * Populated by the system. Read-only. + * +optional + */ + generation?: number; + /** + * Map of string keys and values that can be used to organize and categorize + * (scope and select) objects. May match selectors of replication controllers + * and services. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels + * +optional + */ + labels?: { + [key: string]: string; + }; + /** + * ManagedFields maps workflow-id and version to the set of fields + * that are managed by that workflow. This is mostly for internal + * housekeeping, and users typically shouldn't need to set or + * understand this field. A workflow can be the user's name, a + * controller's name, or the name of a specific apply path like + * "ci-cd". The set of fields is always in the version that the + * workflow used when modifying the object. + * + * +optional + * +listType=atomic + */ + managedFields?: Array; + /** + * Name must be unique within a namespace. Is required when creating resources, although + * some resources may allow a client to request the generation of an appropriate name + * automatically. Name is primarily intended for creation idempotence and configuration + * definition. + * Cannot be updated. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#names + * +optional + */ + name?: string; + /** + * Namespace defines the space within which each name must be unique. An empty namespace is + * equivalent to the "default" namespace, but "default" is the canonical representation. + * Not all objects are required to be scoped to a namespace - the value of this field for + * those objects will be empty. + * + * Must be a DNS_LABEL. + * Cannot be updated. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces + * +optional + */ + namespace?: string; + /** + * List of objects depended by this object. If ALL objects in the list have + * been deleted, this object will be garbage collected. If this object is managed by a controller, + * then an entry in this list will point to this controller, with the controller field set to true. + * There cannot be more than one managing controller. + * +optional + * +patchMergeKey=uid + * +patchStrategy=merge + * +listType=map + * +listMapKey=uid + */ + ownerReferences?: Array; + /** + * An opaque value that represents the internal version of this object that can + * be used by clients to determine when objects have changed. May be used for optimistic + * concurrency, change detection, and the watch operation on a resource or set of resources. + * Clients must treat these values as opaque and passed unmodified back to the server. + * They may only be valid for a particular resource or set of resources. + * + * Populated by the system. + * Read-only. + * Value must be treated as opaque by clients and . + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + * +optional + */ + resourceVersion?: string; + /** + * Deprecated: selfLink is a legacy read-only field that is no longer populated by the system. + * +optional + */ + selfLink?: string; + /** + * UID is the unique in time and space value for this object. It is typically generated by + * the server on successful creation of a resource and is not allowed to change on PUT + * operations. + * + * Populated by the system. + * Read-only. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names#uids + * +optional + */ + uid?: string; +}; + +export type ResourceQuantity = { + Format?: 'DecimalExponent' | 'BinarySI' | 'DecimalSI'; +}; + +export type V1ResourceList = { + [key: string]: ResourceQuantity; +}; + +export type V1Beta1ContainerMetrics = { + /** + * Container name corresponding to the one from pod.spec.containers. + */ + name?: string; + /** + * The memory usage is the memory working set. + */ + usage?: V1ResourceList; +}; + +export type V1Beta1PodMetrics = { + /** + * APIVersion defines the versioned schema of this representation of an object. + * Servers should convert recognized schemas to the latest internal value, and + * may reject unrecognized values. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * +optional + */ + apiVersion?: string; + /** + * Metrics for all containers are collected within the same time window. + * +listType=atomic + */ + containers?: Array; + /** + * Kind is a string value representing the REST resource this object represents. + * Servers may infer this from the endpoint the client submits requests to. + * Cannot be updated. + * In CamelCase. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * +optional + */ + kind?: string; + /** + * Standard object's metadata. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + * +optional + */ + metadata?: V1ObjectMeta; + /** + * The following fields define time interval from which metrics were + * collected from the interval [Timestamp-Window, Timestamp]. + */ + timestamp?: string; + window?: V1Duration; +}; + +export type V1Beta1NodeMetricsList = { + /** + * APIVersion defines the versioned schema of this representation of an object. + * Servers should convert recognized schemas to the latest internal value, and + * may reject unrecognized values. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * +optional + */ + apiVersion?: string; + /** + * List of node metrics. + */ + items?: Array; + /** + * Kind is a string value representing the REST resource this object represents. + * Servers may infer this from the endpoint the client submits requests to. + * Cannot be updated. + * In CamelCase. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * +optional + */ + kind?: string; + /** + * Standard list metadata. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + */ + metadata?: V1ListMeta; +}; + +export type V1Beta1NodeMetrics = { + /** + * APIVersion defines the versioned schema of this representation of an object. + * Servers should convert recognized schemas to the latest internal value, and + * may reject unrecognized values. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * +optional + */ + apiVersion?: string; + /** + * Kind is a string value representing the REST resource this object represents. + * Servers may infer this from the endpoint the client submits requests to. + * Cannot be updated. + * In CamelCase. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * +optional + */ + kind?: string; + /** + * Standard object's metadata. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + * +optional + */ + metadata?: V1ObjectMeta; + /** + * The following fields define time interval from which metrics were + * collected from the interval [Timestamp-Window, Timestamp]. + */ + timestamp?: string; + /** + * The memory usage is the memory working set. + */ + usage?: V1ResourceList; + window?: V1Duration; +}; + +export type V1WindowsSecurityContextOptions = { + /** + * GMSACredentialSpec is where the GMSA admission webhook + * (https://github.com/kubernetes-sigs/windows-gmsa) inlines the contents of the + * GMSA credential spec named by the GMSACredentialSpecName field. + * +optional + */ + gmsaCredentialSpec?: string; + /** + * GMSACredentialSpecName is the name of the GMSA credential spec to use. + * +optional + */ + gmsaCredentialSpecName?: string; + /** + * HostProcess determines if a container should be run as a 'Host Process' container. + * All of a Pod's containers must have the same effective HostProcess value + * (it is not allowed to have a mix of HostProcess containers and non-HostProcess containers). + * In addition, if HostProcess is true then HostNetwork must also be set to true. + * +optional + */ + hostProcess?: boolean; + /** + * The UserName in Windows to run the entrypoint of the container process. + * Defaults to the user specified in image metadata if unspecified. + * May also be set in PodSecurityContext. If set in both SecurityContext and + * PodSecurityContext, the value specified in SecurityContext takes precedence. + * +optional + */ + runAsUserName?: string; +}; + +export type V1VolumeMount = { + /** + * Path within the container at which the volume should be mounted. Must + * not contain ':'. + */ + mountPath?: string; + /** + * mountPropagation determines how mounts are propagated from the host + * to container and the other way around. + * When not set, MountPropagationNone is used. + * This field is beta in 1.10. + * When RecursiveReadOnly is set to IfPossible or to Enabled, MountPropagation must be None or unspecified + * (which defaults to None). + * +optional + */ + mountPropagation?: V1MountPropagationMode; + /** + * This must match the Name of a Volume. + */ + name?: string; + /** + * Mounted read-only if true, read-write otherwise (false or unspecified). + * Defaults to false. + * +optional + */ + readOnly?: boolean; + /** + * RecursiveReadOnly specifies whether read-only mounts should be handled + * recursively. + * + * If ReadOnly is false, this field has no meaning and must be unspecified. + * + * If ReadOnly is true, and this field is set to Disabled, the mount is not made + * recursively read-only. If this field is set to IfPossible, the mount is made + * recursively read-only, if it is supported by the container runtime. If this + * field is set to Enabled, the mount is made recursively read-only if it is + * supported by the container runtime, otherwise the pod will not be started and + * an error will be generated to indicate the reason. + * + * If this field is set to IfPossible or Enabled, MountPropagation must be set to + * None (or be unspecified, which defaults to None). + * + * If this field is not specified, it is treated as an equivalent of Disabled. + * +optional + */ + recursiveReadOnly?: V1RecursiveReadOnlyMode; + /** + * Path within the volume from which the container's volume should be mounted. + * Defaults to "" (volume's root). + * +optional + */ + subPath?: string; + /** + * Expanded path within the volume from which the container's volume should be mounted. + * Behaves similarly to SubPath but environment variable references $(VAR_NAME) are expanded using the container's environment. + * Defaults to "" (volume's root). + * SubPathExpr and SubPath are mutually exclusive. + * +optional + */ + subPathExpr?: string; +}; + +export const V1RecursiveReadOnlyMode = { + /** + * RecursiveReadOnlyDisabled + */ + RECURSIVE_READ_ONLY_DISABLED: 'Disabled', + /** + * RecursiveReadOnlyIfPossible + */ + RECURSIVE_READ_ONLY_IF_POSSIBLE: 'IfPossible', + /** + * RecursiveReadOnlyEnabled + */ + RECURSIVE_READ_ONLY_ENABLED: 'Enabled', +} as const; + +export type V1RecursiveReadOnlyMode = + (typeof V1RecursiveReadOnlyMode)[keyof typeof V1RecursiveReadOnlyMode]; + +export const V1MountPropagationMode = { + /** + * MountPropagationNone + */ + MOUNT_PROPAGATION_NONE: 'None', + /** + * MountPropagationHostToContainer + */ + MOUNT_PROPAGATION_HOST_TO_CONTAINER: 'HostToContainer', + /** + * MountPropagationBidirectional + */ + MOUNT_PROPAGATION_BIDIRECTIONAL: 'Bidirectional', +} as const; + +export type V1MountPropagationMode = + (typeof V1MountPropagationMode)[keyof typeof V1MountPropagationMode]; + +export type V1VolumeDevice = { + /** + * devicePath is the path inside of the container that the device will be mapped to. + */ + devicePath?: string; + /** + * name must match the name of a persistentVolumeClaim in the pod + */ + name?: string; +}; + +export const V1UriScheme = { + /** + * URISchemeHTTP + */ + URI_SCHEME_HTTP: 'HTTP' /** + * URISchemeHTTPS + */, + URI_SCHEME_HTTPS: 'HTTPS', +} as const; + +export type V1UriScheme = (typeof V1UriScheme)[keyof typeof V1UriScheme]; + +export const V1TerminationMessagePolicy = { + /** + * TerminationMessageReadFile + */ + TERMINATION_MESSAGE_READ_FILE: 'File' /** + * TerminationMessageFallbackToLogsOnError + */, + TERMINATION_MESSAGE_FALLBACK_TO_LOGS_ON_ERROR: 'FallbackToLogsOnError', +} as const; + +export type V1TerminationMessagePolicy = + (typeof V1TerminationMessagePolicy)[keyof typeof V1TerminationMessagePolicy]; + +export type V1TcpSocketAction = { + /** + * Optional: Host name to connect to, defaults to the pod IP. + * +optional + */ + host?: string; + /** + * Number or name of the port to access on the container. + * Number must be in the range 1 to 65535. + * Name must be an IANA_SVC_NAME. + */ + port?: IntstrIntOrString; +}; + +export const IntstrType = { + /** + * Int + * + * The IntOrString holds an int. + */ + INT: 0 /** + * String + * + * The IntOrString holds a string. + */, + STRING: 1, +} as const; + +export type IntstrType = (typeof IntstrType)[keyof typeof IntstrType]; + +export type IntstrIntOrString = { + IntVal?: number; + StrVal?: string; + Type?: IntstrType; +}; + +export type V1SleepAction = { + /** + * Seconds is the number of seconds to sleep. + */ + seconds?: number; +}; + +export const V1Signal = { + /** + * SIGABRT + */ + SIGABRT: 'SIGABRT', + /** + * SIGALRM + */ + SIGALRM: 'SIGALRM', + /** + * SIGBUS + */ + SIGBUS: 'SIGBUS', + /** + * SIGCHLD + */ + SIGCHLD: 'SIGCHLD', + /** + * SIGCLD + */ + SIGCLD: 'SIGCLD', + /** + * SIGCONT + */ + SIGCONT: 'SIGCONT', + /** + * SIGFPE + */ + SIGFPE: 'SIGFPE', + /** + * SIGHUP + */ + SIGHUP: 'SIGHUP', + /** + * SIGILL + */ + SIGILL: 'SIGILL', + /** + * SIGINT + */ + SIGINT: 'SIGINT', + /** + * SIGIO + */ + SIGIO: 'SIGIO', + /** + * SIGIOT + */ + SIGIOT: 'SIGIOT', + /** + * SIGKILL + */ + SIGKILL: 'SIGKILL', + /** + * SIGPIPE + */ + SIGPIPE: 'SIGPIPE', + /** + * SIGPOLL + */ + SIGPOLL: 'SIGPOLL', + /** + * SIGPROF + */ + SIGPROF: 'SIGPROF', + /** + * SIGPWR + */ + SIGPWR: 'SIGPWR', + /** + * SIGQUIT + */ + SIGQUIT: 'SIGQUIT', + /** + * SIGSEGV + */ + SIGSEGV: 'SIGSEGV', + /** + * SIGSTKFLT + */ + SIGSTKFLT: 'SIGSTKFLT', + /** + * SIGSTOP + */ + SIGSTOP: 'SIGSTOP', + /** + * SIGSYS + */ + SIGSYS: 'SIGSYS', + /** + * SIGTERM + */ + SIGTERM: 'SIGTERM', + /** + * SIGTRAP + */ + SIGTRAP: 'SIGTRAP', + /** + * SIGTSTP + */ + SIGTSTP: 'SIGTSTP', + /** + * SIGTTIN + */ + SIGTTIN: 'SIGTTIN', + /** + * SIGTTOU + */ + SIGTTOU: 'SIGTTOU', + /** + * SIGURG + */ + SIGURG: 'SIGURG', + /** + * SIGUSR1 + */ + SIGUSR1: 'SIGUSR1', + /** + * SIGUSR2 + */ + SIGUSR2: 'SIGUSR2', + /** + * SIGVTALRM + */ + SIGVTALRM: 'SIGVTALRM', + /** + * SIGWINCH + */ + SIGWINCH: 'SIGWINCH', + /** + * SIGXCPU + */ + SIGXCPU: 'SIGXCPU', + /** + * SIGXFSZ + */ + SIGXFSZ: 'SIGXFSZ', + /** + * SIGRTMIN + */ + SIGRTMIN: 'SIGRTMIN', + /** + * SIGRTMINPLUS1 + */ + SIGRTMINPLUS1: 'SIGRTMIN+1', + /** + * SIGRTMINPLUS2 + */ + SIGRTMINPLUS2: 'SIGRTMIN+2', + /** + * SIGRTMINPLUS3 + */ + SIGRTMINPLUS3: 'SIGRTMIN+3', + /** + * SIGRTMINPLUS4 + */ + SIGRTMINPLUS4: 'SIGRTMIN+4', + /** + * SIGRTMINPLUS5 + */ + SIGRTMINPLUS5: 'SIGRTMIN+5', + /** + * SIGRTMINPLUS6 + */ + SIGRTMINPLUS6: 'SIGRTMIN+6', + /** + * SIGRTMINPLUS7 + */ + SIGRTMINPLUS7: 'SIGRTMIN+7', + /** + * SIGRTMINPLUS8 + */ + SIGRTMINPLUS8: 'SIGRTMIN+8', + /** + * SIGRTMINPLUS9 + */ + SIGRTMINPLUS9: 'SIGRTMIN+9', + /** + * SIGRTMINPLUS10 + */ + SIGRTMINPLUS10: 'SIGRTMIN+10', + /** + * SIGRTMINPLUS11 + */ + SIGRTMINPLUS11: 'SIGRTMIN+11', + /** + * SIGRTMINPLUS12 + */ + SIGRTMINPLUS12: 'SIGRTMIN+12', + /** + * SIGRTMINPLUS13 + */ + SIGRTMINPLUS13: 'SIGRTMIN+13', + /** + * SIGRTMINPLUS14 + */ + SIGRTMINPLUS14: 'SIGRTMIN+14', + /** + * SIGRTMINPLUS15 + */ + SIGRTMINPLUS15: 'SIGRTMIN+15', + /** + * SIGRTMAXMINUS14 + */ + SIGRTMAXMINUS14: 'SIGRTMAX-14', + /** + * SIGRTMAXMINUS13 + */ + SIGRTMAXMINUS13: 'SIGRTMAX-13', + /** + * SIGRTMAXMINUS12 + */ + SIGRTMAXMINUS12: 'SIGRTMAX-12', + /** + * SIGRTMAXMINUS11 + */ + SIGRTMAXMINUS11: 'SIGRTMAX-11', + /** + * SIGRTMAXMINUS10 + */ + SIGRTMAXMINUS10: 'SIGRTMAX-10', + /** + * SIGRTMAXMINUS9 + */ + SIGRTMAXMINUS9: 'SIGRTMAX-9', + /** + * SIGRTMAXMINUS8 + */ + SIGRTMAXMINUS8: 'SIGRTMAX-8', + /** + * SIGRTMAXMINUS7 + */ + SIGRTMAXMINUS7: 'SIGRTMAX-7', + /** + * SIGRTMAXMINUS6 + */ + SIGRTMAXMINUS6: 'SIGRTMAX-6', + /** + * SIGRTMAXMINUS5 + */ + SIGRTMAXMINUS5: 'SIGRTMAX-5', + /** + * SIGRTMAXMINUS4 + */ + SIGRTMAXMINUS4: 'SIGRTMAX-4', + /** + * SIGRTMAXMINUS3 + */ + SIGRTMAXMINUS3: 'SIGRTMAX-3', + /** + * SIGRTMAXMINUS2 + */ + SIGRTMAXMINUS2: 'SIGRTMAX-2', + /** + * SIGRTMAXMINUS1 + */ + SIGRTMAXMINUS1: 'SIGRTMAX-1', + /** + * SIGRTMAX + */ + SIGRTMAX: 'SIGRTMAX', +} as const; + +export type V1Signal = (typeof V1Signal)[keyof typeof V1Signal]; + +export type V1SecurityContext = { + /** + * AllowPrivilegeEscalation controls whether a process can gain more + * privileges than its parent process. This bool directly controls if + * the no_new_privs flag will be set on the container process. + * AllowPrivilegeEscalation is true always when the container is: + * 1) run as Privileged + * 2) has CAP_SYS_ADMIN + * Note that this field cannot be set when spec.os.name is windows. + * +optional + */ + allowPrivilegeEscalation?: boolean; + /** + * appArmorProfile is the AppArmor options to use by this container. If set, this profile + * overrides the pod's appArmorProfile. + * Note that this field cannot be set when spec.os.name is windows. + * +optional + */ + appArmorProfile?: V1AppArmorProfile; + /** + * The capabilities to add/drop when running containers. + * Defaults to the default set of capabilities granted by the container runtime. + * Note that this field cannot be set when spec.os.name is windows. + * +optional + */ + capabilities?: V1Capabilities; + /** + * Run container in privileged mode. + * Processes in privileged containers are essentially equivalent to root on the host. + * Defaults to false. + * Note that this field cannot be set when spec.os.name is windows. + * +optional + */ + privileged?: boolean; + /** + * procMount denotes the type of proc mount to use for the containers. + * The default value is Default which uses the container runtime defaults for + * readonly paths and masked paths. + * This requires the ProcMountType feature flag to be enabled. + * Note that this field cannot be set when spec.os.name is windows. + * +optional + */ + procMount?: V1ProcMountType; + /** + * Whether this container has a read-only root filesystem. + * Default is false. + * Note that this field cannot be set when spec.os.name is windows. + * +optional + */ + readOnlyRootFilesystem?: boolean; + /** + * The GID to run the entrypoint of the container process. + * Uses runtime default if unset. + * May also be set in PodSecurityContext. If set in both SecurityContext and + * PodSecurityContext, the value specified in SecurityContext takes precedence. + * Note that this field cannot be set when spec.os.name is windows. + * +optional + */ + runAsGroup?: number; + /** + * Indicates that the container must run as a non-root user. + * If true, the Kubelet will validate the image at runtime to ensure that it + * does not run as UID 0 (root) and fail to start the container if it does. + * If unset or false, no such validation will be performed. + * May also be set in PodSecurityContext. If set in both SecurityContext and + * PodSecurityContext, the value specified in SecurityContext takes precedence. + * +optional + */ + runAsNonRoot?: boolean; + /** + * The UID to run the entrypoint of the container process. + * Defaults to user specified in image metadata if unspecified. + * May also be set in PodSecurityContext. If set in both SecurityContext and + * PodSecurityContext, the value specified in SecurityContext takes precedence. + * Note that this field cannot be set when spec.os.name is windows. + * +optional + */ + runAsUser?: number; + /** + * The SELinux context to be applied to the container. + * If unspecified, the container runtime will allocate a random SELinux context for each + * container. May also be set in PodSecurityContext. If set in both SecurityContext and + * PodSecurityContext, the value specified in SecurityContext takes precedence. + * Note that this field cannot be set when spec.os.name is windows. + * +optional + */ + seLinuxOptions?: V1SeLinuxOptions; + /** + * The seccomp options to use by this container. If seccomp options are + * provided at both the pod & container level, the container options + * override the pod options. + * Note that this field cannot be set when spec.os.name is windows. + * +optional + */ + seccompProfile?: V1SeccompProfile; + /** + * The Windows specific settings applied to all containers. + * If unspecified, the options from the PodSecurityContext will be used. + * If set in both SecurityContext and PodSecurityContext, the value specified in SecurityContext takes precedence. + * Note that this field cannot be set when spec.os.name is linux. + * +optional + */ + windowsOptions?: V1WindowsSecurityContextOptions; +}; + +export const V1SeccompProfileType = { + /** + * SeccompProfileTypeUnconfined + */ + SECCOMP_PROFILE_TYPE_UNCONFINED: 'Unconfined', + /** + * SeccompProfileTypeRuntimeDefault + */ + SECCOMP_PROFILE_TYPE_RUNTIME_DEFAULT: 'RuntimeDefault', + /** + * SeccompProfileTypeLocalhost + */ + SECCOMP_PROFILE_TYPE_LOCALHOST: 'Localhost', +} as const; + +export type V1SeccompProfileType = + (typeof V1SeccompProfileType)[keyof typeof V1SeccompProfileType]; + +export type V1SeccompProfile = { + /** + * localhostProfile indicates a profile defined in a file on the node should be used. + * The profile must be preconfigured on the node to work. + * Must be a descending path, relative to the kubelet's configured seccomp profile location. + * Must be set if type is "Localhost". Must NOT be set for any other type. + * +optional + */ + localhostProfile?: string; + /** + * type indicates which kind of seccomp profile will be applied. + * Valid options are: + * + * Localhost - a profile defined in a file on the node should be used. + * RuntimeDefault - the container runtime default profile should be used. + * Unconfined - no profile should be applied. + * +unionDiscriminator + */ + type?: V1SeccompProfileType; +}; + +export type V1SeLinuxOptions = { + /** + * Level is SELinux level label that applies to the container. + * +optional + */ + level?: string; + /** + * Role is a SELinux role label that applies to the container. + * +optional + */ + role?: string; + /** + * Type is a SELinux type label that applies to the container. + * +optional + */ + type?: string; + /** + * User is a SELinux user label that applies to the container. + * +optional + */ + user?: string; +}; + +export const V1ProcMountType = { + /** + * DefaultProcMount + */ + DEFAULT_PROC_MOUNT: 'Default' /** + * UnmaskedProcMount + */, + UNMASKED_PROC_MOUNT: 'Unmasked', +} as const; + +export type V1ProcMountType = + (typeof V1ProcMountType)[keyof typeof V1ProcMountType]; + +export type V1Capabilities = { + /** + * Added capabilities + * +optional + * +listType=atomic + */ + add?: Array; + /** + * Removed capabilities + * +optional + * +listType=atomic + */ + drop?: Array; +}; + +export const V1AppArmorProfileType = { + /** + * AppArmorProfileTypeUnconfined + */ + APP_ARMOR_PROFILE_TYPE_UNCONFINED: 'Unconfined', + /** + * AppArmorProfileTypeRuntimeDefault + */ + APP_ARMOR_PROFILE_TYPE_RUNTIME_DEFAULT: 'RuntimeDefault', + /** + * AppArmorProfileTypeLocalhost + */ + APP_ARMOR_PROFILE_TYPE_LOCALHOST: 'Localhost', +} as const; + +export type V1AppArmorProfileType = + (typeof V1AppArmorProfileType)[keyof typeof V1AppArmorProfileType]; + +export type V1AppArmorProfile = { + /** + * localhostProfile indicates a profile loaded on the node that should be used. + * The profile must be preconfigured on the node to work. + * Must match the loaded name of the profile. + * Must be set if and only if type is "Localhost". + * +optional + */ + localhostProfile?: string; + /** + * type indicates which kind of AppArmor profile will be applied. + * Valid options are: + * Localhost - a profile pre-loaded on the node. + * RuntimeDefault - the container runtime's default profile. + * Unconfined - no AppArmor enforcement. + * +unionDiscriminator + */ + type?: V1AppArmorProfileType; +}; + +export type V1SecretReference = { + /** + * name is unique within a namespace to reference a secret resource. + * +optional + */ + name?: string; + /** + * namespace defines the space within which the secret name must be unique. + * +optional + */ + namespace?: string; +}; + +export type V1SecretKeySelector = { + /** + * The key of the secret to select from. Must be a valid secret key. + */ + key?: string; + /** + * Name of the referent. + * This field is effectively required, but due to backwards compatibility is + * allowed to be empty. Instances of this type with an empty value here are + * almost certainly wrong. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * +optional + * +default="" + * +kubebuilder:default="" + * TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. + */ + name?: string; + /** + * Specify whether the Secret or its key must be defined + * +optional + */ + optional?: boolean; +}; + +export type V1SecretEnvSource = { + /** + * Name of the referent. + * This field is effectively required, but due to backwards compatibility is + * allowed to be empty. Instances of this type with an empty value here are + * almost certainly wrong. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * +optional + * +default="" + * +kubebuilder:default="" + * TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. + */ + name?: string; + /** + * Specify whether the Secret must be defined + * +optional + */ + optional?: boolean; +}; + +export type V1ScopedResourceSelectorRequirement = { + /** + * Represents a scope's relationship to a set of values. + * Valid operators are In, NotIn, Exists, DoesNotExist. + */ + operator?: V1ScopeSelectorOperator; + /** + * The name of the scope that the selector applies to. + */ + scopeName?: V1ResourceQuotaScope; + /** + * An array of string values. If the operator is In or NotIn, + * the values array must be non-empty. If the operator is Exists or DoesNotExist, + * the values array must be empty. + * This array is replaced during a strategic merge patch. + * +optional + * +listType=atomic + */ + values?: Array; +}; + +export const V1ResourceQuotaScope = { + /** + * ResourceQuotaScopeTerminating + */ + RESOURCE_QUOTA_SCOPE_TERMINATING: 'Terminating', + /** + * ResourceQuotaScopeNotTerminating + */ + RESOURCE_QUOTA_SCOPE_NOT_TERMINATING: 'NotTerminating', + /** + * ResourceQuotaScopeBestEffort + */ + RESOURCE_QUOTA_SCOPE_BEST_EFFORT: 'BestEffort', + /** + * ResourceQuotaScopeNotBestEffort + */ + RESOURCE_QUOTA_SCOPE_NOT_BEST_EFFORT: 'NotBestEffort', + /** + * ResourceQuotaScopePriorityClass + */ + RESOURCE_QUOTA_SCOPE_PRIORITY_CLASS: 'PriorityClass', + /** + * ResourceQuotaScopeCrossNamespacePodAffinity + */ + RESOURCE_QUOTA_SCOPE_CROSS_NAMESPACE_POD_AFFINITY: + 'CrossNamespacePodAffinity', + /** + * ResourceQuotaScopeVolumeAttributesClass + */ + RESOURCE_QUOTA_SCOPE_VOLUME_ATTRIBUTES_CLASS: 'VolumeAttributesClass', +} as const; + +export type V1ResourceQuotaScope = + (typeof V1ResourceQuotaScope)[keyof typeof V1ResourceQuotaScope]; + +export const V1ScopeSelectorOperator = { + /** + * ScopeSelectorOpIn + */ + SCOPE_SELECTOR_OP_IN: 'In', + /** + * ScopeSelectorOpNotIn + */ + SCOPE_SELECTOR_OP_NOT_IN: 'NotIn', + /** + * ScopeSelectorOpExists + */ + SCOPE_SELECTOR_OP_EXISTS: 'Exists', + /** + * ScopeSelectorOpDoesNotExist + */ + SCOPE_SELECTOR_OP_DOES_NOT_EXIST: 'DoesNotExist', +} as const; + +export type V1ScopeSelectorOperator = + (typeof V1ScopeSelectorOperator)[keyof typeof V1ScopeSelectorOperator]; + +export type V1ScopeSelector = { + /** + * A list of scope selector requirements by scope of the resources. + * +optional + * +listType=atomic + */ + matchExpressions?: Array; +}; + +export type V1RoleRef = { + /** + * APIGroup is the group for the resource being referenced + */ + apiGroup?: string; + /** + * Kind is the type of resource being referenced + */ + kind?: string; + /** + * Name is the name of resource being referenced + * +required + * +k8s:required + */ + name?: string; +}; + +export const V1ResourceResizeRestartPolicy = { + /** + * NotRequired + */ + NOT_REQUIRED: 'NotRequired' /** + * RestartContainer + */, + RESTART_CONTAINER: 'RestartContainer', +} as const; + +export type V1ResourceResizeRestartPolicy = + (typeof V1ResourceResizeRestartPolicy)[keyof typeof V1ResourceResizeRestartPolicy]; + +export type V1ResourceRequirements = { + /** + * Claims lists the names of resources, defined in spec.resourceClaims, + * that are used by this container. + * + * This field depends on the + * DynamicResourceAllocation feature gate. + * + * This field is immutable. It can only be set for containers. + * + * +listType=map + * +listMapKey=name + * +featureGate=DynamicResourceAllocation + * +optional + */ + claims?: Array; + /** + * Limits describes the maximum amount of compute resources allowed. + * More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + * +optional + */ + limits?: V1ResourceList; + /** + * Requests describes the minimum amount of compute resources required. + * If Requests is omitted for a container, it defaults to Limits if that is explicitly specified, + * otherwise to an implementation-defined value. Requests cannot exceed Limits. + * More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + * +optional + */ + requests?: V1ResourceList; +}; + +export type K8sIoApiCoreV1ResourceClaim = { + /** + * Name must match the name of one entry in pod.spec.resourceClaims of + * the Pod where this field is used. It makes that resource available + * inside a container. + */ + name?: string; + /** + * Request is the name chosen for a request in the referenced claim. + * If empty, everything from the claim is made available, otherwise + * only the result of this request. + * + * +optional + */ + request?: string; +}; + +export type V1ResourceQuotaStatus = { + /** + * Hard is the set of enforced hard limits for each named resource. + * More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ + * +optional + */ + hard?: V1ResourceList; + /** + * Used is the current observed total usage of the resource in the namespace. + * +optional + */ + used?: V1ResourceList; +}; + +export type V1ResourceQuotaSpec = { + /** + * hard is the set of desired hard limits for each named resource. + * More info: https://kubernetes.io/docs/concepts/policy/resource-quotas/ + * +optional + */ + hard?: V1ResourceList; + /** + * scopeSelector is also a collection of filters like scopes that must match each object tracked by a quota + * but expressed using ScopeSelectorOperator in combination with possible values. + * For a resource to match, both scopes AND scopeSelector (if specified in spec), must be matched. + * +optional + */ + scopeSelector?: V1ScopeSelector; + /** + * A collection of filters that must match each object tracked by a quota. + * If not specified, the quota matches all objects. + * +optional + * +listType=atomic + */ + scopes?: Array; +}; + +export type V1ResourceQuota = { + /** + * APIVersion defines the versioned schema of this representation of an object. + * Servers should convert recognized schemas to the latest internal value, and + * may reject unrecognized values. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + * +optional + */ + apiVersion?: string; + /** + * Kind is a string value representing the REST resource this object represents. + * Servers may infer this from the endpoint the client submits requests to. + * Cannot be updated. + * In CamelCase. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * +optional + */ + kind?: string; + /** + * Standard object's metadata. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata + * +optional + */ + metadata?: V1ObjectMeta; + /** + * Spec defines the desired quota. + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + * +optional + */ + spec?: V1ResourceQuotaSpec; + /** + * Status defines the actual enforced quota and its current usage. + * https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#spec-and-status + * +optional + */ + status?: V1ResourceQuotaStatus; +}; + +export const V1ResourceName = { + /** + * ResourceCPU + */ + RESOURCE_CPU: 'cpu', + /** + * ResourceMemory + */ + RESOURCE_MEMORY: 'memory', + /** + * ResourceStorage + */ + RESOURCE_STORAGE: 'storage', + /** + * ResourceEphemeralStorage + */ + RESOURCE_EPHEMERAL_STORAGE: 'ephemeral-storage', + /** + * ResourcePods + */ + RESOURCE_PODS: 'pods', + /** + * ResourceServices + */ + RESOURCE_SERVICES: 'services', + /** + * ResourceReplicationControllers + */ + RESOURCE_REPLICATION_CONTROLLERS: 'replicationcontrollers', + /** + * ResourceQuotas + */ + RESOURCE_QUOTAS: 'resourcequotas', + /** + * ResourceSecrets + */ + RESOURCE_SECRETS: 'secrets', + /** + * ResourceConfigMaps + */ + RESOURCE_CONFIG_MAPS: 'configmaps', + /** + * ResourcePersistentVolumeClaims + */ + RESOURCE_PERSISTENT_VOLUME_CLAIMS: 'persistentvolumeclaims', + /** + * ResourceServicesNodePorts + */ + RESOURCE_SERVICES_NODE_PORTS: 'services.nodeports', + /** + * ResourceServicesLoadBalancers + */ + RESOURCE_SERVICES_LOAD_BALANCERS: 'services.loadbalancers', + /** + * ResourceRequestsCPU + */ + RESOURCE_REQUESTS_CPU: 'requests.cpu', + /** + * ResourceRequestsMemory + */ + RESOURCE_REQUESTS_MEMORY: 'requests.memory', + /** + * ResourceRequestsStorage + */ + RESOURCE_REQUESTS_STORAGE: 'requests.storage', + /** + * ResourceRequestsEphemeralStorage + */ + RESOURCE_REQUESTS_EPHEMERAL_STORAGE: 'requests.ephemeral-storage', + /** + * ResourceLimitsCPU + */ + RESOURCE_LIMITS_CPU: 'limits.cpu', + /** + * ResourceLimitsMemory + */ + RESOURCE_LIMITS_MEMORY: 'limits.memory', + /** + * ResourceLimitsEphemeralStorage + */ + RESOURCE_LIMITS_EPHEMERAL_STORAGE: 'limits.ephemeral-storage', +} as const; + +export type V1ResourceName = + (typeof V1ResourceName)[keyof typeof V1ResourceName]; + +export type V1ResourceFieldSelector = { + /** + * Container name: required for volumes, optional for env vars + * +optional + */ + containerName?: string; + /** + * Specifies the output format of the exposed resources, defaults to "1" + * +optional + */ + divisor?: ResourceQuantity; + /** + * Required: resource to select + */ + resource?: string; +}; + +export const V1PullPolicy = { + /** + * PullAlways + */ + PULL_ALWAYS: 'Always', + /** + * PullNever + */ + PULL_NEVER: 'Never', + /** + * PullIfNotPresent + */ + PULL_IF_NOT_PRESENT: 'IfNotPresent', +} as const; + +export type V1PullPolicy = (typeof V1PullPolicy)[keyof typeof V1PullPolicy]; + +export const V1Protocol = { + /** + * ProtocolTCP + */ + PROTOCOL_TCP: 'TCP', + /** + * ProtocolUDP + */ + PROTOCOL_UDP: 'UDP', + /** + * ProtocolSCTP + */ + PROTOCOL_SCTP: 'SCTP', +} as const; + +export type V1Protocol = (typeof V1Protocol)[keyof typeof V1Protocol]; + +export type V1Probe = { + /** + * Exec specifies a command to execute in the container. + * +optional + */ + exec?: V1ExecAction; + /** + * Minimum consecutive failures for the probe to be considered failed after having succeeded. + * Defaults to 3. Minimum value is 1. + * +optional + */ + failureThreshold?: number; + /** + * GRPC specifies a GRPC HealthCheckRequest. + * +optional + */ + grpc?: V1GrpcAction; + /** + * HTTPGet specifies an HTTP GET request to perform. + * +optional + */ + httpGet?: V1HttpGetAction; + /** + * Number of seconds after the container has started before liveness probes are initiated. + * More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + * +optional + */ + initialDelaySeconds?: number; + /** + * How often (in seconds) to perform the probe. + * Default to 10 seconds. Minimum value is 1. + * +optional + */ + periodSeconds?: number; + /** + * Minimum consecutive successes for the probe to be considered successful after having failed. + * Defaults to 1. Must be 1 for liveness and startup. Minimum value is 1. + * +optional + */ + successThreshold?: number; + /** + * TCPSocket specifies a connection to a TCP port. + * +optional + */ + tcpSocket?: V1TcpSocketAction; + /** + * Optional duration in seconds the pod needs to terminate gracefully upon probe failure. + * The grace period is the duration in seconds after the processes running in the pod are sent + * a termination signal and the time when the processes are forcibly halted with a kill signal. + * Set this value longer than the expected cleanup time for your process. + * If this value is nil, the pod's terminationGracePeriodSeconds will be used. Otherwise, this + * value overrides the value provided by the pod spec. + * Value must be non-negative integer. The value zero indicates stop immediately via + * the kill signal (no opportunity to shut down). + * This is a beta field and requires enabling ProbeTerminationGracePeriod feature gate. + * Minimum value is 1. spec.terminationGracePeriodSeconds is used if unset. + * +optional + */ + terminationGracePeriodSeconds?: number; + /** + * Number of seconds after which the probe times out. + * Defaults to 1 second. Minimum value is 1. + * More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + * +optional + */ + timeoutSeconds?: number; +}; + +export type V1HttpHeader = { + /** + * The header field name. + * This will be canonicalized upon output, so case-variant names will be understood as the same header. + */ + name?: string; + /** + * The header field value + */ + value?: string; +}; + +export type V1HttpGetAction = { + /** + * Host name to connect to, defaults to the pod IP. You probably want to set + * "Host" in httpHeaders instead. + * +optional + */ + host?: string; + /** + * Custom headers to set in the request. HTTP allows repeated headers. + * +optional + * +listType=atomic + */ + httpHeaders?: Array; + /** + * Path to access on the HTTP server. + * +optional + */ + path?: string; + /** + * Name or number of the port to access on the container. + * Number must be in the range 1 to 65535. + * Name must be an IANA_SVC_NAME. + */ + port?: IntstrIntOrString; + /** + * Scheme to use for connecting to the host. + * Defaults to HTTP. + * +optional + */ + scheme?: V1UriScheme; +}; + +export type V1GrpcAction = { + /** + * Port number of the gRPC service. Number must be in the range 1 to 65535. + */ + port?: number; + /** + * Service is the name of the service to place in the gRPC HealthCheckRequest + * (see https://github.com/grpc/grpc/blob/master/doc/health-checking.md). + * + * If this is not specified, the default behavior is defined by gRPC. + * +optional + * +default="" + */ + service?: string; +}; + +export type V1ExecAction = { + /** + * Command is the command line to execute inside the container, the working directory for the + * command is root ('/') in the container's filesystem. The command is simply exec'd, it is + * not run inside a shell, so traditional shell instructions ('|', etc) won't work. To use + * a shell, you need to explicitly call out to that shell. + * Exit status of 0 is treated as live/healthy and non-zero is unhealthy. + * +optional + * +listType=atomic + */ + command?: Array; +}; + +export const V1PersistentVolumeReclaimPolicy = { + /** + * PersistentVolumeReclaimRecycle + */ + PERSISTENT_VOLUME_RECLAIM_RECYCLE: 'Recycle', + /** + * PersistentVolumeReclaimDelete + */ + PERSISTENT_VOLUME_RECLAIM_DELETE: 'Delete', + /** + * PersistentVolumeReclaimRetain + */ + PERSISTENT_VOLUME_RECLAIM_RETAIN: 'Retain', +} as const; + +export type V1PersistentVolumeReclaimPolicy = + (typeof V1PersistentVolumeReclaimPolicy)[keyof typeof V1PersistentVolumeReclaimPolicy]; + +export const V1PersistentVolumePhase = { + /** + * VolumePending + */ + VOLUME_PENDING: 'Pending', + /** + * VolumeAvailable + */ + VOLUME_AVAILABLE: 'Available', + /** + * VolumeBound + */ + VOLUME_BOUND: 'Bound', + /** + * VolumeReleased + */ + VOLUME_RELEASED: 'Released', + /** + * VolumeFailed + */ + VOLUME_FAILED: 'Failed', +} as const; + +export type V1PersistentVolumePhase = + (typeof V1PersistentVolumePhase)[keyof typeof V1PersistentVolumePhase]; + +export const V1PersistentVolumeMode = { + /** + * PersistentVolumeBlock + */ + PERSISTENT_VOLUME_BLOCK: 'Block' /** + * PersistentVolumeFilesystem + */, + PERSISTENT_VOLUME_FILESYSTEM: 'Filesystem', +} as const; + +export type V1PersistentVolumeMode = + (typeof V1PersistentVolumeMode)[keyof typeof V1PersistentVolumeMode]; + +export const V1PersistentVolumeClaimPhase = { + /** + * ClaimPending + */ + CLAIM_PENDING: 'Pending', + /** + * ClaimBound + */ + CLAIM_BOUND: 'Bound', + /** + * ClaimLost + */ + CLAIM_LOST: 'Lost', +} as const; + +export type V1PersistentVolumeClaimPhase = + (typeof V1PersistentVolumeClaimPhase)[keyof typeof V1PersistentVolumeClaimPhase]; + +export const V1PersistentVolumeAccessMode = { + /** + * ReadWriteOnce + */ + READ_WRITE_ONCE: 'ReadWriteOnce', + /** + * ReadOnlyMany + */ + READ_ONLY_MANY: 'ReadOnlyMany', + /** + * ReadWriteMany + */ + READ_WRITE_MANY: 'ReadWriteMany', + /** + * ReadWriteOncePod + */ + READ_WRITE_ONCE_POD: 'ReadWriteOncePod', +} as const; + +export type V1PersistentVolumeAccessMode = + (typeof V1PersistentVolumeAccessMode)[keyof typeof V1PersistentVolumeAccessMode]; + +export type V1ObjectReference = { + /** + * API version of the referent. + * +optional + */ + apiVersion?: string; + /** + * If referring to a piece of an object instead of an entire object, this string + * should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. + * For example, if the object reference is to a container within a pod, this would take on a value like: + * "spec.containers{name}" (where "name" refers to the name of the container that triggered + * the event) or if no container name is specified "spec.containers[2]" (container with + * index 2 in this pod). This syntax is chosen only to have some well-defined way of + * referencing a part of an object. + * TODO: this design is not final and this field is subject to change in the future. + * +optional + */ + fieldPath?: string; + /** + * Kind of the referent. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + * +optional + */ + kind?: string; + /** + * Name of the referent. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * +optional + */ + name?: string; + /** + * Namespace of the referent. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/ + * +optional + */ + namespace?: string; + /** + * Specific resourceVersion to which this reference is made, if any. + * More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency + * +optional + */ + resourceVersion?: string; + /** + * UID of the referent. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids + * +optional + */ + uid?: string; +}; + +export type V1ObjectFieldSelector = { + /** + * Version of the schema the FieldPath is written in terms of, defaults to "v1". + * +optional + */ + apiVersion?: string; + /** + * Path of the field to select in the specified API version. + */ + fieldPath?: string; +}; + +export type V1NamespaceStatus = { + /** + * Represents the latest available observations of a namespace's current state. + * +optional + * +patchMergeKey=type + * +patchStrategy=merge + * +listType=map + * +listMapKey=type + */ + conditions?: Array; + /** + * Phase is the current lifecycle phase of the namespace. + * More info: https://kubernetes.io/docs/tasks/administer-cluster/namespaces/ + * +optional + */ + phase?: V1NamespacePhase; +}; + +export const V1NamespacePhase = { + /** + * NamespaceActive + */ + NAMESPACE_ACTIVE: 'Active' /** + * NamespaceTerminating + */, + NAMESPACE_TERMINATING: 'Terminating', +} as const; + +export type V1NamespacePhase = + (typeof V1NamespacePhase)[keyof typeof V1NamespacePhase]; + +export const V1NamespaceConditionType = { + /** + * NamespaceDeletionDiscoveryFailure + */ + NAMESPACE_DELETION_DISCOVERY_FAILURE: 'NamespaceDeletionDiscoveryFailure', + /** + * NamespaceDeletionContentFailure + */ + NAMESPACE_DELETION_CONTENT_FAILURE: 'NamespaceDeletionContentFailure', + /** + * NamespaceDeletionGVParsingFailure + */ + NAMESPACE_DELETION_GV_PARSING_FAILURE: + 'NamespaceDeletionGroupVersionParsingFailure', + /** + * NamespaceContentRemaining + */ + NAMESPACE_CONTENT_REMAINING: 'NamespaceContentRemaining', + /** + * NamespaceFinalizersRemaining + */ + NAMESPACE_FINALIZERS_REMAINING: 'NamespaceFinalizersRemaining', +} as const; + +export type V1NamespaceConditionType = + (typeof V1NamespaceConditionType)[keyof typeof V1NamespaceConditionType]; + +export const K8sIoApiCoreV1ConditionStatus = { + /** + * ConditionTrue + */ + CONDITION_TRUE: 'True', + /** + * ConditionFalse + */ + CONDITION_FALSE: 'False', + /** + * ConditionUnknown + */ + CONDITION_UNKNOWN: 'Unknown', +} as const; + +export type K8sIoApiCoreV1ConditionStatus = + (typeof K8sIoApiCoreV1ConditionStatus)[keyof typeof K8sIoApiCoreV1ConditionStatus]; + +export type V1NamespaceCondition = { + /** + * Last time the condition transitioned from one status to another. + * +optional + */ + lastTransitionTime?: string; + /** + * Human-readable message indicating details about last transition. + * +optional + */ + message?: string; + /** + * Unique, one-word, CamelCase reason for the condition's last transition. + * +optional + */ + reason?: string; + /** + * Status of the condition, one of True, False, Unknown. + */ + status?: K8sIoApiCoreV1ConditionStatus; + /** + * Type of namespace controller condition. + */ + type?: V1NamespaceConditionType; +}; + +export type V1LocalObjectReference = { + /** + * Name of the referent. + * This field is effectively required, but due to backwards compatibility is + * allowed to be empty. Instances of this type with an empty value here are + * almost certainly wrong. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * +optional + * +default="" + * +kubebuilder:default="" + * TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. + */ + name?: string; +}; + +export type V1LifecycleHandler = { + /** + * Exec specifies a command to execute in the container. + * +optional + */ + exec?: V1ExecAction; + /** + * HTTPGet specifies an HTTP GET request to perform. + * +optional + */ + httpGet?: V1HttpGetAction; + /** + * Sleep represents a duration that the container should sleep. + * +optional + */ + sleep?: V1SleepAction; + /** + * Deprecated. TCPSocket is NOT supported as a LifecycleHandler and kept + * for backward compatibility. There is no validation of this field and + * lifecycle hooks will fail at runtime when it is specified. + * +optional + */ + tcpSocket?: V1TcpSocketAction; +}; + +export type V1Lifecycle = { + /** + * PostStart is called immediately after a container is created. If the handler fails, + * the container is terminated and restarted according to its restart policy. + * Other management of the container blocks until the hook completes. + * More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks + * +optional + */ + postStart?: V1LifecycleHandler; + /** + * PreStop is called immediately before a container is terminated due to an + * API request or management event such as liveness/startup probe failure, + * preemption, resource contention, etc. The handler is not called if the + * container crashes or exits. The Pod's termination grace period countdown begins before the + * PreStop hook is executed. Regardless of the outcome of the handler, the + * container will eventually terminate within the Pod's termination grace + * period (unless delayed by finalizers). Other management of the container blocks until the hook completes + * or until the termination grace period is reached. + * More info: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#container-hooks + * +optional + */ + preStop?: V1LifecycleHandler; + /** + * StopSignal defines which signal will be sent to a container when it is being stopped. + * If not specified, the default is defined by the container runtime in use. + * StopSignal can only be set for Pods with a non-empty .spec.os.name + * +optional + */ + stopSignal?: V1Signal; +}; + +export type V1FileKeySelector = { + /** + * The key within the env file. An invalid key will prevent the pod from starting. + * The keys defined within a source may consist of any printable ASCII characters except '='. + * During Alpha stage of the EnvFiles feature gate, the key size is limited to 128 characters. + * +required + */ + key?: string; + /** + * Specify whether the file or its key must be defined. If the file or key + * does not exist, then the env var is not published. + * If optional is set to true and the specified key does not exist, + * the environment variable will not be set in the Pod's containers. + * + * If optional is set to false and the specified key does not exist, + * an error will be returned during Pod creation. + * +optional + * +default=false + */ + optional?: boolean; + /** + * The path within the volume from which to select the file. + * Must be relative and may not contain the '..' path or start with '..'. + * +required + */ + path?: string; + /** + * The name of the volume mount containing the env file. + * +required + */ + volumeName?: string; +}; + +export type V1EnvVarSource = { + /** + * Selects a key of a ConfigMap. + * +optional + */ + configMapKeyRef?: V1ConfigMapKeySelector; + /** + * Selects a field of the pod: supports metadata.name, metadata.namespace, `metadata.labels['']`, `metadata.annotations['']`, + * spec.nodeName, spec.serviceAccountName, status.hostIP, status.podIP, status.podIPs. + * +optional + */ + fieldRef?: V1ObjectFieldSelector; + /** + * FileKeyRef selects a key of the env file. + * Requires the EnvFiles feature gate to be enabled. + * + * +featureGate=EnvFiles + * +optional + */ + fileKeyRef?: V1FileKeySelector; + /** + * Selects a resource of the container: only resources limits and requests + * (limits.cpu, limits.memory, limits.ephemeral-storage, requests.cpu, requests.memory and requests.ephemeral-storage) are currently supported. + * +optional + */ + resourceFieldRef?: V1ResourceFieldSelector; + /** + * Selects a key of a secret in the pod's namespace + * +optional + */ + secretKeyRef?: V1SecretKeySelector; +}; + +export type V1ConfigMapKeySelector = { + /** + * The key to select. + */ + key?: string; + /** + * Name of the referent. + * This field is effectively required, but due to backwards compatibility is + * allowed to be empty. Instances of this type with an empty value here are + * almost certainly wrong. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * +optional + * +default="" + * +kubebuilder:default="" + * TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. + */ + name?: string; + /** + * Specify whether the ConfigMap or its key must be defined + * +optional + */ + optional?: boolean; +}; + +export type V1EnvVar = { + /** + * Name of the environment variable. + * May consist of any printable ASCII characters except '='. + */ + name?: string; + /** + * Variable references $(VAR_NAME) are expanded + * using the previously defined environment variables in the container and + * any service environment variables. If a variable cannot be resolved, + * the reference in the input string will be unchanged. Double $$ are reduced + * to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. + * "$$(VAR_NAME)" will produce the string literal "$(VAR_NAME)". + * Escaped references will never be expanded, regardless of whether the variable + * exists or not. + * Defaults to "". + * +optional + */ + value?: string; + /** + * Source for the environment variable's value. Cannot be used if value is not empty. + * +optional + */ + valueFrom?: V1EnvVarSource; +}; + +export type V1EnvFromSource = { + /** + * The ConfigMap to select from + * +optional + */ + configMapRef?: V1ConfigMapEnvSource; + /** + * Optional text to prepend to the name of each environment variable. + * May consist of any printable ASCII characters except '='. + * +optional + */ + prefix?: string; + /** + * The Secret to select from + * +optional + */ + secretRef?: V1SecretEnvSource; +}; + +export type V1ConfigMapEnvSource = { + /** + * Name of the referent. + * This field is effectively required, but due to backwards compatibility is + * allowed to be empty. Instances of this type with an empty value here are + * almost certainly wrong. + * More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names + * +optional + * +default="" + * +kubebuilder:default="" + * TODO: Drop `kubebuilder:default` when controller-gen doesn't need it https://github.com/kubernetes-sigs/kubebuilder/issues/3896. + */ + name?: string; + /** + * Specify whether the ConfigMap must be defined + * +optional + */ + optional?: boolean; +}; + +export const V1ContainerRestartRuleOnExitCodesOperator = { + /** + * ContainerRestartRuleOnExitCodesOpIn + */ + CONTAINER_RESTART_RULE_ON_EXIT_CODES_OP_IN: 'In' /** + * ContainerRestartRuleOnExitCodesOpNotIn + */, + CONTAINER_RESTART_RULE_ON_EXIT_CODES_OP_NOT_IN: 'NotIn', +} as const; + +export type V1ContainerRestartRuleOnExitCodesOperator = + (typeof V1ContainerRestartRuleOnExitCodesOperator)[keyof typeof V1ContainerRestartRuleOnExitCodesOperator]; + +export type V1ContainerRestartRuleOnExitCodes = { + /** + * Represents the relationship between the container exit code(s) and the + * specified values. Possible values are: + * - In: the requirement is satisfied if the container exit code is in the + * set of specified values. + * - NotIn: the requirement is satisfied if the container exit code is + * not in the set of specified values. + * +required + */ + operator?: V1ContainerRestartRuleOnExitCodesOperator; + /** + * Specifies the set of values to check for container exit codes. + * At most 255 elements are allowed. + * +optional + * +listType=set + */ + values?: Array; +}; + +export const V1ContainerRestartRuleAction = { + /** + * ContainerRestartRuleActionRestart + */ + CONTAINER_RESTART_RULE_ACTION_RESTART: 'Restart' /** + * ContainerRestartRuleActionRestartAllContainers + */, + CONTAINER_RESTART_RULE_ACTION_RESTART_ALL_CONTAINERS: 'RestartAllContainers', +} as const; + +export type V1ContainerRestartRuleAction = + (typeof V1ContainerRestartRuleAction)[keyof typeof V1ContainerRestartRuleAction]; + +export type V1ContainerRestartRule = { + /** + * Specifies the action taken on a container exit if the requirements + * are satisfied. The only possible value is "Restart" to restart the + * container. + * +required + */ + action?: V1ContainerRestartRuleAction; + /** + * Represents the exit codes to check on container exits. + * +optional + * +oneOf=when + */ + exitCodes?: V1ContainerRestartRuleOnExitCodes; +}; + +export const V1ContainerRestartPolicy = { + /** + * ContainerRestartPolicyAlways + */ + CONTAINER_RESTART_POLICY_ALWAYS: 'Always', + /** + * ContainerRestartPolicyNever + */ + CONTAINER_RESTART_POLICY_NEVER: 'Never', + /** + * ContainerRestartPolicyOnFailure + */ + CONTAINER_RESTART_POLICY_ON_FAILURE: 'OnFailure', +} as const; + +export type V1ContainerRestartPolicy = + (typeof V1ContainerRestartPolicy)[keyof typeof V1ContainerRestartPolicy]; + +export type V1ContainerResizePolicy = { + /** + * Name of the resource to which this resource resize policy applies. + * Supported values: cpu, memory. + */ + resourceName?: V1ResourceName; + /** + * Restart policy to apply when specified resource is resized. + * If not specified, it defaults to NotRequired. + */ + restartPolicy?: V1ResourceResizeRestartPolicy; +}; + +export type V1ContainerPort = { + /** + * Number of port to expose on the pod's IP address. + * This must be a valid port number, 0 < x < 65536. + */ + containerPort?: number; + /** + * What host IP to bind the external port to. + * +optional + */ + hostIP?: string; + /** + * Number of port to expose on the host. + * If specified, this must be a valid port number, 0 < x < 65536. + * If HostNetwork is specified, this must match ContainerPort. + * Most containers do not need this. + * +optional + */ + hostPort?: number; + /** + * If specified, this must be an IANA_SVC_NAME and unique within the pod. Each + * named port in a pod must have a unique name. Name for the port that can be + * referred to by services. + * +optional + */ + name?: string; + /** + * Protocol for port. Must be UDP, TCP, or SCTP. + * Defaults to "TCP". + * +optional + * +default="TCP" + */ + protocol?: V1Protocol; +}; + +export type V1Container = { + /** + * Arguments to the entrypoint. + * The container image's CMD is used if this is not provided. + * Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + * cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + * to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + * produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + * of whether the variable exists or not. Cannot be updated. + * More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell + * +optional + * +listType=atomic + */ + args?: Array; + /** + * Entrypoint array. Not executed within a shell. + * The container image's ENTRYPOINT is used if this is not provided. + * Variable references $(VAR_NAME) are expanded using the container's environment. If a variable + * cannot be resolved, the reference in the input string will be unchanged. Double $$ are reduced + * to a single $, which allows for escaping the $(VAR_NAME) syntax: i.e. "$$(VAR_NAME)" will + * produce the string literal "$(VAR_NAME)". Escaped references will never be expanded, regardless + * of whether the variable exists or not. Cannot be updated. + * More info: https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#running-a-command-in-a-shell + * +optional + * +listType=atomic + */ + command?: Array; + /** + * List of environment variables to set in the container. + * Cannot be updated. + * +optional + * +patchMergeKey=name + * +patchStrategy=merge + * +listType=map + * +listMapKey=name + */ + env?: Array; + /** + * List of sources to populate environment variables in the container. + * The keys defined within a source may consist of any printable ASCII characters except '='. + * When a key exists in multiple + * sources, the value associated with the last source will take precedence. + * Values defined by an Env with a duplicate key will take precedence. + * Cannot be updated. + * +optional + * +listType=atomic + */ + envFrom?: Array; + /** + * Container image name. + * More info: https://kubernetes.io/docs/concepts/containers/images + * This field is optional to allow higher level config management to default or override + * container images in workload controllers like Deployments and StatefulSets. + * +optional + */ + image?: string; + /** + * Image pull policy. + * One of Always, Never, IfNotPresent. + * Defaults to Always if :latest tag is specified, or IfNotPresent otherwise. + * Cannot be updated. + * More info: https://kubernetes.io/docs/concepts/containers/images#updating-images + * +optional + */ + imagePullPolicy?: V1PullPolicy; + /** + * Actions that the management system should take in response to container lifecycle events. + * Cannot be updated. + * +optional + */ + lifecycle?: V1Lifecycle; + /** + * Periodic probe of container liveness. + * Container will be restarted if the probe fails. + * Cannot be updated. + * More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + * +optional + */ + livenessProbe?: V1Probe; + /** + * Name of the container specified as a DNS_LABEL. + * Each container in a pod must have a unique name (DNS_LABEL). + * Cannot be updated. + */ + name?: string; + /** + * List of ports to expose from the container. Not specifying a port here + * DOES NOT prevent that port from being exposed. Any port which is + * listening on the default "0.0.0.0" address inside a container will be + * accessible from the network. + * Modifying this array with strategic merge patch may corrupt the data. + * For more information See https://github.com/kubernetes/kubernetes/issues/108255. + * Cannot be updated. + * +optional + * +patchMergeKey=containerPort + * +patchStrategy=merge + * +listType=map + * +listMapKey=containerPort + * +listMapKey=protocol + */ + ports?: Array; + /** + * Periodic probe of container service readiness. + * Container will be removed from service endpoints if the probe fails. + * Cannot be updated. + * More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + * +optional + */ + readinessProbe?: V1Probe; + /** + * Resources resize policy for the container. + * This field cannot be set on ephemeral containers. + * +featureGate=InPlacePodVerticalScaling + * +optional + * +listType=atomic + */ + resizePolicy?: Array; + /** + * Compute Resources required by this container. + * Cannot be updated. + * More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/ + * +optional + */ + resources?: V1ResourceRequirements; + /** + * RestartPolicy defines the restart behavior of individual containers in a pod. + * This overrides the pod-level restart policy. When this field is not specified, + * the restart behavior is defined by the Pod's restart policy and the container type. + * Additionally, setting the RestartPolicy as "Always" for the init container will + * have the following effect: + * this init container will be continually restarted on + * exit until all regular containers have terminated. Once all regular + * containers have completed, all init containers with restartPolicy "Always" + * will be shut down. This lifecycle differs from normal init containers and + * is often referred to as a "sidecar" container. Although this init + * container still starts in the init container sequence, it does not wait + * for the container to complete before proceeding to the next init + * container. Instead, the next init container starts immediately after this + * init container is started, or after any startupProbe has successfully + * completed. + * +optional + */ + restartPolicy?: V1ContainerRestartPolicy; + /** + * Represents a list of rules to be checked to determine if the + * container should be restarted on exit. The rules are evaluated in + * order. Once a rule matches a container exit condition, the remaining + * rules are ignored. If no rule matches the container exit condition, + * the Container-level restart policy determines the whether the container + * is restarted or not. Constraints on the rules: + * - At most 20 rules are allowed. + * - Rules can have the same action. + * - Identical rules are not forbidden in validations. + * When rules are specified, container MUST set RestartPolicy explicitly + * even it if matches the Pod's RestartPolicy. + * +featureGate=ContainerRestartRules + * +optional + * +listType=atomic + */ + restartPolicyRules?: Array; + /** + * SecurityContext defines the security options the container should be run with. + * If set, the fields of SecurityContext override the equivalent fields of PodSecurityContext. + * More info: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ + * +optional + */ + securityContext?: V1SecurityContext; + /** + * StartupProbe indicates that the Pod has successfully initialized. + * If specified, no other probes are executed until this completes successfully. + * If this probe fails, the Pod will be restarted, just as if the livenessProbe failed. + * This can be used to provide different probe parameters at the beginning of a Pod's lifecycle, + * when it might take a long time to load data or warm a cache, than during steady-state operation. + * This cannot be updated. + * More info: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes + * +optional + */ + startupProbe?: V1Probe; + /** + * Whether this container should allocate a buffer for stdin in the container runtime. If this + * is not set, reads from stdin in the container will always result in EOF. + * Default is false. + * +optional + */ + stdin?: boolean; + /** + * Whether the container runtime should close the stdin channel after it has been opened by + * a single attach. When stdin is true the stdin stream will remain open across multiple attach + * sessions. If stdinOnce is set to true, stdin is opened on container start, is empty until the + * first client attaches to stdin, and then remains open and accepts data until the client disconnects, + * at which time stdin is closed and remains closed until the container is restarted. If this + * flag is false, a container processes that reads from stdin will never receive an EOF. + * Default is false + * +optional + */ + stdinOnce?: boolean; + /** + * Optional: Path at which the file to which the container's termination message + * will be written is mounted into the container's filesystem. + * Message written is intended to be brief final status, such as an assertion failure message. + * Will be truncated by the node if greater than 4096 bytes. The total message length across + * all containers will be limited to 12kb. + * Defaults to /dev/termination-log. + * Cannot be updated. + * +optional + */ + terminationMessagePath?: string; + /** + * Indicate how the termination message should be populated. File will use the contents of + * terminationMessagePath to populate the container status message on both success and failure. + * FallbackToLogsOnError will use the last chunk of container log output if the termination + * message file is empty and the container exited with an error. + * The log output is limited to 2048 bytes or 80 lines, whichever is smaller. + * Defaults to File. + * Cannot be updated. + * +optional + */ + terminationMessagePolicy?: V1TerminationMessagePolicy; + /** + * Whether this container should allocate a TTY for itself, also requires 'stdin' to be true. + * Default is false. + * +optional + */ + tty?: boolean; + /** + * volumeDevices is the list of block devices to be used by the container. + * +patchMergeKey=devicePath + * +patchStrategy=merge + * +listType=map + * +listMapKey=devicePath + * +optional + */ + volumeDevices?: Array; + /** + * Pod volumes to mount into the container's filesystem. + * Cannot be updated. + * +optional + * +patchMergeKey=mountPath + * +patchStrategy=merge + * +listType=map + * +listMapKey=mountPath + */ + volumeMounts?: Array; + /** + * Container's working directory. + * If not specified, the container runtime's default will be used, which + * might be configured in the container image. + * Cannot be updated. + * +optional + */ + workingDir?: string; +}; + +export type V1CsiPersistentVolumeSource = { + /** + * controllerExpandSecretRef is a reference to the secret object containing + * sensitive information to pass to the CSI driver to complete the CSI + * ControllerExpandVolume call. + * This field is optional, and may be empty if no secret is required. If the + * secret object contains more than one secret, all secrets are passed. + * +optional + */ + controllerExpandSecretRef?: V1SecretReference; + /** + * controllerPublishSecretRef is a reference to the secret object containing + * sensitive information to pass to the CSI driver to complete the CSI + * ControllerPublishVolume and ControllerUnpublishVolume calls. + * This field is optional, and may be empty if no secret is required. If the + * secret object contains more than one secret, all secrets are passed. + * +optional + */ + controllerPublishSecretRef?: V1SecretReference; + /** + * driver is the name of the driver to use for this volume. + * Required. + */ + driver?: string; + /** + * fsType to mount. Must be a filesystem type supported by the host operating system. + * Ex. "ext4", "xfs", "ntfs". + * +optional + */ + fsType?: string; + /** + * nodeExpandSecretRef is a reference to the secret object containing + * sensitive information to pass to the CSI driver to complete the CSI + * NodeExpandVolume call. + * This field is optional, may be omitted if no secret is required. If the + * secret object contains more than one secret, all secrets are passed. + * +optional + */ + nodeExpandSecretRef?: V1SecretReference; + /** + * nodePublishSecretRef is a reference to the secret object containing + * sensitive information to pass to the CSI driver to complete the CSI + * NodePublishVolume and NodeUnpublishVolume calls. + * This field is optional, and may be empty if no secret is required. If the + * secret object contains more than one secret, all secrets are passed. + * +optional + */ + nodePublishSecretRef?: V1SecretReference; + /** + * nodeStageSecretRef is a reference to the secret object containing sensitive + * information to pass to the CSI driver to complete the CSI NodeStageVolume + * and NodeStageVolume and NodeUnstageVolume calls. + * This field is optional, and may be empty if no secret is required. If the + * secret object contains more than one secret, all secrets are passed. + * +optional + */ + nodeStageSecretRef?: V1SecretReference; + /** + * readOnly value to pass to ControllerPublishVolumeRequest. + * Defaults to false (read/write). + * +optional + */ + readOnly?: boolean; + /** + * volumeAttributes of the volume to publish. + * +optional + */ + volumeAttributes?: { + [key: string]: string; + }; + /** + * volumeHandle is the unique volume name returned by the CSI volume + * plugin’s CreateVolume to refer to the volume on all subsequent calls. + * Required. + */ + volumeHandle?: string; +}; + +export type UsersUserUpdatePayload = { + NewPassword: string; + Password: string; + /** + * User role (1 for administrator account and 2 for regular account) + */ + Role: 1 | 2; + Theme?: UsersThemePayload; + UseCache: boolean; + Username: string; +}; + +export type UsersThemePayload = { + /** + * Color represents the color theme of the UI + */ + color?: 'dark' | 'light' | 'highcontrast' | 'auto'; +}; + +export type UsersUserUpdatePasswordPayload = { + /** + * New Password + */ + NewPassword: string; + /** + * Current Password + */ + Password: string; +}; + +export type UsersUserCreatePayload = { + Password: string; + /** + * User role (1 for administrator account and 2 for regular account) + */ + Role: 1 | 2; + Username: string; +}; + +export type UsersUserAccessTokenCreatePayload = { + description: string; + password: string; +}; + +export type UsersHelmUserRepositoryResponse = { + GlobalRepository?: string; + UserRepositories?: Array; +}; + +export type PortainerHelmUserRepository = { + /** + * Membership Identifier + */ + Id?: number; + /** + * Helm repository URL + */ + URL?: string; + /** + * User identifier + */ + UserId?: number; +}; + +export type UsersAdminInitPayload = { + /** + * Password for the admin user + */ + Password: string; + /** + * Username for the admin user + */ + Username: string; +}; + +export type UsersAddHelmRepoUrlPayload = { + url?: string; +}; + +export type UsersAccessTokenResponse = { + apiKey?: PortainerApiKey; + rawAPIKey?: string; +}; + +export type PortainerApiKey = { + /** + * Unix timestamp (UTC) when the API key was created + */ + dateCreated?: number; + description?: string; + /** + * Digest represents SHA256 hash of the raw API key + */ + digest?: string; + id?: number; + /** + * Unix timestamp (UTC) when the API key was last used + */ + lastUsed?: number; + /** + * API key identifier (7 char prefix) + */ + prefix?: string; + userId?: number; +}; + +export type UsersEffectiveAccessEntry = { + accessLocation?: UsersAccessLocation; + endpointId?: number; + endpointName?: string; + groupId?: number; + groupName?: string; + roleId?: number; + roleName?: string; + rolePriority?: number; + teamId?: number; + teamName?: string; +}; + +export const UsersAccessLocation = { + /** + * AccessLocationEnvironment + */ + ACCESS_LOCATION_ENVIRONMENT: 'environment' /** + * AccessLocationEnvironmentGroup + */, + ACCESS_LOCATION_ENVIRONMENT_GROUP: 'environmentGroup', +} as const; + +export type UsersAccessLocation = + (typeof UsersAccessLocation)[keyof typeof UsersAccessLocation]; + +export type UnstructuredUnstructured = { + /** + * Object is a JSON compatible map with string, float, int, bool, []interface{}, or + * map[string]interface{} + * children. + */ + Object?: { + [key: string]: unknown; + }; +}; + +export type TemplatesListResponse = { + templates?: Array; + version?: string; +}; + +export type PortainerTemplateVolume = { + /** + * Path on the host + */ + bind?: string; + /** + * Path inside the container + */ + container?: string; + /** + * Whether the volume used should be readonly + */ + readonly?: boolean; +}; + +export const PortainerTemplateType = { + /** + * _ + */ + '': 0, + /** + * ContainerTemplate + */ + CONTAINER_TEMPLATE: 1, + /** + * SwarmStackTemplate + */ + SWARM_STACK_TEMPLATE: 2, + /** + * ComposeStackTemplate + */ + COMPOSE_STACK_TEMPLATE: 3, +} as const; + +export type PortainerTemplateType = + (typeof PortainerTemplateType)[keyof typeof PortainerTemplateType]; + +export type PortainerTemplateRepository = { + /** + * Path to the stack file inside the git repository + */ + stackfile?: string; + /** + * URL of a git repository used to deploy a stack template. Mandatory for a Swarm/Compose stack template + */ + url?: string; +}; + +export type PortainerPair = { + name?: string; + value?: string; +}; + +export type PortainerTemplateEnvSelect = { + /** + * Will set this choice as the default choice + */ + default?: boolean; + /** + * Some text that will displayed as a choice + */ + text?: string; + /** + * A value that will be associated to the choice + */ + value?: string; +}; + +export type PortainerTemplateEnv = { + /** + * Default value that will be set for the variable + */ + default?: string; + /** + * Content of the tooltip that will be generated in the UI + */ + description?: string; + /** + * Text for the label that will be generated in the UI + */ + label?: string; + /** + * name of the environment(endpoint) variable + */ + name?: string; + /** + * If set to true, will not generate any input for this variable in the UI + */ + preset?: boolean; + /** + * A list of name/value that will be used to generate a dropdown in the UI + */ + select?: Array; +}; + +export type PortainerTemplate = { + /** + * Whether the template should be available to administrators only + */ + administrator_only?: boolean; + /** + * A list of categories associated to the template + */ + categories?: Array; + /** + * The command that will be executed in a container template + */ + command?: string; + /** + * Description of the template + */ + description?: string; + /** + * A list of environment(endpoint) variables used during the template deployment + */ + env?: Array; + /** + * Container hostname + */ + hostname?: string; + /** + * Mandatory container/stack fields + * Template Identifier + */ + id?: number; + /** + * Mandatory container fields + * Image associated to a container template. Mandatory for a container template + */ + image?: string; + /** + * Whether the container should be started in + * interactive mode (-i -t equivalent on the CLI) + */ + interactive?: boolean; + /** + * Container labels + */ + labels?: Array; + /** + * URL of the template's logo + */ + logo?: string; + /** + * Optional stack/container fields + * Default name for the stack/container to be used on deployment + */ + name?: string; + /** + * Name of a network that will be used on container deployment if it exists inside the environment(endpoint) + */ + network?: string; + /** + * A note that will be displayed in the UI. Supports HTML content + */ + note?: string; + /** + * Platform associated to the template. + * Valid values are: 'linux', 'windows' or leave empty for multi-platform + */ + platform?: string; + /** + * A list of ports exposed by the container + */ + ports?: Array; + /** + * Whether the container should be started in privileged mode + */ + privileged?: boolean; + /** + * Optional container fields + * The URL of a registry associated to the image for a container template + */ + registry?: string; + /** + * Mandatory stack fields + */ + repository?: PortainerTemplateRepository; + /** + * Container restart policy + */ + restart_policy?: string; + /** + * Mandatory Edge stack fields + * Stack file used for this template + */ + stackFile?: string; + /** + * Title of the template + */ + title?: string; + /** + * Template type. Valid values are: 1 (container), 2 (Swarm stack), 3 (Compose stack), 4 (Compose edge stack) + */ + type?: PortainerTemplateType; + /** + * A list of volumes used during the container template deployment + */ + volumes?: Array; +}; + +export type TemplatesFileResponse = { + /** + * The requested file content + */ + FileContent?: string; +}; + +export type TeamsTeamUpdatePayload = { + /** + * Name + */ + Name?: string; +}; + +export type TeamsTeamCreatePayload = { + /** + * Name + */ + Name: string; + /** + * TeamLeaders + */ + TeamLeaders?: Array; +}; + +export type TeammembershipsTeamMembershipUpdatePayload = { + /** + * Role for the user inside the team (1 for leader and 2 for regular member) + */ + Role: 1 | 2; + /** + * Team identifier + */ + TeamID: number; + /** + * User identifier + */ + UserID: number; +}; + +export type TeammembershipsTeamMembershipCreatePayload = { + /** + * Role for the user inside the team (1 for leader and 2 for regular member) + */ + Role: 1 | 2; + /** + * Team identifier + */ + TeamID: number; + /** + * User identifier + */ + UserID: number; +}; + +export type TagsTagCreatePayload = { + Name: string; +}; + +export type SystemVersionResponse = { + Build?: BuildBuildInfo; + DatabaseVersion?: string; + Dependencies?: BuildDependenciesInfo; + /** + * The latest version available + */ + LatestVersion?: string; + Runtime?: BuildRuntimeInfo; + ServerEdition?: string; + ServerVersion?: string; + /** + * Whether portainer has an update available + */ + UpdateAvailable?: boolean; + VersionSupport?: string; +}; + +export type BuildRuntimeInfo = { + Env?: Array; +}; + +export type BuildDependenciesInfo = { + ComposeVersion?: string; + DockerVersion?: string; + HelmVersion?: string; + KubectlVersion?: string; +}; + +export type BuildBuildInfo = { + BuildNumber?: string; + GitCommit?: string; + GoVersion?: string; + ImageTag?: string; + NodejsVersion?: string; + PnpmVersion?: string; + WebpackVersion?: string; +}; + +export type SystemSystemInfoResponse = { + agents?: number; + edgeAgents?: number; + platform?: PlatformContainerPlatform; +}; + +export const PlatformContainerPlatform = { + /** + * PlatformDocker + */ + PLATFORM_DOCKER: 'Docker', + /** + * PlatformDockerStandalone + */ + PLATFORM_DOCKER_STANDALONE: 'Docker Standalone', + /** + * PlatformDockerSwarm + */ + PLATFORM_DOCKER_SWARM: 'Docker Swarm', + /** + * PlatformKubernetes + */ + PLATFORM_KUBERNETES: 'Kubernetes', + /** + * PlatformPodman + */ + PLATFORM_PODMAN: 'Podman', +} as const; + +export type PlatformContainerPlatform = + (typeof PlatformContainerPlatform)[keyof typeof PlatformContainerPlatform]; + +export type SystemStatus = { + /** + * Server Instance ID + */ + InstanceID?: string; + /** + * Portainer API version + */ + Version?: string; +}; + +export type SystemNodesCountResponse = { + nodes?: number; +}; + +export type SwarmServiceUpdateResponse = { + /** + * Optional warning messages + */ + Warnings?: Array; +}; + +export type StatsContainerStats = { + healthy?: number; + running?: number; + stopped?: number; + total?: number; + unhealthy?: number; +}; + +export type StacksUpdateSwarmStackPayload = { + /** + * A list of environment(endpoint) variables used during stack deployment + */ + Env?: Array; + /** + * Prune services that are no longer referenced + */ + Prune?: boolean; + /** + * Deprecated(2.36): use RepullImageAndRedeploy instead for cleaner responsibility + * Force a pulling to current image with the original tag though the image is already the latest + */ + PullImage?: boolean; + /** + * RepullImageAndRedeploy indicates whether to force repulling images and redeploying the stack + */ + RepullImageAndRedeploy?: boolean; + /** + * New content of the Stack file + */ + StackFileContent?: string; +}; + +export type StacksSwarmStackFromGitRepositoryPayload = { + /** + * Applicable when deploying with multiple stack files + */ + AdditionalFiles?: Array; + /** + * Optional GitOps update configuration + */ + AutoUpdate?: PortainerAutoUpdateSettings; + /** + * Path to the Stack file inside the Git repository + */ + ComposeFile?: string; + /** + * A list of environment variables used during stack deployment + */ + Env?: Array; + /** + * Whether the stack is from a app template + */ + FromAppTemplate?: boolean; + /** + * Name of the stack + */ + Name: string; + /** + * Use basic authentication to clone the Git repository + */ + RepositoryAuthentication?: boolean; + /** + * Password used in basic authentication. Required when RepositoryAuthentication is true. + */ + RepositoryPassword?: string; + /** + * Reference name of a Git repository hosting the Stack file + */ + RepositoryReferenceName?: string; + /** + * URL of a Git repository hosting the Stack file + */ + RepositoryURL: string; + /** + * Username used in basic authentication. Required when RepositoryAuthentication is true. + */ + RepositoryUsername?: string; + /** + * Swarm cluster identifier + */ + SwarmID: string; + /** + * TLSSkipVerify skips SSL verification when cloning the Git repository + */ + TLSSkipVerify?: boolean; +}; + +export type StacksSwarmStackFromFileContentPayload = { + /** + * A list of environment variables used during stack deployment + */ + Env?: Array; + /** + * Whether the stack is from a app template + */ + FromAppTemplate?: boolean; + /** + * Name of the stack + */ + Name: string; + /** + * Content of the Stack file + */ + StackFileContent: string; + /** + * Swarm cluster identifier + */ + SwarmID: string; +}; + +export type StacksStackMigratePayload = { + /** + * Environment(Endpoint) identifier of the target environment(endpoint) where the stack will be relocated + */ + EndpointID: number; + /** + * If provided will rename the migrated stack + */ + Name?: string; + /** + * Swarm cluster identifier, must match the identifier of the cluster where the stack will be relocated + */ + SwarmID?: string; +}; + +export type StacksStackGitUpdatePayload = { + AdditionalFiles?: Array; + AutoUpdate?: PortainerAutoUpdateSettings; + ConfigFilePath?: string; + Env?: Array; + Prune?: boolean; + RepositoryAuthentication?: boolean; + RepositoryPassword?: string; + RepositoryReferenceName?: string; + RepositoryURL?: string; + RepositoryUsername?: string; + TLSSkipVerify?: boolean; +}; + +export type StacksStackGitRedeployPayload = { + Env?: Array; + Prune?: boolean; + /** + * Deprecated(2.36): use RepullImageAndRedeploy instead for cleaner responsibility + * Force a pulling to current image with the original tag though the image is already the latest + */ + PullImage?: boolean; + RepositoryAuthentication?: boolean; + RepositoryPassword?: string; + RepositoryReferenceName?: string; + RepositoryUsername?: string; + /** + * RepullImageAndRedeploy indicates whether to force repulling images and redeploying the stack + */ + RepullImageAndRedeploy?: boolean; + StackName?: string; +}; + +export type StacksStackFileResponse = { + /** + * Content of the Stack file + */ + StackFileContent?: string; +}; + +export type StacksKubernetesStringDeploymentPayload = { + ComposeFormat?: boolean; + /** + * Whether the stack is from a app template + */ + FromAppTemplate?: boolean; + Namespace?: string; + StackFileContent?: string; + StackName?: string; +}; + +export type StacksKubernetesManifestUrlDeploymentPayload = { + ComposeFormat?: boolean; + ManifestURL?: string; + Namespace?: string; + StackName?: string; +}; + +export type StacksKubernetesGitDeploymentPayload = { + AdditionalFiles?: Array; + AutoUpdate?: PortainerAutoUpdateSettings; + ComposeFormat?: boolean; + ManifestFile?: string; + Namespace?: string; + RepositoryAuthentication?: boolean; + RepositoryPassword?: string; + RepositoryReferenceName?: string; + RepositoryURL?: string; + RepositoryUsername?: string; + StackName?: string; + /** + * TLSSkipVerify skips SSL verification when cloning the Git repository + */ + TLSSkipVerify?: boolean; +}; + +export type StacksComposeStackFromGitRepositoryPayload = { + /** + * Applicable when deploying with multiple stack files + */ + AdditionalFiles?: Array; + /** + * Optional GitOps update configuration + */ + AutoUpdate?: PortainerAutoUpdateSettings; + /** + * Path to the Stack file inside the Git repository + */ + ComposeFile?: string; + /** + * A list of environment variables used during stack deployment + */ + Env?: Array; + /** + * Whether the stack is from a app template + */ + FromAppTemplate?: boolean; + /** + * Name of the stack + */ + Name: string; + /** + * Use basic authentication to clone the Git repository + */ + RepositoryAuthentication?: boolean; + /** + * Password used in basic authentication. Required when RepositoryAuthentication is true. + */ + RepositoryPassword?: string; + /** + * Reference name of a Git repository hosting the Stack file + */ + RepositoryReferenceName?: string; + /** + * URL of a Git repository hosting the Stack file + */ + RepositoryURL: string; + /** + * Username used in basic authentication. Required when RepositoryAuthentication is true. + */ + RepositoryUsername?: string; + /** + * TLSSkipVerify skips SSL verification when cloning the Git repository + */ + TLSSkipVerify?: boolean; +}; + +export type StacksComposeStackFromFileContentPayload = { + /** + * A list of environment variables used during stack deployment + */ + Env?: Array; + /** + * Whether the stack is from a app template + */ + FromAppTemplate?: boolean; + /** + * Name of the stack + */ + Name: string; + /** + * Content of the Stack file + */ + StackFileContent: string; +}; + +export type SslSslUpdatePayload = { + /** + * SSL Certificates + */ + Cert?: string; + HTTPEnabled?: boolean; + Key?: string; +}; + +export type SourcesConnectionInfo = { + authentication?: boolean; + configFilePath?: string; + referenceName?: string; + tlsSkipVerify?: boolean; +}; + +export type SourcesAutoUpdateInfo = { + fetchInterval?: string; + mechanism?: string; +}; + +export type SourcesSourceDetail = { + autoUpdate?: SourcesAutoUpdateInfo; + connection?: SourcesConnectionInfo; + environments?: number; + error?: string; + id?: string; + lastSync?: number; + name?: string; + status?: WorkflowsStatus; + type?: string; + url?: string; + usedBy?: number; + workflows?: Array; +}; + +export type SourcesSource = { + environments?: number; + error?: string; + id?: string; + lastSync?: number; + name?: string; + status?: WorkflowsStatus; + type?: string; + url?: string; + usedBy?: number; +}; + +export type SourcesGitSourceCreatePayload = { + authentication?: SourcesGitAuthenticationPayload; + clearAuthentication?: boolean; + name?: string; + tlsSkipVerify?: boolean; + url?: string; +}; + +export type SourcesGitAuthenticationPayload = { + authorizationType?: number; + password?: string; + provider?: number; + username?: string; +}; + +export type SettingsSettingsUpdatePayload = { + /** + * Active authentication method for the Portainer instance. Valid values are: 1 for internal, 2 for LDAP, or 3 for oauth + */ + AuthenticationMethod?: number; + /** + * A list of label name & value that will be used to hide containers when querying containers + */ + BlackListedLabels?: Array; + EdgeAgentCheckinInterval?: number; + /** + * EdgePortainerURL is the URL that is exposed to edge agents + */ + EdgePortainerURL?: string; + /** + * Whether edge compute features are enabled + */ + EnableEdgeComputeFeatures?: boolean; + /** + * EnforceEdgeID makes Portainer store the Edge ID instead of accepting anyone + */ + EnforceEdgeID?: boolean; + /** + * ForceSecureCookies forces the Secure attribute on auth cookies regardless of the detected scheme + */ + ForceSecureCookies?: boolean; + /** + * Deployment options for encouraging deployment as code + */ + GlobalDeploymentOptions?: PortainerGlobalDeploymentOptions; + /** + * Helm repository URL + */ + HelmRepositoryURL?: string; + InternalAuthSettings?: PortainerInternalAuthSettings; + /** + * The expiry of a Kubeconfig + */ + KubeconfigExpiry?: string; + /** + * Kubectl Shell Image + */ + KubectlShellImage?: string; + LDAPSettings?: PortainerLdapSettings; + /** + * URL to a logo that will be displayed on the login page as well as on top of the sidebar. Will use default Portainer logo when value is empty string + */ + LogoURL?: string; + OAuthSettings?: PortainerOAuthSettings; + /** + * The interval in which environment(endpoint) snapshots are created + */ + SnapshotInterval?: string; + /** + * URL to the templates that will be displayed in the UI when navigating to App Templates + */ + TemplatesURL?: string; + /** + * TrustOnFirstConnect makes Portainer accepting edge agent connection by default + */ + TrustOnFirstConnect?: boolean; + /** + * The duration of a user session + */ + UserSessionTimeout?: string; +}; + +export const Oauth2AuthStyle = { + /** + * AuthStyleAutoDetect + */ + AUTH_STYLE_AUTO_DETECT: 0, + /** + * AuthStyleInParams + */ + AUTH_STYLE_IN_PARAMS: 1, + /** + * AuthStyleInHeader + */ + AUTH_STYLE_IN_HEADER: 2, +} as const; + +export type Oauth2AuthStyle = + (typeof Oauth2AuthStyle)[keyof typeof Oauth2AuthStyle]; + +export type PortainerOAuthSettings = { + AccessTokenURI?: string; + AuthStyle?: Oauth2AuthStyle; + AuthorizationURI?: string; + ClientID?: string; + ClientSecret?: string; + DefaultTeamID?: number; + KubeSecretKey?: Array; + LogoutURI?: string; + OAuthAutoCreateUsers?: boolean; + RedirectURI?: string; + ResourceURI?: string; + SSO?: boolean; + Scopes?: string; + UserIdentifier?: string; +}; + +export type PortainerTlsConfiguration = { + /** + * Use TLS + */ + TLS?: boolean; + /** + * Path to the TLS CA certificate file + */ + TLSCACert?: string; + /** + * Path to the TLS client certificate file + */ + TLSCert?: string; + /** + * Path to the TLS client key file + */ + TLSKey?: string; + /** + * Skip the verification of the server TLS certificate + */ + TLSSkipVerify?: boolean; +}; + +export type PortainerLdapSearchSettings = { + /** + * The distinguished name of the element from which the LDAP server will search for users + */ + BaseDN?: string; + /** + * Optional LDAP search filter used to select user elements + */ + Filter?: string; + /** + * LDAP attribute which denotes the username + */ + UserNameAttribute?: string; +}; + +export type PortainerLdapGroupSearchSettings = { + /** + * LDAP attribute which denotes the group membership + */ + GroupAttribute?: string; + /** + * The distinguished name of the element from which the LDAP server will search for groups + */ + GroupBaseDN?: string; + /** + * The LDAP search filter used to select group elements, optional + */ + GroupFilter?: string; +}; + +export type PortainerLdapSettings = { + /** + * Enable this option if the server is configured for Anonymous access. When enabled, ReaderDN and Password will not be used + */ + AnonymousMode?: boolean; + /** + * Automatically provision users and assign them to matching LDAP group names + */ + AutoCreateUsers?: boolean; + GroupSearchSettings?: Array; + /** + * Password of the account that will be used to search users + */ + Password?: string; + /** + * Account that will be used to search for users + */ + ReaderDN?: string; + SearchSettings?: Array; + /** + * Whether LDAP connection should use StartTLS + */ + StartTLS?: boolean; + TLSConfig?: PortainerTlsConfiguration; + /** + * URL or IP address of the LDAP server + */ + URL?: string; +}; + +export type PortainerInternalAuthSettings = { + RequiredPasswordLength?: number; +}; + +export type PortainerGlobalDeploymentOptions = { + hideStacksFunctionality?: boolean; +}; + +export type SettingsPublicSettingsResponse = { + /** + * Active authentication method for the Portainer instance. Valid values are: 1 for internal, 2 for LDAP, or 3 for oauth + */ + AuthenticationMethod?: PortainerAuthenticationMethod; + Edge?: { + /** + * The check in interval for edge agent (in seconds) - used in non async mode [seconds] + */ + CheckinInterval?: number; + /** + * The command list interval for edge agent - used in edge async mode [seconds] + */ + CommandInterval?: number; + /** + * The ping interval for edge agent - used in edge async mode [seconds] + */ + PingInterval?: number; + /** + * The snapshot interval for edge agent - used in edge async mode [seconds] + */ + SnapshotInterval?: number; + }; + /** + * Whether edge compute features are enabled + */ + EnableEdgeComputeFeatures?: boolean; + /** + * Supported feature flags + */ + Features?: { + [key: string]: boolean; + }; + /** + * Deployment options for encouraging deployment as code + */ + GlobalDeploymentOptions?: PortainerGlobalDeploymentOptions; + IsDockerDesktopExtension?: boolean; + /** + * The expiry of a Kubeconfig + */ + KubeconfigExpiry?: string; + /** + * URL to a logo that will be displayed on the login page as well as on top of the sidebar. Will use default Portainer logo when value is empty string + */ + LogoURL?: string; + /** + * The URL used for oauth login + */ + OAuthLoginURI?: string; + /** + * The URL used for oauth logout + */ + OAuthLogoutURI?: string; + /** + * The minimum required length for a password of any user when using internal auth mode + */ + RequiredPasswordLength?: number; + /** + * Whether team sync is enabled + */ + TeamSync?: boolean; +}; + +export const PortainerAuthenticationMethod = { + /** + * _ + */ + '': 0, + /** + * AuthenticationInternal + */ + AUTHENTICATION_INTERNAL: 1, + /** + * AuthenticationLDAP + */ + AUTHENTICATION_LDAP: 2, + /** + * AuthenticationOAuth + */ + AUTHENTICATION_O_AUTH: 3, +} as const; + +export type PortainerAuthenticationMethod = + (typeof PortainerAuthenticationMethod)[keyof typeof PortainerAuthenticationMethod]; + +export type RoarRoarPortainerEndpointId = { + [key: string]: unknown; +}; + +export type ResourcecontrolsResourceControlUpdatePayload = { + /** + * Permit access to resource only to admins + */ + AdministratorsOnly?: boolean; + /** + * Permit access to the associated resource to any user + */ + Public?: boolean; + /** + * List of team identifiers with access to the associated resource + */ + Teams?: Array; + /** + * List of user identifiers with access to the associated resource + */ + Users?: Array; +}; + +export type ResourcecontrolsResourceControlCreatePayload = { + /** + * Permit access to resource only to admins + */ + AdministratorsOnly?: boolean; + /** + * Permit access to the associated resource to any user + */ + Public?: boolean; + ResourceID: string; + /** + * List of Docker resources that will inherit this access control + */ + SubResourceIDs?: Array; + /** + * List of team identifiers with access to the associated resource + */ + Teams?: Array; + /** + * Type of Resource. Valid values are: 1 - container, 2 - service + * 3 - volume, 4 - network, 5 - secret, 6 - stack, 7 - config, 8 - custom template, 9 - azure-container-group + */ + Type: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9; + /** + * List of user identifiers with access to the associated resource + */ + Users?: Array; +}; + +export const PortainerResourceControlType = { + /** + * _ + */ + '': 0, + /** + * ContainerResourceControl + */ + CONTAINER_RESOURCE_CONTROL: 1, + /** + * ServiceResourceControl + */ + SERVICE_RESOURCE_CONTROL: 2, + /** + * VolumeResourceControl + */ + VOLUME_RESOURCE_CONTROL: 3, + /** + * NetworkResourceControl + */ + NETWORK_RESOURCE_CONTROL: 4, + /** + * SecretResourceControl + */ + SECRET_RESOURCE_CONTROL: 5, + /** + * StackResourceControl + */ + STACK_RESOURCE_CONTROL: 6, + /** + * ConfigResourceControl + */ + CONFIG_RESOURCE_CONTROL: 7, + /** + * CustomTemplateResourceControl + */ + CUSTOM_TEMPLATE_RESOURCE_CONTROL: 8, + /** + * ContainerGroupResourceControl + */ + CONTAINER_GROUP_RESOURCE_CONTROL: 9, +} as const; + +export type PortainerResourceControlType = + (typeof PortainerResourceControlType)[keyof typeof PortainerResourceControlType]; + +export type ReleaseValues = { + computedValues?: string; + userSuppliedValues?: string; +}; + +export type ReleaseReleaseElement = { + appVersion?: string; + chart?: string; + name?: string; + namespace?: string; + revision?: string; + status?: string; + updated?: string; +}; + +export type ReleaseRelease = { + /** + * AppVersion is the app version of the release. + */ + appVersion?: string; + /** + * Chart is the chart that was released. + */ + chart?: ReleaseChart; + /** + * ChartReference are the labels that are used to identify the chart source. + */ + chartReference?: ReleaseChartReference; + /** + * Config is the set of extra Values added to the chart. + * These values override the default values inside of the chart. + */ + config?: { + [key: string]: unknown; + }; + /** + * Hooks are all of the hooks declared for this release. + */ + hooks?: Array; + /** + * Info provides information about a release + */ + info?: ReleaseInfo; + /** + * Manifest is the string representation of the rendered template. + */ + manifest?: string; + /** + * Name is the name of the release + */ + name?: string; + /** + * Namespace is the kubernetes namespace of the release. + */ + namespace?: string; + /** + * StackID is the ID of the Portainer stack associated with this release (if using GitOps) + */ + stackID?: number; + /** + * Values are the values used to deploy the chart. + */ + values?: ReleaseValues; + /** + * Version is an int which represents the revision of the release. + */ + version?: number; +}; + +export type ReleaseInfo = { + /** + * Deleted tracks when this object was deleted. + */ + deleted?: string; + /** + * Description is human-friendly "log entry" about this release. + */ + description?: string; + /** + * FirstDeployed is when the release was first deployed. + */ + first_deployed?: string; + /** + * LastDeployed is when the release was last deployed. + */ + last_deployed?: string; + /** + * Contains the rendered templates/NOTES.txt if available + */ + notes?: string; + /** + * Resources is the list of resources that are part of the release + */ + resources?: Array; + /** + * Status is the current state of the release + */ + status?: string; +}; + +export type ReleaseHookExecution = { + /** + * CompletedAt indicates the date/time this hook was completed. + */ + completed_at?: string; + /** + * Phase indicates whether the hook completed successfully + */ + phase?: string; + /** + * StartedAt indicates the date/time this hook was started + */ + started_at?: string; +}; + +export type GithubComPortainerPortainerPkgLibhelmReleaseHook = { + /** + * DeletePolicies are the policies that indicate when to delete the hook + */ + delete_policies?: Array; + /** + * Events are the events that this hook fires on. + */ + events?: Array; + /** + * Kind is the Kubernetes kind. + */ + kind?: string; + /** + * LastRun indicates the date/time this was last run. + */ + last_run?: ReleaseHookExecution; + /** + * Manifest is the manifest contents. + */ + manifest?: string; + name?: string; + /** + * Path is the chart-relative path to the template. + */ + path?: string; + /** + * Weight indicates the sort order for execution among similar Hook type + */ + weight?: number; +}; + +export type ReleaseChartReference = { + chartPath?: string; + registryID?: number; + repoURL?: string; +}; + +export type ReleaseMaintainer = { + /** + * Email is an optional email address to contact the named maintainer + */ + email?: string; + /** + * Name is a user name or organization name + */ + name?: string; + /** + * URL is an optional URL to an address for the named maintainer + */ + url?: string; +}; + +export type ReleaseMetadata = { + /** + * Annotations are additional mappings uninterpreted by Helm, + * made available for inspection by other applications. + */ + annotations?: { + [key: string]: string; + }; + /** + * The API Version of this chart. Required. + */ + apiVersion?: string; + /** + * The version of the application enclosed inside of this chart. + */ + appVersion?: string; + /** + * The condition to check to enable chart + */ + condition?: string; + /** + * Dependencies are a list of dependencies for a chart. + */ + dependencies?: Array; + /** + * Whether or not this chart is deprecated + */ + deprecated?: boolean; + /** + * A one-sentence description of the chart + */ + description?: string; + /** + * The URL to a relevant project page, git repo, or contact person + */ + home?: string; + /** + * The URL to an icon file. + */ + icon?: string; + /** + * A list of string keywords + */ + keywords?: Array; + /** + * KubeVersion is a SemVer constraint specifying the version of Kubernetes required. + */ + kubeVersion?: string; + /** + * A list of name and URL/email address combinations for the maintainer(s) + */ + maintainers?: Array; + /** + * The name of the chart. Required. + */ + name?: string; + /** + * Source is the URL to the source code of this chart + */ + sources?: Array; + /** + * The tags to check to enable chart + */ + tags?: string; + /** + * Specifies the chart type: application or library + */ + type?: string; + /** + * A SemVer 2 conformant version string of the chart. Required. + */ + version?: string; +}; + +export type ReleaseDependency = { + /** + * Alias usable alias to be used for the chart + */ + alias?: string; + /** + * A yaml path that resolves to a boolean, used for enabling/disabling charts (e.g. subchart1.enabled ) + */ + condition?: string; + /** + * Enabled bool determines if chart should be loaded + */ + enabled?: boolean; + /** + * ImportValues holds the mapping of source values to parent key to be imported. Each item can be a + * string or pair of child/parent sublist items. + */ + 'import-values'?: Array; + /** + * Name is the name of the dependency. + * + * This must mach the name in the dependency's Chart.yaml. + */ + name?: string; + /** + * The URL to the repository. + * + * Appending `index.yaml` to this string should result in a URL that can be + * used to fetch the repository index. + */ + repository?: string; + /** + * Tags can be used to group charts for enabling/disabling together + */ + tags?: Array; + /** + * Version is the version (range) of this chart. + * + * A lock file will always produce a single version, while a dependency + * may contain a semantic version range. + */ + version?: string; +}; + +export type ReleaseLock = { + /** + * Dependencies is the list of dependencies that this lock file has locked. + */ + dependencies?: Array; + /** + * Digest is a hash of the dependencies in Chart.yaml. + */ + digest?: string; + /** + * Generated is the date the lock file was last generated. + */ + generated?: string; +}; + +export type ReleaseFile = { + /** + * Data is the template as byte data. + */ + data?: Array; + /** + * Name is the path-like name of the template. + */ + name?: string; +}; + +export type ReleaseChart = { + /** + * Files are miscellaneous files in a chart archive, + * e.g. README, LICENSE, etc. + */ + files?: Array; + /** + * Lock is the contents of Chart.lock. + */ + lock?: ReleaseLock; + /** + * Metadata is the contents of the Chartfile. + */ + metadata?: ReleaseMetadata; + /** + * Schema is an optional JSON schema for imposing structure on Values + */ + schema?: Array; + /** + * Templates for this chart. + */ + templates?: Array; + /** + * Values are default config for this chart. + */ + values?: { + [key: string]: unknown; + }; +}; + +export type RegistriesRegistryUpdatePayload = { + /** + * Is authentication against this registry enabled + */ + Authentication: boolean; + /** + * BaseURL is used for quay registry + */ + BaseURL?: string; + /** + * ECR data + */ + Ecr?: PortainerEcrData; + /** + * Name that will be used to identify this registry + */ + Name: string; + /** + * Password used to authenticate against this registry. required when Authentication is true + */ + Password?: string; + /** + * Quay data + */ + Quay?: PortainerQuayRegistryData; + /** + * Registry access control + */ + RegistryAccesses?: PortainerRegistryAccesses; + /** + * URL or IP address of the Docker registry + */ + URL: string; + /** + * Username used to authenticate against this registry. Required when Authentication is true + */ + Username?: string; +}; + +export type PortainerUserAccessPolicies = { + [key: string]: PortainerAccessPolicy; +}; + +export type PortainerAccessPolicy = { + /** + * Namespaces is a list of namespaces that this access policy applies to. Only used for namespaced level roles + */ + Namespaces?: Array; + /** + * Role identifier. Reference the role that will be associated to this access policy + */ + RoleId?: number; +}; + +export type PortainerTeamAccessPolicies = { + [key: string]: PortainerAccessPolicy; +}; + +export type PortainerRegistryAccessPolicies = { + /** + * Kubernetes specific fields (with kubernetes, namespaces have access to a registry, if users/teams have access to the same namespace, they have access to the registry) + */ + Namespaces?: Array; + TeamAccessPolicies?: PortainerTeamAccessPolicies; + /** + * Docker specific fields (with docker, users/teams have access to a registry) + */ + UserAccessPolicies?: PortainerUserAccessPolicies; +}; + +export type PortainerRegistryAccesses = { + [key: string]: PortainerRegistryAccessPolicies; +}; + +export type PortainerQuayRegistryData = { + OrganisationName?: string; + UseOrganisation?: boolean; +}; + +export type PortainerEcrData = { + Region?: string; +}; + +export type RegistriesRegistryPingResponse = { + /** + * Message provides details about the connection test result + */ + message?: string; + /** + * Success indicates if the registry connection was successful + */ + success?: boolean; +}; + +export type RegistriesRegistryPingPayload = { + /** + * Password used to authenticate against this registry + */ + Password?: string; + /** + * Use TLS + */ + TLS?: boolean; + /** + * Registry Type. Valid values are: + * 1 (Quay.io), + * 2 (Azure container registry), + * 3 (custom registry), + * 4 (Gitlab registry), + * 5 (ProGet registry), + * 6 (DockerHub) + * 7 (ECR) + * 8 (Github registry) + */ + Type: 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8; + /** + * URL or IP address of the Docker registry + */ + URL: string; + /** + * Username used to authenticate against this registry + */ + Username?: string; +}; + +export const PortainerRegistryType = { + /** + * _ + */ + '': 0, + /** + * QuayRegistry + */ + QUAY_REGISTRY: 1, + /** + * AzureRegistry + */ + AZURE_REGISTRY: 2, + /** + * CustomRegistry + */ + CUSTOM_REGISTRY: 3, + /** + * GitlabRegistry + */ + GITLAB_REGISTRY: 4, + /** + * ProGetRegistry + */ + PRO_GET_REGISTRY: 5, + /** + * DockerHubRegistry + */ + DOCKER_HUB_REGISTRY: 6, + /** + * EcrRegistry + */ + ECR_REGISTRY: 7, + /** + * GithubRegistry + */ + GITHUB_REGISTRY: 8, +} as const; + +export type PortainerRegistryType = + (typeof PortainerRegistryType)[keyof typeof PortainerRegistryType]; + +export type RegistriesRegistryCreatePayload = { + /** + * Is authentication against this registry enabled + */ + Authentication: boolean; + /** + * BaseURL required for ProGet registry + */ + BaseURL?: string; + /** + * ECR specific details, required when type = 7 + */ + Ecr?: PortainerEcrData; + /** + * Gitlab specific details, required when type = 4 + */ + Gitlab?: PortainerGitlabRegistryData; + /** + * Name that will be used to identify this registry + */ + Name: string; + /** + * Password used to authenticate against this registry. required when Authentication is true + */ + Password?: string; + /** + * Quay specific details, required when type = 1 + */ + Quay?: PortainerQuayRegistryData; + /** + * Use TLS + */ + TLS?: boolean; + /** + * Registry Type. Valid values are: + * 1 (Quay.io), + * 2 (Azure container registry), + * 3 (custom registry), + * 4 (Gitlab registry), + * 5 (ProGet registry), + * 6 (DockerHub) + * 7 (ECR) + */ + Type: 1 | 2 | 3 | 4 | 5 | 6 | 7; + /** + * URL or IP address of the Docker registry + */ + URL: string; + /** + * Username used to authenticate against this registry. Required when Authentication is true + */ + Username?: string; +}; + +export type PortainerGitlabRegistryData = { + InstanceURL?: string; + ProjectId?: number; + ProjectPath?: string; +}; + +export type RegistriesRegistryConfigurePayload = { + /** + * Is authentication against this registry enabled + */ + Authentication: boolean; + /** + * Password used to authenticate against this registry. required when Authentication is true + */ + Password?: string; + /** + * ECR region + */ + Region?: string; + /** + * Use TLS + */ + TLS?: boolean; + /** + * The TLS CA certificate file + */ + TLSCACertFile?: Array; + /** + * The TLS client certificate file + */ + TLSCertFile?: Array; + /** + * The TLS client key file + */ + TLSKeyFile?: Array; + /** + * Skip the verification of the server TLS certificate + */ + TLSSkipVerify?: boolean; + /** + * Username used to authenticate against this registry. Required when Authentication is true + */ + Username?: string; +}; + +export type PortainerWebhook = { + EndpointId?: number; + /** + * Webhook Identifier + */ + Id?: number; + RegistryId?: number; + ResourceId?: string; + Token?: string; + /** + * Type of webhook (1 - service) + */ + Type?: PortainerWebhookType; +}; + +export type PortainerUserThemeSettings = { + /** + * Color represents the color theme of the UI + */ + color?: 'dark' | 'light' | 'highcontrast' | 'auto'; +}; + +export const PortainerUserRole = { + /** + * _ + */ + '': 0, + /** + * AdministratorRole + */ + ADMINISTRATOR_ROLE: 1, + /** + * StandardUserRole + */ + STANDARD_USER_ROLE: 2, +} as const; + +export type PortainerUserRole = + (typeof PortainerUserRole)[keyof typeof PortainerUserRole]; + +export type PortainerUserResourceAccess = { + AccessLevel?: PortainerResourceAccessLevel; + UserId?: number; +}; + +export const PortainerResourceAccessLevel = { + /** + * _ + */ + '': 0 /** + * ReadWriteAccessLevel + */, + READ_WRITE_ACCESS_LEVEL: 1, +} as const; + +export type PortainerResourceAccessLevel = + (typeof PortainerResourceAccessLevel)[keyof typeof PortainerResourceAccessLevel]; + +export type PortainerUser = { + /** + * Deprecated in DBVersion == 25 + */ + EndpointAuthorizations?: PortainerEndpointAuthorizations; + /** + * User Identifier + */ + Id?: number; + /** + * Deprecated in DBVersion == 25 + */ + PortainerAuthorizations?: PortainerAuthorizations; + /** + * User role (1 for administrator account and 2 for regular account) + */ + Role?: PortainerUserRole; + ThemeSettings?: PortainerUserThemeSettings; + TokenIssueAt?: number; + UseCache?: boolean; + /** + * Deprecated + */ + UserTheme?: string; + Username?: string; +}; + +export type PortainerAuthorizations = { + [key: string]: boolean; +}; + +export type PortainerEndpointAuthorizations = { + [key: string]: PortainerAuthorizations; +}; + +export type PortainerTeamResourceAccess = { + AccessLevel?: PortainerResourceAccessLevel; + TeamId?: number; +}; + +export type PortainerTeamMembership = { + /** + * Membership Identifier + */ + Id?: number; + /** + * Team role (1 for team leader and 2 for team member) + */ + Role?: PortainerMembershipRole; + /** + * Team identifier + */ + TeamID?: number; + /** + * User identifier + */ + UserID?: number; +}; + +export const PortainerMembershipRole = { + /** + * _ + */ + '': 0, + /** + * TeamLeader + */ + TEAM_LEADER: 1, + /** + * TeamMember + */ + TEAM_MEMBER: 2, +} as const; + +export type PortainerMembershipRole = + (typeof PortainerMembershipRole)[keyof typeof PortainerMembershipRole]; + +export type PortainerTeam = { + /** + * Team Identifier + */ + Id?: number; + /** + * Team name + */ + Name?: string; +}; + +export type PortainerTag = { + /** + * A set of environment(endpoint) group ids that have this tag + */ + EndpointGroups?: { + [key: string]: boolean; + }; + /** + * A set of environment(endpoint) ids that have this tag + */ + Endpoints?: { + [key: string]: boolean; + }; + /** + * Tag identifier + */ + ID?: number; + /** + * Tag name + */ + Name?: string; +}; + +export const PortainerStackType = { + /** + * _ + */ + '': 0, + /** + * DockerSwarmStack + */ + DOCKER_SWARM_STACK: 1, + /** + * DockerComposeStack + */ + DOCKER_COMPOSE_STACK: 2, + /** + * KubernetesStack + */ + KUBERNETES_STACK: 3, +} as const; + +export type PortainerStackType = + (typeof PortainerStackType)[keyof typeof PortainerStackType]; + +export const PortainerStackStatus = { + /** + * _ + */ + '': 0, + /** + * StackStatusActive + * + * 1 - deployed and running + */ + STACK_STATUS_ACTIVE: 1, + /** + * StackStatusInactive + * + * 2 - intentionally stopped + */ + STACK_STATUS_INACTIVE: 2, + /** + * StackStatusDeploying + * + * 3 - deployment in progress + */ + STACK_STATUS_DEPLOYING: 3, + /** + * StackStatusError + * + * 4 - deployment failed + */ + STACK_STATUS_ERROR: 4, +} as const; + +export type PortainerStackStatus = + (typeof PortainerStackStatus)[keyof typeof PortainerStackStatus]; + +export type PortainerStackOption = { + /** + * Enable atomic rollback on failure (Helm --atomic flag for Kubernetes Helm stacks) + */ + HelmAtomic?: boolean; + /** + * Prune services that are no longer referenced + */ + Prune?: boolean; +}; + +export type PortainerStackDeploymentStatus = { + /** + * populated on Error entries + */ + Message?: string; + Status?: PortainerStackStatus; + Time?: number; +}; + +export type PortainerStackDeploymentInfo = { + /** + * AdditionalFiles are the additional files used for deploying the stack + */ + AdditionalFiles?: Array; + /** + * ConfigFilePath is the path to the config file in the git repository used for deploying the stack + */ + ConfigFilePath?: string; + /** + * ConfigHash is the commit hash of the git repository used for deploying the stack + */ + ConfigHash?: string; + /** + * FileVersion is the version of the stack file, used to detect changes + */ + FileVersion?: number; + /** + * ReferenceName is the git reference (branch/tag) used for deploying the stack + */ + ReferenceName?: string; + /** + * RepositoryURL is the git repository URL used for deploying the stack + */ + RepositoryURL?: string; + /** + * Version is the version of the stack and also is the deployed version in edge agent + */ + Version?: number; +}; + +export type PortainerStack = { + /** + * Only applies when deploying stack with multiple files + */ + AdditionalFiles?: Array; + /** + * The GitOps update settings of a git stack + */ + AutoUpdate?: PortainerAutoUpdateSettings; + /** + * The username which created this stack + */ + CreatedBy?: string; + /** + * The date in unix time when stack was created + */ + CreationDate?: number; + /** + * CurrentDeploymentInfo records the git repository state at the time of the last actual deployment. + */ + CurrentDeploymentInfo?: PortainerStackDeploymentInfo; + /** + * DeploymentStartStatus is the stack status captured when the current + * deployment starts. It is used by deployment logic during the current + * deployment attempt and is cleared/replaced when a new deployment begins. + */ + DeploymentStartStatus?: PortainerStackStatus; + /** + * DeploymentStatus records the status progression of the current deployment. + * Cleared when a new deployment starts. + */ + DeploymentStatus?: Array; + /** + * Environment(Endpoint) identifier. Reference the environment(endpoint) that will be used for deployment + */ + EndpointId?: number; + /** + * EntryPoint is the path to the config file relative to the project root. + * NOTE: For git stacks this mirrors GitConfig.ConfigFilePath and the two are kept in sync + * by stackUpdateGit. The deploy command builder (compose_unpacker_cmd_builder) uses this + * field directly; Kubernetes deploy and git clone operations use GitConfig.ConfigFilePath. + */ + EntryPoint?: string; + /** + * A list of environment(endpoint) variables used during stack deployment + */ + Env?: Array; + /** + * Whether the stack is from a app template + */ + FromAppTemplate?: boolean; + /** + * GitConfig is the git repository configuration for git-backed stacks. + * Deprecated: loaded from Source via WorkflowID; kept for DB backwards-compatibility only. + * Non-migration code must not read or write this field; use Source records instead. + */ + GitConfig?: GittypesRepoConfig; + /** + * Stack Identifier + */ + Id?: number; + /** + * Stack name + */ + Name?: string; + /** + * Kubernetes namespace if stack is a kube application + */ + Namespace?: string; + /** + * The stack deployment option + */ + Option?: PortainerStackOption; + /** + * Path on disk to the repository hosting the Stack file + */ + ProjectPath?: string; + ResourceControl?: PortainerResourceControl; + /** + * Stack status (1 - active, 2 - inactive, 3 - deploying, 4 - error) + */ + Status?: PortainerStackStatus; + /** + * Cluster identifier of the Swarm cluster where the stack is deployed + */ + SwarmId?: string; + /** + * Stack type. 1 for a Swarm stack, 2 for a Compose stack + */ + Type?: PortainerStackType; + /** + * The date in unix time when stack was last updated + */ + UpdateDate?: number; + /** + * The username which last updated this stack + */ + UpdatedBy?: string; + /** + * WorkflowID is the ID of the Workflow that owns the Source for this stack. + */ + WorkflowID?: number; +}; + +export type PortainerResourceControl = { + AccessLevel?: PortainerResourceAccessLevel; + /** + * Permit access to resource only to admins + */ + AdministratorsOnly?: boolean; + /** + * ResourceControl Identifier + */ + Id?: number; + /** + * Deprecated fields + * Deprecated in DBVersion == 2 + */ + OwnerId?: number; + /** + * Permit access to the associated resource to any user + */ + Public?: boolean; + /** + * Docker resource identifier on which access control will be applied.\ + * In the case of a resource control applied to a stack, use the stack name as identifier + */ + ResourceId?: string; + /** + * List of Docker resources that will inherit this access control + */ + SubResourceIds?: Array; + System?: boolean; + TeamAccesses?: Array; + /** + * Type of Docker resource. Valid values are: 1- container, 2 -service + * 3 - volume, 4 - secret, 5 - stack, 6 - config or 7 - custom template + */ + Type?: PortainerResourceControlType; + UserAccesses?: Array; +}; + +export const PortainerSourceType = { + /** + * _ + */ + '': 0, + /** + * SourceTypeGit + */ + SOURCE_TYPE_GIT: 1, + /** + * SourceTypeRegistry + */ + SOURCE_TYPE_REGISTRY: 2, + /** + * SourceTypeHelm + */ + SOURCE_TYPE_HELM: 3, +} as const; + +export type PortainerSourceType = + (typeof PortainerSourceType)[keyof typeof PortainerSourceType]; + +export type PortainerSource = { + gitConfig?: GittypesRepoConfig; + helmConfig?: PortainerHelmConfig; + id?: number; + lastSync?: number; + name?: string; + registry?: PortainerRegistry; + type?: PortainerSourceType; +}; + +export type PortainerRegistryManagementConfiguration = { + AccessToken?: string; + AccessTokenExpiry?: number; + Authentication?: boolean; + Ecr?: PortainerEcrData; + Password?: string; + TLSConfig?: PortainerTlsConfiguration; + Type?: PortainerRegistryType; + Username?: string; +}; + +export type PortainerGithubRegistryData = { + OrganisationName?: string; + UseOrganisation?: boolean; +}; + +export type PortainerRegistry = { + /** + * Stores temporary access token + */ + AccessToken?: string; + AccessTokenExpiry?: number; + /** + * Is authentication against this registry enabled + */ + Authentication?: boolean; + /** + * Deprecated in DBVersion == 18 + */ + AuthorizedTeams?: Array; + /** + * Deprecated in DBVersion == 18 + */ + AuthorizedUsers?: Array; + /** + * Base URL, introduced for ProGet registry + */ + BaseURL?: string; + Ecr?: PortainerEcrData; + Github?: PortainerGithubRegistryData; + Gitlab?: PortainerGitlabRegistryData; + /** + * Registry Identifier + */ + Id?: number; + ManagementConfiguration?: PortainerRegistryManagementConfiguration; + /** + * Registry Name + */ + Name?: string; + /** + * Password or SecretAccessKey used to authenticate against this registry + */ + Password?: string; + Quay?: PortainerQuayRegistryData; + RegistryAccesses?: PortainerRegistryAccesses; + /** + * Deprecated in DBVersion == 31 + */ + TeamAccessPolicies?: PortainerTeamAccessPolicies; + /** + * Registry Type (1 - Quay, 2 - Azure, 3 - Custom, 4 - Gitlab, 5 - ProGet, 6 - DockerHub, 7 - ECR) + */ + Type?: 1 | 2 | 3 | 4 | 5 | 6 | 7; + /** + * URL or IP address of the Docker registry + */ + URL?: string; + /** + * Deprecated fields + * Deprecated in DBVersion == 31 + */ + UserAccessPolicies?: PortainerUserAccessPolicies; + /** + * Username or AccessKeyID used to authenticate against this registry + */ + Username?: string; +}; + +export type PortainerHelmConfig = { + /** + * Atomic enables automatic rollback on deployment failure (equivalent to helm --atomic). + * Used by both git repo and Helm repository deployments. + */ + Atomic?: boolean; + /** + * ChartName is the name of the Helm chart within the repository. + * Required for Helm repository deployments. + */ + ChartName?: string; + /** + * ChartPath is the path to a Helm chart folder within the cloned git repository. + * Used exclusively for git repo helm deployments. Mutually exclusive with ChartURL. + */ + ChartPath?: string; + /** + * ChartURL is the URL of a Helm chart repository. + * Used exclusively for Helm repository deployments. Mutually exclusive with ChartPath. + */ + ChartURL?: string; + /** + * ChartVersion is the version of the Helm chart to deploy. Empty means latest. + * Used exclusively for Helm repository deployments. + */ + ChartVersion?: string; + /** + * Namespace is the Kubernetes namespace to deploy the Helm chart into. + * Used by both git repo and Helm repository deployments. + */ + Namespace?: string; + /** + * Timeout sets the deadline for Helm operations (equivalent to helm --timeout, e.g. "5m0s"). + * Used by both git repo and Helm repository deployments. + */ + Timeout?: string; + /** + * ValuesFiles is a list of relative paths to Helm values YAML files within the cloned git repository. + * Used exclusively for git repo helm deployments. + */ + ValuesFiles?: Array; + /** + * ValuesInline is the inline YAML string of Helm values. + * Used exclusively for Helm repository deployments. + */ + ValuesInline?: string; +}; + +export type PortainerSettings = { + /** + * Container environment parameter AGENT_SECRET + */ + AgentSecret?: string; + AllowBindMountsForRegularUsers?: boolean; + AllowContainerCapabilitiesForRegularUsers?: boolean; + AllowDeviceMappingForRegularUsers?: boolean; + AllowHostNamespaceForRegularUsers?: boolean; + AllowPrivilegedModeForRegularUsers?: boolean; + AllowStackManagementForRegularUsers?: boolean; + AllowVolumeBrowserForRegularUsers?: boolean; + /** + * Active authentication method for the Portainer instance. Valid values are: 1 for internal, 2 for LDAP, or 3 for oauth + */ + AuthenticationMethod?: PortainerAuthenticationMethod; + /** + * A list of label name & value that will be used to hide containers when querying containers + */ + BlackListedLabels?: Array; + /** + * Deprecated fields + */ + DisplayDonationHeader?: boolean; + DisplayExternalContributors?: boolean; + Edge?: PortainerEdge; + /** + * The default check in interval for edge agent (in seconds) + */ + EdgeAgentCheckinInterval?: number; + /** + * EdgePortainerURL is the URL that is exposed to edge agents + */ + EdgePortainerUrl?: string; + /** + * Whether edge compute features are enabled + */ + EnableEdgeComputeFeatures?: boolean; + /** + * Deprecated fields v26 + */ + EnableHostManagementFeatures?: boolean; + /** + * EnforceEdgeID makes Portainer store the Edge ID instead of accepting anyone + */ + EnforceEdgeID?: boolean; + FeatureFlagSettings?: { + [key: string]: boolean; + }; + /** + * ForceSecureCookies forces the Secure attribute on auth cookies regardless of detected scheme. + * Enable when Portainer runs behind a TLS-terminating proxy. + */ + ForceSecureCookies?: boolean; + /** + * Deployment options for encouraging git ops workflows + */ + GlobalDeploymentOptions?: PortainerGlobalDeploymentOptions; + /** + * Helm repository URL, defaults to "https://charts.bitnami.com/bitnami" + */ + HelmRepositoryURL?: string; + InternalAuthSettings?: PortainerInternalAuthSettings; + IsDockerDesktopExtension?: boolean; + /** + * The expiry of a Kubeconfig + */ + KubeconfigExpiry?: string; + /** + * KubectlImage, defaults to portainer/kubectl-shell + */ + KubectlShellImage?: string; + LDAPSettings?: PortainerLdapSettings; + /** + * URL to a logo that will be displayed on the login page as well as on top of the sidebar. Will use default Portainer logo when value is empty string + */ + LogoURL?: string; + OAuthSettings?: PortainerOAuthSettings; + /** + * The interval in which environment(endpoint) snapshots are created + */ + SnapshotInterval?: string; + /** + * URL to the templates that will be displayed in the UI when navigating to App Templates + */ + TemplatesURL?: string; + /** + * TrustOnFirstConnect makes Portainer accepting edge agent connection by default + */ + TrustOnFirstConnect?: boolean; + /** + * The duration of a user session + */ + UserSessionTimeout?: string; +}; + +export type PortainerEdge = { + /** + * Deprecated 2.18 + */ + AsyncMode?: boolean; + /** + * The command list interval for edge agent - used in edge async mode (in seconds) + */ + CommandInterval?: number; + /** + * The ping interval for edge agent - used in edge async mode (in seconds) + */ + PingInterval?: number; + /** + * The snapshot interval for edge agent - used in edge async mode (in seconds) + */ + SnapshotInterval?: number; +}; + +export type PortainerSslSettings = { + certPath?: string; + httpEnabled?: boolean; + keyPath?: string; + selfSigned?: boolean; +}; + +export type PortainerRole = { + /** + * Authorizations associated to a role + */ + Authorizations?: PortainerAuthorizations; + /** + * Role description + */ + Description?: string; + /** + * Role Identifier + */ + Id?: number; + /** + * Role name + */ + Name?: string; + Priority?: number; +}; + +export type PortainerPerformanceMetrics = { + CPUUsage?: number; + DiskUsage?: number; + MemoryUsage?: number; + NetworkUsage?: number; +}; + +export type PortainerKubernetesStorageClassConfig = { + AccessModes?: Array; + AllowVolumeExpansion?: boolean; + Name?: string; + Provisioner?: string; +}; + +export type PortainerKubernetesSnapshot = { + DiagnosticsData?: PortainerDiagnosticsData; + KubernetesVersion?: string; + NodeCount?: number; + PerformanceMetrics?: PortainerPerformanceMetrics; + Time?: number; + TotalCPU?: number; + TotalMemory?: number; +}; + +export type PortainerDiagnosticsData = { + DNS?: { + [key: string]: string; + }; + Log?: string; + Proxy?: { + [key: string]: string; + }; + Telnet?: { + [key: string]: string; + }; +}; + +export type PortainerKubernetesIngressClassConfig = { + Blocked?: boolean; + BlockedNamespaces?: Array; + Name?: string; + Type?: string; +}; + +export type PortainerKubernetesFlags = { + IsServerIngressClassDetected?: boolean; + IsServerMetricsDetected?: boolean; + IsServerStorageDetected?: boolean; +}; + +export type PortainerKubernetesData = { + Configuration?: PortainerKubernetesConfiguration; + Flags?: PortainerKubernetesFlags; + Snapshots?: Array; +}; + +export type PortainerKubernetesConfiguration = { + AllowNoneIngressClass?: boolean; + EnableResourceOverCommit?: boolean; + IngressAvailabilityPerNamespace?: boolean; + IngressClasses?: Array; + ResourceOverCommitPercentage?: number; + RestrictDefaultNamespace?: boolean; + StorageClasses?: Array; + UseLoadBalancer?: boolean; + UseServerMetrics?: boolean; +}; + +export type PortainerK8sNodesLimits = { + [key: string]: PortainerK8sNodeLimits; +}; + +export type PortainerK8sNodeLimits = { + CPU?: number; + Memory?: number; +}; + +export type PortainerK8sNamespaceInfo = { + Annotations?: { + [key: string]: string; + }; + CreationDate?: string; + Id?: string; + IsDefault?: boolean; + IsSystem?: boolean; + Name?: string; + NamespaceOwner?: string; + ResourceQuota?: V1ResourceQuota; + Status?: V1NamespaceStatus; + UnhealthyEventCount?: number; +}; + +export type PortainerEnvironmentEdgeSettings = { + /** + * Whether the device has been started in edge async mode + */ + AsyncMode?: boolean; + /** + * The command list interval for edge agent - used in edge async mode [seconds] + */ + CommandInterval?: number; + /** + * The ping interval for edge agent - used in edge async mode [seconds] + */ + PingInterval?: number; + /** + * The snapshot interval for edge agent - used in edge async mode [seconds] + */ + SnapshotInterval?: number; +}; + +export const PortainerEndpointType = { + /** + * _ + */ + '': 0, + /** + * DockerEnvironment + */ + DOCKER_ENVIRONMENT: 1, + /** + * AgentOnDockerEnvironment + */ + AGENT_ON_DOCKER_ENVIRONMENT: 2, + /** + * AzureEnvironment + */ + AZURE_ENVIRONMENT: 3, + /** + * EdgeAgentOnDockerEnvironment + */ + EDGE_AGENT_ON_DOCKER_ENVIRONMENT: 4, + /** + * KubernetesLocalEnvironment + */ + KUBERNETES_LOCAL_ENVIRONMENT: 5, + /** + * AgentOnKubernetesEnvironment + */ + AGENT_ON_KUBERNETES_ENVIRONMENT: 6, + /** + * EdgeAgentOnKubernetesEnvironment + */ + EDGE_AGENT_ON_KUBERNETES_ENVIRONMENT: 7, +} as const; + +export type PortainerEndpointType = + (typeof PortainerEndpointType)[keyof typeof PortainerEndpointType]; + +export const PortainerEndpointStatus = { + /** + * _ + */ + '': 0, + /** + * EndpointStatusUp + */ + ENDPOINT_STATUS_UP: 1, + /** + * EndpointStatusDown + */ + ENDPOINT_STATUS_DOWN: 2, +} as const; + +export type PortainerEndpointStatus = + (typeof PortainerEndpointStatus)[keyof typeof PortainerEndpointStatus]; + +export type PortainerEndpointSecuritySettings = { + /** + * Whether non-administrator should be able to use bind mounts when creating containers + */ + allowBindMountsForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use container capabilities + */ + allowContainerCapabilitiesForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use device mapping + */ + allowDeviceMappingForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use the host pid + */ + allowHostNamespaceForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use privileged mode when creating containers + */ + allowPrivilegedModeForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use security-opt settings + */ + allowSecurityOptForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to manage stacks + */ + allowStackManagementForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use sysctl settings + */ + allowSysctlSettingForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to browse volumes + */ + allowVolumeBrowserForRegularUsers?: boolean; + /** + * Whether host management features are enabled + */ + enableHostManagementFeatures?: boolean; +}; + +export type PortainerEndpointPostInitMigrations = { + MigrateGPUs?: boolean; + MigrateIngresses?: boolean; + MigrateRegistrySASecrets?: boolean; +}; + +export type PortainerEndpointGroup = { + AuthorizedTeams?: Array; + /** + * Deprecated in DBVersion == 18 + */ + AuthorizedUsers?: Array; + /** + * Description associated to the environment(endpoint) group + */ + Description?: string; + /** + * Environment(Endpoint) group Identifier + */ + Id?: number; + /** + * Deprecated fields + */ + Labels?: Array; + /** + * Environment(Endpoint) group name + */ + Name?: string; + /** + * List of tags associated to this environment(endpoint) group + */ + TagIds?: Array; + /** + * Deprecated in DBVersion == 22 + */ + Tags?: Array; + TeamAccessPolicies?: PortainerTeamAccessPolicies; + UserAccessPolicies?: PortainerUserAccessPolicies; +}; + +export type PortainerEndpoint = { + Agent?: { + Version?: string; + }; + AuthorizedTeams?: Array; + /** + * Deprecated in DBVersion == 18 + */ + AuthorizedUsers?: Array; + AzureCredentials?: PortainerAzureCredentials; + /** + * Maximum version of docker-compose + */ + ComposeSyntaxMaxVersion?: string; + /** + * ContainerEngine represents the container engine type. This can be 'docker' or 'podman' when interacting directly with these environmentes, otherwise '' for kubernetes environments. + */ + ContainerEngine?: string; + Edge?: PortainerEnvironmentEdgeSettings; + /** + * The check in interval for edge agent (in seconds) + */ + EdgeCheckinInterval?: number; + /** + * The identifier of the edge agent associated with this environment(endpoint) + */ + EdgeID?: string; + /** + * The key which is used to map the agent to Portainer + */ + EdgeKey?: string; + EnableGPUManagement?: boolean; + Gpus?: Array; + /** + * Environment(Endpoint) group identifier + */ + GroupId?: number; + /** + * Heartbeat indicates the heartbeat status of an edge environment + */ + Heartbeat?: boolean; + /** + * Environment(Endpoint) Identifier + */ + Id?: number; + /** + * Deprecated v2.18 + */ + IsEdgeDevice?: boolean; + /** + * Associated Kubernetes data + */ + Kubernetes?: PortainerKubernetesData; + /** + * LastCheckInDate mark last check-in date on checkin + */ + LastCheckInDate?: number; + /** + * Environment(Endpoint) name + */ + Name?: string; + /** + * Whether we need to run any "post init migrations". + */ + PostInitMigrations?: PortainerEndpointPostInitMigrations; + /** + * URL or IP address where exposed containers will be reachable + */ + PublicURL?: string; + /** + * Environment(Endpoint) specific security settings + */ + SecuritySettings?: PortainerEndpointSecuritySettings; + /** + * List of snapshots + */ + Snapshots?: Array; + /** + * The status of the environment(endpoint) (1 - up, 2 - down) + */ + Status?: PortainerEndpointStatus; + /** + * Deprecated fields + * Deprecated in DBVersion == 4 + */ + TLS?: boolean; + TLSCACert?: string; + TLSCert?: string; + TLSConfig?: PortainerTlsConfiguration; + TLSKey?: string; + /** + * List of tag identifiers to which this environment(endpoint) is associated + */ + TagIds?: Array; + /** + * Deprecated in DBVersion == 22 + */ + Tags?: Array; + /** + * List of team identifiers authorized to connect to this environment(endpoint) + */ + TeamAccessPolicies?: PortainerTeamAccessPolicies; + /** + * Environment(Endpoint) environment(endpoint) type. 1 for a Docker environment(endpoint), 2 for an agent on Docker environment(endpoint) or 3 for an Azure environment(endpoint). + */ + Type?: PortainerEndpointType; + /** + * URL or IP address of the Docker host associated to this environment(endpoint) + */ + URL?: string; + /** + * List of user identifiers authorized to connect to this environment(endpoint) + */ + UserAccessPolicies?: PortainerUserAccessPolicies; + /** + * Whether the device has been trusted or not by the user + */ + UserTrusted?: boolean; +}; + +export type PortainerDockerSnapshotRaw = { + [key: string]: unknown; +}; + +export type PortainerDockerSnapshot = { + ContainerCount?: number; + DiagnosticsData?: PortainerDiagnosticsData; + DockerSnapshotRaw?: PortainerDockerSnapshotRaw; + DockerVersion?: string; + GpuUseAll?: boolean; + GpuUseList?: Array; + HealthyContainerCount?: number; + ImageCount?: number; + IsPodman?: boolean; + NodeCount?: number; + PerformanceMetrics?: PortainerPerformanceMetrics; + RunningContainerCount?: number; + ServiceCount?: number; + StackCount?: number; + StoppedContainerCount?: number; + Swarm?: boolean; + Time?: number; + TotalCPU?: number; + TotalMemory?: number; + UnhealthyContainerCount?: number; + VolumeCount?: number; +}; + +export type PortainerAzureCredentials = { + /** + * Azure application ID + */ + ApplicationID?: string; + /** + * Azure authentication key + */ + AuthenticationKey?: string; + /** + * Azure tenant ID + */ + TenantID?: string; +}; + +export const PortainerEdgeStackStatusType = { + /** + * EdgeStackStatusPending + */ + EDGE_STACK_STATUS_PENDING: 0, + /** + * EdgeStackStatusDeploymentReceived + */ + EDGE_STACK_STATUS_DEPLOYMENT_RECEIVED: 1, + /** + * EdgeStackStatusError + */ + EDGE_STACK_STATUS_ERROR: 2, + /** + * EdgeStackStatusAcknowledged + */ + EDGE_STACK_STATUS_ACKNOWLEDGED: 3, + /** + * EdgeStackStatusRemoved + */ + EDGE_STACK_STATUS_REMOVED: 4, + /** + * EdgeStackStatusRemoteUpdateSuccess + */ + EDGE_STACK_STATUS_REMOTE_UPDATE_SUCCESS: 5, + /** + * EdgeStackStatusImagesPulled + */ + EDGE_STACK_STATUS_IMAGES_PULLED: 6, + /** + * EdgeStackStatusRunning + */ + EDGE_STACK_STATUS_RUNNING: 7, + /** + * EdgeStackStatusDeploying + */ + EDGE_STACK_STATUS_DEPLOYING: 8, + /** + * EdgeStackStatusRemoving + */ + EDGE_STACK_STATUS_REMOVING: 9, + /** + * EdgeStackStatusPausedDeploying + */ + EDGE_STACK_STATUS_PAUSED_DEPLOYING: 10, + /** + * EdgeStackStatusRollingBack + */ + EDGE_STACK_STATUS_ROLLING_BACK: 11, + /** + * EdgeStackStatusRolledBack + */ + EDGE_STACK_STATUS_ROLLED_BACK: 12, + /** + * EdgeStackStatusCompleted + */ + EDGE_STACK_STATUS_COMPLETED: 13, +} as const; + +export type PortainerEdgeStackStatusType = + (typeof PortainerEdgeStackStatusType)[keyof typeof PortainerEdgeStackStatusType]; + +export type PortainerEdgeStackStatusDetails = { + Acknowledged?: boolean; + Error?: boolean; + ImagesPulled?: boolean; + Ok?: boolean; + Pending?: boolean; + RemoteUpdateSuccess?: boolean; + Remove?: boolean; +}; + +export type PortainerEdgeStackStatus = { + /** + * EE only feature + */ + DeploymentInfo?: PortainerStackDeploymentInfo; + /** + * Deprecated + */ + Details?: PortainerEdgeStackStatusDetails; + EndpointID?: number; + /** + * Deprecated + */ + Error?: string; + /** + * ReadyRePullImage is a flag to indicate whether the auto update is trigger to re-pull image + */ + ReadyRePullImage?: boolean; + Status?: Array; + /** + * Deprecated + */ + Type?: PortainerEdgeStackStatusType; +}; + +export type PortainerEdgeStackDeploymentStatus = { + Error?: string; + /** + * EE only feature + */ + RollbackTo?: number; + Time?: number; + Type?: PortainerEdgeStackStatusType; + Version?: number; +}; + +export const PortainerEdgeStackDeploymentType = { + /** + * EdgeStackDeploymentCompose + */ + EDGE_STACK_DEPLOYMENT_COMPOSE: 0 /** + * EdgeStackDeploymentKubernetes + */, + EDGE_STACK_DEPLOYMENT_KUBERNETES: 1, +} as const; + +export type PortainerEdgeStackDeploymentType = + (typeof PortainerEdgeStackDeploymentType)[keyof typeof PortainerEdgeStackDeploymentType]; + +export type PortainerEdgeStack = { + /** + * The username which created this stack + */ + CreatedBy?: string; + /** + * The username id which created this stack + */ + CreatedByUserId?: string; + /** + * StatusArray map[EndpointID][]EdgeStackStatus `json:"StatusArray"` + */ + CreationDate?: number; + DeploymentType?: PortainerEdgeStackDeploymentType; + EdgeGroups?: Array; + EntryPoint?: string; + /** + * EdgeStack Identifier + */ + Id?: number; + ManifestPath?: string; + Name?: string; + NumDeployments?: number; + ProjectPath?: string; + Status?: { + [key: string]: PortainerEdgeStackStatus; + }; + /** + * Uses the manifest's namespaces instead of the default one + */ + UseManifestNamespaces?: boolean; + Version?: number; +}; + +export const PortainerEdgeJobLogsStatus = { + /** + * _ + */ + '': 0, + /** + * EdgeJobLogsStatusIdle + */ + EDGE_JOB_LOGS_STATUS_IDLE: 1, + /** + * EdgeJobLogsStatusPending + */ + EDGE_JOB_LOGS_STATUS_PENDING: 2, + /** + * EdgeJobLogsStatusCollected + */ + EDGE_JOB_LOGS_STATUS_COLLECTED: 3, +} as const; + +export type PortainerEdgeJobLogsStatus = + (typeof PortainerEdgeJobLogsStatus)[keyof typeof PortainerEdgeJobLogsStatus]; + +export type PortainerEdgeJobEndpointMeta = { + CollectLogs?: boolean; + LogsStatus?: PortainerEdgeJobLogsStatus; +}; + +export type PortainerEdgeJob = { + Created?: number; + CronExpression?: string; + EdgeGroups?: Array; + Endpoints?: { + [key: string]: PortainerEdgeJobEndpointMeta; + }; + /** + * Field used for log collection of Endpoints belonging to EdgeGroups + */ + GroupLogsCollection?: { + [key: string]: PortainerEdgeJobEndpointMeta; + }; + /** + * EdgeJob Identifier + */ + Id?: number; + Name?: string; + Recurring?: boolean; + ScriptPath?: string; + Version?: number; +}; + +export type PortainerEdgeGroup = { + Dynamic?: boolean; + EndpointIds?: RoarRoarPortainerEndpointId; + /** + * Deprecated: only used for API responses + */ + Endpoints?: Array; + /** + * EdgeGroup Identifier + */ + Id?: number; + Name?: string; + PartialMatch?: boolean; + TagIds?: Array; +}; + +export type PortainerCustomTemplateVariableDefinition = { + defaultValue?: string; + description?: string; + label?: string; + name?: string; +}; + +export const PortainerCustomTemplatePlatform = { + /** + * _ + */ + '': 0, + /** + * CustomTemplatePlatformLinux + */ + CUSTOM_TEMPLATE_PLATFORM_LINUX: 1, + /** + * CustomTemplatePlatformWindows + */ + CUSTOM_TEMPLATE_PLATFORM_WINDOWS: 2, +} as const; + +export type PortainerCustomTemplatePlatform = + (typeof PortainerCustomTemplatePlatform)[keyof typeof PortainerCustomTemplatePlatform]; + +export type PortainerCustomTemplate = { + /** + * User identifier who created this template + */ + CreatedByUserId?: number; + /** + * Description of the template + */ + Description?: string; + /** + * EdgeTemplate indicates if this template purpose for Edge Stack + */ + EdgeTemplate?: boolean; + /** + * Path to the Stack file + */ + EntryPoint?: string; + GitConfig?: GittypesRepoConfig; + /** + * CustomTemplate Identifier + */ + Id?: number; + /** + * IsComposeFormat indicates if the Kubernetes template is created from a Docker Compose file + */ + IsComposeFormat?: boolean; + /** + * URL of the template's logo + */ + Logo?: string; + /** + * A note that will be displayed in the UI. Supports HTML content + */ + Note?: string; + /** + * Platform associated to the template. + * Valid values are: 1 - 'linux', 2 - 'windows' + */ + Platform?: 1 | 2; + /** + * Path on disk to the repository hosting the Stack file + */ + ProjectPath?: string; + ResourceControl?: PortainerResourceControl; + /** + * Title of the template + */ + Title?: string; + /** + * Type of created stack: + * * 1 - swarm + * * 2 - compose + * * 3 - kubernetes + */ + Type?: 1 | 2 | 3; + Variables?: Array; +}; + +export type MotdMotd = { + ContentLayout?: { + [key: string]: string; + }; + Hash?: Array; + Message?: string; + Style?: string; + Title?: string; +}; + +export type LdapCheckPayload = { + LDAPSettings?: PortainerLdapSettings; +}; + +export type KubernetesNamespacesToggleSystemPayload = { + /** + * Toggle the system state of this namespace to true or false + */ + System?: boolean; +}; + +export type KubernetesKubernetesVersionResponse = { + buildDate?: string; + compiler?: string; + /** + * EmulationMajor is the major version of the emulation version + */ + emulationMajor?: string; + /** + * EmulationMinor is the minor version of the emulation version + */ + emulationMinor?: string; + gitCommit?: string; + gitTreeState?: string; + gitVersion?: string; + goVersion?: string; + /** + * Major is the major version of the binary version + */ + major?: string; + /** + * MinCompatibilityMajor is the major version of the minimum compatibility version + */ + minCompatibilityMajor?: string; + /** + * MinCompatibilityMinor is the minor version of the minimum compatibility version + */ + minCompatibilityMinor?: string; + /** + * Minor is the minor version of the binary version + */ + minor?: string; + platform?: string; + /** + * SupportsPodRestart is true when the cluster exposes the `pods/restart` + * subresource via API discovery — i.e. the feature gate is enabled and + * the cluster version is recent enough. This is the authoritative + * signal for whether Portainer can call the pod-restart endpoint, and + * is preferred over a raw Kubernetes-version comparison. + */ + supportsPodRestart?: boolean; +}; + +export type KubernetesDescribeResourceResponse = { + describe?: string; +}; + +export type KubernetesTlsInfo = { + hosts?: Array; +}; + +export type KubernetesPublishedPort = { + IngressRules?: Array; + Port?: number; +}; + +export type KubernetesIngressRule = { + Host?: string; + IP?: string; + Path?: string; + TLS?: Array; +}; + +export type KubernetesPod = { + ContainerName?: string; + CreationDate?: string; + Image?: string; + ImagePullPolicy?: string; + Name?: string; + NodeName?: string; + PodIP?: string; + Resource?: KubernetesK8sApplicationResource; + Status?: string; + Uid?: string; +}; + +export type KubernetesK8sApplicationResource = { + CpuLimit?: number; + CpuRequest?: number; + MemoryLimit?: number; + MemoryRequest?: number; +}; + +export type KubernetesMetadata = { + annotations?: { + [key: string]: string; + }; + labels?: { + [key: string]: string; + }; +}; + +export type KubernetesK8sVolumeInfo = { + persistentVolume?: KubernetesK8sPersistentVolume; + persistentVolumeClaim?: KubernetesK8sPersistentVolumeClaim; + storageClass?: KubernetesK8sStorageClass; +}; + +export type KubernetesK8sStorageClass = { + allowVolumeExpansion?: boolean; + annotations?: { + [key: string]: string; + }; + creationDate?: string; + isDefault?: boolean; + labels?: { + [key: string]: string; + }; + mountOptions?: Array; + name?: string; + parameters?: { + [key: string]: string; + }; + provisioner?: string; + reclaimPolicy?: V1PersistentVolumeReclaimPolicy; +}; + +export type KubernetesCustomResourceMetadata = { + apiVersion?: string; + kind?: string; + name?: string; + plural?: string; + scope?: string; +}; + +export type KubernetesConfiguration = { + ConfigurationOwner?: string; + Data?: { + [key: string]: unknown; + }; + Kind?: string; +}; + +export type KubernetesK8sApplication = { + Annotations?: { + [key: string]: string; + }; + ApplicationOwner?: string; + ApplicationType?: string; + Configurations?: Array; + Containers?: Array; + CreationDate?: string; + CustomResourceMetadata?: KubernetesCustomResourceMetadata; + DeploymentType?: string; + Id?: string; + Image?: string; + Kind?: string; + Labels?: { + [key: string]: string; + }; + LoadBalancerIPAddress?: string; + MatchLabels?: { + [key: string]: string; + }; + Metadata?: KubernetesMetadata; + Name?: string; + Namespace?: string; + Pods?: Array; + PublishedPorts?: Array; + Resource?: KubernetesK8sApplicationResource; + ResourcePool?: string; + RunningPodsCount?: number; + ServiceId?: string; + ServiceName?: string; + ServiceType?: string; + StackId?: string; + StackKind?: string; + StackName?: string; + Status?: string; + TotalPodsCount?: number; + Uid?: string; +}; + +export type KubernetesK8sPersistentVolumeClaim = { + accessModes?: Array; + allowVolumeExpansion?: boolean; + creationDate?: string; + humanReadableAccessModes?: Array; + id?: string; + labels?: { + [key: string]: string; + }; + name?: string; + namespace?: string; + owningApplications?: Array; + phase?: V1PersistentVolumeClaimPhase; + resourcesRequests?: V1ResourceList; + storage?: number; + storageClass?: string; + storageRequest?: string; + volumeMode?: V1PersistentVolumeMode; + volumeName?: string; +}; + +export type KubernetesK8sPersistentVolume = { + accessModes?: Array; + annotations?: { + [key: string]: string; + }; + capacity?: V1ResourceList; + claimRef?: V1ObjectReference; + creationDate?: string; + csi?: V1CsiPersistentVolumeSource; + humanReadableAccessModes?: Array; + labels?: { + [key: string]: string; + }; + name?: string; + persistentVolumeReclaimPolicy?: V1PersistentVolumeReclaimPolicy; + status?: V1PersistentVolumePhase; + storageClassName?: string; + volumeMode?: V1PersistentVolumeMode; +}; + +export type KubernetesK8sVolumeDeleteRequest = { + name?: string; + namespace?: string; +}; + +export type KubernetesK8sServicePort = { + Name?: string; + NodePort?: number; + Port?: number; + Protocol?: string; + TargetPort?: string; +}; + +export type KubernetesK8sServiceIngress = { + Hostname?: string; + IP?: string; +}; + +export type KubernetesK8sServiceInfo = { + AllocateLoadBalancerNodePorts?: boolean; + Annotations?: { + [key: string]: string; + }; + /** + * serviceList screen + */ + Applications?: Array; + ClusterIPs?: Array; + CreationDate?: string; + ExternalIPs?: Array; + ExternalName?: string; + IngressStatus?: Array; + Labels?: { + [key: string]: string; + }; + Name?: string; + Namespace?: string; + Ports?: Array; + Selector?: { + [key: string]: string; + }; + Type?: string; + UID?: string; +}; + +export type KubernetesK8sServiceDeleteRequests = { + [key: string]: Array; +}; + +export type KubernetesK8sServiceAccountImagePullSecretsUpdatePayload = { + secretNames?: Array; +}; + +export type KubernetesK8sServiceAccountDeleteRequests = { + [key: string]: Array; +}; + +export type KubernetesK8sServiceAccount = { + annotations?: { + [key: string]: string; + }; + automountServiceAccountToken?: boolean; + creationDate?: string; + imagePullSecrets?: Array; + isSystem?: boolean; + labels?: { + [key: string]: string; + }; + name?: string; + namespace?: string; + uid?: string; +}; + +export type KubernetesK8sSecret = { + Annotations?: { + [key: string]: string; + }; + ConfigurationOwner?: string; + ConfigurationOwnerId?: string; + ConfigurationOwners?: Array; + CreationDate?: string; + Data?: { + [key: string]: string; + }; + IsUsed?: boolean; + Labels?: { + [key: string]: string; + }; + Name?: string; + Namespace?: string; + SecretType?: string; + UID?: string; +}; + +export type KubernetesK8sConfigurationOwnerResource = { + Id?: string; + Name?: string; + ResourceKind?: string; +}; + +export type KubernetesK8sRoleDeleteRequests = { + [key: string]: Array; +}; + +export type KubernetesK8sRoleBindingDeleteRequests = { + [key: string]: Array; +}; + +export type KubernetesK8sRoleBinding = { + creationDate?: string; + isSystem?: boolean; + name?: string; + namespace?: string; + roleRef?: V1RoleRef; + subjects?: Array; + uid?: string; +}; + +export type K8sIoApiRbacV1Subject = { + /** + * APIGroup holds the API group of the referenced subject. + * Defaults to "" for ServiceAccount subjects. + * Defaults to "rbac.authorization.k8s.io" for User and Group subjects. + * +optional + */ + apiGroup?: string; + /** + * Kind of object being referenced. Values defined by this API group are "User", "Group", and "ServiceAccount". + * If the Authorizer does not recognized the kind value, the Authorizer should report an error. + */ + kind?: string; + /** + * Name of the object being referenced. + * +required + * +k8s:required + */ + name?: string; + /** + * Namespace of the referenced object. If the object kind is non-namespace, such as "User" or "Group", and this value is not empty + * the Authorizer should report an error. + * +optional + */ + namespace?: string; +}; + +export type KubernetesK8sRole = { + creationDate?: string; + /** + * isSystem is true if prefixed with "system:" or exists in the kube-system namespace + * or is one of the portainer roles + */ + isSystem?: boolean; + name?: string; + namespace?: string; + uid?: string; +}; + +export type KubernetesK8sResourceQuota = { + cpu?: string; + enabled?: boolean; + memory?: string; +}; + +export type KubernetesK8sPvReclaimPolicyRequest = { + name?: string; + reclaimPolicy?: V1PersistentVolumeReclaimPolicy; +}; + +export type KubernetesK8sPvcResizeRequest = { + name?: string; + namespace?: string; + newSize?: string; +}; + +export type KubernetesK8sNamespaceDetails = { + Annotations?: { + [key: string]: string; + }; + Name?: string; + Owner?: string; + ResourceQuota?: KubernetesK8sResourceQuota; +}; + +export type KubernetesK8sJobDeleteRequests = { + [key: string]: Array; +}; + +export type KubernetesK8sJob = { + BackoffLimit?: number; + Command?: string; + Completions?: number; + Container?: V1Container; + Duration?: string; + FailedReason?: string; + FinishTime?: string; + Id?: string; + IsSystem?: boolean; + Name?: string; + Namespace?: string; + PodName?: string; + StartTime?: string; + Status?: string; +}; + +export type KubernetesK8sIngressTls = { + Hosts?: Array; + SecretName?: string; +}; + +export type KubernetesK8sIngressPath = { + HasService?: boolean; + Host?: string; + IngressName?: string; + Path?: string; + PathType?: string; + Port?: number; + ServiceName?: string; +}; + +export type KubernetesK8sIngressInfo = { + Annotations?: { + [key: string]: string; + }; + ClassName?: string; + CreationDate?: string; + Hosts?: Array; + Labels?: { + [key: string]: string; + }; + Name?: string; + Namespace?: string; + Paths?: Array; + TLS?: Array; + Type?: string; + UID?: string; +}; + +export type KubernetesK8sIngressDeleteRequests = { + [key: string]: Array; +}; + +export type KubernetesK8sIngressController = { + Availability?: boolean; + ClassName?: string; + Name?: string; + New?: boolean; + Type?: string; + Used?: boolean; +}; + +export type KubernetesK8sEventInvolvedObject = { + kind?: string; + name?: string; + namespace?: string; + uid?: string; +}; + +export type KubernetesK8sEvent = { + count?: number; + eventTime?: string; + firstTimestamp?: string; + involvedObject?: KubernetesK8sEventInvolvedObject; + kind?: string; + lastTimestamp?: string; + message?: string; + name?: string; + namespace?: string; + reason?: string; + type?: string; + uid?: string; +}; + +export type KubernetesK8sDashboard = { + applicationsCount?: number; + configMapsCount?: number; + ingressesCount?: number; + namespacesCount?: number; + secretsCount?: number; + servicesCount?: number; + volumesCount?: number; +}; + +export type KubernetesK8sCronJobDeleteRequests = { + [key: string]: Array; +}; + +export type KubernetesK8sCronJob = { + Command?: string; + Id?: string; + IsSystem?: boolean; + Jobs?: Array; + Name?: string; + Namespace?: string; + Schedule?: string; + Suspend?: boolean; + Timezone?: string; +}; + +export type KubernetesK8sConfigMap = { + Annotations?: { + [key: string]: string; + }; + ConfigurationOwner?: string; + ConfigurationOwnerId?: string; + ConfigurationOwners?: Array; + CreationDate?: string; + Data?: { + [key: string]: string; + }; + IsUsed?: boolean; + Labels?: { + [key: string]: string; + }; + Name?: string; + Namespace?: string; + UID?: string; +}; + +export type KubernetesK8sClusterRoleBinding = { + creationDate?: string; + isSystem?: boolean; + name?: string; + namespace?: string; + roleRef?: V1RoleRef; + subjects?: Array; + uid?: string; +}; + +export type KubernetesK8sClusterRole = { + creationDate?: string; + isSystem?: boolean; + name?: string; + uid?: string; +}; + +export type ImagesImageResponse = { + created?: number; + id?: string; + nodeName?: string; + size?: number; + tags?: Array; + /** + * Used is true if the image is used by at least one container + * supplied only when withUsage is true + */ + used?: boolean; +}; + +export type HelmInstallChartPayload = { + atomic?: boolean; + chart?: string; + name?: string; + namespace?: string; + repo?: string; + values?: string; + version?: string; +}; + +export type GitopsRepositoryFilePreviewPayload = { + /** + * TLSSkipVerify skips SSL verification when cloning the Git repository + */ + TLSSkipVerify?: boolean; + password?: string; + reference?: string; + repository: string; + /** + * Path to file whose content will be read + */ + targetFile?: string; + username?: string; +}; + +export type GitopsFileResponse = { + FileContent?: string; +}; + +export type EndpointsRegistryAccessPayload = { + Namespaces?: Array; + TeamAccessPolicies?: PortainerTeamAccessPolicies; + UserAccessPolicies?: PortainerUserAccessPolicies; +}; + +export type EndpointsPlatformCounts = { + azure?: number; + docker?: number; + kubernetes?: number; + podman?: number; +}; + +export type EndpointsHealthCounts = { + down?: number; + heartbeat?: number; + outdated?: number; + up?: number; +}; + +export type EndpointsGroupCount = { + count?: number; + groupID?: number; + groupName?: string; +}; + +export type EndpointsForceUpdateServicePayload = { + /** + * PullImage if true will pull the image + */ + PullImage?: boolean; + /** + * ServiceId to update + */ + ServiceID?: string; +}; + +export type EndpointsEndpointUpdateRelationsPayload = { + Relations?: { + [key: string]: { + EdgeGroups?: Array; + Group?: number; + Tags?: Array; + }; + }; +}; + +export type EndpointsEndpointUpdatePayload = { + /** + * Azure application ID + */ + AzureApplicationID?: string; + /** + * Azure authentication key + */ + AzureAuthenticationKey?: string; + /** + * Azure tenant ID + */ + AzureTenantID?: string; + /** + * The check in interval for edge agent (in seconds) + */ + EdgeCheckinInterval?: number; + /** + * GPUs information + */ + Gpus?: Array; + /** + * Group identifier + */ + GroupID?: number; + /** + * Associated Kubernetes data + */ + Kubernetes?: PortainerKubernetesData; + /** + * Name that will be used to identify this environment(endpoint) + */ + Name?: string; + /** + * URL or IP address where exposed containers will be reachable.\ + * Defaults to URL if not specified + */ + PublicURL?: string; + /** + * The status of the environment(endpoint) (1 - up, 2 - down) + */ + Status?: number; + /** + * Require TLS to connect against this environment(endpoint) + */ + TLS?: boolean; + /** + * Skip client verification when using TLS + */ + TLSSkipClientVerify?: boolean; + /** + * Skip server verification when using TLS + */ + TLSSkipVerify?: boolean; + /** + * List of tag identifiers to which this environment(endpoint) is associated + */ + TagIDs?: Array; + TeamAccessPolicies?: PortainerTeamAccessPolicies; + /** + * URL or IP address of a Docker host + */ + URL?: string; + UserAccessPolicies?: PortainerUserAccessPolicies; +}; + +export type EndpointsEndpointSettingsUpdatePayload = { + /** + * Whether non-administrator should be able to use bind mounts when creating containers + */ + allowBindMountsForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use container capabilities + */ + allowContainerCapabilitiesForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use device mapping + */ + allowDeviceMappingForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use the host pid + */ + allowHostNamespaceForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use privileged mode when creating containers + */ + allowPrivilegedModeForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use security-opt settings + */ + allowSecurityOptForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to manage stacks + */ + allowStackManagementForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to use sysctl settings + */ + allowSysctlSettingForRegularUsers?: boolean; + /** + * Whether non-administrator should be able to browse volumes + */ + allowVolumeBrowserForRegularUsers?: boolean; + enableGPUManagement?: boolean; + /** + * Whether host management features are enabled + */ + enableHostManagementFeatures?: boolean; + gpus?: Array; +}; + +export type EndpointsEndpointDeleteRequest = { + deleteCluster?: boolean; + id?: number; +}; + +export type EndpointsEndpointDeleteBatchPayload = { + endpoints?: Array; +}; + +export type EndpointsEndpointDeleteBatchPartialResponse = { + deleted?: Array; + errors?: Array; +}; + +export type EndpointsEndpointCreateGlobalKeyResponse = { + endpointID?: number; +}; + +export type EndpointsDockerhubStatusResponse = { + /** + * Daily limit + */ + limit?: number; + /** + * Remaiming images to pull + */ + remaining?: number; +}; + +export type EndpointsEnvironmentSummaryCountsResponse = { + byGroup?: Array; + byHealth?: EndpointsHealthCounts; + byPlatformType?: EndpointsPlatformCounts; + down?: number; + outdated?: number; + total?: number; + unassigned?: number; + up?: number; +}; + +export type EndpointgroupsEndpointGroupUpdatePayload = { + /** + * List of environment(endpoint) identifiers that will be part of this group + */ + AssociatedEndpoints?: Array; + /** + * Environment(Endpoint) group description + */ + Description?: string; + /** + * Environment(Endpoint) group name + */ + Name?: string; + /** + * List of tag identifiers associated to the environment(endpoint) group + */ + TagIDs?: Array; + TeamAccessPolicies?: PortainerTeamAccessPolicies; + UserAccessPolicies?: PortainerUserAccessPolicies; +}; + +export type EndpointgroupsEndpointGroupTypeInfo = { + Docker?: number; + Kubernetes?: number; + Mixed?: boolean; + Podman?: number; +}; + +export type EndpointgroupsEndpointGroupResponse = { + AuthorizedTeams?: Array; + /** + * Deprecated in DBVersion == 18 + */ + AuthorizedUsers?: Array; + /** + * Description associated to the environment(endpoint) group + */ + Description?: string; + /** + * Environment(Endpoint) group Identifier + */ + Id?: number; + /** + * Deprecated fields + */ + Labels?: Array; + /** + * Environment(Endpoint) group name + */ + Name?: string; + /** + * List of tags associated to this environment(endpoint) group + */ + TagIds?: Array; + /** + * Deprecated in DBVersion == 22 + */ + Tags?: Array; + TeamAccessPolicies?: PortainerTeamAccessPolicies; + Total?: number; + TypeInfo?: EndpointgroupsEndpointGroupTypeInfo; + UserAccessPolicies?: PortainerUserAccessPolicies; +}; + +export type EndpointgroupsEndpointGroupCreatePayload = { + /** + * List of environment(endpoint) identifiers that will be part of this group + */ + AssociatedEndpoints?: Array; + /** + * Environment(Endpoint) group description + */ + Description?: string; + /** + * Environment(Endpoint) group name + */ + Name: string; + /** + * List of tag identifiers to which this environment(endpoint) group is associated + */ + TagIDs?: Array; +}; + +export type EdgestacksUpdateStatusPayload = { + EndpointID?: number; + Error?: string; + Status?: PortainerEdgeStackStatusType; + Time?: number; + Version?: number; +}; + +export type EdgestacksUpdateEdgeStackPayload = { + DeploymentType?: PortainerEdgeStackDeploymentType; + EdgeGroups?: Array; + StackFileContent?: string; + UpdateVersion?: boolean; + /** + * Uses the manifest's namespaces instead of the default one + */ + UseManifestNamespaces?: boolean; +}; + +export type EdgestacksStackFileResponse = { + StackFileContent?: string; +}; + +export type EdgestacksEdgeStackFromStringPayload = { + /** + * Deployment type to deploy this stack + * Valid values are: 0 - 'compose', 1 - 'kubernetes' + * compose is enabled only for docker environments + * kubernetes is enabled only for kubernetes environments + */ + DeploymentType?: 0 | 1 | 2; + /** + * List of identifiers of EdgeGroups + */ + EdgeGroups?: Array; + /** + * Name of the stack + * Max length: 255 + * Name must only contains lowercase characters, numbers, hyphens, or underscores + * Name must start with a lowercase character or number + * Example: stack-name or stack_123 or stackName + */ + Name: string; + /** + * List of Registries to use for this stack + */ + Registries?: Array; + /** + * Content of the Stack file + */ + StackFileContent: string; + /** + * Uses the manifest's namespaces instead of the default one + */ + UseManifestNamespaces?: boolean; +}; + +export type EdgestacksEdgeStackFromGitRepositoryPayload = { + /** + * Deployment type to deploy this stack + * Valid values are: 0 - 'compose', 1 - 'kubernetes' + * compose is enabled only for docker environments + * kubernetes is enabled only for kubernetes environments + */ + DeploymentType?: 0 | 1 | 2; + /** + * List of identifiers of EdgeGroups + */ + EdgeGroups: Array; + /** + * Path to the Stack file inside the Git repository + */ + FilePathInRepository?: string; + /** + * Name of the stack + * Max length: 255 + * Name must only contains lowercase characters, numbers, hyphens, or underscores + * Name must start with a lowercase character or number + * Example: stack-name or stack_123 or stackName + */ + Name: string; + /** + * List of Registries to use for this stack + */ + Registries?: Array; + /** + * Use basic authentication to clone the Git repository + */ + RepositoryAuthentication?: boolean; + /** + * Password used in basic authentication. Required when RepositoryAuthentication is true. + */ + RepositoryPassword?: string; + /** + * Reference name of a Git repository hosting the Stack file + */ + RepositoryReferenceName?: string; + /** + * URL of a Git repository hosting the Stack file + */ + RepositoryURL: string; + /** + * Username used in basic authentication. Required when RepositoryAuthentication is true. + */ + RepositoryUsername?: string; + /** + * TLSSkipVerify skips SSL verification when cloning the Git repository + */ + TLSSkipVerify?: boolean; + /** + * Uses the manifest's namespaces instead of the default one + */ + UseManifestNamespaces?: boolean; +}; + +export type EdgejobsTaskContainer = { + EndpointId?: number; + EndpointName?: string; + Id?: string; + LogsStatus?: PortainerEdgeJobLogsStatus; +}; + +export type EdgejobsFileResponse = { + FileContent?: string; +}; + +export type EdgejobsEdgeJobUpdatePayload = { + CronExpression?: string; + EdgeGroups?: Array; + Endpoints?: Array; + FileContent?: string; + Name?: string; + Recurring?: boolean; +}; + +export type EdgejobsEdgeJobFileResponse = { + FileContent?: string; +}; + +export type EdgejobsEdgeJobCreateFromFileContentPayload = { + CronExpression?: string; + EdgeGroups?: Array; + Endpoints?: Array; + FileContent?: string; + Name?: string; + Recurring?: boolean; +}; + +export type EdgegroupsEdgeGroupUpdatePayload = { + Dynamic?: boolean; + Endpoints?: Array; + Name?: string; + PartialMatch?: boolean; + TagIDs?: Array; +}; + +export type EdgegroupsEdgeGroupCreatePayload = { + Dynamic?: boolean; + Endpoints?: Array; + Name?: string; + PartialMatch?: boolean; + TagIDs?: Array; +}; + +export type EdgegroupsDecoratedEdgeGroup = { + Dynamic?: boolean; + /** + * Shadow to avoid exposing in the API + */ + EndpointIds?: number; + EndpointTypes?: Array; + /** + * Deprecated: only used for API responses + */ + Endpoints?: Array; + HasEdgeJob?: boolean; + HasEdgeStack?: boolean; + /** + * EdgeGroup Identifier + */ + Id?: number; + Name?: string; + PartialMatch?: boolean; + TagIds?: Array; + TrustedEndpoints?: Array; +}; + +export type DockerImagesCounters = { + size?: number; + total?: number; +}; + +export type DockerDashboardResponse = { + containers?: StatsContainerStats; + images?: DockerImagesCounters; + networks?: number; + services?: number; + stacks?: number; + volumes?: number; +}; + +export type CustomtemplatesFileResponse = { + FileContent?: string; +}; + +export type CustomtemplatesCustomTemplateUpdatePayload = { + /** + * Path to the Stack file inside the Git repository + */ + ComposeFilePathInRepository?: string; + /** + * Description of the template + */ + Description: string; + /** + * EdgeTemplate indicates if this template purpose for Edge Stack + */ + EdgeTemplate?: boolean; + /** + * Content of stack file + */ + FileContent: string; + /** + * IsComposeFormat indicates if the Kubernetes template is created from a Docker Compose file + */ + IsComposeFormat?: boolean; + /** + * URL of the template's logo + */ + Logo?: string; + /** + * A note that will be displayed in the UI. Supports HTML content + */ + Note?: string; + /** + * Platform associated to the template. + * Valid values are: 1 - 'linux', 2 - 'windows' + * Required for Docker stacks + */ + Platform?: 1 | 2; + /** + * Use authentication to clone the Git repository + */ + RepositoryAuthentication?: boolean; + /** + * GitCredentialID used to identify the bound git credential. Required when RepositoryAuthentication + * is true and RepositoryUsername/RepositoryPassword are not provided + */ + RepositoryGitCredentialID?: number; + /** + * Password used in basic authentication or token used in token authentication. + * Required when RepositoryAuthentication is true and RepositoryGitCredentialID is 0 + */ + RepositoryPassword?: string; + /** + * Reference name of a Git repository hosting the Stack file + */ + RepositoryReferenceName?: string; + /** + * URL of a Git repository hosting the Stack file + */ + RepositoryURL: string; + /** + * Username used in basic authentication. Required when RepositoryAuthentication is true + * and RepositoryGitCredentialID is 0. Ignored if RepositoryAuthType is token + */ + RepositoryUsername?: string; + /** + * TLSSkipVerify skips SSL verification when cloning the Git repository + */ + TLSSkipVerify?: boolean; + /** + * Title of the template + */ + Title: string; + /** + * Type of created stack (1 - swarm, 2 - compose, 3 - kubernetes) + */ + Type: 1 | 2 | 3; + /** + * Definitions of variables in the stack file + */ + Variables?: Array; +}; + +export type CustomtemplatesCustomTemplateFromGitRepositoryPayload = { + /** + * Path to the Stack file inside the Git repository + */ + ComposeFilePathInRepository?: string; + /** + * Description of the template + */ + Description: string; + /** + * EdgeTemplate indicates if this template purpose for Edge Stack + */ + EdgeTemplate?: boolean; + /** + * IsComposeFormat indicates if the Kubernetes template is created from a Docker Compose file + */ + IsComposeFormat?: boolean; + /** + * URL of the template's logo + */ + Logo?: string; + /** + * A note that will be displayed in the UI. Supports HTML content + */ + Note?: string; + /** + * Platform associated to the template. + * Valid values are: 1 - 'linux', 2 - 'windows' + * Required for Docker stacks + */ + Platform?: 1 | 2; + /** + * Use basic authentication to clone the Git repository + */ + RepositoryAuthentication?: boolean; + /** + * Password used in basic authentication. Required when RepositoryAuthentication is true. + */ + RepositoryPassword?: string; + /** + * Reference name of a Git repository hosting the Stack file + */ + RepositoryReferenceName?: string; + /** + * URL of a Git repository hosting the Stack file + */ + RepositoryURL: string; + /** + * Username used in basic authentication. Required when RepositoryAuthentication is true. + */ + RepositoryUsername?: string; + /** + * TLSSkipVerify skips SSL verification when cloning the Git repository + */ + TLSSkipVerify?: boolean; + /** + * Title of the template + */ + Title: string; + /** + * Type of created stack: + * * 1 - swarm + * * 2 - compose + * * 3 - kubernetes + */ + Type: 1 | 2; + /** + * Definitions of variables in the stack file + */ + Variables?: Array; +}; + +export type CustomtemplatesCustomTemplateFromFileContentPayload = { + /** + * Description of the template + */ + Description: string; + /** + * EdgeTemplate indicates if this template purpose for Edge Stack + */ + EdgeTemplate?: boolean; + /** + * Content of stack file + */ + FileContent: string; + /** + * URL of the template's logo + */ + Logo?: string; + /** + * A note that will be displayed in the UI. Supports HTML content + */ + Note?: string; + /** + * Platform associated to the template. + * Valid values are: 1 - 'linux', 2 - 'windows' + * Required for Docker stacks + */ + Platform?: 1 | 2; + /** + * Title of the template + */ + Title: string; + /** + * Type of created stack: + * * 1 - swarm + * * 2 - compose + * * 3 - kubernetes + */ + Type: 1 | 2 | 3; + /** + * Definitions of variables in the stack file + */ + Variables?: Array; +}; + +export type ContainersContainerGpusResponse = { + gpus?: string; +}; + +export type BackupRestorePayload = { + FileContent?: Array; + FileName?: string; + Password?: string; +}; + +export type BackupBackupPayload = { + Password?: string; +}; + +export type AuthOauthPayload = { + /** + * OAuth code returned from OAuth Provided + */ + Code?: string; +}; + +export type AuthAuthenticateResponse = { + /** + * JWT token used to authenticate against the API + */ + jwt?: string; +}; + +export type AuthAuthenticatePayload = { + /** + * Password + */ + Password: string; + /** + * Username + */ + Username: string; +}; + +export type KubernetesK8sServiceInfo2 = KubernetesK8sServiceInfo; + +export type KubernetesK8sIngressInfo2 = KubernetesK8sIngressInfo; + +export type KubernetesK8sNamespaceDetails2 = KubernetesK8sNamespaceDetails; + +export type SourcesGitSourceCreatePayload2 = SourcesGitSourceCreatePayload; + +export type EndpointsEndpointDeleteBatchPayload2 = + EndpointsEndpointDeleteBatchPayload; + +/** + * Ingress controllers + */ +export type KubernetesK8sIngressControllerArray = + Array; + +export type AuthenticateUserData = { + /** + * Credentials used for authentication + */ + body: AuthAuthenticatePayload; + path?: never; + query?: never; + url: '/auth'; +}; + +export type AuthenticateUserErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Invalid Credentials + */ + 422: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type AuthenticateUserResponses = { + /** + * Success + */ + 200: AuthAuthenticateResponse; +}; + +export type AuthenticateUserResponse = + AuthenticateUserResponses[keyof AuthenticateUserResponses]; + +export type LogoutData = { + body?: never; + path?: never; + query?: never; + url: '/auth/logout'; +}; + +export type LogoutErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type LogoutResponses = { + /** + * Success + */ + 204: void; +}; + +export type LogoutResponse = LogoutResponses[keyof LogoutResponses]; + +export type ValidateOAuthData = { + /** + * OAuth Credentials used for authentication + */ + body: AuthOauthPayload; + path?: never; + query?: never; + url: '/auth/oauth/validate'; +}; + +export type ValidateOAuthErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Invalid Credentials + */ + 422: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type ValidateOAuthResponses = { + /** + * Success + */ + 200: AuthAuthenticateResponse; +}; + +export type ValidateOAuthResponse = + ValidateOAuthResponses[keyof ValidateOAuthResponses]; + +export type BackupData = { + /** + * An object contains the password to encrypt the backup with + */ + body?: BackupBackupPayload; + path?: never; + query?: never; + url: '/backup'; +}; + +export type BackupErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type BackupResponses = { + /** + * Success + */ + 200: unknown; +}; + +export type CustomTemplateListData = { + body?: never; + path?: never; + query: { + /** + * Template types + */ + type: Array<1 | 2 | 3>; + /** + * Filter by edge templates + */ + edge?: boolean; + }; + url: '/custom_templates'; +}; + +export type CustomTemplateListErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type CustomTemplateListResponses = { + /** + * Success + */ + 200: Array; +}; + +export type CustomTemplateListResponse = + CustomTemplateListResponses[keyof CustomTemplateListResponses]; + +export type CustomTemplateDeleteData = { + body?: never; + path: { + /** + * Template identifier + */ + id: number; + }; + query?: never; + url: '/custom_templates/{id}'; +}; + +export type CustomTemplateDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Access denied to resource + */ + 403: unknown; + /** + * Template not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type CustomTemplateDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type CustomTemplateDeleteResponse = + CustomTemplateDeleteResponses[keyof CustomTemplateDeleteResponses]; + +export type CustomTemplateInspectData = { + body?: never; + path: { + /** + * Template identifier + */ + id: number; + }; + query?: never; + url: '/custom_templates/{id}'; +}; + +export type CustomTemplateInspectErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Template not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type CustomTemplateInspectResponses = { + /** + * Success + */ + 200: PortainerCustomTemplate; +}; + +export type CustomTemplateInspectResponse = + CustomTemplateInspectResponses[keyof CustomTemplateInspectResponses]; + +export type CustomTemplateUpdateData = { + /** + * Template details + */ + body: CustomtemplatesCustomTemplateUpdatePayload; + path: { + /** + * Template identifier + */ + id: number; + }; + query?: never; + url: '/custom_templates/{id}'; +}; + +export type CustomTemplateUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied to access template + */ + 403: unknown; + /** + * Template not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type CustomTemplateUpdateResponses = { + /** + * Success + */ + 200: PortainerCustomTemplate; +}; + +export type CustomTemplateUpdateResponse = + CustomTemplateUpdateResponses[keyof CustomTemplateUpdateResponses]; + +export type CustomTemplateFileData = { + body?: never; + path: { + /** + * Template identifier + */ + id: number; + }; + query?: never; + url: '/custom_templates/{id}/file'; +}; + +export type CustomTemplateFileErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Custom template not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type CustomTemplateFileResponses = { + /** + * Success + */ + 200: CustomtemplatesFileResponse; +}; + +export type CustomTemplateFileResponse = + CustomTemplateFileResponses[keyof CustomTemplateFileResponses]; + +export type CustomTemplateGitFetchData = { + body?: never; + path: { + /** + * Template identifier + */ + id: number; + }; + query?: never; + url: '/custom_templates/{id}/git_fetch'; +}; + +export type CustomTemplateGitFetchErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Custom template not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type CustomTemplateGitFetchResponses = { + /** + * Success + */ + 200: CustomtemplatesFileResponse; +}; + +export type CustomTemplateGitFetchResponse = + CustomTemplateGitFetchResponses[keyof CustomTemplateGitFetchResponses]; + +export type CustomTemplateCreateFileData = { + body: { + /** + * Title of the template + */ + Title: string; + /** + * Description of the template + */ + Description: string; + /** + * A note that will be displayed in the UI. Supports HTML content + */ + Note: string; + /** + * Platform associated to the template (1 - 'linux', 2 - 'windows') + */ + Platform: 1 | 2; + /** + * Type of created stack (1 - swarm, 2 - compose, 3 - kubernetes) + */ + Type: 1 | 2 | 3; + /** + * File + */ + File: Blob | File; + /** + * URL of the template's logo + */ + Logo?: string; + /** + * A json array of variables definitions + */ + Variables?: string; + }; + path?: never; + query?: never; + url: '/custom_templates/create/file'; +}; + +export type CustomTemplateCreateFileErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type CustomTemplateCreateFileResponses = { + /** + * OK + */ + 200: PortainerCustomTemplate; +}; + +export type CustomTemplateCreateFileResponse = + CustomTemplateCreateFileResponses[keyof CustomTemplateCreateFileResponses]; + +export type CustomTemplateCreateRepositoryData = { + /** + * Required when using method=repository + */ + body: CustomtemplatesCustomTemplateFromGitRepositoryPayload; + path?: never; + query?: never; + url: '/custom_templates/create/repository'; +}; + +export type CustomTemplateCreateRepositoryErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type CustomTemplateCreateRepositoryResponses = { + /** + * OK + */ + 200: PortainerCustomTemplate; +}; + +export type CustomTemplateCreateRepositoryResponse = + CustomTemplateCreateRepositoryResponses[keyof CustomTemplateCreateRepositoryResponses]; + +export type CustomTemplateCreateStringData = { + /** + * body + */ + body: CustomtemplatesCustomTemplateFromFileContentPayload; + path?: never; + query?: never; + url: '/custom_templates/create/string'; +}; + +export type CustomTemplateCreateStringErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type CustomTemplateCreateStringResponses = { + /** + * OK + */ + 200: PortainerCustomTemplate; +}; + +export type CustomTemplateCreateStringResponse = + CustomTemplateCreateStringResponses[keyof CustomTemplateCreateStringResponses]; + +export type DockerContainerGpusInspectData = { + body?: never; + path: { + /** + * Environment identifier + */ + environmentId: number; + /** + * Container identifier + */ + containerId: number; + }; + query?: never; + url: '/docker/{environmentId}/containers/{containerId}/gpus'; +}; + +export type DockerContainerGpusInspectErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Environment or container not found + */ + 404: unknown; + /** + * Internal server error + */ + 500: unknown; +}; + +export type DockerContainerGpusInspectResponses = { + /** + * Success + */ + 200: ContainersContainerGpusResponse; +}; + +export type DockerContainerGpusInspectResponse = + DockerContainerGpusInspectResponses[keyof DockerContainerGpusInspectResponses]; + +export type DockerDashboardData = { + body?: never; + path: { + /** + * Environment identifier + */ + environmentId: number; + }; + query?: never; + url: '/docker/{environmentId}/dashboard'; +}; + +export type DockerDashboardErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; +}; + +export type DockerDashboardResponses = { + /** + * Success + */ + 200: DockerDashboardResponse; +}; + +export type DockerDashboardResponse2 = + DockerDashboardResponses[keyof DockerDashboardResponses]; + +export type DockerImagesListData = { + body?: never; + path: { + /** + * Environment identifier + */ + environmentId: number; + }; + query?: { + /** + * Include image usage information + */ + withUsage?: boolean; + }; + url: '/docker/{environmentId}/images'; +}; + +export type DockerImagesListErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; +}; + +export type DockerImagesListResponses = { + /** + * Success + */ + 200: Array; +}; + +export type DockerImagesListResponse = + DockerImagesListResponses[keyof DockerImagesListResponses]; + +export type EdgeGroupListData = { + body?: never; + path?: never; + query?: never; + url: '/edge_groups'; +}; + +export type EdgeGroupListErrors = { + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeGroupListResponses = { + /** + * EdgeGroups + */ + 200: Array; +}; + +export type EdgeGroupListResponse = + EdgeGroupListResponses[keyof EdgeGroupListResponses]; + +export type EdgeGroupCreateData = { + /** + * EdgeGroup data + */ + body: EdgegroupsEdgeGroupCreatePayload; + path?: never; + query?: never; + url: '/edge_groups'; +}; + +export type EdgeGroupCreateErrors = { + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeGroupCreateResponses = { + /** + * OK + */ + 200: PortainerEdgeGroup; +}; + +export type EdgeGroupCreateResponse = + EdgeGroupCreateResponses[keyof EdgeGroupCreateResponses]; + +export type EdgeGroupDeleteData = { + body?: never; + path: { + /** + * EdgeGroup Id + */ + id: number; + }; + query?: never; + url: '/edge_groups/{id}'; +}; + +export type EdgeGroupDeleteErrors = { + /** + * Edge group is in use by an Edge stack or Edge job + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeGroupDeleteResponses = { + /** + * No Content + */ + 204: void; +}; + +export type EdgeGroupDeleteResponse = + EdgeGroupDeleteResponses[keyof EdgeGroupDeleteResponses]; + +export type EdgeGroupInspectData = { + body?: never; + path: { + /** + * EdgeGroup Id + */ + id: number; + }; + query?: never; + url: '/edge_groups/{id}'; +}; + +export type EdgeGroupInspectErrors = { + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeGroupInspectResponses = { + /** + * OK + */ + 200: PortainerEdgeGroup; +}; + +export type EdgeGroupInspectResponse = + EdgeGroupInspectResponses[keyof EdgeGroupInspectResponses]; + +export type EdgeGroupUpdateData = { + /** + * EdgeGroup data + */ + body: EdgegroupsEdgeGroupUpdatePayload; + path: { + /** + * EdgeGroup Id + */ + id: number; + }; + query?: never; + url: '/edge_groups/{id}'; +}; + +export type EdgeGroupUpdateErrors = { + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeGroupUpdateResponses = { + /** + * OK + */ + 200: PortainerEdgeGroup; +}; + +export type EdgeGroupUpdateResponse = + EdgeGroupUpdateResponses[keyof EdgeGroupUpdateResponses]; + +export type EdgeJobListData = { + body?: never; + path?: never; + query?: never; + url: '/edge_jobs'; +}; + +export type EdgeJobListErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeJobListResponses = { + /** + * OK + */ + 200: Array; +}; + +export type EdgeJobListResponse = + EdgeJobListResponses[keyof EdgeJobListResponses]; + +export type EdgeJobDeleteData = { + body?: never; + path: { + /** + * EdgeJob Id + */ + id: number; + }; + query?: never; + url: '/edge_jobs/{id}'; +}; + +export type EdgeJobDeleteErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeJobDeleteResponses = { + /** + * No Content + */ + 204: void; +}; + +export type EdgeJobDeleteResponse = + EdgeJobDeleteResponses[keyof EdgeJobDeleteResponses]; + +export type EdgeJobInspectData = { + body?: never; + path: { + /** + * EdgeJob Id + */ + id: number; + }; + query?: never; + url: '/edge_jobs/{id}'; +}; + +export type EdgeJobInspectErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeJobInspectResponses = { + /** + * OK + */ + 200: PortainerEdgeJob; +}; + +export type EdgeJobInspectResponse = + EdgeJobInspectResponses[keyof EdgeJobInspectResponses]; + +export type EdgeJobUpdateData = { + /** + * EdgeGroup data + */ + body: EdgejobsEdgeJobUpdatePayload; + path: { + /** + * EdgeJob Id + */ + id: number; + }; + query?: never; + url: '/edge_jobs/{id}'; +}; + +export type EdgeJobUpdateErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeJobUpdateResponses = { + /** + * OK + */ + 200: PortainerEdgeJob; +}; + +export type EdgeJobUpdateResponse = + EdgeJobUpdateResponses[keyof EdgeJobUpdateResponses]; + +export type EdgeJobFileData = { + body?: never; + path: { + /** + * EdgeJob Id + */ + id: number; + }; + query?: never; + url: '/edge_jobs/{id}/file'; +}; + +export type EdgeJobFileErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeJobFileResponses = { + /** + * OK + */ + 200: EdgejobsEdgeJobFileResponse; +}; + +export type EdgeJobFileResponse = + EdgeJobFileResponses[keyof EdgeJobFileResponses]; + +export type EdgeJobTasksListData = { + body?: never; + path: { + /** + * EdgeJob Id + */ + id: number; + }; + query?: never; + url: '/edge_jobs/{id}/tasks'; +}; + +export type EdgeJobTasksListErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeJobTasksListResponses = { + /** + * OK + */ + 200: Array; +}; + +export type EdgeJobTasksListResponse = + EdgeJobTasksListResponses[keyof EdgeJobTasksListResponses]; + +export type EdgeJobTasksClearData = { + body?: never; + path: { + /** + * EdgeJob Id + */ + id: number; + /** + * Task Id + */ + taskID: number; + }; + query?: never; + url: '/edge_jobs/{id}/tasks/{taskID}/logs'; +}; + +export type EdgeJobTasksClearErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeJobTasksClearResponses = { + /** + * No Content + */ + 204: void; +}; + +export type EdgeJobTasksClearResponse = + EdgeJobTasksClearResponses[keyof EdgeJobTasksClearResponses]; + +export type EdgeJobTaskLogsInspectData = { + body?: never; + path: { + /** + * EdgeJob Id + */ + id: number; + /** + * Task Id + */ + taskID: number; + }; + query?: never; + url: '/edge_jobs/{id}/tasks/{taskID}/logs'; +}; + +export type EdgeJobTaskLogsInspectErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeJobTaskLogsInspectResponses = { + /** + * OK + */ + 200: EdgejobsFileResponse; +}; + +export type EdgeJobTaskLogsInspectResponse = + EdgeJobTaskLogsInspectResponses[keyof EdgeJobTaskLogsInspectResponses]; + +export type EdgeJobTasksCollectData = { + body?: never; + path: { + /** + * EdgeJob Id + */ + id: number; + /** + * Task Id + */ + taskID: number; + }; + query?: never; + url: '/edge_jobs/{id}/tasks/{taskID}/logs'; +}; + +export type EdgeJobTasksCollectErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeJobTasksCollectResponses = { + /** + * No Content + */ + 204: void; +}; + +export type EdgeJobTasksCollectResponse = + EdgeJobTasksCollectResponses[keyof EdgeJobTasksCollectResponses]; + +export type EdgeJobCreateFileData = { + body: { + /** + * Content of the Stack file + */ + file: Blob | File; + /** + * Name of the stack + */ + Name: string; + /** + * A cron expression to schedule this job + */ + CronExpression: string; + /** + * JSON stringified array of Edge Groups ids + */ + EdgeGroups: string; + /** + * JSON stringified array of Environment ids + */ + Endpoints: string; + /** + * If recurring + */ + Recurring?: boolean; + }; + path?: never; + query?: never; + url: '/edge_jobs/create/file'; +}; + +export type EdgeJobCreateFileErrors = { + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeJobCreateFileResponses = { + /** + * OK + */ + 200: PortainerEdgeGroup; +}; + +export type EdgeJobCreateFileResponse = + EdgeJobCreateFileResponses[keyof EdgeJobCreateFileResponses]; + +export type EdgeJobCreateStringData = { + /** + * EdgeGroup data when method is string + */ + body: EdgejobsEdgeJobCreateFromFileContentPayload; + path?: never; + query?: never; + url: '/edge_jobs/create/string'; +}; + +export type EdgeJobCreateStringErrors = { + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeJobCreateStringResponses = { + /** + * OK + */ + 200: PortainerEdgeGroup; +}; + +export type EdgeJobCreateStringResponse = + EdgeJobCreateStringResponses[keyof EdgeJobCreateStringResponses]; + +export type EdgeStackListData = { + body?: never; + path?: never; + query?: { + /** + * will summarize the statuses + */ + summarizeStatuses?: boolean; + }; + url: '/edge_stacks'; +}; + +export type EdgeStackListErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeStackListResponses = { + /** + * OK + */ + 200: Array; +}; + +export type EdgeStackListResponse = + EdgeStackListResponses[keyof EdgeStackListResponses]; + +export type EdgeStackDeleteData = { + body?: never; + path: { + /** + * EdgeStack Id + */ + id: number; + }; + query?: never; + url: '/edge_stacks/{id}'; +}; + +export type EdgeStackDeleteErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeStackDeleteResponses = { + /** + * No Content + */ + 204: void; +}; + +export type EdgeStackDeleteResponse = + EdgeStackDeleteResponses[keyof EdgeStackDeleteResponses]; + +export type EdgeStackInspectData = { + body?: never; + path: { + /** + * EdgeStack Id + */ + id: number; + }; + query?: never; + url: '/edge_stacks/{id}'; +}; + +export type EdgeStackInspectErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeStackInspectResponses = { + /** + * OK + */ + 200: PortainerEdgeStack; +}; + +export type EdgeStackInspectResponse = + EdgeStackInspectResponses[keyof EdgeStackInspectResponses]; + +export type EdgeStackUpdateData = { + /** + * EdgeStack data + */ + body: EdgestacksUpdateEdgeStackPayload; + path: { + /** + * EdgeStack Id + */ + id: number; + }; + query?: never; + url: '/edge_stacks/{id}'; +}; + +export type EdgeStackUpdateErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeStackUpdateResponses = { + /** + * OK + */ + 200: PortainerEdgeStack; +}; + +export type EdgeStackUpdateResponse = + EdgeStackUpdateResponses[keyof EdgeStackUpdateResponses]; + +export type EdgeStackFileData = { + body?: never; + path: { + /** + * EdgeStack Id + */ + id: number; + }; + query?: never; + url: '/edge_stacks/{id}/file'; +}; + +export type EdgeStackFileErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeStackFileResponses = { + /** + * OK + */ + 200: EdgestacksStackFileResponse; +}; + +export type EdgeStackFileResponse = + EdgeStackFileResponses[keyof EdgeStackFileResponses]; + +export type EdgeStackStatusUpdateData = { + /** + * EdgeStack status payload + */ + body: EdgestacksUpdateStatusPayload; + path: { + /** + * EdgeStack Id + */ + id: number; + }; + query?: never; + url: '/edge_stacks/{id}/status'; +}; + +export type EdgeStackStatusUpdateErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type EdgeStackStatusUpdateResponses = { + /** + * OK + */ + 200: PortainerEdgeStack; +}; + +export type EdgeStackStatusUpdateResponse = + EdgeStackStatusUpdateResponses[keyof EdgeStackStatusUpdateResponses]; + +export type EdgeStackCreateFileData = { + body: { + /** + * Name of the stack. it must only consist of lowercase alphanumeric characters, hyphens, or underscores as well as start with a letter or number + */ + Name: string; + /** + * Content of the Stack file + */ + file: Blob | File; + /** + * JSON stringified array of Edge Groups ids + */ + EdgeGroups: string; + /** + * deploy type 0 - 'compose', 1 - 'kubernetes' + */ + DeploymentType: number; + /** + * JSON stringified array of Registry ids to use for this stack + */ + Registries?: string; + /** + * Uses the manifest's namespaces instead of the default one, relevant only for kube environments + */ + UseManifestNamespaces?: boolean; + /** + * Pre Pull image + */ + PrePullImage?: boolean; + /** + * Retry deploy + */ + RetryDeploy?: boolean; + }; + path?: never; + query?: { + /** + * if true, will not create an edge stack, but just will check the settings and return a non-persisted edge stack object + */ + dryrun?: string; + }; + url: '/edge_stacks/create/file'; +}; + +export type EdgeStackCreateFileErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeStackCreateFileResponses = { + /** + * OK + */ + 200: PortainerEdgeStack; +}; + +export type EdgeStackCreateFileResponse = + EdgeStackCreateFileResponses[keyof EdgeStackCreateFileResponses]; + +export type EdgeStackCreateRepositoryData = { + /** + * stack config + */ + body: EdgestacksEdgeStackFromGitRepositoryPayload; + path?: never; + query?: { + /** + * if true, will not create an edge stack, but just will check the settings and return a non-persisted edge stack object + */ + dryrun?: string; + }; + url: '/edge_stacks/create/repository'; +}; + +export type EdgeStackCreateRepositoryErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeStackCreateRepositoryResponses = { + /** + * OK + */ + 200: PortainerEdgeStack; +}; + +export type EdgeStackCreateRepositoryResponse = + EdgeStackCreateRepositoryResponses[keyof EdgeStackCreateRepositoryResponses]; + +export type EdgeStackCreateStringData = { + /** + * stack config + */ + body: EdgestacksEdgeStackFromStringPayload; + path?: never; + query?: { + /** + * if true, will not create an edge stack, but just will check the settings and return a non-persisted edge stack object + */ + dryrun?: string; + }; + url: '/edge_stacks/create/string'; +}; + +export type EdgeStackCreateStringErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Internal server error + */ + 500: unknown; + /** + * Edge compute features are disabled + */ + 503: unknown; +}; + +export type EdgeStackCreateStringResponses = { + /** + * OK + */ + 200: PortainerEdgeStack; +}; + +export type EdgeStackCreateStringResponse = + EdgeStackCreateStringResponses[keyof EdgeStackCreateStringResponses]; + +export type EndpointGroupListData = { + body?: never; + path?: never; + query?: { + /** + * If true, each environment(endpoint) group will include the number of environments(endpoints) associated to it and breakdown by type + */ + size?: boolean; + }; + url: '/endpoint_groups'; +}; + +export type EndpointGroupListErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointGroupListResponses = { + /** + * Environment(Endpoint) group + */ + 200: Array; +}; + +export type EndpointGroupListResponse = + EndpointGroupListResponses[keyof EndpointGroupListResponses]; + +export type PostEndpointGroupsData = { + /** + * Environment(Endpoint) Group details + */ + body: EndpointgroupsEndpointGroupCreatePayload; + path?: never; + query?: never; + url: '/endpoint_groups'; +}; + +export type PostEndpointGroupsErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type PostEndpointGroupsResponses = { + /** + * Success + */ + 200: PortainerEndpointGroup; +}; + +export type PostEndpointGroupsResponse = + PostEndpointGroupsResponses[keyof PostEndpointGroupsResponses]; + +export type EndpointGroupDeleteData = { + body?: never; + path: { + /** + * EndpointGroup identifier + */ + id: number; + }; + query?: never; + url: '/endpoint_groups/{id}'; +}; + +export type EndpointGroupDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * EndpointGroup not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointGroupDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type EndpointGroupDeleteResponse = + EndpointGroupDeleteResponses[keyof EndpointGroupDeleteResponses]; + +export type GetEndpointGroupsByIdData = { + body?: never; + path: { + /** + * Environment(Endpoint) group identifier + */ + id: number; + }; + query?: never; + url: '/endpoint_groups/{id}'; +}; + +export type GetEndpointGroupsByIdErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * EndpointGroup not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GetEndpointGroupsByIdResponses = { + /** + * Success + */ + 200: PortainerEndpointGroup; +}; + +export type GetEndpointGroupsByIdResponse = + GetEndpointGroupsByIdResponses[keyof GetEndpointGroupsByIdResponses]; + +export type EndpointGroupUpdateData = { + /** + * EndpointGroup details + */ + body: EndpointgroupsEndpointGroupUpdatePayload; + path: { + /** + * EndpointGroup identifier + */ + id: number; + }; + query?: never; + url: '/endpoint_groups/{id}'; +}; + +export type EndpointGroupUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * EndpointGroup not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointGroupUpdateResponses = { + /** + * Success + */ + 200: PortainerEndpointGroup; +}; + +export type EndpointGroupUpdateResponse = + EndpointGroupUpdateResponses[keyof EndpointGroupUpdateResponses]; + +export type EndpointGroupDeleteEndpointData = { + body?: never; + path: { + /** + * EndpointGroup identifier + */ + id: number; + /** + * Environment(Endpoint) identifier + */ + endpointId: number; + }; + query?: never; + url: '/endpoint_groups/{id}/endpoints/{endpointId}'; +}; + +export type EndpointGroupDeleteEndpointErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * EndpointGroup not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointGroupDeleteEndpointResponses = { + /** + * Success + */ + 204: void; +}; + +export type EndpointGroupDeleteEndpointResponse = + EndpointGroupDeleteEndpointResponses[keyof EndpointGroupDeleteEndpointResponses]; + +export type EndpointGroupAddEndpointData = { + body?: never; + path: { + /** + * EndpointGroup identifier + */ + id: number; + /** + * Environment(Endpoint) identifier + */ + endpointId: number; + }; + query?: never; + url: '/endpoint_groups/{id}/endpoints/{endpointId}'; +}; + +export type EndpointGroupAddEndpointErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * EndpointGroup not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointGroupAddEndpointResponses = { + /** + * Success + */ + 204: void; +}; + +export type EndpointGroupAddEndpointResponse = + EndpointGroupAddEndpointResponses[keyof EndpointGroupAddEndpointResponses]; + +export type EndpointListData = { + body?: never; + path?: never; + query?: { + /** + * Start searching from + */ + start?: number; + /** + * Limit results to this value + */ + limit?: number; + /** + * Sort results by this value + */ + sort?: + | 'Name' + | 'Group' + | 'Status' + | 'LastCheckIn' + | 'EdgeID' + | 'PlatformType' + | 'Health' + | 'Id'; + /** + * Order sorted results by desc/asc + */ + order?: number; + /** + * Search query + */ + search?: string; + /** + * List environments(endpoints) of these groups + */ + groupIds?: Array; + /** + * List environments(endpoints) by this status + */ + status?: Array; + /** + * List environments(endpoints) of this type + */ + types?: Array; + /** + * search environments(endpoints) with these tags (depends on tagsPartialMatch) + */ + tagIds?: Array; + /** + * If true, will return environment(endpoint) which has one of tagIds, if false (or missing) will return only environments(endpoints) that has all the tags + */ + tagsPartialMatch?: boolean; + /** + * will return only these environments(endpoints) + */ + endpointIds?: Array; + /** + * will exclude these environments(endpoints) + */ + excludeIds?: Array; + /** + * will exclude environments(endpoints) belonging to these endpoint groups + */ + excludeGroupIds?: Array; + /** + * If true, will return environment(endpoint) that were provisioned + */ + provisioned?: boolean; + /** + * will return only environments with on of these agent versions + */ + agentVersions?: Array; + /** + * if exists true show only edge async agents, false show only standard edge agents. if missing, will show both types (relevant only for edge agents) + */ + edgeAsync?: boolean; + /** + * if true, show only untrusted edge agents, if false show only trusted edge agents (relevant only for edge agents) + */ + edgeDeviceUntrusted?: boolean; + /** + * if bigger then zero, show only edge agents that checked-in in the last provided seconds (relevant only for edge agents) + */ + edgeCheckInPassedSeconds?: number; + /** + * if true, the snapshot data won't be retrieved + */ + excludeSnapshots?: boolean; + /** + * will return only environments(endpoints) with this name + */ + name?: string; + /** + * only applied when edgeStackId exists. Filter the returned environments based on their deployment status in the stack (not the environment status!) + */ + edgeStackStatus?: string; + /** + * List environments(endpoints) of these edge groups + */ + edgeGroupIds?: Array; + /** + * Exclude environments(endpoints) of these edge groups + */ + excludeEdgeGroupIds?: Array; + }; + url: '/endpoints'; +}; + +export type EndpointListErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointListResponses = { + /** + * Endpoints + */ + 200: Array; +}; + +export type EndpointListResponse = + EndpointListResponses[keyof EndpointListResponses]; + +export type EndpointCreateData = { + body: { + /** + * Name that will be used to identify this environment(endpoint) (example: my-environment) + */ + Name: string; + /** + * Environment(Endpoint) type. Value must be one of: 1 (Local Docker environment), 2 (Agent environment), 3 (Azure environment), 4 (Edge agent environment) or 5 (Local Kubernetes Environment) + */ + EndpointCreationType: number; + /** + * Container engine used by the environment(endpoint). Value must be one of: 'docker' or 'podman' + */ + ContainerEngine?: string; + /** + * URL or IP address of a Docker host (example: docker.mydomain.tld:2375). Defaults to local if not specified (Linux: /var/run/docker.sock, Windows: //./pipe/docker_engine). Cannot be empty if EndpointCreationType is set to 4 (Edge agent environment) + */ + URL?: string; + /** + * URL or IP address where exposed containers will be reachable. Defaults to URL if not specified (example: docker.mydomain.tld:2375) + */ + PublicURL?: string; + /** + * Environment(Endpoint) group identifier. If not specified will default to 1 (unassigned). + */ + GroupID?: number; + /** + * Require TLS to connect against this environment(endpoint). Must be true if EndpointCreationType is set to 2 (Agent environment) + */ + TLS?: boolean; + /** + * Skip server verification when using TLS. Must be true if EndpointCreationType is set to 2 (Agent environment) + */ + TLSSkipVerify?: boolean; + /** + * Skip client verification when using TLS. Must be true if EndpointCreationType is set to 2 (Agent environment) + */ + TLSSkipClientVerify?: boolean; + /** + * TLS CA certificate file + */ + TLSCACertFile?: Blob | File; + /** + * TLS client certificate file + */ + TLSCertFile?: Blob | File; + /** + * TLS client key file + */ + TLSKeyFile?: Blob | File; + /** + * Azure application ID. Required if environment(endpoint) type is set to 3 + */ + AzureApplicationID?: string; + /** + * Azure tenant ID. Required if environment(endpoint) type is set to 3 + */ + AzureTenantID?: string; + /** + * Azure authentication key. Required if environment(endpoint) type is set to 3 + */ + AzureAuthenticationKey?: string; + /** + * List of tag identifiers to which this environment(endpoint) is associated + */ + TagIds?: Array; + /** + * The check in interval for edge agent (in seconds) + */ + EdgeCheckinInterval?: number; + /** + * URL or IP address that will be used to establish a reverse tunnel + */ + EdgeTunnelServerAddress: string; + /** + * List of GPUs - json stringified array of {name, value} structs + */ + Gpus?: string; + }; + path?: never; + query?: never; + url: '/endpoints'; +}; + +export type EndpointCreateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Name is not unique + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointCreateResponses = { + /** + * Success + */ + 200: PortainerEndpoint; +}; + +export type EndpointCreateResponse = + EndpointCreateResponses[keyof EndpointCreateResponses]; + +export type EndpointDeleteData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: never; + url: '/endpoints/{id}'; +}; + +export type EndpointDeleteErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Unable to find the environment with the specified identifier inside the database. + */ + 404: unknown; + /** + * Server error occurred while attempting to delete the environment. + */ + 500: unknown; +}; + +export type EndpointDeleteResponses = { + /** + * Environment successfully deleted. + */ + 204: void; +}; + +export type EndpointDeleteResponse = + EndpointDeleteResponses[keyof EndpointDeleteResponses]; + +export type EndpointInspectData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: { + /** + * if true, the snapshot data won't be retrieved + */ + excludeSnapshot?: boolean; + }; + url: '/endpoints/{id}'; +}; + +export type EndpointInspectErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Environment(Endpoint) not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointInspectResponses = { + /** + * Success + */ + 200: PortainerEndpoint; +}; + +export type EndpointInspectResponse = + EndpointInspectResponses[keyof EndpointInspectResponses]; + +export type EndpointUpdateData = { + /** + * Environment(Endpoint) details + */ + body: EndpointsEndpointUpdatePayload; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: never; + url: '/endpoints/{id}'; +}; + +export type EndpointUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Environment(Endpoint) not found + */ + 404: unknown; + /** + * Name is not unique + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointUpdateResponses = { + /** + * Success + */ + 200: PortainerEndpoint; +}; + +export type EndpointUpdateResponse = + EndpointUpdateResponses[keyof EndpointUpdateResponses]; + +export type EndpointAssociationDeleteData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: never; + url: '/endpoints/{id}/association'; +}; + +export type EndpointAssociationDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Environment(Endpoint) not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointAssociationDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type EndpointAssociationDeleteResponse = + EndpointAssociationDeleteResponses[keyof EndpointAssociationDeleteResponses]; + +export type PostEndpointsByIdDockerV2BrowsePutData = { + body: { + /** + * The destination path to upload the file to + */ + Path: string; + /** + * The file to upload + */ + file: Blob | File; + }; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: { + /** + * Optional volume identifier to upload the file + */ + volumeID?: string; + }; + url: '/endpoints/{id}/docker/v2/browse/put'; +}; + +export type PostEndpointsByIdDockerV2BrowsePutErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type PostEndpointsByIdDockerV2BrowsePutResponses = { + /** + * Success + */ + 204: void; +}; + +export type PostEndpointsByIdDockerV2BrowsePutResponse = + PostEndpointsByIdDockerV2BrowsePutResponses[keyof PostEndpointsByIdDockerV2BrowsePutResponses]; + +export type EndpointDockerhubStatusData = { + body?: never; + path: { + /** + * endpoint ID + */ + id: number; + /** + * registry ID + */ + registryId: number; + }; + query?: never; + url: '/endpoints/{id}/dockerhub/{registryId}'; +}; + +export type EndpointDockerhubStatusErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * registry or endpoint not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointDockerhubStatusResponses = { + /** + * Success + */ + 200: EndpointsDockerhubStatusResponse; +}; + +export type EndpointDockerhubStatusResponse = + EndpointDockerhubStatusResponses[keyof EndpointDockerhubStatusResponses]; + +export type EndpointForceUpdateServiceData = { + /** + * details + */ + body: EndpointsForceUpdateServicePayload; + path: { + /** + * endpoint identifier + */ + id: number; + }; + query?: never; + url: '/endpoints/{id}/forceupdateservice'; +}; + +export type EndpointForceUpdateServiceErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * endpoint not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointForceUpdateServiceResponses = { + /** + * Success + */ + 200: SwarmServiceUpdateResponse; +}; + +export type EndpointForceUpdateServiceResponse = + EndpointForceUpdateServiceResponses[keyof EndpointForceUpdateServiceResponses]; + +export type HelmListData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: { + /** + * specify an optional namespace + */ + namespace?: string; + /** + * specify an optional filter + */ + filter?: string; + /** + * specify an optional selector + */ + selector?: string; + }; + url: '/endpoints/{id}/kubernetes/helm'; +}; + +export type HelmListErrors = { + /** + * Invalid environment(endpoint) identifier + */ + 400: unknown; + /** + * Unauthorized + */ + 401: unknown; + /** + * Environment(Endpoint) or ServiceAccount not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type HelmListResponses = { + /** + * Success + */ + 200: Array; +}; + +export type HelmListResponse = HelmListResponses[keyof HelmListResponses]; + +export type HelmInstallData = { + /** + * Chart details + */ + body: HelmInstallChartPayload; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: { + /** + * Dry run + */ + dryRun?: boolean; + }; + url: '/endpoints/{id}/kubernetes/helm'; +}; + +export type HelmInstallErrors = { + /** + * Invalid request payload + */ + 400: unknown; + /** + * Unauthorized + */ + 401: unknown; + /** + * Environment(Endpoint) or ServiceAccount not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type HelmInstallResponses = { + /** + * Created + */ + 201: ReleaseRelease; +}; + +export type HelmInstallResponse = + HelmInstallResponses[keyof HelmInstallResponses]; + +export type HelmDeleteData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + /** + * The name of the release/application to uninstall + */ + release: string; + }; + query?: { + /** + * An optional namespace + */ + namespace?: string; + }; + url: '/endpoints/{id}/kubernetes/helm/{release}'; +}; + +export type HelmDeleteErrors = { + /** + * Invalid environment(endpoint) id or bad request + */ + 400: unknown; + /** + * Unauthorized + */ + 401: unknown; + /** + * Environment(Endpoint) or ServiceAccount not found + */ + 404: unknown; + /** + * Server error or helm error + */ + 500: unknown; +}; + +export type HelmDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type HelmDeleteResponse = HelmDeleteResponses[keyof HelmDeleteResponses]; + +export type HelmGetData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + /** + * Helm release name + */ + release: string; + }; + query?: { + /** + * specify an optional namespace + */ + namespace?: string; + /** + * show resources of the release + */ + showResources?: boolean; + /** + * specify an optional revision + */ + revision?: number; + }; + url: '/endpoints/{id}/kubernetes/helm/{release}'; +}; + +export type HelmGetErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the release. + */ + 500: unknown; +}; + +export type HelmGetResponses = { + /** + * Success + */ + 200: ReleaseRelease; +}; + +export type HelmGetResponse = HelmGetResponses[keyof HelmGetResponses]; + +export type HelmGetHistoryData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + /** + * Helm release name + */ + release: string; + }; + query?: { + /** + * specify an optional namespace + */ + namespace?: string; + }; + url: '/endpoints/{id}/kubernetes/helm/{release}/history'; +}; + +export type HelmGetHistoryErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the historical list of releases. + */ + 500: unknown; +}; + +export type HelmGetHistoryResponses = { + /** + * Success + */ + 200: Array; +}; + +export type HelmGetHistoryResponse = + HelmGetHistoryResponses[keyof HelmGetHistoryResponses]; + +export type HelmRollbackData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + /** + * Helm release name + */ + release: string; + }; + query?: { + /** + * specify an optional namespace + */ + namespace?: string; + /** + * specify the revision to rollback to (defaults to previous revision if not specified) + */ + revision?: number; + /** + * wait for resources to be ready (default: false) + */ + wait?: boolean; + /** + * wait for jobs to complete before marking the release as successful (default: false) + */ + waitForJobs?: boolean; + /** + * performs pods restart for the resource if applicable (default: true) + */ + recreate?: boolean; + /** + * force resource update through delete/recreate if needed (default: false) + */ + force?: boolean; + /** + * time to wait for any individual Kubernetes operation in seconds (default: 300) + */ + timeout?: number; + }; + url: '/endpoints/{id}/kubernetes/helm/{release}/rollback'; +}; + +export type HelmRollbackErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or release name. + */ + 404: unknown; + /** + * Server error occurred while attempting to rollback the release. + */ + 500: unknown; +}; + +export type HelmRollbackResponses = { + /** + * Success + */ + 200: ReleaseRelease; +}; + +export type HelmRollbackResponse = + HelmRollbackResponses[keyof HelmRollbackResponses]; + +export type EndpointRegistriesListData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: { + /** + * required if kubernetes environment, will show registries by namespace + */ + namespace?: string; + }; + url: '/endpoints/{id}/registries'; +}; + +export type EndpointRegistriesListErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointRegistriesListResponses = { + /** + * Success + */ + 200: Array; +}; + +export type EndpointRegistriesListResponse = + EndpointRegistriesListResponses[keyof EndpointRegistriesListResponses]; + +export type EndpointRegistryAccessData = { + /** + * details + */ + body: EndpointsRegistryAccessPayload; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + /** + * Registry identifier + */ + registryId: number; + }; + query?: never; + url: '/endpoints/{id}/registries/{registryId}'; +}; + +export type EndpointRegistryAccessErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Endpoint not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointRegistryAccessResponses = { + /** + * Success + */ + 204: void; +}; + +export type EndpointRegistryAccessResponse = + EndpointRegistryAccessResponses[keyof EndpointRegistryAccessResponses]; + +export type EndpointSettingsUpdateData = { + /** + * Environment(Endpoint) details + */ + body: EndpointsEndpointSettingsUpdatePayload; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: never; + url: '/endpoints/{id}/settings'; +}; + +export type EndpointSettingsUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Environment(Endpoint) not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointSettingsUpdateResponses = { + /** + * Success + */ + 200: PortainerEndpoint; +}; + +export type EndpointSettingsUpdateResponse = + EndpointSettingsUpdateResponses[keyof EndpointSettingsUpdateResponses]; + +export type EndpointSnapshotData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: never; + url: '/endpoints/{id}/snapshot'; +}; + +export type EndpointSnapshotErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Environment(Endpoint) not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointSnapshotResponses = { + /** + * Success + */ + 204: void; +}; + +export type EndpointSnapshotResponse = + EndpointSnapshotResponses[keyof EndpointSnapshotResponses]; + +export type EndpointDeleteBatchData = { + /** + * List of environments to delete, with optional deleteCluster flag to clean-up associated resources (cloud environments only) + */ + body: EndpointsEndpointDeleteBatchPayload2; + path?: never; + query?: never; + url: '/endpoints/delete'; +}; + +export type EndpointDeleteBatchErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to delete the specified environments. + */ + 500: unknown; +}; + +export type EndpointDeleteBatchResponses = { + /** + * Environment(s) successfully deleted. + */ + 204: void; + /** + * Partial success. Some environments were deleted successfully, while others failed. + */ + 207: EndpointsEndpointDeleteBatchPartialResponse; +}; + +export type EndpointDeleteBatchResponse = + EndpointDeleteBatchResponses[keyof EndpointDeleteBatchResponses]; + +export type EndpointCreateGlobalKeyData = { + body?: never; + path?: never; + query?: never; + url: '/endpoints/global-key'; +}; + +export type EndpointCreateGlobalKeyErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointCreateGlobalKeyResponses = { + /** + * Success + */ + 200: EndpointsEndpointCreateGlobalKeyResponse; +}; + +export type EndpointCreateGlobalKeyResponse = + EndpointCreateGlobalKeyResponses[keyof EndpointCreateGlobalKeyResponses]; + +export type EndpointUpdateRelationsData = { + /** + * Environment relations data + */ + body: EndpointsEndpointUpdateRelationsPayload; + path?: never; + query?: never; + url: '/endpoints/relations'; +}; + +export type EndpointUpdateRelationsErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Unauthorized + */ + 401: unknown; + /** + * Not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointUpdateRelationsResponses = { + /** + * Success + */ + 204: void; +}; + +export type EndpointUpdateRelationsResponse = + EndpointUpdateRelationsResponses[keyof EndpointUpdateRelationsResponses]; + +export type EndpointSnapshotsData = { + body?: never; + path?: never; + query?: never; + url: '/endpoints/snapshot'; +}; + +export type EndpointSnapshotsErrors = { + /** + * Server Error + */ + 500: unknown; +}; + +export type EndpointSnapshotsResponses = { + /** + * Success + */ + 204: void; +}; + +export type EndpointSnapshotsResponse = + EndpointSnapshotsResponses[keyof EndpointSnapshotsResponses]; + +export type EndpointSummaryCountsData = { + body?: never; + path?: never; + query?: never; + url: '/endpoints/summary'; +}; + +export type EndpointSummaryCountsErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type EndpointSummaryCountsResponses = { + /** + * Environment summary counts + */ + 200: EndpointsEnvironmentSummaryCountsResponse; +}; + +export type EndpointSummaryCountsResponse = + EndpointSummaryCountsResponses[keyof EndpointSummaryCountsResponses]; + +export type GitOperationRepoFilePreviewData = { + /** + * Template details + */ + body: GitopsRepositoryFilePreviewPayload; + path?: never; + query?: never; + url: '/gitops/repo/file/preview'; +}; + +export type GitOperationRepoFilePreviewErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GitOperationRepoFilePreviewResponses = { + /** + * Success + */ + 200: GitopsFileResponse; +}; + +export type GitOperationRepoFilePreviewResponse = + GitOperationRepoFilePreviewResponses[keyof GitOperationRepoFilePreviewResponses]; + +export type GitOpsSourcesListData = { + body?: never; + path?: never; + query?: { + /** + * Search term (matches URL) + */ + search?: string; + /** + * Sort field: name | status | type + */ + sort?: string; + /** + * Sort order: asc or desc + */ + order?: string; + /** + * Pagination start index + */ + start?: number; + /** + * Pagination limit (0 = unlimited) + */ + limit?: number; + /** + * Filter by status: healthy | syncing | error | paused | unknown + */ + status?: string; + /** + * Filter by source type: git | oci | helm + */ + type?: 'git' | 'helm' | 'oci'; + }; + url: '/gitops/sources'; +}; + +export type GitOpsSourcesListErrors = { + /** + * Invalid status parameter + */ + 400: unknown; + /** + * Access denied + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GitOpsSourcesListResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GitOpsSourcesListResponse = + GitOpsSourcesListResponses[keyof GitOpsSourcesListResponses]; + +export type GitOpsSourcesDeleteData = { + body?: never; + path: { + /** + * Source identifier + */ + id: number; + }; + query?: never; + url: '/gitops/sources/{id}'; +}; + +export type GitOpsSourcesDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Access denied + */ + 403: unknown; + /** + * Source not found + */ + 404: unknown; + /** + * Source is in use by one or more workflows + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GitOpsSourcesDeleteResponses = { + /** + * Source deleted + */ + 204: void; +}; + +export type GitOpsSourcesDeleteResponse = + GitOpsSourcesDeleteResponses[keyof GitOpsSourcesDeleteResponses]; + +export type GitOpsSourceGetData = { + body?: never; + path: { + /** + * Source identifier + */ + id: number; + }; + query?: never; + url: '/gitops/sources/{id}'; +}; + +export type GitOpsSourceGetErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Access denied + */ + 403: unknown; + /** + * Source not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GitOpsSourceGetResponses = { + /** + * OK + */ + 200: SourcesSourceDetail; +}; + +export type GitOpsSourceGetResponse = + GitOpsSourceGetResponses[keyof GitOpsSourceGetResponses]; + +export type GitOpsSourcesUpdateGitData = { + /** + * Git source details + */ + body: SourcesGitSourceCreatePayload2; + path: { + /** + * Source identifier + */ + id: number; + }; + query?: never; + url: '/gitops/sources/{id}'; +}; + +export type GitOpsSourcesUpdateGitErrors = { + /** + * Invalid request payload + */ + 400: unknown; + /** + * Access denied + */ + 403: unknown; + /** + * Source not found + */ + 404: unknown; + /** + * A source with this URL already exists + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GitOpsSourcesUpdateGitResponses = { + /** + * OK + */ + 200: PortainerSource; +}; + +export type GitOpsSourcesUpdateGitResponse = + GitOpsSourcesUpdateGitResponses[keyof GitOpsSourcesUpdateGitResponses]; + +export type GitOpsSourcesCreateGitData = { + /** + * Git source details + */ + body: SourcesGitSourceCreatePayload2; + path?: never; + query?: never; + url: '/gitops/sources/git'; +}; + +export type GitOpsSourcesCreateGitErrors = { + /** + * Invalid request payload + */ + 400: unknown; + /** + * Access denied + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GitOpsSourcesCreateGitResponses = { + /** + * Created + */ + 201: PortainerSource; +}; + +export type GitOpsSourcesCreateGitResponse = + GitOpsSourcesCreateGitResponses[keyof GitOpsSourcesCreateGitResponses]; + +export type GitOpsSourcesSummaryData = { + body?: never; + path?: never; + query?: never; + url: '/gitops/sources/summary'; +}; + +export type GitOpsSourcesSummaryErrors = { + /** + * Access denied + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GitOpsSourcesSummaryResponses = { + /** + * OK + */ + 200: WorkflowsStatusSummary; +}; + +export type GitOpsSourcesSummaryResponse = + GitOpsSourcesSummaryResponses[keyof GitOpsSourcesSummaryResponses]; + +export type GitOpsWorkflowsListData = { + body?: never; + path?: never; + query?: { + /** + * Search term (matches name or repository URL) + */ + search?: string; + /** + * Sort field: name | type | status | creationDate | lastSyncDate + */ + sort?: string; + /** + * Sort order: asc or desc + */ + order?: string; + /** + * Pagination start index + */ + start?: number; + /** + * Pagination limit (0 = unlimited) + */ + limit?: number; + /** + * Filter by environment IDs (e.g. endpointIds[]=1&endpointIds[]=2) + */ + endpointIds?: Array; + /** + * Filter by status: healthy | syncing | error | paused | unknown + */ + status?: string; + /** + * Filter by type: stack + */ + type?: string; + /** + * Filter by platform: dockerStandalone | dockerSwarm | kubernetes + */ + platform?: string; + }; + url: '/gitops/workflows'; +}; + +export type GitOpsWorkflowsListErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type GitOpsWorkflowsListResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GitOpsWorkflowsListResponse = + GitOpsWorkflowsListResponses[keyof GitOpsWorkflowsListResponses]; + +export type GitOpsWorkflowsSummaryData = { + body?: never; + path?: never; + query?: never; + url: '/gitops/workflows/summary'; +}; + +export type GitOpsWorkflowsSummaryErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type GitOpsWorkflowsSummaryResponses = { + /** + * OK + */ + 200: WorkflowsStatusSummary; +}; + +export type GitOpsWorkflowsSummaryResponse = + GitOpsWorkflowsSummaryResponses[keyof GitOpsWorkflowsSummaryResponses]; + +export type GetAllKubernetesApplicationsData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query: { + /** + * Namespace name + */ + namespace: string; + /** + * Node name + */ + nodeName: string; + }; + url: '/kubernetes/{id}/applications'; +}; + +export type GetAllKubernetesApplicationsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the list of applications from the cluster. + */ + 500: unknown; +}; + +export type GetAllKubernetesApplicationsResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetAllKubernetesApplicationsResponse = + GetAllKubernetesApplicationsResponses[keyof GetAllKubernetesApplicationsResponses]; + +export type GetAllKubernetesApplicationsCountData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/applications/count'; +}; + +export type GetAllKubernetesApplicationsCountErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the count of all applications from the cluster. + */ + 500: unknown; +}; + +export type GetAllKubernetesApplicationsCountResponses = { + /** + * Success + */ + 200: number; +}; + +export type GetAllKubernetesApplicationsCountResponse = + GetAllKubernetesApplicationsCountResponses[keyof GetAllKubernetesApplicationsCountResponses]; + +export type DeleteClusterRoleBindingsData = { + /** + * A list of cluster role bindings to delete + */ + body: Array; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/cluster_role_bindings/delete'; +}; + +export type DeleteClusterRoleBindingsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific cluster role binding. + */ + 404: unknown; + /** + * Server error occurred while attempting to delete cluster role bindings. + */ + 500: unknown; +}; + +export type DeleteClusterRoleBindingsResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteClusterRoleBindingsResponse = + DeleteClusterRoleBindingsResponses[keyof DeleteClusterRoleBindingsResponses]; + +export type DeleteClusterRolesData = { + /** + * A list of cluster roles to delete + */ + body: Array; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/cluster_roles/delete'; +}; + +export type DeleteClusterRolesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific cluster role. + */ + 404: unknown; + /** + * Server error occurred while attempting to delete cluster roles. + */ + 500: unknown; +}; + +export type DeleteClusterRolesResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteClusterRolesResponse = + DeleteClusterRolesResponses[keyof DeleteClusterRolesResponses]; + +export type GetAllKubernetesClusterRoleBindingsData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/clusterrolebindings'; +}; + +export type GetAllKubernetesClusterRoleBindingsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the list of cluster role bindings. + */ + 500: unknown; +}; + +export type GetAllKubernetesClusterRoleBindingsResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetAllKubernetesClusterRoleBindingsResponse = + GetAllKubernetesClusterRoleBindingsResponses[keyof GetAllKubernetesClusterRoleBindingsResponses]; + +export type GetAllKubernetesClusterRolesData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/clusterroles'; +}; + +export type GetAllKubernetesClusterRolesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the list of cluster roles. + */ + 500: unknown; +}; + +export type GetAllKubernetesClusterRolesResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetAllKubernetesClusterRolesResponse = + GetAllKubernetesClusterRolesResponses[keyof GetAllKubernetesClusterRolesResponses]; + +export type GetAllKubernetesConfigMapsData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query: { + /** + * Set to true to include information about applications that use the ConfigMaps in the response + */ + isUsed: boolean; + }; + url: '/kubernetes/{id}/configmaps'; +}; + +export type GetAllKubernetesConfigMapsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve all configmaps from the cluster. + */ + 500: unknown; +}; + +export type GetAllKubernetesConfigMapsResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetAllKubernetesConfigMapsResponse = + GetAllKubernetesConfigMapsResponses[keyof GetAllKubernetesConfigMapsResponses]; + +export type GetAllKubernetesConfigMapsCountData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/configmaps/count'; +}; + +export type GetAllKubernetesConfigMapsCountErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the count of all configmaps from the cluster. + */ + 500: unknown; +}; + +export type GetAllKubernetesConfigMapsCountResponses = { + /** + * Success + */ + 200: number; +}; + +export type GetAllKubernetesConfigMapsCountResponse = + GetAllKubernetesConfigMapsCountResponses[keyof GetAllKubernetesConfigMapsCountResponses]; + +export type GetKubernetesCronJobsData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/cron_jobs'; +}; + +export type GetKubernetesCronJobsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the list of Cron Jobs. + */ + 500: unknown; +}; + +export type GetKubernetesCronJobsResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesCronJobsResponse = + GetKubernetesCronJobsResponses[keyof GetKubernetesCronJobsResponses]; + +export type DeleteCronJobsData = { + /** + * A map where the key is the namespace and the value is an array of Cron Jobs to delete + */ + body: KubernetesK8sCronJobDeleteRequests; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/cron_jobs/delete'; +}; + +export type DeleteCronJobsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific service account. + */ + 404: unknown; + /** + * Server error occurred while attempting to delete Cron Jobs. + */ + 500: unknown; +}; + +export type DeleteCronJobsResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteCronJobsResponse = + DeleteCronJobsResponses[keyof DeleteCronJobsResponses]; + +export type GetKubernetesDashboardData = { + body?: never; + path: { + /** + * Environment (Endpoint) identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/dashboard'; +}; + +export type GetKubernetesDashboardErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GetKubernetesDashboardResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesDashboardResponse = + GetKubernetesDashboardResponses[keyof GetKubernetesDashboardResponses]; + +export type DescribeResourceData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query: { + /** + * Resource name + */ + name: string; + /** + * Resource kind + */ + kind: string; + /** + * Namespace + */ + namespace?: string; + }; + url: '/kubernetes/{id}/describe'; +}; + +export type DescribeResourceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve resource description + */ + 500: unknown; +}; + +export type DescribeResourceResponses = { + /** + * Success + */ + 200: KubernetesDescribeResourceResponse; +}; + +export type DescribeResourceResponse = + DescribeResourceResponses[keyof DescribeResourceResponses]; + +export type GetAllKubernetesEventsData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: { + /** + * The resource id of the involved kubernetes object + */ + resourceId?: string; + }; + url: '/kubernetes/{id}/events'; +}; + +export type GetAllKubernetesEventsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Server error occurred while attempting to retrieve the events. + */ + 500: unknown; +}; + +export type GetAllKubernetesEventsResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetAllKubernetesEventsResponse = + GetAllKubernetesEventsResponses[keyof GetAllKubernetesEventsResponses]; + +export type GetAllKubernetesIngressControllersData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: { + /** + * Only return allowed ingress controllers + */ + allowedOnly?: boolean; + }; + url: '/kubernetes/{id}/ingresscontrollers'; +}; + +export type GetAllKubernetesIngressControllersErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve ingress controllers + */ + 500: unknown; +}; + +export type GetAllKubernetesIngressControllersResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetAllKubernetesIngressControllersResponse = + GetAllKubernetesIngressControllersResponses[keyof GetAllKubernetesIngressControllersResponses]; + +export type UpdateKubernetesIngressControllersData = { + /** + * Ingress controllers + */ + body: KubernetesK8sIngressControllerArray; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/ingresscontrollers'; +}; + +export type UpdateKubernetesIngressControllersErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find the ingress controllers to update. + */ + 404: unknown; + /** + * Server error occurred while attempting to update ingress controllers. + */ + 500: unknown; +}; + +export type UpdateKubernetesIngressControllersResponses = { + /** + * Success + */ + 204: void; +}; + +export type UpdateKubernetesIngressControllersResponse = + UpdateKubernetesIngressControllersResponses[keyof UpdateKubernetesIngressControllersResponses]; + +export type GetAllKubernetesClusterIngressesData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: { + /** + * Lookup services associated with each ingress + */ + withServices?: boolean; + }; + url: '/kubernetes/{id}/ingresses'; +}; + +export type GetAllKubernetesClusterIngressesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve ingresses. + */ + 500: unknown; +}; + +export type GetAllKubernetesClusterIngressesResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetAllKubernetesClusterIngressesResponse = + GetAllKubernetesClusterIngressesResponses[keyof GetAllKubernetesClusterIngressesResponses]; + +export type GetAllKubernetesClusterIngressesCountData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/ingresses/count'; +}; + +export type GetAllKubernetesClusterIngressesCountErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve ingresses count. + */ + 500: unknown; +}; + +export type GetAllKubernetesClusterIngressesCountResponses = { + /** + * Success + */ + 200: number; +}; + +export type GetAllKubernetesClusterIngressesCountResponse = + GetAllKubernetesClusterIngressesCountResponses[keyof GetAllKubernetesClusterIngressesCountResponses]; + +export type DeleteKubernetesIngressesData = { + /** + * Ingress details + */ + body: KubernetesK8sIngressDeleteRequests; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/ingresses/delete'; +}; + +export type DeleteKubernetesIngressesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific ingress. + */ + 404: unknown; + /** + * Server error occurred while attempting to delete specified ingresses. + */ + 500: unknown; +}; + +export type DeleteKubernetesIngressesResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteKubernetesIngressesResponse = + DeleteKubernetesIngressesResponses[keyof DeleteKubernetesIngressesResponses]; + +export type GetKubernetesJobsData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: { + /** + * Whether to include Jobs that have a cronjob owner + */ + includeCronJobChildren?: boolean; + }; + url: '/kubernetes/{id}/jobs'; +}; + +export type GetKubernetesJobsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the list of Jobs. + */ + 500: unknown; +}; + +export type GetKubernetesJobsResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesJobsResponse = + GetKubernetesJobsResponses[keyof GetKubernetesJobsResponses]; + +export type DeleteJobsData = { + /** + * A map where the key is the namespace and the value is an array of Jobs to delete + */ + body: KubernetesK8sJobDeleteRequests; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/jobs/delete'; +}; + +export type DeleteJobsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific service account. + */ + 404: unknown; + /** + * Server error occurred while attempting to delete Jobs. + */ + 500: unknown; +}; + +export type DeleteJobsResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteJobsResponse = DeleteJobsResponses[keyof DeleteJobsResponses]; + +export type GetKubernetesMaxResourceLimitsData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/max_resource_limits'; +}; + +export type GetKubernetesMaxResourceLimitsErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve nodes limits. + */ + 500: unknown; +}; + +export type GetKubernetesMaxResourceLimitsResponses = { + /** + * Success + */ + 200: PortainerK8sNodesLimits; +}; + +export type GetKubernetesMaxResourceLimitsResponse = + GetKubernetesMaxResourceLimitsResponses[keyof GetKubernetesMaxResourceLimitsResponses]; + +export type GetApplicationsResourcesData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query: { + /** + * Node name + */ + node: string; + }; + url: '/kubernetes/{id}/metrics/applications_resources'; +}; + +export type GetApplicationsResourcesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the total resource requests and limits for all applications from the cluster. + */ + 500: unknown; +}; + +export type GetApplicationsResourcesResponses = { + /** + * Success + */ + 200: KubernetesK8sApplicationResource; +}; + +export type GetApplicationsResourcesResponse = + GetApplicationsResourcesResponses[keyof GetApplicationsResourcesResponses]; + +export type GetKubernetesMetricsForAllNodesData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/metrics/nodes'; +}; + +export type GetKubernetesMetricsForAllNodesErrors = { + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Server error occurred while attempting to retrieve the list of nodes with their live metrics. + */ + 500: unknown; +}; + +export type GetKubernetesMetricsForAllNodesResponses = { + /** + * Success + */ + 200: V1Beta1NodeMetricsList; +}; + +export type GetKubernetesMetricsForAllNodesResponse = + GetKubernetesMetricsForAllNodesResponses[keyof GetKubernetesMetricsForAllNodesResponses]; + +export type GetKubernetesMetricsForNodeData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Node identifier + */ + name: string; + }; + query?: never; + url: '/kubernetes/{id}/metrics/nodes/{name}'; +}; + +export type GetKubernetesMetricsForNodeErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Server error occurred while attempting to retrieve the live metrics for the specified node. + */ + 500: unknown; +}; + +export type GetKubernetesMetricsForNodeResponses = { + /** + * Success + */ + 200: V1Beta1NodeMetrics; +}; + +export type GetKubernetesMetricsForNodeResponse = + GetKubernetesMetricsForNodeResponses[keyof GetKubernetesMetricsForNodeResponses]; + +export type GetKubernetesMetricsForAllPodsData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/metrics/pods/{namespace}'; +}; + +export type GetKubernetesMetricsForAllPodsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Server error occurred while attempting to retrieve the list of pods with their live metrics. + */ + 500: unknown; +}; + +export type GetKubernetesMetricsForAllPodsResponses = { + /** + * Success + */ + 200: V1Beta1PodMetricsList; +}; + +export type GetKubernetesMetricsForAllPodsResponse = + GetKubernetesMetricsForAllPodsResponses[keyof GetKubernetesMetricsForAllPodsResponses]; + +export type GetKubernetesMetricsForPodData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace + */ + namespace: string; + /** + * Pod identifier + */ + name: string; + }; + query?: never; + url: '/kubernetes/{id}/metrics/pods/{namespace}/{name}'; +}; + +export type GetKubernetesMetricsForPodErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Server error occurred while attempting to retrieve the live metrics for the specified pod. + */ + 500: unknown; +}; + +export type GetKubernetesMetricsForPodResponses = { + /** + * Success + */ + 200: V1Beta1PodMetrics; +}; + +export type GetKubernetesMetricsForPodResponse = + GetKubernetesMetricsForPodResponses[keyof GetKubernetesMetricsForPodResponses]; + +export type DeleteKubernetesNamespaceData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/namespaces'; +}; + +export type DeleteKubernetesNamespaceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to delete the namespace. + */ + 500: unknown; +}; + +export type DeleteKubernetesNamespaceResponses = { + /** + * Success + */ + 200: string; +}; + +export type DeleteKubernetesNamespaceResponse = + DeleteKubernetesNamespaceResponses[keyof DeleteKubernetesNamespaceResponses]; + +export type GetKubernetesNamespacesData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query: { + /** + * When set to true, include the resource quota information as part of the Namespace information. Default is false + */ + withResourceQuota: boolean; + /** + * When set to true, include the unhealthy events information as part of the Namespace information. Default is false + */ + withUnhealthyEvents: boolean; + }; + url: '/kubernetes/{id}/namespaces'; +}; + +export type GetKubernetesNamespacesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the list of namespaces. + */ + 500: unknown; +}; + +export type GetKubernetesNamespacesResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesNamespacesResponse = + GetKubernetesNamespacesResponses[keyof GetKubernetesNamespacesResponses]; + +export type CreateKubernetesNamespaceData = { + /** + * Namespace configuration details + */ + body: KubernetesK8sNamespaceDetails; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/namespaces'; +}; + +export type CreateKubernetesNamespaceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Conflict - the namespace already exists. + */ + 409: unknown; + /** + * Server error occurred while attempting to create the namespace. + */ + 500: unknown; +}; + +export type CreateKubernetesNamespaceResponses = { + /** + * Success + */ + 200: PortainerK8sNamespaceInfo; +}; + +export type CreateKubernetesNamespaceResponse = + CreateKubernetesNamespaceResponses[keyof CreateKubernetesNamespaceResponses]; + +export type UpdateKubernetesNamespaceDeprecatedData = { + /** + * Namespace details + */ + body: KubernetesK8sNamespaceDetails2; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces'; +}; + +export type UpdateKubernetesNamespaceDeprecatedErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific namespace. + */ + 404: unknown; + /** + * Server error occurred while attempting to update the namespace. + */ + 500: unknown; +}; + +export type UpdateKubernetesNamespaceDeprecatedResponses = { + /** + * Success + */ + 200: PortainerK8sNamespaceInfo; +}; + +export type UpdateKubernetesNamespaceDeprecatedResponse = + UpdateKubernetesNamespaceDeprecatedResponses[keyof UpdateKubernetesNamespaceDeprecatedResponses]; + +export type GetKubernetesNamespaceData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * The namespace name to get details for + */ + namespace: string; + }; + query: { + /** + * When set to true, include the resource quota information as part of the Namespace information. Default is false + */ + withResourceQuota: boolean; + }; + url: '/kubernetes/{id}/namespaces/{namespace}'; +}; + +export type GetKubernetesNamespaceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific namespace. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve specified namespace information. + */ + 500: unknown; +}; + +export type GetKubernetesNamespaceResponses = { + /** + * Success + */ + 200: PortainerK8sNamespaceInfo; +}; + +export type GetKubernetesNamespaceResponse = + GetKubernetesNamespaceResponses[keyof GetKubernetesNamespaceResponses]; + +export type UpdateKubernetesNamespaceData = { + /** + * Namespace details + */ + body: KubernetesK8sNamespaceDetails2; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}'; +}; + +export type UpdateKubernetesNamespaceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific namespace. + */ + 404: unknown; + /** + * Server error occurred while attempting to update the namespace. + */ + 500: unknown; +}; + +export type UpdateKubernetesNamespaceResponses = { + /** + * Success + */ + 200: PortainerK8sNamespaceInfo; +}; + +export type UpdateKubernetesNamespaceResponse = + UpdateKubernetesNamespaceResponses[keyof UpdateKubernetesNamespaceResponses]; + +export type GetKubernetesConfigMapData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * The namespace name where the configmap is located + */ + namespace: string; + /** + * The configmap name to get details for + */ + configmap: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/configmaps/{configmap}'; +}; + +export type GetKubernetesConfigMapErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or a configmap with the specified name in the given namespace. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve a configmap by name within the specified namespace. + */ + 500: unknown; +}; + +export type GetKubernetesConfigMapResponses = { + /** + * Success + */ + 200: KubernetesK8sConfigMap; +}; + +export type GetKubernetesConfigMapResponse = + GetKubernetesConfigMapResponses[keyof GetKubernetesConfigMapResponses]; + +export type GetKubernetesEventsForNamespaceData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * The namespace name the events are associated to + */ + namespace: string; + }; + query?: { + /** + * The resource id of the involved kubernetes object + */ + resourceId?: string; + }; + url: '/kubernetes/{id}/namespaces/{namespace}/events'; +}; + +export type GetKubernetesEventsForNamespaceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Server error occurred while attempting to retrieve the events within the specified namespace. + */ + 500: unknown; +}; + +export type GetKubernetesEventsForNamespaceResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesEventsForNamespaceResponse = + GetKubernetesEventsForNamespaceResponses[keyof GetKubernetesEventsForNamespaceResponses]; + +export type GetKubernetesIngressControllersByNamespaceData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/ingresscontrollers'; +}; + +export type GetKubernetesIngressControllersByNamespaceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or a namespace with the specified name. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve ingress controllers by a namespace + */ + 500: unknown; +}; + +export type GetKubernetesIngressControllersByNamespaceResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesIngressControllersByNamespaceResponse = + GetKubernetesIngressControllersByNamespaceResponses[keyof GetKubernetesIngressControllersByNamespaceResponses]; + +export type UpdateKubernetesIngressControllersByNamespaceData = { + /** + * Ingress controllers + */ + body: KubernetesK8sIngressControllerArray; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace name + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/ingresscontrollers'; +}; + +export type UpdateKubernetesIngressControllersByNamespaceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to update ingress controllers by namespace. + */ + 500: unknown; +}; + +export type UpdateKubernetesIngressControllersByNamespaceResponses = { + /** + * Success + */ + 204: void; +}; + +export type UpdateKubernetesIngressControllersByNamespaceResponse = + UpdateKubernetesIngressControllersByNamespaceResponses[keyof UpdateKubernetesIngressControllersByNamespaceResponses]; + +export type GetAllKubernetesIngressesData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace name + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/ingresses'; +}; + +export type GetAllKubernetesIngressesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve ingresses + */ + 500: unknown; +}; + +export type GetAllKubernetesIngressesResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetAllKubernetesIngressesResponse = + GetAllKubernetesIngressesResponses[keyof GetAllKubernetesIngressesResponses]; + +export type CreateKubernetesIngressData = { + /** + * Ingress details + */ + body: KubernetesK8sIngressInfo2; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace name + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/ingresses'; +}; + +export type CreateKubernetesIngressErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Conflict - an ingress with the same name already exists in the specified namespace. + */ + 409: unknown; + /** + * Server error occurred while attempting to create an ingress. + */ + 500: unknown; +}; + +export type CreateKubernetesIngressResponses = { + /** + * Success + */ + 204: void; +}; + +export type CreateKubernetesIngressResponse = + CreateKubernetesIngressResponses[keyof CreateKubernetesIngressResponses]; + +export type UpdateKubernetesIngressData = { + /** + * Ingress details + */ + body: KubernetesK8sIngressInfo2; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace name + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/ingresses'; +}; + +export type UpdateKubernetesIngressErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find the specified ingress. + */ + 404: unknown; + /** + * Server error occurred while attempting to update the specified ingress. + */ + 500: unknown; +}; + +export type UpdateKubernetesIngressResponses = { + /** + * Success + */ + 204: void; +}; + +export type UpdateKubernetesIngressResponse = + UpdateKubernetesIngressResponses[keyof UpdateKubernetesIngressResponses]; + +export type GetKubernetesIngressData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace name + */ + namespace: string; + /** + * Ingress name + */ + ingress: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/ingresses/{ingress}'; +}; + +export type GetKubernetesIngressErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find an ingress with the specified name. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve an ingress. + */ + 500: unknown; +}; + +export type GetKubernetesIngressResponses = { + /** + * Success + */ + 200: KubernetesK8sIngressInfo; +}; + +export type GetKubernetesIngressResponse = + GetKubernetesIngressResponses[keyof GetKubernetesIngressResponses]; + +export type GetKubernetesPersistentVolumeClaimsInNamespaceData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace name + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/persistent_volume_claims'; +}; + +export type GetKubernetesPersistentVolumeClaimsInNamespaceErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to retrieve persistent volume claims. + */ + 500: unknown; +}; + +export type GetKubernetesPersistentVolumeClaimsInNamespaceResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesPersistentVolumeClaimsInNamespaceResponse = + GetKubernetesPersistentVolumeClaimsInNamespaceResponses[keyof GetKubernetesPersistentVolumeClaimsInNamespaceResponses]; + +export type GetKubernetesPersistentVolumeClaimData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace name + */ + namespace: string; + /** + * PVC name + */ + name: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/persistent_volume_claims/{name}'; +}; + +export type GetKubernetesPersistentVolumeClaimErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * PVC not found. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the persistent volume claim. + */ + 500: unknown; +}; + +export type GetKubernetesPersistentVolumeClaimResponses = { + /** + * Success + */ + 200: KubernetesK8sPersistentVolumeClaim; +}; + +export type GetKubernetesPersistentVolumeClaimResponse = + GetKubernetesPersistentVolumeClaimResponses[keyof GetKubernetesPersistentVolumeClaimResponses]; + +export type DeleteKubernetesPodData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + /** + * Namespace + */ + namespace: string; + /** + * Pod name + */ + name: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/pods/{name}'; +}; + +export type DeleteKubernetesPodErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find the specified pod. + */ + 404: unknown; + /** + * Server error occurred while attempting to delete the pod. + */ + 500: unknown; +}; + +export type DeleteKubernetesPodResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteKubernetesPodResponse = + DeleteKubernetesPodResponses[keyof DeleteKubernetesPodResponses]; + +export type RestartKubernetesPodData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + /** + * Namespace + */ + namespace: string; + /** + * Pod name + */ + name: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/pods/{name}/restart'; +}; + +export type RestartKubernetesPodErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment, the specified pod, or the cluster does not expose the pod-restart subresource (Kubernetes <1.35 or feature gate disabled). + */ + 404: unknown; + /** + * The cluster does not support the pod-restart subresource (Kubernetes <1.35 or feature gate disabled). + */ + 405: unknown; + /** + * Server error occurred while attempting to restart the pod. + */ + 500: unknown; +}; + +export type RestartKubernetesPodResponses = { + /** + * Success + */ + 204: void; +}; + +export type RestartKubernetesPodResponse = + RestartKubernetesPodResponses[keyof RestartKubernetesPodResponses]; + +export type GetKubernetesSecretData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * The namespace name where the secret is located + */ + namespace: string; + /** + * The secret name to get details for + */ + secret: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/secrets/{secret}'; +}; + +export type GetKubernetesSecretErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve a secret by name belong in a namespace. + */ + 500: unknown; +}; + +export type GetKubernetesSecretResponses = { + /** + * Success + */ + 200: KubernetesK8sSecret; +}; + +export type GetKubernetesSecretResponse = + GetKubernetesSecretResponses[keyof GetKubernetesSecretResponses]; + +export type GetKubernetesServiceAccountData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace + */ + namespace: string; + /** + * Service account name + */ + name: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/service_accounts/{name}'; +}; + +export type GetKubernetesServiceAccountErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Unauthorized + */ + 401: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Service account not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GetKubernetesServiceAccountResponses = { + /** + * Success + */ + 200: KubernetesK8sServiceAccount; +}; + +export type GetKubernetesServiceAccountResponse = + GetKubernetesServiceAccountResponses[keyof GetKubernetesServiceAccountResponses]; + +export type UpdateKubernetesServiceAccountImagePullSecretsData = { + /** + * New imagePullSecrets list + */ + body: KubernetesK8sServiceAccountImagePullSecretsUpdatePayload; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace + */ + namespace: string; + /** + * Service account name + */ + name: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/service_accounts/{name}/image_pull_secrets'; +}; + +export type UpdateKubernetesServiceAccountImagePullSecretsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier, namespace, or service account. + */ + 404: unknown; + /** + * Server error occurred while attempting to update image pull secrets for the service account. + */ + 500: unknown; +}; + +export type UpdateKubernetesServiceAccountImagePullSecretsResponses = { + /** + * Success + */ + 204: void; +}; + +export type UpdateKubernetesServiceAccountImagePullSecretsResponse = + UpdateKubernetesServiceAccountImagePullSecretsResponses[keyof UpdateKubernetesServiceAccountImagePullSecretsResponses]; + +export type GetKubernetesServicesByNamespaceData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace name + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/services'; +}; + +export type GetKubernetesServicesByNamespaceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve all services for a namespace. + */ + 500: unknown; +}; + +export type GetKubernetesServicesByNamespaceResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesServicesByNamespaceResponse = + GetKubernetesServicesByNamespaceResponses[keyof GetKubernetesServicesByNamespaceResponses]; + +export type CreateKubernetesServiceData = { + /** + * Service definition + */ + body: KubernetesK8sServiceInfo2; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace name + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/services'; +}; + +export type CreateKubernetesServiceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to create a service. + */ + 500: unknown; +}; + +export type CreateKubernetesServiceResponses = { + /** + * Success + */ + 204: void; +}; + +export type CreateKubernetesServiceResponse = + CreateKubernetesServiceResponses[keyof CreateKubernetesServiceResponses]; + +export type UpdateKubernetesServiceData = { + /** + * Service definition + */ + body: KubernetesK8sServiceInfo2; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace name + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/services'; +}; + +export type UpdateKubernetesServiceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find the service to update. + */ + 404: unknown; + /** + * Server error occurred while attempting to update a service. + */ + 500: unknown; +}; + +export type UpdateKubernetesServiceResponses = { + /** + * Success + */ + 204: void; +}; + +export type UpdateKubernetesServiceResponse = + UpdateKubernetesServiceResponses[keyof UpdateKubernetesServiceResponses]; + +export type KubernetesNamespacesToggleSystemData = { + /** + * Update details + */ + body: KubernetesNamespacesToggleSystemPayload; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace name + */ + namespace: string; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/{namespace}/system'; +}; + +export type KubernetesNamespacesToggleSystemErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find the namespace to update. + */ + 404: unknown; + /** + * Server error occurred while attempting to update the system state of the namespace. + */ + 500: unknown; +}; + +export type KubernetesNamespacesToggleSystemResponses = { + /** + * Success + */ + 204: void; +}; + +export type KubernetesNamespacesToggleSystemResponse = + KubernetesNamespacesToggleSystemResponses[keyof KubernetesNamespacesToggleSystemResponses]; + +export type GetKubernetesVolumesInNamespaceData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace identifier + */ + namespace: string; + }; + query?: { + /** + * When set to True, include the applications that are using the volumes. It is set to false by default + */ + withApplications?: boolean; + }; + url: '/kubernetes/{id}/namespaces/{namespace}/volumes'; +}; + +export type GetKubernetesVolumesInNamespaceErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to retrieve kubernetes volumes in the namespace. + */ + 500: unknown; +}; + +export type GetKubernetesVolumesInNamespaceResponses = { + /** + * Success + */ + 200: { + [key: string]: KubernetesK8sVolumeInfo; + }; +}; + +export type GetKubernetesVolumesInNamespaceResponse = + GetKubernetesVolumesInNamespaceResponses[keyof GetKubernetesVolumesInNamespaceResponses]; + +export type GetKubernetesNamespacesCountData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/namespaces/count'; +}; + +export type GetKubernetesNamespacesCountErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to compute the namespace count. + */ + 500: unknown; +}; + +export type GetKubernetesNamespacesCountResponses = { + /** + * Success + */ + 200: number; +}; + +export type GetKubernetesNamespacesCountResponse = + GetKubernetesNamespacesCountResponses[keyof GetKubernetesNamespacesCountResponses]; + +export type DrainNodeData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + /** + * Name of the node to drain + */ + name: string; + }; + query?: never; + url: '/kubernetes/{id}/nodes/{name}/drain'; +}; + +export type DrainNodeErrors = { + /** + * Invalid request, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find the specified node. + */ + 404: unknown; + /** + * Server error occurred while attempting to drain node. + */ + 500: unknown; +}; + +export type DrainNodeResponses = { + /** + * Success + */ + 204: void; +}; + +export type DrainNodeResponse = DrainNodeResponses[keyof DrainNodeResponses]; + +export type GetKubernetesNodesLimitsData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/nodes_limits'; +}; + +export type GetKubernetesNodesLimitsErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve nodes limits. + */ + 500: unknown; +}; + +export type GetKubernetesNodesLimitsResponses = { + /** + * Success + */ + 200: PortainerK8sNodesLimits; +}; + +export type GetKubernetesNodesLimitsResponse = + GetKubernetesNodesLimitsResponses[keyof GetKubernetesNodesLimitsResponses]; + +export type GetAllKubernetesPersistentVolumeClaimsData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/persistent_volume_claims'; +}; + +export type GetAllKubernetesPersistentVolumeClaimsErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to retrieve persistent volume claims. + */ + 500: unknown; +}; + +export type GetAllKubernetesPersistentVolumeClaimsResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetAllKubernetesPersistentVolumeClaimsResponse = + GetAllKubernetesPersistentVolumeClaimsResponses[keyof GetAllKubernetesPersistentVolumeClaimsResponses]; + +export type DeleteKubernetesPersistentVolumeClaimsData = { + /** + * List of PVCs to delete (namespace + name) + */ + body: Array; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/persistent_volume_claims/delete'; +}; + +export type DeleteKubernetesPersistentVolumeClaimsErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to delete persistent volume claims. + */ + 500: unknown; +}; + +export type DeleteKubernetesPersistentVolumeClaimsResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteKubernetesPersistentVolumeClaimsResponse = + DeleteKubernetesPersistentVolumeClaimsResponses[keyof DeleteKubernetesPersistentVolumeClaimsResponses]; + +export type ResizeKubernetesPersistentVolumeClaimData = { + /** + * PVC resize request + */ + body: KubernetesK8sPvcResizeRequest; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/persistent_volume_claims/resize'; +}; + +export type ResizeKubernetesPersistentVolumeClaimErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to resize the persistent volume claim. + */ + 500: unknown; +}; + +export type ResizeKubernetesPersistentVolumeClaimResponses = { + /** + * Success + */ + 204: void; +}; + +export type ResizeKubernetesPersistentVolumeClaimResponse = + ResizeKubernetesPersistentVolumeClaimResponses[keyof ResizeKubernetesPersistentVolumeClaimResponses]; + +export type GetAllKubernetesPersistentVolumesData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/persistent_volumes'; +}; + +export type GetAllKubernetesPersistentVolumesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to retrieve persistent volumes. + */ + 500: unknown; +}; + +export type GetAllKubernetesPersistentVolumesResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetAllKubernetesPersistentVolumesResponse = + GetAllKubernetesPersistentVolumesResponses[keyof GetAllKubernetesPersistentVolumesResponses]; + +export type GetKubernetesPersistentVolumeData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * PersistentVolume name + */ + name: string; + }; + query?: never; + url: '/kubernetes/{id}/persistent_volumes/{name}'; +}; + +export type GetKubernetesPersistentVolumeErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * PersistentVolume not found. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the persistent volume. + */ + 500: unknown; +}; + +export type GetKubernetesPersistentVolumeResponses = { + /** + * Success + */ + 200: KubernetesK8sPersistentVolume; +}; + +export type GetKubernetesPersistentVolumeResponse = + GetKubernetesPersistentVolumeResponses[keyof GetKubernetesPersistentVolumeResponses]; + +export type DeleteKubernetesPersistentVolumesData = { + /** + * List of PV names to delete + */ + body: Array; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/persistent_volumes/delete'; +}; + +export type DeleteKubernetesPersistentVolumesErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to delete persistent volumes. + */ + 500: unknown; +}; + +export type DeleteKubernetesPersistentVolumesResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteKubernetesPersistentVolumesResponse = + DeleteKubernetesPersistentVolumesResponses[keyof DeleteKubernetesPersistentVolumesResponses]; + +export type UpdateKubernetesPersistentVolumeReclaimPolicyData = { + /** + * Reclaim policy update request + */ + body: KubernetesK8sPvReclaimPolicyRequest; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/persistent_volumes/reclaim_policy'; +}; + +export type UpdateKubernetesPersistentVolumeReclaimPolicyErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to update reclaim policy. + */ + 500: unknown; +}; + +export type UpdateKubernetesPersistentVolumeReclaimPolicyResponses = { + /** + * Success + */ + 204: void; +}; + +export type UpdateKubernetesPersistentVolumeReclaimPolicyResponse = + UpdateKubernetesPersistentVolumeReclaimPolicyResponses[keyof UpdateKubernetesPersistentVolumeReclaimPolicyResponses]; + +export type GetKubernetesRbacStatusData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/rbac_enabled'; +}; + +export type GetKubernetesRbacStatusErrors = { + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the RBAC status. + */ + 500: unknown; +}; + +export type GetKubernetesRbacStatusResponses = { + /** + * RBAC status + */ + 200: boolean; +}; + +export type GetKubernetesRbacStatusResponse = + GetKubernetesRbacStatusResponses[keyof GetKubernetesRbacStatusResponses]; + +export type DeleteRoleBindingsData = { + /** + * A map where the key is the namespace and the value is an array of role bindings to delete + */ + body: KubernetesK8sRoleBindingDeleteRequests; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/role_bindings/delete'; +}; + +export type DeleteRoleBindingsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific role binding. + */ + 404: unknown; + /** + * Server error occurred while attempting to delete role bindings. + */ + 500: unknown; +}; + +export type DeleteRoleBindingsResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteRoleBindingsResponse = + DeleteRoleBindingsResponses[keyof DeleteRoleBindingsResponses]; + +export type GetKubernetesRoleBindingsData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/rolebindings'; +}; + +export type GetKubernetesRoleBindingsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the list of role bindings. + */ + 500: unknown; +}; + +export type GetKubernetesRoleBindingsResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesRoleBindingsResponse = + GetKubernetesRoleBindingsResponses[keyof GetKubernetesRoleBindingsResponses]; + +export type GetKubernetesRolesData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/roles'; +}; + +export type GetKubernetesRolesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the list of roles. + */ + 500: unknown; +}; + +export type GetKubernetesRolesResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesRolesResponse = + GetKubernetesRolesResponses[keyof GetKubernetesRolesResponses]; + +export type DeleteRolesData = { + /** + * A map where the key is the namespace and the value is an array of roles to delete + */ + body: KubernetesK8sRoleDeleteRequests; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/roles/delete'; +}; + +export type DeleteRolesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific role. + */ + 404: unknown; + /** + * Server error occurred while attempting to delete roles. + */ + 500: unknown; +}; + +export type DeleteRolesResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteRolesResponse = + DeleteRolesResponses[keyof DeleteRolesResponses]; + +export type GetKubernetesSecretsData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query: { + /** + * When set to true, associate the Secrets with the applications that use them + */ + isUsed: boolean; + }; + url: '/kubernetes/{id}/secrets'; +}; + +export type GetKubernetesSecretsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve all secrets from the cluster. + */ + 500: unknown; +}; + +export type GetKubernetesSecretsResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesSecretsResponse = + GetKubernetesSecretsResponses[keyof GetKubernetesSecretsResponses]; + +export type GetKubernetesSecretsCountData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/secrets/count'; +}; + +export type GetKubernetesSecretsCountErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the count of all secrets from the cluster. + */ + 500: unknown; +}; + +export type GetKubernetesSecretsCountResponses = { + /** + * Success + */ + 200: number; +}; + +export type GetKubernetesSecretsCountResponse = + GetKubernetesSecretsCountResponses[keyof GetKubernetesSecretsCountResponses]; + +export type DeleteServiceAccountsData = { + /** + * A map where the key is the namespace and the value is an array of service accounts to delete + */ + body: KubernetesK8sServiceAccountDeleteRequests; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/service_accounts/delete'; +}; + +export type DeleteServiceAccountsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific service account. + */ + 404: unknown; + /** + * Server error occurred while attempting to delete service accounts. + */ + 500: unknown; +}; + +export type DeleteServiceAccountsResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteServiceAccountsResponse = + DeleteServiceAccountsResponses[keyof DeleteServiceAccountsResponses]; + +export type GetKubernetesServiceAccountsData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/serviceaccounts'; +}; + +export type GetKubernetesServiceAccountsErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the list of service accounts. + */ + 500: unknown; +}; + +export type GetKubernetesServiceAccountsResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesServiceAccountsResponse = + GetKubernetesServiceAccountsResponses[keyof GetKubernetesServiceAccountsResponses]; + +export type GetKubernetesServicesData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: { + /** + * Lookup applications associated with each service + */ + withApplications?: boolean; + }; + url: '/kubernetes/{id}/services'; +}; + +export type GetKubernetesServicesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve all services. + */ + 500: unknown; +}; + +export type GetKubernetesServicesResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetKubernetesServicesResponse = + GetKubernetesServicesResponses[keyof GetKubernetesServicesResponses]; + +export type GetAllKubernetesServicesCountData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/services/count'; +}; + +export type GetAllKubernetesServicesCountErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the total count of all services. + */ + 500: unknown; +}; + +export type GetAllKubernetesServicesCountResponses = { + /** + * Success + */ + 200: number; +}; + +export type GetAllKubernetesServicesCountResponse = + GetAllKubernetesServicesCountResponses[keyof GetAllKubernetesServicesCountResponses]; + +export type DeleteKubernetesServicesData = { + /** + * A map where the key is the namespace and the value is an array of services to delete + */ + body: KubernetesK8sServiceDeleteRequests; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/services/delete'; +}; + +export type DeleteKubernetesServicesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier or unable to find a specific service. + */ + 404: unknown; + /** + * Server error occurred while attempting to delete services. + */ + 500: unknown; +}; + +export type DeleteKubernetesServicesResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteKubernetesServicesResponse = + DeleteKubernetesServicesResponses[keyof DeleteKubernetesServicesResponses]; + +export type GetAllKubernetesStorageClassesData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/storage_classes'; +}; + +export type GetAllKubernetesStorageClassesErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to retrieve storage classes. + */ + 500: unknown; +}; + +export type GetAllKubernetesStorageClassesResponses = { + /** + * Success + */ + 200: Array; +}; + +export type GetAllKubernetesStorageClassesResponse = + GetAllKubernetesStorageClassesResponses[keyof GetAllKubernetesStorageClassesResponses]; + +export type GetKubernetesStorageClassData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * StorageClass name + */ + name: string; + }; + query?: never; + url: '/kubernetes/{id}/storage_classes/{name}'; +}; + +export type GetKubernetesStorageClassErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * StorageClass not found. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the storage class. + */ + 500: unknown; +}; + +export type GetKubernetesStorageClassResponses = { + /** + * Success + */ + 200: KubernetesK8sStorageClass; +}; + +export type GetKubernetesStorageClassResponse = + GetKubernetesStorageClassResponses[keyof GetKubernetesStorageClassResponses]; + +export type SetDefaultKubernetesStorageClassData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * StorageClass name + */ + name: string; + }; + query?: never; + url: '/kubernetes/{id}/storage_classes/{name}/default'; +}; + +export type SetDefaultKubernetesStorageClassErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to set default storage class. + */ + 500: unknown; +}; + +export type SetDefaultKubernetesStorageClassResponses = { + /** + * Success + */ + 204: void; +}; + +export type SetDefaultKubernetesStorageClassResponse = + SetDefaultKubernetesStorageClassResponses[keyof SetDefaultKubernetesStorageClassResponses]; + +export type DeleteKubernetesStorageClassesData = { + /** + * List of StorageClass names to delete + */ + body: Array; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/storage_classes/delete'; +}; + +export type DeleteKubernetesStorageClassesErrors = { + /** + * Invalid request payload. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to delete storage classes. + */ + 500: unknown; +}; + +export type DeleteKubernetesStorageClassesResponses = { + /** + * Success + */ + 204: void; +}; + +export type DeleteKubernetesStorageClassesResponse = + DeleteKubernetesStorageClassesResponses[keyof DeleteKubernetesStorageClassesResponses]; + +export type GetKubernetesVersionData = { + body?: never; + path: { + /** + * Environment(Endpoint) identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/version'; +}; + +export type GetKubernetesVersionErrors = { + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to retrieve the cluster version. + */ + 500: unknown; +}; + +export type GetKubernetesVersionResponses = { + /** + * Success + */ + 200: KubernetesKubernetesVersionResponse; +}; + +export type GetKubernetesVersionResponse = + GetKubernetesVersionResponses[keyof GetKubernetesVersionResponses]; + +export type GetAllKubernetesVolumesData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: { + /** + * When set to True, include the applications that are using the volumes. It is set to false by default + */ + withApplications?: boolean; + }; + url: '/kubernetes/{id}/volumes'; +}; + +export type GetAllKubernetesVolumesErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to retrieve kubernetes volumes. + */ + 500: unknown; +}; + +export type GetAllKubernetesVolumesResponses = { + /** + * Success + */ + 200: { + [key: string]: KubernetesK8sVolumeInfo; + }; +}; + +export type GetAllKubernetesVolumesResponse = + GetAllKubernetesVolumesResponses[keyof GetAllKubernetesVolumesResponses]; + +export type GetKubernetesVolumeData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + /** + * Namespace identifier + */ + namespace: string; + /** + * Volume name + */ + volume: string; + }; + query?: never; + url: '/kubernetes/{id}/volumes/{namespace}/{volume}'; +}; + +export type GetKubernetesVolumeErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GetKubernetesVolumeResponses = { + /** + * Success + */ + 200: KubernetesK8sVolumeInfo; +}; + +export type GetKubernetesVolumeResponse = + GetKubernetesVolumeResponses[keyof GetKubernetesVolumeResponses]; + +export type GetAllKubernetesVolumesCountData = { + body?: never; + path: { + /** + * Environment identifier + */ + id: number; + }; + query?: never; + url: '/kubernetes/{id}/volumes/count'; +}; + +export type GetAllKubernetesVolumesCountErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access or operation not allowed. + */ + 403: unknown; + /** + * Server error occurred while attempting to retrieve kubernetes volumes count. + */ + 500: unknown; +}; + +export type GetAllKubernetesVolumesCountResponses = { + /** + * Success + */ + 200: number; +}; + +export type GetAllKubernetesVolumesCountResponse = + GetAllKubernetesVolumesCountResponses[keyof GetAllKubernetesVolumesCountResponses]; + +export type GetKubernetesConfigData = { + body?: never; + path?: never; + query?: { + /** + * will include only these environments(endpoints) + */ + ids?: Array; + /** + * will exclude these environments(endpoints) + */ + excludeIds?: Array; + }; + url: '/kubernetes/config'; +}; + +export type GetKubernetesConfigErrors = { + /** + * Invalid request payload, such as missing required fields or fields not meeting validation criteria. + */ + 400: unknown; + /** + * Unauthorized access - the user is not authenticated or does not have the necessary permissions. Ensure that you have provided a valid API key or JWT token, and that you have the required permissions. + */ + 401: unknown; + /** + * Permission denied - the user is authenticated but does not have the necessary permissions to access the requested resource or perform the specified operation. Check your user roles and permissions. + */ + 403: unknown; + /** + * Unable to find an environment with the specified identifier. + */ + 404: unknown; + /** + * Server error occurred while attempting to generate the kubeconfig file. + */ + 500: unknown; +}; + +export type GetKubernetesConfigResponses = { + /** + * Success + */ + 200: unknown; +}; + +export type LdapCheckData = { + /** + * details + */ + body: LdapCheckPayload; + path?: never; + query?: never; + url: '/ldap/check'; +}; + +export type LdapCheckErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type LdapCheckResponses = { + /** + * Success + */ + 204: void; +}; + +export type LdapCheckResponse = LdapCheckResponses[keyof LdapCheckResponses]; + +export type MotdData = { + body?: never; + path?: never; + query?: never; + url: '/motd'; +}; + +export type MotdResponses = { + /** + * OK + */ + 200: MotdMotd; +}; + +export type MotdResponse = MotdResponses[keyof MotdResponses]; + +export type RegistryListData = { + body?: never; + path?: never; + query?: never; + url: '/registries'; +}; + +export type RegistryListErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type RegistryListResponses = { + /** + * Success + */ + 200: Array; +}; + +export type RegistryListResponse = + RegistryListResponses[keyof RegistryListResponses]; + +export type RegistryCreateData = { + /** + * Registry details + */ + body: RegistriesRegistryCreatePayload; + path?: never; + query?: never; + url: '/registries'; +}; + +export type RegistryCreateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Another registry with the same name or same URL & credentials already exists + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type RegistryCreateResponses = { + /** + * Success + */ + 200: PortainerRegistry; +}; + +export type RegistryCreateResponse = + RegistryCreateResponses[keyof RegistryCreateResponses]; + +export type RegistryDeleteData = { + body?: never; + path: { + /** + * Registry identifier + */ + id: number; + }; + query?: never; + url: '/registries/{id}'; +}; + +export type RegistryDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Registry not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type RegistryDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type RegistryDeleteResponse = + RegistryDeleteResponses[keyof RegistryDeleteResponses]; + +export type RegistryInspectData = { + body?: never; + path: { + /** + * Registry identifier + */ + id: number; + }; + query?: never; + url: '/registries/{id}'; +}; + +export type RegistryInspectErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied to access registry + */ + 403: unknown; + /** + * Registry not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type RegistryInspectResponses = { + /** + * Success + */ + 200: PortainerRegistry; +}; + +export type RegistryInspectResponse = + RegistryInspectResponses[keyof RegistryInspectResponses]; + +export type RegistryUpdateData = { + /** + * Registry details + */ + body: RegistriesRegistryUpdatePayload; + path: { + /** + * Registry identifier + */ + id: number; + }; + query?: never; + url: '/registries/{id}'; +}; + +export type RegistryUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Registry not found + */ + 404: unknown; + /** + * Another registry with the same name or same URL & credentials already exists + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type RegistryUpdateResponses = { + /** + * Success + */ + 200: PortainerRegistry; +}; + +export type RegistryUpdateResponse = + RegistryUpdateResponses[keyof RegistryUpdateResponses]; + +export type RegistryConfigureData = { + /** + * Registry configuration + */ + body: RegistriesRegistryConfigurePayload; + path: { + /** + * Registry identifier + */ + id: number; + }; + query?: never; + url: '/registries/{id}/configure'; +}; + +export type RegistryConfigureErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Registry not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type RegistryConfigureResponses = { + /** + * Success + */ + 204: void; +}; + +export type RegistryConfigureResponse = + RegistryConfigureResponses[keyof RegistryConfigureResponses]; + +export type RegistryPingData = { + /** + * Registry credentials to test + */ + body: RegistriesRegistryPingPayload; + path?: never; + query?: never; + url: '/registries/ping'; +}; + +export type RegistryPingErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type RegistryPingResponses = { + /** + * Success + */ + 200: RegistriesRegistryPingResponse; +}; + +export type RegistryPingResponse = + RegistryPingResponses[keyof RegistryPingResponses]; + +export type ResourceControlCreateData = { + /** + * Resource control details + */ + body: ResourcecontrolsResourceControlCreatePayload; + path?: never; + query?: never; + url: '/resource_controls'; +}; + +export type ResourceControlCreateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * A resource control is already associated to this resource + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type ResourceControlCreateResponses = { + /** + * Success + */ + 200: PortainerResourceControl; +}; + +export type ResourceControlCreateResponse = + ResourceControlCreateResponses[keyof ResourceControlCreateResponses]; + +export type ResourceControlDeleteData = { + body?: never; + path: { + /** + * Resource control identifier + */ + id: number; + }; + query?: never; + url: '/resource_controls/{id}'; +}; + +export type ResourceControlDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Resource control not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type ResourceControlDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type ResourceControlDeleteResponse = + ResourceControlDeleteResponses[keyof ResourceControlDeleteResponses]; + +export type ResourceControlUpdateData = { + /** + * Resource control details + */ + body: ResourcecontrolsResourceControlUpdatePayload; + path: { + /** + * Resource control identifier + */ + id: number; + }; + query?: never; + url: '/resource_controls/{id}'; +}; + +export type ResourceControlUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Unauthorized + */ + 403: unknown; + /** + * Resource control not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type ResourceControlUpdateResponses = { + /** + * Success + */ + 200: PortainerResourceControl; +}; + +export type ResourceControlUpdateResponse = + ResourceControlUpdateResponses[keyof ResourceControlUpdateResponses]; + +export type RestoreData = { + /** + * Restore request payload + */ + body: BackupRestorePayload; + path?: never; + query?: never; + url: '/restore'; +}; + +export type RestoreErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type RestoreResponses = { + /** + * Success + */ + 200: unknown; +}; + +export type RoleListData = { + body?: never; + path?: never; + query?: never; + url: '/roles'; +}; + +export type RoleListErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type RoleListResponses = { + /** + * Success + */ + 200: Array; +}; + +export type RoleListResponse = RoleListResponses[keyof RoleListResponses]; + +export type SettingsInspectData = { + body?: never; + path?: never; + query?: never; + url: '/settings'; +}; + +export type SettingsInspectErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type SettingsInspectResponses = { + /** + * Success + */ + 200: PortainerSettings; +}; + +export type SettingsInspectResponse = + SettingsInspectResponses[keyof SettingsInspectResponses]; + +export type SettingsUpdateData = { + /** + * New settings + */ + body: SettingsSettingsUpdatePayload; + path?: never; + query?: never; + url: '/settings'; +}; + +export type SettingsUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type SettingsUpdateResponses = { + /** + * Success + */ + 200: PortainerSettings; +}; + +export type SettingsUpdateResponse = + SettingsUpdateResponses[keyof SettingsUpdateResponses]; + +export type SettingsPublicData = { + body?: never; + path?: never; + query?: never; + url: '/settings/public'; +}; + +export type SettingsPublicErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type SettingsPublicResponses = { + /** + * Success + */ + 200: SettingsPublicSettingsResponse; +}; + +export type SettingsPublicResponse = + SettingsPublicResponses[keyof SettingsPublicResponses]; + +export type SslInspectData = { + body?: never; + path?: never; + query?: never; + url: '/ssl'; +}; + +export type SslInspectErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied to access settings + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type SslInspectResponses = { + /** + * Success + */ + 200: PortainerSslSettings; +}; + +export type SslInspectResponse = SslInspectResponses[keyof SslInspectResponses]; + +export type SslUpdateData = { + /** + * SSL Settings + */ + body: SslSslUpdatePayload; + path?: never; + query?: never; + url: '/ssl'; +}; + +export type SslUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied to access settings + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type SslUpdateResponses = { + /** + * Success + */ + 204: void; +}; + +export type SslUpdateResponse = SslUpdateResponses[keyof SslUpdateResponses]; + +export type StackListData = { + body?: never; + path?: never; + query?: { + /** + * Filters to process on the stack list. Encoded as JSON (a map[string]string). For example, {'SwarmID': 'jpofkc0i9uo9wtx1zesuk649w'} will only return stacks that are part of the specified Swarm cluster. Available filters: EndpointID, SwarmID. + */ + filters?: string; + }; + url: '/stacks'; +}; + +export type StackListErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackListResponses = { + /** + * Success + */ + 200: Array; + /** + * Success + */ + 204: void; +}; + +export type StackListResponse = StackListResponses[keyof StackListResponses]; + +export type StackDeleteData = { + body?: never; + path: { + /** + * Stack identifier + */ + id: number; + }; + query: { + /** + * Set to true to delete an external stack. Only external Swarm stacks are supported + */ + external?: boolean; + /** + * Environment identifier + */ + endpointId: number; + }; + url: '/stacks/{id}'; +}; + +export type StackDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type StackDeleteResponse = + StackDeleteResponses[keyof StackDeleteResponses]; + +export type StackInspectData = { + body?: never; + path: { + /** + * Stack identifier + */ + id: number; + }; + query?: never; + url: '/stacks/{id}'; +}; + +export type StackInspectErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Stack not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackInspectResponses = { + /** + * Success + */ + 200: PortainerStack; +}; + +export type StackInspectResponse = + StackInspectResponses[keyof StackInspectResponses]; + +export type StackUpdateData = { + /** + * Stack details + */ + body: StacksUpdateSwarmStackPayload; + path: { + /** + * Stack identifier + */ + id: number; + }; + query: { + /** + * Environment identifier + */ + endpointId: number; + }; + url: '/stacks/{id}'; +}; + +export type StackUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Not found + */ + 404: unknown; + /** + * Conflict + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackUpdateResponses = { + /** + * Success + */ + 200: PortainerStack; +}; + +export type StackUpdateResponse = + StackUpdateResponses[keyof StackUpdateResponses]; + +export type StackAssociateData = { + body?: never; + path: { + /** + * Stack identifier + */ + id: number; + }; + query: { + /** + * Environment identifier + */ + endpointId: number; + /** + * Swarm identifier + */ + swarmId: number; + /** + * Indicates whether the stack is orphaned + */ + orphanedRunning: boolean; + }; + url: '/stacks/{id}/associate'; +}; + +export type StackAssociateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Stack not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackAssociateResponses = { + /** + * Success + */ + 200: PortainerStack; +}; + +export type StackAssociateResponse = + StackAssociateResponses[keyof StackAssociateResponses]; + +export type StackFileInspectData = { + body?: never; + path: { + /** + * Stack identifier + */ + id: number; + }; + query?: never; + url: '/stacks/{id}/file'; +}; + +export type StackFileInspectErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Stack not found + */ + 404: unknown; + /** + * Git settings changed, redeploy required + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackFileInspectResponses = { + /** + * Success + */ + 200: StacksStackFileResponse; +}; + +export type StackFileInspectResponse = + StackFileInspectResponses[keyof StackFileInspectResponses]; + +export type StackUpdateGitData = { + /** + * Git configs for pull and redeploy a stack + */ + body: StacksStackGitUpdatePayload; + path: { + /** + * Stack identifier + */ + id: number; + }; + query?: { + /** + * Stacks created before version 1.18.0 might not have an associated environment(endpoint) identifier. Use this optional parameter to set the environment(endpoint) identifier used by the stack. + */ + endpointId?: number; + }; + url: '/stacks/{id}/git'; +}; + +export type StackUpdateGitErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackUpdateGitResponses = { + /** + * Success + */ + 200: PortainerStack; +}; + +export type StackUpdateGitResponse = + StackUpdateGitResponses[keyof StackUpdateGitResponses]; + +export type StackGitRedeployData = { + /** + * Git configs for pull and redeploy of a stack. **StackName** may only be populated for Kuberenetes stacks, and if specified with a blank string, it will be set to blank + */ + body: StacksStackGitRedeployPayload; + path: { + /** + * Stack identifier + */ + id: number; + }; + query?: { + /** + * Stacks created before version 1.18.0 might not have an associated environment(endpoint) identifier. Use this optional parameter to set the environment(endpoint) identifier used by the stack. + */ + endpointId?: number; + }; + url: '/stacks/{id}/git/redeploy'; +}; + +export type StackGitRedeployErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Not found + */ + 404: unknown; + /** + * Conflict + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackGitRedeployResponses = { + /** + * Success + */ + 200: PortainerStack; +}; + +export type StackGitRedeployResponse = + StackGitRedeployResponses[keyof StackGitRedeployResponses]; + +export type StackMigrateData = { + /** + * Stack migration details + */ + body: StacksStackMigratePayload; + path: { + /** + * Stack identifier + */ + id: number; + }; + query?: { + /** + * Stacks created before version 1.18.0 might not have an associated environment(endpoint) identifier. Use this optional parameter to set the environment(endpoint) identifier used by the stack. + */ + endpointId?: number; + }; + url: '/stacks/{id}/migrate'; +}; + +export type StackMigrateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Stack not found + */ + 404: unknown; + /** + * A stack with the same name is already running on the target environment(endpoint) + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackMigrateResponses = { + /** + * Success + */ + 200: PortainerStack; +}; + +export type StackMigrateResponse = + StackMigrateResponses[keyof StackMigrateResponses]; + +export type StackStartData = { + body?: never; + path: { + /** + * Stack identifier + */ + id: number; + }; + query: { + /** + * Environment identifier + */ + endpointId: number; + }; + url: '/stacks/{id}/start'; +}; + +export type StackStartErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Not found + */ + 404: unknown; + /** + * Stack is already active, deploying, or in error state + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackStartResponses = { + /** + * Success + */ + 200: PortainerStack; +}; + +export type StackStartResponse = StackStartResponses[keyof StackStartResponses]; + +export type StackStopData = { + body?: never; + path: { + /** + * Stack identifier + */ + id: number; + }; + query: { + /** + * Environment identifier + */ + endpointId: number; + }; + url: '/stacks/{id}/stop'; +}; + +export type StackStopErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Not found + */ + 404: unknown; + /** + * Conflict + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackStopResponses = { + /** + * Success + */ + 200: PortainerStack; +}; + +export type StackStopResponse = StackStopResponses[keyof StackStopResponses]; + +export type StackCreateKubernetesGitData = { + /** + * stack config + */ + body: StacksKubernetesGitDeploymentPayload; + path?: never; + query: { + /** + * Identifier of the environment that will be used to deploy the stack + */ + endpointId: number; + }; + url: '/stacks/create/kubernetes/repository'; +}; + +export type StackCreateKubernetesGitErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Stack name or webhook ID already exists + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackCreateKubernetesGitResponses = { + /** + * OK + */ + 200: PortainerStack; +}; + +export type StackCreateKubernetesGitResponse = + StackCreateKubernetesGitResponses[keyof StackCreateKubernetesGitResponses]; + +export type StackCreateKubernetesFileData = { + /** + * stack config + */ + body: StacksKubernetesStringDeploymentPayload; + path?: never; + query: { + /** + * Identifier of the environment that will be used to deploy the stack + */ + endpointId: number; + }; + url: '/stacks/create/kubernetes/string'; +}; + +export type StackCreateKubernetesFileErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackCreateKubernetesFileResponses = { + /** + * OK + */ + 200: PortainerStack; +}; + +export type StackCreateKubernetesFileResponse = + StackCreateKubernetesFileResponses[keyof StackCreateKubernetesFileResponses]; + +export type StackCreateKubernetesUrlData = { + /** + * stack config + */ + body: StacksKubernetesManifestUrlDeploymentPayload; + path?: never; + query: { + /** + * Identifier of the environment that will be used to deploy the stack + */ + endpointId: number; + }; + url: '/stacks/create/kubernetes/url'; +}; + +export type StackCreateKubernetesUrlErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackCreateKubernetesUrlResponses = { + /** + * OK + */ + 200: PortainerStack; +}; + +export type StackCreateKubernetesUrlResponse = + StackCreateKubernetesUrlResponses[keyof StackCreateKubernetesUrlResponses]; + +export type StackCreateDockerStandaloneFileData = { + body: { + /** + * Name of the stack + */ + Name: string; + /** + * Environment variables passed during deployment, represented as a JSON array [{'name': 'name', 'value': 'value'}]. + */ + Env?: string; + /** + * Stack file + */ + file?: Blob | File; + }; + path?: never; + query: { + /** + * Identifier of the environment that will be used to deploy the stack + */ + endpointId: number; + }; + url: '/stacks/create/standalone/file'; +}; + +export type StackCreateDockerStandaloneFileErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackCreateDockerStandaloneFileResponses = { + /** + * OK + */ + 200: PortainerStack; +}; + +export type StackCreateDockerStandaloneFileResponse = + StackCreateDockerStandaloneFileResponses[keyof StackCreateDockerStandaloneFileResponses]; + +export type StackCreateDockerStandaloneRepositoryData = { + /** + * stack config + */ + body: StacksComposeStackFromGitRepositoryPayload; + path?: never; + query: { + /** + * Identifier of the environment that will be used to deploy the stack + */ + endpointId: number; + }; + url: '/stacks/create/standalone/repository'; +}; + +export type StackCreateDockerStandaloneRepositoryErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Stack name or webhook ID already exists + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackCreateDockerStandaloneRepositoryResponses = { + /** + * OK + */ + 200: PortainerStack; +}; + +export type StackCreateDockerStandaloneRepositoryResponse = + StackCreateDockerStandaloneRepositoryResponses[keyof StackCreateDockerStandaloneRepositoryResponses]; + +export type StackCreateDockerStandaloneStringData = { + /** + * stack config + */ + body: StacksComposeStackFromFileContentPayload; + path?: never; + query: { + /** + * Identifier of the environment that will be used to deploy the stack + */ + endpointId: number; + }; + url: '/stacks/create/standalone/string'; +}; + +export type StackCreateDockerStandaloneStringErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackCreateDockerStandaloneStringResponses = { + /** + * OK + */ + 200: PortainerStack; +}; + +export type StackCreateDockerStandaloneStringResponse = + StackCreateDockerStandaloneStringResponses[keyof StackCreateDockerStandaloneStringResponses]; + +export type StackCreateDockerSwarmFileData = { + body?: { + /** + * Name of the stack + */ + Name?: string; + /** + * Swarm cluster identifier. + */ + SwarmID?: string; + /** + * Environment variables passed during deployment, represented as a JSON array [{'name': 'name', 'value': 'value'}]. Optional + */ + Env?: string; + /** + * Stack file + */ + file?: Blob | File; + }; + path?: never; + query: { + /** + * Identifier of the environment that will be used to deploy the stack + */ + endpointId: number; + }; + url: '/stacks/create/swarm/file'; +}; + +export type StackCreateDockerSwarmFileErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackCreateDockerSwarmFileResponses = { + /** + * OK + */ + 200: PortainerStack; +}; + +export type StackCreateDockerSwarmFileResponse = + StackCreateDockerSwarmFileResponses[keyof StackCreateDockerSwarmFileResponses]; + +export type StackCreateDockerSwarmRepositoryData = { + /** + * stack config + */ + body: StacksSwarmStackFromGitRepositoryPayload; + path?: never; + query: { + /** + * Identifier of the environment that will be used to deploy the stack + */ + endpointId: number; + }; + url: '/stacks/create/swarm/repository'; +}; + +export type StackCreateDockerSwarmRepositoryErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Stack name or webhook ID already exists + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackCreateDockerSwarmRepositoryResponses = { + /** + * OK + */ + 200: PortainerStack; +}; + +export type StackCreateDockerSwarmRepositoryResponse = + StackCreateDockerSwarmRepositoryResponses[keyof StackCreateDockerSwarmRepositoryResponses]; + +export type StackCreateDockerSwarmStringData = { + /** + * stack config + */ + body: StacksSwarmStackFromFileContentPayload; + path?: never; + query: { + /** + * Identifier of the environment that will be used to deploy the stack + */ + endpointId: number; + }; + url: '/stacks/create/swarm/string'; +}; + +export type StackCreateDockerSwarmStringErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackCreateDockerSwarmStringResponses = { + /** + * OK + */ + 200: PortainerStack; +}; + +export type StackCreateDockerSwarmStringResponse = + StackCreateDockerSwarmStringResponses[keyof StackCreateDockerSwarmStringResponses]; + +export type StackDeleteKubernetesByNameData = { + body?: never; + path: { + /** + * Stack name + */ + name: string; + }; + query: { + /** + * Set to true to delete an external stack. Only external Swarm stacks are supported + */ + external?: boolean; + /** + * Environment identifier + */ + endpointId: number; + }; + url: '/stacks/name/{name}'; +}; + +export type StackDeleteKubernetesByNameErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type StackDeleteKubernetesByNameResponses = { + /** + * Success + */ + 204: void; +}; + +export type StackDeleteKubernetesByNameResponse = + StackDeleteKubernetesByNameResponses[keyof StackDeleteKubernetesByNameResponses]; + +export type WebhookInvokeData = { + body?: never; + path: { + /** + * Stack identifier + */ + webhookID: string; + }; + query?: never; + url: '/stacks/webhooks/{webhookID}'; +}; + +export type WebhookInvokeErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Autoupdate for the stack isn't available" or "Stack deployment is already in progress + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type WebhookInvokeResponses = { + /** + * Success + */ + 200: unknown; +}; + +export type SystemInfoData = { + body?: never; + path?: never; + query?: never; + url: '/system/info'; +}; + +export type SystemInfoErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type SystemInfoResponses = { + /** + * Success + */ + 200: SystemSystemInfoResponse; +}; + +export type SystemInfoResponse = SystemInfoResponses[keyof SystemInfoResponses]; + +export type SystemNodesCountData = { + body?: never; + path?: never; + query?: never; + url: '/system/nodes'; +}; + +export type SystemNodesCountErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type SystemNodesCountResponses = { + /** + * Success + */ + 200: SystemNodesCountResponse; +}; + +export type SystemNodesCountResponse2 = + SystemNodesCountResponses[keyof SystemNodesCountResponses]; + +export type SystemStatusData = { + body?: never; + path?: never; + query?: never; + url: '/system/status'; +}; + +export type SystemStatusResponses = { + /** + * Success + */ + 200: SystemStatus; +}; + +export type SystemStatusResponse = + SystemStatusResponses[keyof SystemStatusResponses]; + +export type SystemUpgradeData = { + body?: never; + path?: never; + query?: never; + url: '/system/upgrade'; +}; + +export type SystemUpgradeResponses = { + /** + * Success + */ + 204: SystemStatus; +}; + +export type SystemUpgradeResponse = + SystemUpgradeResponses[keyof SystemUpgradeResponses]; + +export type SystemVersionData = { + body?: never; + path?: never; + query?: never; + url: '/system/version'; +}; + +export type SystemVersionResponses = { + /** + * Success + */ + 200: SystemVersionResponse; +}; + +export type SystemVersionResponse2 = + SystemVersionResponses[keyof SystemVersionResponses]; + +export type TagListData = { + body?: never; + path?: never; + query?: never; + url: '/tags'; +}; + +export type TagListErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type TagListResponses = { + /** + * Success + */ + 200: Array; +}; + +export type TagListResponse = TagListResponses[keyof TagListResponses]; + +export type TagCreateData = { + /** + * Tag details + */ + body: TagsTagCreatePayload; + path?: never; + query?: never; + url: '/tags'; +}; + +export type TagCreateErrors = { + /** + * This name is already associated to a tag + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TagCreateResponses = { + /** + * Success + */ + 200: PortainerTag; +}; + +export type TagCreateResponse = TagCreateResponses[keyof TagCreateResponses]; + +export type TagDeleteData = { + body?: never; + path: { + /** + * Tag identifier + */ + id: number; + }; + query?: never; + url: '/tags/{id}'; +}; + +export type TagDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Tag not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TagDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type TagDeleteResponse = TagDeleteResponses[keyof TagDeleteResponses]; + +export type TeamMembershipListData = { + body?: never; + path?: never; + query?: never; + url: '/team_memberships'; +}; + +export type TeamMembershipListErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TeamMembershipListResponses = { + /** + * Success + */ + 200: Array; +}; + +export type TeamMembershipListResponse = + TeamMembershipListResponses[keyof TeamMembershipListResponses]; + +export type TeamMembershipCreateData = { + /** + * Team membership details + */ + body: TeammembershipsTeamMembershipCreatePayload; + path?: never; + query?: never; + url: '/team_memberships'; +}; + +export type TeamMembershipCreateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied to manage memberships + */ + 403: unknown; + /** + * Team membership already registered + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TeamMembershipCreateResponses = { + /** + * Success + */ + 200: PortainerTeamMembership; +}; + +export type TeamMembershipCreateResponse = + TeamMembershipCreateResponses[keyof TeamMembershipCreateResponses]; + +export type TeamMembershipDeleteData = { + body?: never; + path: { + /** + * TeamMembership identifier + */ + id: number; + }; + query?: never; + url: '/team_memberships/{id}'; +}; + +export type TeamMembershipDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * TeamMembership not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TeamMembershipDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type TeamMembershipDeleteResponse = + TeamMembershipDeleteResponses[keyof TeamMembershipDeleteResponses]; + +export type TeamMembershipUpdateData = { + /** + * Team membership details + */ + body: TeammembershipsTeamMembershipUpdatePayload; + path: { + /** + * Team membership identifier + */ + id: number; + }; + query?: never; + url: '/team_memberships/{id}'; +}; + +export type TeamMembershipUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * TeamMembership not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TeamMembershipUpdateResponses = { + /** + * Success + */ + 200: PortainerTeamMembership; +}; + +export type TeamMembershipUpdateResponse = + TeamMembershipUpdateResponses[keyof TeamMembershipUpdateResponses]; + +export type TeamListData = { + body?: never; + path?: never; + query?: { + /** + * Only list teams that the user is leader of + */ + onlyLedTeams?: boolean; + /** + * Identifier of the environment(endpoint) that will be used to filter the authorized teams + */ + environmentId?: number; + }; + url: '/teams'; +}; + +export type TeamListErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type TeamListResponses = { + /** + * Success + */ + 200: Array; +}; + +export type TeamListResponse = TeamListResponses[keyof TeamListResponses]; + +export type TeamCreateData = { + /** + * details + */ + body: TeamsTeamCreatePayload; + path?: never; + query?: never; + url: '/teams'; +}; + +export type TeamCreateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * A team with the same name already exists + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TeamCreateResponses = { + /** + * Success + */ + 200: PortainerTeam; +}; + +export type TeamCreateResponse = TeamCreateResponses[keyof TeamCreateResponses]; + +export type TeamDeleteData = { + body?: never; + path: { + /** + * Team Id + */ + id: number; + }; + query?: never; + url: '/teams/{id}'; +}; + +export type TeamDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Team not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TeamDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type TeamDeleteResponse = TeamDeleteResponses[keyof TeamDeleteResponses]; + +export type TeamInspectData = { + body?: never; + path: { + /** + * Team identifier + */ + id: number; + }; + query?: never; + url: '/teams/{id}'; +}; + +export type TeamInspectErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Team not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TeamInspectResponses = { + /** + * Success + */ + 200: PortainerTeam; +}; + +export type TeamInspectResponse = + TeamInspectResponses[keyof TeamInspectResponses]; + +export type TeamUpdateData = { + /** + * Team details + */ + body: TeamsTeamUpdatePayload; + path: { + /** + * Team identifier + */ + id: number; + }; + query?: never; + url: '/teams/{id}'; +}; + +export type TeamUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Team not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TeamUpdateResponses = { + /** + * Success + */ + 200: PortainerTeam; +}; + +export type TeamUpdateResponse = TeamUpdateResponses[keyof TeamUpdateResponses]; + +export type TeamMembershipsData = { + body?: never; + path: { + /** + * Team Id + */ + id: number; + }; + query?: never; + url: '/teams/{id}/memberships'; +}; + +export type TeamMembershipsErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TeamMembershipsResponses = { + /** + * Success + */ + 200: Array; +}; + +export type TeamMembershipsResponse = + TeamMembershipsResponses[keyof TeamMembershipsResponses]; + +export type TemplateListData = { + body?: never; + path?: never; + query?: never; + url: '/templates'; +}; + +export type TemplateListErrors = { + /** + * Server error + */ + 500: unknown; +}; + +export type TemplateListResponses = { + /** + * Success + */ + 200: TemplatesListResponse; +}; + +export type TemplateListResponse = + TemplateListResponses[keyof TemplateListResponses]; + +export type TemplateFileData = { + body?: never; + path: { + /** + * Template identifier + */ + id: number; + }; + query?: never; + url: '/templates/{id}/file'; +}; + +export type TemplateFileErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type TemplateFileResponses = { + /** + * Success + */ + 200: TemplatesFileResponse; +}; + +export type TemplateFileResponse = + TemplateFileResponses[keyof TemplateFileResponses]; + +export type HelmRepoSearchData = { + body?: never; + path?: never; + query: { + /** + * Helm repository URL + */ + repo: string; + /** + * Helm chart name + */ + chart?: string; + /** + * If true will use cache to search + */ + useCache?: string; + }; + url: '/templates/helm'; +}; + +export type HelmRepoSearchErrors = { + /** + * Bad request + */ + 400: unknown; + /** + * Unauthorized + */ + 401: unknown; + /** + * Not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type HelmRepoSearchResponses = { + /** + * Success + */ + 200: string; +}; + +export type HelmRepoSearchResponse = + HelmRepoSearchResponses[keyof HelmRepoSearchResponses]; + +export type HelmShowData = { + body?: never; + path: { + /** + * chart/values/readme + */ + command: string; + }; + query: { + /** + * Helm repository URL + */ + repo: string; + /** + * Chart name + */ + chart: string; + /** + * Chart version + */ + version?: string; + }; + url: '/templates/helm/{command}'; +}; + +export type HelmShowErrors = { + /** + * Unauthorized + */ + 401: unknown; + /** + * Environment(Endpoint) or ServiceAccount not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type HelmShowResponses = { + /** + * Success + */ + 200: string; +}; + +export type HelmShowResponse = HelmShowResponses[keyof HelmShowResponses]; + +export type UploadTlsData = { + body: { + /** + * Folder where the TLS file will be stored. Will be created if not existing + */ + folder: string; + /** + * The file to upload + */ + file: Blob | File; + }; + path: { + /** + * TLS file type. Valid values are 'ca', 'cert' or 'key'. + */ + certificate: 'ca' | 'cert' | 'key'; + }; + query?: never; + url: '/upload/tls/{certificate}'; +}; + +export type UploadTlsErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UploadTlsResponses = { + /** + * Success + */ + 204: void; +}; + +export type UploadTlsResponse = UploadTlsResponses[keyof UploadTlsResponses]; + +export type UserListData = { + body?: never; + path?: never; + query?: { + /** + * Identifier of the environment(endpoint) that will be used to filter the authorized users + */ + environmentId?: number; + }; + url: '/users'; +}; + +export type UserListErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserListResponses = { + /** + * Success + */ + 200: Array; +}; + +export type UserListResponse = UserListResponses[keyof UserListResponses]; + +export type UserCreateData = { + /** + * User details + */ + body: UsersUserCreatePayload; + path?: never; + query?: never; + url: '/users'; +}; + +export type UserCreateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * User already exists + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserCreateResponses = { + /** + * Success + */ + 200: PortainerUser; +}; + +export type UserCreateResponse = UserCreateResponses[keyof UserCreateResponses]; + +export type UserDeleteData = { + body?: never; + path: { + /** + * User identifier + */ + id: number; + }; + query?: never; + url: '/users/{id}'; +}; + +export type UserDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * User not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type UserDeleteResponse = UserDeleteResponses[keyof UserDeleteResponses]; + +export type UserInspectData = { + body?: never; + path: { + /** + * User identifier + */ + id: number; + }; + query?: never; + url: '/users/{id}'; +}; + +export type UserInspectErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * User not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserInspectResponses = { + /** + * Success + */ + 200: PortainerUser; +}; + +export type UserInspectResponse = + UserInspectResponses[keyof UserInspectResponses]; + +export type UserUpdateData = { + /** + * User details + */ + body: UsersUserUpdatePayload; + path: { + /** + * User identifier + */ + id: number; + }; + query?: never; + url: '/users/{id}'; +}; + +export type UserUpdateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * User not found + */ + 404: unknown; + /** + * Username already exist + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserUpdateResponses = { + /** + * Success + */ + 200: PortainerUser; +}; + +export type UserUpdateResponse = UserUpdateResponses[keyof UserUpdateResponses]; + +export type UserEffectiveAccessInspectData = { + body?: never; + path: { + /** + * User identifier + */ + id: number; + }; + query?: never; + url: '/users/{id}/effective-access'; +}; + +export type UserEffectiveAccessInspectErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * User not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserEffectiveAccessInspectResponses = { + /** + * Success + */ + 200: Array; +}; + +export type UserEffectiveAccessInspectResponse = + UserEffectiveAccessInspectResponses[keyof UserEffectiveAccessInspectResponses]; + +export type HelmUserRepositoriesListData = { + body?: never; + path: { + /** + * User identifier + */ + id: number; + }; + query?: never; + url: '/users/{id}/helm/repositories'; +}; + +export type HelmUserRepositoriesListErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type HelmUserRepositoriesListResponses = { + /** + * Success + */ + 200: UsersHelmUserRepositoryResponse; +}; + +export type HelmUserRepositoriesListResponse = + HelmUserRepositoriesListResponses[keyof HelmUserRepositoriesListResponses]; + +export type HelmUserRepositoryCreateData = { + /** + * Helm Repository + */ + body: UsersAddHelmRepoUrlPayload; + path: { + /** + * User identifier + */ + id: number; + }; + query?: never; + url: '/users/{id}/helm/repositories'; +}; + +export type HelmUserRepositoryCreateErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type HelmUserRepositoryCreateResponses = { + /** + * Success + */ + 200: PortainerHelmUserRepository; +}; + +export type HelmUserRepositoryCreateResponse = + HelmUserRepositoryCreateResponses[keyof HelmUserRepositoryCreateResponses]; + +export type HelmUserRepositoryDeleteData = { + body?: never; + path: { + /** + * User identifier + */ + id: number; + /** + * Repository identifier + */ + repositoryID: number; + }; + query?: never; + url: '/users/{id}/helm/repositories/{repositoryID}'; +}; + +export type HelmUserRepositoryDeleteErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type HelmUserRepositoryDeleteResponses = { + /** + * Success + */ + 204: void; +}; + +export type HelmUserRepositoryDeleteResponse = + HelmUserRepositoryDeleteResponses[keyof HelmUserRepositoryDeleteResponses]; + +export type UserMembershipsInspectData = { + body?: never; + path: { + /** + * User identifier + */ + id: number; + }; + query?: never; + url: '/users/{id}/memberships'; +}; + +export type UserMembershipsInspectErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserMembershipsInspectResponses = { + /** + * Success + */ + 200: PortainerTeamMembership; +}; + +export type UserMembershipsInspectResponse = + UserMembershipsInspectResponses[keyof UserMembershipsInspectResponses]; + +export type UserUpdatePasswordData = { + /** + * details + */ + body: UsersUserUpdatePasswordPayload; + path: { + /** + * identifier + */ + id: number; + }; + query?: never; + url: '/users/{id}/passwd'; +}; + +export type UserUpdatePasswordErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * User not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserUpdatePasswordResponses = { + /** + * Success + */ + 204: void; +}; + +export type UserUpdatePasswordResponse = + UserUpdatePasswordResponses[keyof UserUpdatePasswordResponses]; + +export type UserGetApiKeysData = { + body?: never; + path: { + /** + * User identifier + */ + id: number; + }; + query?: never; + url: '/users/{id}/tokens'; +}; + +export type UserGetApiKeysErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * User not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserGetApiKeysResponses = { + /** + * Success + */ + 200: Array; +}; + +export type UserGetApiKeysResponse = + UserGetApiKeysResponses[keyof UserGetApiKeysResponses]; + +export type UserGenerateApiKeyData = { + /** + * details + */ + body: UsersUserAccessTokenCreatePayload; + path: { + /** + * User identifier + */ + id: number; + }; + query?: never; + url: '/users/{id}/tokens'; +}; + +export type UserGenerateApiKeyErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Unauthorized + */ + 401: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * User not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserGenerateApiKeyResponses = { + /** + * Success + */ + 200: UsersAccessTokenResponse; +}; + +export type UserGenerateApiKeyResponse = + UserGenerateApiKeyResponses[keyof UserGenerateApiKeyResponses]; + +export type UserRemoveApiKeyData = { + body?: never; + path: { + /** + * User identifier + */ + id: number; + /** + * Api Key identifier + */ + keyID: number; + }; + query?: never; + url: '/users/{id}/tokens/{keyID}'; +}; + +export type UserRemoveApiKeyErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserRemoveApiKeyResponses = { + /** + * Success + */ + 204: void; +}; + +export type UserRemoveApiKeyResponse = + UserRemoveApiKeyResponses[keyof UserRemoveApiKeyResponses]; + +export type UserAdminCheckData = { + body?: never; + path?: never; + query?: never; + url: '/users/admin/check'; +}; + +export type UserAdminCheckErrors = { + /** + * User not found + */ + 404: unknown; +}; + +export type UserAdminCheckResponses = { + /** + * Success + */ + 204: void; +}; + +export type UserAdminCheckResponse = + UserAdminCheckResponses[keyof UserAdminCheckResponses]; + +export type UserAdminInitData = { + /** + * User details + */ + body: UsersAdminInitPayload; + path?: never; + query?: never; + url: '/users/admin/init'; +}; + +export type UserAdminInitErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Admin user already initialized + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type UserAdminInitResponses = { + /** + * Success + */ + 200: PortainerUser; +}; + +export type UserAdminInitResponse = + UserAdminInitResponses[keyof UserAdminInitResponses]; + +export type CurrentUserInspectData = { + body?: never; + path?: never; + query?: never; + url: '/users/me'; +}; + +export type CurrentUserInspectErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * User not found + */ + 404: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type CurrentUserInspectResponses = { + /** + * Success + */ + 200: PortainerUser; +}; + +export type CurrentUserInspectResponse = + CurrentUserInspectResponses[keyof CurrentUserInspectResponses]; + +export type GetWebhooksData = { + body?: never; + path?: never; + query?: { + /** + * Filters (json-string) + */ + filters?: string; + }; + url: '/webhooks'; +}; + +export type GetWebhooksErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type GetWebhooksResponses = { + /** + * OK + */ + 200: Array; +}; + +export type GetWebhooksResponse = + GetWebhooksResponses[keyof GetWebhooksResponses]; + +export type PostWebhooksData = { + /** + * Webhook data + */ + body: WebhooksWebhookCreatePayload; + path?: never; + query?: never; + url: '/webhooks'; +}; + +export type PostWebhooksErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * A webhook for this resource already exists + */ + 409: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type PostWebhooksResponses = { + /** + * OK + */ + 200: PortainerWebhook; +}; + +export type PostWebhooksResponse = + PostWebhooksResponses[keyof PostWebhooksResponses]; + +export type DeleteWebhooksByIdData = { + body?: never; + path: { + /** + * Webhook id + */ + id: number; + }; + query?: never; + url: '/webhooks/{id}'; +}; + +export type DeleteWebhooksByIdErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type DeleteWebhooksByIdResponses = { + /** + * Webhook deleted + */ + 202: unknown; +}; + +export type PostWebhooksByIdData = { + body?: never; + path: { + /** + * Webhook token + */ + id: string; + }; + query?: never; + url: '/webhooks/{id}'; +}; + +export type PostWebhooksByIdErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type PostWebhooksByIdResponses = { + /** + * Webhook executed + */ + 202: unknown; +}; + +export type PutWebhooksByIdData = { + /** + * Webhook data + */ + body: WebhooksWebhookUpdatePayload; + path: { + /** + * Webhook id + */ + id: number; + }; + query?: never; + url: '/webhooks/{id}'; +}; + +export type PutWebhooksByIdErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Conflict + */ + 409: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type PutWebhooksByIdResponses = { + /** + * OK + */ + 200: PortainerWebhook; +}; + +export type PutWebhooksByIdResponse = + PutWebhooksByIdResponses[keyof PutWebhooksByIdResponses]; + +export type GetWebsocketAttachData = { + body?: never; + path?: never; + query: { + /** + * environment(endpoint) ID of the environment(endpoint) where the resource is located + */ + endpointId: number; + /** + * node name + */ + nodeName?: string; + }; + url: '/websocket/attach'; +}; + +export type GetWebsocketAttachErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type GetWebsocketAttachResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type GetWebsocketExecData = { + body?: never; + path?: never; + query: { + /** + * environment(endpoint) ID of the environment(endpoint) where the resource is located + */ + endpointId: number; + /** + * node name + */ + nodeName?: string; + }; + url: '/websocket/exec'; +}; + +export type GetWebsocketExecErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Conflict + */ + 409: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type GetWebsocketExecResponses = { + /** + * OK + */ + 200: unknown; +}; + +export type GetWebsocketKubernetesShellData = { + body?: never; + path?: never; + query: { + /** + * environment(endpoint) ID of the environment(endpoint) where the resource is located + */ + endpointId: number; + }; + url: '/websocket/kubernetes-shell'; +}; + +export type GetWebsocketKubernetesShellErrors = { + /** + * Invalid request + */ + 400: unknown; + /** + * Permission denied + */ + 403: unknown; + /** + * Server error + */ + 500: unknown; +}; + +export type GetWebsocketKubernetesShellResponses = { + /** + * Success + */ + 200: unknown; +}; + +export type GetWebsocketPodData = { + body?: never; + path?: never; + query: { + /** + * environment(endpoint) ID of the environment(endpoint) where the resource is located + */ + endpointId: number; + /** + * namespace where the container is located + */ + namespace: string; + /** + * name of the pod containing the container + */ + podName: string; + /** + * name of the container + */ + containerName: string; + /** + * command to execute in the container + */ + command: string; + }; + url: '/websocket/pod'; +}; + +export type GetWebsocketPodErrors = { + /** + * Bad Request + */ + 400: unknown; + /** + * Forbidden + */ + 403: unknown; + /** + * Not Found + */ + 404: unknown; + /** + * Internal Server Error + */ + 500: unknown; +}; + +export type GetWebsocketPodResponses = { + /** + * OK + */ + 200: unknown; +}; diff --git a/app/react/portainer/generated-api/portainer/zod.gen.ts b/app/react/portainer/generated-api/portainer/zod.gen.ts new file mode 100644 index 0000000000..331502fbc2 --- /dev/null +++ b/app/react/portainer/generated-api/portainer/zod.gen.ts @@ -0,0 +1,5855 @@ +// This file is auto-generated by @hey-api/openapi-ts + +import * as z from 'zod'; + +import { + IntstrType, + K8sIoApiCoreV1ConditionStatus, + Oauth2AuthStyle, + PlatformContainerPlatform, + PortainerAuthenticationMethod, + PortainerCustomTemplatePlatform, + PortainerEdgeJobLogsStatus, + PortainerEdgeStackDeploymentType, + PortainerEdgeStackStatusType, + PortainerEndpointStatus, + PortainerEndpointType, + PortainerMembershipRole, + PortainerRegistryType, + PortainerResourceAccessLevel, + PortainerResourceControlType, + PortainerSourceType, + PortainerStackStatus, + PortainerStackType, + PortainerTemplateType, + PortainerUserRole, + PortainerWebhookType, + UsersAccessLocation, + V1AppArmorProfileType, + V1ContainerRestartPolicy, + V1ContainerRestartRuleAction, + V1ContainerRestartRuleOnExitCodesOperator, + V1ManagedFieldsOperationType, + V1MountPropagationMode, + V1NamespaceConditionType, + V1NamespacePhase, + V1PersistentVolumeAccessMode, + V1PersistentVolumeClaimPhase, + V1PersistentVolumeMode, + V1PersistentVolumePhase, + V1PersistentVolumeReclaimPolicy, + V1ProcMountType, + V1Protocol, + V1PullPolicy, + V1RecursiveReadOnlyMode, + V1ResourceName, + V1ResourceQuotaScope, + V1ResourceResizeRestartPolicy, + V1ScopeSelectorOperator, + V1SeccompProfileType, + V1Signal, + V1TerminationMessagePolicy, + V1UriScheme, + WorkflowsDeploymentPlatform, + WorkflowsStatus, + WorkflowsType, +} from './types.gen'; + +export const zWorkflowsStatus = z.enum(WorkflowsStatus); + +export const zWorkflowsWorkflowPhaseStatus = z.object({ + error: z.string().optional(), + status: zWorkflowsStatus.optional(), +}); + +export const zWorkflowsWorkflowStatusObject = z.object({ + artifact: zWorkflowsWorkflowPhaseStatus.optional(), + source: zWorkflowsWorkflowPhaseStatus.optional(), + target: zWorkflowsWorkflowPhaseStatus.optional(), +}); + +export const zWorkflowsType = z.enum(WorkflowsType); + +export const zWorkflowsTarget = z.object({ + edgeGroupIds: z.array(z.int()).optional(), + endpointId: z.int().optional(), + groupStatus: z.record(z.string(), zWorkflowsStatus).optional(), + namespace: z.string().optional(), + resolvedEndpointIds: z.array(z.int()).optional(), +}); + +export const zWorkflowsDeploymentPlatform = z.enum(WorkflowsDeploymentPlatform); + +export const zGittypesGitAuthentication = z.object({ + AuthorizationType: z.int().optional(), + GitCredentialID: z.int().optional(), + Password: z.string().optional(), + Provider: z.int().optional(), + Username: z.string().optional(), +}); + +export const zGittypesRepoConfig = z.object({ + Authentication: zGittypesGitAuthentication.optional(), + ConfigFilePath: z.string().optional(), + ConfigHash: z.string().optional(), + ReferenceName: z.string().optional(), + TLSSkipVerify: z.boolean().optional(), + URL: z.string().optional(), +}); + +export const zPortainerAutoUpdateSettings = z.object({ + ForcePullImage: z.boolean().optional(), + ForceUpdate: z.boolean().optional(), + Interval: z.string().optional(), + JobID: z.string().optional(), + Webhook: z.string().optional(), +}); + +export const zWorkflowsWorkflow = z.object({ + autoUpdate: zPortainerAutoUpdateSettings.optional(), + creationDate: z.int().optional(), + gitConfig: zGittypesRepoConfig.optional(), + id: z.int().optional(), + lastSyncDate: z.int().optional(), + name: z.string().optional(), + platform: zWorkflowsDeploymentPlatform.optional(), + status: zWorkflowsWorkflowStatusObject.optional(), + target: zWorkflowsTarget.optional(), + type: zWorkflowsType.optional(), +}); + +export const zWorkflowsStatusSummary = z.object({ + error: z.int().optional(), + healthy: z.int().optional(), + paused: z.int().optional(), + syncing: z.int().optional(), + unknown: z.int().optional(), +}); + +export const zWebhooksWebhookUpdatePayload = z.object({ + RegistryID: z.int().optional(), +}); + +export const zPortainerWebhookType = z.enum(PortainerWebhookType); + +export const zWebhooksWebhookCreatePayload = z.object({ + EndpointID: z.int().optional(), + RegistryID: z.int().optional(), + ResourceID: z.string().optional(), + WebhookType: zPortainerWebhookType.optional(), +}); + +export const zV1ListMeta = z.object({ + continue: z.string().optional(), + remainingItemCount: z.int().optional(), + resourceVersion: z.string().optional(), + selfLink: z.string().optional(), +}); + +export const zV1Duration = z.object({ + 'time.Duration': z + .union([ + z.literal(-9223372036854776000), + z.literal(9223372036854776000), + z.literal(1), + z.literal(1000), + z.literal(1000000), + z.literal(1000000000), + z.literal(60000000000), + z.literal(3600000000000), + ]) + .optional(), +}); + +export const zV1OwnerReference = z.object({ + apiVersion: z.string().optional(), + blockOwnerDeletion: z.boolean().optional(), + controller: z.boolean().optional(), + kind: z.string().optional(), + name: z.string().optional(), + uid: z.string().optional(), +}); + +export const zV1ManagedFieldsOperationType = z.enum( + V1ManagedFieldsOperationType +); + +export const zV1FieldsV1 = z.record(z.string(), z.unknown()); + +export const zV1ManagedFieldsEntry = z.object({ + apiVersion: z.string().optional(), + fieldsType: z.string().optional(), + fieldsV1: zV1FieldsV1.optional(), + manager: z.string().optional(), + operation: zV1ManagedFieldsOperationType.optional(), + subresource: z.string().optional(), + time: z.string().optional(), +}); + +export const zV1ObjectMeta = z.object({ + annotations: z.record(z.string(), z.string()).optional(), + creationTimestamp: z.string().optional(), + deletionGracePeriodSeconds: z.int().optional(), + deletionTimestamp: z.string().optional(), + finalizers: z.array(z.string()).optional(), + generateName: z.string().optional(), + generation: z.int().optional(), + labels: z.record(z.string(), z.string()).optional(), + managedFields: z.array(zV1ManagedFieldsEntry).optional(), + name: z.string().optional(), + namespace: z.string().optional(), + ownerReferences: z.array(zV1OwnerReference).optional(), + resourceVersion: z.string().optional(), + selfLink: z.string().optional(), + uid: z.string().optional(), +}); + +export const zResourceQuantity = z.object({ + Format: z.enum(['DecimalExponent', 'BinarySI', 'DecimalSI']).optional(), +}); + +export const zV1ResourceList = z.record(z.string(), zResourceQuantity); + +export const zV1Beta1ContainerMetrics = z.object({ + name: z.string().optional(), + usage: zV1ResourceList.optional(), +}); + +export const zV1Beta1PodMetrics = z.object({ + apiVersion: z.string().optional(), + containers: z.array(zV1Beta1ContainerMetrics).optional(), + kind: z.string().optional(), + metadata: zV1ObjectMeta.optional(), + timestamp: z.string().optional(), + window: zV1Duration.optional(), +}); + +export const zV1Beta1PodMetricsList = z.object({ + apiVersion: z.string().optional(), + items: z.array(zV1Beta1PodMetrics).optional(), + kind: z.string().optional(), + metadata: zV1ListMeta.optional(), +}); + +export const zV1Beta1NodeMetrics = z.object({ + apiVersion: z.string().optional(), + kind: z.string().optional(), + metadata: zV1ObjectMeta.optional(), + timestamp: z.string().optional(), + usage: zV1ResourceList.optional(), + window: zV1Duration.optional(), +}); + +export const zV1Beta1NodeMetricsList = z.object({ + apiVersion: z.string().optional(), + items: z.array(zV1Beta1NodeMetrics).optional(), + kind: z.string().optional(), + metadata: zV1ListMeta.optional(), +}); + +export const zV1WindowsSecurityContextOptions = z.object({ + gmsaCredentialSpec: z.string().optional(), + gmsaCredentialSpecName: z.string().optional(), + hostProcess: z.boolean().optional(), + runAsUserName: z.string().optional(), +}); + +export const zV1RecursiveReadOnlyMode = z.enum(V1RecursiveReadOnlyMode); + +export const zV1MountPropagationMode = z.enum(V1MountPropagationMode); + +export const zV1VolumeMount = z.object({ + mountPath: z.string().optional(), + mountPropagation: zV1MountPropagationMode.optional(), + name: z.string().optional(), + readOnly: z.boolean().optional(), + recursiveReadOnly: zV1RecursiveReadOnlyMode.optional(), + subPath: z.string().optional(), + subPathExpr: z.string().optional(), +}); + +export const zV1VolumeDevice = z.object({ + devicePath: z.string().optional(), + name: z.string().optional(), +}); + +export const zV1UriScheme = z.enum(V1UriScheme); + +export const zV1TerminationMessagePolicy = z.enum(V1TerminationMessagePolicy); + +export const zIntstrType = z.enum(IntstrType); + +export const zIntstrIntOrString = z.object({ + IntVal: z.int().optional(), + StrVal: z.string().optional(), + Type: zIntstrType.optional(), +}); + +export const zV1TcpSocketAction = z.object({ + host: z.string().optional(), + port: zIntstrIntOrString.optional(), +}); + +export const zV1SleepAction = z.object({ + seconds: z.int().optional(), +}); + +export const zV1Signal = z.enum(V1Signal); + +export const zV1SeccompProfileType = z.enum(V1SeccompProfileType); + +export const zV1SeccompProfile = z.object({ + localhostProfile: z.string().optional(), + type: zV1SeccompProfileType.optional(), +}); + +export const zV1SeLinuxOptions = z.object({ + level: z.string().optional(), + role: z.string().optional(), + type: z.string().optional(), + user: z.string().optional(), +}); + +export const zV1ProcMountType = z.enum(V1ProcMountType); + +export const zV1Capabilities = z.object({ + add: z.array(z.string()).optional(), + drop: z.array(z.string()).optional(), +}); + +export const zV1AppArmorProfileType = z.enum(V1AppArmorProfileType); + +export const zV1AppArmorProfile = z.object({ + localhostProfile: z.string().optional(), + type: zV1AppArmorProfileType.optional(), +}); + +export const zV1SecurityContext = z.object({ + allowPrivilegeEscalation: z.boolean().optional(), + appArmorProfile: zV1AppArmorProfile.optional(), + capabilities: zV1Capabilities.optional(), + privileged: z.boolean().optional(), + procMount: zV1ProcMountType.optional(), + readOnlyRootFilesystem: z.boolean().optional(), + runAsGroup: z.int().optional(), + runAsNonRoot: z.boolean().optional(), + runAsUser: z.int().optional(), + seLinuxOptions: zV1SeLinuxOptions.optional(), + seccompProfile: zV1SeccompProfile.optional(), + windowsOptions: zV1WindowsSecurityContextOptions.optional(), +}); + +export const zV1SecretReference = z.object({ + name: z.string().optional(), + namespace: z.string().optional(), +}); + +export const zV1SecretKeySelector = z.object({ + key: z.string().optional(), + name: z.string().optional(), + optional: z.boolean().optional(), +}); + +export const zV1SecretEnvSource = z.object({ + name: z.string().optional(), + optional: z.boolean().optional(), +}); + +export const zV1ResourceQuotaScope = z.enum(V1ResourceQuotaScope); + +export const zV1ScopeSelectorOperator = z.enum(V1ScopeSelectorOperator); + +export const zV1ScopedResourceSelectorRequirement = z.object({ + operator: zV1ScopeSelectorOperator.optional(), + scopeName: zV1ResourceQuotaScope.optional(), + values: z.array(z.string()).optional(), +}); + +export const zV1ScopeSelector = z.object({ + matchExpressions: z.array(zV1ScopedResourceSelectorRequirement).optional(), +}); + +export const zV1RoleRef = z.object({ + apiGroup: z.string().optional(), + kind: z.string().optional(), + name: z.string().optional(), +}); + +export const zV1ResourceResizeRestartPolicy = z.enum( + V1ResourceResizeRestartPolicy +); + +export const zK8sIoApiCoreV1ResourceClaim = z.object({ + name: z.string().optional(), + request: z.string().optional(), +}); + +export const zV1ResourceRequirements = z.object({ + claims: z.array(zK8sIoApiCoreV1ResourceClaim).optional(), + limits: zV1ResourceList.optional(), + requests: zV1ResourceList.optional(), +}); + +export const zV1ResourceQuotaStatus = z.object({ + hard: zV1ResourceList.optional(), + used: zV1ResourceList.optional(), +}); + +export const zV1ResourceQuotaSpec = z.object({ + hard: zV1ResourceList.optional(), + scopeSelector: zV1ScopeSelector.optional(), + scopes: z.array(zV1ResourceQuotaScope).optional(), +}); + +export const zV1ResourceQuota = z.object({ + apiVersion: z.string().optional(), + kind: z.string().optional(), + metadata: zV1ObjectMeta.optional(), + spec: zV1ResourceQuotaSpec.optional(), + status: zV1ResourceQuotaStatus.optional(), +}); + +export const zV1ResourceName = z.enum(V1ResourceName); + +export const zV1ResourceFieldSelector = z.object({ + containerName: z.string().optional(), + divisor: zResourceQuantity.optional(), + resource: z.string().optional(), +}); + +export const zV1PullPolicy = z.enum(V1PullPolicy); + +export const zV1Protocol = z.enum(V1Protocol); + +export const zV1HttpHeader = z.object({ + name: z.string().optional(), + value: z.string().optional(), +}); + +export const zV1HttpGetAction = z.object({ + host: z.string().optional(), + httpHeaders: z.array(zV1HttpHeader).optional(), + path: z.string().optional(), + port: zIntstrIntOrString.optional(), + scheme: zV1UriScheme.optional(), +}); + +export const zV1GrpcAction = z.object({ + port: z.int().optional(), + service: z.string().optional(), +}); + +export const zV1ExecAction = z.object({ + command: z.array(z.string()).optional(), +}); + +export const zV1Probe = z.object({ + exec: zV1ExecAction.optional(), + failureThreshold: z.int().optional(), + grpc: zV1GrpcAction.optional(), + httpGet: zV1HttpGetAction.optional(), + initialDelaySeconds: z.int().optional(), + periodSeconds: z.int().optional(), + successThreshold: z.int().optional(), + tcpSocket: zV1TcpSocketAction.optional(), + terminationGracePeriodSeconds: z.int().optional(), + timeoutSeconds: z.int().optional(), +}); + +export const zV1PersistentVolumeReclaimPolicy = z.enum( + V1PersistentVolumeReclaimPolicy +); + +export const zV1PersistentVolumePhase = z.enum(V1PersistentVolumePhase); + +export const zV1PersistentVolumeMode = z.enum(V1PersistentVolumeMode); + +export const zV1PersistentVolumeClaimPhase = z.enum( + V1PersistentVolumeClaimPhase +); + +export const zV1PersistentVolumeAccessMode = z.enum( + V1PersistentVolumeAccessMode +); + +export const zV1ObjectReference = z.object({ + apiVersion: z.string().optional(), + fieldPath: z.string().optional(), + kind: z.string().optional(), + name: z.string().optional(), + namespace: z.string().optional(), + resourceVersion: z.string().optional(), + uid: z.string().optional(), +}); + +export const zV1ObjectFieldSelector = z.object({ + apiVersion: z.string().optional(), + fieldPath: z.string().optional(), +}); + +export const zV1NamespacePhase = z.enum(V1NamespacePhase); + +export const zV1NamespaceConditionType = z.enum(V1NamespaceConditionType); + +export const zK8sIoApiCoreV1ConditionStatus = z.enum( + K8sIoApiCoreV1ConditionStatus +); + +export const zV1NamespaceCondition = z.object({ + lastTransitionTime: z.string().optional(), + message: z.string().optional(), + reason: z.string().optional(), + status: zK8sIoApiCoreV1ConditionStatus.optional(), + type: zV1NamespaceConditionType.optional(), +}); + +export const zV1NamespaceStatus = z.object({ + conditions: z.array(zV1NamespaceCondition).optional(), + phase: zV1NamespacePhase.optional(), +}); + +export const zV1LocalObjectReference = z.object({ + name: z.string().optional(), +}); + +export const zV1LifecycleHandler = z.object({ + exec: zV1ExecAction.optional(), + httpGet: zV1HttpGetAction.optional(), + sleep: zV1SleepAction.optional(), + tcpSocket: zV1TcpSocketAction.optional(), +}); + +export const zV1Lifecycle = z.object({ + postStart: zV1LifecycleHandler.optional(), + preStop: zV1LifecycleHandler.optional(), + stopSignal: zV1Signal.optional(), +}); + +export const zV1FileKeySelector = z.object({ + key: z.string().optional(), + optional: z.boolean().optional(), + path: z.string().optional(), + volumeName: z.string().optional(), +}); + +export const zV1ConfigMapKeySelector = z.object({ + key: z.string().optional(), + name: z.string().optional(), + optional: z.boolean().optional(), +}); + +export const zV1EnvVarSource = z.object({ + configMapKeyRef: zV1ConfigMapKeySelector.optional(), + fieldRef: zV1ObjectFieldSelector.optional(), + fileKeyRef: zV1FileKeySelector.optional(), + resourceFieldRef: zV1ResourceFieldSelector.optional(), + secretKeyRef: zV1SecretKeySelector.optional(), +}); + +export const zV1EnvVar = z.object({ + name: z.string().optional(), + value: z.string().optional(), + valueFrom: zV1EnvVarSource.optional(), +}); + +export const zV1ConfigMapEnvSource = z.object({ + name: z.string().optional(), + optional: z.boolean().optional(), +}); + +export const zV1EnvFromSource = z.object({ + configMapRef: zV1ConfigMapEnvSource.optional(), + prefix: z.string().optional(), + secretRef: zV1SecretEnvSource.optional(), +}); + +export const zV1ContainerRestartRuleOnExitCodesOperator = z.enum( + V1ContainerRestartRuleOnExitCodesOperator +); + +export const zV1ContainerRestartRuleOnExitCodes = z.object({ + operator: zV1ContainerRestartRuleOnExitCodesOperator.optional(), + values: z.array(z.int()).optional(), +}); + +export const zV1ContainerRestartRuleAction = z.enum( + V1ContainerRestartRuleAction +); + +export const zV1ContainerRestartRule = z.object({ + action: zV1ContainerRestartRuleAction.optional(), + exitCodes: zV1ContainerRestartRuleOnExitCodes.optional(), +}); + +export const zV1ContainerRestartPolicy = z.enum(V1ContainerRestartPolicy); + +export const zV1ContainerResizePolicy = z.object({ + resourceName: zV1ResourceName.optional(), + restartPolicy: zV1ResourceResizeRestartPolicy.optional(), +}); + +export const zV1ContainerPort = z.object({ + containerPort: z.int().optional(), + hostIP: z.string().optional(), + hostPort: z.int().optional(), + name: z.string().optional(), + protocol: zV1Protocol.optional(), +}); + +export const zV1Container = z.object({ + args: z.array(z.string()).optional(), + command: z.array(z.string()).optional(), + env: z.array(zV1EnvVar).optional(), + envFrom: z.array(zV1EnvFromSource).optional(), + image: z.string().optional(), + imagePullPolicy: zV1PullPolicy.optional(), + lifecycle: zV1Lifecycle.optional(), + livenessProbe: zV1Probe.optional(), + name: z.string().optional(), + ports: z.array(zV1ContainerPort).optional(), + readinessProbe: zV1Probe.optional(), + resizePolicy: z.array(zV1ContainerResizePolicy).optional(), + resources: zV1ResourceRequirements.optional(), + restartPolicy: zV1ContainerRestartPolicy.optional(), + restartPolicyRules: z.array(zV1ContainerRestartRule).optional(), + securityContext: zV1SecurityContext.optional(), + startupProbe: zV1Probe.optional(), + stdin: z.boolean().optional(), + stdinOnce: z.boolean().optional(), + terminationMessagePath: z.string().optional(), + terminationMessagePolicy: zV1TerminationMessagePolicy.optional(), + tty: z.boolean().optional(), + volumeDevices: z.array(zV1VolumeDevice).optional(), + volumeMounts: z.array(zV1VolumeMount).optional(), + workingDir: z.string().optional(), +}); + +export const zV1CsiPersistentVolumeSource = z.object({ + controllerExpandSecretRef: zV1SecretReference.optional(), + controllerPublishSecretRef: zV1SecretReference.optional(), + driver: z.string().optional(), + fsType: z.string().optional(), + nodeExpandSecretRef: zV1SecretReference.optional(), + nodePublishSecretRef: zV1SecretReference.optional(), + nodeStageSecretRef: zV1SecretReference.optional(), + readOnly: z.boolean().optional(), + volumeAttributes: z.record(z.string(), z.string()).optional(), + volumeHandle: z.string().optional(), +}); + +export const zUsersThemePayload = z.object({ + color: z.enum(['dark', 'light', 'highcontrast', 'auto']).optional(), +}); + +export const zUsersUserUpdatePayload = z.object({ + NewPassword: z.string(), + Password: z.string(), + Role: z.union([z.literal(1), z.literal(2)]), + Theme: zUsersThemePayload.optional(), + UseCache: z.boolean(), + Username: z.string(), +}); + +export const zUsersUserUpdatePasswordPayload = z.object({ + NewPassword: z.string(), + Password: z.string(), +}); + +export const zUsersUserCreatePayload = z.object({ + Password: z.string(), + Role: z.union([z.literal(1), z.literal(2)]), + Username: z.string(), +}); + +export const zUsersUserAccessTokenCreatePayload = z.object({ + description: z.string(), + password: z.string(), +}); + +export const zPortainerHelmUserRepository = z.object({ + Id: z.int().optional(), + URL: z.string().optional(), + UserId: z.int().optional(), +}); + +export const zUsersHelmUserRepositoryResponse = z.object({ + GlobalRepository: z.string().optional(), + UserRepositories: z.array(zPortainerHelmUserRepository).optional(), +}); + +export const zUsersAdminInitPayload = z.object({ + Password: z.string(), + Username: z.string(), +}); + +export const zUsersAddHelmRepoUrlPayload = z.object({ + url: z.string().optional(), +}); + +export const zPortainerApiKey = z.object({ + dateCreated: z.int().optional(), + description: z.string().optional(), + digest: z.string().optional(), + id: z.int().optional(), + lastUsed: z.int().optional(), + prefix: z.string().optional(), + userId: z.int().optional(), +}); + +export const zUsersAccessTokenResponse = z.object({ + apiKey: zPortainerApiKey.optional(), + rawAPIKey: z.string().optional(), +}); + +export const zUsersAccessLocation = z.enum(UsersAccessLocation); + +export const zUsersEffectiveAccessEntry = z.object({ + accessLocation: zUsersAccessLocation.optional(), + endpointId: z.int().optional(), + endpointName: z.string().optional(), + groupId: z.int().optional(), + groupName: z.string().optional(), + roleId: z.int().optional(), + roleName: z.string().optional(), + rolePriority: z.int().optional(), + teamId: z.int().optional(), + teamName: z.string().optional(), +}); + +export const zUnstructuredUnstructured = z.object({ + Object: z.record(z.string(), z.unknown()).optional(), +}); + +export const zPortainerTemplateVolume = z.object({ + bind: z.string().optional(), + container: z.string().optional(), + readonly: z.boolean().optional(), +}); + +export const zPortainerTemplateType = z.enum(PortainerTemplateType); + +export const zPortainerTemplateRepository = z.object({ + stackfile: z.string().optional(), + url: z.string().optional(), +}); + +export const zPortainerPair = z.object({ + name: z.string().optional(), + value: z.string().optional(), +}); + +export const zPortainerTemplateEnvSelect = z.object({ + default: z.boolean().optional(), + text: z.string().optional(), + value: z.string().optional(), +}); + +export const zPortainerTemplateEnv = z.object({ + default: z.string().optional(), + description: z.string().optional(), + label: z.string().optional(), + name: z.string().optional(), + preset: z.boolean().optional(), + select: z.array(zPortainerTemplateEnvSelect).optional(), +}); + +export const zPortainerTemplate = z.object({ + administrator_only: z.boolean().optional(), + categories: z.array(z.string()).optional(), + command: z.string().optional(), + description: z.string().optional(), + env: z.array(zPortainerTemplateEnv).optional(), + hostname: z.string().optional(), + id: z.int().optional(), + image: z.string().optional(), + interactive: z.boolean().optional(), + labels: z.array(zPortainerPair).optional(), + logo: z.string().optional(), + name: z.string().optional(), + network: z.string().optional(), + note: z.string().optional(), + platform: z.string().optional(), + ports: z.array(z.string()).optional(), + privileged: z.boolean().optional(), + registry: z.string().optional(), + repository: zPortainerTemplateRepository.optional(), + restart_policy: z.string().optional(), + stackFile: z.string().optional(), + title: z.string().optional(), + type: zPortainerTemplateType.optional(), + volumes: z.array(zPortainerTemplateVolume).optional(), +}); + +export const zTemplatesListResponse = z.object({ + templates: z.array(zPortainerTemplate).optional(), + version: z.string().optional(), +}); + +export const zTemplatesFileResponse = z.object({ + FileContent: z.string().optional(), +}); + +export const zTeamsTeamUpdatePayload = z.object({ + Name: z.string().optional(), +}); + +export const zTeamsTeamCreatePayload = z.object({ + Name: z.string(), + TeamLeaders: z.array(z.int()).optional(), +}); + +export const zTeammembershipsTeamMembershipUpdatePayload = z.object({ + Role: z.union([z.literal(1), z.literal(2)]), + TeamID: z.int(), + UserID: z.int(), +}); + +export const zTeammembershipsTeamMembershipCreatePayload = z.object({ + Role: z.union([z.literal(1), z.literal(2)]), + TeamID: z.int(), + UserID: z.int(), +}); + +export const zTagsTagCreatePayload = z.object({ + Name: z.string(), +}); + +export const zBuildRuntimeInfo = z.object({ + Env: z.array(z.string()).optional(), +}); + +export const zBuildDependenciesInfo = z.object({ + ComposeVersion: z.string().optional(), + DockerVersion: z.string().optional(), + HelmVersion: z.string().optional(), + KubectlVersion: z.string().optional(), +}); + +export const zBuildBuildInfo = z.object({ + BuildNumber: z.string().optional(), + GitCommit: z.string().optional(), + GoVersion: z.string().optional(), + ImageTag: z.string().optional(), + NodejsVersion: z.string().optional(), + PnpmVersion: z.string().optional(), + WebpackVersion: z.string().optional(), +}); + +export const zSystemVersionResponse = z.object({ + Build: zBuildBuildInfo.optional(), + DatabaseVersion: z.string().optional(), + Dependencies: zBuildDependenciesInfo.optional(), + LatestVersion: z.string().optional(), + Runtime: zBuildRuntimeInfo.optional(), + ServerEdition: z.string().optional(), + ServerVersion: z.string().optional(), + UpdateAvailable: z.boolean().optional(), + VersionSupport: z.string().optional(), +}); + +export const zPlatformContainerPlatform = z.enum(PlatformContainerPlatform); + +export const zSystemSystemInfoResponse = z.object({ + agents: z.int().optional(), + edgeAgents: z.int().optional(), + platform: zPlatformContainerPlatform.optional(), +}); + +export const zSystemStatus = z.object({ + InstanceID: z.string().optional(), + Version: z.string().optional(), +}); + +export const zSystemNodesCountResponse = z.object({ + nodes: z.int().optional(), +}); + +export const zSwarmServiceUpdateResponse = z.object({ + Warnings: z.array(z.string()).optional(), +}); + +export const zStatsContainerStats = z.object({ + healthy: z.int().optional(), + running: z.int().optional(), + stopped: z.int().optional(), + total: z.int().optional(), + unhealthy: z.int().optional(), +}); + +export const zStacksUpdateSwarmStackPayload = z.object({ + Env: z.array(zPortainerPair).optional(), + Prune: z.boolean().optional(), + PullImage: z.boolean().optional(), + RepullImageAndRedeploy: z.boolean().optional(), + StackFileContent: z.string().optional(), +}); + +export const zStacksSwarmStackFromGitRepositoryPayload = z.object({ + AdditionalFiles: z.array(z.string()).optional(), + AutoUpdate: zPortainerAutoUpdateSettings.optional(), + ComposeFile: z.string().optional().default('docker-compose.yml'), + Env: z.array(zPortainerPair).optional(), + FromAppTemplate: z.boolean().optional(), + Name: z.string(), + RepositoryAuthentication: z.boolean().optional(), + RepositoryPassword: z.string().optional(), + RepositoryReferenceName: z.string().optional(), + RepositoryURL: z.string(), + RepositoryUsername: z.string().optional(), + SwarmID: z.string(), + TLSSkipVerify: z.boolean().optional(), +}); + +export const zStacksSwarmStackFromFileContentPayload = z.object({ + Env: z.array(zPortainerPair).optional(), + FromAppTemplate: z.boolean().optional(), + Name: z.string(), + StackFileContent: z.string(), + SwarmID: z.string(), +}); + +export const zStacksStackMigratePayload = z.object({ + EndpointID: z.int(), + Name: z.string().optional(), + SwarmID: z.string().optional(), +}); + +export const zStacksStackGitUpdatePayload = z.object({ + AdditionalFiles: z.array(z.string()).optional(), + AutoUpdate: zPortainerAutoUpdateSettings.optional(), + ConfigFilePath: z.string().optional(), + Env: z.array(zPortainerPair).optional(), + Prune: z.boolean().optional(), + RepositoryAuthentication: z.boolean().optional(), + RepositoryPassword: z.string().optional(), + RepositoryReferenceName: z.string().optional(), + RepositoryURL: z.string().optional(), + RepositoryUsername: z.string().optional(), + TLSSkipVerify: z.boolean().optional(), +}); + +export const zStacksStackGitRedeployPayload = z.object({ + Env: z.array(zPortainerPair).optional(), + Prune: z.boolean().optional(), + PullImage: z.boolean().optional(), + RepositoryAuthentication: z.boolean().optional(), + RepositoryPassword: z.string().optional(), + RepositoryReferenceName: z.string().optional(), + RepositoryUsername: z.string().optional(), + RepullImageAndRedeploy: z.boolean().optional(), + StackName: z.string().optional(), +}); + +export const zStacksStackFileResponse = z.object({ + StackFileContent: z.string().optional(), +}); + +export const zStacksKubernetesStringDeploymentPayload = z.object({ + ComposeFormat: z.boolean().optional(), + FromAppTemplate: z.boolean().optional(), + Namespace: z.string().optional(), + StackFileContent: z.string().optional(), + StackName: z.string().optional(), +}); + +export const zStacksKubernetesManifestUrlDeploymentPayload = z.object({ + ComposeFormat: z.boolean().optional(), + ManifestURL: z.string().optional(), + Namespace: z.string().optional(), + StackName: z.string().optional(), +}); + +export const zStacksKubernetesGitDeploymentPayload = z.object({ + AdditionalFiles: z.array(z.string()).optional(), + AutoUpdate: zPortainerAutoUpdateSettings.optional(), + ComposeFormat: z.boolean().optional(), + ManifestFile: z.string().optional(), + Namespace: z.string().optional(), + RepositoryAuthentication: z.boolean().optional(), + RepositoryPassword: z.string().optional(), + RepositoryReferenceName: z.string().optional(), + RepositoryURL: z.string().optional(), + RepositoryUsername: z.string().optional(), + StackName: z.string().optional(), + TLSSkipVerify: z.boolean().optional(), +}); + +export const zStacksComposeStackFromGitRepositoryPayload = z.object({ + AdditionalFiles: z.array(z.string()).optional(), + AutoUpdate: zPortainerAutoUpdateSettings.optional(), + ComposeFile: z.string().optional().default('docker-compose.yml'), + Env: z.array(zPortainerPair).optional(), + FromAppTemplate: z.boolean().optional(), + Name: z.string(), + RepositoryAuthentication: z.boolean().optional(), + RepositoryPassword: z.string().optional(), + RepositoryReferenceName: z.string().optional(), + RepositoryURL: z.string(), + RepositoryUsername: z.string().optional(), + TLSSkipVerify: z.boolean().optional(), +}); + +export const zStacksComposeStackFromFileContentPayload = z.object({ + Env: z.array(zPortainerPair).optional(), + FromAppTemplate: z.boolean().optional(), + Name: z.string(), + StackFileContent: z.string(), +}); + +export const zSslSslUpdatePayload = z.object({ + Cert: z.string().optional(), + HTTPEnabled: z.boolean().optional(), + Key: z.string().optional(), +}); + +export const zSourcesConnectionInfo = z.object({ + authentication: z.boolean().optional(), + configFilePath: z.string().optional(), + referenceName: z.string().optional(), + tlsSkipVerify: z.boolean().optional(), +}); + +export const zSourcesAutoUpdateInfo = z.object({ + fetchInterval: z.string().optional(), + mechanism: z.string().optional(), +}); + +export const zSourcesSourceDetail = z.object({ + autoUpdate: zSourcesAutoUpdateInfo.optional(), + connection: zSourcesConnectionInfo.optional(), + environments: z.int().optional(), + error: z.string().optional(), + id: z.string().optional(), + lastSync: z.int().optional(), + name: z.string().optional(), + status: zWorkflowsStatus.optional(), + type: z.string().optional(), + url: z.string().optional(), + usedBy: z.int().optional(), + workflows: z.array(zWorkflowsWorkflow).optional(), +}); + +export const zSourcesSource = z.object({ + environments: z.int().optional(), + error: z.string().optional(), + id: z.string().optional(), + lastSync: z.int().optional(), + name: z.string().optional(), + status: zWorkflowsStatus.optional(), + type: z.string().optional(), + url: z.string().optional(), + usedBy: z.int().optional(), +}); + +export const zSourcesGitAuthenticationPayload = z.object({ + authorizationType: z.int().optional(), + password: z.string().optional(), + provider: z.int().optional(), + username: z.string().optional(), +}); + +export const zSourcesGitSourceCreatePayload = z.object({ + authentication: zSourcesGitAuthenticationPayload.optional(), + clearAuthentication: z.boolean().optional(), + name: z.string().optional(), + tlsSkipVerify: z.boolean().optional(), + url: z.string().optional(), +}); + +export const zOauth2AuthStyle = z.enum(Oauth2AuthStyle); + +export const zPortainerOAuthSettings = z.object({ + AccessTokenURI: z.string().optional(), + AuthStyle: zOauth2AuthStyle.optional(), + AuthorizationURI: z.string().optional(), + ClientID: z.string().optional(), + ClientSecret: z.string().optional(), + DefaultTeamID: z.int().optional(), + KubeSecretKey: z.array(z.int()).optional(), + LogoutURI: z.string().optional(), + OAuthAutoCreateUsers: z.boolean().optional(), + RedirectURI: z.string().optional(), + ResourceURI: z.string().optional(), + SSO: z.boolean().optional(), + Scopes: z.string().optional(), + UserIdentifier: z.string().optional(), +}); + +export const zPortainerTlsConfiguration = z.object({ + TLS: z.boolean().optional(), + TLSCACert: z.string().optional(), + TLSCert: z.string().optional(), + TLSKey: z.string().optional(), + TLSSkipVerify: z.boolean().optional(), +}); + +export const zPortainerLdapSearchSettings = z.object({ + BaseDN: z.string().optional(), + Filter: z.string().optional(), + UserNameAttribute: z.string().optional(), +}); + +export const zPortainerLdapGroupSearchSettings = z.object({ + GroupAttribute: z.string().optional(), + GroupBaseDN: z.string().optional(), + GroupFilter: z.string().optional(), +}); + +export const zPortainerLdapSettings = z.object({ + AnonymousMode: z.boolean().optional(), + AutoCreateUsers: z.boolean().optional(), + GroupSearchSettings: z.array(zPortainerLdapGroupSearchSettings).optional(), + Password: z.string().optional(), + ReaderDN: z.string().optional(), + SearchSettings: z.array(zPortainerLdapSearchSettings).optional(), + StartTLS: z.boolean().optional(), + TLSConfig: zPortainerTlsConfiguration.optional(), + URL: z.string().optional(), +}); + +export const zPortainerInternalAuthSettings = z.object({ + RequiredPasswordLength: z.int().optional(), +}); + +export const zPortainerGlobalDeploymentOptions = z.object({ + hideStacksFunctionality: z.boolean().optional(), +}); + +export const zSettingsSettingsUpdatePayload = z.object({ + AuthenticationMethod: z.int().optional(), + BlackListedLabels: z.array(zPortainerPair).optional(), + EdgeAgentCheckinInterval: z.int().optional(), + EdgePortainerURL: z.string().optional(), + EnableEdgeComputeFeatures: z.boolean().optional(), + EnforceEdgeID: z.boolean().optional(), + ForceSecureCookies: z.boolean().optional(), + GlobalDeploymentOptions: zPortainerGlobalDeploymentOptions.optional(), + HelmRepositoryURL: z.string().optional(), + InternalAuthSettings: zPortainerInternalAuthSettings.optional(), + KubeconfigExpiry: z.string().optional().default('0'), + KubectlShellImage: z.string().optional(), + LDAPSettings: zPortainerLdapSettings.optional(), + LogoURL: z.string().optional(), + OAuthSettings: zPortainerOAuthSettings.optional(), + SnapshotInterval: z.string().optional(), + TemplatesURL: z.string().optional(), + TrustOnFirstConnect: z.boolean().optional(), + UserSessionTimeout: z.string().optional(), +}); + +export const zPortainerAuthenticationMethod = z.enum( + PortainerAuthenticationMethod +); + +export const zSettingsPublicSettingsResponse = z.object({ + AuthenticationMethod: zPortainerAuthenticationMethod.optional(), + Edge: z + .object({ + CheckinInterval: z.int().optional(), + CommandInterval: z.int().optional(), + PingInterval: z.int().optional(), + SnapshotInterval: z.int().optional(), + }) + .optional(), + EnableEdgeComputeFeatures: z.boolean().optional(), + Features: z.record(z.string(), z.boolean()).optional(), + GlobalDeploymentOptions: zPortainerGlobalDeploymentOptions.optional(), + IsDockerDesktopExtension: z.boolean().optional(), + KubeconfigExpiry: z.string().optional().default('0'), + LogoURL: z.string().optional(), + OAuthLoginURI: z.string().optional(), + OAuthLogoutURI: z.string().optional(), + RequiredPasswordLength: z.int().optional(), + TeamSync: z.boolean().optional(), +}); + +export const zRoarRoarPortainerEndpointId = z.record(z.string(), z.unknown()); + +export const zResourcecontrolsResourceControlUpdatePayload = z.object({ + AdministratorsOnly: z.boolean().optional(), + Public: z.boolean().optional(), + Teams: z.array(z.int()).optional(), + Users: z.array(z.int()).optional(), +}); + +export const zResourcecontrolsResourceControlCreatePayload = z.object({ + AdministratorsOnly: z.boolean().optional(), + Public: z.boolean().optional(), + ResourceID: z.string(), + SubResourceIDs: z.array(z.string()).optional(), + Teams: z.array(z.int()).optional(), + Type: z.union([ + z.literal(1), + z.literal(2), + z.literal(3), + z.literal(4), + z.literal(5), + z.literal(6), + z.literal(7), + z.literal(8), + z.literal(9), + ]), + Users: z.array(z.int()).optional(), +}); + +export const zPortainerResourceControlType = z.enum( + PortainerResourceControlType +); + +export const zReleaseValues = z.object({ + computedValues: z.string().optional(), + userSuppliedValues: z.string().optional(), +}); + +export const zReleaseReleaseElement = z.object({ + appVersion: z.string().optional(), + chart: z.string().optional(), + name: z.string().optional(), + namespace: z.string().optional(), + revision: z.string().optional(), + status: z.string().optional(), + updated: z.string().optional(), +}); + +export const zReleaseInfo = z.object({ + deleted: z.string().optional(), + description: z.string().optional(), + first_deployed: z.string().optional(), + last_deployed: z.string().optional(), + notes: z.string().optional(), + resources: z.array(zUnstructuredUnstructured).optional(), + status: z.string().optional(), +}); + +export const zReleaseHookExecution = z.object({ + completed_at: z.string().optional(), + phase: z.string().optional(), + started_at: z.string().optional(), +}); + +export const zGithubComPortainerPortainerPkgLibhelmReleaseHook = z.object({ + delete_policies: z.array(z.string()).optional(), + events: z.array(z.string()).optional(), + kind: z.string().optional(), + last_run: zReleaseHookExecution.optional(), + manifest: z.string().optional(), + name: z.string().optional(), + path: z.string().optional(), + weight: z.int().optional(), +}); + +export const zReleaseChartReference = z.object({ + chartPath: z.string().optional(), + registryID: z.int().optional(), + repoURL: z.string().optional(), +}); + +export const zReleaseMaintainer = z.object({ + email: z.string().optional(), + name: z.string().optional(), + url: z.string().optional(), +}); + +export const zReleaseDependency = z.object({ + alias: z.string().optional(), + condition: z.string().optional(), + enabled: z.boolean().optional(), + 'import-values': z.array(z.unknown()).optional(), + name: z.string().optional(), + repository: z.string().optional(), + tags: z.array(z.string()).optional(), + version: z.string().optional(), +}); + +export const zReleaseMetadata = z.object({ + annotations: z.record(z.string(), z.string()).optional(), + apiVersion: z.string().optional(), + appVersion: z.string().optional(), + condition: z.string().optional(), + dependencies: z.array(zReleaseDependency).optional(), + deprecated: z.boolean().optional(), + description: z.string().optional(), + home: z.string().optional(), + icon: z.string().optional(), + keywords: z.array(z.string()).optional(), + kubeVersion: z.string().optional(), + maintainers: z.array(zReleaseMaintainer).optional(), + name: z.string().optional(), + sources: z.array(z.string()).optional(), + tags: z.string().optional(), + type: z.string().optional(), + version: z.string().optional(), +}); + +export const zReleaseLock = z.object({ + dependencies: z.array(zReleaseDependency).optional(), + digest: z.string().optional(), + generated: z.string().optional(), +}); + +export const zReleaseFile = z.object({ + data: z.array(z.int()).optional(), + name: z.string().optional(), +}); + +export const zReleaseChart = z.object({ + files: z.array(zReleaseFile).optional(), + lock: zReleaseLock.optional(), + metadata: zReleaseMetadata.optional(), + schema: z.array(z.int()).optional(), + templates: z.array(zReleaseFile).optional(), + values: z.record(z.string(), z.unknown()).optional(), +}); + +export const zReleaseRelease = z.object({ + appVersion: z.string().optional(), + chart: zReleaseChart.optional(), + chartReference: zReleaseChartReference.optional(), + config: z.record(z.string(), z.unknown()).optional(), + hooks: z.array(zGithubComPortainerPortainerPkgLibhelmReleaseHook).optional(), + info: zReleaseInfo.optional(), + manifest: z.string().optional(), + name: z.string().optional(), + namespace: z.string().optional(), + stackID: z.int().optional(), + values: zReleaseValues.optional(), + version: z.int().optional(), +}); + +export const zPortainerAccessPolicy = z.object({ + Namespaces: z.array(z.string()).optional(), + RoleId: z.int().optional(), +}); + +export const zPortainerUserAccessPolicies = z.record( + z.string(), + zPortainerAccessPolicy +); + +export const zPortainerTeamAccessPolicies = z.record( + z.string(), + zPortainerAccessPolicy +); + +export const zPortainerRegistryAccessPolicies = z.object({ + Namespaces: z.array(z.string()).optional(), + TeamAccessPolicies: zPortainerTeamAccessPolicies.optional(), + UserAccessPolicies: zPortainerUserAccessPolicies.optional(), +}); + +export const zPortainerRegistryAccesses = z.record( + z.string(), + zPortainerRegistryAccessPolicies +); + +export const zPortainerQuayRegistryData = z.object({ + OrganisationName: z.string().optional(), + UseOrganisation: z.boolean().optional(), +}); + +export const zPortainerEcrData = z.object({ + Region: z.string().optional(), +}); + +export const zRegistriesRegistryUpdatePayload = z.object({ + Authentication: z.boolean(), + BaseURL: z.string().optional(), + Ecr: zPortainerEcrData.optional(), + Name: z.string(), + Password: z.string().optional(), + Quay: zPortainerQuayRegistryData.optional(), + RegistryAccesses: zPortainerRegistryAccesses.optional(), + URL: z.string(), + Username: z.string().optional(), +}); + +export const zRegistriesRegistryPingResponse = z.object({ + message: z.string().optional(), + success: z.boolean().optional(), +}); + +export const zRegistriesRegistryPingPayload = z.object({ + Password: z.string().optional(), + TLS: z.boolean().optional(), + Type: z.union([ + z.literal(1), + z.literal(2), + z.literal(3), + z.literal(4), + z.literal(5), + z.literal(6), + z.literal(7), + z.literal(8), + ]), + URL: z.string(), + Username: z.string().optional(), +}); + +export const zPortainerRegistryType = z.enum(PortainerRegistryType); + +export const zPortainerGitlabRegistryData = z.object({ + InstanceURL: z.string().optional(), + ProjectId: z.int().optional(), + ProjectPath: z.string().optional(), +}); + +export const zRegistriesRegistryCreatePayload = z.object({ + Authentication: z.boolean(), + BaseURL: z.string().optional(), + Ecr: zPortainerEcrData.optional(), + Gitlab: zPortainerGitlabRegistryData.optional(), + Name: z.string(), + Password: z.string().optional(), + Quay: zPortainerQuayRegistryData.optional(), + TLS: z.boolean().optional(), + Type: z.union([ + z.literal(1), + z.literal(2), + z.literal(3), + z.literal(4), + z.literal(5), + z.literal(6), + z.literal(7), + ]), + URL: z.string(), + Username: z.string().optional(), +}); + +export const zRegistriesRegistryConfigurePayload = z.object({ + Authentication: z.boolean(), + Password: z.string().optional(), + Region: z.string().optional(), + TLS: z.boolean().optional(), + TLSCACertFile: z + .array( + z + .int() + .min(-2147483648, { + error: 'Invalid value: Expected int32 to be >= -2147483648', + }) + .max(2147483647, { + error: 'Invalid value: Expected int32 to be <= 2147483647', + }) + ) + .optional(), + TLSCertFile: z + .array( + z + .int() + .min(-2147483648, { + error: 'Invalid value: Expected int32 to be >= -2147483648', + }) + .max(2147483647, { + error: 'Invalid value: Expected int32 to be <= 2147483647', + }) + ) + .optional(), + TLSKeyFile: z + .array( + z + .int() + .min(-2147483648, { + error: 'Invalid value: Expected int32 to be >= -2147483648', + }) + .max(2147483647, { + error: 'Invalid value: Expected int32 to be <= 2147483647', + }) + ) + .optional(), + TLSSkipVerify: z.boolean().optional(), + Username: z.string().optional(), +}); + +export const zPortainerWebhook = z.object({ + EndpointId: z.int().optional(), + Id: z.int().optional(), + RegistryId: z.int().optional(), + ResourceId: z.string().optional(), + Token: z.string().optional(), + Type: zPortainerWebhookType.optional(), +}); + +export const zPortainerUserThemeSettings = z.object({ + color: z.enum(['dark', 'light', 'highcontrast', 'auto']).optional(), +}); + +export const zPortainerUserRole = z.enum(PortainerUserRole); + +export const zPortainerResourceAccessLevel = z.enum( + PortainerResourceAccessLevel +); + +export const zPortainerUserResourceAccess = z.object({ + AccessLevel: zPortainerResourceAccessLevel.optional(), + UserId: z.int().optional(), +}); + +export const zPortainerAuthorizations = z.record(z.string(), z.boolean()); + +export const zPortainerEndpointAuthorizations = z.record( + z.string(), + zPortainerAuthorizations +); + +export const zPortainerUser = z.object({ + EndpointAuthorizations: zPortainerEndpointAuthorizations.optional(), + Id: z.int().optional(), + PortainerAuthorizations: zPortainerAuthorizations.optional(), + Role: zPortainerUserRole.optional(), + ThemeSettings: zPortainerUserThemeSettings.optional(), + TokenIssueAt: z.int().optional(), + UseCache: z.boolean().optional(), + UserTheme: z.string().optional(), + Username: z.string().optional(), +}); + +export const zPortainerTeamResourceAccess = z.object({ + AccessLevel: zPortainerResourceAccessLevel.optional(), + TeamId: z.int().optional(), +}); + +export const zPortainerMembershipRole = z.enum(PortainerMembershipRole); + +export const zPortainerTeamMembership = z.object({ + Id: z.int().optional(), + Role: zPortainerMembershipRole.optional(), + TeamID: z.int().optional(), + UserID: z.int().optional(), +}); + +export const zPortainerTeam = z.object({ + Id: z.int().optional(), + Name: z.string().optional(), +}); + +export const zPortainerTag = z.object({ + EndpointGroups: z.record(z.string(), z.boolean()).optional(), + Endpoints: z.record(z.string(), z.boolean()).optional(), + ID: z.int().optional(), + Name: z.string().optional(), +}); + +export const zPortainerStackType = z.enum(PortainerStackType); + +export const zPortainerStackStatus = z.enum(PortainerStackStatus); + +export const zPortainerStackOption = z.object({ + HelmAtomic: z.boolean().optional(), + Prune: z.boolean().optional(), +}); + +export const zPortainerStackDeploymentStatus = z.object({ + Message: z.string().optional(), + Status: zPortainerStackStatus.optional(), + Time: z.int().optional(), +}); + +export const zPortainerStackDeploymentInfo = z.object({ + AdditionalFiles: z.array(z.string()).optional(), + ConfigFilePath: z.string().optional(), + ConfigHash: z.string().optional(), + FileVersion: z.int().optional(), + ReferenceName: z.string().optional(), + RepositoryURL: z.string().optional(), + Version: z.int().optional(), +}); + +export const zPortainerResourceControl = z.object({ + AccessLevel: zPortainerResourceAccessLevel.optional(), + AdministratorsOnly: z.boolean().optional(), + Id: z.int().optional(), + OwnerId: z.int().optional(), + Public: z.boolean().optional(), + ResourceId: z.string().optional(), + SubResourceIds: z.array(z.string()).optional(), + System: z.boolean().optional(), + TeamAccesses: z.array(zPortainerTeamResourceAccess).optional(), + Type: zPortainerResourceControlType.optional(), + UserAccesses: z.array(zPortainerUserResourceAccess).optional(), +}); + +export const zPortainerStack = z.object({ + AdditionalFiles: z.array(z.string()).optional(), + AutoUpdate: zPortainerAutoUpdateSettings.optional(), + CreatedBy: z.string().optional(), + CreationDate: z.int().optional(), + CurrentDeploymentInfo: zPortainerStackDeploymentInfo.optional(), + DeploymentStartStatus: zPortainerStackStatus.optional(), + DeploymentStatus: z.array(zPortainerStackDeploymentStatus).optional(), + EndpointId: z.int().optional(), + EntryPoint: z.string().optional(), + Env: z.array(zPortainerPair).optional(), + FromAppTemplate: z.boolean().optional(), + GitConfig: zGittypesRepoConfig.optional(), + Id: z.int().optional(), + Name: z.string().optional(), + Namespace: z.string().optional(), + Option: zPortainerStackOption.optional(), + ProjectPath: z.string().optional(), + ResourceControl: zPortainerResourceControl.optional(), + Status: zPortainerStackStatus.optional(), + SwarmId: z.string().optional(), + Type: zPortainerStackType.optional(), + UpdateDate: z.int().optional(), + UpdatedBy: z.string().optional(), + WorkflowID: z.int().optional(), +}); + +export const zPortainerSourceType = z.enum(PortainerSourceType); + +export const zPortainerRegistryManagementConfiguration = z.object({ + AccessToken: z.string().optional(), + AccessTokenExpiry: z.int().optional(), + Authentication: z.boolean().optional(), + Ecr: zPortainerEcrData.optional(), + Password: z.string().optional(), + TLSConfig: zPortainerTlsConfiguration.optional(), + Type: zPortainerRegistryType.optional(), + Username: z.string().optional(), +}); + +export const zPortainerGithubRegistryData = z.object({ + OrganisationName: z.string().optional(), + UseOrganisation: z.boolean().optional(), +}); + +export const zPortainerRegistry = z.object({ + AccessToken: z.string().optional(), + AccessTokenExpiry: z.int().optional(), + Authentication: z.boolean().optional(), + AuthorizedTeams: z.array(z.int()).optional(), + AuthorizedUsers: z.array(z.int()).optional(), + BaseURL: z.string().optional(), + Ecr: zPortainerEcrData.optional(), + Github: zPortainerGithubRegistryData.optional(), + Gitlab: zPortainerGitlabRegistryData.optional(), + Id: z.int().optional(), + ManagementConfiguration: zPortainerRegistryManagementConfiguration.optional(), + Name: z.string().optional(), + Password: z.string().optional(), + Quay: zPortainerQuayRegistryData.optional(), + RegistryAccesses: zPortainerRegistryAccesses.optional(), + TeamAccessPolicies: zPortainerTeamAccessPolicies.optional(), + Type: z + .union([ + z.literal(1), + z.literal(2), + z.literal(3), + z.literal(4), + z.literal(5), + z.literal(6), + z.literal(7), + ]) + .optional(), + URL: z.string().optional(), + UserAccessPolicies: zPortainerUserAccessPolicies.optional(), + Username: z.string().optional(), +}); + +export const zPortainerHelmConfig = z.object({ + Atomic: z.boolean().optional(), + ChartName: z.string().optional(), + ChartPath: z.string().optional(), + ChartURL: z.string().optional(), + ChartVersion: z.string().optional(), + Namespace: z.string().optional(), + Timeout: z.string().optional(), + ValuesFiles: z.array(z.string()).optional(), + ValuesInline: z.string().optional(), +}); + +export const zPortainerSource = z.object({ + gitConfig: zGittypesRepoConfig.optional(), + helmConfig: zPortainerHelmConfig.optional(), + id: z.int().optional(), + lastSync: z.int().optional(), + name: z.string().optional(), + registry: zPortainerRegistry.optional(), + type: zPortainerSourceType.optional(), +}); + +export const zPortainerEdge = z.object({ + AsyncMode: z.boolean().optional(), + CommandInterval: z.int().optional(), + PingInterval: z.int().optional(), + SnapshotInterval: z.int().optional(), +}); + +export const zPortainerSettings = z.object({ + AgentSecret: z.string().optional(), + AllowBindMountsForRegularUsers: z.boolean().optional(), + AllowContainerCapabilitiesForRegularUsers: z.boolean().optional(), + AllowDeviceMappingForRegularUsers: z.boolean().optional(), + AllowHostNamespaceForRegularUsers: z.boolean().optional(), + AllowPrivilegedModeForRegularUsers: z.boolean().optional(), + AllowStackManagementForRegularUsers: z.boolean().optional(), + AllowVolumeBrowserForRegularUsers: z.boolean().optional(), + AuthenticationMethod: zPortainerAuthenticationMethod.optional(), + BlackListedLabels: z.array(zPortainerPair).optional(), + DisplayDonationHeader: z.boolean().optional(), + DisplayExternalContributors: z.boolean().optional(), + Edge: zPortainerEdge.optional(), + EdgeAgentCheckinInterval: z.int().optional(), + EdgePortainerUrl: z.string().optional(), + EnableEdgeComputeFeatures: z.boolean().optional(), + EnableHostManagementFeatures: z.boolean().optional(), + EnforceEdgeID: z.boolean().optional(), + FeatureFlagSettings: z.record(z.string(), z.boolean()).optional(), + ForceSecureCookies: z.boolean().optional(), + GlobalDeploymentOptions: zPortainerGlobalDeploymentOptions.optional(), + HelmRepositoryURL: z.string().optional(), + InternalAuthSettings: zPortainerInternalAuthSettings.optional(), + IsDockerDesktopExtension: z.boolean().optional(), + KubeconfigExpiry: z.string().optional(), + KubectlShellImage: z.string().optional(), + LDAPSettings: zPortainerLdapSettings.optional(), + LogoURL: z.string().optional(), + OAuthSettings: zPortainerOAuthSettings.optional(), + SnapshotInterval: z.string().optional(), + TemplatesURL: z.string().optional(), + TrustOnFirstConnect: z.boolean().optional(), + UserSessionTimeout: z.string().optional(), +}); + +export const zPortainerSslSettings = z.object({ + certPath: z.string().optional(), + httpEnabled: z.boolean().optional(), + keyPath: z.string().optional(), + selfSigned: z.boolean().optional(), +}); + +export const zPortainerRole = z.object({ + Authorizations: zPortainerAuthorizations.optional(), + Description: z.string().optional(), + Id: z.int().optional(), + Name: z.string().optional(), + Priority: z.int().optional(), +}); + +export const zPortainerPerformanceMetrics = z.object({ + CPUUsage: z.number().optional(), + DiskUsage: z.number().optional(), + MemoryUsage: z.number().optional(), + NetworkUsage: z.number().optional(), +}); + +export const zPortainerKubernetesStorageClassConfig = z.object({ + AccessModes: z.array(z.string()).optional(), + AllowVolumeExpansion: z.boolean().optional(), + Name: z.string().optional(), + Provisioner: z.string().optional(), +}); + +export const zPortainerDiagnosticsData = z.object({ + DNS: z.record(z.string(), z.string()).optional(), + Log: z.string().optional(), + Proxy: z.record(z.string(), z.string()).optional(), + Telnet: z.record(z.string(), z.string()).optional(), +}); + +export const zPortainerKubernetesSnapshot = z.object({ + DiagnosticsData: zPortainerDiagnosticsData.optional(), + KubernetesVersion: z.string().optional(), + NodeCount: z.int().optional(), + PerformanceMetrics: zPortainerPerformanceMetrics.optional(), + Time: z.int().optional(), + TotalCPU: z.int().optional(), + TotalMemory: z.int().optional(), +}); + +export const zPortainerKubernetesIngressClassConfig = z.object({ + Blocked: z.boolean().optional(), + BlockedNamespaces: z.array(z.string()).optional(), + Name: z.string().optional(), + Type: z.string().optional(), +}); + +export const zPortainerKubernetesFlags = z.object({ + IsServerIngressClassDetected: z.boolean().optional(), + IsServerMetricsDetected: z.boolean().optional(), + IsServerStorageDetected: z.boolean().optional(), +}); + +export const zPortainerKubernetesConfiguration = z.object({ + AllowNoneIngressClass: z.boolean().optional(), + EnableResourceOverCommit: z.boolean().optional(), + IngressAvailabilityPerNamespace: z.boolean().optional(), + IngressClasses: z.array(zPortainerKubernetesIngressClassConfig).optional(), + ResourceOverCommitPercentage: z.int().optional(), + RestrictDefaultNamespace: z.boolean().optional(), + StorageClasses: z.array(zPortainerKubernetesStorageClassConfig).optional(), + UseLoadBalancer: z.boolean().optional(), + UseServerMetrics: z.boolean().optional(), +}); + +export const zPortainerKubernetesData = z.object({ + Configuration: zPortainerKubernetesConfiguration.optional(), + Flags: zPortainerKubernetesFlags.optional(), + Snapshots: z.array(zPortainerKubernetesSnapshot).optional(), +}); + +export const zPortainerK8sNodeLimits = z.object({ + CPU: z.int().optional(), + Memory: z.int().optional(), +}); + +export const zPortainerK8sNodesLimits = z.record( + z.string(), + zPortainerK8sNodeLimits +); + +export const zPortainerK8sNamespaceInfo = z.object({ + Annotations: z.record(z.string(), z.string()).optional(), + CreationDate: z.string().optional(), + Id: z.string().optional(), + IsDefault: z.boolean().optional(), + IsSystem: z.boolean().optional(), + Name: z.string().optional(), + NamespaceOwner: z.string().optional(), + ResourceQuota: zV1ResourceQuota.optional(), + Status: zV1NamespaceStatus.optional(), + UnhealthyEventCount: z.int().optional(), +}); + +export const zPortainerEnvironmentEdgeSettings = z.object({ + AsyncMode: z.boolean().optional(), + CommandInterval: z.int().optional(), + PingInterval: z.int().optional(), + SnapshotInterval: z.int().optional(), +}); + +export const zPortainerEndpointType = z.enum(PortainerEndpointType); + +export const zPortainerEndpointStatus = z.enum(PortainerEndpointStatus); + +export const zPortainerEndpointSecuritySettings = z.object({ + allowBindMountsForRegularUsers: z.boolean().optional(), + allowContainerCapabilitiesForRegularUsers: z.boolean().optional(), + allowDeviceMappingForRegularUsers: z.boolean().optional(), + allowHostNamespaceForRegularUsers: z.boolean().optional(), + allowPrivilegedModeForRegularUsers: z.boolean().optional(), + allowSecurityOptForRegularUsers: z.boolean().optional(), + allowStackManagementForRegularUsers: z.boolean().optional(), + allowSysctlSettingForRegularUsers: z.boolean().optional(), + allowVolumeBrowserForRegularUsers: z.boolean().optional(), + enableHostManagementFeatures: z.boolean().optional(), +}); + +export const zPortainerEndpointPostInitMigrations = z.object({ + MigrateGPUs: z.boolean().optional(), + MigrateIngresses: z.boolean().optional(), + MigrateRegistrySASecrets: z.boolean().optional(), +}); + +export const zPortainerEndpointGroup = z.object({ + AuthorizedTeams: z.array(z.int()).optional(), + AuthorizedUsers: z.array(z.int()).optional(), + Description: z.string().optional(), + Id: z.int().optional(), + Labels: z.array(zPortainerPair).optional(), + Name: z.string().optional(), + TagIds: z.array(z.int()).optional(), + Tags: z.array(z.string()).optional(), + TeamAccessPolicies: zPortainerTeamAccessPolicies.optional(), + UserAccessPolicies: zPortainerUserAccessPolicies.optional(), +}); + +export const zPortainerDockerSnapshotRaw = z.record(z.string(), z.unknown()); + +export const zPortainerDockerSnapshot = z.object({ + ContainerCount: z.int().optional(), + DiagnosticsData: zPortainerDiagnosticsData.optional(), + DockerSnapshotRaw: zPortainerDockerSnapshotRaw.optional(), + DockerVersion: z.string().optional(), + GpuUseAll: z.boolean().optional(), + GpuUseList: z.array(z.string()).optional(), + HealthyContainerCount: z.int().optional(), + ImageCount: z.int().optional(), + IsPodman: z.boolean().optional(), + NodeCount: z.int().optional(), + PerformanceMetrics: zPortainerPerformanceMetrics.optional(), + RunningContainerCount: z.int().optional(), + ServiceCount: z.int().optional(), + StackCount: z.int().optional(), + StoppedContainerCount: z.int().optional(), + Swarm: z.boolean().optional(), + Time: z.int().optional(), + TotalCPU: z.int().optional(), + TotalMemory: z.int().optional(), + UnhealthyContainerCount: z.int().optional(), + VolumeCount: z.int().optional(), +}); + +export const zPortainerAzureCredentials = z.object({ + ApplicationID: z.string().optional(), + AuthenticationKey: z.string().optional(), + TenantID: z.string().optional(), +}); + +export const zPortainerEndpoint = z.object({ + Agent: z + .object({ + Version: z.string().optional(), + }) + .optional(), + AuthorizedTeams: z.array(z.int()).optional(), + AuthorizedUsers: z.array(z.int()).optional(), + AzureCredentials: zPortainerAzureCredentials.optional(), + ComposeSyntaxMaxVersion: z.string().optional(), + ContainerEngine: z.string().optional(), + Edge: zPortainerEnvironmentEdgeSettings.optional(), + EdgeCheckinInterval: z.int().optional(), + EdgeID: z.string().optional(), + EdgeKey: z.string().optional(), + EnableGPUManagement: z.boolean().optional(), + Gpus: z.array(zPortainerPair).optional(), + GroupId: z.int().optional(), + Heartbeat: z.boolean().optional(), + Id: z.int().optional(), + IsEdgeDevice: z.boolean().optional(), + Kubernetes: zPortainerKubernetesData.optional(), + LastCheckInDate: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + Name: z.string().optional(), + PostInitMigrations: zPortainerEndpointPostInitMigrations.optional(), + PublicURL: z.string().optional(), + SecuritySettings: zPortainerEndpointSecuritySettings.optional(), + Snapshots: z.array(zPortainerDockerSnapshot).optional(), + Status: zPortainerEndpointStatus.optional(), + TLS: z.boolean().optional(), + TLSCACert: z.string().optional(), + TLSCert: z.string().optional(), + TLSConfig: zPortainerTlsConfiguration.optional(), + TLSKey: z.string().optional(), + TagIds: z.array(z.int()).optional(), + Tags: z.array(z.string()).optional(), + TeamAccessPolicies: zPortainerTeamAccessPolicies.optional(), + Type: zPortainerEndpointType.optional(), + URL: z.string().optional(), + UserAccessPolicies: zPortainerUserAccessPolicies.optional(), + UserTrusted: z.boolean().optional(), +}); + +export const zPortainerEdgeStackStatusType = z.enum( + PortainerEdgeStackStatusType +); + +export const zPortainerEdgeStackStatusDetails = z.object({ + Acknowledged: z.boolean().optional(), + Error: z.boolean().optional(), + ImagesPulled: z.boolean().optional(), + Ok: z.boolean().optional(), + Pending: z.boolean().optional(), + RemoteUpdateSuccess: z.boolean().optional(), + Remove: z.boolean().optional(), +}); + +export const zPortainerEdgeStackDeploymentStatus = z.object({ + Error: z.string().optional(), + RollbackTo: z.int().optional(), + Time: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + Type: zPortainerEdgeStackStatusType.optional(), + Version: z.int().optional(), +}); + +export const zPortainerEdgeStackStatus = z.object({ + DeploymentInfo: zPortainerStackDeploymentInfo.optional(), + Details: zPortainerEdgeStackStatusDetails.optional(), + EndpointID: z.int().optional(), + Error: z.string().optional(), + ReadyRePullImage: z.boolean().optional(), + Status: z.array(zPortainerEdgeStackDeploymentStatus).optional(), + Type: zPortainerEdgeStackStatusType.optional(), +}); + +export const zPortainerEdgeStackDeploymentType = z.enum( + PortainerEdgeStackDeploymentType +); + +export const zPortainerEdgeStack = z.object({ + CreatedBy: z.string().optional(), + CreatedByUserId: z.string().optional(), + CreationDate: z.int().optional(), + DeploymentType: zPortainerEdgeStackDeploymentType.optional(), + EdgeGroups: z.array(z.int()).optional(), + EntryPoint: z.string().optional(), + Id: z.int().optional(), + ManifestPath: z.string().optional(), + Name: z.string().optional(), + NumDeployments: z.int().optional(), + ProjectPath: z.string().optional(), + Status: z.record(z.string(), zPortainerEdgeStackStatus).optional(), + UseManifestNamespaces: z.boolean().optional(), + Version: z.int().optional(), +}); + +export const zPortainerEdgeJobLogsStatus = z.enum(PortainerEdgeJobLogsStatus); + +export const zPortainerEdgeJobEndpointMeta = z.object({ + CollectLogs: z.boolean().optional(), + LogsStatus: zPortainerEdgeJobLogsStatus.optional(), +}); + +export const zPortainerEdgeJob = z.object({ + Created: z.int().optional(), + CronExpression: z.string().optional(), + EdgeGroups: z.array(z.int()).optional(), + Endpoints: z.record(z.string(), zPortainerEdgeJobEndpointMeta).optional(), + GroupLogsCollection: z + .record(z.string(), zPortainerEdgeJobEndpointMeta) + .optional(), + Id: z.int().optional(), + Name: z.string().optional(), + Recurring: z.boolean().optional(), + ScriptPath: z.string().optional(), + Version: z.int().optional(), +}); + +export const zPortainerEdgeGroup = z.object({ + Dynamic: z.boolean().optional(), + EndpointIds: zRoarRoarPortainerEndpointId.optional(), + Endpoints: z.array(z.int()).optional(), + Id: z.int().optional(), + Name: z.string().optional(), + PartialMatch: z.boolean().optional(), + TagIds: z.array(z.int()).optional(), +}); + +export const zPortainerCustomTemplateVariableDefinition = z.object({ + defaultValue: z.string().optional(), + description: z.string().optional(), + label: z.string().optional(), + name: z.string().optional(), +}); + +export const zPortainerCustomTemplatePlatform = z.enum( + PortainerCustomTemplatePlatform +); + +export const zPortainerCustomTemplate = z.object({ + CreatedByUserId: z.int().optional(), + Description: z.string().optional(), + EdgeTemplate: z.boolean().optional(), + EntryPoint: z.string().optional(), + GitConfig: zGittypesRepoConfig.optional(), + Id: z.int().optional(), + IsComposeFormat: z.boolean().optional(), + Logo: z.string().optional(), + Note: z.string().optional(), + Platform: z.union([z.literal(1), z.literal(2)]).optional(), + ProjectPath: z.string().optional(), + ResourceControl: zPortainerResourceControl.optional(), + Title: z.string().optional(), + Type: z.union([z.literal(1), z.literal(2), z.literal(3)]).optional(), + Variables: z.array(zPortainerCustomTemplateVariableDefinition).optional(), +}); + +export const zMotdMotd = z.object({ + ContentLayout: z.record(z.string(), z.string()).optional(), + Hash: z.array(z.int()).optional(), + Message: z.string().optional(), + Style: z.string().optional(), + Title: z.string().optional(), +}); + +export const zLdapCheckPayload = z.object({ + LDAPSettings: zPortainerLdapSettings.optional(), +}); + +export const zKubernetesNamespacesToggleSystemPayload = z.object({ + System: z.boolean().optional(), +}); + +export const zKubernetesKubernetesVersionResponse = z.object({ + buildDate: z.string().optional(), + compiler: z.string().optional(), + emulationMajor: z.string().optional(), + emulationMinor: z.string().optional(), + gitCommit: z.string().optional(), + gitTreeState: z.string().optional(), + gitVersion: z.string().optional(), + goVersion: z.string().optional(), + major: z.string().optional(), + minCompatibilityMajor: z.string().optional(), + minCompatibilityMinor: z.string().optional(), + minor: z.string().optional(), + platform: z.string().optional(), + supportsPodRestart: z.boolean().optional(), +}); + +export const zKubernetesDescribeResourceResponse = z.object({ + describe: z.string().optional(), +}); + +export const zKubernetesTlsInfo = z.object({ + hosts: z.array(z.string()).optional(), +}); + +export const zKubernetesIngressRule = z.object({ + Host: z.string().optional(), + IP: z.string().optional(), + Path: z.string().optional(), + TLS: z.array(zKubernetesTlsInfo).optional(), +}); + +export const zKubernetesPublishedPort = z.object({ + IngressRules: z.array(zKubernetesIngressRule).optional(), + Port: z.int().optional(), +}); + +export const zKubernetesK8sApplicationResource = z.object({ + CpuLimit: z.number().optional(), + CpuRequest: z.number().optional(), + MemoryLimit: z.int().optional(), + MemoryRequest: z.int().optional(), +}); + +export const zKubernetesPod = z.object({ + ContainerName: z.string().optional(), + CreationDate: z.string().optional(), + Image: z.string().optional(), + ImagePullPolicy: z.string().optional(), + Name: z.string().optional(), + NodeName: z.string().optional(), + PodIP: z.string().optional(), + Resource: zKubernetesK8sApplicationResource.optional(), + Status: z.string().optional(), + Uid: z.string().optional(), +}); + +export const zKubernetesMetadata = z.object({ + annotations: z.record(z.string(), z.string()).optional(), + labels: z.record(z.string(), z.string()).optional(), +}); + +export const zKubernetesK8sStorageClass = z.object({ + allowVolumeExpansion: z.boolean().optional(), + annotations: z.record(z.string(), z.string()).optional(), + creationDate: z.string().optional(), + isDefault: z.boolean().optional(), + labels: z.record(z.string(), z.string()).optional(), + mountOptions: z.array(z.string()).optional(), + name: z.string().optional(), + parameters: z.record(z.string(), z.string()).optional(), + provisioner: z.string().optional(), + reclaimPolicy: zV1PersistentVolumeReclaimPolicy.optional(), +}); + +export const zKubernetesCustomResourceMetadata = z.object({ + apiVersion: z.string().optional(), + kind: z.string().optional(), + name: z.string().optional(), + plural: z.string().optional(), + scope: z.string().optional(), +}); + +export const zKubernetesConfiguration = z.object({ + ConfigurationOwner: z.string().optional(), + Data: z.record(z.string(), z.unknown()).optional(), + Kind: z.string().optional(), +}); + +export const zKubernetesK8sApplication = z.object({ + Annotations: z.record(z.string(), z.string()).optional(), + ApplicationOwner: z.string().optional(), + ApplicationType: z.string().optional(), + Configurations: z.array(zKubernetesConfiguration).optional(), + Containers: z.array(z.unknown()).optional(), + CreationDate: z.string().optional(), + CustomResourceMetadata: zKubernetesCustomResourceMetadata.optional(), + DeploymentType: z.string().optional(), + Id: z.string().optional(), + Image: z.string().optional(), + Kind: z.string().optional(), + Labels: z.record(z.string(), z.string()).optional(), + LoadBalancerIPAddress: z.string().optional(), + MatchLabels: z.record(z.string(), z.string()).optional(), + Metadata: zKubernetesMetadata.optional(), + Name: z.string().optional(), + Namespace: z.string().optional(), + Pods: z.array(zKubernetesPod).optional(), + PublishedPorts: z.array(zKubernetesPublishedPort).optional(), + Resource: zKubernetesK8sApplicationResource.optional(), + ResourcePool: z.string().optional(), + RunningPodsCount: z.int().optional(), + ServiceId: z.string().optional(), + ServiceName: z.string().optional(), + ServiceType: z.string().optional(), + StackId: z.string().optional(), + StackKind: z.string().optional(), + StackName: z.string().optional(), + Status: z.string().optional(), + TotalPodsCount: z.int().optional(), + Uid: z.string().optional(), +}); + +export const zKubernetesK8sPersistentVolumeClaim = z.object({ + accessModes: z.array(z.string()).optional(), + allowVolumeExpansion: z.boolean().optional(), + creationDate: z.string().optional(), + humanReadableAccessModes: z.array(zV1PersistentVolumeAccessMode).optional(), + id: z.string().optional(), + labels: z.record(z.string(), z.string()).optional(), + name: z.string().optional(), + namespace: z.string().optional(), + owningApplications: z.array(zKubernetesK8sApplication).optional(), + phase: zV1PersistentVolumeClaimPhase.optional(), + resourcesRequests: zV1ResourceList.optional(), + storage: z.int().optional(), + storageClass: z.string().optional(), + storageRequest: z.string().optional(), + volumeMode: zV1PersistentVolumeMode.optional(), + volumeName: z.string().optional(), +}); + +export const zKubernetesK8sPersistentVolume = z.object({ + accessModes: z.array(z.string()).optional(), + annotations: z.record(z.string(), z.string()).optional(), + capacity: zV1ResourceList.optional(), + claimRef: zV1ObjectReference.optional(), + creationDate: z.string().optional(), + csi: zV1CsiPersistentVolumeSource.optional(), + humanReadableAccessModes: z.array(zV1PersistentVolumeAccessMode).optional(), + labels: z.record(z.string(), z.string()).optional(), + name: z.string().optional(), + persistentVolumeReclaimPolicy: zV1PersistentVolumeReclaimPolicy.optional(), + status: zV1PersistentVolumePhase.optional(), + storageClassName: z.string().optional(), + volumeMode: zV1PersistentVolumeMode.optional(), +}); + +export const zKubernetesK8sVolumeInfo = z.object({ + persistentVolume: zKubernetesK8sPersistentVolume.optional(), + persistentVolumeClaim: zKubernetesK8sPersistentVolumeClaim.optional(), + storageClass: zKubernetesK8sStorageClass.optional(), +}); + +export const zKubernetesK8sVolumeDeleteRequest = z.object({ + name: z.string().optional(), + namespace: z.string().optional(), +}); + +export const zKubernetesK8sServicePort = z.object({ + Name: z.string().optional(), + NodePort: z.int().optional(), + Port: z.int().optional(), + Protocol: z.string().optional(), + TargetPort: z.string().optional(), +}); + +export const zKubernetesK8sServiceIngress = z.object({ + Hostname: z.string().optional(), + IP: z.string().optional(), +}); + +export const zKubernetesK8sServiceInfo = z.object({ + AllocateLoadBalancerNodePorts: z.boolean().optional(), + Annotations: z.record(z.string(), z.string()).optional(), + Applications: z.array(zKubernetesK8sApplication).optional(), + ClusterIPs: z.array(z.string()).optional(), + CreationDate: z.string().optional(), + ExternalIPs: z.array(z.string()).optional(), + ExternalName: z.string().optional(), + IngressStatus: z.array(zKubernetesK8sServiceIngress).optional(), + Labels: z.record(z.string(), z.string()).optional(), + Name: z.string().optional(), + Namespace: z.string().optional(), + Ports: z.array(zKubernetesK8sServicePort).optional(), + Selector: z.record(z.string(), z.string()).optional(), + Type: z.string().optional(), + UID: z.string().optional(), +}); + +export const zKubernetesK8sServiceDeleteRequests = z.record( + z.string(), + z.array(z.string()) +); + +export const zKubernetesK8sServiceAccountImagePullSecretsUpdatePayload = + z.object({ + secretNames: z.array(z.string()).optional(), + }); + +export const zKubernetesK8sServiceAccountDeleteRequests = z.record( + z.string(), + z.array(z.string()) +); + +export const zKubernetesK8sServiceAccount = z.object({ + annotations: z.record(z.string(), z.string()).optional(), + automountServiceAccountToken: z.boolean().optional(), + creationDate: z.string().optional(), + imagePullSecrets: z.array(zV1LocalObjectReference).optional(), + isSystem: z.boolean().optional(), + labels: z.record(z.string(), z.string()).optional(), + name: z.string().optional(), + namespace: z.string().optional(), + uid: z.string().optional(), +}); + +export const zKubernetesK8sConfigurationOwnerResource = z.object({ + Id: z.string().optional(), + Name: z.string().optional(), + ResourceKind: z.string().optional(), +}); + +export const zKubernetesK8sSecret = z.object({ + Annotations: z.record(z.string(), z.string()).optional(), + ConfigurationOwner: z.string().optional(), + ConfigurationOwnerId: z.string().optional(), + ConfigurationOwners: z + .array(zKubernetesK8sConfigurationOwnerResource) + .optional(), + CreationDate: z.string().optional(), + Data: z.record(z.string(), z.string()).optional(), + IsUsed: z.boolean().optional(), + Labels: z.record(z.string(), z.string()).optional(), + Name: z.string().optional(), + Namespace: z.string().optional(), + SecretType: z.string().optional(), + UID: z.string().optional(), +}); + +export const zKubernetesK8sRoleDeleteRequests = z.record( + z.string(), + z.array(z.string()) +); + +export const zKubernetesK8sRoleBindingDeleteRequests = z.record( + z.string(), + z.array(z.string()) +); + +export const zK8sIoApiRbacV1Subject = z.object({ + apiGroup: z.string().optional(), + kind: z.string().optional(), + name: z.string().optional(), + namespace: z.string().optional(), +}); + +export const zKubernetesK8sRoleBinding = z.object({ + creationDate: z.string().optional(), + isSystem: z.boolean().optional(), + name: z.string().optional(), + namespace: z.string().optional(), + roleRef: zV1RoleRef.optional(), + subjects: z.array(zK8sIoApiRbacV1Subject).optional(), + uid: z.string().optional(), +}); + +export const zKubernetesK8sRole = z.object({ + creationDate: z.string().optional(), + isSystem: z.boolean().optional(), + name: z.string().optional(), + namespace: z.string().optional(), + uid: z.string().optional(), +}); + +export const zKubernetesK8sResourceQuota = z.object({ + cpu: z.string().optional(), + enabled: z.boolean().optional(), + memory: z.string().optional(), +}); + +export const zKubernetesK8sPvReclaimPolicyRequest = z.object({ + name: z.string().optional(), + reclaimPolicy: zV1PersistentVolumeReclaimPolicy.optional(), +}); + +export const zKubernetesK8sPvcResizeRequest = z.object({ + name: z.string().optional(), + namespace: z.string().optional(), + newSize: z.string().optional(), +}); + +export const zKubernetesK8sNamespaceDetails = z.object({ + Annotations: z.record(z.string(), z.string()).optional(), + Name: z.string().optional(), + Owner: z.string().optional(), + ResourceQuota: zKubernetesK8sResourceQuota.optional(), +}); + +export const zKubernetesK8sJobDeleteRequests = z.record( + z.string(), + z.array(z.string()) +); + +export const zKubernetesK8sJob = z.object({ + BackoffLimit: z.int().optional(), + Command: z.string().optional(), + Completions: z.int().optional(), + Container: zV1Container.optional(), + Duration: z.string().optional(), + FailedReason: z.string().optional(), + FinishTime: z.string().optional(), + Id: z.string().optional(), + IsSystem: z.boolean().optional(), + Name: z.string().optional(), + Namespace: z.string().optional(), + PodName: z.string().optional(), + StartTime: z.string().optional(), + Status: z.string().optional(), +}); + +export const zKubernetesK8sIngressTls = z.object({ + Hosts: z.array(z.string()).optional(), + SecretName: z.string().optional(), +}); + +export const zKubernetesK8sIngressPath = z.object({ + HasService: z.boolean().optional(), + Host: z.string().optional(), + IngressName: z.string().optional(), + Path: z.string().optional(), + PathType: z.string().optional(), + Port: z.int().optional(), + ServiceName: z.string().optional(), +}); + +export const zKubernetesK8sIngressInfo = z.object({ + Annotations: z.record(z.string(), z.string()).optional(), + ClassName: z.string().optional(), + CreationDate: z.string().optional(), + Hosts: z.array(z.string()).optional(), + Labels: z.record(z.string(), z.string()).optional(), + Name: z.string().optional(), + Namespace: z.string().optional(), + Paths: z.array(zKubernetesK8sIngressPath).optional(), + TLS: z.array(zKubernetesK8sIngressTls).optional(), + Type: z.string().optional(), + UID: z.string().optional(), +}); + +export const zKubernetesK8sIngressDeleteRequests = z.record( + z.string(), + z.array(z.string()) +); + +export const zKubernetesK8sIngressController = z.object({ + Availability: z.boolean().optional(), + ClassName: z.string().optional(), + Name: z.string().optional(), + New: z.boolean().optional(), + Type: z.string().optional(), + Used: z.boolean().optional(), +}); + +export const zKubernetesK8sEventInvolvedObject = z.object({ + kind: z.string().optional(), + name: z.string().optional(), + namespace: z.string().optional(), + uid: z.string().optional(), +}); + +export const zKubernetesK8sEvent = z.object({ + count: z.int().optional(), + eventTime: z.string().optional(), + firstTimestamp: z.string().optional(), + involvedObject: zKubernetesK8sEventInvolvedObject.optional(), + kind: z.string().optional(), + lastTimestamp: z.string().optional(), + message: z.string().optional(), + name: z.string().optional(), + namespace: z.string().optional(), + reason: z.string().optional(), + type: z.string().optional(), + uid: z.string().optional(), +}); + +export const zKubernetesK8sDashboard = z.object({ + applicationsCount: z.int().optional(), + configMapsCount: z.int().optional(), + ingressesCount: z.int().optional(), + namespacesCount: z.int().optional(), + secretsCount: z.int().optional(), + servicesCount: z.int().optional(), + volumesCount: z.int().optional(), +}); + +export const zKubernetesK8sCronJobDeleteRequests = z.record( + z.string(), + z.array(z.string()) +); + +export const zKubernetesK8sCronJob = z.object({ + Command: z.string().optional(), + Id: z.string().optional(), + IsSystem: z.boolean().optional(), + Jobs: z.array(zKubernetesK8sJob).optional(), + Name: z.string().optional(), + Namespace: z.string().optional(), + Schedule: z.string().optional(), + Suspend: z.boolean().optional(), + Timezone: z.string().optional(), +}); + +export const zKubernetesK8sConfigMap = z.object({ + Annotations: z.record(z.string(), z.string()).optional(), + ConfigurationOwner: z.string().optional(), + ConfigurationOwnerId: z.string().optional(), + ConfigurationOwners: z + .array(zKubernetesK8sConfigurationOwnerResource) + .optional(), + CreationDate: z.string().optional(), + Data: z.record(z.string(), z.string()).optional(), + IsUsed: z.boolean().optional(), + Labels: z.record(z.string(), z.string()).optional(), + Name: z.string().optional(), + Namespace: z.string().optional(), + UID: z.string().optional(), +}); + +export const zKubernetesK8sClusterRoleBinding = z.object({ + creationDate: z.string().optional(), + isSystem: z.boolean().optional(), + name: z.string().optional(), + namespace: z.string().optional(), + roleRef: zV1RoleRef.optional(), + subjects: z.array(zK8sIoApiRbacV1Subject).optional(), + uid: z.string().optional(), +}); + +export const zKubernetesK8sClusterRole = z.object({ + creationDate: z.string().optional(), + isSystem: z.boolean().optional(), + name: z.string().optional(), + uid: z.string().optional(), +}); + +export const zImagesImageResponse = z.object({ + created: z.int().optional(), + id: z.string().optional(), + nodeName: z.string().optional(), + size: z.int().optional(), + tags: z.array(z.string()).optional(), + used: z.boolean().optional(), +}); + +export const zHelmInstallChartPayload = z.object({ + atomic: z.boolean().optional(), + chart: z.string().optional(), + name: z.string().optional(), + namespace: z.string().optional(), + repo: z.string().optional(), + values: z.string().optional(), + version: z.string().optional(), +}); + +export const zGitopsRepositoryFilePreviewPayload = z.object({ + TLSSkipVerify: z.boolean().optional(), + password: z.string().optional(), + reference: z.string().optional(), + repository: z.string(), + targetFile: z.string().optional(), + username: z.string().optional(), +}); + +export const zGitopsFileResponse = z.object({ + FileContent: z.string().optional(), +}); + +export const zEndpointsRegistryAccessPayload = z.object({ + Namespaces: z.array(z.string()).optional(), + TeamAccessPolicies: zPortainerTeamAccessPolicies.optional(), + UserAccessPolicies: zPortainerUserAccessPolicies.optional(), +}); + +export const zEndpointsPlatformCounts = z.object({ + azure: z.int().optional(), + docker: z.int().optional(), + kubernetes: z.int().optional(), + podman: z.int().optional(), +}); + +export const zEndpointsHealthCounts = z.object({ + down: z.int().optional(), + heartbeat: z.int().optional(), + outdated: z.int().optional(), + up: z.int().optional(), +}); + +export const zEndpointsGroupCount = z.object({ + count: z.int().optional(), + groupID: z.int().optional(), + groupName: z.string().optional(), +}); + +export const zEndpointsForceUpdateServicePayload = z.object({ + PullImage: z.boolean().optional(), + ServiceID: z.string().optional(), +}); + +export const zEndpointsEndpointUpdateRelationsPayload = z.object({ + Relations: z + .record( + z.string(), + z.object({ + EdgeGroups: z.array(z.int()).optional(), + Group: z.int().optional(), + Tags: z.array(z.int()).optional(), + }) + ) + .optional(), +}); + +export const zEndpointsEndpointUpdatePayload = z.object({ + AzureApplicationID: z.string().optional(), + AzureAuthenticationKey: z.string().optional(), + AzureTenantID: z.string().optional(), + EdgeCheckinInterval: z.int().optional(), + Gpus: z.array(zPortainerPair).optional(), + GroupID: z.int().optional(), + Kubernetes: zPortainerKubernetesData.optional(), + Name: z.string().optional(), + PublicURL: z.string().optional(), + Status: z.int().optional(), + TLS: z.boolean().optional(), + TLSSkipClientVerify: z.boolean().optional(), + TLSSkipVerify: z.boolean().optional(), + TagIDs: z.array(z.int()).optional(), + TeamAccessPolicies: zPortainerTeamAccessPolicies.optional(), + URL: z.string().optional(), + UserAccessPolicies: zPortainerUserAccessPolicies.optional(), +}); + +export const zEndpointsEndpointSettingsUpdatePayload = z.object({ + allowBindMountsForRegularUsers: z.boolean().optional(), + allowContainerCapabilitiesForRegularUsers: z.boolean().optional(), + allowDeviceMappingForRegularUsers: z.boolean().optional(), + allowHostNamespaceForRegularUsers: z.boolean().optional(), + allowPrivilegedModeForRegularUsers: z.boolean().optional(), + allowSecurityOptForRegularUsers: z.boolean().optional(), + allowStackManagementForRegularUsers: z.boolean().optional(), + allowSysctlSettingForRegularUsers: z.boolean().optional(), + allowVolumeBrowserForRegularUsers: z.boolean().optional(), + enableGPUManagement: z.boolean().optional(), + enableHostManagementFeatures: z.boolean().optional(), + gpus: z.array(zPortainerPair).optional(), +}); + +export const zEndpointsEndpointDeleteRequest = z.object({ + deleteCluster: z.boolean().optional(), + id: z.int().optional(), +}); + +export const zEndpointsEndpointDeleteBatchPayload = z.object({ + endpoints: z.array(zEndpointsEndpointDeleteRequest).optional(), +}); + +export const zEndpointsEndpointDeleteBatchPartialResponse = z.object({ + deleted: z.array(z.int()).optional(), + errors: z.array(z.int()).optional(), +}); + +export const zEndpointsEndpointCreateGlobalKeyResponse = z.object({ + endpointID: z.int().optional(), +}); + +export const zEndpointsDockerhubStatusResponse = z.object({ + limit: z.int().optional(), + remaining: z.int().optional(), +}); + +export const zEndpointsEnvironmentSummaryCountsResponse = z.object({ + byGroup: z.array(zEndpointsGroupCount).optional(), + byHealth: zEndpointsHealthCounts.optional(), + byPlatformType: zEndpointsPlatformCounts.optional(), + down: z.int().optional(), + outdated: z.int().optional(), + total: z.int().optional(), + unassigned: z.int().optional(), + up: z.int().optional(), +}); + +export const zEndpointgroupsEndpointGroupUpdatePayload = z.object({ + AssociatedEndpoints: z.array(z.int()).optional(), + Description: z.string().optional(), + Name: z.string().optional(), + TagIDs: z.array(z.int()).optional(), + TeamAccessPolicies: zPortainerTeamAccessPolicies.optional(), + UserAccessPolicies: zPortainerUserAccessPolicies.optional(), +}); + +export const zEndpointgroupsEndpointGroupTypeInfo = z.object({ + Docker: z.int().optional(), + Kubernetes: z.int().optional(), + Mixed: z.boolean().optional(), + Podman: z.int().optional(), +}); + +export const zEndpointgroupsEndpointGroupResponse = z.object({ + AuthorizedTeams: z.array(z.int()).optional(), + AuthorizedUsers: z.array(z.int()).optional(), + Description: z.string().optional(), + Id: z.int().optional(), + Labels: z.array(zPortainerPair).optional(), + Name: z.string().optional(), + TagIds: z.array(z.int()).optional(), + Tags: z.array(z.string()).optional(), + TeamAccessPolicies: zPortainerTeamAccessPolicies.optional(), + Total: z.int().optional(), + TypeInfo: zEndpointgroupsEndpointGroupTypeInfo.optional(), + UserAccessPolicies: zPortainerUserAccessPolicies.optional(), +}); + +export const zEndpointgroupsEndpointGroupCreatePayload = z.object({ + AssociatedEndpoints: z.array(z.int()).optional(), + Description: z.string().optional(), + Name: z.string(), + TagIDs: z.array(z.int()).optional(), +}); + +export const zEdgestacksUpdateStatusPayload = z.object({ + EndpointID: z.int().optional(), + Error: z.string().optional(), + Status: zPortainerEdgeStackStatusType.optional(), + Time: z.coerce + .bigint() + .min(BigInt('-9223372036854775808'), { + error: 'Invalid value: Expected int64 to be >= -9223372036854775808', + }) + .max(BigInt('9223372036854775807'), { + error: 'Invalid value: Expected int64 to be <= 9223372036854775807', + }) + .optional(), + Version: z.int().optional(), +}); + +export const zEdgestacksUpdateEdgeStackPayload = z.object({ + DeploymentType: zPortainerEdgeStackDeploymentType.optional(), + EdgeGroups: z.array(z.int()).optional(), + StackFileContent: z.string().optional(), + UpdateVersion: z.boolean().optional(), + UseManifestNamespaces: z.boolean().optional(), +}); + +export const zEdgestacksStackFileResponse = z.object({ + StackFileContent: z.string().optional(), +}); + +export const zEdgestacksEdgeStackFromStringPayload = z.object({ + DeploymentType: z + .union([z.literal(0), z.literal(1), z.literal(2)]) + .optional(), + EdgeGroups: z.array(z.int()).optional(), + Name: z.string(), + Registries: z.array(z.int()).optional(), + StackFileContent: z.string(), + UseManifestNamespaces: z.boolean().optional(), +}); + +export const zEdgestacksEdgeStackFromGitRepositoryPayload = z.object({ + DeploymentType: z + .union([z.literal(0), z.literal(1), z.literal(2)]) + .optional(), + EdgeGroups: z.array(z.int()), + FilePathInRepository: z.string().optional().default('docker-compose.yml'), + Name: z.string(), + Registries: z.array(z.int()).optional(), + RepositoryAuthentication: z.boolean().optional(), + RepositoryPassword: z.string().optional(), + RepositoryReferenceName: z.string().optional(), + RepositoryURL: z.string(), + RepositoryUsername: z.string().optional(), + TLSSkipVerify: z.boolean().optional(), + UseManifestNamespaces: z.boolean().optional(), +}); + +export const zEdgejobsTaskContainer = z.object({ + EndpointId: z.int().optional(), + EndpointName: z.string().optional(), + Id: z.string().optional(), + LogsStatus: zPortainerEdgeJobLogsStatus.optional(), +}); + +export const zEdgejobsFileResponse = z.object({ + FileContent: z.string().optional(), +}); + +export const zEdgejobsEdgeJobUpdatePayload = z.object({ + CronExpression: z.string().optional(), + EdgeGroups: z.array(z.int()).optional(), + Endpoints: z.array(z.int()).optional(), + FileContent: z.string().optional(), + Name: z.string().optional(), + Recurring: z.boolean().optional(), +}); + +export const zEdgejobsEdgeJobFileResponse = z.object({ + FileContent: z.string().optional(), +}); + +export const zEdgejobsEdgeJobCreateFromFileContentPayload = z.object({ + CronExpression: z.string().optional(), + EdgeGroups: z.array(z.int()).optional(), + Endpoints: z.array(z.int()).optional(), + FileContent: z.string().optional(), + Name: z.string().optional(), + Recurring: z.boolean().optional(), +}); + +export const zEdgegroupsEdgeGroupUpdatePayload = z.object({ + Dynamic: z.boolean().optional(), + Endpoints: z.array(z.int()).optional(), + Name: z.string().optional(), + PartialMatch: z.boolean().optional(), + TagIDs: z.array(z.int()).optional(), +}); + +export const zEdgegroupsEdgeGroupCreatePayload = z.object({ + Dynamic: z.boolean().optional(), + Endpoints: z.array(z.int()).optional(), + Name: z.string().optional(), + PartialMatch: z.boolean().optional(), + TagIDs: z.array(z.int()).optional(), +}); + +export const zEdgegroupsDecoratedEdgeGroup = z.object({ + Dynamic: z.boolean().optional(), + EndpointIds: z.int().optional(), + EndpointTypes: z.array(zPortainerEndpointType).optional(), + Endpoints: z.array(z.int()).optional(), + HasEdgeJob: z.boolean().optional(), + HasEdgeStack: z.boolean().optional(), + Id: z.int().optional(), + Name: z.string().optional(), + PartialMatch: z.boolean().optional(), + TagIds: z.array(z.int()).optional(), + TrustedEndpoints: z.array(z.int()).optional(), +}); + +export const zDockerImagesCounters = z.object({ + size: z.int().optional(), + total: z.int().optional(), +}); + +export const zDockerDashboardResponse = z.object({ + containers: zStatsContainerStats.optional(), + images: zDockerImagesCounters.optional(), + networks: z.int().optional(), + services: z.int().optional(), + stacks: z.int().optional(), + volumes: z.int().optional(), +}); + +export const zCustomtemplatesFileResponse = z.object({ + FileContent: z.string().optional(), +}); + +export const zCustomtemplatesCustomTemplateUpdatePayload = z.object({ + ComposeFilePathInRepository: z + .string() + .optional() + .default('docker-compose.yml'), + Description: z.string(), + EdgeTemplate: z.boolean().optional(), + FileContent: z.string(), + IsComposeFormat: z.boolean().optional(), + Logo: z.string().optional(), + Note: z.string().optional(), + Platform: z.union([z.literal(1), z.literal(2)]).optional(), + RepositoryAuthentication: z.boolean().optional(), + RepositoryGitCredentialID: z.int().optional(), + RepositoryPassword: z.string().optional(), + RepositoryReferenceName: z.string().optional(), + RepositoryURL: z.string(), + RepositoryUsername: z.string().optional(), + TLSSkipVerify: z.boolean().optional(), + Title: z.string(), + Type: z.union([z.literal(1), z.literal(2), z.literal(3)]), + Variables: z.array(zPortainerCustomTemplateVariableDefinition).optional(), +}); + +export const zCustomtemplatesCustomTemplateFromGitRepositoryPayload = z.object({ + ComposeFilePathInRepository: z + .string() + .optional() + .default('docker-compose.yml'), + Description: z.string(), + EdgeTemplate: z.boolean().optional(), + IsComposeFormat: z.boolean().optional(), + Logo: z.string().optional(), + Note: z.string().optional(), + Platform: z.union([z.literal(1), z.literal(2)]).optional(), + RepositoryAuthentication: z.boolean().optional(), + RepositoryPassword: z.string().optional(), + RepositoryReferenceName: z.string().optional(), + RepositoryURL: z.string(), + RepositoryUsername: z.string().optional(), + TLSSkipVerify: z.boolean().optional(), + Title: z.string(), + Type: z.union([z.literal(1), z.literal(2)]), + Variables: z.array(zPortainerCustomTemplateVariableDefinition).optional(), +}); + +export const zCustomtemplatesCustomTemplateFromFileContentPayload = z.object({ + Description: z.string(), + EdgeTemplate: z.boolean().optional(), + FileContent: z.string(), + Logo: z.string().optional(), + Note: z.string().optional(), + Platform: z.union([z.literal(1), z.literal(2)]).optional(), + Title: z.string(), + Type: z.union([z.literal(1), z.literal(2), z.literal(3)]), + Variables: z.array(zPortainerCustomTemplateVariableDefinition).optional(), +}); + +export const zContainersContainerGpusResponse = z.object({ + gpus: z.string().optional(), +}); + +export const zBackupRestorePayload = z.object({ + FileContent: z + .array( + z + .int() + .min(-2147483648, { + error: 'Invalid value: Expected int32 to be >= -2147483648', + }) + .max(2147483647, { + error: 'Invalid value: Expected int32 to be <= 2147483647', + }) + ) + .optional(), + FileName: z.string().optional(), + Password: z.string().optional(), +}); + +export const zBackupBackupPayload = z.object({ + Password: z.string().optional(), +}); + +export const zAuthOauthPayload = z.object({ + Code: z.string().optional(), +}); + +export const zAuthAuthenticateResponse = z.object({ + jwt: z.string().optional(), +}); + +export const zAuthAuthenticatePayload = z.object({ + Password: z.string(), + Username: z.string(), +}); + +export const zKubernetesK8sServiceInfo2 = zKubernetesK8sServiceInfo; + +export const zKubernetesK8sIngressInfo2 = zKubernetesK8sIngressInfo; + +export const zKubernetesK8sNamespaceDetails2 = zKubernetesK8sNamespaceDetails; + +export const zSourcesGitSourceCreatePayload2 = zSourcesGitSourceCreatePayload; + +export const zEndpointsEndpointDeleteBatchPayload2 = + zEndpointsEndpointDeleteBatchPayload; + +/** + * Ingress controllers + */ +export const zKubernetesK8sIngressControllerArray = z.array( + zKubernetesK8sIngressController +); + +/** + * Credentials used for authentication + */ +export const zAuthenticateUserBody = zAuthAuthenticatePayload; + +/** + * Success + */ +export const zAuthenticateUserResponse = zAuthAuthenticateResponse; + +/** + * Success + */ +export const zLogoutResponse = z.void(); + +/** + * OAuth Credentials used for authentication + */ +export const zValidateOAuthBody = zAuthOauthPayload; + +/** + * Success + */ +export const zValidateOAuthResponse = zAuthAuthenticateResponse; + +/** + * An object contains the password to encrypt the backup with + */ +export const zBackupBody = zBackupBackupPayload; + +export const zCustomTemplateListQuery = z.object({ + type: z.array(z.union([z.literal(1), z.literal(2), z.literal(3)])), + edge: z.boolean().optional(), +}); + +/** + * Success + */ +export const zCustomTemplateListResponse = z.array(zPortainerCustomTemplate); + +export const zCustomTemplateDeletePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zCustomTemplateDeleteResponse = z.void(); + +export const zCustomTemplateInspectPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zCustomTemplateInspectResponse = zPortainerCustomTemplate; + +/** + * Template details + */ +export const zCustomTemplateUpdateBody = + zCustomtemplatesCustomTemplateUpdatePayload; + +export const zCustomTemplateUpdatePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zCustomTemplateUpdateResponse = zPortainerCustomTemplate; + +export const zCustomTemplateFilePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zCustomTemplateFileResponse = zCustomtemplatesFileResponse; + +export const zCustomTemplateGitFetchPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zCustomTemplateGitFetchResponse = zCustomtemplatesFileResponse; + +export const zCustomTemplateCreateFileBody = z.object({ + Title: z.string(), + Description: z.string(), + Note: z.string(), + Platform: z.union([z.literal(1), z.literal(2)]), + Type: z.union([z.literal(1), z.literal(2), z.literal(3)]), + File: z.string(), + Logo: z.string().optional(), + Variables: z.string().optional(), +}); + +/** + * OK + */ +export const zCustomTemplateCreateFileResponse = zPortainerCustomTemplate; + +/** + * Required when using method=repository + */ +export const zCustomTemplateCreateRepositoryBody = + zCustomtemplatesCustomTemplateFromGitRepositoryPayload; + +/** + * OK + */ +export const zCustomTemplateCreateRepositoryResponse = zPortainerCustomTemplate; + +/** + * body + */ +export const zCustomTemplateCreateStringBody = + zCustomtemplatesCustomTemplateFromFileContentPayload; + +/** + * OK + */ +export const zCustomTemplateCreateStringResponse = zPortainerCustomTemplate; + +export const zDockerContainerGpusInspectPath = z.object({ + environmentId: z.int(), + containerId: z.int(), +}); + +/** + * Success + */ +export const zDockerContainerGpusInspectResponse = + zContainersContainerGpusResponse; + +export const zDockerDashboardPath = z.object({ + environmentId: z.int(), +}); + +/** + * Success + */ +export const zDockerDashboardResponse2 = zDockerDashboardResponse; + +export const zDockerImagesListPath = z.object({ + environmentId: z.int(), +}); + +export const zDockerImagesListQuery = z.object({ + withUsage: z.boolean().optional(), +}); + +/** + * Success + */ +export const zDockerImagesListResponse = z.array(zImagesImageResponse); + +/** + * EdgeGroups + */ +export const zEdgeGroupListResponse = z.array(zEdgegroupsDecoratedEdgeGroup); + +/** + * EdgeGroup data + */ +export const zEdgeGroupCreateBody = zEdgegroupsEdgeGroupCreatePayload; + +/** + * OK + */ +export const zEdgeGroupCreateResponse = zPortainerEdgeGroup; + +export const zEdgeGroupDeletePath = z.object({ + id: z.int(), +}); + +/** + * No Content + */ +export const zEdgeGroupDeleteResponse = z.void(); + +export const zEdgeGroupInspectPath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zEdgeGroupInspectResponse = zPortainerEdgeGroup; + +/** + * EdgeGroup data + */ +export const zEdgeGroupUpdateBody = zEdgegroupsEdgeGroupUpdatePayload; + +export const zEdgeGroupUpdatePath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zEdgeGroupUpdateResponse = zPortainerEdgeGroup; + +/** + * OK + */ +export const zEdgeJobListResponse = z.array(zPortainerEdgeJob); + +export const zEdgeJobDeletePath = z.object({ + id: z.int(), +}); + +/** + * No Content + */ +export const zEdgeJobDeleteResponse = z.void(); + +export const zEdgeJobInspectPath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zEdgeJobInspectResponse = zPortainerEdgeJob; + +/** + * EdgeGroup data + */ +export const zEdgeJobUpdateBody = zEdgejobsEdgeJobUpdatePayload; + +export const zEdgeJobUpdatePath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zEdgeJobUpdateResponse = zPortainerEdgeJob; + +export const zEdgeJobFilePath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zEdgeJobFileResponse = zEdgejobsEdgeJobFileResponse; + +export const zEdgeJobTasksListPath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zEdgeJobTasksListResponse = z.array(zEdgejobsTaskContainer); + +export const zEdgeJobTasksClearPath = z.object({ + id: z.int(), + taskID: z.int(), +}); + +/** + * No Content + */ +export const zEdgeJobTasksClearResponse = z.void(); + +export const zEdgeJobTaskLogsInspectPath = z.object({ + id: z.int(), + taskID: z.int(), +}); + +/** + * OK + */ +export const zEdgeJobTaskLogsInspectResponse = zEdgejobsFileResponse; + +export const zEdgeJobTasksCollectPath = z.object({ + id: z.int(), + taskID: z.int(), +}); + +/** + * No Content + */ +export const zEdgeJobTasksCollectResponse = z.void(); + +export const zEdgeJobCreateFileBody = z.object({ + file: z.string(), + Name: z.string(), + CronExpression: z.string(), + EdgeGroups: z.string(), + Endpoints: z.string(), + Recurring: z.boolean().optional(), +}); + +/** + * OK + */ +export const zEdgeJobCreateFileResponse = zPortainerEdgeGroup; + +/** + * EdgeGroup data when method is string + */ +export const zEdgeJobCreateStringBody = + zEdgejobsEdgeJobCreateFromFileContentPayload; + +/** + * OK + */ +export const zEdgeJobCreateStringResponse = zPortainerEdgeGroup; + +export const zEdgeStackListQuery = z.object({ + summarizeStatuses: z.boolean().optional(), +}); + +/** + * OK + */ +export const zEdgeStackListResponse = z.array(zPortainerEdgeStack); + +export const zEdgeStackDeletePath = z.object({ + id: z.int(), +}); + +/** + * No Content + */ +export const zEdgeStackDeleteResponse = z.void(); + +export const zEdgeStackInspectPath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zEdgeStackInspectResponse = zPortainerEdgeStack; + +/** + * EdgeStack data + */ +export const zEdgeStackUpdateBody = zEdgestacksUpdateEdgeStackPayload; + +export const zEdgeStackUpdatePath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zEdgeStackUpdateResponse = zPortainerEdgeStack; + +export const zEdgeStackFilePath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zEdgeStackFileResponse = zEdgestacksStackFileResponse; + +/** + * EdgeStack status payload + */ +export const zEdgeStackStatusUpdateBody = zEdgestacksUpdateStatusPayload; + +export const zEdgeStackStatusUpdatePath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zEdgeStackStatusUpdateResponse = zPortainerEdgeStack; + +export const zEdgeStackCreateFileBody = z.object({ + Name: z.string(), + file: z.string(), + EdgeGroups: z.string(), + DeploymentType: z.int(), + Registries: z.string().optional(), + UseManifestNamespaces: z.boolean().optional(), + PrePullImage: z.boolean().optional(), + RetryDeploy: z.boolean().optional(), +}); + +export const zEdgeStackCreateFileQuery = z.object({ + dryrun: z.string().optional(), +}); + +/** + * OK + */ +export const zEdgeStackCreateFileResponse = zPortainerEdgeStack; + +/** + * stack config + */ +export const zEdgeStackCreateRepositoryBody = + zEdgestacksEdgeStackFromGitRepositoryPayload; + +export const zEdgeStackCreateRepositoryQuery = z.object({ + dryrun: z.string().optional(), +}); + +/** + * OK + */ +export const zEdgeStackCreateRepositoryResponse = zPortainerEdgeStack; + +/** + * stack config + */ +export const zEdgeStackCreateStringBody = zEdgestacksEdgeStackFromStringPayload; + +export const zEdgeStackCreateStringQuery = z.object({ + dryrun: z.string().optional(), +}); + +/** + * OK + */ +export const zEdgeStackCreateStringResponse = zPortainerEdgeStack; + +export const zEndpointGroupListQuery = z.object({ + size: z.boolean().optional(), +}); + +/** + * Environment(Endpoint) group + */ +export const zEndpointGroupListResponse = z.array( + zEndpointgroupsEndpointGroupResponse +); + +/** + * Environment(Endpoint) Group details + */ +export const zPostEndpointGroupsBody = + zEndpointgroupsEndpointGroupCreatePayload; + +/** + * Success + */ +export const zPostEndpointGroupsResponse = zPortainerEndpointGroup; + +export const zEndpointGroupDeletePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zEndpointGroupDeleteResponse = z.void(); + +export const zGetEndpointGroupsByIdPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetEndpointGroupsByIdResponse = zPortainerEndpointGroup; + +/** + * EndpointGroup details + */ +export const zEndpointGroupUpdateBody = + zEndpointgroupsEndpointGroupUpdatePayload; + +export const zEndpointGroupUpdatePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zEndpointGroupUpdateResponse = zPortainerEndpointGroup; + +export const zEndpointGroupDeleteEndpointPath = z.object({ + id: z.int(), + endpointId: z.int(), +}); + +/** + * Success + */ +export const zEndpointGroupDeleteEndpointResponse = z.void(); + +export const zEndpointGroupAddEndpointPath = z.object({ + id: z.int(), + endpointId: z.int(), +}); + +/** + * Success + */ +export const zEndpointGroupAddEndpointResponse = z.void(); + +export const zEndpointListQuery = z.object({ + start: z.int().optional(), + limit: z.int().optional(), + sort: z + .enum([ + 'Name', + 'Group', + 'Status', + 'LastCheckIn', + 'EdgeID', + 'PlatformType', + 'Health', + 'Id', + ]) + .optional(), + order: z.int().optional(), + search: z.string().optional(), + groupIds: z.array(z.int()).optional(), + status: z.array(z.int()).optional(), + types: z.array(z.int()).optional(), + tagIds: z.array(z.int()).optional(), + tagsPartialMatch: z.boolean().optional(), + endpointIds: z.array(z.int()).optional(), + excludeIds: z.array(z.int()).optional(), + excludeGroupIds: z.array(z.int()).optional(), + provisioned: z.boolean().optional(), + agentVersions: z.array(z.string()).optional(), + edgeAsync: z.boolean().optional(), + edgeDeviceUntrusted: z.boolean().optional(), + edgeCheckInPassedSeconds: z.number().optional(), + excludeSnapshots: z.boolean().optional(), + name: z.string().optional(), + edgeStackStatus: z.string().optional(), + edgeGroupIds: z.array(z.int()).optional(), + excludeEdgeGroupIds: z.array(z.int()).optional(), +}); + +/** + * Endpoints + */ +export const zEndpointListResponse = z.array(zPortainerEndpoint); + +export const zEndpointCreateBody = z.object({ + Name: z.string(), + EndpointCreationType: z.int(), + ContainerEngine: z.string().optional(), + URL: z.string().optional(), + PublicURL: z.string().optional(), + GroupID: z.int().optional(), + TLS: z.boolean().optional(), + TLSSkipVerify: z.boolean().optional(), + TLSSkipClientVerify: z.boolean().optional(), + TLSCACertFile: z.string().optional(), + TLSCertFile: z.string().optional(), + TLSKeyFile: z.string().optional(), + AzureApplicationID: z.string().optional(), + AzureTenantID: z.string().optional(), + AzureAuthenticationKey: z.string().optional(), + TagIds: z.array(z.int()).optional(), + EdgeCheckinInterval: z.int().optional(), + EdgeTunnelServerAddress: z.string(), + Gpus: z.string().optional(), +}); + +/** + * Success + */ +export const zEndpointCreateResponse = zPortainerEndpoint; + +export const zEndpointDeletePath = z.object({ + id: z.int(), +}); + +/** + * Environment successfully deleted. + */ +export const zEndpointDeleteResponse = z.void(); + +export const zEndpointInspectPath = z.object({ + id: z.int(), +}); + +export const zEndpointInspectQuery = z.object({ + excludeSnapshot: z.boolean().optional(), +}); + +/** + * Success + */ +export const zEndpointInspectResponse = zPortainerEndpoint; + +/** + * Environment(Endpoint) details + */ +export const zEndpointUpdateBody = zEndpointsEndpointUpdatePayload; + +export const zEndpointUpdatePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zEndpointUpdateResponse = zPortainerEndpoint; + +export const zEndpointAssociationDeletePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zEndpointAssociationDeleteResponse = z.void(); + +export const zPostEndpointsByIdDockerV2BrowsePutBody = z.object({ + Path: z.string(), + file: z.string(), +}); + +export const zPostEndpointsByIdDockerV2BrowsePutPath = z.object({ + id: z.int(), +}); + +export const zPostEndpointsByIdDockerV2BrowsePutQuery = z.object({ + volumeID: z.string().optional(), +}); + +/** + * Success + */ +export const zPostEndpointsByIdDockerV2BrowsePutResponse = z.void(); + +export const zEndpointDockerhubStatusPath = z.object({ + id: z.int(), + registryId: z.int(), +}); + +/** + * Success + */ +export const zEndpointDockerhubStatusResponse = + zEndpointsDockerhubStatusResponse; + +/** + * details + */ +export const zEndpointForceUpdateServiceBody = + zEndpointsForceUpdateServicePayload; + +export const zEndpointForceUpdateServicePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zEndpointForceUpdateServiceResponse = zSwarmServiceUpdateResponse; + +export const zHelmListPath = z.object({ + id: z.int(), +}); + +export const zHelmListQuery = z.object({ + namespace: z.string().optional(), + filter: z.string().optional(), + selector: z.string().optional(), +}); + +/** + * Success + */ +export const zHelmListResponse = z.array(zReleaseReleaseElement); + +/** + * Chart details + */ +export const zHelmInstallBody = zHelmInstallChartPayload; + +export const zHelmInstallPath = z.object({ + id: z.int(), +}); + +export const zHelmInstallQuery = z.object({ + dryRun: z.boolean().optional(), +}); + +/** + * Created + */ +export const zHelmInstallResponse = zReleaseRelease; + +export const zHelmDeletePath = z.object({ + id: z.int(), + release: z.string(), +}); + +export const zHelmDeleteQuery = z.object({ + namespace: z.string().optional(), +}); + +/** + * Success + */ +export const zHelmDeleteResponse = z.void(); + +export const zHelmGetPath = z.object({ + id: z.int(), + release: z.string(), +}); + +export const zHelmGetQuery = z.object({ + namespace: z.string().optional(), + showResources: z.boolean().optional(), + revision: z.int().optional(), +}); + +/** + * Success + */ +export const zHelmGetResponse = zReleaseRelease; + +export const zHelmGetHistoryPath = z.object({ + id: z.int(), + release: z.string(), +}); + +export const zHelmGetHistoryQuery = z.object({ + namespace: z.string().optional(), +}); + +/** + * Success + */ +export const zHelmGetHistoryResponse = z.array(zReleaseRelease); + +export const zHelmRollbackPath = z.object({ + id: z.int(), + release: z.string(), +}); + +export const zHelmRollbackQuery = z.object({ + namespace: z.string().optional(), + revision: z.int().optional(), + wait: z.boolean().optional(), + waitForJobs: z.boolean().optional(), + recreate: z.boolean().optional(), + force: z.boolean().optional(), + timeout: z.int().optional(), +}); + +/** + * Success + */ +export const zHelmRollbackResponse = zReleaseRelease; + +export const zEndpointRegistriesListPath = z.object({ + id: z.int(), +}); + +export const zEndpointRegistriesListQuery = z.object({ + namespace: z.string().optional(), +}); + +/** + * Success + */ +export const zEndpointRegistriesListResponse = z.array(zPortainerRegistry); + +/** + * details + */ +export const zEndpointRegistryAccessBody = zEndpointsRegistryAccessPayload; + +export const zEndpointRegistryAccessPath = z.object({ + id: z.int(), + registryId: z.int(), +}); + +/** + * Success + */ +export const zEndpointRegistryAccessResponse = z.void(); + +/** + * Environment(Endpoint) details + */ +export const zEndpointSettingsUpdateBody = + zEndpointsEndpointSettingsUpdatePayload; + +export const zEndpointSettingsUpdatePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zEndpointSettingsUpdateResponse = zPortainerEndpoint; + +export const zEndpointSnapshotPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zEndpointSnapshotResponse = z.void(); + +/** + * List of environments to delete, with optional deleteCluster flag to clean-up associated resources (cloud environments only) + */ +export const zEndpointDeleteBatchBody = zEndpointsEndpointDeleteBatchPayload2; + +export const zEndpointDeleteBatchResponse = z.union([ + z.void(), + zEndpointsEndpointDeleteBatchPartialResponse, +]); + +/** + * Success + */ +export const zEndpointCreateGlobalKeyResponse = + zEndpointsEndpointCreateGlobalKeyResponse; + +/** + * Environment relations data + */ +export const zEndpointUpdateRelationsBody = + zEndpointsEndpointUpdateRelationsPayload; + +/** + * Success + */ +export const zEndpointUpdateRelationsResponse = z.void(); + +/** + * Success + */ +export const zEndpointSnapshotsResponse = z.void(); + +/** + * Environment summary counts + */ +export const zEndpointSummaryCountsResponse = + zEndpointsEnvironmentSummaryCountsResponse; + +/** + * Template details + */ +export const zGitOperationRepoFilePreviewBody = + zGitopsRepositoryFilePreviewPayload; + +/** + * Success + */ +export const zGitOperationRepoFilePreviewResponse = zGitopsFileResponse; + +export const zGitOpsSourcesListQuery = z.object({ + search: z.string().optional(), + sort: z.string().optional(), + order: z.string().optional(), + start: z.int().optional(), + limit: z.int().optional(), + status: z.string().optional(), + type: z.enum(['git', 'helm', 'oci']).optional(), +}); + +/** + * OK + */ +export const zGitOpsSourcesListResponse = z.array(zSourcesSource); + +export const zGitOpsSourcesDeletePath = z.object({ + id: z.int(), +}); + +/** + * Source deleted + */ +export const zGitOpsSourcesDeleteResponse = z.void(); + +export const zGitOpsSourceGetPath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zGitOpsSourceGetResponse = zSourcesSourceDetail; + +/** + * Git source details + */ +export const zGitOpsSourcesUpdateGitBody = zSourcesGitSourceCreatePayload2; + +export const zGitOpsSourcesUpdateGitPath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zGitOpsSourcesUpdateGitResponse = zPortainerSource; + +/** + * Git source details + */ +export const zGitOpsSourcesCreateGitBody = zSourcesGitSourceCreatePayload2; + +/** + * Created + */ +export const zGitOpsSourcesCreateGitResponse = zPortainerSource; + +/** + * OK + */ +export const zGitOpsSourcesSummaryResponse = zWorkflowsStatusSummary; + +export const zGitOpsWorkflowsListQuery = z.object({ + search: z.string().optional(), + sort: z.string().optional(), + order: z.string().optional(), + start: z.int().optional(), + limit: z.int().optional(), + endpointIds: z.array(z.int()).optional(), + status: z.string().optional(), + type: z.string().optional(), + platform: z.string().optional(), +}); + +/** + * OK + */ +export const zGitOpsWorkflowsListResponse = z.array(zWorkflowsWorkflow); + +/** + * OK + */ +export const zGitOpsWorkflowsSummaryResponse = zWorkflowsStatusSummary; + +export const zGetAllKubernetesApplicationsPath = z.object({ + id: z.int(), +}); + +export const zGetAllKubernetesApplicationsQuery = z.object({ + namespace: z.string(), + nodeName: z.string(), +}); + +/** + * Success + */ +export const zGetAllKubernetesApplicationsResponse = z.array( + zKubernetesK8sApplication +); + +export const zGetAllKubernetesApplicationsCountPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetAllKubernetesApplicationsCountResponse = z.int(); + +/** + * A list of cluster role bindings to delete + */ +export const zDeleteClusterRoleBindingsBody = z.array(z.string()); + +export const zDeleteClusterRoleBindingsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteClusterRoleBindingsResponse = z.void(); + +/** + * A list of cluster roles to delete + */ +export const zDeleteClusterRolesBody = z.array(z.string()); + +export const zDeleteClusterRolesPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteClusterRolesResponse = z.void(); + +export const zGetAllKubernetesClusterRoleBindingsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetAllKubernetesClusterRoleBindingsResponse = z.array( + zKubernetesK8sClusterRoleBinding +); + +export const zGetAllKubernetesClusterRolesPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetAllKubernetesClusterRolesResponse = z.array( + zKubernetesK8sClusterRole +); + +export const zGetAllKubernetesConfigMapsPath = z.object({ + id: z.int(), +}); + +export const zGetAllKubernetesConfigMapsQuery = z.object({ + isUsed: z.boolean(), +}); + +/** + * Success + */ +export const zGetAllKubernetesConfigMapsResponse = z.array( + zKubernetesK8sConfigMap +); + +export const zGetAllKubernetesConfigMapsCountPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetAllKubernetesConfigMapsCountResponse = z.int(); + +export const zGetKubernetesCronJobsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetKubernetesCronJobsResponse = z.array(zKubernetesK8sCronJob); + +/** + * A map where the key is the namespace and the value is an array of Cron Jobs to delete + */ +export const zDeleteCronJobsBody = zKubernetesK8sCronJobDeleteRequests; + +export const zDeleteCronJobsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteCronJobsResponse = z.void(); + +export const zGetKubernetesDashboardPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetKubernetesDashboardResponse = z.array(zKubernetesK8sDashboard); + +export const zDescribeResourcePath = z.object({ + id: z.int(), +}); + +export const zDescribeResourceQuery = z.object({ + name: z.string(), + kind: z.string(), + namespace: z.string().optional(), +}); + +/** + * Success + */ +export const zDescribeResourceResponse = zKubernetesDescribeResourceResponse; + +export const zGetAllKubernetesEventsPath = z.object({ + id: z.int(), +}); + +export const zGetAllKubernetesEventsQuery = z.object({ + resourceId: z.string().optional(), +}); + +/** + * Success + */ +export const zGetAllKubernetesEventsResponse = z.array(zKubernetesK8sEvent); + +export const zGetAllKubernetesIngressControllersPath = z.object({ + id: z.int(), +}); + +export const zGetAllKubernetesIngressControllersQuery = z.object({ + allowedOnly: z.boolean().optional(), +}); + +/** + * Success + */ +export const zGetAllKubernetesIngressControllersResponse = z.array( + zKubernetesK8sIngressController +); + +/** + * Ingress controllers + */ +export const zUpdateKubernetesIngressControllersBody = + zKubernetesK8sIngressControllerArray; + +export const zUpdateKubernetesIngressControllersPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zUpdateKubernetesIngressControllersResponse = z.void(); + +export const zGetAllKubernetesClusterIngressesPath = z.object({ + id: z.int(), +}); + +export const zGetAllKubernetesClusterIngressesQuery = z.object({ + withServices: z.boolean().optional(), +}); + +/** + * Success + */ +export const zGetAllKubernetesClusterIngressesResponse = z.array( + zKubernetesK8sIngressInfo +); + +export const zGetAllKubernetesClusterIngressesCountPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetAllKubernetesClusterIngressesCountResponse = z.int(); + +/** + * Ingress details + */ +export const zDeleteKubernetesIngressesBody = + zKubernetesK8sIngressDeleteRequests; + +export const zDeleteKubernetesIngressesPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteKubernetesIngressesResponse = z.void(); + +export const zGetKubernetesJobsPath = z.object({ + id: z.int(), +}); + +export const zGetKubernetesJobsQuery = z.object({ + includeCronJobChildren: z.boolean().optional(), +}); + +/** + * Success + */ +export const zGetKubernetesJobsResponse = z.array(zKubernetesK8sJob); + +/** + * A map where the key is the namespace and the value is an array of Jobs to delete + */ +export const zDeleteJobsBody = zKubernetesK8sJobDeleteRequests; + +export const zDeleteJobsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteJobsResponse = z.void(); + +export const zGetKubernetesMaxResourceLimitsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetKubernetesMaxResourceLimitsResponse = zPortainerK8sNodesLimits; + +export const zGetApplicationsResourcesPath = z.object({ + id: z.int(), +}); + +export const zGetApplicationsResourcesQuery = z.object({ + node: z.string(), +}); + +/** + * Success + */ +export const zGetApplicationsResourcesResponse = + zKubernetesK8sApplicationResource; + +export const zGetKubernetesMetricsForAllNodesPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetKubernetesMetricsForAllNodesResponse = zV1Beta1NodeMetricsList; + +export const zGetKubernetesMetricsForNodePath = z.object({ + id: z.int(), + name: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesMetricsForNodeResponse = zV1Beta1NodeMetrics; + +export const zGetKubernetesMetricsForAllPodsPath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesMetricsForAllPodsResponse = zV1Beta1PodMetricsList; + +export const zGetKubernetesMetricsForPodPath = z.object({ + id: z.int(), + namespace: z.string(), + name: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesMetricsForPodResponse = zV1Beta1PodMetrics; + +export const zDeleteKubernetesNamespacePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteKubernetesNamespaceResponse = z.string(); + +export const zGetKubernetesNamespacesPath = z.object({ + id: z.int(), +}); + +export const zGetKubernetesNamespacesQuery = z.object({ + withResourceQuota: z.boolean(), + withUnhealthyEvents: z.boolean(), +}); + +/** + * Success + */ +export const zGetKubernetesNamespacesResponse = z.array( + zPortainerK8sNamespaceInfo +); + +/** + * Namespace configuration details + */ +export const zCreateKubernetesNamespaceBody = zKubernetesK8sNamespaceDetails; + +export const zCreateKubernetesNamespacePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zCreateKubernetesNamespaceResponse = zPortainerK8sNamespaceInfo; + +/** + * Namespace details + */ +export const zUpdateKubernetesNamespaceDeprecatedBody = + zKubernetesK8sNamespaceDetails2; + +export const zUpdateKubernetesNamespaceDeprecatedPath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zUpdateKubernetesNamespaceDeprecatedResponse = + zPortainerK8sNamespaceInfo; + +export const zGetKubernetesNamespacePath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +export const zGetKubernetesNamespaceQuery = z.object({ + withResourceQuota: z.boolean(), +}); + +/** + * Success + */ +export const zGetKubernetesNamespaceResponse = zPortainerK8sNamespaceInfo; + +/** + * Namespace details + */ +export const zUpdateKubernetesNamespaceBody = zKubernetesK8sNamespaceDetails2; + +export const zUpdateKubernetesNamespacePath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zUpdateKubernetesNamespaceResponse = zPortainerK8sNamespaceInfo; + +export const zGetKubernetesConfigMapPath = z.object({ + id: z.int(), + namespace: z.string(), + configmap: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesConfigMapResponse = zKubernetesK8sConfigMap; + +export const zGetKubernetesEventsForNamespacePath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +export const zGetKubernetesEventsForNamespaceQuery = z.object({ + resourceId: z.string().optional(), +}); + +/** + * Success + */ +export const zGetKubernetesEventsForNamespaceResponse = + z.array(zKubernetesK8sEvent); + +export const zGetKubernetesIngressControllersByNamespacePath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesIngressControllersByNamespaceResponse = z.array( + zKubernetesK8sIngressController +); + +/** + * Ingress controllers + */ +export const zUpdateKubernetesIngressControllersByNamespaceBody = + zKubernetesK8sIngressControllerArray; + +export const zUpdateKubernetesIngressControllersByNamespacePath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zUpdateKubernetesIngressControllersByNamespaceResponse = z.void(); + +export const zGetAllKubernetesIngressesPath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zGetAllKubernetesIngressesResponse = z.array( + zKubernetesK8sIngressInfo +); + +/** + * Ingress details + */ +export const zCreateKubernetesIngressBody = zKubernetesK8sIngressInfo2; + +export const zCreateKubernetesIngressPath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zCreateKubernetesIngressResponse = z.void(); + +/** + * Ingress details + */ +export const zUpdateKubernetesIngressBody = zKubernetesK8sIngressInfo2; + +export const zUpdateKubernetesIngressPath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zUpdateKubernetesIngressResponse = z.void(); + +export const zGetKubernetesIngressPath = z.object({ + id: z.int(), + namespace: z.string(), + ingress: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesIngressResponse = zKubernetesK8sIngressInfo; + +export const zGetKubernetesPersistentVolumeClaimsInNamespacePath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesPersistentVolumeClaimsInNamespaceResponse = z.array( + zKubernetesK8sPersistentVolumeClaim +); + +export const zGetKubernetesPersistentVolumeClaimPath = z.object({ + id: z.int(), + namespace: z.string(), + name: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesPersistentVolumeClaimResponse = + zKubernetesK8sPersistentVolumeClaim; + +export const zDeleteKubernetesPodPath = z.object({ + id: z.int(), + namespace: z.string(), + name: z.string(), +}); + +/** + * Success + */ +export const zDeleteKubernetesPodResponse = z.void(); + +export const zRestartKubernetesPodPath = z.object({ + id: z.int(), + namespace: z.string(), + name: z.string(), +}); + +/** + * Success + */ +export const zRestartKubernetesPodResponse = z.void(); + +export const zGetKubernetesSecretPath = z.object({ + id: z.int(), + namespace: z.string(), + secret: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesSecretResponse = zKubernetesK8sSecret; + +export const zGetKubernetesServiceAccountPath = z.object({ + id: z.int(), + namespace: z.string(), + name: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesServiceAccountResponse = + zKubernetesK8sServiceAccount; + +/** + * New imagePullSecrets list + */ +export const zUpdateKubernetesServiceAccountImagePullSecretsBody = + zKubernetesK8sServiceAccountImagePullSecretsUpdatePayload; + +export const zUpdateKubernetesServiceAccountImagePullSecretsPath = z.object({ + id: z.int(), + namespace: z.string(), + name: z.string(), +}); + +/** + * Success + */ +export const zUpdateKubernetesServiceAccountImagePullSecretsResponse = z.void(); + +export const zGetKubernetesServicesByNamespacePath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesServicesByNamespaceResponse = z.array( + zKubernetesK8sServiceInfo +); + +/** + * Service definition + */ +export const zCreateKubernetesServiceBody = zKubernetesK8sServiceInfo2; + +export const zCreateKubernetesServicePath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zCreateKubernetesServiceResponse = z.void(); + +/** + * Service definition + */ +export const zUpdateKubernetesServiceBody = zKubernetesK8sServiceInfo2; + +export const zUpdateKubernetesServicePath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zUpdateKubernetesServiceResponse = z.void(); + +/** + * Update details + */ +export const zKubernetesNamespacesToggleSystemBody = + zKubernetesNamespacesToggleSystemPayload; + +export const zKubernetesNamespacesToggleSystemPath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +/** + * Success + */ +export const zKubernetesNamespacesToggleSystemResponse = z.void(); + +export const zGetKubernetesVolumesInNamespacePath = z.object({ + id: z.int(), + namespace: z.string(), +}); + +export const zGetKubernetesVolumesInNamespaceQuery = z.object({ + withApplications: z.boolean().optional(), +}); + +/** + * Success + */ +export const zGetKubernetesVolumesInNamespaceResponse = z.record( + z.string(), + zKubernetesK8sVolumeInfo +); + +export const zGetKubernetesNamespacesCountPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetKubernetesNamespacesCountResponse = z.int(); + +export const zDrainNodePath = z.object({ + id: z.int(), + name: z.string(), +}); + +/** + * Success + */ +export const zDrainNodeResponse = z.void(); + +export const zGetKubernetesNodesLimitsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetKubernetesNodesLimitsResponse = zPortainerK8sNodesLimits; + +export const zGetAllKubernetesPersistentVolumeClaimsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetAllKubernetesPersistentVolumeClaimsResponse = z.array( + zKubernetesK8sPersistentVolumeClaim +); + +/** + * List of PVCs to delete (namespace + name) + */ +export const zDeleteKubernetesPersistentVolumeClaimsBody = z.array( + zKubernetesK8sVolumeDeleteRequest +); + +export const zDeleteKubernetesPersistentVolumeClaimsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteKubernetesPersistentVolumeClaimsResponse = z.void(); + +/** + * PVC resize request + */ +export const zResizeKubernetesPersistentVolumeClaimBody = + zKubernetesK8sPvcResizeRequest; + +export const zResizeKubernetesPersistentVolumeClaimPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zResizeKubernetesPersistentVolumeClaimResponse = z.void(); + +export const zGetAllKubernetesPersistentVolumesPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetAllKubernetesPersistentVolumesResponse = z.array( + zKubernetesK8sPersistentVolume +); + +export const zGetKubernetesPersistentVolumePath = z.object({ + id: z.int(), + name: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesPersistentVolumeResponse = + zKubernetesK8sPersistentVolume; + +/** + * List of PV names to delete + */ +export const zDeleteKubernetesPersistentVolumesBody = z.array(z.string()); + +export const zDeleteKubernetesPersistentVolumesPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteKubernetesPersistentVolumesResponse = z.void(); + +/** + * Reclaim policy update request + */ +export const zUpdateKubernetesPersistentVolumeReclaimPolicyBody = + zKubernetesK8sPvReclaimPolicyRequest; + +export const zUpdateKubernetesPersistentVolumeReclaimPolicyPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zUpdateKubernetesPersistentVolumeReclaimPolicyResponse = z.void(); + +export const zGetKubernetesRbacStatusPath = z.object({ + id: z.int(), +}); + +/** + * RBAC status + */ +export const zGetKubernetesRbacStatusResponse = z.boolean(); + +/** + * A map where the key is the namespace and the value is an array of role bindings to delete + */ +export const zDeleteRoleBindingsBody = zKubernetesK8sRoleBindingDeleteRequests; + +export const zDeleteRoleBindingsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteRoleBindingsResponse = z.void(); + +export const zGetKubernetesRoleBindingsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetKubernetesRoleBindingsResponse = z.array( + zKubernetesK8sRoleBinding +); + +export const zGetKubernetesRolesPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetKubernetesRolesResponse = z.array(zKubernetesK8sRole); + +/** + * A map where the key is the namespace and the value is an array of roles to delete + */ +export const zDeleteRolesBody = zKubernetesK8sRoleDeleteRequests; + +export const zDeleteRolesPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteRolesResponse = z.void(); + +export const zGetKubernetesSecretsPath = z.object({ + id: z.int(), +}); + +export const zGetKubernetesSecretsQuery = z.object({ + isUsed: z.boolean(), +}); + +/** + * Success + */ +export const zGetKubernetesSecretsResponse = z.array(zKubernetesK8sSecret); + +export const zGetKubernetesSecretsCountPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetKubernetesSecretsCountResponse = z.int(); + +/** + * A map where the key is the namespace and the value is an array of service accounts to delete + */ +export const zDeleteServiceAccountsBody = + zKubernetesK8sServiceAccountDeleteRequests; + +export const zDeleteServiceAccountsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteServiceAccountsResponse = z.void(); + +export const zGetKubernetesServiceAccountsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetKubernetesServiceAccountsResponse = z.array( + zKubernetesK8sServiceAccount +); + +export const zGetKubernetesServicesPath = z.object({ + id: z.int(), +}); + +export const zGetKubernetesServicesQuery = z.object({ + withApplications: z.boolean().optional(), +}); + +/** + * Success + */ +export const zGetKubernetesServicesResponse = z.array( + zKubernetesK8sServiceInfo +); + +export const zGetAllKubernetesServicesCountPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetAllKubernetesServicesCountResponse = z.int(); + +/** + * A map where the key is the namespace and the value is an array of services to delete + */ +export const zDeleteKubernetesServicesBody = + zKubernetesK8sServiceDeleteRequests; + +export const zDeleteKubernetesServicesPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteKubernetesServicesResponse = z.void(); + +export const zGetAllKubernetesStorageClassesPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetAllKubernetesStorageClassesResponse = z.array( + zKubernetesK8sStorageClass +); + +export const zGetKubernetesStorageClassPath = z.object({ + id: z.int(), + name: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesStorageClassResponse = zKubernetesK8sStorageClass; + +export const zSetDefaultKubernetesStorageClassPath = z.object({ + id: z.int(), + name: z.string(), +}); + +/** + * Success + */ +export const zSetDefaultKubernetesStorageClassResponse = z.void(); + +/** + * List of StorageClass names to delete + */ +export const zDeleteKubernetesStorageClassesBody = z.array(z.string()); + +export const zDeleteKubernetesStorageClassesPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zDeleteKubernetesStorageClassesResponse = z.void(); + +export const zGetKubernetesVersionPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetKubernetesVersionResponse = + zKubernetesKubernetesVersionResponse; + +export const zGetAllKubernetesVolumesPath = z.object({ + id: z.int(), +}); + +export const zGetAllKubernetesVolumesQuery = z.object({ + withApplications: z.boolean().optional(), +}); + +/** + * Success + */ +export const zGetAllKubernetesVolumesResponse = z.record( + z.string(), + zKubernetesK8sVolumeInfo +); + +export const zGetKubernetesVolumePath = z.object({ + id: z.int(), + namespace: z.string(), + volume: z.string(), +}); + +/** + * Success + */ +export const zGetKubernetesVolumeResponse = zKubernetesK8sVolumeInfo; + +export const zGetAllKubernetesVolumesCountPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zGetAllKubernetesVolumesCountResponse = z.int(); + +export const zGetKubernetesConfigQuery = z.object({ + ids: z.array(z.int()).optional(), + excludeIds: z.array(z.int()).optional(), +}); + +/** + * details + */ +export const zLdapCheckBody = zLdapCheckPayload; + +/** + * Success + */ +export const zLdapCheckResponse = z.void(); + +/** + * OK + */ +export const zMotdResponse = zMotdMotd; + +/** + * Success + */ +export const zRegistryListResponse = z.array(zPortainerRegistry); + +/** + * Registry details + */ +export const zRegistryCreateBody = zRegistriesRegistryCreatePayload; + +/** + * Success + */ +export const zRegistryCreateResponse = zPortainerRegistry; + +export const zRegistryDeletePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zRegistryDeleteResponse = z.void(); + +export const zRegistryInspectPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zRegistryInspectResponse = zPortainerRegistry; + +/** + * Registry details + */ +export const zRegistryUpdateBody = zRegistriesRegistryUpdatePayload; + +export const zRegistryUpdatePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zRegistryUpdateResponse = zPortainerRegistry; + +/** + * Registry configuration + */ +export const zRegistryConfigureBody = zRegistriesRegistryConfigurePayload; + +export const zRegistryConfigurePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zRegistryConfigureResponse = z.void(); + +/** + * Registry credentials to test + */ +export const zRegistryPingBody = zRegistriesRegistryPingPayload; + +/** + * Success + */ +export const zRegistryPingResponse = zRegistriesRegistryPingResponse; + +/** + * Resource control details + */ +export const zResourceControlCreateBody = + zResourcecontrolsResourceControlCreatePayload; + +/** + * Success + */ +export const zResourceControlCreateResponse = zPortainerResourceControl; + +export const zResourceControlDeletePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zResourceControlDeleteResponse = z.void(); + +/** + * Resource control details + */ +export const zResourceControlUpdateBody = + zResourcecontrolsResourceControlUpdatePayload; + +export const zResourceControlUpdatePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zResourceControlUpdateResponse = zPortainerResourceControl; + +/** + * Restore request payload + */ +export const zRestoreBody = zBackupRestorePayload; + +/** + * Success + */ +export const zRoleListResponse = z.array(zPortainerRole); + +/** + * Success + */ +export const zSettingsInspectResponse = zPortainerSettings; + +/** + * New settings + */ +export const zSettingsUpdateBody = zSettingsSettingsUpdatePayload; + +/** + * Success + */ +export const zSettingsUpdateResponse = zPortainerSettings; + +/** + * Success + */ +export const zSettingsPublicResponse = zSettingsPublicSettingsResponse; + +/** + * Success + */ +export const zSslInspectResponse = zPortainerSslSettings; + +/** + * SSL Settings + */ +export const zSslUpdateBody = zSslSslUpdatePayload; + +/** + * Success + */ +export const zSslUpdateResponse = z.void(); + +export const zStackListQuery = z.object({ + filters: z.string().optional(), +}); + +export const zStackListResponse = z.union([z.array(zPortainerStack), z.void()]); + +export const zStackDeletePath = z.object({ + id: z.int(), +}); + +export const zStackDeleteQuery = z.object({ + external: z.boolean().optional(), + endpointId: z.int(), +}); + +/** + * Success + */ +export const zStackDeleteResponse = z.void(); + +export const zStackInspectPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zStackInspectResponse = zPortainerStack; + +/** + * Stack details + */ +export const zStackUpdateBody = zStacksUpdateSwarmStackPayload; + +export const zStackUpdatePath = z.object({ + id: z.int(), +}); + +export const zStackUpdateQuery = z.object({ + endpointId: z.int(), +}); + +/** + * Success + */ +export const zStackUpdateResponse = zPortainerStack; + +export const zStackAssociatePath = z.object({ + id: z.int(), +}); + +export const zStackAssociateQuery = z.object({ + endpointId: z.int(), + swarmId: z.int(), + orphanedRunning: z.boolean(), +}); + +/** + * Success + */ +export const zStackAssociateResponse = zPortainerStack; + +export const zStackFileInspectPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zStackFileInspectResponse = zStacksStackFileResponse; + +/** + * Git configs for pull and redeploy a stack + */ +export const zStackUpdateGitBody = zStacksStackGitUpdatePayload; + +export const zStackUpdateGitPath = z.object({ + id: z.int(), +}); + +export const zStackUpdateGitQuery = z.object({ + endpointId: z.int().optional(), +}); + +/** + * Success + */ +export const zStackUpdateGitResponse = zPortainerStack; + +/** + * Git configs for pull and redeploy of a stack. **StackName** may only be populated for Kuberenetes stacks, and if specified with a blank string, it will be set to blank + */ +export const zStackGitRedeployBody = zStacksStackGitRedeployPayload; + +export const zStackGitRedeployPath = z.object({ + id: z.int(), +}); + +export const zStackGitRedeployQuery = z.object({ + endpointId: z.int().optional(), +}); + +/** + * Success + */ +export const zStackGitRedeployResponse = zPortainerStack; + +/** + * Stack migration details + */ +export const zStackMigrateBody = zStacksStackMigratePayload; + +export const zStackMigratePath = z.object({ + id: z.int(), +}); + +export const zStackMigrateQuery = z.object({ + endpointId: z.int().optional(), +}); + +/** + * Success + */ +export const zStackMigrateResponse = zPortainerStack; + +export const zStackStartPath = z.object({ + id: z.int(), +}); + +export const zStackStartQuery = z.object({ + endpointId: z.int(), +}); + +/** + * Success + */ +export const zStackStartResponse = zPortainerStack; + +export const zStackStopPath = z.object({ + id: z.int(), +}); + +export const zStackStopQuery = z.object({ + endpointId: z.int(), +}); + +/** + * Success + */ +export const zStackStopResponse = zPortainerStack; + +/** + * stack config + */ +export const zStackCreateKubernetesGitBody = + zStacksKubernetesGitDeploymentPayload; + +export const zStackCreateKubernetesGitQuery = z.object({ + endpointId: z.int(), +}); + +/** + * OK + */ +export const zStackCreateKubernetesGitResponse = zPortainerStack; + +/** + * stack config + */ +export const zStackCreateKubernetesFileBody = + zStacksKubernetesStringDeploymentPayload; + +export const zStackCreateKubernetesFileQuery = z.object({ + endpointId: z.int(), +}); + +/** + * OK + */ +export const zStackCreateKubernetesFileResponse = zPortainerStack; + +/** + * stack config + */ +export const zStackCreateKubernetesUrlBody = + zStacksKubernetesManifestUrlDeploymentPayload; + +export const zStackCreateKubernetesUrlQuery = z.object({ + endpointId: z.int(), +}); + +/** + * OK + */ +export const zStackCreateKubernetesUrlResponse = zPortainerStack; + +export const zStackCreateDockerStandaloneFileBody = z.object({ + Name: z.string(), + Env: z.string().optional(), + file: z.string().optional(), +}); + +export const zStackCreateDockerStandaloneFileQuery = z.object({ + endpointId: z.int(), +}); + +/** + * OK + */ +export const zStackCreateDockerStandaloneFileResponse = zPortainerStack; + +/** + * stack config + */ +export const zStackCreateDockerStandaloneRepositoryBody = + zStacksComposeStackFromGitRepositoryPayload; + +export const zStackCreateDockerStandaloneRepositoryQuery = z.object({ + endpointId: z.int(), +}); + +/** + * OK + */ +export const zStackCreateDockerStandaloneRepositoryResponse = zPortainerStack; + +/** + * stack config + */ +export const zStackCreateDockerStandaloneStringBody = + zStacksComposeStackFromFileContentPayload; + +export const zStackCreateDockerStandaloneStringQuery = z.object({ + endpointId: z.int(), +}); + +/** + * OK + */ +export const zStackCreateDockerStandaloneStringResponse = zPortainerStack; + +export const zStackCreateDockerSwarmFileBody = z.object({ + Name: z.string().optional(), + SwarmID: z.string().optional(), + Env: z.string().optional(), + file: z.string().optional(), +}); + +export const zStackCreateDockerSwarmFileQuery = z.object({ + endpointId: z.int(), +}); + +/** + * OK + */ +export const zStackCreateDockerSwarmFileResponse = zPortainerStack; + +/** + * stack config + */ +export const zStackCreateDockerSwarmRepositoryBody = + zStacksSwarmStackFromGitRepositoryPayload; + +export const zStackCreateDockerSwarmRepositoryQuery = z.object({ + endpointId: z.int(), +}); + +/** + * OK + */ +export const zStackCreateDockerSwarmRepositoryResponse = zPortainerStack; + +/** + * stack config + */ +export const zStackCreateDockerSwarmStringBody = + zStacksSwarmStackFromFileContentPayload; + +export const zStackCreateDockerSwarmStringQuery = z.object({ + endpointId: z.int(), +}); + +/** + * OK + */ +export const zStackCreateDockerSwarmStringResponse = zPortainerStack; + +export const zStackDeleteKubernetesByNamePath = z.object({ + name: z.string(), +}); + +export const zStackDeleteKubernetesByNameQuery = z.object({ + external: z.boolean().optional(), + endpointId: z.int(), +}); + +/** + * Success + */ +export const zStackDeleteKubernetesByNameResponse = z.void(); + +export const zWebhookInvokePath = z.object({ + webhookID: z.string(), +}); + +/** + * Success + */ +export const zSystemInfoResponse = zSystemSystemInfoResponse; + +/** + * Success + */ +export const zSystemNodesCountResponse2 = zSystemNodesCountResponse; + +/** + * Success + */ +export const zSystemStatusResponse = zSystemStatus; + +/** + * Success + */ +export const zSystemUpgradeResponse = zSystemStatus; + +/** + * Success + */ +export const zSystemVersionResponse2 = zSystemVersionResponse; + +/** + * Success + */ +export const zTagListResponse = z.array(zPortainerTag); + +/** + * Tag details + */ +export const zTagCreateBody = zTagsTagCreatePayload; + +/** + * Success + */ +export const zTagCreateResponse = zPortainerTag; + +export const zTagDeletePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zTagDeleteResponse = z.void(); + +/** + * Success + */ +export const zTeamMembershipListResponse = z.array(zPortainerTeamMembership); + +/** + * Team membership details + */ +export const zTeamMembershipCreateBody = + zTeammembershipsTeamMembershipCreatePayload; + +/** + * Success + */ +export const zTeamMembershipCreateResponse = zPortainerTeamMembership; + +export const zTeamMembershipDeletePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zTeamMembershipDeleteResponse = z.void(); + +/** + * Team membership details + */ +export const zTeamMembershipUpdateBody = + zTeammembershipsTeamMembershipUpdatePayload; + +export const zTeamMembershipUpdatePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zTeamMembershipUpdateResponse = zPortainerTeamMembership; + +export const zTeamListQuery = z.object({ + onlyLedTeams: z.boolean().optional(), + environmentId: z.int().optional(), +}); + +/** + * Success + */ +export const zTeamListResponse = z.array(zPortainerTeam); + +/** + * details + */ +export const zTeamCreateBody = zTeamsTeamCreatePayload; + +/** + * Success + */ +export const zTeamCreateResponse = zPortainerTeam; + +export const zTeamDeletePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zTeamDeleteResponse = z.void(); + +export const zTeamInspectPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zTeamInspectResponse = zPortainerTeam; + +/** + * Team details + */ +export const zTeamUpdateBody = zTeamsTeamUpdatePayload; + +export const zTeamUpdatePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zTeamUpdateResponse = zPortainerTeam; + +export const zTeamMembershipsPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zTeamMembershipsResponse = z.array(zPortainerTeamMembership); + +/** + * Success + */ +export const zTemplateListResponse = zTemplatesListResponse; + +export const zTemplateFilePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zTemplateFileResponse = zTemplatesFileResponse; + +export const zHelmRepoSearchQuery = z.object({ + repo: z.string(), + chart: z.string().optional(), + useCache: z.string().optional(), +}); + +/** + * Success + */ +export const zHelmRepoSearchResponse = z.string(); + +export const zHelmShowPath = z.object({ + command: z.string(), +}); + +export const zHelmShowQuery = z.object({ + repo: z.string(), + chart: z.string(), + version: z.string().optional(), +}); + +/** + * Success + */ +export const zHelmShowResponse = z.string(); + +export const zUploadTlsBody = z.object({ + folder: z.string(), + file: z.string(), +}); + +export const zUploadTlsPath = z.object({ + certificate: z.enum(['ca', 'cert', 'key']), +}); + +/** + * Success + */ +export const zUploadTlsResponse = z.void(); + +export const zUserListQuery = z.object({ + environmentId: z.int().optional(), +}); + +/** + * Success + */ +export const zUserListResponse = z.array(zPortainerUser); + +/** + * User details + */ +export const zUserCreateBody = zUsersUserCreatePayload; + +/** + * Success + */ +export const zUserCreateResponse = zPortainerUser; + +export const zUserDeletePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zUserDeleteResponse = z.void(); + +export const zUserInspectPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zUserInspectResponse = zPortainerUser; + +/** + * User details + */ +export const zUserUpdateBody = zUsersUserUpdatePayload; + +export const zUserUpdatePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zUserUpdateResponse = zPortainerUser; + +export const zUserEffectiveAccessInspectPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zUserEffectiveAccessInspectResponse = z.array( + zUsersEffectiveAccessEntry +); + +export const zHelmUserRepositoriesListPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zHelmUserRepositoriesListResponse = + zUsersHelmUserRepositoryResponse; + +/** + * Helm Repository + */ +export const zHelmUserRepositoryCreateBody = zUsersAddHelmRepoUrlPayload; + +export const zHelmUserRepositoryCreatePath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zHelmUserRepositoryCreateResponse = zPortainerHelmUserRepository; + +export const zHelmUserRepositoryDeletePath = z.object({ + id: z.int(), + repositoryID: z.int(), +}); + +/** + * Success + */ +export const zHelmUserRepositoryDeleteResponse = z.void(); + +export const zUserMembershipsInspectPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zUserMembershipsInspectResponse = zPortainerTeamMembership; + +/** + * details + */ +export const zUserUpdatePasswordBody = zUsersUserUpdatePasswordPayload; + +export const zUserUpdatePasswordPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zUserUpdatePasswordResponse = z.void(); + +export const zUserGetApiKeysPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zUserGetApiKeysResponse = z.array(zPortainerApiKey); + +/** + * details + */ +export const zUserGenerateApiKeyBody = zUsersUserAccessTokenCreatePayload; + +export const zUserGenerateApiKeyPath = z.object({ + id: z.int(), +}); + +/** + * Success + */ +export const zUserGenerateApiKeyResponse = zUsersAccessTokenResponse; + +export const zUserRemoveApiKeyPath = z.object({ + id: z.int(), + keyID: z.int(), +}); + +/** + * Success + */ +export const zUserRemoveApiKeyResponse = z.void(); + +/** + * Success + */ +export const zUserAdminCheckResponse = z.void(); + +/** + * User details + */ +export const zUserAdminInitBody = zUsersAdminInitPayload; + +/** + * Success + */ +export const zUserAdminInitResponse = zPortainerUser; + +/** + * Success + */ +export const zCurrentUserInspectResponse = zPortainerUser; + +export const zGetWebhooksQuery = z.object({ + filters: z.string().optional(), +}); + +/** + * OK + */ +export const zGetWebhooksResponse = z.array(zPortainerWebhook); + +/** + * Webhook data + */ +export const zPostWebhooksBody = zWebhooksWebhookCreatePayload; + +/** + * OK + */ +export const zPostWebhooksResponse = zPortainerWebhook; + +export const zDeleteWebhooksByIdPath = z.object({ + id: z.int(), +}); + +export const zPostWebhooksByIdPath = z.object({ + id: z.string(), +}); + +/** + * Webhook data + */ +export const zPutWebhooksByIdBody = zWebhooksWebhookUpdatePayload; + +export const zPutWebhooksByIdPath = z.object({ + id: z.int(), +}); + +/** + * OK + */ +export const zPutWebhooksByIdResponse = zPortainerWebhook; + +export const zGetWebsocketAttachQuery = z.object({ + endpointId: z.int(), + nodeName: z.string().optional(), +}); + +export const zGetWebsocketExecQuery = z.object({ + endpointId: z.int(), + nodeName: z.string().optional(), +}); + +export const zGetWebsocketKubernetesShellQuery = z.object({ + endpointId: z.int(), +}); + +export const zGetWebsocketPodQuery = z.object({ + endpointId: z.int(), + namespace: z.string(), + podName: z.string(), + containerName: z.string(), + command: z.string(), +}); diff --git a/app/react/portainer/services/axios/axios.ts b/app/react/portainer/services/axios/axios.ts index 27fd5079bb..cc724b13ae 100644 --- a/app/react/portainer/services/axios/axios.ts +++ b/app/react/portainer/services/axios/axios.ts @@ -18,7 +18,6 @@ import { portainerAgentTargetHeader, } from '@/portainer/services/http-request.helper'; import { dockerMaxAPIVersionInterceptor } from '@/portainer/services/dockerMaxApiVersionInterceptor'; -import { MAX_DOCKER_API_VERSION } from '@/portainer/services/dockerMaxApiVersion'; export { parseAxiosError } from './utils/parseAxiosError'; @@ -50,7 +49,6 @@ function headerInterpreter( const axios = Axios.create({ baseURL: 'api', - maxDockerAPIVersion: MAX_DOCKER_API_VERSION, paramsSerializer: { serialize: (params) => qs.stringify(params, { arrayFormat: 'brackets' }), }, diff --git a/app/react/portainer/services/axios/configure-hey-api.ts b/app/react/portainer/services/axios/configure-hey-api.ts new file mode 100644 index 0000000000..693cf09404 --- /dev/null +++ b/app/react/portainer/services/axios/configure-hey-api.ts @@ -0,0 +1,10 @@ +import { CreateClientConfig } from '@api/client.gen'; + +import axios from './axios'; + +export function createClientConfig(config: Parameters[0]) { + return { + ...config, + axios, + }; +} diff --git a/app/setup-tests/mock-codemirror.tsx b/app/setup-tests/mock-codemirror.tsx index 10dcfa11c4..d30c50c65a 100644 --- a/app/setup-tests/mock-codemirror.tsx +++ b/app/setup-tests/mock-codemirror.tsx @@ -1,60 +1,61 @@ -export function mockCodeMirror() { - vi.mock('@uiw/react-codemirror', () => ({ +vi.mock('@uiw/react-codemirror', () => ({ + __esModule: true, + default: ({ + value, + onChange, + readOnly, + placeholder, + height, + className, + id, + 'data-cy': dataCy, + }: { + value?: string; + onChange?: (value: string) => void; + readOnly?: boolean; + placeholder?: string; + height?: string; + className?: string; + id?: string; + 'data-cy'?: string; + }) => ( +