Method: Api::V2::ContainersController#destroy

Defined in:
app/controllers/api/v2/containers_controller.rb

#destroyObject



88
89
90
91
92
93
94
95
96
97
98
# File 'app/controllers/api/v2/containers_controller.rb', line 88

def destroy
  deleted_identifier = ForemanDocker::ContainerRemover.remove_unmanaged(
    @container.compute_resource_id,
    @container.uuid)

  if deleted_identifier
    process_response @container.destroy
  else
    render :json => { :error => 'Could not delete container on Docker host' }, :status => :precondition_failed
  end
end