/* 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 { ClustersSLA } from '../models'; // @ts-ignore import type { DailySLA } from '../models'; // @ts-ignore import type { OutageRecord } from '../models'; // @ts-ignore import type { SLA } from '../models'; // @ts-ignore import type { SLASettings } from '../models'; /** * SLAApi - axios parameter creator * @export */ export const SLAApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Calculate daily SLA for a environment or a cluster since a specific date * @summary Calculate daily SLA for a environment or a cluster since a specific date * @param {number} startTime SLA calculation start time Unix timestamp, unit is second. * @param {number} endTime SLA calculation end time Unix timestamp, unit is second. * @param {Array} [environmentName] name of the environment * @param {Array} [clusterID] id of the cluster * @param {Array} [engine] database engine type * @param {Array} [orgName] name of the organization * @param {number} [timezoneOffset] timezone offset in seconds, e.g. offset of UTC+08:00 is +8 * 60 * 60, default is 0 * @param {*} [options] Override http request option. * @throws {RequiredError} */ calculateDailySLA: async (startTime: number, endTime: number, environmentName?: Array, clusterID?: Array, engine?: Array, orgName?: Array, timezoneOffset?: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'startTime' is not null or undefined assertParamExists('calculateDailySLA', 'startTime', startTime) // verify required parameter 'endTime' is not null or undefined assertParamExists('calculateDailySLA', 'endTime', endTime) const localVarPath = `/admin/v1/sla/daily`; // 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) if (environmentName) { localVarQueryParameter['environmentName'] = environmentName; } if (startTime !== undefined) { localVarQueryParameter['startTime'] = startTime; } if (endTime !== undefined) { localVarQueryParameter['endTime'] = endTime; } if (clusterID) { localVarQueryParameter['clusterID'] = clusterID; } if (engine) { localVarQueryParameter['engine'] = engine; } if (orgName) { localVarQueryParameter['orgName'] = orgName; } if (timezoneOffset !== undefined) { localVarQueryParameter['timezoneOffset'] = timezoneOffset; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Calculate SLA for a environment * @summary Calculate SLA for a environment * @param {number} startTime SLA calculation start time Unix timestamp, unit is second. * @param {number} endTime SLA calculation end time Unix timestamp, unit is second. * @param {Array} [environmentName] name of the environment * @param {Array} [clusterID] id of the cluster * @param {Array} [engine] database engine type * @param {Array} [orgName] name of the organization * @param {string} [clusterNamePrefix] Filter clusters by name prefix (fuzzy search). * @param {number} [page] Page number for pagination, starts from 1. * @param {number} [pageSize] Number of items per page. * @param {string} [orderBy] Order by field, available values are \"clusterName\", \"engine\". * @param {boolean} [desc] Whether to sort in descending order. * @param {*} [options] Override http request option. * @throws {RequiredError} */ calculateSLA: async (startTime: number, endTime: number, environmentName?: Array, clusterID?: Array, engine?: Array, orgName?: Array, clusterNamePrefix?: string, page?: number, pageSize?: number, orderBy?: string, desc?: boolean, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'startTime' is not null or undefined assertParamExists('calculateSLA', 'startTime', startTime) // verify required parameter 'endTime' is not null or undefined assertParamExists('calculateSLA', 'endTime', endTime) const localVarPath = `/admin/v1/sla`; // 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) if (environmentName) { localVarQueryParameter['environmentName'] = environmentName; } if (clusterID) { localVarQueryParameter['clusterID'] = clusterID; } if (engine) { localVarQueryParameter['engine'] = engine; } if (orgName) { localVarQueryParameter['orgName'] = orgName; } if (startTime !== undefined) { localVarQueryParameter['startTime'] = startTime; } if (endTime !== undefined) { localVarQueryParameter['endTime'] = endTime; } if (clusterNamePrefix !== undefined) { localVarQueryParameter['clusterNamePrefix'] = clusterNamePrefix; } if (page !== undefined) { localVarQueryParameter['page'] = page; } if (pageSize !== undefined) { localVarQueryParameter['pageSize'] = pageSize; } if (orderBy !== undefined) { localVarQueryParameter['orderBy'] = orderBy; } if (desc !== undefined) { localVarQueryParameter['desc'] = desc; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get SLA settings in a environment * @summary Get SLA settings * @param {string} environmentName name of the environment * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSLASettingsInEnv: async (environmentName: string, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'environmentName' is not null or undefined assertParamExists('getSLASettingsInEnv', 'environmentName', environmentName) const localVarPath = `/admin/v1/sla/settings`; // 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) if (environmentName !== undefined) { localVarQueryParameter['environmentName'] = environmentName; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Get SLA supported engines in a environment * @summary Get SLA supported engines * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSLASupportEngines: async (options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/admin/v1/sla/engines`; // 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 outage record for environments * @summary List outage record for environments * @param {string} [environmentName] name of the environment, if not specified, return all environments * @param {string} [orgName] name of the organization * @param {string} [clusterID] id of the cluster * @param {boolean} [activeOnly] whether to return only active outage records * @param {*} [options] Override http request option. * @throws {RequiredError} */ listEnvironmentOutageRecord: async (environmentName?: string, orgName?: string, clusterID?: string, activeOnly?: boolean, options: RawAxiosRequestConfig = {}): Promise => { const localVarPath = `/admin/v1/sla/outages`; // 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) if (environmentName !== undefined) { localVarQueryParameter['environmentName'] = environmentName; } if (orgName !== undefined) { localVarQueryParameter['orgName'] = orgName; } if (clusterID !== undefined) { localVarQueryParameter['clusterID'] = clusterID; } if (activeOnly !== undefined) { localVarQueryParameter['activeOnly'] = activeOnly; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * List SLA rank for a environment * @summary List SLA rank for a environment * @param {number} startTime SLA calculation start time Unix timestamp, unit is second. * @param {number} endTime SLA calculation end time Unix timestamp, unit is second. * @param {Array} [environmentName] name of the environment * @param {Array} [engine] database engine type * @param {Array} [orgName] name of the organization * @param {number} [limit] Number of items per page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listSLARank: async (startTime: number, endTime: number, environmentName?: Array, engine?: Array, orgName?: Array, limit?: number, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'startTime' is not null or undefined assertParamExists('listSLARank', 'startTime', startTime) // verify required parameter 'endTime' is not null or undefined assertParamExists('listSLARank', 'endTime', endTime) const localVarPath = `/admin/v1/sla/rank`; // 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) if (environmentName) { localVarQueryParameter['environmentName'] = environmentName; } if (engine) { localVarQueryParameter['engine'] = engine; } if (orgName) { localVarQueryParameter['orgName'] = orgName; } if (startTime !== undefined) { localVarQueryParameter['startTime'] = startTime; } if (endTime !== undefined) { localVarQueryParameter['endTime'] = endTime; } if (limit !== undefined) { localVarQueryParameter['limit'] = limit; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * List uncompliant clusters that sla lower than the threshold * @summary List uncompliant clusters * @param {number} startTime SLA calculation start time Unix timestamp, unit is second. * @param {number} endTime SLA calculation end time Unix timestamp, unit is second. * @param {Array} [environmentName] name of the environment * @param {Array} [engine] database engine type * @param {Array} [orgName] name of the organization * @param {*} [options] Override http request option. * @throws {RequiredError} */ listUncompliantClusters: async (startTime: number, endTime: number, environmentName?: Array, engine?: Array, orgName?: Array, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'startTime' is not null or undefined assertParamExists('listUncompliantClusters', 'startTime', startTime) // verify required parameter 'endTime' is not null or undefined assertParamExists('listUncompliantClusters', 'endTime', endTime) const localVarPath = `/admin/v1/sla/uncompliant`; // 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) if (environmentName) { localVarQueryParameter['environmentName'] = environmentName; } if (engine) { localVarQueryParameter['engine'] = engine; } if (orgName) { localVarQueryParameter['orgName'] = orgName; } if (startTime !== undefined) { localVarQueryParameter['startTime'] = startTime; } if (endTime !== undefined) { localVarQueryParameter['endTime'] = endTime; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * Update SLA settings in a environment * @summary Update SLA settings * @param {string} environmentName name of the environment * @param {SLASettings} sLASettings * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSLASettingsInEnv: async (environmentName: string, sLASettings: SLASettings, options: RawAxiosRequestConfig = {}): Promise => { // verify required parameter 'environmentName' is not null or undefined assertParamExists('updateSLASettingsInEnv', 'environmentName', environmentName) // verify required parameter 'sLASettings' is not null or undefined assertParamExists('updateSLASettingsInEnv', 'sLASettings', sLASettings) const localVarPath = `/admin/v1/sla/settings`; // 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: 'PATCH', ...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) if (environmentName !== undefined) { localVarQueryParameter['environmentName'] = environmentName; } localVarHeaderParameter['Content-Type'] = 'application/json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; localVarRequestOptions.data = serializeDataIfNeeded(sLASettings, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, } }; /** * SLAApi - functional programming interface * @export */ export const SLAApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = SLAApiAxiosParamCreator(configuration) return { /** * Calculate daily SLA for a environment or a cluster since a specific date * @summary Calculate daily SLA for a environment or a cluster since a specific date * @param {number} startTime SLA calculation start time Unix timestamp, unit is second. * @param {number} endTime SLA calculation end time Unix timestamp, unit is second. * @param {Array} [environmentName] name of the environment * @param {Array} [clusterID] id of the cluster * @param {Array} [engine] database engine type * @param {Array} [orgName] name of the organization * @param {number} [timezoneOffset] timezone offset in seconds, e.g. offset of UTC+08:00 is +8 * 60 * 60, default is 0 * @param {*} [options] Override http request option. * @throws {RequiredError} */ async calculateDailySLA(startTime: number, endTime: number, environmentName?: Array, clusterID?: Array, engine?: Array, orgName?: Array, timezoneOffset?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.calculateDailySLA(startTime, endTime, environmentName, clusterID, engine, orgName, timezoneOffset, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SLAApi.calculateDailySLA']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Calculate SLA for a environment * @summary Calculate SLA for a environment * @param {number} startTime SLA calculation start time Unix timestamp, unit is second. * @param {number} endTime SLA calculation end time Unix timestamp, unit is second. * @param {Array} [environmentName] name of the environment * @param {Array} [clusterID] id of the cluster * @param {Array} [engine] database engine type * @param {Array} [orgName] name of the organization * @param {string} [clusterNamePrefix] Filter clusters by name prefix (fuzzy search). * @param {number} [page] Page number for pagination, starts from 1. * @param {number} [pageSize] Number of items per page. * @param {string} [orderBy] Order by field, available values are \"clusterName\", \"engine\". * @param {boolean} [desc] Whether to sort in descending order. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async calculateSLA(startTime: number, endTime: number, environmentName?: Array, clusterID?: Array, engine?: Array, orgName?: Array, clusterNamePrefix?: string, page?: number, pageSize?: number, orderBy?: string, desc?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.calculateSLA(startTime, endTime, environmentName, clusterID, engine, orgName, clusterNamePrefix, page, pageSize, orderBy, desc, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SLAApi.calculateSLA']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Get SLA settings in a environment * @summary Get SLA settings * @param {string} environmentName name of the environment * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSLASettingsInEnv(environmentName: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSLASettingsInEnv(environmentName, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SLAApi.getSLASettingsInEnv']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Get SLA supported engines in a environment * @summary Get SLA supported engines * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getSLASupportEngines(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.getSLASupportEngines(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SLAApi.getSLASupportEngines']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * List outage record for environments * @summary List outage record for environments * @param {string} [environmentName] name of the environment, if not specified, return all environments * @param {string} [orgName] name of the organization * @param {string} [clusterID] id of the cluster * @param {boolean} [activeOnly] whether to return only active outage records * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listEnvironmentOutageRecord(environmentName?: string, orgName?: string, clusterID?: string, activeOnly?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.listEnvironmentOutageRecord(environmentName, orgName, clusterID, activeOnly, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SLAApi.listEnvironmentOutageRecord']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * List SLA rank for a environment * @summary List SLA rank for a environment * @param {number} startTime SLA calculation start time Unix timestamp, unit is second. * @param {number} endTime SLA calculation end time Unix timestamp, unit is second. * @param {Array} [environmentName] name of the environment * @param {Array} [engine] database engine type * @param {Array} [orgName] name of the organization * @param {number} [limit] Number of items per page. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listSLARank(startTime: number, endTime: number, environmentName?: Array, engine?: Array, orgName?: Array, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.listSLARank(startTime, endTime, environmentName, engine, orgName, limit, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SLAApi.listSLARank']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * List uncompliant clusters that sla lower than the threshold * @summary List uncompliant clusters * @param {number} startTime SLA calculation start time Unix timestamp, unit is second. * @param {number} endTime SLA calculation end time Unix timestamp, unit is second. * @param {Array} [environmentName] name of the environment * @param {Array} [engine] database engine type * @param {Array} [orgName] name of the organization * @param {*} [options] Override http request option. * @throws {RequiredError} */ async listUncompliantClusters(startTime: number, endTime: number, environmentName?: Array, engine?: Array, orgName?: Array, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { const localVarAxiosArgs = await localVarAxiosParamCreator.listUncompliantClusters(startTime, endTime, environmentName, engine, orgName, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SLAApi.listUncompliantClusters']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Update SLA settings in a environment * @summary Update SLA settings * @param {string} environmentName name of the environment * @param {SLASettings} sLASettings * @param {*} [options] Override http request option. * @throws {RequiredError} */ async updateSLASettingsInEnv(environmentName: string, sLASettings: SLASettings, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { const localVarAxiosArgs = await localVarAxiosParamCreator.updateSLASettingsInEnv(environmentName, sLASettings, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['SLAApi.updateSLASettingsInEnv']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** * SLAApi - factory interface * @export */ export const SLAApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = SLAApiFp(configuration) return { /** * Calculate daily SLA for a environment or a cluster since a specific date * @summary Calculate daily SLA for a environment or a cluster since a specific date * @param {SLAApiCalculateDailySLARequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ calculateDailySLA(requestParameters: SLAApiCalculateDailySLARequest, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.calculateDailySLA(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.clusterID, requestParameters.engine, requestParameters.orgName, requestParameters.timezoneOffset, options).then((request) => request(axios, basePath)); }, /** * Calculate SLA for a environment * @summary Calculate SLA for a environment * @param {SLAApiCalculateSLARequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ calculateSLA(requestParameters: SLAApiCalculateSLARequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.calculateSLA(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.clusterID, requestParameters.engine, requestParameters.orgName, requestParameters.clusterNamePrefix, requestParameters.page, requestParameters.pageSize, requestParameters.orderBy, requestParameters.desc, options).then((request) => request(axios, basePath)); }, /** * Get SLA settings in a environment * @summary Get SLA settings * @param {SLAApiGetSLASettingsInEnvRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSLASettingsInEnv(requestParameters: SLAApiGetSLASettingsInEnvRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.getSLASettingsInEnv(requestParameters.environmentName, options).then((request) => request(axios, basePath)); }, /** * Get SLA supported engines in a environment * @summary Get SLA supported engines * @param {*} [options] Override http request option. * @throws {RequiredError} */ getSLASupportEngines(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getSLASupportEngines(options).then((request) => request(axios, basePath)); }, /** * List outage record for environments * @summary List outage record for environments * @param {SLAApiListEnvironmentOutageRecordRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listEnvironmentOutageRecord(requestParameters: SLAApiListEnvironmentOutageRecordRequest = {}, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.listEnvironmentOutageRecord(requestParameters.environmentName, requestParameters.orgName, requestParameters.clusterID, requestParameters.activeOnly, options).then((request) => request(axios, basePath)); }, /** * List SLA rank for a environment * @summary List SLA rank for a environment * @param {SLAApiListSLARankRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listSLARank(requestParameters: SLAApiListSLARankRequest, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.listSLARank(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.engine, requestParameters.orgName, requestParameters.limit, options).then((request) => request(axios, basePath)); }, /** * List uncompliant clusters that sla lower than the threshold * @summary List uncompliant clusters * @param {SLAApiListUncompliantClustersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ listUncompliantClusters(requestParameters: SLAApiListUncompliantClustersRequest, options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.listUncompliantClusters(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.engine, requestParameters.orgName, options).then((request) => request(axios, basePath)); }, /** * Update SLA settings in a environment * @summary Update SLA settings * @param {SLAApiUpdateSLASettingsInEnvRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} */ updateSLASettingsInEnv(requestParameters: SLAApiUpdateSLASettingsInEnvRequest, options?: RawAxiosRequestConfig): AxiosPromise { return localVarFp.updateSLASettingsInEnv(requestParameters.environmentName, requestParameters.sLASettings, options).then((request) => request(axios, basePath)); }, }; }; /** * SLAApi - interface * @export * @interface SLAApi */ export interface SLAApiInterface { /** * Calculate daily SLA for a environment or a cluster since a specific date * @summary Calculate daily SLA for a environment or a cluster since a specific date * @param {SLAApiCalculateDailySLARequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApiInterface */ calculateDailySLA(requestParameters: SLAApiCalculateDailySLARequest, options?: RawAxiosRequestConfig): AxiosPromise>; /** * Calculate SLA for a environment * @summary Calculate SLA for a environment * @param {SLAApiCalculateSLARequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApiInterface */ calculateSLA(requestParameters: SLAApiCalculateSLARequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Get SLA settings in a environment * @summary Get SLA settings * @param {SLAApiGetSLASettingsInEnvRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApiInterface */ getSLASettingsInEnv(requestParameters: SLAApiGetSLASettingsInEnvRequest, options?: RawAxiosRequestConfig): AxiosPromise; /** * Get SLA supported engines in a environment * @summary Get SLA supported engines * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApiInterface */ getSLASupportEngines(options?: RawAxiosRequestConfig): AxiosPromise>; /** * List outage record for environments * @summary List outage record for environments * @param {SLAApiListEnvironmentOutageRecordRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApiInterface */ listEnvironmentOutageRecord(requestParameters?: SLAApiListEnvironmentOutageRecordRequest, options?: RawAxiosRequestConfig): AxiosPromise>; /** * List SLA rank for a environment * @summary List SLA rank for a environment * @param {SLAApiListSLARankRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApiInterface */ listSLARank(requestParameters: SLAApiListSLARankRequest, options?: RawAxiosRequestConfig): AxiosPromise>; /** * List uncompliant clusters that sla lower than the threshold * @summary List uncompliant clusters * @param {SLAApiListUncompliantClustersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApiInterface */ listUncompliantClusters(requestParameters: SLAApiListUncompliantClustersRequest, options?: RawAxiosRequestConfig): AxiosPromise>; /** * Update SLA settings in a environment * @summary Update SLA settings * @param {SLAApiUpdateSLASettingsInEnvRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApiInterface */ updateSLASettingsInEnv(requestParameters: SLAApiUpdateSLASettingsInEnvRequest, options?: RawAxiosRequestConfig): AxiosPromise; } /** * Request parameters for calculateDailySLA operation in SLAApi. * @export * @interface SLAApiCalculateDailySLARequest */ export interface SLAApiCalculateDailySLARequest { /** * SLA calculation start time Unix timestamp, unit is second. * @type {number} * @memberof SLAApiCalculateDailySLA */ readonly startTime: number /** * SLA calculation end time Unix timestamp, unit is second. * @type {number} * @memberof SLAApiCalculateDailySLA */ readonly endTime: number /** * name of the environment * @type {Array} * @memberof SLAApiCalculateDailySLA */ readonly environmentName?: Array /** * id of the cluster * @type {Array} * @memberof SLAApiCalculateDailySLA */ readonly clusterID?: Array /** * database engine type * @type {Array} * @memberof SLAApiCalculateDailySLA */ readonly engine?: Array /** * name of the organization * @type {Array} * @memberof SLAApiCalculateDailySLA */ readonly orgName?: Array /** * timezone offset in seconds, e.g. offset of UTC+08:00 is +8 * 60 * 60, default is 0 * @type {number} * @memberof SLAApiCalculateDailySLA */ readonly timezoneOffset?: number } /** * Request parameters for calculateSLA operation in SLAApi. * @export * @interface SLAApiCalculateSLARequest */ export interface SLAApiCalculateSLARequest { /** * SLA calculation start time Unix timestamp, unit is second. * @type {number} * @memberof SLAApiCalculateSLA */ readonly startTime: number /** * SLA calculation end time Unix timestamp, unit is second. * @type {number} * @memberof SLAApiCalculateSLA */ readonly endTime: number /** * name of the environment * @type {Array} * @memberof SLAApiCalculateSLA */ readonly environmentName?: Array /** * id of the cluster * @type {Array} * @memberof SLAApiCalculateSLA */ readonly clusterID?: Array /** * database engine type * @type {Array} * @memberof SLAApiCalculateSLA */ readonly engine?: Array /** * name of the organization * @type {Array} * @memberof SLAApiCalculateSLA */ readonly orgName?: Array /** * Filter clusters by name prefix (fuzzy search). * @type {string} * @memberof SLAApiCalculateSLA */ readonly clusterNamePrefix?: string /** * Page number for pagination, starts from 1. * @type {number} * @memberof SLAApiCalculateSLA */ readonly page?: number /** * Number of items per page. * @type {number} * @memberof SLAApiCalculateSLA */ readonly pageSize?: number /** * Order by field, available values are \"clusterName\", \"engine\". * @type {string} * @memberof SLAApiCalculateSLA */ readonly orderBy?: string /** * Whether to sort in descending order. * @type {boolean} * @memberof SLAApiCalculateSLA */ readonly desc?: boolean } /** * Request parameters for getSLASettingsInEnv operation in SLAApi. * @export * @interface SLAApiGetSLASettingsInEnvRequest */ export interface SLAApiGetSLASettingsInEnvRequest { /** * name of the environment * @type {string} * @memberof SLAApiGetSLASettingsInEnv */ readonly environmentName: string } /** * Request parameters for listEnvironmentOutageRecord operation in SLAApi. * @export * @interface SLAApiListEnvironmentOutageRecordRequest */ export interface SLAApiListEnvironmentOutageRecordRequest { /** * name of the environment, if not specified, return all environments * @type {string} * @memberof SLAApiListEnvironmentOutageRecord */ readonly environmentName?: string /** * name of the organization * @type {string} * @memberof SLAApiListEnvironmentOutageRecord */ readonly orgName?: string /** * id of the cluster * @type {string} * @memberof SLAApiListEnvironmentOutageRecord */ readonly clusterID?: string /** * whether to return only active outage records * @type {boolean} * @memberof SLAApiListEnvironmentOutageRecord */ readonly activeOnly?: boolean } /** * Request parameters for listSLARank operation in SLAApi. * @export * @interface SLAApiListSLARankRequest */ export interface SLAApiListSLARankRequest { /** * SLA calculation start time Unix timestamp, unit is second. * @type {number} * @memberof SLAApiListSLARank */ readonly startTime: number /** * SLA calculation end time Unix timestamp, unit is second. * @type {number} * @memberof SLAApiListSLARank */ readonly endTime: number /** * name of the environment * @type {Array} * @memberof SLAApiListSLARank */ readonly environmentName?: Array /** * database engine type * @type {Array} * @memberof SLAApiListSLARank */ readonly engine?: Array /** * name of the organization * @type {Array} * @memberof SLAApiListSLARank */ readonly orgName?: Array /** * Number of items per page. * @type {number} * @memberof SLAApiListSLARank */ readonly limit?: number } /** * Request parameters for listUncompliantClusters operation in SLAApi. * @export * @interface SLAApiListUncompliantClustersRequest */ export interface SLAApiListUncompliantClustersRequest { /** * SLA calculation start time Unix timestamp, unit is second. * @type {number} * @memberof SLAApiListUncompliantClusters */ readonly startTime: number /** * SLA calculation end time Unix timestamp, unit is second. * @type {number} * @memberof SLAApiListUncompliantClusters */ readonly endTime: number /** * name of the environment * @type {Array} * @memberof SLAApiListUncompliantClusters */ readonly environmentName?: Array /** * database engine type * @type {Array} * @memberof SLAApiListUncompliantClusters */ readonly engine?: Array /** * name of the organization * @type {Array} * @memberof SLAApiListUncompliantClusters */ readonly orgName?: Array } /** * Request parameters for updateSLASettingsInEnv operation in SLAApi. * @export * @interface SLAApiUpdateSLASettingsInEnvRequest */ export interface SLAApiUpdateSLASettingsInEnvRequest { /** * name of the environment * @type {string} * @memberof SLAApiUpdateSLASettingsInEnv */ readonly environmentName: string /** * * @type {SLASettings} * @memberof SLAApiUpdateSLASettingsInEnv */ readonly sLASettings: SLASettings } /** * SLAApi - object-oriented interface * @export * @class SLAApi * @extends {BaseAPI} */ export class SLAApi extends BaseAPI implements SLAApiInterface { /** * Calculate daily SLA for a environment or a cluster since a specific date * @summary Calculate daily SLA for a environment or a cluster since a specific date * @param {SLAApiCalculateDailySLARequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApi */ public calculateDailySLA(requestParameters: SLAApiCalculateDailySLARequest, options?: RawAxiosRequestConfig) { return SLAApiFp(this.configuration).calculateDailySLA(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.clusterID, requestParameters.engine, requestParameters.orgName, requestParameters.timezoneOffset, options).then((request) => request(this.axios, this.basePath)); } /** * Calculate SLA for a environment * @summary Calculate SLA for a environment * @param {SLAApiCalculateSLARequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApi */ public calculateSLA(requestParameters: SLAApiCalculateSLARequest, options?: RawAxiosRequestConfig) { return SLAApiFp(this.configuration).calculateSLA(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.clusterID, requestParameters.engine, requestParameters.orgName, requestParameters.clusterNamePrefix, requestParameters.page, requestParameters.pageSize, requestParameters.orderBy, requestParameters.desc, options).then((request) => request(this.axios, this.basePath)); } /** * Get SLA settings in a environment * @summary Get SLA settings * @param {SLAApiGetSLASettingsInEnvRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApi */ public getSLASettingsInEnv(requestParameters: SLAApiGetSLASettingsInEnvRequest, options?: RawAxiosRequestConfig) { return SLAApiFp(this.configuration).getSLASettingsInEnv(requestParameters.environmentName, options).then((request) => request(this.axios, this.basePath)); } /** * Get SLA supported engines in a environment * @summary Get SLA supported engines * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApi */ public getSLASupportEngines(options?: RawAxiosRequestConfig) { return SLAApiFp(this.configuration).getSLASupportEngines(options).then((request) => request(this.axios, this.basePath)); } /** * List outage record for environments * @summary List outage record for environments * @param {SLAApiListEnvironmentOutageRecordRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApi */ public listEnvironmentOutageRecord(requestParameters: SLAApiListEnvironmentOutageRecordRequest = {}, options?: RawAxiosRequestConfig) { return SLAApiFp(this.configuration).listEnvironmentOutageRecord(requestParameters.environmentName, requestParameters.orgName, requestParameters.clusterID, requestParameters.activeOnly, options).then((request) => request(this.axios, this.basePath)); } /** * List SLA rank for a environment * @summary List SLA rank for a environment * @param {SLAApiListSLARankRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApi */ public listSLARank(requestParameters: SLAApiListSLARankRequest, options?: RawAxiosRequestConfig) { return SLAApiFp(this.configuration).listSLARank(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.engine, requestParameters.orgName, requestParameters.limit, options).then((request) => request(this.axios, this.basePath)); } /** * List uncompliant clusters that sla lower than the threshold * @summary List uncompliant clusters * @param {SLAApiListUncompliantClustersRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApi */ public listUncompliantClusters(requestParameters: SLAApiListUncompliantClustersRequest, options?: RawAxiosRequestConfig) { return SLAApiFp(this.configuration).listUncompliantClusters(requestParameters.startTime, requestParameters.endTime, requestParameters.environmentName, requestParameters.engine, requestParameters.orgName, options).then((request) => request(this.axios, this.basePath)); } /** * Update SLA settings in a environment * @summary Update SLA settings * @param {SLAApiUpdateSLASettingsInEnvRequest} requestParameters Request parameters. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof SLAApi */ public updateSLASettingsInEnv(requestParameters: SLAApiUpdateSLASettingsInEnvRequest, options?: RawAxiosRequestConfig) { return SLAApiFp(this.configuration).updateSLASettingsInEnv(requestParameters.environmentName, requestParameters.sLASettings, options).then((request) => request(this.axios, this.basePath)); } }