Skip to content

# Class: JobStore

## Hierarchy

↳ KubeObjectStore‹Job›

↳ JobStore

## Index

### Constructors

- constructor

### Properties

- api
- bufferSize
- eventsBuffer
- isLoaded
- isLoading
- items
- limit
- selectedItemsIds

### Accessors

- query
- selectedItems

### Methods

- [Symbol.iterator]
- bindWatchEventsUpdater
- create
- createItem
- defaultSorting
- filterItemsOnLoad
- getAllByNs
- getByLabel
- getByName
- getByPath
- getChildPods
- getJobsByOwner
- getStatuses
- isSelected
- isSelectedAll
- load
- loadAll
- loadFromPath
- loadItem
- loadItems
- onWatchApiEvent
- remove
- removeItem
- removeSelectedItems
- reset
- resetSelection
- select
- sortItems
- subscribe
- toggleSelection
- toggleSelectionAll
- unselect
- update
- updateFromEventsBuffer
- updateItem

## Constructors

### constructor

+ new JobStore(): JobStore

Inherited from KubeObjectStore.constructor

Defined in src/renderer/kube-object.store.ts:15

Returns: JobStore

## Properties

### api

• api: KubeApi‹Job‹›› = jobApi

Overrides KubeObjectStore.api

Defined in src/renderer/components/+workloads-jobs/job.store.ts:10

### bufferSize

• bufferSize: number = 50000

Inherited from KubeObjectStore.bufferSize

Defined in src/renderer/kube-object.store.ts:15

### `Protected` eventsBuffer

• eventsBuffer: IObservableArray‹IKubeWatchEvent‹KubeJsonApiData›› = observable>([], { deep: false })

Inherited from KubeObjectStore.eventsBuffer

Defined in src/renderer/kube-object.store.ts:172

### isLoaded

• isLoaded: boolean = false

Inherited from KubeObjectStore.isLoaded

Defined in src/renderer/item.store.ts:17

### isLoading

• isLoading: boolean = false

Inherited from KubeObjectStore.isLoading

Defined in src/renderer/item.store.ts:16

### items

• items: IObservableArray‹T› = observable.array([], { deep: false })

Inherited from KubeObjectStore.items

Defined in src/renderer/item.store.ts:18

### `Optional` limit

• limit? : number

Inherited from KubeObjectStore.limit

Defined in src/renderer/kube-object.store.ts:14

### selectedItemsIds

• selectedItemsIds: ObservableMap‹string, boolean› = observable.map()

Inherited from KubeObjectStore.selectedItemsIds

Defined in src/renderer/item.store.ts:19

## Accessors

### query

• get query(): IKubeApiQueryParams

Inherited from KubeObjectStore.query

Defined in src/renderer/kube-object.store.ts:23

Returns: IKubeApiQueryParams

### selectedItems

• get selectedItems(): Job[]

Inherited from KubeObjectStore.selectedItems

Defined in src/renderer/item.store.ts:21

Returns: Job[]

## Methods

### [Symbol.iterator]

▸ [Symbol.iterator](): Generator‹T, void, undefined›

Inherited from KubeObjectStore.[Symbol.iterator]

Defined in src/renderer/item.store.ts:178

Returns: Generator‹T, void, undefined›

### `Protected` bindWatchEventsUpdater

▸ bindWatchEventsUpdater(`delay`: number): IReactionDisposer

Inherited from KubeObjectStore.bindWatchEventsUpdater

Defined in src/renderer/kube-object.store.ts:174

Parameters:

Name | Type | Default
--- | --- | ---
`delay` | number | 1000

Returns: IReactionDisposer

### create

▸ create(`params`: object, `data?`: Partial‹Job›): Promise‹Job›

Inherited from KubeObjectStore.create

Defined in src/renderer/kube-object.store.ts:143

Parameters:

▪ params: object

Name | Type
--- | ---
`name` | string
`namespace?` | string

▪`Optional` data: Partial‹Job›

Returns: Promise‹Job›

### `Protected` createItem

▸ createItem(`params`: object, `data?`: Partial‹Job›): Promise‹Job›

Inherited from KubeObjectStore.createItem

Overrides void

Defined in src/renderer/kube-object.store.ts:139

Parameters:

▪ params: object

Name | Type
--- | ---
`name` | string
`namespace?` | string

▪`Optional` data: Partial‹Job›

Returns: Promise‹Job›

