new KubernetesClient(options)
Kubernetes API Client
Create a new KubernetesClient object. If the given object is not of type ClientConfig then it is
used as input to the ClientConfig constructor to define a new one. Parses the Kubernetes API spec to generate
Endpoint properties.
Parameters:
| Name | Type | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object | module:client~ClientConfig | Sets
Properties
|
Throws:
Members
-
config :module:client~ClientConfig
-
Client object configuration
Type:
Methods
-
authenticate(flush, next) → {Promise.<module:client~ClientConfig>}
-
Authenticate with the oAuth server
The new token is added to the
ClientConfig. Returns aPromiseof the updatedClientConfigwith the new token parameter.Parameters:
Name Type Argument Default Description flushboolean <optional>
false Delete the client's token if it already exists
nextfunction <optional>
Node.js callback (replaces Promise output)
- See:
Returns:
- Type
- Promise.<module:client~ClientConfig>
-
createEndpoint(resource, spec)
-
Define a new API server resource endpoint. The returned object will be an instantiated
Endpointor a relevant subtype.Parameters:
Name Type Argument Description resourcestring Resource name
specEndpointSpecification <optional>
<nullable>
Endpoint specification for the resource
Properties
Name Type Argument Description namestring <optional>
<nullable>
Custom name for the endpoint property
- See:
-
defineAPI(api)
-
Create all resource endpoints defined in the given API specification
Parameters:
Name Type Description apiAPISpecification API endpoints to define