Class: NamespaceStore#
Renderer.K8sApi.NamespaceStore
Hierarchy#
KubeObjectStore<Namespace,NamespaceApi>
↳ NamespaceStore
Table of contents#
Constructors#
Properties#
- api
- bufferSize
- defaultSorting
- dependencies
- eventsBuffer
- failedLoading
- isLoaded
- isLoading
- items
- limit
- selectNamespaces
- selectedItemsIds
Accessors#
- allowedNamespaces
- areAllSelectedImplicitly
- contextItems
- contextNamespaces
- hasAllContexts
- query
- selectedItems
- selectedNames
Methods#
- [iterator]
- bindWatchEventsUpdater
- clearSelected
- create
- createItem
- filterItemsOnLoad
- getAllByNs
- getById
- getByLabel
- getByName
- getByPath
- getIndexById
- getItems
- getNamespaceTree
- getTotalCount
- hasContext
- isSelected
- isSelectedAll
- load
- loadAll
- loadFromPath
- loadItem
- loadItems
- mergeItems
- onContextChange
- patch
- pickOnlySelected
- reloadAll
- remove
- removeItem
- removeItems
- removeSelectedItems
- reset
- resetOnError
- resetSelection
- select
- selectAll
- selectSingle
- sortItems
- subscribe
- toggleAll
- toggleContext
- toggleSelection
- toggleSelectionAll
- toggleSingle
- unselect
- update
- updateFromEventsBuffer
- updateItem
Constructors#
constructor#
• new NamespaceStore(dependencies, api)
Parameters#
| Name | Type |
|---|---|
dependencies |
Dependencies |
api |
NamespaceApi |
Overrides#
KubeObjectStore<Namespace, NamespaceApi\>.constructor
Properties#
api#
• Readonly api: NamespaceApi
Inherited from#
KubeObjectStore.api
bufferSize#
• Readonly bufferSize: number
Inherited from#
KubeObjectStore.bufferSize
defaultSorting#
• Protected defaultSorting: (item: Namespace) => string
Type declaration#
▸ (item): string
Parameters#
| Name | Type |
|---|---|
item |
Namespace |
Returns#
string
Inherited from#
KubeObjectStore.defaultSorting
dependencies#
• Protected Readonly dependencies: Dependencies
Overrides#
KubeObjectStore.dependencies
eventsBuffer#
• Protected Readonly eventsBuffer: IObservableArray<IKubeWatchEvent<KubeJsonApiData<ClusterScopedMetadata, NamespaceStatus, NamespaceSpec>>>
Inherited from#
KubeObjectStore.eventsBuffer
failedLoading#
• failedLoading: boolean
Inherited from#
KubeObjectStore.failedLoading
isLoaded#
• isLoaded: boolean
Inherited from#
KubeObjectStore.isLoaded
isLoading#
• isLoading: boolean
Inherited from#
KubeObjectStore.isLoading
items#
• items: IObservableArray<Namespace>
Inherited from#
KubeObjectStore.items
limit#
• Readonly limit: undefined | number
Inherited from#
KubeObjectStore.limit
selectNamespaces#
• selectNamespaces: (namespace: string | string[]) => void
Type declaration#
▸ (namespace): void
Parameters#
| Name | Type |
|---|---|
namespace |
string | string[] |
Returns#
void
selectedItemsIds#
• selectedItemsIds: ObservableSet<string>
Inherited from#
KubeObjectStore.selectedItemsIds
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
contextItems#
• get contextItems(): K[]
Returns#
K[]
Inherited from#
KubeObjectStore.contextItems
contextNamespaces#
• get contextNamespaces(): string[]
The list of selected namespace names (for filtering)
Returns#
string[]
hasAllContexts#
• get hasAllContexts(): boolean
Is true if all available namespaces are selected, otherwise false
Returns#
boolean
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@186
bindWatchEventsUpdater#
▸ Protected bindWatchEventsUpdater(delay?): void
Parameters#
| Name | Type |
|---|---|
delay? |
number |
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
filterItemsOnLoad#
▸ Protected filterItemsOnLoad(items): Namespace[]
Parameters#
| Name | Type |
|---|---|
items |
Namespace[] |
Returns#
Inherited from#
KubeObjectStore.filterItemsOnLoad
getAllByNs#
▸ getAllByNs(namespace, strict?): Namespace[]
Parameters#
| Name | Type |
|---|---|
namespace |
string | string[] |
strict? |
boolean |
Returns#
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#
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#
Inherited from#
KubeObjectStore.getItems
getNamespaceTree#
▸ getNamespaceTree(root): NamespaceTree
Parameters#
| Name | Type |
|---|---|
root |
Namespace |
Returns#
NamespaceTree
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(«destructured»?): Promise<undefined | Namespace[]>
Parameters#
| Name | Type |
|---|---|
«destructured» |
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, «destructured»): Namespace[]
Parameters#
| Name | Type |
|---|---|
partialItems |
Namespace[] |
«destructured» |
MergeItemsOptions |
Returns#
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#
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
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#
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