export type AdvancedSetting = {sectionName: string, canRemove: boolean, defaultValue: string, documented: boolean, name: string, section: string, type: string, value: string, initialValue: string, enabled: boolean}; export type HostPortConfigAdv = {processorCountAutoValue: number, port: string, processorCount: string, advancedSettings: Array, name: string, ipAddress: string, serverName: string, saveFieldList?: Array | undefined, type: string, version: string}; export type HostportsTuneConfig = {hostports: Array, name: string, serverName: string, saveFieldList?: Array | undefined, version: string}; export type UpdateApiV2ServersServerNameVhostsVhostNameTunehostportsArgs = {serverName: string, vhostName: string, body: HostportsTuneConfig}; export type UpdateApiV2ServersServerNameVhostsVhostNameTunehostportsOptions = {baseUrl?: string | undefined, basicAuth?: {username: string, password: string} | undefined, fetch?: typeof fetch | undefined}; /** * Update host port * * PUT /v2/servers/{serverName}/vhosts/{vhostName}/tunehostports */ export const updateApiV2ServersServerNameVhostsVhostNameTunehostports = async (args: UpdateApiV2ServersServerNameVhostsVhostNameTunehostportsArgs, options?: UpdateApiV2ServersServerNameVhostsVhostNameTunehostportsOptions) => { const {baseUrl = "http://localhost:8087", fetch: fetchFn = fetch, basicAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (basicAuth !== undefined) headers.set('authorization', `Basic ${btoa(`${basicAuth.username}:${basicAuth.password}`)}`) const url = `${baseUrl.replace(/\/+$/, '')}/v2/servers/${encodeURIComponent(String(args.serverName))}/vhosts/${encodeURIComponent(String(args.vhostName))}/tunehostports${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 };