def index
domain_id = params[:domain_id]
domain = Domain.get(@cloud_user, domain_id)
return render_error(:not_found, "Domain '#{domain_id}' not found", 127,
"LIST_APPLICATIONS") if !domain || !domain.hasAccess?(@cloud_user)
applications = Application.find_all(@cloud_user)
apps = Array.new
applications.each do |application|
if application.domain.uuid = domain.uuid
if $requested_api_version == 1.0
app = RestApplication10.new(application, get_url, nolinks)
else
app = RestApplication12.new(application, get_url, nolinks)
end
apps.push(app)
end
end if applications
render_success(:ok, "applications", apps, "LIST_APPLICATIONS", "Found #{apps.length} applications for domain '#{domain_id}'")
end