export type BGPApplyPolicyToNeighborMod = {ipAddress: string, policyType: 'import' | 'export', policies?: Array | undefined, routeAction: 'accept' | 'reject'}; export type DeleteApiConfigBgpPolicyApplyArgs = {body: BGPApplyPolicyToNeighborMod}; export type DeleteApiConfigBgpPolicyApplyOptions = {baseUrl?: string | undefined, BearerAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete BGP Policy in neighbor * * DELETE /config/bgp/policy/apply */ export const deleteApiConfigBgpPolicyApply = async (args: DeleteApiConfigBgpPolicyApplyArgs, options?: DeleteApiConfigBgpPolicyApplyOptions) => { const {baseUrl = "http://0.0.0.0:11111/netlox/v1", fetch: fetchFn = fetch, BearerAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (BearerAuth !== undefined) headers.set("Authorization", BearerAuth) const url = `${baseUrl.replace(/\/+$/, '')}/config/bgp/policy/apply${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", 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 };