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 aPromise
of the updatedClientConfig
with the new token parameter.Parameters:
Name Type Argument Default Description flush
boolean <optional>
false Delete the client's token if it already exists
next
function <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
Endpoint
or a relevant subtype.Parameters:
Name Type Argument Description resource
string Resource name
spec
EndpointSpecification <optional>
<nullable>
Endpoint specification for the resource
Properties
Name Type Argument Description name
string <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 api
APISpecification API endpoints to define