Options
All
  • Public
  • Public/Protected
  • All
Menu

Dynamically construct Kubernetes API request URIs so client does not have to know what type of object it is acting on, create the appropriate client, and call the appropriate method.

Hierarchy

  • ApisApi
    • K8sObjectApi

Index

Constructors

constructor

  • Parameters

    • Optional basePath: string

    Returns K8sObjectApi

Properties

Protected _basePath

_basePath: string

Protected _defaultHeaders

_defaultHeaders: any

Protected _useQuerystring

_useQuerystring: boolean

Protected authentications

authentications: { BearerToken: ApiKeyAuth; default: Authentication }

Type declaration

  • BearerToken: ApiKeyAuth
  • default: Authentication

basePath

basePath: string

defaultHeaders

defaultHeaders: any

Protected interceptors

interceptors: Interceptor[]

useQuerystring

useQuerystring: boolean

Methods

addInterceptor

  • addInterceptor(interceptor: Interceptor): void
  • Parameters

    • interceptor: Interceptor

    Returns void

baseRequestOptions

create

delete

getAPIVersions

  • getAPIVersions(options?: { headers: {} }): Promise<{ body: V1APIGroupList; response: IncomingMessage }>
  • get available API versions

    Parameters

    • Optional options: { headers: {} }
      • headers: {}
        • [name: string]: string

    Returns Promise<{ body: V1APIGroupList; response: IncomingMessage }>

list

patch

read

replace

Private requestPromise

resource

  • resource(apiVersion: string, kind: string): Promise<V1APIResource | undefined>
  • Get metadata from Kubernetes API for resources described by kind and apiVersion. If it is unable to find the resource kind under the provided apiVersion, undefined is returned.

    Parameters

    • apiVersion: string
    • kind: string

    Returns Promise<V1APIResource | undefined>

setApiKey

  • setApiKey(key: ApisApiApiKeys, value: string): void
  • Parameters

    • key: ApisApiApiKeys
    • value: string

    Returns void

setDefaultAuthentication

  • setDefaultAuthentication(auth: Authentication): void

specUriPath

  • Use spec information to construct resource URI path. If any required information in not provided, an Error is thrown. If an apiVersion is not provided, "v1" is used. If a metadata.namespace is not provided for a request that requires one, "default" is used.

    Parameters

    • spec: KubernetesObject

      resource spec which must kind and apiVersion properties

    • action: K8sApiAction

      API action, see K8sApiAction

    Returns Promise<string>

    tail of resource-specific URI

Static Private methodHeaders

  • methodHeaders(method: string): {}

Object literals

Static Private Readonly defaultDeleteBody

defaultDeleteBody: object

propagationPolicy

propagationPolicy: string = "Background"

Generated using TypeDoc