Rails.application.routes.draw do root :to => 'mini_environments#index' scope :setup do get '/', to: 'setup#show', as: 'setup' resources :govuk_guix_revisions, controller: 'govuk_guix/revisions', only: %i[show destroy] post 'enqueue_fetch_govuk_guix_revision', to: 'govuk_guix/revisions#enqueue_fetch_revision', as: 'enqueue_fetch_govuk_guix_revision' scope '/backends' do resources :terraform_aws, as: 'terraform_aws_backends', controller: 'backends/terraform_aws', only: %i[create new show update destroy] do member do post 'perform_action' get 'in_use_store_paths' end end resources :terraform_aws_using_ami, as: 'terraform_aws_using_ami_backends', controller: 'backends/terraform_aws_using_ami', only: %i[create new show update destroy] do member do post 'perform_action' end end resources :terraform_libvirt, as: 'terraform_libvirt_backends', controller: 'backends/terraform_libvirt', only: %i[create new show update destroy] do member do post 'perform_action' get 'in_use_store_paths' end end end end resources :que_jobs, only: %i[index] do member do post 'cancel' post 'retry_now' end end get( 'terraform_states', to: 'terraform_http_backend#index', as: 'terraform_states' ) scope :terraform_http_backend do get( '*state_id/history', to: 'terraform_http_backend#show_history', as: 'terraform_http_backend_show_history' ) get( '*state_id/history/*index', to: 'terraform_http_backend#show_by_index', as: 'terraform_http_backend_show_by_index' ) get( '*state_id', to: 'terraform_http_backend#show', format: false, as: 'terraform_http_backend' ) post '*state_id', to: 'terraform_http_backend#create', format: false delete '*state_id', to: 'terraform_http_backend#destroy', format: false end if Rails.env.development? mount GovukAdminTemplate::Engine, at: "/style-guide" end resources :mini_environments, path: '/' do post '/', to: 'mini_environments#perform_action', as: 'perform_action' member do get 'services' put 'services' end end end