Sha256: 7287b73e888b7ef97a0b7783f56a2584e317da33ae4723eb7d910bda6672434b

Contents?: true

Size: 766 Bytes

Versions: 23

Compression:

Stored size: 766 Bytes

Contents

module MnoEnterprise
  class Jpi::V1::AppInstancesController < Jpi::V1::BaseResourceController

    # GET /mnoe/jpi/v1/organization/1/apps.json?timestamp=151452452345
    def index
      @app_instances = parent_organization.app_instances.select do |i| 
        i.active? && i.updated_at > Time.at(timestamp) && can?(:access,i)
      end
    end
    
    # DELETE /mnoe/jpi/v1/app_instances/1
    def destroy
      app_instance = MnoEnterprise::AppInstance.find(params[:id])

      if app_instance
        authorize! :manage_app_instances, app_instance.owner
        MnoEnterprise::EventLogger.info('app_destroy', current_user.id, "App destroyed", app_instance.name,app_instance)
        app_instance.terminate
      end
      
      head :accepted
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
mno-enterprise-api-3.1.4 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-3.0.7 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-2.0.9 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-3.1.3 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-3.0.6 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-2.0.8 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-3.1.2 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-3.0.5 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-2.0.7 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-2.0.6 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-2.0.5 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-3.1.1 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-3.0.4 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-2.0.4 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-3.1.0 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-3.0.3 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-2.0.3 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-3.0.2 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-2.0.2 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb
mno-enterprise-api-3.0.1 app/controllers/mno_enterprise/jpi/v1/app_instances_controller.rb