### `Protected` defaultSorting

▸ defaultSorting(`item`: Job): string

Inherited from KubeObjectStore.defaultSorting

Defined in src/renderer/item.store.ts:14

Parameters:

Name | Type
--- | ---
`item` | Job

Returns: string

### `Protected` filterItemsOnLoad

▸ filterItemsOnLoad(`items`: Job[]): T[]

Inherited from KubeObjectStore.filterItemsOnLoad

Defined in src/renderer/kube-object.store.ts:84

Parameters:

Name | Type
--- | ---
`items` | Job[]

Returns: T[]

### getAllByNs

▸ getAllByNs(`namespace`: string | string[], `strict`: boolean): Job[]

Inherited from KubeObjectStore.getAllByNs

Defined in src/renderer/kube-object.store.ts:35

Parameters:

Name | Type | Default
--- | --- | ---
`namespace` | string | string[] | -
`strict` | boolean | false

Returns: Job[]

### getByLabel

▸ getByLabel(`labels`: string[] | object): Job[]

Inherited from KubeObjectStore.getByLabel

Defined in src/renderer/kube-object.store.ts:57

Parameters:

Name | Type
--- | ---
`labels` | string[] | object

Returns: Job[]

### getByName

▸ getByName(`name`: string, `namespace?`: string): Job

Inherited from KubeObjectStore.getByName

Overrides void

Defined in src/renderer/kube-object.store.ts:45

Parameters:

Name | Type
--- | ---
`name` | string
`namespace?` | string

Returns: Job

### getByPath

▸ getByPath(`path`: string): Job

Inherited from KubeObjectStore.getByPath

Defined in src/renderer/kube-object.store.ts:53

Parameters:

Name | Type
--- | ---
`path` | string

Returns: Job

### getChildPods

▸ getChildPods(`job`: Job): Pod[]

Defined in src/renderer/components/+workloads-jobs/job.store.ts:12

Parameters:

Name | Type
--- | ---
`job` | Job

Returns: Pod[]

### getJobsByOwner

▸ getJobsByOwner(`cronJob`: CronJob): Job‹›[]

Defined in src/renderer/components/+workloads-jobs/job.store.ts:16

Parameters:

Name | Type
--- | ---
`cronJob` | CronJob

Returns: Job‹›[]

### getStatuses

▸ getStatuses(`jobs?`: Job[]): object

Overrides KubeObjectStore.getStatuses

Defined in src/renderer/components/+workloads-jobs/job.store.ts:23

Parameters:

Name | Type
--- | ---
`jobs?` | Job[]

Returns: object

- failed: number = 0

- pending: number = 0

- running: number = 0

- succeeded: number = 0

### isSelected

▸ isSelected(`item`: Job): boolean

Inherited from KubeObjectStore.isSelected

Defined in src/renderer/item.store.ts:115

Parameters:

Name | Type
--- | ---
`item` | Job

Returns: boolean

### isSelectedAll

▸ isSelectedAll(`visibleItems`: Job[]): boolean

Inherited from KubeObjectStore.isSelectedAll

Defined in src/renderer/item.store.ts:151

Parameters:

Name | Type | Default
--- | --- | ---
`visibleItems` | Job[] | this.items

Returns: boolean

### load

▸ load(`params`: object): Promise‹Job›

Inherited from KubeObjectStore.load

Defined in src/renderer/kube-object.store.ts:118

Parameters:

▪ params: object

Name | Type
--- | ---
`name` | string
`namespace?` | string

Returns: Promise‹Job›

### loadAll

▸ loadAll(): Promise‹void›

Inherited from KubeObjectStore.loadAll

Overrides void

Defined in src/renderer/kube-object.store.ts:89

Returns: Promise‹void›

### loadFromPath

▸ loadFromPath(`resourcePath`: string): Promise‹T›

Inherited from KubeObjectStore.loadFromPath

Defined in src/renderer/kube-object.store.ts:133

Parameters:

Name | Type
--- | ---
`resourcePath` | string

Returns: Promise‹T›

### `Protected` loadItem

▸ loadItem(`params`: object): Promise‹Job›

Inherited from KubeObjectStore.loadItem

Overrides void

Defined in src/renderer/kube-object.store.ts:113

Parameters:

▪ params: object

Name | Type
--- | ---
`name` | string
`namespace?` | string

Returns: Promise‹Job›

### `Protected` loadItems

