export type StepType = 'connectivity-check' | 'execute' | 'inventory' | 'install' | 'free-network-addresses' | 'dhcp-lease-allocate' | 'api-vip-connectivity-check' | 'tang-connectivity-check' | 'ntp-synchronizer' | 'installation-disk-speed-check' | 'container-image-availability' | 'domain-resolution' | 'stop-installation' | 'logs-gather' | 'next-step-runner' | 'upgrade-agent' | 'download-boot-artifacts' | 'reboot-for-reclaim' | 'verify-vips'; export type StepReply = {step_type?: StepType | undefined, step_id?: string | undefined, exit_code?: number | undefined, output?: string | undefined, error?: string | undefined}; export type CreateApiV2InfraEnvsInfraEnvIdHostsHostIdInstructionsArgs = {discovery_agent_version?: string | undefined, infra_env_id: string, host_id: string, body: StepReply}; export type CreateApiV2InfraEnvsInfraEnvIdHostsHostIdInstructionsOptions = {baseUrl?: string | undefined, agentAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Posts the result of the operations from the host agent. * * POST /v2/infra-envs/{infra_env_id}/hosts/{host_id}/instructions */ export const createApiV2InfraEnvsInfraEnvIdHostsHostIdInstructions = async (args: CreateApiV2InfraEnvsInfraEnvIdHostsHostIdInstructionsArgs, options?: CreateApiV2InfraEnvsInfraEnvIdHostsHostIdInstructionsOptions) => { const {baseUrl = "http://api.openshift.com/api/assisted-install", fetch: fetchFn = fetch, agentAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (args.discovery_agent_version != null) headers.set("discovery_agent_version", String(args.discovery_agent_version)) if (agentAuth !== undefined) headers.set("X-Secret-Key", agentAuth) const url = `${baseUrl.replace(/\/+$/, '')}/v2/infra-envs/${encodeURIComponent(String(args.infra_env_id))}/hosts/${encodeURIComponent(String(args.host_id))}/instructions${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", 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 };