Class: KubeObject<Metadata, Status, Spec>#
Type parameters#
Name | Type |
---|---|
Metadata |
extends KubeObjectMetadata``KubeObjectMetadata |
Status |
any |
Spec |
any |
Hierarchy#
KubeObject
↳ Node
↳ CronJob
↳ Secret
↳ Service
↳ Endpoint
↳ Ingress
↳ Role
Implements#
ItemObject
Table of contents#
Constructors#
Properties#
Accessors#
Methods#
- delete
- getAge
- getAnnotations
- getFinalizers
- getId
- getLabels
- getName
- getNs
- getOwnerRefs
- getResourceVersion
- getSearchFields
- getTimeDiffFromNow
- patch
- toPlainObject
- update
- create
- isJsonApiData
- isJsonApiDataList
- isKubeJsonApiListMetadata
- isKubeJsonApiMetadata
- isNonSystem
- isPartialJsonApiData
- isPartialJsonApiMetadata
- stringifyLabels
Constructors#
constructor#
• new KubeObject<Metadata
, Status
, Spec
>(data
)
Type parameters#
Name | Type |
---|---|
Metadata |
extends KubeObjectMetadata``KubeObjectMetadata |
Status |
any |
Spec |
any |
Parameters#
Name | Type |
---|---|
data |
KubeJsonApiData |
Properties#
apiVersion#
• apiVersion: string
kind#
• kind: string
managedFields#
• Optional
managedFields: any
metadata#
• metadata: Metadata
spec#
• Optional
spec: Spec
status#
• Optional
status: Status
apiBase#
▪ Static
Optional
Readonly
apiBase: string
kind#
▪ Static
Optional
Readonly
kind: string
namespaced#
▪ Static
Optional
Readonly
namespaced: boolean
Accessors#
selfLink#
• get
selfLink(): string
Returns#
string
Methods#
delete#
▸ delete(params?
): Promise
<KubeJsonApiData
>
deprecated
use KubeApi.delete instead
Parameters#
Name | Type |
---|---|
params? |
JsonApiParams <any > |
Returns#
Promise
<KubeJsonApiData
>
getAge#
▸ getAge(humanize?
, compact?
, fromNow?
): string
| number
Parameters#
Name | Type | Default value |
---|---|---|
humanize |
boolean |
true |
compact |
boolean |
true |
fromNow |
boolean |
false |
Returns#
string
| number
getAnnotations#
▸ getAnnotations(filter?
): string
[]
Parameters#
Name | Type | Default value |
---|---|---|
filter |
boolean |
false |
Returns#
string
[]
getFinalizers#
▸ getFinalizers(): string
[]
Returns#
string
[]
getId#
▸ getId(): string
Returns#
string
Implementation of#
ItemObject.getId
getLabels#
▸ getLabels(): string
[]
Returns#
string
[]
getName#
▸ getName(): string
Returns#
string
Implementation of#
ItemObject.getName
getNs#
▸ getNs(): string
Returns#
string
getOwnerRefs#
▸ getOwnerRefs(): { apiVersion
: string
; blockOwnerDeletion
: boolean
; controller
: boolean
; kind
: string
; name
: string
; namespace
: string
; uid
: string
}[]
Returns#
{ apiVersion
: string
; blockOwnerDeletion
: boolean
; controller
: boolean
; kind
: string
; name
: string
; namespace
: string
; uid
: string
}[]
getResourceVersion#
▸ getResourceVersion(): string
Returns#
string
getSearchFields#
▸ getSearchFields(): string
[]
Returns#
string
[]
getTimeDiffFromNow#
▸ getTimeDiffFromNow(): number
Returns#
number
patch#
▸ patch(patch
): Promise
<KubeJsonApiData
>
deprecated
use KubeApi.patch instead
Parameters#
Name | Type |
---|---|
patch |
Patch |
Returns#
Promise
<KubeJsonApiData
>
toPlainObject#
▸ toPlainObject(): object
Returns#
object
update#
▸ update(data
): Promise
<KubeJsonApiData
>
Perform a full update (or more specifically a replace)
Note: this is brittle if data
is not actually partial (but instead whole).
As fields such as resourceVersion
will probably out of date. This is a
common race condition.
deprecated
use KubeApi.update instead
Parameters#
Name | Type |
---|---|
data |
Partial <KubeObject <Metadata , Status , Spec >> |
Returns#
Promise
<KubeJsonApiData
>
create#
▸ Static
create(data
): KubeObject
<KubeObjectMetadata
, any
, any
>
Parameters#
Name | Type |
---|---|
data |
KubeJsonApiData |
Returns#
KubeObject
<KubeObjectMetadata
, any
, any
>
isJsonApiData#
▸ Static
isJsonApiData(object
): object is KubeJsonApiData
Parameters#
Name | Type |
---|---|
object |
unknown |
Returns#
object is KubeJsonApiData
isJsonApiDataList#
▸ Static
isJsonApiDataList<T
>(object
, verifyItem
): object is KubeJsonApiDataList<T>
Type parameters#
Name |
---|
T |
Parameters#
Name | Type |
---|---|
object |
unknown |
verifyItem |
(val : unknown ) => val is T |
Returns#
object is KubeJsonApiDataList<T>
isKubeJsonApiListMetadata#
▸ Static
isKubeJsonApiListMetadata(object
): object is KubeJsonApiListMetadata
Parameters#
Name | Type |
---|---|
object |
unknown |
Returns#
object is KubeJsonApiListMetadata
isKubeJsonApiMetadata#
▸ Static
isKubeJsonApiMetadata(object
): object is KubeJsonApiMetadata
Parameters#
Name | Type |
---|---|
object |
unknown |
Returns#
object is KubeJsonApiMetadata
isNonSystem#
▸ Static
isNonSystem(item
): boolean
Parameters#
Name | Type |
---|---|
item |
KubeObject <KubeObjectMetadata , any , any > | KubeJsonApiData |
Returns#
boolean
isPartialJsonApiData#
▸ Static
isPartialJsonApiData(object
): object is Partial<KubeJsonApiData>
Parameters#
Name | Type |
---|---|
object |
unknown |
Returns#
object is Partial<KubeJsonApiData>
isPartialJsonApiMetadata#
▸ Static
isPartialJsonApiMetadata(object
): object is Partial<KubeJsonApiMetadata>
Parameters#
Name | Type |
---|---|
object |
unknown |
Returns#
object is Partial<KubeJsonApiMetadata>
stringifyLabels#
▸ Static
stringifyLabels(labels?
): string
[]
Parameters#
Name | Type |
---|---|
labels? |
Object |
Returns#
string
[]