Class: Api::V1::MediaController

Inherits:
BaseController show all
Defined in:
app/controllers/api/v1/media_controller.rb

Direct Known Subclasses

Api::V2::MediaController

Constant Summary collapse

PATH_INFO =

TRANSLATORS: API documentation - do not translate

"The path to the medium, can be a URL or a valid NFS server (exclusive of the architecture).\n\nfor example http://mirror.averse.net/centos/$version/os/$arch\nwhere $arch will be substituted for the host\\'s actual OS architecture and $version, $major and $minor\nwill be substituted for the version of the operating system.\n\nSolaris and Debian media may also use $release.\n"
OS_FAMILY_INFO =

TRANSLATORS: API documentation - do not translate

"The family that the operating system belongs to.\n\nAvailable families:\n\n\#{Operatingsystem.families.map { |f| \"* \" + f }.join(\"\\n\")}\n"

Instance Method Summary collapse

Methods included from Api::Version1

#api_version

Methods inherited from BaseController

#get_resource, #resource_class, #resource_name, #resource_scope

Methods included from Foreman::ThreadSession::Cleaner

#clear_thread, included

Instance Method Details

#createObject


49
50
51
52
# File 'app/controllers/api/v1/media_controller.rb', line 49

def create
  @medium = Medium.new(params[:medium])
  process_response @medium.save
end

#destroyObject


69
70
71
# File 'app/controllers/api/v1/media_controller.rb', line 69

def destroy
  process_response @medium.destroy
end

#indexObject


32
33
34
# File 'app/controllers/api/v1/media_controller.rb', line 32

def index
  @media = Medium.search_for(*search_options).paginate(paginate_options)
end

#showObject


39
40
# File 'app/controllers/api/v1/media_controller.rb', line 39

def show
end

#updateObject


62
63
64
# File 'app/controllers/api/v1/media_controller.rb', line 62

def update
  process_response @medium.update_attributes(params[:medium])
end