gitlab-org--gitlab-foss/app/services/check_gcp_project_billing_service.rb

12 lines
294 B
Ruby
Raw Normal View History

2017-12-15 20:12:44 -05:00
class CheckGcpProjectBillingService
2017-12-15 19:44:36 -05:00
def execute(token)
client = GoogleApi::CloudPlatform::Client.new(token, nil)
client.projects_list.select do |project|
2018-01-10 09:23:22 -05:00
begin
client.projects_get_billing_info(project.project_id).billing_enabled
rescue
end
2017-12-15 19:44:36 -05:00
end
end
end