Documentationcurrent version
Help us improve the docs by fixing typos and proposing enhancements.

Nikita

Action "lxc.config.device.exists"

Check if the device exists in a container.

Output

  • $status True if the device exist, false otherwise.

Add a network interface

const {$status, config} = await nikita.lxc.config.device.exists({
  container: "my_container",
  device: 'eth0'
})
console.info($status ? `device exists, type is ${config.type}` : 'device missing')

Schema definitions

definitions =
  config:
    type: 'object'
    properties:
      'container':
        $ref: 'module://@nikitajs/lxd/src/init#/definitions/config/properties/container'
      'device':
        type: 'string'
        description: '''
        Name of the device in LXD configuration, for example "eth0".
        '''
    required: ['container', 'device']

Handler

handler = ({config}) ->
  {properties} = await @lxc.config.device.show
    container: config.container
    device: config.device
  exists: !!properties, properties: properties

Exports

module.exports =
  handler: handler
  metadata:
    definitions: definitions
Edit on GitHub
Navigate
About

Nikita is an open source project hosted on GitHub and developed by Adaltas.