/* 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 { VipPool } from '../models'; // @ts-ignore import type { VipPoolCreate } from '../models'; // @ts-ignore import type { VipPoolList } from '../models'; // @ts-ignore import type { VipPoolUpdate } from '../models'; // @ts-ignore import type { VipPortCheckRequest } from '../models'; // @ts-ignore import type { VipPortCheckResult } from '../models'; /** * VipPoolApi - axios parameter creator * @export */ export const VipPoolApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * * @summary Check whether ports are already used on a VIP * @param {string} environmentName name of the environment * @param {VipPortCheckRequest} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ checkVIPPorts: async (environmentName: string, body: VipPortCheckRequest, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'environmentName' is not null or undefined assertParamExists('checkVIPPorts', 'environmentName', environmentName) // verify required parameter 'body' is not null or undefined assertParamExists('checkVIPPorts', 'body', body) const localVarPath = `/admin/v1/environments/{environmentName}/loadbalancer/vipPool/checkPorts` .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 BearerToken required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) // authentication DigestAuth required await setApiKeyToObject(localVarHeaderParameter, "Authorization", 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(body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Create environment VIP Pool * @param {string} environmentName name of the environment * @param {VipPoolCreate} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ createVIPPool: async (environmentName: string, body: VipPoolCreate, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'environmentName' is not null or undefined assertParamExists('createVIPPool', 'environmentName', environmentName) // verify required parameter 'body' is not null or undefined assertParamExists('createVIPPool', 'body', body) const localVarPath = `/admin/v1/environments/{environmentName}/loadbalancer/vipPool` .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 BearerToken required // http bearer authentication required await setBearerAuthToObject(localVarHeaderParameter, configuration) // authentication DigestAuth required await setApiKeyToObject(localVarHeaderParameter, "Authorization", 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(body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Delete environment VIP Pool * @param {string} environmentName name of the environment * @param {string} poolID id of the VIP Pool * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteVIPPool: async (environmentName: string, poolID: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'environmentName' is not null or undefined assertParamExists('deleteVIPPool', 'environmentName', environmentName) // verify required parameter 'poolID' is not null or undefined assertParamExists('deleteVIPPool', 'poolID', poolID) const localVarPath = `/admin/v1/environments/{environmentName}/loadbalancer/vipPool/{poolID}` .replace(`{${"environmentName"}}`, encodeURIComponent(String(environmentName))) .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); // 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: 'DELETE', ...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, }; }, /** * * @summary List environment VIP Pools * @param {string} environmentName name of the environment * @param {*} [options] Override http request option. * @throws {RequiredError} */ listVIPPool: async (environmentName: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'environmentName' is not null or undefined assertParamExists('listVIPPool', 'environmentName', environmentName) const localVarPath = `/admin/v1/environments/{environmentName}/loadbalancer/vipPool` .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: '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, }; }, /** * * @summary Update environment VIP Pool * @param {string} environmentName name of the environment * @param {string} poolID id of the VIP Pool * @param {VipPoolUpdate} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateVIPPool: async (environmentName: string, poolID: string, body: VipPoolUpdate, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'environmentName' is not null or undefined assertParamExists('updateVIPPool', 'environmentName', environmentName) // verify required parameter 'poolID' is not null or undefined assertParamExists('updateVIPPool', 'poolID', poolID) // verify required parameter 'body' is not null or undefined assertParamExists('updateVIPPool', 'body', body) const localVarPath = `/admin/v1/environments/{environmentName}/loadbalancer/vipPool/{poolID}` .replace(`{${"environmentName"}}`, encodeURIComponent(String(environmentName))) .replace(`{${"poolID"}}`, encodeURIComponent(String(poolID))); // 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: 'PUT', ...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) localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * VipPoolApi - functional programming interface * @export */ export const VipPoolApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = VipPoolApiAxiosParamCreator(configuration) return { /** * * @summary Check whether ports are already used on a VIP * @param {string} environmentName name of the environment * @param {VipPortCheckRequest} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async checkVIPPorts(environmentName: string, body: VipPortCheckRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.checkVIPPorts(environmentName, body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['VipPoolApi.checkVIPPorts']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Create environment VIP Pool * @param {string} environmentName name of the environment * @param {VipPoolCreate} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createVIPPool(environmentName: string, body: VipPoolCreate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.createVIPPool(environmentName, body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['VipPoolApi.createVIPPool']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Delete environment VIP Pool * @param {string} environmentName name of the environment * @param {string} poolID id of the VIP Pool * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteVIPPool(environmentName: string, poolID: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteVIPPool(environmentName, poolID, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['VipPoolApi.deleteVIPPool']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary List environment VIP Pools * @param {string} environmentName name of the environment * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listVIPPool(environmentName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.listVIPPool(environmentName, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['VipPoolApi.listVIPPool']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Update environment VIP Pool * @param {string} environmentName name of the environment * @param {string} poolID id of the VIP Pool * @param {VipPoolUpdate} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateVIPPool(environmentName: string, poolID: string, body: VipPoolUpdate, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateVIPPool(environmentName, poolID, body, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['VipPoolApi.updateVIPPool']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * VipPoolApi - factory interface * @export */ export const VipPoolApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = VipPoolApiFp(configuration) return { /** * * @summary Check whether ports are already used on a VIP * @param {VipPoolApiCheckVIPPortsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ checkVIPPorts(requestParameters: VipPoolApiCheckVIPPortsRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.checkVIPPorts(requestParameters.environmentName, requestParameters.body, options).then((request) => request(axios, basePath)); }, /** * * @summary Create environment VIP Pool * @param {VipPoolApiCreateVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createVIPPool(requestParameters: VipPoolApiCreateVIPPoolRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.createVIPPool(requestParameters.environmentName, requestParameters.body, options).then((request) => request(axios, basePath)); }, /** * * @summary Delete environment VIP Pool * @param {VipPoolApiDeleteVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteVIPPool(requestParameters: VipPoolApiDeleteVIPPoolRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.deleteVIPPool(requestParameters.environmentName, requestParameters.poolID, options).then((request) => request(axios, basePath)); }, /** * * @summary List environment VIP Pools * @param {VipPoolApiListVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listVIPPool(requestParameters: VipPoolApiListVIPPoolRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.listVIPPool(requestParameters.environmentName, options).then((request) => request(axios, basePath)); }, /** * * @summary Update environment VIP Pool * @param {VipPoolApiUpdateVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateVIPPool(requestParameters: VipPoolApiUpdateVIPPoolRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateVIPPool(requestParameters.environmentName, requestParameters.poolID, requestParameters.body, options).then((request) => request(axios, basePath)); }, }; }; /** * VipPoolApi - interface * @export * @interface VipPoolApi */ export interface VipPoolApiInterface { /** * * @summary Check whether ports are already used on a VIP * @param {VipPoolApiCheckVIPPortsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VipPoolApiInterface */ checkVIPPorts(requestParameters: VipPoolApiCheckVIPPortsRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * * @summary Create environment VIP Pool * @param {VipPoolApiCreateVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VipPoolApiInterface */ createVIPPool(requestParameters: VipPoolApiCreateVIPPoolRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * * @summary Delete environment VIP Pool * @param {VipPoolApiDeleteVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VipPoolApiInterface */ deleteVIPPool(requestParameters: VipPoolApiDeleteVIPPoolRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * * @summary List environment VIP Pools * @param {VipPoolApiListVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VipPoolApiInterface */ listVIPPool(requestParameters: VipPoolApiListVIPPoolRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * * @summary Update environment VIP Pool * @param {VipPoolApiUpdateVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VipPoolApiInterface */ updateVIPPool(requestParameters: VipPoolApiUpdateVIPPoolRequest, options?: RawAxiosRequestConfig): AxiosPromise; } /** * Request parameters for checkVIPPorts operation in VipPoolApi. * @export * @interface VipPoolApiCheckVIPPortsRequest */ export interface VipPoolApiCheckVIPPortsRequest { /** * name of the environment * @type {string} * @memberof VipPoolApiCheckVIPPorts */ readonly environmentName: string /** * * @type {VipPortCheckRequest} * @memberof VipPoolApiCheckVIPPorts */ readonly body: VipPortCheckRequest } /** * Request parameters for createVIPPool operation in VipPoolApi. * @export * @interface VipPoolApiCreateVIPPoolRequest */ export interface VipPoolApiCreateVIPPoolRequest { /** * name of the environment * @type {string} * @memberof VipPoolApiCreateVIPPool */ readonly environmentName: string /** * * @type {VipPoolCreate} * @memberof VipPoolApiCreateVIPPool */ readonly body: VipPoolCreate } /** * Request parameters for deleteVIPPool operation in VipPoolApi. * @export * @interface VipPoolApiDeleteVIPPoolRequest */ export interface VipPoolApiDeleteVIPPoolRequest { /** * name of the environment * @type {string} * @memberof VipPoolApiDeleteVIPPool */ readonly environmentName: string /** * id of the VIP Pool * @type {string} * @memberof VipPoolApiDeleteVIPPool */ readonly poolID: string } /** * Request parameters for listVIPPool operation in VipPoolApi. * @export * @interface VipPoolApiListVIPPoolRequest */ export interface VipPoolApiListVIPPoolRequest { /** * name of the environment * @type {string} * @memberof VipPoolApiListVIPPool */ readonly environmentName: string } /** * Request parameters for updateVIPPool operation in VipPoolApi. * @export * @interface VipPoolApiUpdateVIPPoolRequest */ export interface VipPoolApiUpdateVIPPoolRequest { /** * name of the environment * @type {string} * @memberof VipPoolApiUpdateVIPPool */ readonly environmentName: string /** * id of the VIP Pool * @type {string} * @memberof VipPoolApiUpdateVIPPool */ readonly poolID: string /** * * @type {VipPoolUpdate} * @memberof VipPoolApiUpdateVIPPool */ readonly body: VipPoolUpdate } /** * VipPoolApi - object-oriented interface * @export * @class VipPoolApi * @extends {BaseAPI} */ export class VipPoolApi extends BaseAPI implements VipPoolApiInterface { /** * * @summary Check whether ports are already used on a VIP * @param {VipPoolApiCheckVIPPortsRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VipPoolApi */ public checkVIPPorts(requestParameters: VipPoolApiCheckVIPPortsRequest, options?: RawAxiosRequestConfig) { return VipPoolApiFp(this.configuration).checkVIPPorts(requestParameters.environmentName, requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Create environment VIP Pool * @param {VipPoolApiCreateVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VipPoolApi */ public createVIPPool(requestParameters: VipPoolApiCreateVIPPoolRequest, options?: RawAxiosRequestConfig) { return VipPoolApiFp(this.configuration).createVIPPool(requestParameters.environmentName, requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Delete environment VIP Pool * @param {VipPoolApiDeleteVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VipPoolApi */ public deleteVIPPool(requestParameters: VipPoolApiDeleteVIPPoolRequest, options?: RawAxiosRequestConfig) { return VipPoolApiFp(this.configuration).deleteVIPPool(requestParameters.environmentName, requestParameters.poolID, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary List environment VIP Pools * @param {VipPoolApiListVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VipPoolApi */ public listVIPPool(requestParameters: VipPoolApiListVIPPoolRequest, options?: RawAxiosRequestConfig) { return VipPoolApiFp(this.configuration).listVIPPool(requestParameters.environmentName, options).then((request) => request(this.axios, this.basePath)); } /** * * @summary Update environment VIP Pool * @param {VipPoolApiUpdateVIPPoolRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof VipPoolApi */ public updateVIPPool(requestParameters: VipPoolApiUpdateVIPPoolRequest, options?: RawAxiosRequestConfig) { return VipPoolApiFp(this.configuration).updateVIPPool(requestParameters.environmentName, requestParameters.poolID, requestParameters.body, options).then((request) => request(this.axios, this.basePath)); } }