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

Nikita

Action "lxc.delete"

Delete a Linux Container using lxc.

Example

const {$status} = await nikita.lxc.delete({
  container: "myubuntu"
})
console.info(`Container was deleted: ${$status}`)

Schema definitions

definitions =
  config:
    type: 'object'
    properties:
      'container':
        $ref: 'module://@nikitajs/lxd/src/init#/definitions/config/properties/container'
      'force':
        type: 'boolean'
        default: false
        description: '''
        If true, the container will be deleted even if running.
        '''
    required: ['container']

Handler

handler = ({config}) ->
  await @execute
    command: """
    lxc info #{config.container} > /dev/null || exit 42
    #{[
      'lxc',
      'delete',
      config.container
      "--force" if config.force
    ].join ' '}
    """
    code: [0, 42]

Exports

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

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