Sha256: 4f3c39feef90bbbf834ae6505de71151a11b933185777c9990d28048fdc4df9a

Contents?: true

Size: 829 Bytes

Versions: 2

Compression:

Stored size: 829 Bytes

Contents

Rails.application.routes.draw do
  namespace :api, :defaults => { :format => 'json' } do
    scope '(:apiv)', :module => :v2,
                     :defaults => { :apiv => 'v2' },
                     :apiv => /v1|v2/,
                     :constraints => ApiConstraints.new(:version => 2, :default => true) do
      constraints(:host_id => /[^\/]+/) do
        resources :hosts, :only => [] do
          constraints(:id => /[^\/]+/) do
            resources :snapshots, except: [:new, :edit] do
              put :revert, :on => :collection
            end
          end
        end
      end
    end
  end

  constraints(host_id: %r{[^\/]+}) do
    resources :hosts, only: [] do
      resources :snapshots, module: 'foreman_snapshot_management' do
        member do
          put :revert
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
foreman_snapshot_management-1.2.0 config/routes.rb
foreman_snapshot_management-1.1.0 config/routes.rb