▸ loadItems(`allowedNamespaces?`: string[]): Promise‹Job[]›

Inherited from KubeObjectStore.loadItems

Overrides void

Defined in src/renderer/kube-object.store.ts:74

Parameters:

Name | Type
--- | ---
`allowedNamespaces?` | string[]

Returns: Promise‹Job[]›

### `Protected` onWatchApiEvent

▸ onWatchApiEvent(`evt`: IKubeWatchEvent): void

Inherited from KubeObjectStore.onWatchApiEvent

Defined in src/renderer/kube-object.store.ts:184

Parameters:

Name | Type
--- | ---
`evt` | IKubeWatchEvent

Returns: void

### remove

▸ remove(`item`: Job): Promise‹void›

Inherited from KubeObjectStore.remove

Defined in src/renderer/kube-object.store.ts:161

Parameters:

Name | Type
--- | ---
`item` | Job

Returns: Promise‹void›

### `Protected` removeItem

▸ removeItem(`item`: Job, `request`: function): Promise‹void›

Inherited from KubeObjectStore.removeItem

Defined in src/renderer/item.store.ts:109

Parameters:

▪ item: Job

▪ request: function

▸ (): Promise‹any›

Returns: Promise‹void›

### removeSelectedItems

▸ removeSelectedItems(): Promise‹void[]›

Inherited from KubeObjectStore.removeSelectedItems

Overrides void

Defined in src/renderer/kube-object.store.ts:167

Returns: Promise‹void[]›

### reset

▸ reset(): void

Inherited from KubeObjectStore.reset

Defined in src/renderer/item.store.ts:163

Returns: void

### resetSelection

▸ resetSelection(): void

Inherited from KubeObjectStore.resetSelection

Defined in src/renderer/item.store.ts:158

Returns: void

### select

▸ select(`item`: Job): void

Inherited from KubeObjectStore.select

Defined in src/renderer/item.store.ts:120

Parameters:

Name | Type
--- | ---
`item` | Job

Returns: void

### `Protected` sortItems

▸ sortItems(`items`: Job[], `sorting?`: function[], `order?`: "asc" | "desc"): Job[]

Inherited from KubeObjectStore.sortItems

Defined in src/renderer/item.store.ts:31

Parameters:

Name | Type | Default
--- | --- | ---
`items` | Job[] | this.items
`sorting?` | function[] | -
`order?` | "asc" | "desc" | -

Returns: Job[]

### subscribe

▸ subscribe(`apis`: KubeApi‹T›[]): (Anonymous function)

Inherited from KubeObjectStore.subscribe

Overrides void

Defined in src/renderer/kube-object.store.ts:180

Parameters:

Name | Type | Default
--- | --- | ---
`apis` | KubeApi‹T›[] | [this.api]

Returns: (Anonymous function)

### toggleSelection

▸ toggleSelection(`item`: Job): void

Inherited from KubeObjectStore.toggleSelection

Defined in src/renderer/item.store.ts:130

Parameters:

Name | Type
--- | ---
`item` | Job

Returns: void

### toggleSelectionAll

▸ toggleSelectionAll(`visibleItems`: Job[]): void

Inherited from KubeObjectStore.toggleSelectionAll

Defined in src/renderer/item.store.ts:140

Parameters:

Name | Type | Default
--- | --- | ---
`visibleItems` | Job[] | this.items

Returns: void

### unselect

▸ unselect(`item`: Job): void

Inherited from KubeObjectStore.unselect

Defined in src/renderer/item.store.ts:125

Parameters:

Name | Type
--- | ---
`item` | Job

Returns: void

### update

▸ update(`item`: Job, `data`: Partial‹Job›): Promise‹Job›

Inherited from KubeObjectStore.update

Defined in src/renderer/kube-object.store.ts:152

Parameters:

Name | Type
--- | ---
`item` | Job
`data` | Partial‹Job›

Returns: Promise‹Job›

### `Protected` updateFromEventsBuffer

▸ updateFromEventsBuffer(): void

Inherited from KubeObjectStore.updateFromEventsBuffer

Defined in src/renderer/kube-object.store.ts:190

Returns: void

### `Protected` updateItem

▸ updateItem(`item`: Job, `request`: function): Promise‹T›

Inherited from KubeObjectStore.updateItem

Defined in src/renderer/item.store.ts:99

Parameters:

▪ item: Job

▪ request: function

▸ (): Promise‹Job›

Returns: Promise‹T›