Skip to main content

Function: request()

function request(
path: string,
params: RequestParams,
autoLogoutOnAuthError: boolean,
useCluster: boolean,
queryParams?: QueryParameters): Promise<any>

Sends a request to the backend. If the useCluster parameter is true (which it is, by default), it will be treated as a request to the Kubernetes server of the currently defined (in the URL) cluster.

Parameters

ParameterTypeDefault valueDescription
pathstringundefinedThe path to the API endpoint.
paramsRequestParams{}Optional parameters for the request.
autoLogoutOnAuthErrorbooleantrueWhether to automatically log out the user if there is an authentication error.
useClusterbooleantrueWhether to use the current cluster for the request.
queryParams?QueryParametersundefinedOptional query parameters for the request.

Returns

Promise<any>

A Promise that resolves to the JSON response from the API server.

Throws

An ApiError if the response status is not ok.

Defined in

src/lib/k8s/api/v1/clusterRequests.ts:94