/* tslint:disable */ /* eslint-disable */ /** * Admin API * The Admin API is used to manage the ApeCloud platform. * * The version of the OpenAPI document: 1.0.0 * Contact: support@apecloud.com * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base'; // @ts-ignore import type { APIErrorResponse } from '../models'; // @ts-ignore import type { PlatformComponent } from '../models'; // @ts-ignore import type { PlatformComponentDetails } from '../models'; // @ts-ignore import type { PlatformComponentOverview } from '../models'; /** * PlatformComponentApi - axios parameter creator * @export */ export const PlatformComponentApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Get platform component detail by name, including monitoring and log query metadata * @summary Get platform component detail * @param {string} componentName Platform component name * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPlatformComponent: async (componentName: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'componentName' is not null or undefined assertParamExists('getPlatformComponent', 'componentName', componentName) const localVarPath = `/admin/v1/platformComponents/{componentName}` .replace(`{${"componentName"}}`, encodeURIComponent(String(componentName))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication BearerToken required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) // authentication DigestAuth required await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get hosting nodes, node CPU and memory usage, component PVC statistics, and component Pod counts in the central Kubernetes cluster. Unavailable resource usage is reported as -1. * @summary Get platform component nodes and resource statistics * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPlatformComponentOverview: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/admin/v1/platformComponents/overview`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication BearerToken required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) // authentication DigestAuth required await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * List platform components with monitoring and log query metadata * @summary List platform components * @param {*} [options] Override http request option. * @throws {RequiredError} */ listPlatformComponents: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/admin/v1/platformComponents`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication BearerToken required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) // authentication DigestAuth required await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration) setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * PlatformComponentApi - functional programming interface * @export */ export const PlatformComponentApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = PlatformComponentApiAxiosParamCreator(configuration) return { /** * Get platform component detail by name, including monitoring and log query metadata * @summary Get platform component detail * @param {string} componentName Platform component name * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getPlatformComponent(componentName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPlatformComponent(componentName, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PlatformComponentApi.getPlatformComponent']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Get hosting nodes, node CPU and memory usage, component PVC statistics, and component Pod counts in the central Kubernetes cluster. Unavailable resource usage is reported as -1. * @summary Get platform component nodes and resource statistics * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getPlatformComponentOverview(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getPlatformComponentOverview(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PlatformComponentApi.getPlatformComponentOverview']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * List platform components with monitoring and log query metadata * @summary List platform components * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listPlatformComponents(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.listPlatformComponents(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['PlatformComponentApi.listPlatformComponents']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * PlatformComponentApi - factory interface * @export */ export const PlatformComponentApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = PlatformComponentApiFp(configuration) return { /** * Get platform component detail by name, including monitoring and log query metadata * @summary Get platform component detail * @param {PlatformComponentApiGetPlatformComponentRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPlatformComponent(requestParameters: PlatformComponentApiGetPlatformComponentRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPlatformComponent(requestParameters.componentName, options).then((request) => request(axios, basePath)); }, /** * Get hosting nodes, node CPU and memory usage, component PVC statistics, and component Pod counts in the central Kubernetes cluster. Unavailable resource usage is reported as -1. * @summary Get platform component nodes and resource statistics * @param {*} [options] Override http request option. * @throws {RequiredError} */ getPlatformComponentOverview(options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getPlatformComponentOverview(options).then((request) => request(axios, basePath)); }, /** * List platform components with monitoring and log query metadata * @summary List platform components * @param {*} [options] Override http request option. * @throws {RequiredError} */ listPlatformComponents(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.listPlatformComponents(options).then((request) => request(axios, basePath)); }, }; }; /** * PlatformComponentApi - interface * @export * @interface PlatformComponentApi */ export interface PlatformComponentApiInterface { /** * Get platform component detail by name, including monitoring and log query metadata * @summary Get platform component detail * @param {PlatformComponentApiGetPlatformComponentRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PlatformComponentApiInterface */ getPlatformComponent(requestParameters: PlatformComponentApiGetPlatformComponentRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Get hosting nodes, node CPU and memory usage, component PVC statistics, and component Pod counts in the central Kubernetes cluster. Unavailable resource usage is reported as -1. * @summary Get platform component nodes and resource statistics * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PlatformComponentApiInterface */ getPlatformComponentOverview(options?: RawAxiosRequestConfig): AxiosPromise; /** * List platform components with monitoring and log query metadata * @summary List platform components * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PlatformComponentApiInterface */ listPlatformComponents(options?: RawAxiosRequestConfig): AxiosPromise>; } /** * Request parameters for getPlatformComponent operation in PlatformComponentApi. * @export * @interface PlatformComponentApiGetPlatformComponentRequest */ export interface PlatformComponentApiGetPlatformComponentRequest { /** * Platform component name * @type {string} * @memberof PlatformComponentApiGetPlatformComponent */ readonly componentName: string } /** * PlatformComponentApi - object-oriented interface * @export * @class PlatformComponentApi * @extends {BaseAPI} */ export class PlatformComponentApi extends BaseAPI implements PlatformComponentApiInterface { /** * Get platform component detail by name, including monitoring and log query metadata * @summary Get platform component detail * @param {PlatformComponentApiGetPlatformComponentRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PlatformComponentApi */ public getPlatformComponent(requestParameters: PlatformComponentApiGetPlatformComponentRequest, options?: RawAxiosRequestConfig) { return PlatformComponentApiFp(this.configuration).getPlatformComponent(requestParameters.componentName, options).then((request) => request(this.axios, this.basePath)); } /** * Get hosting nodes, node CPU and memory usage, component PVC statistics, and component Pod counts in the central Kubernetes cluster. Unavailable resource usage is reported as -1. * @summary Get platform component nodes and resource statistics * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PlatformComponentApi */ public getPlatformComponentOverview(options?: RawAxiosRequestConfig) { return PlatformComponentApiFp(this.configuration).getPlatformComponentOverview(options).then((request) => request(this.axios, this.basePath)); } /** * List platform components with monitoring and log query metadata * @summary List platform components * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof PlatformComponentApi */ public listPlatformComponents(options?: RawAxiosRequestConfig) { return PlatformComponentApiFp(this.configuration).listPlatformComponents(options).then((request) => request(this.axios, this.basePath)); } }