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 _useQuerystring

_useQuerystring: boolean

Protected authentications

authentications: object

Type declaration

  • BearerToken: ApiKeyAuth
  • default: Authentication

basePath

basePath: string

Protected defaultHeaders

defaultHeaders: any

useQuerystring

useQuerystring: boolean

Methods

baseRequestOptions

  • Generate request options. Largely copied from the common elements of @kubernetes/client-node action methods.

    Parameters

    Returns UriOptions & CoreOptions

create

delete

getAPIVersions

  • getAPIVersions(options?: object): Promise<object>
  • get available API versions

    Parameters

    • Optional options: object
      • headers: object
        • [name: string]: string

    Returns Promise<object>

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 or an error occurs, 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
  • Parameters

    • auth: Authentication

    Returns void

specUriPath

  • specUriPath(spec: KubernetesObject, action: K8sApiAction): Promise<string>
  • 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
  • Return default headers based on action.

    Parameters

    • method: string

    Returns object

    • [name: string]: string

Object literals

Static Private defaultDeleteBody

defaultDeleteBody: object

propagationPolicy

propagationPolicy: string = "Background"

Generated using TypeDoc