gitlab-org--gitlab-foss/app/services/check_gcp_project_billing_s...

12 lines
294 B
Ruby
Raw Normal View History

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