regions.rb 475 B

1234567891011121314151617181920212223242526
  1. # frozen_string_literal: true
  2. # buckets frozen_string_literal: true
  3. require 'neo4j'
  4. # Information on Region
  5. class Region
  6. include Neo4j::ActiveNode
  7. property :region, constraint: :unique
  8. end
  9. # Information on Availability Zones
  10. class Az
  11. include Neo4j::ActiveNode
  12. property :az, constraint: :unique
  13. has_one :out, :region, rel_class: :AzRegion
  14. end
  15. # Map AZs to regions
  16. class AzRegion
  17. include Neo4j::ActiveRel
  18. from_class :Az
  19. to_class :Region
  20. type :region
  21. end