Specification of the Kubernetes API groups
API groups allow for easy expansion of the base Kubernetes API while maintaining compatibility with the main
resource endpoints. This library comes prepackaged with the extensions
API group from Kubernetes, available by
setting the beta
configuration property to the desired extensions version, or true
for the latest available
version. Below is an example for defining API groups for the client. Specify additional APISpecification
objects in the apis
configuration property to add custom API groups to the client.
Example
config.apis = [{ // Define name in the format: {API_GROUP}/{VERSION} name: 'fruits/v1' , spec: { // `apples` endpoint for resource of kind `Apple` apples: { kind: 'Apple' // Example of nested resource endpoint definitions , nested: [{ resource: 'peel' , methods: ['get', 'put'] // Defines `client.apples.getPeel` and `client.apples.putPeel` methods }, { resource: 'juice' , methods: ['get'] // Defines `client.oranges.getJuice` method }] }, // `oranges` endpoint for resources of kind `Orange` oranges: { kind: 'Orange' , nickname: 'oj' // Creates link to resource `client.oj === client.oranges` } } }];