diff --git a/src/datasource-zabbix/zabbix/connectors/zabbix_api/types.ts b/src/datasource-zabbix/zabbix/connectors/zabbix_api/types.ts index 57e4423ca..83038be13 100644 --- a/src/datasource-zabbix/zabbix/connectors/zabbix_api/types.ts +++ b/src/datasource-zabbix/zabbix/connectors/zabbix_api/types.ts @@ -19,14 +19,6 @@ export interface JSONRPCError { data?: string; } -export interface GFHTTPRequest { - method: HTTPMethod; - url: string; - data?: any; - headers?: {[key: string]: string}; - withCredentials?: boolean; -} - export type JSONRPCRequestParams = {[key: string]: any}; export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'HEAD' | 'CONNECT' | 'OPTIONS' | 'TRACE'; diff --git a/src/datasource-zabbix/zabbix/connectors/zabbix_api/zabbixAPIConnector.ts b/src/datasource-zabbix/zabbix/connectors/zabbix_api/zabbixAPIConnector.ts index b197f92fe..39905e2bc 100644 --- a/src/datasource-zabbix/zabbix/connectors/zabbix_api/zabbixAPIConnector.ts +++ b/src/datasource-zabbix/zabbix/connectors/zabbix_api/zabbixAPIConnector.ts @@ -4,8 +4,8 @@ import kbn from 'grafana/app/core/utils/kbn'; import * as utils from '../../../utils'; import { ZBX_ACK_ACTION_NONE, ZBX_ACK_ACTION_ADD_MESSAGE, MIN_SLA_INTERVAL } from '../../../constants'; import { ShowProblemTypes, ZBXProblem } from '../../../types'; -import { GFHTTPRequest, JSONRPCError, ZBXScript, APIExecuteScriptResponse } from './types'; -import { getBackendSrv } from '@grafana/runtime'; +import { JSONRPCError, ZBXScript, APIExecuteScriptResponse } from './types'; +import { BackendSrvRequest, getBackendSrv } from '@grafana/runtime'; const DEFAULT_ZABBIX_VERSION = '3.0.0'; @@ -48,12 +48,13 @@ export class ZabbixAPIConnector { } backendAPIRequest(method: string, params: any = {}) { - const requestOptions: GFHTTPRequest = { + const requestOptions: BackendSrvRequest = { url: this.backendAPIUrl, method: 'POST', headers: { 'Content-Type': 'application/json' }, + hideFromInspector: false, data: { datasourceId: this.datasourceId, method,