Skip to content

api-resources data source

Description

APIResourcesDataSource queries fresh API discovery with the configured identity. Results are sorted by group, version and resource name; list attributes are sorted and deduplicated. A successful query with no matches returns an empty list.

Any discovery failure rejects the whole query, including a partial failure in a group excluded by filters. Discovered verbs describe API capabilities and do not establish that the configured identity has permission to use them.

Source: internal/object/api_resources_dsrc.go:30

Example usage:

imports: {
  kubernetes-dynamic: 'github.com/cloudboss/unobin-library-kubernetes//dynamic'
}

data-sources: {
  example: kubernetes-dynamic.api-resources {
    # Set input fields here.
  }
}

Inputs

api-group

optional(string)

APIGroup is an exact filter. Empty selects core; omission selects all groups.

namespaced

optional(boolean)

Namespaced filters scope when provided, including an explicit false value.

verbs

optional(list(string))

Verbs requires every listed verb. An empty list selects all capabilities; duplicate verbs have the same meaning as one occurrence.

include-subresources

optional(boolean)

default false

IncludeSubresources includes slash-separated names such as pods/status; defaults false.

preferred-versions-only

optional(boolean)

default true

PreferredVersionsOnly defaults true; false returns all served versions separately.

Input Constraints

Verbs rules

Requirement.

Rule logic
For each
input.verbs ?? []
Require
@core.length(@each.value) >= 1

Outputs

resources

list(object)
list(
  object({
    api-version: string
    group: string
    version: string
    name: string
    singular-name: string
    kind: string
    namespaced: boolean
    verbs: list(string)
    short-names: list(string)
    categories: list(string)
  })
)