/* tslint:disable */ /* eslint-disable */ /** * KubeBlocks Cloud Internal API * The Internal API is using for interaction of ApeCloud platform microservices. * * The version of the OpenAPI document: 1.0.0 * * * 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 { Cluster } from '../models'; // @ts-ignore import type { VictoriaLogsConfig } from '../models'; /** * VictoriaLogsClusterApi - axios parameter creator * @export */ export const VictoriaLogsClusterApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Create VictoriaLogs with optional per-component resources and retention, or attach an existing cluster. Reuse does not apply component overrides or retention changes. Omitted components keep installer defaults on create. * @summary Create VictoriaLogs cluster * @param {string} environmentName name of the environment * @param {VictoriaLogsConfig} [victoriaLogsConfig] * @param {*} [options] Override http request option. * @throws {RequiredError} */ createVictoriaLogsCluster: async (environmentName: string, victoriaLogsConfig?: VictoriaLogsConfig, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'environmentName' is not null or undefined assertParamExists('createVictoriaLogsCluster', 'environmentName', environmentName) const localVarPath = `/internal/v1/environments/{environmentName}/victoriaLogsCluster` .replace(`{${"environmentName"}}`, encodeURIComponent(String(environmentName))); // 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: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication BasicAuth required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(victoriaLogsConfig, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * VictoriaLogsClusterApi - functional programming interface * @export */ export const VictoriaLogsClusterApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = VictoriaLogsClusterApiAxiosParamCreator(configuration) return { /** * Create VictoriaLogs with optional per-component resources and retention, or attach an existing cluster. Reuse does not apply component overrides or retention changes. Omitted components keep installer defaults on create. * @summary Create VictoriaLogs cluster * @param {string} environmentName name of the environment * @param {VictoriaLogsConfig} [victoriaLogsConfig] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createVictoriaLogsCluster(environmentName: string, victoriaLogsConfig?: VictoriaLogsConfig, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createVictoriaLogsCluster(environmentName, victoriaLogsConfig, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['VictoriaLogsClusterApi.createVictoriaLogsCluster']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * VictoriaLogsClusterApi - factory interface * @export */ export const VictoriaLogsClusterApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = VictoriaLogsClusterApiFp(configuration) return { /** * Create VictoriaLogs with optional per-component resources and retention, or attach an existing cluster. Reuse does not apply component overrides or retention changes. Omitted components keep installer defaults on create. * @summary Create VictoriaLogs cluster * @param {VictoriaLogsClusterApiCreateVictoriaLogsClusterRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createVictoriaLogsCluster(requestParameters: VictoriaLogsClusterApiCreateVictoriaLogsClusterRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createVictoriaLogsCluster(requestParameters.environmentName, requestParameters.victoriaLogsConfig, options).then((request) => request(axios, basePath)); }, }; }; /** * VictoriaLogsClusterApi - interface * @export * @interface VictoriaLogsClusterApi */ export interface VictoriaLogsClusterApiInterface { /** * Create VictoriaLogs with optional per-component resources and retention, or attach an existing cluster. Reuse does not apply component overrides or retention changes. Omitted components keep installer defaults on create. * @summary Create VictoriaLogs cluster * @param {VictoriaLogsClusterApiCreateVictoriaLogsClusterRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VictoriaLogsClusterApiInterface */ createVictoriaLogsCluster(requestParameters: VictoriaLogsClusterApiCreateVictoriaLogsClusterRequest, options?: RawAxiosRequestConfig): AxiosPromise; } /** * Request parameters for createVictoriaLogsCluster operation in VictoriaLogsClusterApi. * @export * @interface VictoriaLogsClusterApiCreateVictoriaLogsClusterRequest */ export interface VictoriaLogsClusterApiCreateVictoriaLogsClusterRequest { /** * name of the environment * @type {string} * @memberof VictoriaLogsClusterApiCreateVictoriaLogsCluster */ readonly environmentName: string /** * * @type {VictoriaLogsConfig} * @memberof VictoriaLogsClusterApiCreateVictoriaLogsCluster */ readonly victoriaLogsConfig?: VictoriaLogsConfig } /** * VictoriaLogsClusterApi - object-oriented interface * @export * @class VictoriaLogsClusterApi * @extends {BaseAPI} */ export class VictoriaLogsClusterApi extends BaseAPI implements VictoriaLogsClusterApiInterface { /** * Create VictoriaLogs with optional per-component resources and retention, or attach an existing cluster. Reuse does not apply component overrides or retention changes. Omitted components keep installer defaults on create. * @summary Create VictoriaLogs cluster * @param {VictoriaLogsClusterApiCreateVictoriaLogsClusterRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VictoriaLogsClusterApi */ public createVictoriaLogsCluster(requestParameters: VictoriaLogsClusterApiCreateVictoriaLogsClusterRequest, options?: RawAxiosRequestConfig) { return VictoriaLogsClusterApiFp(this.configuration).createVictoriaLogsCluster(requestParameters.environmentName, requestParameters.victoriaLogsConfig, options).then((request) => request(this.axios, this.basePath)); } }