7.6.2.31. k8sGetResource


It fetches a resource from the cluster, based on the provided options. If the name is provided it returns one resource else 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 providedelse it returns all the resources matching the model. In case of failure, the promise gets rejected with HTTP error response.

Expand
Parameter NameDescription

options

Which are passed as key-value pairs in the map

options.model

k8s model

options.name

The name of the resource, if not provided then it looks for all the resources matching the model.

options.ns

The namespace to look into, should not be specified for cluster-scoped resources.

options.path

Appends as subpath if provided

options.queryParams

The query parameters to be included in the URL.

options.requestInit

The fetch init object to use. This can have request headers, method, redirect, etc. See Interface RequestInit for more.

Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

关于红帽文档

Legal Notice

Theme

© 2026 Red Hat
返回顶部