/** * Copyright 2022 Splunk, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"): you may * not use this file except in compliance with the License. You may obtain * a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the * License for the specific language governing permissions and limitations * under the License. * * Splunk Search service * Use the Search service in Splunk Cloud Services to dispatch, review, and manage searches and search jobs. You can finalize or cancel jobs, retrieve search results, and request search-related configurations from the Metadata Catalog service in Splunk Cloud Services. * * OpenAPI spec version: v3alpha1 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { Dataset, DatasetPOST, DeleteSearchJob, FederatedConnection, FederatedConnectionInput, FieldsSummary, ListDatasets, ListModules, ListPreviewResultsResponse, ListSearchResultsResponse, Module, SearchJob, SearchModule, SearchStatus, TimeBucketsSummary, UpdateJob } from '../models'; import BaseApiService from "../../../../baseapiservice"; import { SearchServiceExtensions } from "../../../../service_extensions/search"; import { RequestStatus } from '../../../../client'; export declare const SEARCH_SERVICE_PREFIX: string; export declare const SEARCH_SERVICE_CLUSTER: string; /** * @export */ export declare enum OutputModeEnum { Csv = "csv", Json = "json" } /** * Splunk Search service * Version: v3alpha1 * Use the Search service in Splunk Cloud Services to dispatch, review, and manage searches and search jobs. You can finalize or cancel jobs, retrieve search results, and request search-related configurations from the Metadata Catalog service in Splunk Cloud Services. */ export declare class GeneratedSearchService extends BaseApiService { getServiceCluster(): string; getServicePrefix(): string; /** * Creates a dataset. * @param datasetPOST * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Dataset */ createDataset: (datasetPOST?: DatasetPOST | undefined, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Creates a new federated connection with information about how to connect to a remote index. * @param federatedConnectionInput * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return FederatedConnection */ createFederatedConnection: (federatedConnectionInput?: FederatedConnectionInput | undefined, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Creates a search job. * @param searchJob * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return SearchJob */ createJob: (searchJob?: SearchJob | undefined, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Create a multi-statement module with inter-dependencies between statements. * @param searchModule * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return SearchModule */ createSearchStatements: (searchModule?: SearchModule | undefined, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Modifies/Creates a module with a specified resource name (resourceName). * @param resourceName The resource name. * @param module * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Module */ createSpl2Module: (resourceName: string, module?: Module | undefined, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Deletes a dataset with a specified dataset ID (datasetid). * @param datasetid The dataset ID. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ deleteDatasetById: (datasetid: string, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Deletes a federated connection with the specified name (connectionName) * @param connectionName The name of the federated connection. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ deleteFederatedConnection: (connectionName: string, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Creates a search job that deletes events from an index. The events are deleted from the index in the specified module, based on the search criteria as specified by the predicate. * @param deleteSearchJob * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return DeleteSearchJob */ deleteJob: (deleteSearchJob?: DeleteSearchJob | undefined, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Deletes a module with a specified resource name (resourceName). * @param resourceName The resource name. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Module */ deleteSpl2ModuleByResourceName: (resourceName: string, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Export the search results for the job with the specified search ID (SID). Export the results as a csv file or json file. * @param sid The search ID. * @param args parameters to be sent with the request * @param args.count The maximum number of entries to return. Set to 0 to return all available entries. * @param args.filename The export results filename. Default: exportResults * @param args.outputMode Specifies the format for the returned output. * @param requestStatusCallback callback function to listen to the status of a request * @return { [key: string]: any; } */ exportResults: (sid: string, args?: { [key: string]: any; count?: number | undefined; filename?: string | undefined; outputMode?: OutputModeEnum | undefined; } | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise<{ [key: string]: any; }>; /** * Returns all federated connections. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return ListFederatedConnections */ getAllFederatedConnections: (args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Returns a dataset with a specified dataset ID (datasetid). * @param datasetid The dataset ID. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Dataset */ getDatasetById: (datasetid: string, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Returns the federated connection with the specified name (connectionName). * @param connectionName The name of the federated connection. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return FederatedConnection */ getFederatedConnectionByName: (connectionName: string, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Returns a search job with a specified search ID (sid). * @param sid The search ID. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return SearchJob */ getJob: (sid: string, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Returns a module with a specified resource name (resourceName). * @param resourceName The resource name. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Module */ getSpl2ModuleByResourceName: (resourceName: string, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Returns a list of all datasets. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return ListDatasets */ listDatasets: (args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Return events summary, for search ID (SID) search. * @param sid The search ID. * @param args parameters to be sent with the request * @param args.count The maximum number of entries to return. Set to 0 to return all available entries. * @param args.earliest The earliest time filter, in absolute time. When specifying an absolute time specify either UNIX time, or UTC in seconds using the ISO-8601 (%FT%T.%Q) format. For example 2019-01-25T13:15:30Z. GMT is the default timezone. You must specify GMT when you specify UTC. Any offset specified is ignored. * @param args.field The field to return for the result set. Specify multiple fields of comma-separated values if multiple fields are required. * @param args.latest The latest time filter, in absolute time. When specifying an absolute time specify either UNIX time, or UTC in seconds using the ISO-8601 (%FT%T.%Q) format. For example 2019-01-25T13:15:30Z. GMT is the default timezone. You must specify GMT when you specify UTC. Any offset specified is ignored. Latest time must be after Earliest time. * @param args.offset The index of the first item to return. * @param requestStatusCallback callback function to listen to the status of a request * @return ListSearchResultsResponse */ listEventsSummary: (sid: string, args?: { [key: string]: any; count?: number | undefined; earliest?: string | undefined; field?: string | undefined; latest?: string | undefined; offset?: number | undefined; } | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Return fields stats summary of the events to-date, for search ID (SID) search. * @param sid The search ID. * @param args parameters to be sent with the request * @param args.earliest The earliest time filter, in absolute time. When specifying an absolute time specify either UNIX time, or UTC in seconds using the ISO-8601 (%FT%T.%Q) format. For example 2019-01-25T13:15:30Z. GMT is the default timezone. You must specify GMT when you specify UTC. Any offset specified is ignored. * @param args.latest The latest time filter, in absolute time. When specifying an absolute time specify either UNIX time, or UTC in seconds using the ISO-8601 (%FT%T.%Q) format. For example 2019-01-25T13:15:30Z. GMT is the default timezone. You must specify GMT when you specify UTC. Any offset specified is ignored. Latest time must be after Earliest time. * @param requestStatusCallback callback function to listen to the status of a request * @return FieldsSummary */ listFieldsSummary: (sid: string, args?: { [key: string]: any; earliest?: string | undefined; latest?: string | undefined; } | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Returns a matching list of search jobs. * @param args parameters to be sent with the request * @param args.count The maximum number of jobs that you want to return the status entries for. * @param args.filter Filter the list of jobs by sid. Valid format is `sid IN ({comma separated list of SIDs in quotes})`. A maximum of 30 SIDs can be specified in one query. * @param args.status Filter the list of jobs by status. Valid status values are 'running', 'done', 'canceled', or 'failed'. * @param requestStatusCallback callback function to listen to the status of a request * @return Array */ listJobs: (args?: { [key: string]: any; count?: number | undefined; filter?: string | undefined; status?: SearchStatus | undefined; } | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Return the preview search results for the job with the specified search ID (SID). Can be used when a job is running to return interim results. * @param sid The search ID. * @param args parameters to be sent with the request * @param args.count The maximum number of entries to return. Set to 0 to return all available entries. * @param args.offset The index of the first item to return. * @param requestStatusCallback callback function to listen to the status of a request * @return ListPreviewResultsResponse */ listPreviewResults: (sid: string, args?: { [key: string]: any; count?: number | undefined; offset?: number | undefined; } | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Returns search results for a job with a specified search ID (sid). * @param sid The search ID. * @param args parameters to be sent with the request * @param args.count The maximum number of entries to return. Set to 0 to return all available entries. * @param args.field The field to return for the result set. Specify multiple fields of comma-separated values if multiple fields are required. * @param args.offset The index of the first item to return. * @param requestStatusCallback callback function to listen to the status of a request * @return ListSearchResultsResponse */ listResults: (sid: string, args?: { [key: string]: any; count?: number | undefined; field?: string | undefined; offset?: number | undefined; } | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * gets a list of modules. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return ListModules */ listSpl2Modules: (args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Returns an event distribution over time of the untransformed events that are read to-date for a job with a specified search ID (sid). * @param sid The search ID. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return TimeBucketsSummary */ listTimeBuckets: (sid: string, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Creates or updates a federated connection with a specified name (connectionName). * @param connectionName The name of the federated connection. * @param federatedConnectionInput * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return FederatedConnection */ putFederatedConnectionByName: (connectionName: string, federatedConnectionInput?: FederatedConnectionInput | undefined, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Refresh a federated connection to fetch new remote indexes and add/delete corresponding federated datasets. * @param connectionName The name of the federated connection. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ refreshFederatedConnection: (connectionName: string, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Test connection with remote EC instance using federated connection parameters. * @param connectionName The name of the federated connection. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ testFederatedConnection: (connectionName: string, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Modifies a dataset with a specified dataset ID (datasetid). * @param datasetid The dataset ID. * @param datasetPATCH * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Dataset */ updateDatasetById: (datasetid: string, datasetPATCH?: import("../models").FederatedDatasetPATCH | import("../models").IndexDatasetPATCH | import("../models").KVCollectionDatasetPATCH | import("../models").LookupDatasetPATCH | import("../models").MetricDatasetPATCH | undefined, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; /** * Modifies a search job with a specified search ID (sid) with an action. * @param sid The search ID. * @param updateJob * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return SearchJob */ updateJob: (sid: string, updateJob?: UpdateJob | undefined, args?: object | undefined, requestStatusCallback?: ((requestStatus: RequestStatus) => void) | undefined) => Promise; } export declare type SearchService = GeneratedSearchService & SearchServiceExtensions; export declare const SearchService: { new (...args: any[]): { waitForJob(jobIn: J, pollInterval?: number | undefined, callback?: ((job: J) => object) | undefined): Promise; getJob(sid: string): Promise<{ sid?: string | undefined; status?: string | undefined; }>; }; } & typeof GeneratedSearchService;