new Endpoint(client, resource, nested, options)
Kubernetes API Endpoint
Define a new Endpoint object corresponding to a resource on the API
server. Specify options to override the library defaults for this endpoint.
This:
Parameters:
| Name | Type | Argument | Description | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
client |
module:client.KubernetesClient | Sets |
|||||||||||||||||
resource |
string | Sets |
|||||||||||||||||
nested |
Array.<NestedResourceDefinition> |
<optional> <nullable> |
List of nested endpoints |
||||||||||||||||
options |
object |
<optional> <nullable> |
Sets Properties
|
Members
-
client :module:client.KubernetesClient
-
Reference to the parent client object
Type:
-
<nullable> options :object
-
Endpoint option overrides
Type:
- object
-
resource :string
-
Server resource name
Type:
- string
Methods
-
create(body, opts, next) → {Promise.<KubernetesResource>}
-
Create new resource on the API server
Corresponds to the 'POST' http method.
This:
Parameters:
Name Type Argument Description bodyKubernetesResource | * Resource object to send
optsobject <optional>
<nullable>
Method options
nextfunction | * <optional>
Node.js callback (replaces Promise output)
Returns:
- Type
- Promise.<KubernetesResource>
-
delete(query, opts, next) → {Promise.<KubernetesResource>}
-
Delete resource on the API server
Corresponds to the 'DELETE' http method.
This:
Parameters:
Name Type Argument Description querystring Server resource resource
optsobject <optional>
<nullable>
Method options
nextfunction | * <optional>
Node.js callback (replaces Promise output)
Returns:
- Type
- Promise.<KubernetesResource>
-
get(query, opts, next) → {Promise.<(KubernetesResource|KubernetesList)>}
-
Request resources from the API server
Corresponds to the 'GET' http method.
Missing parameters can be stripped from the beginning of the parameter list and will be checked for type appropriately. If
queryis not defined, the returnedPromisewill be for a KubernetesList. Otherwise it will be aPromisefor a KubernetesResource.This:
Parameters:
Name Type Argument Description querystring <optional>
<nullable>
Server resource name
optsobject <optional>
<nullable>
Method options
nextfunction | * <optional>
Node.js callback (replaces Promise output)
Returns:
- Type
- Promise.<(KubernetesResource|KubernetesList)>
-
patch(query, body, opts, next) → {Promise.<KubernetesResource>}
-
Partially update resource on the API server
Corresponds to the 'PATCH' http method.
Currently only the
application/strategic-merge-patch+jsoncontent type is supported by default, but other types may be used by manually setting theContent-Typeheader in the method options.This:
Parameters:
Name Type Argument Description querystring Server resource resource
bodyobject Resource patch to send
optsobject <optional>
<nullable>
Method options
nextfunction | * <optional>
Node.js callback (replaces Promise output)
Returns:
- Type
- Promise.<KubernetesResource>
-
update(query, body, opts, next) → {Promise.<KubernetesResource>}
-
Update resource on the API server
Corresponds to the 'PUT' http method.
This:
Parameters:
Name Type Argument Description querystring Server resource resource
bodyKubernetesResource | * Resource object to send
optsobject <optional>
<nullable>
Method options
nextfunction | * <optional>
Node.js callback (replaces Promise output)
Returns:
- Type
- Promise.<KubernetesResource>
-
watch(query, opts, next) → {module.endpoints~WatchEmitter}
-
Watch server resource(s) for changes
Corresponds to the 'GET' http method with the
watchquery parameter set.Gets the current state of the requested resources and returns a custom event emitter (see below) with the current state set to the
initialStateproperty. Watch events will not be received until thestartmethod is called on the emitter. This allows the user to define all event listeners before requesting events from the API server and prevent events from being missed during the initial setup.Missing parameters can be stripped from the beginning of the parameter list and will be checked for type appropriately. If query is not defined, the watched resource will be a KubernetesList. Otherwise it will be a KubernetesResource.
This:
Parameters:
Name Type Argument Description querystring <optional>
<nullable>
Server resource resource
optsobject | * <optional>
Method options
Properties
Name Type Argument Default Description verboseboolean <optional>
false Return full response instead of body only
childstring <optional>
<nullable>
Name of nested child resource
nextfunction | * <optional>
Node.js callback (replaces Promise output)
Returns:
- Type
- module.endpoints~WatchEmitter