app/controllers/api/v1/node/containers_controller.rb
# GET /scheduled
# Get all scheduled containers within a particular node
GET /scheduled
Get all scheduled containers within a particular node
GET / scheduled Get all scheduled containers within a particular node
def scheduled
    @containers = current_node.containers.
      where(status: [
        ::Container.statuses[:scheduled],
        ::Container.statuses[:schedule_deletion],
      ]).
      order(Arel.sql 'CASE WHEN status = \'SCHEDULE_DELETION\' THEN 1 WHEN status = \'SCHEDULED\' THEN 2 END').
      order('last_status_update_at ASC')
    render json: ::Api::V1::Node::ContainerSerializer.new(@containers).to_h
  end
def scheduled @containers = current_node . containers . where ( status : [ :: Container . statuses [ :scheduled ] , :: Container . statuses [ :schedule_deletion ] , ] ) . order ( Arel . sql 'CASE WHEN status = \'SCHEDULE_DELETION\' THEN 1 WHEN status = \'SCHEDULED\' THEN 2 END' ) . order ( 'last_status_update_at ASC' ) render json : :: Api :: V1 :: Node :: ContainerSerializer . new ( @containers ) . to_h end
GET /scheduled
Get all scheduled containers within a particular node
GET / scheduled Get all scheduled containers within a particular node