/usr/lib/ruby/vendor_ruby/chef_zero/endpoints/role_environments_endpoint.rb is in chef-zero 4.5.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | require 'ffi_yajl'
require 'chef_zero/rest_base'
module ChefZero
module Endpoints
# /roles/NAME/environments
class RoleEnvironmentsEndpoint < RestBase
def get(request)
role = FFI_Yajl::Parser.parse(get_data(request, request.rest_path[0..3]), :create_additions => false)
json_response(200, [ '_default' ] + (role['env_run_lists'].keys || []))
end
end
end
end
|