// tslint:disable /** * 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. * * Data Stream Processing REST API * Use the Streams service to perform create, read, update, and delete (CRUD) operations on your data pipeline. The Streams service also has metrics and preview session endpoints and gives you full control over your data pipeline. * * OpenAPI spec version: v2beta1.4 * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { ActivatePipelineRequest, ConnectionPatchRequest, ConnectionPutRequest, ConnectionRequest, ConnectionSaveResponse, DeactivatePipelineRequest, DslCompilationRequest, GetInputSchemaRequest, GetOutputSchemaRequest, GroupExpandRequest, GroupPatchRequest, GroupPutRequest, GroupRequest, GroupResponse, MetricsResponse, PaginatedResponseOfConnectionResponse, PaginatedResponseOfConnectorResponse, PaginatedResponseOfPipelineJobStatus, PaginatedResponseOfPipelineResponse, PaginatedResponseOfTemplateResponse, PipelineDeleteResponse, PipelinePatchRequest, PipelineReactivateResponse, PipelineRequest, PipelineResponse, PipelinesMergeRequest, PreviewData, PreviewSessionStartRequest, PreviewStartResponse, PreviewState, ReactivatePipelineRequest, Response, SplCompileRequest, TemplatePatchRequest, TemplatePutRequest, TemplateRequest, TemplateResponse, UplPipeline, UplRegistry, UplType, ValidateRequest, ValidateResponse, } from '../models'; import BaseApiService from "../../../../baseapiservice"; import { StreamsServiceExtensions } from "../../../../service_extensions/streams"; import { SplunkError, RequestStatus } from '../../../../client'; export const STREAMS_SERVICE_PREFIX: string = '/streams/v2beta1'; export const STREAMS_SERVICE_CLUSTER: string = 'api'; /** * Data Stream Processing REST API * Version: v2beta1.4 * Use the Streams service to perform create, read, update, and delete (CRUD) operations on your data pipeline. The Streams service also has metrics and preview session endpoints and gives you full control over your data pipeline. */ export class GeneratedStreamsService extends BaseApiService { getServiceCluster() : string { return STREAMS_SERVICE_CLUSTER } getServicePrefix() : string { return STREAMS_SERVICE_PREFIX; } /** * Activates an existing pipeline. * @param id id of the pipeline to activate * @param activatePipelineRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Response */ public activatePipeline = (id: string, activatePipelineRequest: ActivatePipelineRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { id: id }; const path = this.template`/streams/v2beta1/pipelines/${'id'}/activate`(path_params); return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), activatePipelineRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Response); } /** * Compiles the Streams DSL and returns Streams JSON. * @param dslCompilationRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return UplPipeline */ public compileDSL = (dslCompilationRequest: DslCompilationRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/pipelines/compile-dsl`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), dslCompilationRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as UplPipeline); } /** * Compiles SPL2 and returns Streams JSON. * @param splCompileRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return UplPipeline */ public compileSPL = (splCompileRequest: SplCompileRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/pipelines/compile-spl`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), splCompileRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as UplPipeline); } /** * Create a new DSP connection. * @param connectionRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return ConnectionSaveResponse */ public createConnection = (connectionRequest: ConnectionRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/connections`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), connectionRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as ConnectionSaveResponse); } /** * Create a new group function by combining the Streams JSON of two or more functions. * @param groupRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return GroupResponse */ public createGroup = (groupRequest: GroupRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/groups`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), groupRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as GroupResponse); } /** * Creates a pipeline. * @param pipelineRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return PipelineResponse */ public createPipeline = (pipelineRequest: PipelineRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/pipelines`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), pipelineRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PipelineResponse); } /** * Creates a template for a tenant. * @param templateRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return TemplateResponse */ public createTemplate = (templateRequest: TemplateRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/templates`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), templateRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as TemplateResponse); } /** * Deactivates an existing pipeline. * @param id id of the pipeline to deactivate * @param deactivatePipelineRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return Response */ public deactivatePipeline = (id: string, deactivatePipelineRequest: DeactivatePipelineRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { id: id }; const path = this.template`/streams/v2beta1/pipelines/${'id'}/deactivate`(path_params); return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), deactivatePipelineRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as Response); } /** * Delete all versions of a connection by its id. * @param connectionId ID of the connection * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteConnection = (connectionId: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { connectionId: connectionId }; const path = this.template`/streams/v2beta1/connections/${'connectionId'}`(path_params); return this.client.delete(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Removes an existing group. * @param groupId The group function's ID from the function registry * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteGroup = (groupId: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { groupId: groupId }; const path = this.template`/streams/v2beta1/groups/${'groupId'}`(path_params); return this.client.delete(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Removes a pipeline. * @param id id of the pipeline to delete * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return PipelineDeleteResponse */ public deletePipeline = (id: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { id: id }; const path = this.template`/streams/v2beta1/pipelines/${'id'}`(path_params); return this.client.delete(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PipelineDeleteResponse); } /** * Removes a template with a specific ID. * @param templateId ID of the template to delete * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request */ public deleteTemplate = (templateId: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { templateId: templateId }; const path = this.template`/streams/v2beta1/templates/${'templateId'}`(path_params); return this.client.delete(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as object); } /** * Creates and returns the expanded version of a group. * @param groupId The group function's ID from the function registry * @param groupExpandRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return UplPipeline */ public expandGroup = (groupId: string, groupExpandRequest: GroupExpandRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { groupId: groupId }; const path = this.template`/streams/v2beta1/groups/${'groupId'}/expand`(path_params); return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), groupExpandRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as UplPipeline); } /** * Returns the entire Streams JSON, including the expanded Streams JSON of any group functions in the pipeline. * @param uplPipeline Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return UplPipeline */ public expandPipeline = (uplPipeline: UplPipeline, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/pipelines/expand`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), uplPipeline, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as UplPipeline); } /** * Returns the full Streams JSON of a group. * @param groupId The group function's ID from the function registry * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return GroupResponse */ public getGroup = (groupId: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { groupId: groupId }; const path = this.template`/streams/v2beta1/groups/${'groupId'}`(path_params); return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as GroupResponse); } /** * Returns the input schema for a function in a pipeline. * @param getInputSchemaRequest Input Schema Request * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return UplType */ public getInputSchema = (getInputSchemaRequest: GetInputSchemaRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/pipelines/input-schema`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), getInputSchemaRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as UplType); } /** * Returns the output schema for a specified function in a pipeline. If no function ID is specified, the request returns the output schema for all functions in a pipeline. * @param getOutputSchemaRequest Output Schema Request * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return { [key: string]: UplType; } */ public getOutputSchema = (getOutputSchemaRequest: GetOutputSchemaRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise<{ [key: string]: UplType; }> => { const path = `/streams/v2beta1/pipelines/output-schema`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), getOutputSchemaRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as { [key: string]: UplType; }); } /** * Returns an individual pipeline by version. * @param id id of the pipeline to get * @param args parameters to be sent with the request * @param args.version version * @param requestStatusCallback callback function to listen to the status of a request * @return PipelineResponse */ public getPipeline = (id: string, args?: { version?: string, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { id: id }; const path = this.template`/streams/v2beta1/pipelines/${'id'}`(path_params); return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PipelineResponse); } /** * Returns the latest metrics for a single pipeline. * @param id ID of the pipeline to get metrics for * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return MetricsResponse */ public getPipelineLatestMetrics = (id: string, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { id: id }; const path = this.template`/streams/v2beta1/pipelines/${'id'}/metrics/latest`(path_params); return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as MetricsResponse); } /** * Returns the status of pipelines from the underlying streaming system. * @param args parameters to be sent with the request * @param args.activated activated * @param args.createUserId createUserId * @param args.name name * @param args.offset offset * @param args.pageSize pageSize * @param args.sortDir sortDir * @param args.sortField sortField * @param requestStatusCallback callback function to listen to the status of a request * @return PaginatedResponseOfPipelineJobStatus */ public getPipelinesStatus = (args?: { activated?: boolean, createUserId?: string, name?: string, offset?: number, pageSize?: number, sortDir?: string, sortField?: string, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/pipelines/status`; return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PaginatedResponseOfPipelineJobStatus); } /** * Returns the preview data for a session. * @param previewSessionId ID of the preview session * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return PreviewData */ public getPreviewData = (previewSessionId: number, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { previewSessionId: previewSessionId.toString() }; const path = this.template`/streams/v2beta1/preview-data/${'previewSessionId'}`(path_params); return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PreviewData); } /** * Returns information from a preview session. * @param previewSessionId ID of the preview session * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return PreviewState */ public getPreviewSession = (previewSessionId: number, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { previewSessionId: previewSessionId.toString() }; const path = this.template`/streams/v2beta1/preview-session/${'previewSessionId'}`(path_params); return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PreviewState); } /** * Returns the latest metrics for a preview session. * @param previewSessionId ID of the preview session * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return MetricsResponse */ public getPreviewSessionLatestMetrics = (previewSessionId: number, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { previewSessionId: previewSessionId.toString() }; const path = this.template`/streams/v2beta1/preview-session/${'previewSessionId'}/metrics/latest`(path_params); return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as MetricsResponse); } /** * Returns all functions in JSON format. * @param args parameters to be sent with the request * @param args.local local * @param requestStatusCallback callback function to listen to the status of a request * @return UplRegistry */ public getRegistry = (args?: { local?: boolean, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/pipelines/registry`; return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as UplRegistry); } /** * Returns an individual template by version. * @param templateId ID of the template * @param args parameters to be sent with the request * @param args.version version of the template * @param requestStatusCallback callback function to listen to the status of a request * @return TemplateResponse */ public getTemplate = (templateId: string, args?: { version?: number, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { templateId: templateId }; const path = this.template`/streams/v2beta1/templates/${'templateId'}`(path_params); return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as TemplateResponse); } /** * Returns a list of connections (latest versions only) by tenant ID. * @param args parameters to be sent with the request * @param args.connectorId * @param args.createUserId * @param args.functionId * @param args.functionOp * @param args.name * @param args.offset * @param args.pageSize * @param args.showSecretNames * @param args.sortDir Specify either ascending ('asc') or descending ('desc') sort order for a given field (sortField), which must be set for sortDir to apply. Defaults to 'asc'. * @param args.sortField * @param requestStatusCallback callback function to listen to the status of a request * @return PaginatedResponseOfConnectionResponse */ public listConnections = (args?: { connectorId?: Array, createUserId?: string, functionId?: string, functionOp?: string, name?: string, offset?: number, pageSize?: number, showSecretNames?: string, sortDir?: string, sortField?: string, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/connections`; return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PaginatedResponseOfConnectionResponse); } /** * Returns a list of the available connectors. * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return PaginatedResponseOfConnectorResponse */ public listConnectors = (args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/connectors`; return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PaginatedResponseOfConnectorResponse); } /** * Returns all pipelines. * @param args parameters to be sent with the request * @param args.activated activated * @param args.createUserId createUserId * @param args.includeData includeData * @param args.name name * @param args.offset offset * @param args.pageSize pageSize * @param args.sortDir sortDir * @param args.sortField sortField * @param requestStatusCallback callback function to listen to the status of a request * @return PaginatedResponseOfPipelineResponse */ public listPipelines = (args?: { activated?: boolean, createUserId?: string, includeData?: boolean, name?: string, offset?: number, pageSize?: number, sortDir?: string, sortField?: string, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/pipelines`; return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PaginatedResponseOfPipelineResponse); } /** * Returns a list of all templates. * @param args parameters to be sent with the request * @param args.offset offset * @param args.pageSize pageSize * @param args.sortDir sortDir * @param args.sortField sortField * @param requestStatusCallback callback function to listen to the status of a request * @return PaginatedResponseOfTemplateResponse */ public listTemplates = (args?: { offset?: number, pageSize?: number, sortDir?: string, sortField?: string, [key: string]: any }, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/templates`; return this.client.get(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PaginatedResponseOfTemplateResponse); } /** * Combines two Streams JSON programs. * @param pipelinesMergeRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return UplPipeline */ public mergePipelines = (pipelinesMergeRequest: PipelinesMergeRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/pipelines/merge`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), pipelinesMergeRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as UplPipeline); } /** * Modifies an existing DSP connection. * @param connectionId ID of the connection * @param connectionPutRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return ConnectionSaveResponse */ public putConnection = (connectionId: string, connectionPutRequest: ConnectionPutRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { connectionId: connectionId }; const path = this.template`/streams/v2beta1/connections/${'connectionId'}`(path_params); return this.client.put(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), connectionPutRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as ConnectionSaveResponse); } /** * Update a group function combining the Streams JSON of two or more functions. * @param groupId The group function's ID from the function registry * @param groupPutRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return GroupResponse */ public putGroup = (groupId: string, groupPutRequest: GroupPutRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { groupId: groupId }; const path = this.template`/streams/v2beta1/groups/${'groupId'}`(path_params); return this.client.put(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), groupPutRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as GroupResponse); } /** * Updates an existing template. * @param templateId ID of the template * @param templatePutRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return TemplateResponse */ public putTemplate = (templateId: string, templatePutRequest: TemplatePutRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { templateId: templateId }; const path = this.template`/streams/v2beta1/templates/${'templateId'}`(path_params); return this.client.put(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), templatePutRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as TemplateResponse); } /** * Reactivate a pipeline * @param id Pipeline UUID to reactivate * @param reactivatePipelineRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return PipelineReactivateResponse */ public reactivatePipeline = (id: string, reactivatePipelineRequest?: ReactivatePipelineRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { if (!reactivatePipelineRequest) { throw new SplunkError({ message: `Bad Request: reactivatePipelineRequest is empty or undefined` }); } const path_params = { id: id }; const path = this.template`/streams/v2beta1/pipelines/${'id'}/reactivate`(path_params); return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), reactivatePipelineRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PipelineReactivateResponse); } /** * Creates a preview session for a pipeline. * @param previewSessionStartRequest Parameters to start a new Preview session * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return PreviewStartResponse */ public startPreview = (previewSessionStartRequest: PreviewSessionStartRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/preview-session`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), previewSessionStartRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PreviewStartResponse); } /** * Stops a preview session. * @param previewSessionId ID of the preview session * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return string */ public stopPreview = (previewSessionId: number, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { previewSessionId: previewSessionId.toString() }; const path = this.template`/streams/v2beta1/preview-session/${'previewSessionId'}`(path_params); return this.client.delete(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as string); } /** * Partially modifies an existing DSP connection. * @param connectionId ID of the connection * @param connectionPatchRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return ConnectionSaveResponse */ public updateConnection = (connectionId: string, connectionPatchRequest: ConnectionPatchRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { connectionId: connectionId }; const path = this.template`/streams/v2beta1/connections/${'connectionId'}`(path_params); return this.client.patch(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), connectionPatchRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as ConnectionSaveResponse); } /** * Modify a group function by combining the Streams JSON of two or more functions. * @param groupId The group function's ID from the function registry * @param groupPatchRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return GroupResponse */ public updateGroup = (groupId: string, groupPatchRequest: GroupPatchRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { groupId: groupId }; const path = this.template`/streams/v2beta1/groups/${'groupId'}`(path_params); return this.client.patch(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), groupPatchRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as GroupResponse); } /** * Partially modifies an existing pipeline. * @param id id of the pipeline to update * @param pipelinePatchRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return PipelineResponse */ public updatePipeline = (id: string, pipelinePatchRequest: PipelinePatchRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { id: id }; const path = this.template`/streams/v2beta1/pipelines/${'id'}`(path_params); return this.client.patch(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), pipelinePatchRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as PipelineResponse); } /** * Partially modifies an existing template. * @param templateId ID of the template * @param templatePatchRequest Request JSON * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return TemplateResponse */ public updateTemplate = (templateId: string, templatePatchRequest: TemplatePatchRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path_params = { templateId: templateId }; const path = this.template`/streams/v2beta1/templates/${'templateId'}`(path_params); return this.client.patch(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), templatePatchRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as TemplateResponse); } /** * Verifies whether the Streams JSON is valid. * @param validateRequest JSON UPL to validate * @param args parameters to be sent with the request * @param requestStatusCallback callback function to listen to the status of a request * @return ValidateResponse */ public validatePipeline = (validateRequest: ValidateRequest, args?: object, requestStatusCallback?: (requestStatus: RequestStatus) => void): Promise => { const path = `/streams/v2beta1/pipelines/validate`; return this.client.post(STREAMS_SERVICE_CLUSTER, this.client.buildPath('', path.split('/').slice(1)), validateRequest, { query: args, statusCallback: requestStatusCallback}) .then(response => response.body as ValidateResponse); } } export type StreamsService = GeneratedStreamsService & StreamsServiceExtensions; export const StreamsService = StreamsServiceExtensions(GeneratedStreamsService);