export type CreateApiV1DboDatabasesEntityIdPluginsOperationOperationArgs = {entityId: string, operation: string}; export type CreateApiV1DboDatabasesEntityIdPluginsOperationOperationOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Apply an operation on a database observability plugin * * POST /v1/dbo/databases/{entityId}/plugins/operation/{operation} */ export const createApiV1DboDatabasesEntityIdPluginsOperationOperation = async (args: CreateApiV1DboDatabasesEntityIdPluginsOperationOperationArgs, options?: CreateApiV1DboDatabasesEntityIdPluginsOperationOperationOptions) => { const {baseUrl = "https://api.na-01.cloud.solarwinds.com", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (BearerAuth !== undefined) headers.set('authorization', `Bearer ${BearerAuth}`) const url = `${baseUrl.replace(/\/+$/, '')}/v1/dbo/databases/${encodeURIComponent(String(args.entityId))}/plugins/operation/${encodeURIComponent(String(args.operation))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };