Skip to content

Class: NamespaceStore#

Renderer.K8sApi.NamespaceStore

Hierarchy#

NamespaceStore

Table of contents#

Constructors#

Properties#

Accessors#

Methods#

Constructors#

constructor#

new NamespaceStore(dependencies, api)

Parameters#

Name Type
dependencies Dependencies
api NamespaceApi

Overrides#

KubeObjectStore.constructor

Properties#

api#

Readonly api: NamespaceApi

Inherited from#

KubeObjectStore.api


bufferSize#

Readonly bufferSize: number

Inherited from#

KubeObjectStore.bufferSize


dependencies#

Protected Readonly dependencies: Dependencies


eventsBuffer#

Protected eventsBuffer: IObservableArray<IKubeWatchEvent<KubeJsonApiData<ClusterScopedMetadata, NamespaceStatus, NamespaceSpec>>>

Inherited from#

KubeObjectStore.eventsBuffer


failedLoading#

failedLoading: boolean = false

Inherited from#

KubeObjectStore.failedLoading


isLoaded#

isLoaded: boolean = false

Inherited from#

KubeObjectStore.isLoaded


isLoading#

isLoading: boolean = false

Inherited from#

KubeObjectStore.isLoading


items#

items: IObservableArray<Namespace>

Inherited from#

KubeObjectStore.items


limit#

Readonly limit: undefined | number

Inherited from#

KubeObjectStore.limit


selectedItemsIds#

selectedItemsIds: ObservableSet<string>

Inherited from#

KubeObjectStore.selectedItemsIds


defaultContext#

Static Readonly defaultContext: IObservableValue<undefined | ClusterContext>

Inherited from#

KubeObjectStore.defaultContext

Accessors#

allowedNamespaces#

get allowedNamespaces(): string[]

Returns#

string[]


areAllSelectedImplicitly#

get areAllSelectedImplicitly(): boolean

Is true when the the set of namespace names selected is implicitly all

Namely, this will be true if the user has deselected all namespaces from the filter or if the user has clicked the "All Namespaces" option

Returns#

boolean


context#

get context(): undefined | ClusterContext

Returns#

undefined | ClusterContext

Inherited from#

KubeObjectStore.context


contextItems#

get contextItems(): K[]

Returns#

K[]

Inherited from#

KubeObjectStore.contextItems


contextNamespaces#

get contextNamespaces(): string[]

The list of selected namespace names (for filtering)

Returns#

string[]


contextReady#

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

Returns#

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

Inherited from#

KubeObjectStore.contextReady


hasAllContexts#

get hasAllContexts(): boolean

Is true if all available namespaces are selected, otherwise false

Returns#

boolean


namespacesReady#

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

Returns#

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

Inherited from#

KubeObjectStore.namespacesReady


query#

get query(): KubeApiQueryParams

Returns#

KubeApiQueryParams

Inherited from#

KubeObjectStore.query


selectedItems#

get selectedItems(): Item[]

Returns#

Item[]

Inherited from#

KubeObjectStore.selectedItems


selectedNames#

get selectedNames(): Set<string>

The set of select namespace names (for filtering)

Returns#

Set<string>

Methods#

[iterator]#

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

Returns#

Generator<Namespace, void, undefined>

Inherited from#

KubeObjectStore.[iterator]


bindWatchEventsUpdater#

Protected bindWatchEventsUpdater(delay?): void

Parameters#

Name Type Default value
delay number 1000

Returns#

void

Inherited from#

KubeObjectStore.bindWatchEventsUpdater


clearSelected#

clearSelected(namespaces?): void

Parameters#

Name Type
namespaces? string | string[]

Returns#

void


create#

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

Parameters#

Name Type
params Object
params.name string
params.namespace? string
data? PartialObjectDeep<Namespace>

Returns#

Promise<Namespace>

Inherited from#

KubeObjectStore.create


createItem#

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

Parameters#

Name Type
params Object
params.name string
params.namespace? string
data? PartialObjectDeep<Namespace>

Returns#

Promise<null | Namespace>

Inherited from#

KubeObjectStore.createItem


defaultSorting#

Protected defaultSorting(item): string

Parameters#

Name Type
item Item

Returns#

string

Inherited from#

KubeObjectStore.defaultSorting


filterItemsOnLoad#

Protected filterItemsOnLoad(items): Namespace[]

Parameters#

Name Type
items Namespace[]

Returns#

Namespace[]

Inherited from#

KubeObjectStore.filterItemsOnLoad


getAllByNs#

getAllByNs(namespace, strict?): Namespace[]

Parameters#

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

Returns#

Namespace[]

Inherited from#

KubeObjectStore.getAllByNs


getById#

getById(id): undefined | Namespace

Parameters#

Name Type
id string

Returns#

undefined | Namespace

Inherited from#

KubeObjectStore.getById


getByLabel#

getByLabel(labels): Namespace[]

Parameters#

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

Returns#

Namespace[]

Inherited from#

KubeObjectStore.getByLabel


getByName#

getByName(name, namespace?): undefined | Namespace

Parameters#

Name Type
name string
namespace? string

Returns#

undefined | Namespace

Inherited from#

KubeObjectStore.getByName


getByPath#

getByPath(path): undefined | Namespace

Parameters#

Name Type
path string

Returns#

undefined | Namespace

Inherited from#

KubeObjectStore.getByPath


getIndexById#

getIndexById(id): number

Parameters#

Name Type
id string

Returns#

number

Inherited from#

KubeObjectStore.getIndexById


getItems#

getItems(): Namespace[]

Returns#

Namespace[]

Inherited from#

KubeObjectStore.getItems


getTotalCount#

getTotalCount(): number

Returns#

number

Inherited from#

KubeObjectStore.getTotalCount


hasContext#

hasContext(namespaces): boolean

Checks if namespace names are selected for filtering

Parameters#

Name Type Description
namespaces string | string[] One or several names of namespaces to check if they are selected

Returns#

boolean

true if all the provided names are selected


isSelected#

isSelected(item): boolean

Parameters#

Name Type
item Namespace

Returns#

boolean

Inherited from#

KubeObjectStore.isSelected


isSelectedAll#

isSelectedAll(visibleItems?): boolean

Parameters#

Name Type
visibleItems Namespace[]

Returns#

boolean

Inherited from#

KubeObjectStore.isSelectedAll


load#

load(params): Promise<Namespace>

Parameters#

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

Returns#

Promise<Namespace>

Inherited from#

KubeObjectStore.load


loadAll#

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

Parameters#

Name Type
__namedParameters KubeObjectStoreLoadAllParams

Returns#

Promise<undefined | Namespace[]>

Inherited from#

KubeObjectStore.loadAll


loadFromPath#

loadFromPath(resourcePath): Promise<Namespace>

Parameters#

Name Type
resourcePath string

Returns#

Promise<Namespace>

Inherited from#

KubeObjectStore.loadFromPath


loadItem#

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

Parameters#

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

Returns#

Promise<null | Namespace>

Inherited from#

KubeObjectStore.loadItem


loadItems#

Protected loadItems(params): Promise<Namespace[]>

Parameters#

Name Type
params KubeObjectStoreLoadingParams

Returns#

Promise<Namespace[]>

Overrides#

KubeObjectStore.loadItems


mergeItems#

Protected mergeItems(partialItems, __namedParameters): Namespace[]

Parameters#

Name Type
partialItems Namespace[]
__namedParameters MergeItemsOptions

Returns#

Namespace[]

Inherited from#

KubeObjectStore.mergeItems


onContextChange#

onContextChange(callback, opts?): IReactionDisposer

Parameters#

Name Type
callback (namespaces: string[]) => void
opts Object
opts.fireImmediately? boolean

Returns#

IReactionDisposer


patch#

patch(item, patch): Promise<Namespace>

Parameters#

Name Type
item Namespace
patch Patch

Returns#

Promise<Namespace>

Inherited from#

KubeObjectStore.patch


pickOnlySelected#

pickOnlySelected(items): Namespace[]

Parameters#

Name Type
items Namespace[]

Returns#

Namespace[]

Inherited from#

KubeObjectStore.pickOnlySelected


reloadAll#

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

Parameters#

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

Returns#

Promise<undefined | Namespace[]>

Inherited from#

KubeObjectStore.reloadAll


remove#

remove(item): Promise<void>

Parameters#

Name Type
item Namespace

Returns#

Promise<void>

Overrides#

KubeObjectStore.remove


removeItem#

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

Parameters#

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

Returns#

Promise<void>

Inherited from#

KubeObjectStore.removeItem


removeItems#

removeItems(items): Promise<void>

Parameters#

Name Type
items Namespace[]

Returns#

Promise<void>

Inherited from#

KubeObjectStore.removeItems


removeSelectedItems#

removeSelectedItems(): Promise<void>

Returns#

Promise<void>

Inherited from#

KubeObjectStore.removeSelectedItems


reset#

reset(): void

Returns#

void

Inherited from#

KubeObjectStore.reset


resetOnError#

Protected resetOnError(error): void

Parameters#

Name Type
error any

Returns#

void

Inherited from#

KubeObjectStore.resetOnError


resetSelection#

resetSelection(): void

Returns#

void

Inherited from#

KubeObjectStore.resetSelection


select#

select(item): void

Parameters#

Name Type
item Namespace

Returns#

void

Inherited from#

KubeObjectStore.select


selectAll#

selectAll(): void

Selects all available namespaces.

Note: If new namespaces appear in the future those will be selected too

Returns#

void


selectNamespaces#

selectNamespaces(namespace): void

Parameters#

Name Type
namespace string | string[]

Returns#

void


selectSingle#

selectSingle(namespace): void

Makes the given namespace the sole selected namespace

Parameters#

Name Type
namespace string

Returns#

void


sortItems#

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

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 Namespace[] the items to be sorted (default: the current items in this store)
sorting (item: Namespace) => 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#

Namespace[]

Inherited from#

KubeObjectStore.sortItems


subscribe#

subscribe(): (...args: T) => void

Returns#

fn

▸ <T>(...args): void

A function that does nothing

Type parameters#
Name Type
T extends any[]
Parameters#
Name Type
...args T
Returns#

void

Overrides#

KubeObjectStore.subscribe


toggleAll#

toggleAll(selectAll?): void

This function selects all namespaces implicitly.

NOTE: does not toggle any namespaces

deprecated Use NamespaceStore.selectAll instead.

Parameters#

Name Type Description
selectAll? boolean NOT USED

Returns#

void


toggleContext#

toggleContext(namespaces): void

Acts like toggleSingle but can work on several at a time

Parameters#

Name Type Description
namespaces string | string[] One or many names of namespaces to select

Returns#

void


toggleSelection#

toggleSelection(item): void

Parameters#

Name Type
item Namespace

Returns#

void

Inherited from#

KubeObjectStore.toggleSelection


toggleSelectionAll#

toggleSelectionAll(visibleItems?): void

Parameters#

Name Type
visibleItems Namespace[]

Returns#

void

Inherited from#

KubeObjectStore.toggleSelectionAll


toggleSingle#

toggleSingle(namespace): void

Toggles the selection state of namespace. Namely, if it was previously specifically or implicitly selected then after this call it will be explicitly deselected.

Parameters#

Name Type Description
namespace string The name of a namespace

Returns#

void


unselect#

unselect(item): void

Parameters#

Name Type
item Namespace

Returns#

void

Inherited from#

KubeObjectStore.unselect


update#

update(item, data): Promise<Namespace>

Parameters#

Name Type
item Namespace
data PartialObjectDeep<Namespace>

Returns#

Promise<Namespace>

Inherited from#

KubeObjectStore.update


updateFromEventsBuffer#

Protected updateFromEventsBuffer(): void

Returns#

void

Inherited from#

KubeObjectStore.updateFromEventsBuffer


updateItem#

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

Parameters#

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

Returns#

Promise<Namespace>

Inherited from#

KubeObjectStore.updateItem