k8sGetResource
It fetches a resource from the cluster, based on the provided options. If the name is provided it returns one resource, otherwise it returns all the resources matching the model. It returns a promise that resolves to the response as JSON object with a resource if the name is provided, otherwise it returns all the resources matching the model. In case of failure, the promise gets rejected with HTTP error response.
| Parameter Name | Description |
|---|---|
|
Which are passed as key-value pairs in the map |
|
k8s model |
|
The name of the resource, if not provided then it looks for all the resources matching the model. |
|
The namespace to look into, should not be specified for cluster-scoped resources. |
|
Appends as subpath if provided |
|
The query parameters to be included in the URL. |
|
The fetch init object to use. This can have request headers, method, redirect, and so on. |