/** * Dynatrace Configuration API * Documentation of the Dynatrace Configuration API. Refer to the [help page](https://www.dynatrace.com/support/help/shortlink/config-api) to read about use-cases and examples. Notes about compatibility: * Operations marked as early adopter or preview may be changed in non-compatible ways, although we try to avoid this. * We may add new enum constants without incrementing the API version; thus, clients need to handle unknown enum constants gracefully. * * The version of the OpenAPI document: 1.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 localVarRequest = require('request'); import http = require('http'); /* tslint:disable:no-unused-locals */ import { EntityShortRepresentation } from '../model/entityShortRepresentation'; import { ErrorEnvelope } from '../model/errorEnvelope'; import { Extension } from '../model/extension'; import { ExtensionConfigurationDto } from '../model/extensionConfigurationDto'; import { ExtensionConfigurationList } from '../model/extensionConfigurationList'; import { ExtensionListDto } from '../model/extensionListDto'; import { ExtensionStateList } from '../model/extensionStateList'; import { GlobalExtensionConfiguration } from '../model/globalExtensionConfiguration'; import { HostList } from '../model/hostList'; import { StubList } from '../model/stubList'; import { ObjectSerializer, Authentication, VoidAuth, Interceptor } from '../model/models'; import { HttpBasicAuth, HttpBearerAuth, ApiKeyAuth, OAuth } from '../model/models'; import { HttpError, RequestFile } from './apis'; let defaultBasePath = 'https://dynatrace.nonprod.jbhunt.com/e/2063b0c9-e776-4494-9095-10036c37e2ab/api/config/v1'; // =============================================== // This file is autogenerated - Please do not edit // =============================================== export enum ExtensionsApiApiKeys { Api-Token, } export class ExtensionsApi { protected _basePath = defaultBasePath; protected _defaultHeaders : any = {}; protected _useQuerystring : boolean = false; protected authentications = { 'default': new VoidAuth(), 'Api-Token': new ApiKeyAuth('header', 'Authorization'), } protected interceptors: Interceptor[] = []; constructor(basePath?: string); constructor(basePathOrUsername: string, password?: string, basePath?: string) { if (password) { if (basePath) { this.basePath = basePath; } } else { if (basePathOrUsername) { this.basePath = basePathOrUsername } } } set useQuerystring(value: boolean) { this._useQuerystring = value; } set basePath(basePath: string) { this._basePath = basePath; } set defaultHeaders(defaultHeaders: any) { this._defaultHeaders = defaultHeaders; } get defaultHeaders() { return this._defaultHeaders; } get basePath() { return this._basePath; } public setDefaultAuthentication(auth: Authentication) { this.authentications.default = auth; } public setApiKey(key: ExtensionsApiApiKeys, value: string) { (this.authentications as any)[ExtensionsApiApiKeys[key]].apiKey = value; } public addInterceptor(interceptor: Interceptor) { this.interceptors.push(interceptor); } /** * * @summary Creates instance of local configuration for given extension | maturity=EARLY_ADOPTER * @param id The ID of the extension * @param extensionConfigurationDto The JSON body of the request. Contains new configuration of the extension. */ public async createLocalExtensionConfiguration (id: string, extensionConfigurationDto?: ExtensionConfigurationDto, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: EntityShortRepresentation; }> { const localVarPath = this.basePath + '/extensions/{id}/instances' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling createLocalExtensionConfiguration.'); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(extensionConfigurationDto, "ExtensionConfigurationDto") }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: EntityShortRepresentation; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "EntityShortRepresentation"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * Deletion of the extension file uninstalls the extension, making it unavailable for use. * @summary Deletes the ZIP file of the specified extension | maturity=EARLY_ADOPTER * @param id The ID of the extension to be deleted. */ public async deleteExtension (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/extensions/{id}' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling deleteExtension.'); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Deletes an existing configuration of the extension | maturity=EARLY_ADOPTER * @param id The ID of the extension where you want to delete the configuration. * @param configurationId The ID of the configuration to be deleted. */ public async deleteLocalExtensionConfiguration (id: string, configurationId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/extensions/{id}/instances/{configurationId}' .replace('{' + 'id' + '}', encodeURIComponent(String(id))) .replace('{' + 'configurationId' + '}', encodeURIComponent(String(configurationId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling deleteLocalExtensionConfiguration.'); } // verify required parameter 'configurationId' is not null or undefined if (configurationId === null || configurationId === undefined) { throw new Error('Required parameter configurationId was null or undefined when calling deleteLocalExtensionConfiguration.'); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'DELETE', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Lists the properties of the specified extension | maturity=EARLY_ADOPTER * @param id The ID of the required extension. */ public async getExtension (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: Extension; }> { const localVarPath = this.basePath + '/extensions/{id}' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getExtension.'); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: Extension; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "Extension"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Downloads the ZIP file of the specified extension | maturity=EARLY_ADOPTER * @param id The ID of the extension you want to download. */ public async getExtensionBinary (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/extensions/{id}/binary' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getExtensionBinary.'); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Returns list of all local configuration instances for given extension | maturity=EARLY_ADOPTER * @param id The ID of the required extension. * @param pageSize The number of results per result page. Must be between 1 and 500 * @param nextPageKey The cursor for the next page of results. */ public async getExtensionConfigurations (id: string, pageSize?: number, nextPageKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: ExtensionConfigurationList; }> { const localVarPath = this.basePath + '/extensions/{id}/instances' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getExtensionConfigurations.'); } if (pageSize !== undefined) { localVarQueryParameters['pageSize'] = ObjectSerializer.serialize(pageSize, "number"); } if (nextPageKey !== undefined) { localVarQueryParameters['nextPageKey'] = ObjectSerializer.serialize(nextPageKey, "string"); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: ExtensionConfigurationList; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionConfigurationList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Get the global configuration of the specified OneAgent or JMX extension | maturity=EARLY_ADOPTER * @param id The ID of the extension to be updated. */ public async getExtensionGlobalConfiguration (id: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: GlobalExtensionConfiguration; }> { const localVarPath = this.basePath + '/extensions/{id}/global' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getExtensionGlobalConfiguration.'); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: GlobalExtensionConfiguration; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "GlobalExtensionConfiguration"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Lists the states of the specified extension | maturity=EARLY_ADOPTER * @param id The ID of the required extension. * @param pageSize The number of results per result page. Must be between 1 and 500 * @param nextPageKey The cursor for the next page of results. * @param state Extension state to filter. */ public async getExtensionStates (id: string, pageSize?: number, nextPageKey?: string, state?: 'DISABLED' | 'ERROR_AUTH' | 'ERROR_COMMUNICATION_FAILURE' | 'ERROR_CONFIG' | 'ERROR_TIMEOUT' | 'ERROR_UNKNOWN' | 'INCOMPATIBLE' | 'LIMIT_REACHED' | 'NOTHING_TO_REPORT' | 'OK' | 'STATE_TYPE_UNKNOWN' | 'UNINITIALIZED' | 'UNSUPPORTED' | 'WAITING_FOR_STATE', options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: ExtensionStateList; }> { const localVarPath = this.basePath + '/extensions/{id}/states' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getExtensionStates.'); } if (pageSize !== undefined) { localVarQueryParameters['pageSize'] = ObjectSerializer.serialize(pageSize, "number"); } if (nextPageKey !== undefined) { localVarQueryParameters['nextPageKey'] = ObjectSerializer.serialize(nextPageKey, "string"); } if (state !== undefined) { localVarQueryParameters['state'] = ObjectSerializer.serialize(state, "'DISABLED' | 'ERROR_AUTH' | 'ERROR_COMMUNICATION_FAILURE' | 'ERROR_CONFIG' | 'ERROR_TIMEOUT' | 'ERROR_UNKNOWN' | 'INCOMPATIBLE' | 'LIMIT_REACHED' | 'NOTHING_TO_REPORT' | 'OK' | 'STATE_TYPE_UNKNOWN' | 'UNINITIALIZED' | 'UNSUPPORTED' | 'WAITING_FOR_STATE'"); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: ExtensionStateList; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionStateList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Lists all uploaded extensions | maturity=EARLY_ADOPTER * @param pageSize The number of results per result page. Must be between 1 and 500 * @param nextPageKey The cursor for the next page of results. */ public async getExtensions (pageSize?: number, nextPageKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: ExtensionListDto; }> { const localVarPath = this.basePath + '/extensions'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; if (pageSize !== undefined) { localVarQueryParameters['pageSize'] = ObjectSerializer.serialize(pageSize, "number"); } if (nextPageKey !== undefined) { localVarQueryParameters['nextPageKey'] = ObjectSerializer.serialize(nextPageKey, "string"); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: ExtensionListDto; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionListDto"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Lists all available hosts that have specified technology running | maturity=EARLY_ADOPTER * @param technology Name of requested technology * @param tag Filters the resulting set of hosts by the specified tag. You can specify several tags in the following format: `tag=tag1&tag=tag2`. The host has to match **all** the specified tags. * @param managementZone Only return hosts that are part of the specified management zone. * @param hostGroupId Filters the resulting set of hosts by the specified host group. Specify the Dynatrace IDs of the host group you\'re interested in. * @param hostGroupName Filters the resulting set of hosts by the specified host group. Specify the name of the host group you\'re interested in. * @param pageSize The number of results per result page. Must be between 1 and 500 * @param nextPageKey The cursor for the next page of results. */ public async getHostsForTechnology (technology: 'ACTIVE_MQ' | 'ACTIVE_MQ_ARTEMIS' | 'ADO_NET' | 'AIX' | 'AKKA' | 'AMAZON_REDSHIFT' | 'AMQP' | 'APACHE_CAMEL' | 'APACHE_CASSANDRA' | 'APACHE_COUCH_DB' | 'APACHE_DERBY' | 'APACHE_HTTP_CLIENT_ASYNC' | 'APACHE_HTTP_CLIENT_SYNC' | 'APACHE_HTTP_SERVER' | 'APACHE_KAFKA' | 'APACHE_SOLR' | 'APACHE_STORM' | 'APACHE_SYNAPSE' | 'APACHE_TOMCAT' | 'APPARMOR' | 'APPLICATION_INSIGHTS_SDK' | 'ASP_DOTNET' | 'ASP_DOTNET_CORE' | 'ASP_DOTNET_CORE_SIGNALR' | 'ASP_DOTNET_SIGNALR' | 'AWS_LAMBDA' | 'AWS_RDS' | 'AWS_SERVICE' | 'AXIS' | 'AZURE_FUNCTIONS' | 'AZURE_SERVICE_BUS' | 'AZURE_SERVICE_FABRIC' | 'AZURE_STORAGE' | 'BOSHBPM' | 'CITRIX' | 'CITRIX_COMMON' | 'CITRIX_DESKTOP_DELIVERY_CONTROLLERS' | 'CITRIX_DIRECTOR' | 'CITRIX_LICENSE_SERVER' | 'CITRIX_PROVISIONING_SERVICES' | 'CITRIX_STOREFRONT' | 'CITRIX_VIRTUAL_DELIVERY_AGENT' | 'CITRIX_WORKSPACE_ENVIRONMENT_MANAGEMENT' | 'CLOUDFOUNDRY' | 'CLOUDFOUNDRY_AUCTIONEER' | 'CLOUDFOUNDRY_BOSH' | 'CLOUDFOUNDRY_GOROUTER' | 'COLDFUSION' | 'CONTAINERD' | 'CORE_DNS' | 'COUCHBASE' | 'CRIO' | 'CXF' | 'DATASTAX' | 'DB2' | 'DIEGO_CELL' | 'DOCKER' | 'DOTNET' | 'DOTNET_REMOTING' | 'ELASTIC_SEARCH' | 'ENVOY' | 'ERLANG' | 'ETCD' | 'F5_LTM' | 'FSHARP' | 'GARDEN' | 'GLASSFISH' | 'GO' | 'GRPC' | 'GRSECURITY' | 'HADOOP' | 'HADOOP_HDFS' | 'HADOOP_YARN' | 'HAPROXY' | 'HEAT' | 'HESSIAN' | 'HORNET_Q' | 'IBM_CICS_REGION' | 'IBM_CICS_TRANSACTION_GATEWAY' | 'IBM_IMS_CONNECT_REGION' | 'IBM_IMS_CONTROL_REGION' | 'IBM_IMS_MESSAGE_PROCESSING_REGION' | 'IBM_IMS_SOAP_GATEWAY' | 'IBM_INTEGRATION_BUS' | 'IBM_MQ' | 'IBM_MQ_CLIENT' | 'IBM_WEBSHPRERE_APPLICATION_SERVER' | 'IBM_WEBSHPRERE_LIBERTY' | 'IIS' | 'IIS_APP_POOL' | 'ISTIO' | 'JAVA' | 'JAX_WS' | 'JBOSS' | 'JBOSS_EAP' | 'JDK_HTTP_SERVER' | 'JERSEY' | 'JETTY' | 'JRUBY' | 'JYTHON' | 'KUBERNETES' | 'LIBVIRT' | 'LINKERD' | 'MARIADB' | 'MEMCACHED' | 'MICROSOFT_SQL_SERVER' | 'MONGODB' | 'MSSQL_CLIENT' | 'MULE_ESB' | 'MYSQL' | 'MYSQL_CONNECTOR' | 'NETFLIX_SERVO' | 'NETTY' | 'NGINX' | 'NODE_JS' | 'ONEAGENT_SDK' | 'OPENCENSUS' | 'OPENSHIFT' | 'OPENSTACK_COMPUTE' | 'OPENSTACK_CONTROLLER' | 'OPENTELEMETRY' | 'OPENTRACING' | 'OPEN_LIBERTY' | 'ORACLE_DATABASE' | 'ORACLE_WEBLOGIC' | 'OWIN' | 'PERL' | 'PHP' | 'PHP_FPM' | 'PLAY' | 'POSTGRE_SQL' | 'POSTGRE_SQL_DOTNET_DATA_PROVIDER' | 'POWER_DNS' | 'PROGRESS' | 'PYTHON' | 'RABBIT_MQ' | 'REDIS' | 'RESTEASY' | 'RESTLET' | 'RIAK' | 'RUBY' | 'SAG_WEBMETHODS_IS' | 'SAP' | 'SAP_HANADB' | 'SAP_HYBRIS' | 'SAP_MAXDB' | 'SAP_SYBASE' | 'SCALA' | 'SELINUX' | 'SHAREPOINT' | 'SPARK' | 'SPRING' | 'SQLITE' | 'THRIFT' | 'TIBCO' | 'TIBCO_BUSINESS_WORKS' | 'TIBCO_EMS' | 'VARNISH_CACHE' | 'VIM2' | 'VIRTUAL_MACHINE_KVM' | 'VIRTUAL_MACHINE_QEMU' | 'WILDFLY' | 'WINDOWS_CONTAINERS' | 'WINK' | 'ZERO_MQ', tag?: Array, managementZone?: number, hostGroupId?: string, hostGroupName?: string, pageSize?: number, nextPageKey?: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: HostList; }> { const localVarPath = this.basePath + '/extensions/{technology}/availableHosts' .replace('{' + 'technology' + '}', encodeURIComponent(String(technology))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'technology' is not null or undefined if (technology === null || technology === undefined) { throw new Error('Required parameter technology was null or undefined when calling getHostsForTechnology.'); } if (tag !== undefined) { localVarQueryParameters['tag'] = ObjectSerializer.serialize(tag, "Array"); } if (managementZone !== undefined) { localVarQueryParameters['managementZone'] = ObjectSerializer.serialize(managementZone, "number"); } if (hostGroupId !== undefined) { localVarQueryParameters['hostGroupId'] = ObjectSerializer.serialize(hostGroupId, "string"); } if (hostGroupName !== undefined) { localVarQueryParameters['hostGroupName'] = ObjectSerializer.serialize(hostGroupName, "string"); } if (pageSize !== undefined) { localVarQueryParameters['pageSize'] = ObjectSerializer.serialize(pageSize, "number"); } if (nextPageKey !== undefined) { localVarQueryParameters['nextPageKey'] = ObjectSerializer.serialize(nextPageKey, "string"); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: HostList; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "HostList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Returns instance of local configuration for given extension | maturity=EARLY_ADOPTER * @param id The ID of the extension. * @param configurationId The ID of the configuration. */ public async getLocalExtensionConfiguration (id: string, configurationId: string, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: ExtensionConfigurationDto; }> { const localVarPath = this.basePath + '/extensions/{id}/instances/{configurationId}' .replace('{' + 'id' + '}', encodeURIComponent(String(id))) .replace('{' + 'configurationId' + '}', encodeURIComponent(String(configurationId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getLocalExtensionConfiguration.'); } // verify required parameter 'configurationId' is not null or undefined if (configurationId === null || configurationId === undefined) { throw new Error('Required parameter configurationId was null or undefined when calling getLocalExtensionConfiguration.'); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: ExtensionConfigurationDto; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "ExtensionConfigurationDto"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary List available ActiveGate extension modules | maturity=EARLY_ADOPTER */ public async getRemoteExtensionModules (options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: StubList; }> { const localVarPath = this.basePath + '/extensions/activeGateExtensionModules'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'GET', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: StubList; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "StubList"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Updates the configuration of the specified OneAgent or JMX extension | maturity=EARLY_ADOPTER * @param id The ID of the extension to be updated. * @param globalExtensionConfiguration The JSON body of the request. Contains updated configuration of the extension. */ public async updateGlobalExtensionConfiguration (id: string, globalExtensionConfiguration?: GlobalExtensionConfiguration, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/extensions/{id}/global' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling updateGlobalExtensionConfiguration.'); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(globalExtensionConfiguration, "GlobalExtensionConfiguration") }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Updates instance of local configuration for given extension | maturity=EARLY_ADOPTER * @param id The ID of the extension where you want to update the configuration. If you set the extension ID in the body as well, it must match this ID. * @param configurationId The ID of the configuration to be updated. * @param extensionConfigurationDto The JSON body of the request. Contains updated parameters of the extension configuration. */ public async updateLocalExtensionConfiguration (id: string, configurationId: string, extensionConfigurationDto?: ExtensionConfigurationDto, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/extensions/{id}/instances/{configurationId}' .replace('{' + 'id' + '}', encodeURIComponent(String(id))) .replace('{' + 'configurationId' + '}', encodeURIComponent(String(configurationId))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling updateLocalExtensionConfiguration.'); } // verify required parameter 'configurationId' is not null or undefined if (configurationId === null || configurationId === undefined) { throw new Error('Required parameter configurationId was null or undefined when calling updateLocalExtensionConfiguration.'); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'PUT', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(extensionConfigurationDto, "ExtensionConfigurationDto") }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Uploads a ZIP extension file | maturity=EARLY_ADOPTER * @param file Extension ZIP file to be uploaded. File name must match the **name** field in the `plugin.json` file. For example, for the extension whose **name** is `custom.remote.python.demo`, the name of the extension file must be `custom.remote.python.demo.zip`. * @param overrideAlerts Use extension-defined thresholds for alerts (`true`) or user-defined thresholds (`false`). Extension-defined thresholds are stored in the `plugin.json` file. If not set, user-defined thresholds are used. */ public async uploadExtension (file: RequestFile, overrideAlerts?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body: EntityShortRepresentation; }> { const localVarPath = this.basePath + '/extensions'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'file' is not null or undefined if (file === null || file === undefined) { throw new Error('Required parameter file was null or undefined when calling uploadExtension.'); } if (overrideAlerts !== undefined) { localVarQueryParameters['overrideAlerts'] = ObjectSerializer.serialize(overrideAlerts, "boolean"); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; if (file !== undefined) { localVarFormParams['file'] = file; } localVarUseFormData = true; let localVarRequestOptions: localVarRequest.Options = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body: EntityShortRepresentation; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { body = ObjectSerializer.deserialize(body, "EntityShortRepresentation"); if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Validates a ZIP extension file for `POST/extensions` request | maturity=EARLY_ADOPTER * @param file The ZIP extension file to be uploaded. The file name must match the ID of the extension. Example: `custom.remote.python.demo.zip` * @param jsonOnly Validate only the `plugin.json` file (`true`) or the entire extension structure (`false`). If not set, the entire extension is validated. */ public async validateExtension (file: RequestFile, jsonOnly?: boolean, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/extensions/validator'; let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'file' is not null or undefined if (file === null || file === undefined) { throw new Error('Required parameter file was null or undefined when calling validateExtension.'); } if (jsonOnly !== undefined) { localVarQueryParameters['jsonOnly'] = ObjectSerializer.serialize(jsonOnly, "boolean"); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; if (file !== undefined) { localVarFormParams['file'] = file; } localVarUseFormData = true; let localVarRequestOptions: localVarRequest.Options = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } /** * * @summary Validates the payload for the `POST /extensions/{id}/instances` request | maturity=EARLY_ADOPTER * @param id The ID of the extension. * @param extensionConfigurationDto The JSON body of the request. Contains new configuration of the extension to be validated. */ public async validateLocalExtensionConfiguration (id: string, extensionConfigurationDto?: ExtensionConfigurationDto, options: {headers: {[name: string]: string}} = {headers: {}}) : Promise<{ response: http.ClientResponse; body?: any; }> { const localVarPath = this.basePath + '/extensions/{id}/instances/validator' .replace('{' + 'id' + '}', encodeURIComponent(String(id))); let localVarQueryParameters: any = {}; let localVarHeaderParams: any = (Object).assign({}, this._defaultHeaders); const produces = ['application/json; charset=utf-8']; // give precedence to 'application/json' if (produces.indexOf('application/json') >= 0) { localVarHeaderParams.Accept = 'application/json'; } else { localVarHeaderParams.Accept = produces.join(','); } let localVarFormParams: any = {}; // verify required parameter 'id' is not null or undefined if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling validateLocalExtensionConfiguration.'); } (Object).assign(localVarHeaderParams, options.headers); let localVarUseFormData = false; let localVarRequestOptions: localVarRequest.Options = { method: 'POST', qs: localVarQueryParameters, headers: localVarHeaderParams, uri: localVarPath, useQuerystring: this._useQuerystring, json: true, body: ObjectSerializer.serialize(extensionConfigurationDto, "ExtensionConfigurationDto") }; let authenticationPromise = Promise.resolve(); if (this.authentications.Api-Token.apiKey) { authenticationPromise = authenticationPromise.then(() => this.authentications.Api-Token.applyToRequest(localVarRequestOptions)); } authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions)); let interceptorPromise = authenticationPromise; for (const interceptor of this.interceptors) { interceptorPromise = interceptorPromise.then(() => interceptor(localVarRequestOptions)); } return interceptorPromise.then(() => { if (Object.keys(localVarFormParams).length) { if (localVarUseFormData) { (localVarRequestOptions).formData = localVarFormParams; } else { localVarRequestOptions.form = localVarFormParams; } } return new Promise<{ response: http.ClientResponse; body?: any; }>((resolve, reject) => { localVarRequest(localVarRequestOptions, (error, response, body) => { if (error) { reject(error); } else { if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) { resolve({ response: response, body: body }); } else { reject(new HttpError(response, body, response.statusCode)); } } }); }); }); } }