Skip to content

# Class: KubeApi ‹T›

## Type parameters

▪ T: KubeObject

## Hierarchy

- KubeApi

↳ PodsApi

↳ NodesApi

↳ DeploymentApi

↳ IngressApi

↳ PersistentVolumeClaimsApi

## Index

### Constructors

- constructor

### Properties

- apiBase
- apiGroup
- apiPrefix
- apiResource
- apiVersion
- apiVersionPreferred
- isNamespaced
- kind
- objectConstructor
- options
- request
- resourceVersions
- parseApi

### Accessors

- apiVersionWithGroup

### Methods

- checkPreferredVersion
- create
- delete
- get
- getResourceVersion
- getUrl
- getWatchUrl
- list
- normalizeQuery
- parseResponse
- refreshResourceVersion
- setResourceVersion
- update
- watch
- watchAll

## Constructors

### constructor

+ new KubeApi(`options`: IKubeApiOptions‹T›): KubeApi

Defined in src/renderer/api/kube-api.ts:114

Parameters:

Name | Type
--- | ---
`options` | IKubeApiOptions‹T›

Returns: KubeApi

## Properties

### apiBase

• apiBase: string

Defined in src/renderer/api/kube-api.ts:104

### apiGroup

• apiGroup: string

Defined in src/renderer/api/kube-api.ts:106

### apiPrefix

• apiPrefix: string

Defined in src/renderer/api/kube-api.ts:105

### apiResource

• apiResource: string

Defined in src/renderer/api/kube-api.ts:109

### apiVersion

• apiVersion: string

Defined in src/renderer/api/kube-api.ts:107

### `Optional` apiVersionPreferred

• apiVersionPreferred? : string

Defined in src/renderer/api/kube-api.ts:108

### isNamespaced

• isNamespaced: boolean

Defined in src/renderer/api/kube-api.ts:110

### kind

• kind: string

Defined in src/renderer/api/kube-api.ts:103

### objectConstructor

• objectConstructor: IKubeObjectConstructor‹T›

Defined in src/renderer/api/kube-api.ts:112

### `Protected` options

• options: IKubeApiOptions‹T›

Defined in src/renderer/api/kube-api.ts:116

### `Protected` request

• request: KubeJsonApi

Defined in src/renderer/api/kube-api.ts:113

### `Protected` resourceVersions

• resourceVersions: Map‹string, string› = new Map()

Defined in src/renderer/api/kube-api.ts:114

### `Static` parseApi

▪ parseApi: parseKubeApi = parseKubeApi

Defined in src/renderer/api/kube-api.ts:95

## Accessors

### apiVersionWithGroup

• get apiVersionWithGroup(): string

Defined in src/renderer/api/kube-api.ts:144

Returns: string

## Methods

### `Protected` checkPreferredVersion

▸ checkPreferredVersion(): Promise‹void›

Defined in src/renderer/api/kube-api.ts:206

Returns: Promise‹void›

### create

▸ create(`__namedParameters`: object, `data?`: Partial‹T›): Promise‹T›

Defined in src/renderer/api/kube-api.ts:326

Parameters:

▪`Default value` __namedParameters: object= {}

Name | Type | Default
--- | --- | ---
`name` | string | ""
`namespace` | string | "default"

▪`Optional` data: Partial‹T›

Returns: Promise‹T›

### delete

▸ delete(`__namedParameters`: object): Promise‹KubeJsonApiData›

Defined in src/renderer/api/kube-api.ts:353

Parameters:

▪ __namedParameters: object

Name | Type | Default
--- | --- | ---
`name` | string | ""
`namespace` | string | "default"

Returns: Promise‹KubeJsonApiData›

### get

▸ get(`__namedParameters`: object, `query?`: IKubeApiQueryParams): Promise‹T›

Defined in src/renderer/api/kube-api.ts:318

Parameters:

▪`Default value` __namedParameters: object= {}

Name | Type | Default
--- | --- | ---
`name` | string | ""
`namespace` | string | "default"

▪`Optional` query: IKubeApiQueryParams

Returns: Promise‹T›

### getResourceVersion

▸ getResourceVersion(`namespace`: string): string

Defined in src/renderer/api/kube-api.ts:239

Parameters:

Name | Type | Default
--- | --- | ---
`namespace` | string | ""

Returns: string

### getUrl

▸ getUrl(`__namedParameters`: object, `query?`: Partial‹IKubeApiQueryParams›): string

Defined in src/renderer/api/kube-api.ts:247

Parameters:

▪`Default value` __namedParameters: object= {}

Name | Type | Default
--- | --- | ---
`name` | string | ""
`namespace` | string | ""

▪`Optional` query: Partial‹IKubeApiQueryParams›

Returns: string

### getWatchUrl

▸ getWatchUrl(`namespace`: string, `query`: IKubeApiQueryParams): string

Defined in src/renderer/api/kube-api.ts:360

Parameters:

Name | Type | Default
--- | --- | ---
`namespace` | string | ""
`query` | IKubeApiQueryParams | {}

Returns: string

### list

▸ list(`__namedParameters`: object, `query?`: IKubeApiQueryParams): Promise‹T[]›

Defined in src/renderer/api/kube-api.ts:310

Parameters:

▪`Default value` __namedParameters: object= {}

Name | Type | Default
--- | --- | ---
`namespace` | string | ""

▪`Optional` query: IKubeApiQueryParams

Returns: Promise‹T[]›

### `Protected` normalizeQuery

▸ normalizeQuery(`query`: Partial‹IKubeApiQueryParams›): object

Defined in src/renderer/api/kube-api.ts:259

Parameters:

Name | Type | Default
--- | --- | ---
`query` | Partial‹IKubeApiQueryParams› | {}

Returns: object

### `Protected` parseResponse

▸ parseResponse(`data`: KubeJsonApiData | KubeJsonApiData[] | KubeJsonApiDataList, `namespace?`: string): any

Defined in src/renderer/api/kube-api.ts:271

Parameters:

Name | Type
--- | ---
`data` | KubeJsonApiData | KubeJsonApiData[] | KubeJsonApiDataList
`namespace?` | string

Returns: any

### refreshResourceVersion

▸ refreshResourceVersion(`params?`: object): Promise‹T[]›

Defined in src/renderer/api/kube-api.ts:243

Parameters:

▪`Optional` params: object

Name | Type
--- | ---
`namespace` | string

Returns: Promise‹T[]›

### setResourceVersion

▸ setResourceVersion(`namespace`: string, `newVersion`: string): void

Defined in src/renderer/api/kube-api.ts:235

Parameters:

Name | Type | Default
--- | --- | ---
`namespace` | string | ""
`newVersion` | string | -

Returns: void

### update

▸ update(`__namedParameters`: object, `data?`: Partial‹T›): Promise‹T›

Defined in src/renderer/api/kube-api.ts:344

Parameters:

▪`Default value` __namedParameters: object= {}

Name | Type | Default
--- | --- | ---
`name` | string | ""
`namespace` | string | "default"

▪`Optional` data: Partial‹T›

Returns: Promise‹T›

### watch

▸ watch(): function

Defined in src/renderer/api/kube-api.ts:368

Returns: function

▸ (): void

### `Static` watchAll

▸ watchAll(...`apis`: KubeApi[]): (Anonymous function)

Defined in src/renderer/api/kube-api.ts:97

Parameters:

Name | Type
--- | ---
`...apis` | KubeApi[]

Returns: (Anonymous function)