export type UpdateApiStackAdminconfigV2ObservabilityEnableCentralizedRbacArgs = {'o11y-access-token': string, stack: string, body: {'o11y-realm'?: string | undefined}}; export type UpdateApiStackAdminconfigV2ObservabilityEnableCentralizedRbacOptions = {baseUrl: string, fetch?: typeof fetch | undefined}; /** * set the paired Splunk Cloud stack as the RBAC source for Splunk Observability Cloud organization * * PUT /{stack}/adminconfig/v2/observability/enable-centralized-rbac */ export const updateApiStackAdminconfigV2ObservabilityEnableCentralizedRbac = async (args: UpdateApiStackAdminconfigV2ObservabilityEnableCentralizedRbacArgs, options: UpdateApiStackAdminconfigV2ObservabilityEnableCentralizedRbacOptions) => { const {baseUrl, fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args['o11y-access-token'] != null) headers.set("o11y-access-token", String(args['o11y-access-token'])) const url = `${baseUrl.replace(/\/+$/, '')}/${encodeURIComponent(String(args.stack))}/adminconfig/v2/observability/enable-centralized-rbac${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "PUT", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };