Skip to content

Class: KubeObjectStore<K, A, D>#

Renderer.K8sApi.KubeObjectStore

Type parameters#

Name Type
K extends KubeObject = KubeObject
A extends KubeApi<K, D> = KubeApi<K, KubeJsonApiDataFor<K>>
D extends KubeJsonApiDataFor<K> = KubeApiDataFrom<K, A>

Hierarchy#

  • ItemStore<K>

KubeObjectStore

↳↳ EventStore

↳↳ PodsStore

↳↳ NodesStore

↳↳ DeploymentStore

↳↳ DaemonSetStore

↳↳ StatefulSetStore

↳↳ JobStore

↳↳ CronJobStore

↳↳ ConfigMapsStore

↳↳ SecretsStore

↳↳ ReplicaSetStore

↳↳ ResourceQuotasStore

↳↳ LimitRangesStore

↳↳ HPAStore

↳↳ PodDisruptionBudgetsStore

↳↳ PriorityClassStoreStore

↳↳ ServiceStore

↳↳ EndpointStore

↳↳ IngressStore

↳↳ NetworkPolicyStore

↳↳ PersistentVolumesStore

↳↳ VolumeClaimStore

↳↳ StorageClassStore

↳↳ NamespaceStore

↳↳ ServiceAccountsStore

↳↳ RolesStore

↳↳ RoleBindingsStore

↳↳ CRDStore

↳↳ CRDResourceStore

Table of contents#

Constructors#

Properties#

Accessors#

Methods#

Constructors#

constructor#

new KubeObjectStore<K, A, D>(api, opts?)

Type parameters#

Name Type
K extends KubeObject<KubeObjectMetadata<KubeObjectScope>, unknown, unknown, K> = KubeObject<KubeObjectMetadata<KubeObjectScope>, unknown, unknown>
A extends KubeApi<K, D, A> = KubeApi<K, KubeJsonApiDataFor<K>>
D extends KubeJsonApiData<KubeObjectMetadata<KubeObjectScope>, unknown, unknown, D> = KubeApiDataFrom<K, A>

Parameters#

Name Type
api A
opts? KubeObjectStoreOptions

Overrides#

ItemStore<K\>.constructor

new KubeObjectStore<K, A, D>()

deprecated Supply API instance through constructor

Type parameters#

Name Type
K extends KubeObject<KubeObjectMetadata<KubeObjectScope>, unknown, unknown, K> = KubeObject<KubeObjectMetadata<KubeObjectScope>, unknown, unknown>
A extends KubeApi<K, D, A> = KubeApi<K, KubeJsonApiDataFor<K>>
D extends KubeJsonApiData<KubeObjectMetadata<KubeObjectScope>, unknown, unknown, D> = KubeApiDataFrom<K, A>

Overrides#

ItemStore<K\>.constructor

Properties#

api#

Readonly api: A


bufferSize#

Readonly bufferSize: number


eventsBuffer#

Protected eventsBuffer: IObservableArray<IKubeWatchEvent<D>>


failedLoading#

failedLoading: boolean = false

Inherited from#

ItemStore.failedLoading


isLoaded#

isLoaded: boolean = false

Inherited from#

ItemStore.isLoaded


isLoading#

isLoading: boolean = false

Inherited from#

ItemStore.isLoading


items#

items: IObservableArray<K>

Inherited from#

ItemStore.items


limit#

Readonly limit: undefined | number


selectedItemsIds#

selectedItemsIds: ObservableSet<string>

Inherited from#

ItemStore.selectedItemsIds


defaultContext#

Static Readonly defaultContext: IObservableValue<undefined | ClusterContext>

Accessors#

context#

get context(): undefined | ClusterContext

Returns#

undefined | ClusterContext


contextItems#

get contextItems(): K[]

Returns#

K[]


contextReady#

get contextReady(): Promise<void> & { cancel: () => void }

Returns#

Promise<void> & { cancel: () => void }


namespacesReady#

get namespacesReady(): Promise<void> & { cancel: () => void }

Returns#

Promise<void> & { cancel: () => void }


query#

get query(): KubeApiQueryParams

Returns#

KubeApiQueryParams


selectedItems#

get selectedItems(): Item[]

Returns#

Item[]

Inherited from#

ItemStore.selectedItems

Methods#

[iterator]#

[iterator](): Generator<K, void, undefined>

Returns#

Generator<K, void, undefined>

Inherited from#

ItemStore.__@iterator@515


bindWatchEventsUpdater#

Protected bindWatchEventsUpdater(delay?): void

Parameters#

Name Type Default value
delay number 1000

Returns#

void


create#

create(params, data?): Promise<K>

Parameters#

Name Type
params Object
params.name string
params.namespace? string
data? PartialDeep<K>

Returns#

Promise<K>


createItem#

Protected createItem(params, data?): Promise<null | K>

Parameters#

Name Type
params Object
params.name string
params.namespace? string
data? PartialDeep<K>

Returns#

Promise<null | K>

Overrides#

ItemStore.createItem


defaultSorting#

Protected defaultSorting(item): string

Parameters#

Name Type
item Item

Returns#

string

Inherited from#

ItemStore.defaultSorting


filterItemsOnLoad#

Protected filterItemsOnLoad(items): K[]

Parameters#

Name Type
items K[]

Returns#

K[]


getAllByNs#

getAllByNs(namespace, strict?): K[]

Parameters#

Name Type Default value
namespace string | string[] undefined
strict boolean false

Returns#

K[]


getById#

getById(id): undefined | K

Parameters#

Name Type
id string

Returns#

undefined | K


getByLabel#

getByLabel(labels): K[]

Parameters#

Name Type
labels string[] | Partial<Record<string, string>>

Returns#

K[]


getByName#

getByName(name, namespace?): undefined | K

Parameters#

Name Type
name string
namespace? string

Returns#

undefined | K

Overrides#

ItemStore.getByName


getByPath#

getByPath(path): undefined | K

Parameters#

Name Type
path string

Returns#

undefined | K


getIndexById#

getIndexById(id): number

Parameters#

Name Type
id string

Returns#

number

Inherited from#

ItemStore.getIndexById


getItems#

getItems(): K[]

Returns#

K[]

Inherited from#

ItemStore.getItems


getTotalCount#

getTotalCount(): number

Returns#

number

Overrides#

ItemStore.getTotalCount


isSelected#

isSelected(item): boolean

Parameters#

Name Type
item K

Returns#

boolean

Inherited from#

ItemStore.isSelected


isSelectedAll#

isSelectedAll(visibleItems?): boolean

Parameters#

Name Type
visibleItems K[]

Returns#

boolean

Inherited from#

ItemStore.isSelectedAll


load#

load(params): Promise<K>

Parameters#

Name Type
params Object
params.name string
params.namespace? string

Returns#

Promise<K>


loadAll#

loadAll(__namedParameters?): Promise<undefined | K[]>

Parameters#

Name Type
__namedParameters KubeObjectStoreLoadAllParams

Returns#

Promise<undefined | K[]>


loadFromPath#

loadFromPath(resourcePath): Promise<K>

Parameters#

Name Type
resourcePath string

Returns#

Promise<K>


loadItem#

Protected loadItem(params): Promise<null | K>

Parameters#

Name Type
params Object
params.name string
params.namespace? string

Returns#

Promise<null | K>

Overrides#

ItemStore.loadItem


loadItems#

Protected loadItems(__namedParameters): Promise<K[]>

Parameters#

Name Type
__namedParameters KubeObjectStoreLoadingParams

Returns#

Promise<K[]>

Overrides#

ItemStore.loadItems


mergeItems#

Protected mergeItems(partialItems, __namedParameters): K[]

Parameters#

Name Type
partialItems K[]
__namedParameters MergeItemsOptions

Returns#

K[]


patch#

patch(item, patch): Promise<K>

Parameters#

Name Type
item K
patch Patch

Returns#

Promise<K>


pickOnlySelected#

pickOnlySelected(items): K[]

Parameters#

Name Type
items K[]

Returns#

K[]

Inherited from#

ItemStore.pickOnlySelected


reloadAll#

reloadAll(opts?): Promise<undefined | K[]>

Parameters#

Name Type
opts Object
opts.force? boolean
opts.merge? boolean
opts.namespaces? string[]

Returns#

Promise<undefined | K[]>


remove#

remove(item): Promise<void>

Parameters#

Name Type
item K

Returns#

Promise<void>


removeItem#

Protected removeItem(item, request): Promise<void>

Parameters#

Name Type
item K
request () => Promise<any>

Returns#

Promise<void>

Inherited from#

ItemStore.removeItem


removeItems#

removeItems(items): Promise<void>

Parameters#

Name Type
items K[]

Returns#

Promise<void>

Overrides#

ItemStore.removeItems


removeSelectedItems#

removeSelectedItems(): Promise<void>

Returns#

Promise<void>

Overrides#

ItemStore.removeSelectedItems


reset#

reset(): void

Returns#

void

Inherited from#

ItemStore.reset


resetOnError#

Protected resetOnError(error): void

Parameters#

Name Type
error any

Returns#

void


resetSelection#

resetSelection(): void

Returns#

void

Inherited from#

ItemStore.resetSelection


select#

select(item): void

Parameters#

Name Type
item K

Returns#

void

Inherited from#

ItemStore.select


sortItems#

Protected sortItems(items?, sorting?, order?): K[]

Return items sorted by the given ordering functions. If two elements of items are sorted to the same "index" then the next sorting function is used to determine where to place them relative to each other. Once the sorting functions have been all exhausted then the order is unchanged (ie a stable sort).

Parameters#

Name Type Description
items K[] the items to be sorted (default: the current items in this store)
sorting (item: K) => any[] list of functions to determine sort order (default: sorting by name)
order? "asc" | "desc" whether to sort from least to greatest ("asc" (default)) or vice-versa ("desc")

Returns#

K[]

Inherited from#

ItemStore.sortItems


subscribe#

subscribe(__namedParameters?): Disposer

Parameters#

Name Type
__namedParameters KubeObjectStoreSubscribeParams

Returns#

Disposer


toggleSelection#

toggleSelection(item): void

Parameters#

Name Type
item K

Returns#

void

Inherited from#

ItemStore.toggleSelection


toggleSelectionAll#

toggleSelectionAll(visibleItems?): void

Parameters#

Name Type
visibleItems K[]

Returns#

void

Inherited from#

ItemStore.toggleSelectionAll


unselect#

unselect(item): void

Parameters#

Name Type
item K

Returns#

void

Inherited from#

ItemStore.unselect


update#

update(item, data): Promise<K>

Parameters#

Name Type
item K
data PartialDeep<K>

Returns#

Promise<K>


updateFromEventsBuffer#

Protected updateFromEventsBuffer(): void

Returns#

void


updateItem#

Protected updateItem(item, request): Promise<K>

Parameters#

Name Type
item K
request () => Promise<K>

Returns#

Promise<K>

Inherited from#

ItemStore.updateItem