Skip to content

Class: KubeApi<Object, Data>#

Renderer.K8sApi.KubeApi

Type parameters#

Name Type
Object extends KubeObject = KubeObject
Data extends KubeJsonApiDataFor<Object> = KubeJsonApiDataFor<Object>

Hierarchy#

  • KubeApi

PodsApi

NodesApi

DeploymentApi

IngressApi

PersistentVolumeClaimsApi

Table of contents#

Constructors#

Properties#

Accessors#

Methods#

Constructors#

constructor#

new KubeApi<Object, Data>(opts)

Type parameters#

Name Type
Object extends KubeObject<KubeObjectMetadata<KubeObjectScope>, unknown, unknown, Object> = KubeObject<KubeObjectMetadata<KubeObjectScope>, unknown, unknown>
Data extends KubeJsonApiData<KubeObjectMetadata<KubeObjectScope>, unknown, unknown, Data> = KubeJsonApiDataFor<Object>

Parameters#

Name Type
opts KubeApiOptions<Object, Data>

Properties#

apiBase#

apiBase: string


apiGroup#

apiGroup: string


apiPrefix#

apiPrefix: string


apiResource#

Readonly apiResource: string


apiVersion#

Readonly apiVersion: string


apiVersionPreferred#

apiVersionPreferred: undefined | string


doCheckPreferredVersion#

Protected Readonly doCheckPreferredVersion: boolean


fallbackApiBases#

Protected Readonly fallbackApiBases: undefined | string[]


fullApiPathname#

Protected Readonly fullApiPathname: string


isNamespaced#

Readonly isNamespaced: boolean


kind#

Readonly kind: string


objectConstructor#

Readonly objectConstructor: KubeObjectConstructor<Object, Data>


request#

Protected Readonly request: KubeJsonApi


resourceVersions#

Protected Readonly resourceVersions: Map<string, string>


watchDisposer#

Protected Readonly watchDisposer: undefined | Disposer

Accessors#

apiVersionWithGroup#

get apiVersionWithGroup(): string

Returns#

string

Methods#

checkPreferredVersion#

Protected checkPreferredVersion(): Promise<void>

Returns#

Promise<void>


create#

create(__namedParameters, partialData?): Promise<null | Object>

Parameters#

Name Type
__namedParameters Partial<ResourceDescriptor>
partialData? PartialDeep<Object>

Returns#

Promise<null | Object>


delete#

delete(__namedParameters): Promise<KubeJsonApiData<KubeJsonApiObjectMetadata<KubeObjectScope>, unknown, unknown>>

Parameters#

Name Type
__namedParameters DeleteResourceDescriptor

Returns#

Promise<KubeJsonApiData<KubeJsonApiObjectMetadata<KubeObjectScope>, unknown, unknown>>


get#

get(desc, query?): Promise<null | Object>

Parameters#

Name Type
desc ResourceDescriptor
query? KubeApiQueryParams

Returns#

Promise<null | Object>


getResourceVersion#

getResourceVersion(namespace?): undefined | string

Parameters#

Name Type Default value
namespace string ""

Returns#

undefined | string


getUrl#

getUrl(__namedParameters?, query?): string

Parameters#

Name Type
__namedParameters Partial<ResourceDescriptor>
query? Partial<KubeApiQueryParams>

Returns#

string


getWatchUrl#

getWatchUrl(namespace?, query?): string

Parameters#

Name Type Default value
namespace string ""
query KubeApiQueryParams {}

Returns#

string


list#

list(__namedParameters?, query?): Promise<null | Object[]>

Parameters#

Name Type
__namedParameters KubeApiListOptions
query? KubeApiQueryParams

Returns#

Promise<null | Object[]>


modifyWatchEvent#

Protected modifyWatchEvent(event): void

Parameters#

Name Type
event IKubeWatchEvent<KubeJsonApiData<KubeObjectMetadata<KubeObjectScope>, unknown, unknown>>

Returns#

void


normalizeQuery#

Protected normalizeQuery(query?): Partial<KubeApiQueryParams>

Parameters#

Name Type
query Partial<KubeApiQueryParams>

Returns#

Partial<KubeApiQueryParams>


parseResponse#

Protected parseResponse(data, namespace?): null | Object | Object[]

Parameters#

Name Type
data unknown
namespace? string

Returns#

null | Object | Object[]


patch#

patch(desc, data, strategy?): Promise<null | Object>

Parameters#

Name Type Default value
desc ResourceDescriptor undefined
data Patch | PartialDeep<Object> undefined
strategy KubeApiPatchType "strategic"

Returns#

Promise<null | Object>


refreshResourceVersion#

refreshResourceVersion(params?): Promise<null | Object[]>

Parameters#

Name Type
params? KubeApiListOptions

Returns#

Promise<null | Object[]>


setResourceVersion#

setResourceVersion(namespace?, newVersion): void

Parameters#

Name Type Default value
namespace string ""
newVersion string undefined

Returns#

void


update#

update(__namedParameters, data): Promise<null | Object>

Parameters#

Name Type
__namedParameters ResourceDescriptor
data PartialDeep<Object>

Returns#

Promise<null | Object>


watch#

watch(opts?): () => void

Parameters#

Name Type
opts KubeApiWatchOptions<Object, Data>

Returns#

fn

▸ (): void

Returns#

void