export type GetApiApiAtlasV2GroupsGroupIdClustersClusterNameOnlineArchivesQueryLogsGzArgs = {groupId: string, envelope?: boolean | undefined, startDate?: number | undefined, endDate?: number | undefined, clusterName: string, archiveOnly?: boolean | undefined}; export type GetApiApiAtlasV2GroupsGroupIdClustersClusterNameOnlineArchivesQueryLogsGzOptions = {baseUrl?: string | undefined, ServiceAccounts?: string | undefined, fetch?: typeof fetch | undefined}; /** * Download Online Archive Query Logs * * GET /api/atlas/v2/groups/{groupId}/clusters/{clusterName}/onlineArchives/queryLogs.gz * * Also accepts auth: DigestAuth */ export const getApiApiAtlasV2GroupsGroupIdClustersClusterNameOnlineArchivesQueryLogsGz = async (args: GetApiApiAtlasV2GroupsGroupIdClustersClusterNameOnlineArchivesQueryLogsGzArgs, options?: GetApiApiAtlasV2GroupsGroupIdClustersClusterNameOnlineArchivesQueryLogsGzOptions) => { const {baseUrl = "https://cloud.mongodb.com", fetch: fetchFn = fetch, ServiceAccounts} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('accept', "application/vnd.atlas.2023-01-01+gzip") if (args.envelope != null) query.append("envelope", String(args.envelope)) if (args.startDate != null) query.append("startDate", String(args.startDate)) if (args.endDate != null) query.append("endDate", String(args.endDate)) if (args.archiveOnly != null) query.append("archiveOnly", String(args.archiveOnly)) if (ServiceAccounts !== undefined) headers.set('authorization', `Bearer ${ServiceAccounts}`) const url = `${baseUrl.replace(/\/+$/, '')}/api/atlas/v2/groups/${encodeURIComponent(String(args.groupId))}/clusters/${encodeURIComponent(String(args.clusterName))}/onlineArchives/queryLogs.gz${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return res.blob() };