controller/app/controllers/cartridges_controller.rb
##
# Retrieve details for all available cartridge
#
# URL: /cartridges
#
# @note This method may or may not require authenticated access depending on the authentication plugin that is configured.
#
# Action: GET
# @return [RestReply<Array<RestCartridge>>] Array of cartridge objects
Retrieve details for all available cartridge
URL: /cartridges
Retrieve details for all available cartridge URL : / cartridges
def index
    searching = false
    carts = CartridgeType.all
    if name = params[:name].presence
      if (ComponentInstance.check_name!(name) rescue nil)
        carts = carts.order_by(:name => 1).where(name: name)
      else
        carts = []
      end
    else
      carts = carts.active.order_by(:name => 1)
      feature = params[:feature].presence
      category = params[:category].presence || params[:id].presence
      if ['standalone','embedded'].include?(feature)
        category = feature
        feature = nil
      end
      category = 'web_framework' if category == 'standalone'
      if category == "embedded"
        searching = true
        carts = carts.not_in(categories: 'web_framework')
      elsif category
        searching = true
        carts = carts.in(categories: category)
      elsif features = feature || params[:features].presence
        searching = true
        carts = carts.in(provides: features)
      end
    end
    carts = carts.sort_by(&OpenShift::Cartridge::NAME_PRECEDENCE_ORDER)
    render_success(:ok, "cartridges", carts.map{ |c| get_rest_cartridge(c) }, "#{searching ? "Searching" : "Listing"} cartridges")
  end
def index searching = false carts = CartridgeType . all if name = params [ :name ] . presence if ( ComponentInstance . check_name! ( name ) rescue nil ) carts = carts . order_by ( :name => 1 ) . where ( name : name ) else carts = [ ] end else carts = carts . active . order_by ( :name => 1 ) feature = params [ :feature ] . presence category = params [ :category ] . presence || params [ :id ] . presence if [ 'standalone' , 'embedded' ] . include? ( feature ) category = feature feature = nil end category = 'web_framework' if category == 'standalone' if category == "embedded" searching = true carts = carts . not_in ( categories : 'web_framework' ) elsif category searching = true carts = carts . in ( categories : category ) elsif features = feature || params [ :features ] . presence searching = true carts = carts . in ( provides : features ) end end carts = carts . sort_by ( & OpenShift :: Cartridge :: NAME_PRECEDENCE_ORDER ) render_success ( :ok , "cartridges" , carts . map { | c | get_rest_cartridge ( c ) } , "#{searching ? "Searching" : "Listing"} cartridges" ) end
Retrieve details for all available cartridge
URL: /cartridges
Retrieve details for all available cartridge URL : / cartridges
# Legacy support for cartridges/standalone|embedded
Array of cartridge objects
Array of cartridge objects
RestReply<Array<RestCartridge>>
note
This method may or may not require authenticated access depending on the authentication plugin that is configured. Action: GET
This method may or may not require authenticated access depending on the authentication plugin that is configured . Action : GET