debian-mirror-gitlab/app/services/check_gcp_project_billing_service.rb

12 lines
294 B
Ruby
Raw Normal View History

2018-03-17 18:26:18 +05:30
class CheckGcpProjectBillingService
def execute(token)
client = GoogleApi::CloudPlatform::Client.new(token, nil)
client.projects_list.select do |project|
begin
client.projects_get_billing_info(project.project_id).billing_enabled
rescue
end
end
end
end