Class: KubeApi<T>#
Type parameters#
Name | Type |
---|---|
T |
extends KubeObject |
Hierarchy#
KubeApi
↳ PodsApi
↳ NodesApi
Table of contents#
Constructors#
Properties#
- apiBase
- apiGroup
- apiPrefix
- apiResource
- apiVersion
- apiVersionPreferred
- isNamespaced
- kind
- objectConstructor
- options
- request
- resourceVersions
- watchDisposer
Accessors#
Methods#
- checkPreferredVersion
- create
- delete
- get
- getResourceVersion
- getUrl
- getWatchUrl
- list
- modifyWatchEvent
- normalizeQuery
- parseResponse
- patch
- refreshResourceVersion
- setResourceVersion
- update
- watch
Constructors#
constructor#
• new KubeApi<T
>(options
)
Type parameters#
Name | Type |
---|---|
T |
extends KubeObject <KubeObjectMetadata , any , any , T > |
Parameters#
Name | Type |
---|---|
options |
IKubeApiOptions <T > |
Properties#
apiBase#
• apiBase: string
apiGroup#
• apiGroup: string
apiPrefix#
• apiPrefix: string
apiResource#
• Readonly
apiResource: string
apiVersion#
• Readonly
apiVersion: string
apiVersionPreferred#
• Optional
apiVersionPreferred: string
isNamespaced#
• Readonly
isNamespaced: boolean
kind#
• Readonly
kind: string
objectConstructor#
• objectConstructor: KubeObjectConstructor
<T
>
options#
• Protected
options: IKubeApiOptions
<T
>
request#
• Protected
request: KubeJsonApi
resourceVersions#
• Protected
resourceVersions: Map
<string
, string
>
watchDisposer#
• Protected
watchDisposer: () => void
Type declaration#
▸ (): void
Returns#
void
Accessors#
apiVersionWithGroup#
• get
apiVersionWithGroup(): string
Returns#
string
Methods#
checkPreferredVersion#
▸ Protected
checkPreferredVersion(): Promise
<void
>
Returns#
Promise
<void
>
create#
▸ create(__namedParameters
, data?
): Promise
<T
>
Parameters#
Name | Type |
---|---|
__namedParameters |
Partial <ResourceDescriptor > |
data? |
PartialKubeObject <T > |
Returns#
Promise
<T
>
delete#
▸ delete(__namedParameters
): Promise
<KubeJsonApiData
>
Parameters#
Name | Type |
---|---|
__namedParameters |
DeleteResourceDescriptor |
Returns#
Promise
<KubeJsonApiData
>
get#
▸ get(desc
, query?
): Promise
<T
>
Parameters#
Name | Type |
---|---|
desc |
ResourceDescriptor |
query? |
IKubeApiQueryParams |
Returns#
Promise
<T
>
getResourceVersion#
▸ getResourceVersion(namespace?
): string
Parameters#
Name | Type | Default value |
---|---|---|
namespace |
string |
"" |
Returns#
string
getUrl#
▸ getUrl(__namedParameters?
, query?
): string
Parameters#
Name | Type |
---|---|
__namedParameters |
Partial <ResourceDescriptor > |
query? |
Partial <IKubeApiQueryParams > |
Returns#
string
getWatchUrl#
▸ getWatchUrl(namespace?
, query?
): string
Parameters#
Name | Type | Default value |
---|---|---|
namespace |
string |
"" |
query |
IKubeApiQueryParams |
{} |
Returns#
string
list#
▸ list(__namedParameters?
, query?
): Promise
<T
[]>
Parameters#
Name | Type |
---|---|
__namedParameters |
KubeApiListOptions |
query? |
IKubeApiQueryParams |
Returns#
Promise
<T
[]>
modifyWatchEvent#
▸ Protected
modifyWatchEvent(event
): void
Parameters#
Name | Type |
---|---|
event |
IKubeWatchEvent <KubeJsonApiData > |
Returns#
void
normalizeQuery#
▸ Protected
normalizeQuery(query?
): Partial
<IKubeApiQueryParams
>
Parameters#
Name | Type |
---|---|
query |
Partial <IKubeApiQueryParams > |
Returns#
Partial
<IKubeApiQueryParams
>
parseResponse#
▸ Protected
parseResponse(data
, namespace?
): T
| T
[]
Parameters#
Name | Type |
---|---|
data |
unknown |
namespace? |
string |
Returns#
T
| T
[]
patch#
▸ patch(desc
, data?
, strategy?
): Promise
<T
>
Parameters#
Name | Type | Default value |
---|---|---|
desc |
ResourceDescriptor |
undefined |
data? |
Patch | Partial <T > |
undefined |
strategy |
KubeApiPatchType |
"strategic" |
Returns#
Promise
<T
>
refreshResourceVersion#
▸ refreshResourceVersion(params?
): Promise
<T
[]>
Parameters#
Name | Type |
---|---|
params? |
KubeApiListOptions |
Returns#
Promise
<T
[]>
setResourceVersion#
▸ setResourceVersion(namespace?
, newVersion
): void
Parameters#
Name | Type | Default value |
---|---|---|
namespace |
string |
"" |
newVersion |
string |
undefined |
Returns#
void
update#
▸ update(__namedParameters
, data
): Promise
<T
>
Parameters#
Name | Type |
---|---|
__namedParameters |
ResourceDescriptor |
data |
PartialKubeObject <T > |
Returns#
Promise
<T
>
watch#
▸ watch(opts?
): () => void
Parameters#
Name | Type |
---|---|
opts |
KubeApiWatchOptions |
Returns#
fn
▸ (): void
Returns#
void